Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 14 commits
  • 46 files changed
  • 0 commit comments
  • 1 contributor
Showing with 2,665 additions and 514 deletions.
  1. +1 −1 Gemfile
  2. +5 −5 Gemfile.lock
  3. +16 −2 app/assets/javascripts/application.js
  4. +2 −2 app/assets/javascripts/pages.js
  5. +1 −0 app/assets/stylesheets/application.css
  6. +4 −0 app/assets/stylesheets/base/base.css.less
  7. +106 −22 app/assets/stylesheets/base/leagues.css.less
  8. +1 −0 app/assets/stylesheets/oia.css
  9. +5 −3 app/controllers/base_league_controller.rb
  10. +5 −1 app/controllers/scoreboard_controller.rb
  11. +3 −0 app/controllers/statistics_controller.rb
  12. +39 −4 app/controllers/teams_controller.rb
  13. +1 −1 app/models/block.rb
  14. +2 −2 app/models/game.rb
  15. +1 −1 app/models/section.rb
  16. +28 −17 app/models/team.rb
  17. +72 −7 app/uploaders/team_logo_uploader.rb
  18. +74 −8 app/views/admin/teams/_form.html.haml
  19. +2 −1 app/views/admin/teams/index.html.haml
  20. +5 −6 app/views/layouts/application.html.haml
  21. +44 −45 app/views/scoreboard/_score_card.html.haml
  22. +5 −0 app/views/scoreboard/_team.html.haml
  23. +4 −4 app/views/scoreboard/index.html.erb
  24. +13 −0 app/views/statistics/_stat_table.haml
  25. +10 −106 app/views/statistics/index.html.haml
  26. +16 −0 app/views/teams/_actions.haml
  27. +53 −0 app/views/teams/_form_adjust_logo.html.haml
  28. +9 −0 app/views/teams/_form_basic.html.haml
  29. +88 −0 app/views/teams/_form_color.html.haml
  30. +14 −0 app/views/teams/_form_upload_logo.haml
  31. +15 −0 app/views/teams/_team.html.haml
  32. +8 −0 app/views/teams/edit.js.erb
  33. +2 −11 app/views/teams/index.html.haml
  34. +4 −1 app/views/teams/roster.html.haml
  35. +6 −6 app/views/teams/schedule.html.haml
  36. +3 −0 app/views/teams/statistics.html.haml
  37. +28 −0 app/views/teams/update.js.erb
  38. +1 −1 config/application.rb
  39. +4 −0 config/routes.rb
  40. +14 −14 lib/patches/mongoid.rb
  41. BIN vendor/assets/images/Jcrop.gif
  42. +1,695 −0 vendor/assets/javascripts/jcrop/jquery.Jcrop.js
  43. +19 −243 vendor/assets/javascripts/jcrop/jquery.Jcrop.min.js
  44. +123 −0 vendor/assets/javascripts/jcrop/jquery.color.js
  45. +86 −0 vendor/assets/stylesheets/jcrop/jquery.Jcrop.css
  46. +28 −0 vendor/assets/stylesheets/jcrop/jquery.Jcrop.min.css
View
2 Gemfile
@@ -27,7 +27,7 @@ gem 'simple_form', '~> 2.0.4'
gem 'carrierwave-mongoid', :require => 'carrierwave/mongoid'
gem 'fog'
gem 'rmagick'
-gem 'remotipart', '~> 0.4'
+gem 'remotipart', '~> 1.0'
gem "RedCloth"
View
10 Gemfile.lock
@@ -36,7 +36,7 @@ GEM
activesupport (3.2.1)
i18n (~> 0.6)
multi_json (~> 1.0)
- addressable (2.3.2)
+ addressable (2.3.3)
arel (3.0.2)
autotest (4.4.6)
ZenTest (>= 4.4.1)
@@ -82,7 +82,7 @@ GEM
warden (~> 1.2.1)
diff-lcs (1.1.3)
erubis (2.7.0)
- excon (0.16.10)
+ excon (0.18.5)
execjs (1.4.0)
multi_json (~> 1.0)
factory_girl (4.2.0)
@@ -215,7 +215,7 @@ GEM
rspec (>= 2.0.0.alpha11)
remarkable_mongoid (0.6.0)
remarkable_activemodel (~> 4.0.0.alpha4)
- remotipart (0.4.2)
+ remotipart (1.0.5)
rmagick (2.13.2)
rspec (2.12.0)
rspec-core (~> 2.12.0)
@@ -239,7 +239,7 @@ GEM
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
- selenium-webdriver (2.29.0)
+ selenium-webdriver (2.30.0)
childprocess (>= 0.2.5)
multi_json (~> 1.0)
rubyzip
@@ -306,7 +306,7 @@ DEPENDENCIES
omniauth
rails (= 3.2.1)
remarkable_mongoid (>= 0.5.0)
- remotipart (~> 0.4)
+ remotipart (~> 1.0)
rmagick
rspec (>= 2.0.1)
rspec-rails (>= 2.0.1)
View
18 app/assets/javascripts/application.js
@@ -1,9 +1,23 @@
//= require jquery
//= require jquery_ujs
//= require jquery-ui.min
-//= require jquery.form
//= require jquery.remotipart
//= require twitter/bootstrap
+//= require jcrop/jquery.Jcrop.min
+
+function colorToHex(color) {
+ if (color.substr(0, 1) === '#') {
+ return color;
+ }
+ var digits = /(.*?)rgb\((\d+), (\d+), (\d+)\)/.exec(color);
+
+ var red = parseInt(digits[2]);
+ var green = parseInt(digits[3]);
+ var blue = parseInt(digits[4]);
+
+ var rgb = blue | (green << 8) | (red << 16);
+ return digits[1] + '#' + rgb.toString(16).toUpperCase();
+};
function clearForm(form) {
@@ -25,7 +39,7 @@ $(document).ready(function() {
window.location = this.value;
});
- $('.toggle').live("click", function() {
+ $('.toggle').on("click", function() {
$('#'+this.getAttribute('rel')).slideToggle(300);
return false;
});
View
4 app/assets/javascripts/pages.js
@@ -83,8 +83,8 @@ $(function() {
updateBlockPositions($origin);
updateBlockPositions($target);
return false;
- });
-
+ });
+
$(document).on('click', '.section a.add_block', function(){
$('#column').val( $(this).attr('data-column') );
$('#section_id').val( $(this).attr('data-section_id') );
View
1 app/assets/stylesheets/application.css
@@ -1,5 +1,6 @@
/*
*= require_self
*= require jquery-ui-1.8.11.custom
+*= require jcrop/jquery.Jcrop.min
*= require themes/default/index
*/
View
4 app/assets/stylesheets/base/base.css.less
@@ -5,6 +5,10 @@ header {
}
}
+.breadcrumb {
+ margin: 0;
+}
+
/* Subnav */
.subnav {
width: 100%;
View
128 app/assets/stylesheets/base/leagues.css.less
@@ -1,52 +1,128 @@
+// TEAM BRANDING
+// --------------------------------
+.team {
+ .well {
+ position: relative;
+ height: 110px;
+ padding: 0;
+ }
+ .logo {
+ width: 100px;
+ height: 100px;
+ position: absolute;
+ top: 5px;
+ left: 5px;
+ }
+ .name {
+ position: absolute;
+ left: 120px;
+ top: 10px;
+ }
+ .links {
+ position: absolute;
+ left: 120px;
+ top: 65px;
+ }
+}
+.banner {
+ .team {
+ .well {
+ margin-bottom: 0;
+ }
+ }
+}
+
// SCOREBOARD
// --------------------------------
.scoreboard .group-head {
- .makeColumn(12);
padding: 3px 5px;
- border-bottom: 1px solid @grayLight;
+ border-bottom: 2px solid @grayLight;
background-color: @grayLighter;
margin-bottom: 18px;
}
.scoreboard .group-foot {
clear: both;
}
.scorecard {
- .makeColumn(4);
+ padding: 1px;
margin-bottom: 18px;
}
.scorecard .inner {
+ background-color: @grayLighter;
border: 1px solid @grayLight;
padding: 2px;
.border-radius(5px);
}
-.scorecard .header {
- border-top: 2px solid #000;
- border-bottom: 1px solid @grayLight;
- table {
- #gradient > .vertical(@white, #dedede);
+
+.scorecard {
+ .status {
+ padding: 2px 4px;
font-weight: bold;
- width: 100%;
- margin-bottom: 0px;
- td {
- padding: 8px;
- line-height: 18px;
+ font-size: 10pt;
+ border-bottom: solid 1px @grayLight;
+ }
+ .matchup {
+ table {
+ width: 100%;
+ }
+ td.logo {
+ width: 50px;
+ }
+ td.name {
+ padding-left: 10px;
+ line-height: 50px;
+ font-size: 24px;
+ font-weight: bold;
}
td.score {
- border-right: 1px solid @grayLighter;
+ width: 80px;
+ line-height: 50px;
+ font-size: 24px;
+ font-weight: bold;
+ text-align: right;
+ padding-right: 10px;
}
}
-}
-.scorecard {
- td.winner { width: 10%; }
- td.team { width: 50%; }
- td.score { width: 10%; text-align: right; }
- td.result { wdith: 30%; vertical-align: middle; }
+ .team {
+ position: absolute;
+ height: 50px;
+ width: 294px;
+ .logo, .name, .score, {
+ position: absolute;
+ height: 50px;
+ top: 0px;
+ }
+
+ .name, .score {
+ font-size: 24px;
+ font-weight: bold;
+ line-height: 50px;
+ }
+ .name {
+ left: 50px;
+ padding-left: 10px;
+ }
+ .score {
+ right: 0px;
+ width: 100px;
+ padding-right: 20px;
+ text-align: right;
+ }
+ }
+ .home {
+ top: 50px;
+ }
+ .away {
+ top: 0px;
+ }
}
.scorecard .game-links {
+ margin-top: 2px;
padding: 4px;
+ border-top: 1px solid @grayLight;
border-bottom: 1px solid @grayLight;
font-size: 8pt;
}
@@ -148,8 +224,16 @@
// ---------------------------------
table.leaders {
- th.stat, td.stat {
+ td {
+ vertical-align: middle;
+ }
+ td.logo {
+ padding: 0;
+ width: 50px;
+ height: 50px;
+ }
+ td.stat {
+ width: 50px;
text-align: center;
- width: 80px;
}
}
View
1 app/assets/stylesheets/oia.css
@@ -1,5 +1,6 @@
/*
*= require_self
*= require jquery-ui-1.8.11.custom
+*= require jcrop/jquery.Jcrop.min
*= require themes/oia/index
*/
View
8 app/controllers/base_league_controller.rb
@@ -17,7 +17,7 @@ def set_area_navigation
add_area_menu_item 'Standings', standings_path(@league)
add_area_menu_item 'Statistics', statistics_path(@league)
add_area_menu_item 'Teams', teams_path(@league)
- add_area_menu_item 'Players', players_path(@league)
+ add_area_menu_item 'Players', players_path(@league)
end
def find_league
@@ -26,8 +26,10 @@ def find_league
end
def find_season
- @season = @league.seasons.find_by(slug: params[:season_slug]) if params[:season_slug]
- @season ||= @league.seasons.most_recent
+ if @league
+ @season = @league.seasons.find_by(slug: params[:season_slug]) if params[:season_slug]
+ @season ||= @league.seasons.most_recent
+ end
end
end
View
6 app/controllers/scoreboard_controller.rb
@@ -15,7 +15,11 @@ def index
add_breadcrumb("Scoreboard")
- @games = Game.gt(starts_on: @start_date).lt(ends_on: @end_date)
+ @games = Game.gt(starts_on: @start_date)
+ .lt(ends_on: @end_date)
+ .includes(:home_team)
+ .includes(:away_team)
+ .includes(:statsheet)
@games = @games.for_league(@league) if @league
@games = @games.desc(:starts_on).entries
View
3 app/controllers/statistics_controller.rb
@@ -12,6 +12,9 @@ def index
@savepct_leaders = Player.for_league(@league).for_season(@season).where(:"record.g_gp".gt => 0).desc("record.g_svp").limit(limit)
@save_leaders = Player.for_league(@league).for_season(@season).where(:"record.g_gp".gt => 0).desc("record.g_sv").limit(limit)
@shutout_leaders = Player.for_league(@league).for_season(@season).where(:"record.g_so".gt => 0).desc("record.g_so").limit(limit)
+ @hattrick_leaders = Player.for_league(@league).for_season(@season).where(:"record.hat".gt => 0).desc("record.hat").limit(limit)
+ @playmaker_leaders = Player.for_league(@league).for_season(@season).where(:"record.plmkr".gt => 0).desc("record.plmkr").limit(limit)
+ @gordie_leaders = Player.for_league(@league).for_season(@season).where(:"record.gordie".gt => 0).desc("record.gordie").limit(limit)
end
private
View
43 app/controllers/teams_controller.rb
@@ -1,13 +1,18 @@
require 'icalendar'
class TeamsController < BaseLeagueController
+ before_filter :verify_admin, :except => [:show, :index, :schedule, :roster, :statistics]
before_filter :set_team_breadcrumbs, :only => [:schedule, :show, :roster]
before_filter :get_season_options, :only => [:index]
-
+ before_filter :find_team, :only => [:edit, :update, :destroy]
+ before_filter :load_league_options, :only => [:new]
+ before_filter :load_division_options, :only => [:new, :edit]
+ before_filter :load_club_options, :only => [:new, :edit]
+
def index
add_breadcrumb "Teams"
- @teams = @league.teams.for_season(@season).asc(:name)
+ @teams = @league.teams.for_season(@season).asc(:name).without(:record, :event_ids)
respond_to do |format|
format.html # index.html.erb
@@ -27,6 +32,14 @@ def schedule
end
end
+
+ def edit
+
+ end
+
+ def update
+ @team.update_attributes(params[:team])
+ end
def roster
add_breadcrumb "Roster"
@@ -51,6 +64,30 @@ def show
end
private
+
+ def find_team
+ @team = Team.find(params[:id])
+ end
+
+ def load_league_options
+ @leagues = @season.leagues.asc(:name)
+ end
+
+ def load_division_options
+ league_id = @team ? @team.league_id : params[:league_id]
+ season_id = @team ? @team.season_id : params[:season_id]
+ @divisions = Division.for_league(league_id).for_season(season_id).asc(:name)
+ end
+
+ def load_club_options
+ @clubs = Club.asc(:name).entries
+ end
+
+ def set_area_navigation
+ puts params[:action]
+ super unless [:edit,:update,:new,:create].include? params[:action].to_sym
+ end
+
def set_team_breadcrumbs
add_breadcrumb "Teams", teams_path(@league.slug)
add_breadcrumb @team.name if @team
@@ -61,8 +98,6 @@ def load_objects
end
- private
-
def get_season_options
@season_options = @league.seasons.all.desc(:starts_on).collect{|s| [s.name, teams_path(:league_slug => @league.slug, :season_slug => s == @season ? nil : s.slug)]}
end
View
2 app/models/block.rb
@@ -6,7 +6,7 @@ class Block
field :section_id, :type => BSON::ObjectId
field :column, :default => 0, :type => Integer
- field :position, :type => Integer
+ field :position, :type => Integer, :default => 0
embedded_in :page
View
4 app/models/game.rb
@@ -1,7 +1,7 @@
class Game < Event
- belongs_to :away_team, :class_name => "Team", :inverse_of => :away_games
+ belongs_to :away_team, :class_name => "Team"
field :away_custom_name, :type => Boolean
field :away_team_name
field :away_team_score, :type => Integer, :default => 0
@@ -10,7 +10,7 @@ def away_team_is_winner?
return result.away_score > result.home_score if result
end
- belongs_to :home_team, :class_name => "Team", :inverse_of => :home_games
+ belongs_to :home_team, :class_name => "Team"
field :home_team_name
field :home_custom_name, :type => Boolean
field :home_team_score, :type => Integer, :default => 0
View
2 app/models/section.rb
@@ -4,7 +4,7 @@ class Section
embedded_in :page
field :pattern
- field :position, :type => Integer
+ field :position, :type => Integer, :default => 0
PATTERNS = [
"100",
View
45 app/models/team.rb
@@ -11,12 +11,11 @@ class Team
field :pool, :type => String
field :seed, :type => Integer
- field :primary_color, :default => '#666'
- field :accent_color, :default => '#000'
- field :text_color, :default => '#FFF'
- field :link_color, :default => '#000033'
-
- field :thumb_color, :default => '#FFFFFF'
+ field :primary_color
+ field :secondary_color
+ field :accent_color
+ field :main_colors, :type => Array
+ field :custom_colors, :type => Boolean
field :crop_x, :type => Integer, :default => 0
field :crop_y, :type => Integer, :default => 0
@@ -50,8 +49,6 @@ def crop_changed?
belongs_to :club
has_many :players
- has_many :home_games, :class_name => "Game", :inverse_of => :home_team
- has_many :away_games, :class_name => "Game", :inverse_of => :away_team
embeds_one :record, :class_name => "Team::Record"
before_save :set_slug
@@ -88,16 +85,30 @@ def set_division_name division = nil
division ||= Division.find(self.division_id) if self.division_id
self.division_name = division ? division.name : nil
end
+
+ before_save :clear_crop, :if => :logo_changed?
+ def clear_crop
+ self.crop_x = 0
+ self.crop_y = 0
+ self.crop_w = 0
+ self.crop_h = 0
+ end
- #
- #before_save :prepare_crop_changed_message
- #def prepare_crop_changed_message
- # if crop_changed?
- # msg = Message.new(:team_crop_changed)
- # msg.data[:team_id] = self.id
- # end
- # enqueue_message msg
- #end
+ before_save :resize_logo_images, :if => :crop_changed?
+ def resize_logo_images
+ self.logo.recreate_versions! if self.logo.url
+ end
+
+ before_save :get_color_palette, :if => :logo?
+ def get_color_palette
+ p = self.logo.color_palette
+ self.main_colors = p[:colors]
+ unless self.custom_colors
+ self.primary_color = p[:primary]
+ self.secondary_color = p[:secondary]
+ self.accent_color = p[:accent]
+ end
+ end
class << self
def for_league(league)
View
79 app/uploaders/team_logo_uploader.rb
@@ -1,3 +1,5 @@
+require 'carrierwave/processing/rmagick'
+
class TeamLogoUploader < CarrierWave::Uploader::Base
include CarrierWave::RMagick
@@ -6,9 +8,7 @@ def extension_white_list
end
def store_dir
- @site = Site.current
- @site ||= model.site
- "uploads/#{@site.slug}/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
+ "uploads/#{model.tenant.slug}/#{model.class.name.pluralize.downcase}/#{mounted_as}/#{model.id}"
end
def cache_dir
@@ -18,31 +18,96 @@ def cache_dir
process :resize_to_limit => [400,400]
version :small do
- process :crop_and_scale => 200
+ process :crop_and_scale
+ process :resize_to_fill => [200,200]
end
version :thumb do
- process :crop_and_scale => 100
+ process :crop_and_scale
+ process :resize_to_fill => [100,100]
end
version :tiny do
- process :crop_and_scale => 50
+ process :crop_and_scale
+ process :resize_to_fill => [50,50]
end
version :micro do
- process :crop_and_scale => 25
+ process :crop_and_scale
+ process :resize_to_fill => [25,25]
end
def crop_and_scale(resize_to = nil)
if model.cropping?
manipulate! do |img|
img = img.crop(model.crop_x.to_i, model.crop_y.to_i, model.crop_h.to_i, model.crop_w.to_i, true)
img = img.resize(resize_to, resize_to) if resize_to
+ img
end
else
resize_to_limit(resize_to, resize_to)
end
end
+
+ # Create a 1-row image that has a column for every color in the quantized
+ # image. The columns are sorted decreasing frequency of appearance in the
+ # quantized image.
+ def sort_by_decreasing_frequency(img)
+ hist = img.color_histogram
+ # sort by decreasing frequency
+ sorted = hist.keys.sort_by {|p| -hist[p]}
+ new_img = Magick::Image.new(hist.size, 1)
+ new_img.store_pixels(0, 0, hist.size, 1, sorted)
+ end
+
+ def get_color_map(img)
+ palette = Magick::ImageList.new
+ pixels = img.get_pixels(0, 0, img.columns, 1)
+ map = { :colors => pixels.collect{ |p| p.to_color(Magick::AllCompliance, false, 8, true) } }
+
+ primary = pixels[0]
+ secondary = ''
+ accent = ''
+
+ max_diff = 0
+ pixels.each do |pixel|
+ diff = get_color_diff(primary, pixel)
+ if diff > max_diff
+ max_diff = diff
+ secondary = pixel
+ end
+ end
+
+ max_diff = 0
+ pixels.each do |pixel|
+ diff = get_color_diff(primary, pixel)
+ if diff > max_diff and pixel != secondary
+ max_diff = diff
+ accent = pixel
+ end
+ end
+
+ map[:primary] = primary.to_color(Magick::AllCompliance, false, 8, true)
+ map[:secondary] = secondary.to_color(Magick::AllCompliance, false, 8, true)
+ map[:accent] = accent.to_color(Magick::AllCompliance, false, 8, true)
+ map
+ end
+
+ def get_color_diff(a, b)
+ square(a.red-b.red) + square(a.green-b.green) + square(a.blue-b.blue)
+ end
+
+ def square(n)
+ n * n
+ end
+
+
+ def color_palette
+ img = Magick::Image::read(self.small.path)[0]
+ quantized = img.quantize(8, Magick::RGBColorspace)
+ normal = sort_by_decreasing_frequency(quantized)
+ map = get_color_map(normal)
+ end
end
View
82 app/views/admin/teams/_form.html.haml
@@ -1,10 +1,76 @@
+%ul.nav.nav-tabs
+ %li.active
+ = link_to "Basic Info", '#basic', { :"data-toggle" => "tab" }
+ %li
+ = link_to "Branding", '#branding', { :"data-toggle" => "tab" }
= simple_form_for [:admin, @season, @team] do |f|
- = f.input :league_id, :as => :select, :collection => @leagues if %w{new create}.include? params[:action]
- = f.input :name
- = f.input :short_name
- = f.input :club_id, :as => :select, :collection => @clubs
- = f.input :division_id, :as => :select, :collection => @divisions
- = f.input :pool
- = f.input :show_in_standings, :as => :boolean
- = f.input :seed, :input_html => { :class => 'span1' }
+ .tab-content
+ .tab-pane.active{ :id => "basic" }
+ = f.input :league_id, :as => :select, :collection => @leagues if %w{new create}.include? params[:action]
+ = f.input :name
+ = f.input :short_name
+ = f.input :club_id, :as => :select, :collection => @clubs
+ = f.input :division_id, :as => :select, :collection => @divisions
+ = f.input :pool
+ = f.input :show_in_standings, :as => :boolean
+ = f.input :seed, :input_html => { :class => 'span1' }
+ .tab-pane{ :id => "branding" }
+ = f.input :crop_x, :as => :hidden
+ = f.input :crop_y, :as => :hidden
+ = f.input :crop_h, :as => :hidden
+ = f.input :crop_w, :as => :hidden
+ = f.input :logo, :as => :file
+ = f.input :remote_logo_url
+ = f.input :logo_cache, :as => :hidden
+ - if @team.logo?
+ .jcrop
+ %img{ :src => @team.logo.url, :id => "jcrop_target"}
+ #preview{ :style => "width: 100px; height: 100px; overflow: hidden; margin-top: 10px;"}
+ = image_tag @team.logo.url
+ - #@team.logo.primary_colors[:colors].each do |color|
+ - #.color{:style => "background-color: #{color}; height: 20px; width: 20px; margin-top: 5px;"}
= f.button :wrapped, :cancel => return_url
+
+:css
+ .jcrop img {max-width: none}
+
+- content_for :javascript do
+ :javascript
+
+ $(function() {
+ $('#jcrop_target').Jcrop({
+ aspectRatio: 1,
+ onChange: update_crop,
+ onSelect: update_crop
+ }, function() {
+ // Use the API to get the real image size
+ var bounds = this.getBounds();
+ boundx = bounds[0];
+ boundy = bounds[1];
+ // Store the API in the jcrop_api variable
+ jcrop_api = this;
+ var x = #{@team.crop_x};
+ var y = #{@team.crop_y};
+ var w = #{@team.crop_w};
+ var h = #{@team.crop_h};
+ jcrop_api.setSelect([x,y,x+w,y+h]);
+ });
+ });
+
+ function update_crop(coords) {
+ var rx = 100 / coords.w;
+ var ry = 100 / coords.h;
+ var lw = $('#jcrop_target').width();
+ var lh = $('#jcrop_target').height();
+ $('#preview img').css({
+ width: Math.round(rx * lw) + 'px',
+ height: Math.round(ry * lh) + 'px',
+ marginLeft: '-' + Math.round(rx * coords.x) + 'px',
+ marginTop: '-' + Math.round(ry * coords.y) + 'px'
+ });
+ $('#team_crop_h').val(coords.h);
+ $('#team_crop_w').val(coords.w);
+ $('#team_crop_y').val(coords.y);
+ $('#team_crop_x').val(coords.x);
+ return false;
+ }
View
3 app/views/admin/teams/index.html.haml
@@ -18,6 +18,7 @@
- if team.league_id == league.id
%tr
%td
+ = image_tag team.logo.tiny unless team.logo.blank?
= team.name
.pull-right
- unless team.division_name.blank?
@@ -28,4 +29,4 @@
= link_to "Edit", edit_admin_team_path(team), :class => 'btn btn-mini'
= link_to "Roster", admin_team_players_path(team), :class => 'btn btn-mini'
= link_to 'Delete', [:admin, team], :confirm => 'Are you sure?', :method => :delete, :class => 'btn btn-mini'
-= link_to 'Import Players from File', new_admin_player_import_path, :class => "btn"
+= link_to 'Import Players from File', new_admin_player_import_path, :class => "btn"
View
11 app/views/layouts/application.html.haml
@@ -27,18 +27,17 @@
= render "layouts/site_navigation" if @site_menu_items
#wrapper.container
%header
+ = render "layouts/area_navigation" if @area_menu_items
+ = render "layouts/breadcrumbs" if @breadcrumbs
+ #banner
+ #{yield :banner}
%h1.pull-left
%span#page-title= yield(:title)
= content_tag :small, yield(:title_small) if content_for?(:title_small)
.actions.pull-right
= yield(:actions)
- .clear
- = render "layouts/area_navigation" if @area_menu_items
- = render "layouts/breadcrumbs" if @breadcrumbs
-
+ .clear
#main
- #banner
- #{yield :banner}
#page-header
= render :partial => 'layouts/flash', :locals => { :flash => flash }
= yield
View
89 app/views/scoreboard/_score_card.html.haml
@@ -1,48 +1,47 @@
-.scorecard
- .inner
- .header
- %table
- %tbody
- %tr
- %td.winner= '>' if game.has_result? && game.away_team_is_winner?
- %td.team= game.away_team_name
- %td.score= game.result.away_score if game.has_result?
- %td.result{:rowspan => "2"}= game.has_result? ? "FINAL" : game.starts_on.strftime("%l:%M %p")
- %tr
- %td.winner= '>' if game.has_result? && game.home_team_is_winner?
- %td.team= game.home_team_name
- %td.score= game.result.home_score if game.has_result?
- - stats = game.statsheet
- - if stats
- .game-links
- = link_to 'Box Score', game_box_score_path(@league.slug, game.id)
- .line-score
- %table.table
- %thead
- %tr
- %th
- %th.period 1
- %th.period 2
- %th.period 3
- - if stats.overtime?
- %th.period OT
- %th.final T
+.span4
+ .scorecard
+ .inner
+ .status
+ - unless game.has_result?
+ = game.starts_on.strftime("%l:%M %P")
+ - if game.has_result?
+ FINAL
+ .matchup
+ %table
%tbody
- %tr
- %td= stats.away_team_name
- %td.period= stats.away_goals_1
- %td.period= stats.away_goals_2
- %td.period= stats.away_goals_3
- - if stats.overtime?
- %td.period= stats.away_goals_ot
- %td.final= stats.away_goals_total
- %tr
- %td= stats.home_team_name
- %td.period= stats.home_goals_1
- %td.period= stats.home_goals_2
- %td.period= stats.home_goals_3
- - if stats.overtime?
- %td.period= stats.home_goals_ot
- %td.final= stats.home_goals_total
+ = render :partial => "team", :locals => { :team => game.away_team, :score => game.has_result? ? game.result.away_score : "" }
+ = render :partial => "team", :locals => { :team => game.home_team, :score => game.has_result? ? game.result.home_score : "" }
+ - stats = game.statsheet
+ - if stats
+ .game-links
+ = link_to 'Box Score', game_box_score_path(@league.slug, game.id)
+ .line-score
+ %table.table
+ %thead
+ %tr
+ %th
+ %th.period 1
+ %th.period 2
+ %th.period 3
+ - if stats.overtime?
+ %th.period OT
+ %th.final T
+ %tbody
+ %tr
+ %td= stats.away_team_name
+ %td.period= stats.away_goals_1
+ %td.period= stats.away_goals_2
+ %td.period= stats.away_goals_3
+ - if stats.overtime?
+ %td.period= stats.away_goals_ot
+ %td.final= stats.away_goals_total
+ %tr
+ %td= stats.home_team_name
+ %td.period= stats.home_goals_1
+ %td.period= stats.home_goals_2
+ %td.period= stats.home_goals_3
+ - if stats.overtime?
+ %td.period= stats.home_goals_ot
+ %td.final= stats.home_goals_total
View
5 app/views/scoreboard/_team.html.haml
@@ -0,0 +1,5 @@
+%tr{ :style => "background-color: #{team.primary_color}; border-top: 2px solid #FFF; margin-top: 2px;"}
+ %td.logo
+ = image_tag team.logo.thumb.url if team.logo?
+ %td.name{ :style => "color: #{team.secondary_color}"}= team.name
+ %td.score{ :style => "color: #{team.secondary_color}"}= score
View
8 app/views/scoreboard/index.html.erb
@@ -17,16 +17,16 @@
<% end %>
<% if first_date or new_date # new head %>
<% counter = 0 %>
- <div class="row">
- <div class="group-head">
+ <div class="row-fluid">
+ <div class="group-head span12">
<h5><%= game.starts_on.to_date.strftime("%A, %B %e %Y") %></h5>
</div>
</div>
- <div class="row">
+ <div class="row-fluid">
<% else %>
<% if counter % 3 == 0 %>
</div>
- <div class="row">
+ <div class="row-fluid">
<% end %>
<% end %>
<%= render :partial => "score_card", :locals => { :game => game } %>
View
13 app/views/statistics/_stat_table.haml
@@ -0,0 +1,13 @@
+- format_with ||= ->(value) { value }
+%table.table.table-striped.table-bordered.leaders
+ %thead
+ %tr
+ %th{ :colspan => "3"}= title
+ %tbody
+ - arr = players.entries
+ - for i in 0..2
+ - player = arr[i]
+ %tr
+ %td.logo= image_tag player.team.logo.thumb.url if player && player.team.logo?
+ %td.player= player.full_name if player
+ %td.stat= format_with.call(player.record[column]) if player
View
116 app/views/statistics/index.html.haml
@@ -2,111 +2,15 @@
= render :partial => 'shared/season_options', :object => @season_options
.row
.span4
- %h3 Goals
- %table.table.table-striped.table-bordered.leaders
- %thead
- %tr
- %th.player PLAYER
- %th.stat GOALS
- %tbody
- - data_exists = false
- - @goal_leaders.each do |player|
- - data_exists = true
- %tr
- %td.player= player.full_name
- %td.stat= player.record.g
- - unless data_exists
- %tr
- %td{:colspan => 2}
- %em No goals have been recorded... yet
+ = render :partial => "stat_table", :locals => { :title => "POINTS", :players => @point_leaders, :column => "pts" }
+ = render :partial => "stat_table", :locals => { :title => "GOALS", :players => @goal_leaders, :column => "g" }
+ = render :partial => "stat_table", :locals => { :title => "ASSISTS", :players => @assist_leaders, :column => "a" }
.span4
- %h3 Assists
- %table.table.table-striped.table-bordered.leaders
- %thead
- %tr
- %th.player PLAYER
- %th.stat ASSISTS
- %tbody
- - data_exists = false
- - @assist_leaders.each do |player|
- - data_exists = true
- %tr
- %td.player= player.full_name
- %td.stat= player.record.a
- - unless data_exists
- %tr
- %td{:colspan => 2}
- %em No assists have been recorded... yet
+ = render :partial => "stat_table", :locals => { :title => "SAVE PERCENTAGE", :players => @savepct_leaders, :column => "g_svp", :format_with => ->(value) { number_with_precision(value, :precision => 3) } }
+ = render :partial => "stat_table", :locals => { :title => "SAVES", :players => @save_leaders, :column => "g_sv" }
+ = render :partial => "stat_table", :locals => { :title => "SHUTOUTS", :players => @shutout_leaders, :column => "g_so" }
.span4
- %h3 Points
- %table.table.table-striped.table-bordered.leaders
- %thead
- %tr
- %th.player PLAYER
- %th.stat POINTS
- %tbody
- - data_exists = false
- - @point_leaders.each do |player|
- - data_exists = true
- %tr
- %td.player= player.full_name
- %td.stat= player.record.pts
- - unless data_exists
- %tr
- %td{:colspan => 2}
- %em No points have been recorded... yet
-.row
- .span4
- %h3 Save Percentage
- %table.table.table-striped.table-bordered.leaders
- %thead
- %tr
- %th.player PLAYER
- %th.stat SAVE PCT
- %tbody
- - data_exists = false
- - @savepct_leaders.each do |player|
- - data_exists = true
- %tr
- %td.player= player.full_name
- %td.stat= number_with_precision(player.record.g_svp, :precision => 3)
- - unless data_exists
- %tr
- %td{:colspan => 2}
- %em No saves have been recorded... yet
- .span4
- %h3 Saves
- %table.table.table-striped.table-bordered.leaders
- %thead
- %tr
- %th.player PLAYER
- %th.stat SAVES
- %tbody
- - data_exists = false
- - @save_leaders.each do |player|
- - data_exists = true
- %tr
- %td.player= player.full_name
- %td.stat= player.record.g_sv
- - unless data_exists
- %tr
- %td{:colspan => 2}
- %em No saves have been recorded... yet
- .span4
- %h3 Shutouts
- %table.table.table-striped.table-bordered.leaders
- %thead
- %tr
- %th.player PLAYER
- %th.stat SO
- %tbody
- - data_exists = false
- - @shutout_leaders.each do |player|
- - data_exists = true
- %tr
- %td.player= player.full_name
- %td.stat= player.record.g_so
- - unless data_exists
- %tr
- %td{:colspan => 2}
- %em No shutouts have been recorded... yet
+ = render :partial => "stat_table", :locals => { :title => "HAT TRICKS", :players => @hattrick_leaders, :column => "hat"}
+ = render :partial => "stat_table", :locals => { :title => "PLAYMAKERS", :players => @playmaker_leaders, :column => "plmkr" }
+ = render :partial => "stat_table", :locals => { :title => "GORDIE HOWES", :players => @gordie_leaders, :column => "gordie" }
+
View
16 app/views/teams/_actions.haml
@@ -0,0 +1,16 @@
+.actions{ :style => "position: absolute; top: 10px; right: 10px;"}
+ .buttons.pull-right
+ .btn-group
+ %button.btn.btn-small.dropdown-toggle{ :"data-toggle" => "dropdown", rel: "tooltip", title: "Team Tools" }
+ = icon('wrench')
+ %span.caret
+ %ul.dropdown-menu.pull-right
+ %li.nav-header EDIT
+ %li= link_to icon(:cog)+" Edit Settings", edit_team_path(team), :remote => true
+ %li= link_to icon(:upload)+" Upload Logo", edit_team_path(team, :form => 'upload_logo'), :remote => true
+ - if team.logo?
+ %li= link_to icon(:move)+" Adjust Logo", edit_team_path(team, :form => 'adjust_logo'), :remote => true
+ %li= link_to icon(:adjust)+" Edit Colors", edit_team_path(team, :form => 'color'), :remote => true
+ %li.divider
+ %li= link_to icon(:trash)+' Delete', admin_team_path(team), :confirm => 'Are you sure?', :method => :delete, :remote => true
+ .clear
View
53 app/views/teams/_form_adjust_logo.html.haml
@@ -0,0 +1,53 @@
+:css
+ .jcrop img {max-width: none}
+
+.jcrop
+ %img{ :src => @team.logo.url, :id => "jcrop_target"}
+.clear
+= simple_form_for @team, :remote => true do |f|
+ = f.input :crop_x, :as => :hidden
+ = f.input :crop_y, :as => :hidden
+ = f.input :crop_h, :as => :hidden
+ = f.input :crop_w, :as => :hidden
+
+:javascript
+
+ $(function() {
+
+ $('#jcrop_target').Jcrop({
+ aspectRatio: 1,
+ onChange: update_crop,
+ onSelect: update_crop
+ }, function() {
+ // Use the API to get the real image size
+ var bounds = this.getBounds();
+ boundx = bounds[0];
+ boundy = bounds[1];
+ // Store the API in the jcrop_api variable
+ jcrop_api = this;
+ var x = #{@team.crop_x};
+ var y = #{@team.crop_y};
+ var w = #{@team.crop_w};
+ var h = #{@team.crop_h};
+ jcrop_api.setSelect([x,y,x+w,y+h]);
+ });
+
+ });
+
+ function update_crop(coords) {
+ var rx = 100 / coords.w;
+ var ry = 100 / coords.h;
+ var lw = $('#jcrop_target').width();
+ var lh = $('#jcrop_target').height();
+ $('#preview img').css({
+ width: Math.round(rx * lw) + 'px',
+ height: Math.round(ry * lh) + 'px',
+ marginLeft: '-' + Math.round(rx * coords.x) + 'px',
+ marginTop: '-' + Math.round(ry * coords.y) + 'px'
+ });
+ $('#team_crop_h').val(coords.h);
+ $('#team_crop_w').val(coords.w);
+ $('#team_crop_y').val(coords.y);
+ $('#team_crop_x').val(coords.x);
+ return false;
+ }
View
9 app/views/teams/_form_basic.html.haml
@@ -0,0 +1,9 @@
+= simple_form_for @team, :remote => true do |f|
+ = f.input :league_id, :as => :select, :collection => @leagues if %w{new create}.include? params[:action]
+ = f.input :name
+ = f.input :short_name
+ = f.input :club_id, :as => :select, :collection => @clubs
+ = f.input :division_id, :as => :select, :collection => @divisions
+ = f.input :pool
+ = f.input :show_in_standings, :as => :boolean
+ = f.input :seed, :input_html => { :class => 'span1' }
View
88 app/views/teams/_form_color.html.haml
@@ -0,0 +1,88 @@
+:css
+ .swatch {
+ height: 20px;
+ width: 20px;
+ border: 1px solid #CCC;
+ margin: 2px;
+ float: left;
+ cursor: pointer;
+ }
+ .swatch.selected {
+ border: 2px solid #0F0;
+ }
+
+.preview{ :id => "team-#{@team.id}"}
+ .well{ :style => "background-color: #{@team.primary_color}" }
+ .row-fluid
+ .span3.logo
+ = image_tag @team.logo.thumb.url if @team.logo?
+ .span9
+ %h3.name{ :style => "color: #{@team.secondary_color}"}= @team.name
+ .pages
+ = link_to "Clubhouse", "#", { :style => "color: #{@team.accent_color};" }
+ %span{ :style=> "color: #{@team.secondary_color}"}= " | "
+ = link_to "Schedule", "#", { :style => "color: #{@team.accent_color};" }
+ %span{ :style=> "color: #{@team.secondary_color}"}= " | "
+ = link_to "Players", "#", { :style => "color: #{@team.accent_color};" }
+
+- color_options = @team.main_colors << "#FFF" << "#000"
+
+= simple_form_for @team, :remote => true do |f|
+ .control-group.optional
+ %label.optional.control-label Primary color
+ .controls
+ %input{ :id => "team_primary_color", :class => "color", :name => "team[primary_color]", :type => "hidden", :value => "#{@team.primary_color}" }
+ .swatches
+ - color_options.each do |color|
+ %div{ :style => "background-color: #{color};", :class => "swatch #{'selected' if color == @team.primary_color}" }
+ .clear
+ .control-group.optional
+ %label.optional.control-label Secondary color
+ .controls
+ %input{ :id => "team_secondary_color", :class => "color", :name => "team[secondary_color]", :type => "hidden", :value => "#{@team.secondary_color}" }
+ .swatches
+ - color_options.each do |color|
+ %div{ :style => "background-color: #{color};", :class => "swatch #{'selected' if color == @team.secondary_color}" }
+ .clear
+ .control-group.optional
+ %label.optional.control-label Accent color
+ .controls
+ %input{ :id => "team_accent_color", :class => "color", :name => "team[accent_color]", :type => "hidden", :value => "#{@team.accent_color}" }
+ .swatches
+ - color_options.each do |color|
+ %div{ :style => "background-color: #{color};", :class => "swatch #{'selected' if color == @team.accent_color}" }
+ .clear
+ = f.input :custom_colors, :as => :boolean
+
+:javascript
+ $(function(){
+
+ // select a color
+ $('.swatch').click(function() {
+ // update selection indicator
+ $(this).addClass('selected')
+ .siblings('.swatch').removeClass('selected');
+ // update hidden field
+ var selectedColor = $(this).css('background-color');
+ var $input = $(this).closest('.controls').find('input.color')
+ $input.val( colorToHex(selectedColor) );
+ // update custom color checkbox
+ $('#team_custom_colors').prop('checked', true);
+ // update preview
+ switch( $input.attr('id') ) {
+ case "team_primary_color":
+ $('.preview .well').css("background-color", selectedColor);
+ break;
+ case "team_secondary_color":
+ $('.preview .name').css("color", selectedColor);
+ $('.preview .pages span').css("color", selectedColor);
+ break;
+ default:
+ $('.preview .pages a').css("color", selectedColor);
+ break;
+ }
+
+ });
+
+
+ });
View
14 app/views/teams/_form_upload_logo.haml
@@ -0,0 +1,14 @@
+= simple_form_for @team, :remote => true do |f|
+ %ul.nav.nav-tabs#upload_type
+ %li.active
+ %a{ :href => "#file", :"data-toggle" => "tab"}= icon(:upload)+" Upload from File"
+ %li
+ %a{ :href => "#url ", :"data-toggle" => "tab"}= icon(:globe)+" Upload from URL"
+ .tab-content
+ .tab-pane.active{ :id => "file" }
+ = f.input :logo, :as => :file
+ .tab-pane{ :id => "url" }
+ = f.input :remote_logo_url
+
+:javascript
+ $("#upload_type").tab();
View
15 app/views/teams/_team.html.haml
@@ -0,0 +1,15 @@
+%div{ :id => "team-#{team.id}", :class => "team #{class_name if class_name}"}
+ .well{ :style => "background-color: #{team.primary_color || '#FFF'};" }
+ .logo
+ = image_tag team.logo.small.url if team.logo?
+ = render :partial => "actions", :locals => { :team => team } if current_user_is_admin?
+ %h1.name{ :style => "color: #{team.secondary_color}"}= team.name
+ .links
+ = link_to "Schedule", team_schedule_path(@league.slug, team.season_slug, team.slug), { :style => "color: #{team.accent_color};" }
+ %span{ :style=> "color: #{team.secondary_color}"}= " | "
+ = link_to "Roster", team_roster_path(@league.slug, team.season_slug, team.slug), { :style => "color: #{team.accent_color};" }
+ %span{ :style=> "color: #{team.secondary_color}"}= " | "
+ = link_to "Statistics", team_statistics_path(@league.slug, team.season_slug, team.slug), { :style => "color: #{team.accent_color};" }
+
+
+
View
8 app/views/teams/edit.js.erb
@@ -0,0 +1,8 @@
+var $modal = $('#dialog-modal');
+<% @modal_title = "Edit Team" %>
+$modal.html("<%= escape_javascript( render(:partial => "form_#{ params[:form] || 'basic' }", :layout => "layouts/modal" ) )%>");
+$modal.modal();
+$modal.find('.submit').click(function(){
+ $modal.find('form').submit();
+});
+
View
13 app/views/teams/index.html.haml
@@ -1,14 +1,5 @@
- title @league.name + ' Teams'
= render :partial => 'shared/season_options', :object => @season_options
.row
- - @teams.each do |team|
- .span6
- .well
- %h3= team.name
- = link_to "Schedule", team_schedule_path(@league.slug, team.season_slug, team.slug)
- = " | "
- = link_to "Roster", team_roster_path(@league.slug, team.season_slug, team.slug)
- = " | "
- = link_to "Statistics", team_statistics_path(@league.slug, team.season_slug, team.slug)
-
-
+ = render :partial => "team", :collection => @teams, :locals => { :class_name => 'span6' }
+.modal.hide.fade{ :id => "dialog-modal", :tabindex => "-1", :role => "dialog", :"aria-labelledby" => "modalLabel", :"aria-hidden" => true }
View
5 app/views/teams/roster.html.haml
@@ -1,6 +1,9 @@
- title "#{@team.name} #{@season.name} Roster"
-
+- content_for :banner do
+ .row.banner
+ = render :partial => "team", :locals => { :team => @team, :class_name => "span12" }
#{select("team", :id, @team_links, { :selected => request.fullpath }, { :class => "redirect_to" })}
+
%table.table.table-striped.table-bordered
%thead
%tr
View
12 app/views/teams/schedule.html.haml
@@ -1,6 +1,8 @@
- title "#{@team.name} #{@season.name} Schedule"
- last_month = nil
-
+- content_for :banner do
+ .row.banner
+ = render :partial => "team", :locals => { :team => @team, :class_name => "span12" }
.visible-phone
.row
.span12
@@ -26,11 +28,9 @@
- last_future = future
%tr
%td
- = event.starts_on.strftime('%a, %b %e')
- %br/
- = display_time_or_result(event, @team) + " " + display_event_summary(event, @team)
- %br/
- = event.venue_name
+ %span= event.starts_on.strftime('%a, %b %e') + " :: "
+ %span= display_time_or_result(event, @team) + " " + display_event_summary(event, @team)
+ %span= event.venue_name
.hidden-phone
.row
.span12
View
3 app/views/teams/statistics.html.haml
@@ -1,4 +1,7 @@
- title "#{@team.name} #{@season.name} Statistics"
+- content_for :banner do
+ .row.banner
+ = render :partial => "team", :locals => { :team => @team, :class_name => "span12" }
%h3 Player Statistics
%table.table.table-striped.table-bordered
%thead
View
28 app/views/teams/update.js.erb
@@ -0,0 +1,28 @@
+<% if @team.errors.any? %>
+ $("#flash_notice").slideUp()
+<% else %>
+ $("#flash_success").html("<%= escape_javascript( flash.discard(:notice) )%>");
+ $("#flash_success").slideDown();
+ $("#dialog-modal").modal('hide');
+ $("#dialog-modal").html('');
+ var $team = $("#team-<%= @team.id %>");
+ $team.slideUp('slow', function() {
+ $team.find('.well').css('background-color', '<%= @team.primary_color %>');
+ $team.find('.name').text('<%= @team.name %>')
+ .css('color', '<%= @team.secondary_color %>');
+ $team.find('.pages a').css('color', '<%= @team.accent_color %>');
+ <% if @team.logo? %>
+ $team.find('.info').removeClass('span12').addClass('span9');
+ $team.find('.logo').show();
+ <% else %>
+ $team.find('.info').removeClass('span9').addClass('span12');
+ $team.find('.logo').hide();
+ <% end %>
+ $team.find('.logo').html('<%= image_tag @team.logo.thumb.url if @team.logo? %>');
+ $team.find('.actions').replaceWith('<%= escape_javascript(render :partial => "actions", :locals => { :team => @team }) %>');
+ $team.slideDown();
+ });
+
+
+
+<% end %>
View
2 config/application.rb
@@ -42,7 +42,7 @@ class Application < Rails::Application
config.assets.initialize_on_precompile = false
# Version of your assets, change this if you want to expire all your assets
- config.assets.version = '1.4'
+ config.assets.version = '1.5'
# Custom directories with classes and modules you want to be autoloadable.
# config.autoload_paths += %W(#{config.root}/extras)
View
4 config/routes.rb
@@ -38,6 +38,10 @@
match "programs/:league_slug/teams/:season_slug/:team_slug/schedule" => "teams#schedule", :as => :team_schedule, :via => :get
match "programs/:league_slug/teams/:season_slug/:team_slug/roster" => "teams#roster", :as => :team_roster, :via => :get
match "programs/:league_slug/teams/:season_slug/:team_slug/statistics" => "teams#statistics", :as => :team_statistics, :via => :get
+
+ resources :seasons, :only => [], :shallow => true do
+ resources :teams, :only => [ :new, :create, :edit, :update, :delete]
+ end
namespace :admin do
resources :leagues
View
28 lib/patches/mongoid.rb
@@ -31,18 +31,18 @@ def <<(*args)
end
# monkey-patch issue with multiple sort on embedded
- module Contextual
- class Memory
- def in_place_sort(values)
- documents.sort! do |a, b|
- a_value, b_value = [], []
- values.keys.each do |field|
- a_value << (values[field] < 0 ? b[field] : a[field])
- b_value << (values[field] < 0 ? a[field] : b[field])
- end
- a_value <=> b_value
- end
- end
- end
- end
+# module Contextual
+# class Memory
+# def in_place_sort(values)
+# documents.sort! do |a, b|
+# a_value, b_value = [], []
+# values.keys.each do |field|
+# a_value << (values[field] < 0 ? b[field] : a[field])
+# b_value << (values[field] < 0 ? a[field] : b[field])
+# end
+# a_value <=> b_value
+# end
+# end
+# end
+# end
end
View
BIN vendor/assets/images/Jcrop.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
1,695 vendor/assets/javascripts/jcrop/jquery.Jcrop.js
1,695 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
262 vendor/assets/javascripts/jcrop/jquery.Jcrop.min.js 100644 → 100755
@@ -1,246 +1,22 @@
/**
- * jquery.Jcrop.min.js v0.9.9 (build:20110607)
- * jQuery Image Cropping Plugin
- * @author Kelly Hallman <khallman@gmail.com>
- * Copyright (c) 2008-2011 Kelly Hallman - released under MIT License
+ * jquery.Jcrop.min.js v0.9.10 (build:20120429)
+ * jQuery Image Cropping Plugin - released under MIT License
+ * Copyright (c) 2008-2012 Tapmodo Interactive LLC
* https://github.com/tapmodo/Jcrop
*/
-
-(function($){$.Jcrop=function(obj,opt){var options=$.extend({},$.Jcrop.defaults),docOffset,lastcurs,ie6mode=false;function px(n){return parseInt(n,10)+'px';}
-function pct(n){return parseInt(n,10)+'%';}
-function cssClass(cl){return options.baseClass+'-'+cl;}
-function supportsColorFade(){return $.fx.step.hasOwnProperty('backgroundColor');}
-function getPos(obj)
-{var pos=$(obj).offset();return[pos.left,pos.top];}
-function mouseAbs(e)
-{return[(e.pageX-docOffset[0]),(e.pageY-docOffset[1])];}
-function setOptions(opt)
-{if(typeof(opt)!=='object'){opt={};}
-options=$.extend(options,opt);if(typeof(options.onChange)!=='function'){options.onChange=function(){};}
-if(typeof(options.onSelect)!=='function'){options.onSelect=function(){};}
-if(typeof(options.onRelease)!=='function'){options.onRelease=function(){};}}
-function myCursor(type)
-{if(type!==lastcurs){Tracker.setCursor(type);lastcurs=type;}}
-function startDragMode(mode,pos)
-{docOffset=getPos($img);Tracker.setCursor(mode==='move'?mode:mode+'-resize');if(mode==='move'){return Tracker.activateHandlers(createMover(pos),doneSelect);}
-var fc=Coords.getFixed();var opp=oppLockCorner(mode);var opc=Coords.getCorner(oppLockCorner(opp));Coords.setPressed(Coords.getCorner(opp));Coords.setCurrent(opc);Tracker.activateHandlers(dragmodeHandler(mode,fc),doneSelect);}
-function dragmodeHandler(mode,f)
-{return function(pos){if(!options.aspectRatio){switch(mode){case'e':pos[1]=f.y2;break;case'w':pos[1]=f.y2;break;case'n':pos[0]=f.x2;break;case's':pos[0]=f.x2;break;}}else{switch(mode){case'e':pos[1]=f.y+1;break;case'w':pos[1]=f.y+1;break;case'n':pos[0]=f.x+1;break;case's':pos[0]=f.x+1;break;}}
-Coords.setCurrent(pos);Selection.update();};}
-function createMover(pos)
-{var lloc=pos;KeyManager.watchKeys();return function(pos){Coords.moveOffset([pos[0]-lloc[0],pos[1]-lloc[1]]);lloc=pos;Selection.update();};}
-function oppLockCorner(ord)
-{switch(ord){case'n':return'sw';case's':return'nw';case'e':return'nw';case'w':return'ne';case'ne':return'sw';case'nw':return'se';case'se':return'nw';case'sw':return'ne';}}
-function createDragger(ord)
-{return function(e){if(options.disabled){return false;}
-if((ord==='move')&&!options.allowMove){return false;}
-btndown=true;startDragMode(ord,mouseAbs(e));e.stopPropagation();e.preventDefault();return false;};}
-function presize($obj,w,h)
-{var nw=$obj.width(),nh=$obj.height();if((nw>w)&&w>0){nw=w;nh=(w/$obj.width())*$obj.height();}
-if((nh>h)&&h>0){nh=h;nw=(h/$obj.height())*$obj.width();}
-xscale=$obj.width()/nw;yscale=$obj.height()/nh;$obj.width(nw).height(nh);}
-function unscale(c)
-{return{x:parseInt(c.x*xscale,10),y:parseInt(c.y*yscale,10),x2:parseInt(c.x2*xscale,10),y2:parseInt(c.y2*yscale,10),w:parseInt(c.w*xscale,10),h:parseInt(c.h*yscale,10)};}
-function doneSelect(pos)
-{var c=Coords.getFixed();if((c.w>options.minSelect[0])&&(c.h>options.minSelect[1])){Selection.enableHandles();Selection.done();}else{Selection.release();}
-Tracker.setCursor(options.allowSelect?'crosshair':'default');}
-function newSelection(e)
-{if(options.disabled){return false;}
-if(!options.allowSelect){return false;}
-btndown=true;docOffset=getPos($img);Selection.disableHandles();myCursor('crosshair');var pos=mouseAbs(e);Coords.setPressed(pos);Selection.update();Tracker.activateHandlers(selectDrag,doneSelect);KeyManager.watchKeys();e.stopPropagation();e.preventDefault();return false;}
-function selectDrag(pos)
-{Coords.setCurrent(pos);Selection.update();}
-function newTracker()
-{var trk=$('<div></div>').addClass(cssClass('tracker'));if($.browser.msie){trk.css({opacity:0,backgroundColor:'white'});}
-return trk;}
-if($.browser.msie&&($.browser.version.split('.')[0]==='6')){ie6mode=true;}
-if(typeof(obj)!=='object'){obj=$(obj)[0];}
-if(typeof(opt)!=='object'){opt={};}
-setOptions(opt);var img_css={border:'none',margin:0,padding:0,position:'absolute'};var $origimg=$(obj);var $img=$origimg.clone().removeAttr('id').css(img_css);$img.width($origimg.width());$img.height($origimg.height());$origimg.after($img).hide();presize($img,options.boxWidth,options.boxHeight);var boundx=$img.width(),boundy=$img.height(),$div=$('<div />').width(boundx).height(boundy).addClass(cssClass('holder')).css({position:'relative',backgroundColor:options.bgColor}).insertAfter($origimg).append($img);delete(options.bgColor);if(options.addClass){$div.addClass(options.addClass);}
-var $img2=$('<img />').attr('src',$img.attr('src')).css(img_css).width(boundx).height(boundy),$img_holder=$('<div />').width(pct(100)).height(pct(100)).css({zIndex:310,position:'absolute',overflow:'hidden'}).append($img2),$hdl_holder=$('<div />').width(pct(100)).height(pct(100)).css('zIndex',320),$sel=$('<div />').css({position:'absolute',zIndex:300}).insertBefore($img).append($img_holder,$hdl_holder);if(ie6mode){$sel.css({overflowY:'hidden'});}
-var bound=options.boundary;var $trk=newTracker().width(boundx+(bound*2)).height(boundy+(bound*2)).css({position:'absolute',top:px(-bound),left:px(-bound),zIndex:290}).mousedown(newSelection);var bgopacity=options.bgOpacity,xlimit,ylimit,xmin,ymin,xscale,yscale,enabled=true,btndown,animating,shift_down;docOffset=getPos($img);var Touch=(function(){function hasTouchSupport(){var support={},events=['touchstart','touchmove','touchend'],el=document.createElement('div'),i;try{for(i=0;i<events.length;i++){var eventName=events[i];eventName='on'+eventName;var isSupported=(eventName in el);if(!isSupported){el.setAttribute(eventName,'return;');isSupported=typeof el[eventName]=='function';}
-support[events[i]]=isSupported;}
-return support.touchstart&&support.touchend&&support.touchmove;}
-catch(err){return false;}}
-function detectSupport(){if((options.touchSupport===true)||(options.touchSupport===false))return options.touchSupport;else return hasTouchSupport();}
-return{createDragger:function(ord){return function(e){e.pageX=e.originalEvent.changedTouches[0].pageX;e.pageY=e.originalEvent.changedTouches[0].pageY;if(options.disabled){return false;}
-if((ord==='move')&&!options.allowMove){return false;}
-btndown=true;startDragMode(ord,mouseAbs(e));e.stopPropagation();e.preventDefault();return false;};},newSelection:function(e){e.pageX=e.originalEvent.changedTouches[0].pageX;e.pageY=e.originalEvent.changedTouches[0].pageY;return newSelection(e);},isSupported:hasTouchSupport,support:detectSupport()};}());var Coords=(function(){var x1=0,y1=0,x2=0,y2=0,ox,oy;function setPressed(pos)
-{pos=rebound(pos);x2=x1=pos[0];y2=y1=pos[1];}
-function setCurrent(pos)
-{pos=rebound(pos);ox=pos[0]-x2;oy=pos[1]-y2;x2=pos[0];y2=pos[1];}
-function getOffset()
-{return[ox,oy];}
-function moveOffset(offset)
-{var ox=offset[0],oy=offset[1];if(0>x1+ox){ox-=ox+x1;}
-if(0>y1+oy){oy-=oy+y1;}
-if(boundy<y2+oy){oy+=boundy-(y2+oy);}
-if(boundx<x2+ox){ox+=boundx-(x2+ox);}
-x1+=ox;x2+=ox;y1+=oy;y2+=oy;}
-function getCorner(ord)
-{var c=getFixed();switch(ord){case'ne':return[c.x2,c.y];case'nw':return[c.x,c.y];case'se':return[c.x2,c.y2];case'sw':return[c.x,c.y2];}}
-function getFixed()
-{if(!options.aspectRatio){return getRect();}
-var aspect=options.aspectRatio,min_x=options.minSize[0]/xscale,max_x=options.maxSize[0]/xscale,max_y=options.maxSize[1]/yscale,rw=x2-x1,rh=y2-y1,rwa=Math.abs(rw),rha=Math.abs(rh),real_ratio=rwa/rha,xx,yy;if(max_x===0){max_x=boundx*10;}
-if(max_y===0){max_y=boundy*10;}
-if(real_ratio<aspect){yy=y2;w=rha*aspect;xx=rw<0?x1-w:w+x1;if(xx<0){xx=0;h=Math.abs((xx-x1)/aspect);yy=rh<0?y1-h:h+y1;}else if(xx>boundx){xx=boundx;h=Math.abs((xx-x1)/aspect);yy=rh<0?y1-h:h+y1;}}else{xx=x2;h=rwa/aspect;yy=rh<0?y1-h:y1+h;if(yy<0){yy=0;w=Math.abs((yy-y1)*aspect);xx=rw<0?x1-w:w+x1;}else if(yy>boundy){yy=boundy;w=Math.abs(yy-y1)*aspect;xx=rw<0?x1-w:w+x1;}}
-if(xx>x1){if(xx-x1<min_x){xx=x1+min_x;}else if(xx-x1>max_x){xx=x1+max_x;}
-if(yy>y1){yy=y1+(xx-x1)/aspect;}else{yy=y1-(xx-x1)/aspect;}}else if(xx<x1){if(x1-xx<min_x){xx=x1-min_x;}else if(x1-xx>max_x){xx=x1-max_x;}
-if(yy>y1){yy=y1+(x1-xx)/aspect;}else{yy=y1-(x1-xx)/aspect;}}
-if(xx<0){x1-=xx;xx=0;}else if(xx>boundx){x1-=xx-boundx;xx=boundx;}
-if(yy<0){y1-=yy;yy=0;}else if(yy>boundy){y1-=yy-boundy;yy=boundy;}
-return makeObj(flipCoords(x1,y1,xx,yy));}
-function rebound(p)
-{if(p[0]<0){p[0]=0;}
-if(p[1]<0){p[1]=0;}
-if(p[0]>boundx){p[0]=boundx;}
-if(p[1]>boundy){p[1]=boundy;}
-return[p[0],p[1]];}
-function flipCoords(x1,y1,x2,y2)
-{var xa=x1,xb=x2,ya=y1,yb=y2;if(x2<x1){xa=x2;xb=x1;}
-if(y2<y1){ya=y2;yb=y1;}
-return[Math.round(xa),Math.round(ya),Math.round(xb),Math.round(yb)];}
-function getRect()
-{var xsize=x2-x1,ysize=y2-y1,delta;if(xlimit&&(Math.abs(xsize)>xlimit)){x2=(xsize>0)?(x1+xlimit):(x1-xlimit);}
-if(ylimit&&(Math.abs(ysize)>ylimit)){y2=(ysize>0)?(y1+ylimit):(y1-ylimit);}
-if(ymin/yscale&&(Math.abs(ysize)<ymin/yscale)){y2=(ysize>0)?(y1+ymin/yscale):(y1-ymin/yscale);}
-if(xmin/xscale&&(Math.abs(xsize)<xmin/xscale)){x2=(xsize>0)?(x1+xmin/xscale):(x1-xmin/xscale);}
-if(x1<0){x2-=x1;x1-=x1;}
-if(y1<0){y2-=y1;y1-=y1;}
-if(x2<0){x1-=x2;x2-=x2;}
-if(y2<0){y1-=y2;y2-=y2;}
-if(x2>boundx){delta=x2-boundx;x1-=delta;x2-=delta;}
-if(y2>boundy){delta=y2-boundy;y1-=delta;y2-=delta;}
-if(x1>boundx){delta=x1-boundy;y2-=delta;y1-=delta;}
-if(y1>boundy){delta=y1-boundy;y2-=delta;y1-=delta;}
-return makeObj(flipCoords(x1,y1,x2,y2));}
-function makeObj(a)
-{return{x:a[0],y:a[1],x2:a[2],y2:a[3],w:a[2]-a[0],h:a[3]-a[1]};}
-return{flipCoords:flipCoords,setPressed:setPressed,setCurrent:setCurrent,getOffset:getOffset,moveOffset:moveOffset,getCorner:getCorner,getFixed:getFixed};}());var Selection=(function(){var awake,hdep=370;var borders={};var handle={};var seehandles=false;var hhs=options.handleOffset;function insertBorder(type)
-{var jq=$('<div />').css({position:'absolute',opacity:options.borderOpacity}).addClass(cssClass(type));$img_holder.append(jq);return jq;}
-function dragDiv(ord,zi)
-{var jq=$('<div />').mousedown(createDragger(ord)).css({cursor:ord+'-resize',position:'absolute',zIndex:zi});if(Touch.support){jq.bind('touchstart',Touch.createDragger(ord));}
-$hdl_holder.append(jq);return jq;}
-function insertHandle(ord)
-{return dragDiv(ord,hdep++).css({top:px(-hhs+1),left:px(-hhs+1),opacity:options.handleOpacity}).addClass(cssClass('handle'));}
-function insertDragbar(ord)
-{var s=options.handleSize,h=s,w=s,t=hhs,l=hhs;switch(ord){case'n':case's':w=pct(100);break;case'e':case'w':h=pct(100);break;}
-return dragDiv(ord,hdep++).width(w).height(h).css({top:px(-t+1),left:px(-l+1)});}
-function createHandles(li)
-{var i;for(i=0;i<li.length;i++){handle[li[i]]=insertHandle(li[i]);}}
-function moveHandles(c)
-{var midvert=Math.round((c.h/2)-hhs),midhoriz=Math.round((c.w/2)-hhs),north=-hhs+1,west=-hhs+1,east=c.w-hhs,south=c.h-hhs,x,y;if(handle.e){handle.e.css({top:px(midvert),left:px(east)});handle.w.css({top:px(midvert)});handle.s.css({top:px(south),left:px(midhoriz)});handle.n.css({left:px(midhoriz)});}
-if(handle.ne){handle.ne.css({left:px(east)});handle.se.css({top:px(south),left:px(east)});handle.sw.css({top:px(south)});}
-if(handle.b){handle.b.css({top:px(south)});handle.r.css({left:px(east)});}}
-function moveto(x,y)
-{$img2.css({top:px(-y),left:px(-x)});$sel.css({top:px(y),left:px(x)});}
-function resize(w,h)
-{$sel.width(w).height(h);}
-function refresh()
-{var c=Coords.getFixed();Coords.setPressed([c.x,c.y]);Coords.setCurrent([c.x2,c.y2]);updateVisible();}
-function updateVisible()
-{if(awake){return update();}}
-function update()
-{var c=Coords.getFixed();resize(c.w,c.h);moveto(c.x,c.y);if(seehandles){moveHandles(c);}
-if(!awake){show();}
-options.onChange.call(api,unscale(c));}
-function show()
-{$sel.show();if(options.bgFade){$img.fadeTo(options.fadeTime,bgopacity);}else{$img.css('opacity',bgopacity);}
-awake=true;}
-function release()
-{disableHandles();$sel.hide();if(options.bgFade){$img.fadeTo(options.fadeTime,1);}else{$img.css('opacity',1);}
-awake=false;options.onRelease.call(api);}
-function showHandles()
-{if(seehandles){moveHandles(Coords.getFixed());$hdl_holder.show();}}
-function enableHandles()
-{seehandles=true;if(options.allowResize){moveHandles(Coords.getFixed());$hdl_holder.show();return true;}}
-function disableHandles()
-{seehandles=false;$hdl_holder.hide();}
-function animMode(v)
-{if(animating===v){disableHandles();}else{enableHandles();}}
-function done()
-{animMode(false);refresh();}
-if(options.drawBorders){borders={top:insertBorder('hline'),bottom:insertBorder('hline bottom'),left:insertBorder('vline'),right:insertBorder('vline right')};}
-if(options.dragEdges){handle.t=insertDragbar('n');handle.b=insertDragbar('s');handle.r=insertDragbar('e');handle.l=insertDragbar('w');}
-if(options.sideHandles){createHandles(['n','s','e','w']);}
-if(options.cornerHandles){createHandles(['sw','nw','ne','se']);}
-var $track=newTracker().mousedown(createDragger('move')).css({cursor:'move',position:'absolute',zIndex:360});if(Touch.support){$track.bind('touchstart.jcrop',Touch.createDragger('move'));}
-$img_holder.append($track);disableHandles();return{updateVisible:updateVisible,update:update,release:release,refresh:refresh,isAwake:function(){return awake;},setCursor:function(cursor){$track.css('cursor',cursor);},enableHandles:enableHandles,enableOnly:function(){seehandles=true;},showHandles:showHandles,disableHandles:disableHandles,animMode:animMode,done:done};}());var Tracker=(function(){var onMove=function(){},onDone=function(){},trackDoc=options.trackDocument;function toFront()
-{$trk.css({zIndex:450});if(trackDoc){$(document).bind('mousemove',trackMove).bind('mouseup',trackUp);}}
-function toBack()
-{$trk.css({zIndex:290});if(trackDoc){$(document).unbind('mousemove',trackMove).unbind('mouseup',trackUp);}}
-function trackMove(e)
-{onMove(mouseAbs(e));return false;}
-function trackUp(e)
-{e.preventDefault();e.stopPropagation();if(btndown){btndown=false;onDone(mouseAbs(e));if(Selection.isAwake()){options.onSelect.call(api,unscale(Coords.getFixed()));}
-toBack();onMove=function(){};onDone=function(){};}
-return false;}
-function activateHandlers(move,done)
-{btndown=true;onMove=move;onDone=done;toFront();return false;}
-function trackTouchMove(e)
-{e.pageX=e.originalEvent.changedTouches[0].pageX;e.pageY=e.originalEvent.changedTouches[0].pageY;return trackMove(e);}
-function trackTouchEnd(e)
-{e.pageX=e.originalEvent.changedTouches[0].pageX;e.pageY=e.originalEvent.changedTouches[0].pageY;return trackUp(e);}
-function setCursor(t)
-{$trk.css('cursor',t);}
-if(Touch.support){$(document).bind('touchmove',trackTouchMove).bind('touchend',trackTouchEnd);}
-if(!trackDoc){$trk.mousemove(trackMove).mouseup(trackUp).mouseout(trackUp);}
-$img.before($trk);return{activateHandlers:activateHandlers,setCursor:setCursor};}());var KeyManager=(function(){var $keymgr=$('<input type="radio" />').css({position:'fixed',left:'-120px',width:'12px'}),$keywrap=$('<div />').css({position:'absolute',overflow:'hidden'}).append($keymgr);function watchKeys()
-{if(options.keySupport){$keymgr.show();$keymgr.focus();}}
-function onBlur(e)
-{$keymgr.hide();}
-function doNudge(e,x,y)
-{if(options.allowMove){Coords.moveOffset([x,y]);Selection.updateVisible();}
-e.preventDefault();e.stopPropagation();}
-function parseKey(e)
-{if(e.ctrlKey){return true;}
-shift_down=e.shiftKey?true:false;var nudge=shift_down?10:1;switch(e.keyCode){case 37:doNudge(e,-nudge,0);break;case 39:doNudge(e,nudge,0);break;case 38:doNudge(e,0,-nudge);break;case 40:doNudge(e,0,nudge);break;case 27:Selection.release();break;case 9:return true;}
-return false;}
-if(options.keySupport){$keymgr.keydown(parseKey).blur(onBlur);if(ie6mode||!options.fixedSupport){$keymgr.css({position:'absolute',left:'-20px'});$keywrap.append($keymgr).insertBefore($img);}else{$keymgr.insertBefore($img);}}
-return{watchKeys:watchKeys};}());function setClass(cname)
-{$div.removeClass().addClass(cssClass('holder')).addClass(cname);}
-function animateTo(a,callback)
-{var x1=parseInt(a[0],10)/xscale,y1=parseInt(a[1],10)/yscale,x2=parseInt(a[2],10)/xscale,y2=parseInt(a[3],10)/yscale;if(animating){return;}
-var animto=Coords.flipCoords(x1,y1,x2,y2),c=Coords.getFixed(),initcr=[c.x,c.y,c.x2,c.y2],animat=initcr,interv=options.animationDelay,ix1=animto[0]-initcr[0],iy1=animto[1]-initcr[1],ix2=animto[2]-initcr[2],iy2=animto[3]-initcr[3],pcent=0,velocity=options.swingSpeed;x=animat[0];y=animat[1];x2=animat[2];y2=animat[3];Selection.animMode(true);var anim_timer;function queueAnimator(){window.setTimeout(animator,interv);}
-var animator=(function(){return function(){pcent+=(100-pcent)/velocity;animat[0]=x+((pcent/100)*ix1);animat[1]=y+((pcent/100)*iy1);animat[2]=x2+((pcent/100)*ix2);animat[3]=y2+((pcent/100)*iy2);if(pcent>=99.8){pcent=100;}
-if(pcent<100){setSelectRaw(animat);queueAnimator();}else{Selection.done();if(typeof(callback)==='function'){callback.call(api);}}};}());queueAnimator();}
-function setSelect(rect)
-{setSelectRaw([parseInt(rect[0],10)/xscale,parseInt(rect[1],10)/yscale,parseInt(rect[2],10)/xscale,parseInt(rect[3],10)/yscale]);}
-function setSelectRaw(l)
-{Coords.setPressed([l[0],l[1]]);Coords.setCurrent([l[2],l[3]]);Selection.update();}
-function tellSelect()
-{return unscale(Coords.getFixed());}
-function tellScaled()
-{return Coords.getFixed();}
-function setOptionsNew(opt)
-{setOptions(opt);interfaceUpdate();}
-function disableCrop()
-{options.disabled=true;Selection.disableHandles();Selection.setCursor('default');Tracker.setCursor('default');}
-function enableCrop()
-{options.disabled=false;interfaceUpdate();}
-function cancelCrop()
-{Selection.done();Tracker.activateHandlers(null,null);}
-function destroy()
-{$div.remove();$origimg.show();$(obj).removeData('Jcrop');}
-function setImage(src,callback)
-{Selection.release();disableCrop();var img=new Image();img.onload=function(){var iw=img.width;var ih=img.height;var bw=options.boxWidth;var bh=options.boxHeight;$img.width(iw).height(ih);$img.attr('src',src);$img2.attr('src',src);presize($img,bw,bh);boundx=$img.width();boundy=$img.height();$img2.width(boundx).height(boundy);$trk.width(boundx+(bound*2)).height(boundy+(bound*2));$div.width(boundx).height(boundy);enableCrop();if(typeof(callback)==='function'){callback.call(api);}};img.src=src;}
-function interfaceUpdate(alt)
-{if(options.allowResize){if(alt){Selection.enableOnly();}else{Selection.enableHandles();}}else{Selection.disableHandles();}
-Tracker.setCursor(options.allowSelect?'crosshair':'default');Selection.setCursor(options.allowMove?'move':'default');if(options.hasOwnProperty('setSelect')){setSelect(options.setSelect);Selection.done();delete(options.setSelect);}
-if(options.hasOwnProperty('trueSize')){xscale=options.trueSize[0]/boundx;yscale=options.trueSize[1]/boundy;}
-if(options.hasOwnProperty('bgColor')){if(supportsColorFade()&&options.fadeTime){$div.animate({backgroundColor:options.bgColor},{queue:false,duration:options.fadeTime});}else{$div.css('backgroundColor',options.bgColor);}
-delete(options.bgColor);}
-if(options.hasOwnProperty('bgOpacity')){bgopacity=options.bgOpacity;if(Selection.isAwake()){if(options.fadeTime){$img.fadeTo(options.fadeTime,bgopacity);}else{$div.css('opacity',options.opacity);}}
-delete(options.bgOpacity);}
-xlimit=options.maxSize[0]||0;ylimit=options.maxSize[1]||0;xmin=options.minSize[0]||0;ymin=options.minSize[1]||0;if(options.hasOwnProperty('outerImage')){$img.attr('src',options.outerImage);delete(options.outerImage);}
-Selection.refresh();}
-if(Touch.support){$trk.bind('touchstart',Touch.newSelection);}
-$hdl_holder.hide();interfaceUpdate(true);var api={setImage:setImage,animateTo:animateTo,setSelect:setSelect,setOptions:setOptionsNew,tellSelect:tellSelect,tellScaled:tellScaled,setClass:setClass,disable:disableCrop,enable:enableCrop,cancel:cancelCrop,release:Selection.release,destroy:destroy,focus:KeyManager.watchKeys,getBounds:function(){return[boundx*xscale,boundy*yscale];},getWidgetSize:function(){return[boundx,boundy];},getScaleFactor:function(){return[xscale,yscale];},ui:{holder:$div,selection:$sel}};if($.browser.msie){$div.bind('selectstart',function(){return false;});}
-$origimg.data('Jcrop',api);return api;};$.fn.Jcrop=function(options,callback)
-{function attachWhenDone(from)
-{var opt=(typeof(options)==='object')?options:{};var loadsrc=opt.useImg||from.src;var img=new Image();img.onload=function(){function attachJcrop(){var api=$.Jcrop(from,opt);if(typeof(callback)==='function'){callback.call(api);}}
-function attachAttempt(){if(!img.width||!img.height){window.setTimeout(attachAttempt,50);}else{attachJcrop();}}
-window.setTimeout(attachAttempt,50);};img.src=loadsrc;}
-this.each(function(){if($(this).data('Jcrop')){if(options==='api'){return $(this).data('Jcrop');}
-else{$(this).data('Jcrop').setOptions(options);}}
-else{attachWhenDone(this);}});return this;};$.Jcrop.defaults={allowSelect:true,allowMove:true,allowResize:true,trackDocument:true,baseClass:'jcrop',addClass:null,bgColor:'black',bgOpacity:0.6,bgFade:false,borderOpacity:0.4,handleOpacity:0.5,handleSize:9,handleOffset:5,aspectRatio:0,keySupport:true,cornerHandles:true,sideHandles:true,drawBorders:true,dragEdges:true,fixedSupport:true,touchSupport:null,boxWidth:0,boxHeight:0,boundary:2,fadeTime:400,animationDelay:20,swingSpeed:3,minSelect:[0,0],maxSize:[0,0],minSize:[0,0],onChange:function(){},onSelect:function(){},onRelease:function(){}};}(jQuery));
+(function(a){a.Jcrop=function(b,c){function h(a){return a+"px"}function i(a){return d.baseClass+"-"+a}function j(){return a.fx.step.hasOwnProperty("backgroundColor")}function k(b){var c=a(b).offset();return[c.left,c.top]}function l(a){return[a.pageX-e[0],a.pageY-e[1]]}function m(b){typeof b!="object"&&(b={}),d=a.extend(d,b),a.each(["onChange","onSelect","onRelease","onDblClick"],function(a,b){typeof d[b]!="function"&&(d[b]=function(){})})}function n(a,b){e=k(E),bd.setCursor(a==="move"?a:a+"-resize");if(a==="move")return bd.activateHandlers(p(b),u);var c=ba.getFixed(),d=q(a),f=ba.getCorner(q(d));ba.setPressed(ba.getCorner(d)),ba.setCurrent(f),bd.activateHandlers(o(a,c),u)}function o(a,b){return function(c){if(!d.aspectRatio)switch(a){case"e":c[1]=b.y2;break;case"w":c[1]=b.y2;break;case"n":c[0]=b.x2;break;case"s":c[0]=b.x2}else switch(a){case"e":c[1]=b.y+1;break;case"w":c[1]=b.y+1;break;case"n":c[0]=b.x+1;break;case"s":c[0]=b.x+1}ba.setCurrent(c),bc.update()}}function p(a){var b=a;return be.watchKeys(),function(
+a){ba.moveOffset([a[0]-b[0],a[1]-b[1]]),b=a,bc.update()}}function q(a){switch(a){case"n":return"sw";case"s":return"nw";case"e":return"nw";case"w":return"ne";case"ne":return"sw";case"nw":return"se";case"se":return"nw";case"sw":return"ne"}}function r(a){return function(b){return d.disabled?!1:a==="move"&&!d.allowMove?!1:(e=k(E),X=!0,n(a,l(b)),b.stopPropagation(),b.preventDefault(),!1)}}function s(a,b,c){var d=a.width(),e=a.height();d>b&&b>0&&(d=b,e=b/a.width()*a.height()),e>c&&c>0&&(e=c,d=c/a.height()*a.width()),U=a.width()/d,V=a.height()/e,a.width(d).height(e)}function t(a){return{x:a.x*U,y:a.y*V,x2:a.x2*U,y2:a.y2*V,w:a.w*U,h:a.h*V}}function u(a){var b=ba.getFixed();b.w>d.minSelect[0]&&b.h>d.minSelect[1]?(bc.enableHandles(),bc.done()):bc.release(),bd.setCursor(d.allowSelect?"crosshair":"default")}function v(a){if(d.disabled)return!1;if(!d.allowSelect)return!1;X=!0,e=k(E),bc.disableHandles(),bd.setCursor("crosshair");var b=l(a);return ba.setPressed(b),bc.update(),bd.activateHandlers(w,u),be.watchKeys(),a.stopPropagation
+(),a.preventDefault(),!1}function w(a){ba.setCurrent(a),bc.update()}function z(){var b=a("<div></div>").addClass(i("tracker"));return a.browser.msie&&b.css({opacity:0,backgroundColor:"white"}),b}function bf(a){H.removeClass().addClass(i("holder")).addClass(a)}function bg(a,b){function t(){window.setTimeout(u,l)}var c=a[0]/U,e=a[1]/V,f=a[2]/U,g=a[3]/V;if(Y)return;var h=ba.flipCoords(c,e,f,g),i=ba.getFixed(),j=[i.x,i.y,i.x2,i.y2],k=j,l=d.animationDelay,m=h[0]-j[0],n=h[1]-j[1],o=h[2]-j[2],p=h[3]-j[3],q=0,r=d.swingSpeed;x=k[0],y=k[1],f=k[2],g=k[3],bc.animMode(!0);var s,u=function(){return function(){q+=(100-q)/r,k[0]=x+q/100*m,k[1]=y+q/100*n,k[2]=f+q/100*o,k[3]=g+q/100*p,q>=99.8&&(q=100),q<100?(bi(k),t()):(bc.done(),typeof b=="function"&&b.call(bt))}}();t()}function bh(a){bi([a[0]/U,a[1]/V,a[2]/U,a[3]/V]),d.onSelect.call(bt,t(ba.getFixed())),bc.enableHandles()}function bi(a){ba.setPressed([a[0],a[1]]),ba.setCurrent([a[2],a[3]]),bc.update()}function bj(){return t(ba.getFixed())}function bk(){return ba.getFixed()}function bl
+(a){m(a),bs()}function bm(){d.disabled=!0,bc.disableHandles(),bc.setCursor("default"),bd.setCursor("default")}function bn(){d.disabled=!1,bs()}function bo(){bc.done(),bd.activateHandlers(null,null)}function bp(){H.remove(),B.show(),a(b).removeData("Jcrop")}function bq(a,b){bc.release(),bm();var c=new Image;c.onload=function(){var e=c.width,f=c.height,g=d.boxWidth,h=d.boxHeight;E.width(e).height(f),E.attr("src",a),I.attr("src",a),s(E,g,h),F=E.width(),G=E.height(),I.width(F).height(G),N.width(F+M*2).height(G+M*2),H.width(F).height(G),bb.resize(F,G),bn(),typeof b=="function"&&b.call(bt)},c.src=a}function br(a,b,c){var e=b||d.bgColor;d.bgFade&&j()&&d.fadeTime&&!c?a.animate({backgroundColor:e},{queue:!1,duration:d.fadeTime}):a.css("backgroundColor",e)}function bs(a){d.allowResize?a?bc.enableOnly():bc.enableHandles():bc.disableHandles(),bd.setCursor(d.allowSelect?"crosshair":"default"),bc.setCursor(d.allowMove?"move":"default"),d.hasOwnProperty("trueSize")&&(U=d.trueSize[0]/F,V=d.trueSize[1]/G),d.hasOwnProperty("setSelect"
+)&&(bh(d.setSelect),bc.done(),delete d.setSelect),bb.refresh(),d.bgColor!=O&&(br(d.shade?bb.getShades():H,d.shade?d.shadeColor||d.bgColor:d.bgColor),O=d.bgColor),P!=d.bgOpacity&&(P=d.bgOpacity,d.shade?bb.refresh():bc.setBgOpacity(P)),Q=d.maxSize[0]||0,R=d.maxSize[1]||0,S=d.minSize[0]||0,T=d.minSize[1]||0,d.hasOwnProperty("outerImage")&&(E.attr("src",d.outerImage),delete d.outerImage),bc.refresh()}var d=a.extend({},a.Jcrop.defaults),e,f,g=!1;a.browser.msie&&a.browser.version.split(".")[0]==="6"&&(g=!0),typeof b!="object"&&(b=a(b)[0]),typeof c!="object"&&(c={}),m(c);var A={border:"none",visibility:"visible",margin:0,padding:0,position:"absolute",top:0,left:0},B=a(b),C=!0;if(b.tagName=="IMG"){if(B[0].width!=0&&B[0].height!=0)B.width(B[0].width),B.height(B[0].height);else{var D=new Image;D.src=B[0].src,B.width(D.width),B.height(D.height)}var E=B.clone().removeAttr("id").css(A).show();E.width(B.width()),E.height(B.height()),B.after(E).hide()}else E=B.css(A).show(),C=!1,d.shade===null&&(d.shade=!0);s(E,d.boxWidth,d.
+boxHeight);var F=E.width(),G=E.height(),H=a("<div />").width(F).height(G).addClass(i("holder")).css({position:"relative",backgroundColor:d.bgColor}).insertAfter(B).append(E);d.addClass&&H.addClass(d.addClass);var I=a("<div />"),J=a("<div />").width("100%").height("100%").css({zIndex:310,position:"absolute",overflow:"hidden"}),K=a("<div />").width("100%").height("100%").css("zIndex",320),L=a("<div />").css({position:"absolute",zIndex:600}).dblclick(function(){var a=ba.getFixed();d.onDblClick.call(bt,a)}).insertBefore(E).append(J,K);C&&(I=a("<img />").attr("src",E.attr("src")).css(A).width(F).height(G),J.append(I)),g&&L.css({overflowY:"hidden"});var M=d.boundary,N=z().width(F+M*2).height(G+M*2).css({position:"absolute",top:h(-M),left:h(-M),zIndex:290}).mousedown(v),O=d.bgColor,P=d.bgOpacity,Q,R,S,T,U,V,W=!0,X,Y,Z;e=k(E);var _=function(){function a(){var a={},b=["touchstart","touchmove","touchend"],c=document.createElement("div"),d;try{for(d=0;d<b.length;d++){var e=b[d];e="on"+e;var f=e in c;f||(c.setAttribute(e,"return;"
+),f=typeof c[e]=="function"),a[b[d]]=f}return a.touchstart&&a.touchend&&a.touchmove}catch(g){return!1}}function b(){return d.touchSupport===!0||d.touchSupport===!1?d.touchSupport:a()}return{createDragger:function(a){return function(b){return b.pageX=b.originalEvent.changedTouches[0].pageX,b.pageY=b.originalEvent.changedTouches[0].pageY,d.disabled?!1:a==="move"&&!d.allowMove?!1:(X=!0,n(a,l(b)),b.stopPropagation(),b.preventDefault(),!1)}},newSelection:function(a){return a.pageX=a.originalEvent.changedTouches[0].pageX,a.pageY=a.originalEvent.changedTouches[0].pageY,v(a)},isSupported:a,support:b()}}(),ba=function(){function h(d){d=n(d),c=a=d[0],e=b=d[1]}function i(a){a=n(a),f=a[0]-c,g=a[1]-e,c=a[0],e=a[1]}function j(){return[f,g]}function k(d){var f=d[0],g=d[1];0>a+f&&(f-=f+a),0>b+g&&(g-=g+b),G<e+g&&(g+=G-(e+g)),F<c+f&&(f+=F-(c+f)),a+=f,c+=f,b+=g,e+=g}function l(a){var b=m();switch(a){case"ne":return[b.x2,b.y];case"nw":return[b.x,b.y];case"se":return[b.x2,b.y2];case"sw":return[b.x,b.y2]}}function m(){if(!d.aspectRatio
+)return p();var f=d.aspectRatio,g=d.minSize[0]/U,h=d.maxSize[0]/U,i=d.maxSize[1]/V,j=c-a,k=e-b,l=Math.abs(j),m=Math.abs(k),n=l/m,r,s,t,u;return h===0&&(h=F*10),i===0&&(i=G*10),n<f?(s=e,t=m*f,r=j<0?a-t:t+a,r<0?(r=0,u=Math.abs((r-a)/f),s=k<0?b-u:u+b):r>F&&(r=F,u=Math.abs((r-a)/f),s=k<0?b-u:u+b)):(r=c,u=l/f,s=k<0?b-u:b+u,s<0?(s=0,t=Math.abs((s-b)*f),r=j<0?a-t:t+a):s>G&&(s=G,t=Math.abs(s-b)*f,r=j<0?a-t:t+a)),r>a?(r-a<g?r=a+g:r-a>h&&(r=a+h),s>b?s=b+(r-a)/f:s=b-(r-a)/f):r<a&&(a-r<g?r=a-g:a-r>h&&(r=a-h),s>b?s=b+(a-r)/f:s=b-(a-r)/f),r<0?(a-=r,r=0):r>F&&(a-=r-F,r=F),s<0?(b-=s,s=0):s>G&&(b-=s-G,s=G),q(o(a,b,r,s))}function n(a){return a[0]<0&&(a[0]=0),a[1]<0&&(a[1]=0),a[0]>F&&(a[0]=F),a[1]>G&&(a[1]=G),[a[0],a[1]]}function o(a,b,c,d){var e=a,f=c,g=b,h=d;return c<a&&(e=c,f=a),d<b&&(g=d,h=b),[e,g,f,h]}function p(){var d=c-a,f=e-b,g;return Q&&Math.abs(d)>Q&&(c=d>0?a+Q:a-Q),R&&Math.abs(f)>R&&(e=f>0?b+R:b-R),T/V&&Math.abs(f)<T/V&&(e=f>0?b+T/V:b-T/V),S/U&&Math.abs(d)<S/U&&(c=d>0?a+S/U:a-S/U),a<0&&(c-=a,a-=a),b<0&&(e-=b,b-=b),c<0&&
+(a-=c,c-=c),e<0&&(b-=e,e-=e),c>F&&(g=c-F,a-=g,c-=g),e>G&&(g=e-G,b-=g,e-=g),a>F&&(g=a-G,e-=g,b-=g),b>G&&(g=b-G,e-=g,b-=g),q(o(a,b,c,e))}function q(a){return{x:a[0],y:a[1],x2:a[2],y2:a[3],w:a[2]-a[0],h:a[3]-a[1]}}var a=0,b=0,c=0,e=0,f,g;return{flipCoords:o,setPressed:h,setCurrent:i,getOffset:j,moveOffset:k,getCorner:l,getFixed:m}}(),bb=function(){function f(a,b){e.left.css({height:h(b)}),e.right.css({height:h(b)})}function g(){return i(ba.getFixed())}function i(a){e.top.css({left:h(a.x),width:h(a.w),height:h(a.y)}),e.bottom.css({top:h(a.y2),left:h(a.x),width:h(a.w),height:h(G-a.y2)}),e.right.css({left:h(a.x2),width:h(F-a.x2)}),e.left.css({width:h(a.x)})}function j(){return a("<div />").css({position:"absolute",backgroundColor:d.shadeColor||d.bgColor}).appendTo(c)}function k(){b||(b=!0,c.insertBefore(E),g(),bc.setBgOpacity(1,0,1),I.hide(),l(d.shadeColor||d.bgColor,1),bc.isAwake()?n(d.bgOpacity,1):n(1,1))}function l(a,b){br(p(),a,b)}function m(){b&&(c.remove(),I.show(),b=!1,bc.isAwake()?bc.setBgOpacity(d.bgOpacity
+,1,1):(bc.setBgOpacity(1,1,1),bc.disableHandles()),br(H,0,1))}function n(a,e){b&&(d.bgFade&&!e?c.animate({opacity:1-a},{queue:!1,duration:d.fadeTime}):c.css({opacity:1-a}))}function o(){d.shade?k():m(),bc.isAwake()&&n(d.bgOpacity)}function p(){return c.children()}var b=!1,c=a("<div />").css({position:"absolute",zIndex:240,opacity:0}),e={top:j(),left:j().height(G),right:j().height(G),bottom:j()};return{update:g,updateRaw:i,getShades:p,setBgColor:l,enable:k,disable:m,resize:f,refresh:o,opacity:n}}(),bc=function(){function k(b){var c=a("<div />").css({position:"absolute",opacity:d.borderOpacity}).addClass(i(b));return J.append(c),c}function l(b,c){var d=a("<div />").mousedown(r(b)).css({cursor:b+"-resize",position:"absolute",zIndex:c}).addClass("ord-"+b);return _.support&&d.bind("touchstart.jcrop",_.createDragger(b)),K.append(d),d}function m(a){var b=d.handleSize;return l(a,c++).css({opacity:d.handleOpacity}).width(b).height(b).addClass(i("handle"))}function n(a){return l(a,c++).addClass("jcrop-dragbar")}function o
+(a){var b;for(b=0;b<a.length;b++)g[a[b]]=n(a[b])}function p(a){var b,c;for(c=0;c<a.length;c++){switch(a[c]){case"n":b="hline";break;case"s":b="hline bottom";break;case"e":b="vline right";break;case"w":b="vline"}e[a[c]]=k(b)}}function q(a){var b;for(b=0;b<a.length;b++)f[a[b]]=m(a[b])}function s(a,b){d.shade||I.css({top:h(-b),left:h(-a)}),L.css({top:h(b),left:h(a)})}function u(a,b){L.width(a).height(b)}function v(){var a=ba.getFixed();ba.setPressed([a.x,a.y]),ba.setCurrent([a.x2,a.y2]),w()}function w(a){if(b)return x(a)}function x(a){var c=ba.getFixed();u(c.w,c.h),s(c.x,c.y),d.shade&&bb.updateRaw(c),b||A(),a?d.onSelect.call(bt,t(c)):d.onChange.call(bt,t(c))}function y(a,c,e){if(!b&&!c)return;d.bgFade&&!e?E.animate({opacity:a},{queue:!1,duration:d.fadeTime}):E.css("opacity",a)}function A(){L.show(),d.shade?bb.opacity(P):y(P,!0),b=!0}function B(){F(),L.hide(),d.shade?bb.opacity(1):y(1),b=!1,d.onRelease.call(bt)}function C(){j&&K.show()}function D(){j=!0;if(d.allowResize)return K.show(),!0}function F(){j=!1,K.hide(
+)}function G(a){Y===a?F():D()}function H(){G(!1),v()}var b,c=370,e={},f={},g={},j=!1;d.dragEdges&&a.isArray(d.createDragbars)&&o(d.createDragbars),a.isArray(d.createHandles)&&q(d.createHandles),d.drawBorders&&a.isArray(d.createBorders)&&p(d.createBorders),a(document).bind("touchstart.jcrop-ios",function(b){a(b.currentTarget).hasClass("jcrop-tracker")&&b.stopPropagation()});var M=z().mousedown(r("move")).css({cursor:"move",position:"absolute",zIndex:360});return _.support&&M.bind("touchstart.jcrop",_.createDragger("move")),J.append(M),F(),{updateVisible:w,update:x,release:B,refresh:v,isAwake:function(){return b},setCursor:function(a){M.css("cursor",a)},enableHandles:D,enableOnly:function(){j=!0},showHandles:C,disableHandles:F,animMode:G,setBgOpacity:y,done:H}}(),bd=function(){function f(){N.css({zIndex:450}),_.support&&a(document).bind("touchmove.jcrop",k).bind("touchend.jcrop",m),e&&a(document).bind("mousemove.jcrop",h).bind("mouseup.jcrop",i)}function g(){N.css({zIndex:290}),a(document).unbind(".jcrop")}function h
+(a){return b(l(a)),!1}function i(a){return a.preventDefault(),a.stopPropagation(),X&&(X=!1,c(l(a)),bc.isAwake()&&d.onSelect.call(bt,t(ba.getFixed())),g(),b=function(){},c=function(){}),!1}function j(a,d){return X=!0,b=a,c=d,f(),!1}function k(a){return a.pageX=a.originalEvent.changedTouches[0].pageX,a.pageY=a.originalEvent.changedTouches[0].pageY,h(a)}function m(a){return a.pageX=a.originalEvent.changedTouches[0].pageX,a.pageY=a.originalEvent.changedTouches[0].pageY,i(a)}function n(a){N.css("cursor",a)}var b=function(){},c=function(){},e=d.trackDocument;return e||N.mousemove(h).mouseup(i).mouseout(i),E.before(N),{activateHandlers:j,setCursor:n}}(),be=function(){function e(){d.keySupport&&(b.show(),b.focus())}function f(a){b.hide()}function h(a,b,c){d.allowMove&&(ba.moveOffset([b,c]),bc.updateVisible(!0)),a.preventDefault(),a.stopPropagation()}function i(a){if(a.ctrlKey||a.metaKey)return!0;Z=a.shiftKey?!0:!1;var b=Z?10:1;switch(a.keyCode){case 37:h(a,-b,0);break;case 39:h(a,b,0);break;case 38:h(a,0,-b);break;case 40
+:h(a,0,b);break;case 27:d.allowSelect&&bc.release();break;case 9:return!0}return!1}var b=a('<input type="radio" />').css({position:"fixed",left:"-120px",width:"12px"}),c=a("<div />").css({position:"absolute",overflow:"hidden"}).append(b);return d.keySupport&&(b.keydown(i).blur(f),g||!d.fixedSupport?(b.css({position:"absolute",left:"-20px"}),c.append(b).insertBefore(E)):b.insertBefore(E)),{watchKeys:e}}();_.support&&N.bind("touchstart.jcrop",_.newSelection),K.hide(),bs(!0);var bt={setImage:bq,animateTo:bg,setSelect:bh,setOptions:bl,tellSelect:bj,tellScaled:bk,setClass:bf,disable:bm,enable:bn,cancel:bo,release:bc.release,destroy:bp,focus:be.watchKeys,getBounds:function(){return[F*U,G*V]},getWidgetSize:function(){return[F,G]},getScaleFactor:function(){return[U,V]},getOptions:function(){return d},ui:{holder:H,selection:L}};return a.browser.msie&&H.bind("selectstart",function(){return!1}),B.data("Jcrop",bt),bt},a.fn.Jcrop=function(b,c){var d;return this.each(function(){if(a(this).data("Jcrop")){if(b==="api")return a
+(this).data("Jcrop");a(this).data("Jcrop").setOptions(b)}else this.tagName=="IMG"?a.Jcrop.Loader(this,function(){a(this).css({display:"block",visibility:"hidden"}),d=a.Jcrop(this,b),a.isFunction(c)&&c.call(d)}):(a(this).css({display:"block",visibility:"hidden"}),d=a.Jcrop(this,b),a.isFunction(c)&&c.call(d))}),this},a.Jcrop.Loader=function(b,c,d){function g(){f.complete?(e.unbind(".jcloader"),a.isFunction(c)&&c.call(f)):window.setTimeout(g,50)}var e=a(b),f=e[0];e.bind("load.jcloader",g).bind("error.jcloader",function(b){e.unbind(".jcloader"),a.isFunction(d)&&d.call(f)}),f.complete&&a.isFunction(c)&&(e.unbind(".jcloader"),c.call(f))},a.Jcrop.defaults={allowSelect:!0,allowMove:!0,allowResize:!0,trackDocument:!0,baseClass:"jcrop",addClass:null,bgColor:"black",bgOpacity:.6,bgFade:!1,borderOpacity:.4,handleOpacity:.5,handleSize:7,aspectRatio:0,keySupport:!0,createHandles:["n","s","e","w","nw","ne","se","sw"],createDragbars:["n","s","e","w"],createBorders:["n","s","e","w"],drawBorders:!0,dragEdges:!0,fixedSupport:!0,
+touchSupport:null,shade:null,boxWidth:0,boxHeight:0,boundary:2,fadeTime:400,animationDelay:20,swingSpeed:3,minSelect:[0,0],maxSize:[0,0],minSize:[0,0],onChange:function(){},onSelect:function(){},onDblClick:function(){},onRelease:function(){}}})(jQuery);
View
123