Commit e51bfcc8a956639c63879f55e1bc02b274a9315f
Exists in
master
and in
1 other branch
Merge branch 'ruby-1.9.3-upgrade'
Showing
26 changed files
with
42 additions
and
730 deletions
Show diff stats
.travis.yml
Gemfile
... | ... | @@ -19,7 +19,7 @@ gem "has_scope", "0.4.2" |
19 | 19 | gem "responders", "0.4.8" |
20 | 20 | gem "thoughtbot-clearance", "0.8.2", |
21 | 21 | :require => "clearance" |
22 | -gem "fastercsv", "1.5.1" | |
22 | +gem "fastercsv", "1.5.1", :platforms => :ruby_18 | |
23 | 23 | gem "delayed_job", "2.0.6" |
24 | 24 | gem "redis", "~> 3.0.1" |
25 | 25 | |
... | ... | @@ -39,6 +39,7 @@ group :cucumber do |
39 | 39 | end |
40 | 40 | |
41 | 41 | group :test do |
42 | + gem "test-unit", "1.2.3" | |
42 | 43 | gem "rspec", "~>1.3.1" |
43 | 44 | gem "rspec-rails", "1.3.4" |
44 | 45 | gem "shoulda", "~>2.10.1" | ... | ... |
Gemfile.lock
... | ... | @@ -34,6 +34,8 @@ GEM |
34 | 34 | gherkin (2.5.4) |
35 | 35 | json (>= 1.4.6) |
36 | 36 | has_scope (0.4.2) |
37 | + hoe (3.6.0) | |
38 | + rake (>= 0.8, < 11.0) | |
37 | 39 | hoptoad_notifier (2.4.9) |
38 | 40 | activesupport |
39 | 41 | builder |
... | ... | @@ -74,6 +76,8 @@ GEM |
74 | 76 | sendgrid (0.1.4) |
75 | 77 | shoulda (2.10.3) |
76 | 78 | term-ansicolor (1.0.7) |
79 | + test-unit (1.2.3) | |
80 | + hoe (>= 1.5.1) | |
77 | 81 | thoughtbot-clearance (0.8.2) |
78 | 82 | webrat (0.5.3) |
79 | 83 | nokogiri (>= 1.2.0) |
... | ... | @@ -116,6 +120,7 @@ DEPENDENCIES |
116 | 120 | rubaidh-google_analytics (= 1.1.4) |
117 | 121 | sendgrid (= 0.1.4) |
118 | 122 | shoulda (~> 2.10.1) |
123 | + test-unit (= 1.2.3) | |
119 | 124 | thoughtbot-clearance (= 0.8.2) |
120 | 125 | webrat (= 0.5.3) |
121 | 126 | xml-simple (= 1.0.12) | ... | ... |
app/controllers/questions_controller.rb
1 | -require 'fastercsv' | |
2 | -require 'generator.rb' | |
3 | - | |
4 | 1 | class QuestionsController < InheritedResources::Base |
5 | 2 | actions :all, :except => [ :show, :edit, :delete ] |
6 | 3 | before_filter :authenticate |
... | ... | @@ -372,7 +369,7 @@ class QuestionsController < InheritedResources::Base |
372 | 369 | # objects. This solution depends on Array#to_xml rendering each |
373 | 370 | # member in the correct order. Internally, it just uses, #each, so |
374 | 371 | # this _should_ work. |
375 | - ids = Generator.new{ |g| @questions.each{ |q| g.yield q.id } } | |
372 | + ids = Enumerator.new{ |g| @questions.each{ |q| g.yield q.id } } | |
376 | 373 | extra_info = Proc.new do |o| |
377 | 374 | id = ids.next |
378 | 375 | counts.each_pair do |attr, hash| | ... | ... |
app/models/question.rb
app/views/shared/_javascript.html.erb
config/environment.rb
1 | 1 | # Be sure to restart your server when you modify this file |
2 | +Encoding.default_external = Encoding.default_internal = Encoding::UTF_8 if defined? Encoding | |
2 | 3 | |
3 | 4 | # Specifies gem version of Rails to use when vendor/rails is not present |
4 | 5 | RAILS_GEM_VERSION = '2.3.18' unless defined? RAILS_GEM_VERSION | ... | ... |
... | ... | @@ -0,0 +1,8 @@ |
1 | +class Fixnum | |
2 | + # actionpack-2.3.18/lib/action_controller/assertions/selector_assertions.rb:276 | |
3 | + # attempts to get encoding of Fixnum when doing has_tag "foo", :text => 3 | |
4 | + # Example: bundle exec spec spec/integration/visitors_spec.rb -e "should return the bounces for a single question" | |
5 | + def encoding | |
6 | + Encoding::UTF_8 | |
7 | + end | |
8 | +end | ... | ... |
lib/tasks/import_bt_test_data.rb
... | ... | @@ -11,7 +11,7 @@ inserts = [] |
11 | 11 | |
12 | 12 | timestring = Time.now.to_s(:db) #isn't rails awesome? |
13 | 13 | totalchoices=0 |
14 | -FasterCSV.foreach(BASEDIR + "choices_7000.txt", {:headers => :first_row, :return_headers => false}) do |choice| | |
14 | +CSVBridge.foreach(BASEDIR + "choices_7000.txt", {:headers => :first_row, :return_headers => false}) do |choice| | |
15 | 15 | # for each choice, create an insert with unique id |
16 | 16 | id = choice[0].to_i + choice_offset |
17 | 17 | wins = choice[1].to_i |
... | ... | @@ -26,7 +26,7 @@ ActiveRecord::Base.connection.execute(sql) |
26 | 26 | inserts = [] |
27 | 27 | prompt_offset = Prompt.last.id |
28 | 28 | totalprompts = 0 |
29 | -FasterCSV.foreach(BASEDIR + "prompts_7000.txt", {:headers => :first_row, :return_headers => false}) do |prompt| | |
29 | +CSVBridge.foreach(BASEDIR + "prompts_7000.txt", {:headers => :first_row, :return_headers => false}) do |prompt| | |
30 | 30 | id = prompt[0].to_i + prompt_offset |
31 | 31 | left_choice_id = prompt[1].to_i + choice_offset |
32 | 32 | right_choice_id = prompt[2].to_i + choice_offset |
... | ... | @@ -43,7 +43,7 @@ ActiveRecord::Base.connection.execute(sql) |
43 | 43 | inserts = [] |
44 | 44 | vote_offset = Vote.last.id |
45 | 45 | totalvotes=0 |
46 | -FasterCSV.foreach(BASEDIR + "votes_7000.txt", {:headers => :first_row, :return_headers => false}) do |vote| | |
46 | +CSVBridge.foreach(BASEDIR + "votes_7000.txt", {:headers => :first_row, :return_headers => false}) do |vote| | |
47 | 47 | id = vote[0].to_i + vote_offset |
48 | 48 | prompt_id = vote[1].to_i + prompt_offset |
49 | 49 | choice_id = vote[2].to_i + choice_offset | ... | ... |
lib/tasks/test_api.rake
... | ... | @@ -314,7 +314,7 @@ namespace :test_api do |
314 | 314 | sum = total_appearances = appearances_by_choice_id.values.inject(0) {|sum, x| sum +=x} |
315 | 315 | mean = average_appearances = total_appearances.to_f / appearances_by_choice_id.size.to_f |
316 | 316 | |
317 | - if sum > 0: | |
317 | + if sum > 0 | |
318 | 318 | stddev = Math.sqrt( appearances_by_choice_id.values.inject(0) { |sum, e| sum + (e - mean) ** 2 } / appearances_by_choice_id.size.to_f ) |
319 | 319 | |
320 | 320 | # add small number to standard deviation to give some leniency when stddev is low | ... | ... |
spec/integration/questions_spec.rb
... | ... | @@ -335,7 +335,7 @@ describe "Questions" do |
335 | 335 | |
336 | 336 | get_auth upload_to_participation_rate_question_path(q, :format => 'xml') |
337 | 337 | response.should be_success |
338 | - response.body.should have_tag("uploadparticipationrate", :text => "0.555555555555556") | |
338 | + response.body.should have_tag("uploadparticipationrate", :text => (5.0 / 9.0).to_s) | |
339 | 339 | end |
340 | 340 | end |
341 | 341 | ... | ... |
spec/models/question_spec.rb
... | ... | @@ -539,7 +539,7 @@ describe Question do |
539 | 539 | |
540 | 540 | # Not specifying exact file syntax, it's likely to change frequently |
541 | 541 | # |
542 | - rows = FasterCSV.parse(csv) | |
542 | + rows = CSVBridge.parse(csv) | |
543 | 543 | rows.first.should include("Vote ID") |
544 | 544 | rows.first.should_not include("Idea ID") |
545 | 545 | |
... | ... | @@ -567,7 +567,7 @@ describe Question do |
567 | 567 | it "should export non vote data to a string" do |
568 | 568 | csv = @aoi_question.export('non_votes') |
569 | 569 | |
570 | - rows = FasterCSV.parse(csv) | |
570 | + rows = CSVBridge.parse(csv) | |
571 | 571 | rows.first.should include("Record ID") |
572 | 572 | rows.first.should include("Record Type") |
573 | 573 | rows.first.should_not include("Idea ID") |
... | ... | @@ -580,7 +580,7 @@ describe Question do |
580 | 580 | |
581 | 581 | # Not specifying exact file syntax, it's likely to change frequently |
582 | 582 | # |
583 | - rows = FasterCSV.parse(csv) | |
583 | + rows = CSVBridge.parse(csv) | |
584 | 584 | rows.first.should include("Idea ID") |
585 | 585 | rows.first.should_not include("Skip ID") |
586 | 586 | end |
... | ... | @@ -648,7 +648,7 @@ describe Question do |
648 | 648 | |
649 | 649 | # Not specifying exact file syntax, it's likely to change frequently |
650 | 650 | # |
651 | - rows = FasterCSV.parse(csv) | |
651 | + rows = CSVBridge.parse(csv) | |
652 | 652 | rows.first.should include("Idea ID") |
653 | 653 | rows.first.should_not include("Skip ID") |
654 | 654 | |
... | ... | @@ -664,7 +664,7 @@ describe Question do |
664 | 664 | |
665 | 665 | # Not specifying exact file syntax, it's likely to change frequently |
666 | 666 | # |
667 | - rows = FasterCSV.parse(csv) | |
667 | + rows = CSVBridge.parse(csv) | |
668 | 668 | rows.first.should include("Vote ID") |
669 | 669 | rows.first.should_not include("Idea ID") |
670 | 670 | ... | ... |
No preview for this file type
No preview for this file type
vendor/plugins/jrails/CHANGELOG
... | ... | @@ -1,35 +0,0 @@ |
1 | -SVN | |
2 | -* better approximate scriptaculous effect names | |
3 | -* add support for page[:element_id].visual_effect(:effect) as well as page.visual_effect(:effect, :element_id) | |
4 | -* added a reset form function to jrails.js (stolen from jquery form) | |
5 | -* can now use jquery selectors in all functions | |
6 | -* added javascript_function helper to render inline rjs helpers | |
7 | -* better support for sortable_element | |
8 | -* updated to jquery-ui 1.5.1 | |
9 | - | |
10 | -0.4.0 (16 June 2008) | |
11 | -* updated to jquery-ui 1.5 & merged js into single file | |
12 | -* Added jQuery.noConflict support | |
13 | -* support for value/val | |
14 | -* additional support for update/delete methods | |
15 | -* support for success/failure hash | |
16 | -* setRequestHeader now gets called globally | |
17 | -* Better support for droppables, sortables | |
18 | -* Add support for prototype AJAX callbacks | |
19 | -* better support for AJAX form calls | |
20 | - | |
21 | -0.3.0 (22 Feb 2008) | |
22 | -* updated to jquery-fx 1.0b and jquery-ui 1.5b | |
23 | -* Add text/javascript request header to fix format.js | |
24 | -* Added Tasks (thanks ggarside) | |
25 | -* Improve visual_effects methods | |
26 | -* Fixed some RJS calls | |
27 | -* Fixed observer code for ie | |
28 | - | |
29 | -0.2.0 (26 Nov 2007) | |
30 | -* Vastly Improved FX | |
31 | -* Improved Form Observers | |
32 | -* Fixed Rails <= 1.2.6 Compatibility | |
33 | - | |
34 | -0.1.0 (15 Nov 2007) | |
35 | -* Initial release |
vendor/plugins/jrails/README
... | ... | @@ -1,21 +0,0 @@ |
1 | -= jRails | |
2 | - | |
3 | -jRails is a drop-in jQuery replacement for the Rails Prototype/script.aculo.us helpers. | |
4 | - | |
5 | -== Resources | |
6 | - | |
7 | -Install | |
8 | - | |
9 | -* .script/plugin install http://ennerchi.googlecode.com/svn/trunk/plugins/jrails | |
10 | - | |
11 | -Project Site | |
12 | - | |
13 | -* http://code.google.com/p/ennerchi/ | |
14 | - | |
15 | -Web Site | |
16 | - | |
17 | -* http://www.ennerchi.com/projects/jrails | |
18 | - | |
19 | -Group Site | |
20 | - | |
21 | -* http://groups.google.com/group/jrails | |
22 | 0 | \ No newline at end of file |
vendor/plugins/jrails/init.rb
... | ... | @@ -1,6 +0,0 @@ |
1 | -# uncomment to use jQuery.noConflict() | |
2 | -#ActionView::Helpers::PrototypeHelper::JQUERY_VAR = 'jQuery' | |
3 | - | |
4 | -ActionView::Helpers::AssetTagHelper::JAVASCRIPT_DEFAULT_SOURCES = ['jquery','jquery-ui','jrails'] | |
5 | -ActionView::Helpers::AssetTagHelper::reset_javascript_include_default | |
6 | -require 'jrails' |
vendor/plugins/jrails/install.rb
... | ... | @@ -1,9 +0,0 @@ |
1 | -# Install hook code here | |
2 | -puts "Copying files..." | |
3 | -dir = "javascripts" | |
4 | -["jquery-ui.js", "jquery.js", "jrails.js"].each do |js_file| | |
5 | - dest_file = File.join(RAILS_ROOT, "public", dir, js_file) | |
6 | - src_file = File.join(File.dirname(__FILE__) , dir, js_file) | |
7 | - FileUtils.cp_r(src_file, dest_file) | |
8 | -end | |
9 | -puts "Files copied - Installation complete!" |
vendor/plugins/jrails/javascripts/jquery-ui.js
... | ... | @@ -1 +0,0 @@ |
1 | -(function(B){var H=B.fn.remove,D=B.browser.mozilla&&(parseFloat(B.browser.version)<1.9);B.ui={version:"1.6rc5",plugin:{add:function(K,J,N){var M=B.ui[K].prototype;for(var L in N){M.plugins[L]=M.plugins[L]||[];M.plugins[L].push([J,N[L]])}},call:function(J,L,K){var N=J.plugins[L];if(!N){return }for(var M=0;M<N.length;M++){if(J.options[N[M][0]]){N[M][1].apply(J.element,K)}}}},contains:function(K,J){return document.compareDocumentPosition?K.compareDocumentPosition(J)&16:K!==J&&K.contains(J)},cssCache:{},css:function(J){if(B.ui.cssCache[J]){return B.ui.cssCache[J]}var K=B('<div class="ui-gen"></div>').addClass(J).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");B.ui.cssCache[J]=!!((!(/auto|default/).test(K.css("cursor"))||(/^[1-9]/).test(K.css("height"))||(/^[1-9]/).test(K.css("width"))||!(/none/).test(K.css("backgroundImage"))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(K.css("backgroundColor"))));try{B("body").get(0).removeChild(K.get(0))}catch(L){}return B.ui.cssCache[J]},hasScroll:function(L,J){if(B(L).css("overflow")=="hidden"){return false}var M=(J&&J=="left")?"scrollLeft":"scrollTop",K=false;if(L[M]>0){return true}L[M]=1;K=(L[M]>0);L[M]=0;return K},isOverAxis:function(J,L,K){return(J>L)&&(J<(L+K))},isOver:function(O,J,N,M,L,K){return B.ui.isOverAxis(O,N,L)&&B.ui.isOverAxis(J,M,K)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(D){var E=B.attr,C=B.fn.removeAttr,I="http://www.w3.org/2005/07/aaa",F=/^aria-/,G=/^wairole:/;B.attr=function(K,J,L){var M=L!==undefined;return(J=="role"?(M?E.call(this,K,J,"wairole:"+L):(E.apply(this,arguments)||"").replace(G,"")):(F.test(J)?(M?K.setAttributeNS(I,J.replace(F,"aaa:"),L):E.call(this,K,J.replace(F,"aaa:"))):E.apply(this,arguments)))};B.fn.removeAttr=function(J){return(F.test(J)?this.each(function(){this.removeAttributeNS(I,J.replace(F,""))}):C.call(this,J))}}B.fn.extend({remove:function(){B("*",this).add(this).each(function(){B(this).triggerHandler("remove")});return H.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var J;if((B.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){J=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(B.curCSS(this,"position",1))&&(/(auto|scroll)/).test(B.curCSS(this,"overflow",1)+B.curCSS(this,"overflow-y",1)+B.curCSS(this,"overflow-x",1))}).eq(0)}else{J=this.parents().filter(function(){return(/(auto|scroll)/).test(B.curCSS(this,"overflow",1)+B.curCSS(this,"overflow-y",1)+B.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!J.length?B(document):J}});B.extend(B.expr[":"],{data:function(L,K,J){return !!B.data(L,J[3])},tabbable:function(J){var L=J.nodeName.toLowerCase();function K(M){return !(B(M).is(":hidden")||B(M).parents(":hidden").length)}return(J.tabIndex>=0&&(("a"==L&&J.href)||(/input|select|textarea|button/.test(L)&&"hidden"!=J.type&&!J.disabled))&&K(J))}});function A(N,J,O,M){function L(Q){var P=B[N][J][Q]||[];return(typeof P=="string"?P.split(/,?\s+/):P)}var K=L("getter");if(M.length==1&&typeof M[0]=="string"){K=K.concat(L("getterSetter"))}return(B.inArray(O,K)!=-1)}B.widget=function(J,K){var L=J.split(".")[0];J=J.split(".")[1];B.fn[J]=function(P){var N=(typeof P=="string"),O=Array.prototype.slice.call(arguments,1);if(N&&P.substring(0,1)=="_"){return this}if(N&&A(L,J,P,O)){var M=B.data(this[0],J);return(M?M[P].apply(M,O):undefined)}return this.each(function(){var Q=B.data(this,J);(!Q&&!N&&B.data(this,J,new B[L][J](this,P)));(Q&&N&&B.isFunction(Q[P])&&Q[P].apply(Q,O))})};B[L]=B[L]||{};B[L][J]=function(N,O){var M=this;this.namespace=L;this.widgetName=J;this.widgetEventPrefix=B[L][J].eventPrefix||J;this.widgetBaseClass=L+"-"+J;this.options=B.extend({},B.widget.defaults,B[L][J].defaults,B.metadata&&B.metadata.get(N)[J],O);this.element=B(N).bind("setData."+J,function(Q,P,R){if(Q.target==N){return M._setData(P,R)}}).bind("getData."+J,function(Q,P){if(Q.target==N){return M._getData(P)}}).bind("remove",function(){return M.destroy()});this._init()};B[L][J].prototype=B.extend({},B.widget.prototype,K);B[L][J].getterSetter="option"};B.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(L,M){var K=L,J=this;if(typeof L=="string"){if(M===undefined){return this._getData(L)}K={};K[L]=M}B.each(K,function(N,O){J._setData(N,O)})},_getData:function(J){return this.options[J]},_setData:function(J,K){this.options[J]=K;if(J=="disabled"){this.element[K?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",K)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(K,L,M){var N=this.options[K],J=(K==this.widgetEventPrefix?K:this.widgetEventPrefix+K);L=B.Event(L);L.type=J;this.element.trigger(L,M);return !(B.isFunction(N)&&N.call(this.element[0],L,M)===false||L.isDefaultPrevented())}};B.widget.defaults={disabled:false};B.ui.mouse={_mouseInit:function(){var J=this;this.element.bind("mousedown."+this.widgetName,function(K){return J._mouseDown(K)}).bind("click."+this.widgetName,function(K){if(J._preventClickEvent){J._preventClickEvent=false;return false}});if(B.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(B.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(L){(this._mouseStarted&&this._mouseUp(L));this._mouseDownEvent=L;var J=this,M=(L.which==1),K=(typeof this.options.cancel=="string"?B(L.target).parents().add(L.target).filter(this.options.cancel).length:false);if(!M||K||!this._mouseCapture(L)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){J.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(L)&&this._mouseDelayMet(L)){this._mouseStarted=(this._mouseStart(L)!==false);if(!this._mouseStarted){L.preventDefault();return true}}this._mouseMoveDelegate=function(N){return J._mouseMove(N)};this._mouseUpDelegate=function(N){return J._mouseUp(N)};B(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(B.browser.safari||L.preventDefault());return true},_mouseMove:function(J){if(B.browser.msie&&!J.button){return this._mouseUp(J)}if(this._mouseStarted){this._mouseDrag(J);return J.preventDefault()}if(this._mouseDistanceMet(J)&&this._mouseDelayMet(J)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,J)!==false);(this._mouseStarted?this._mouseDrag(J):this._mouseUp(J))}return !this._mouseStarted},_mouseUp:function(J){B(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=true;this._mouseStop(J)}return false},_mouseDistanceMet:function(J){return(Math.max(Math.abs(this._mouseDownEvent.pageX-J.pageX),Math.abs(this._mouseDownEvent.pageY-J.pageY))>=this.options.distance)},_mouseDelayMet:function(J){return this.mouseDelayMet},_mouseStart:function(J){},_mouseDrag:function(J){},_mouseStop:function(J){},_mouseCapture:function(J){return true}};B.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);(function(A){A.widget("ui.draggable",A.extend({},A.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.cssNamespace&&this.element.addClass(this.options.cssNamespace+"-draggable"));(this.options.disabled&&this.element.addClass(this.options.cssNamespace+"-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return }this.element.removeData("draggable").unbind(".draggable").removeClass(this.options.cssNamespace+"-draggable "+this.options.cssNamespace+"-draggable-dragging "+this.options.cssNamespace+"-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(B){var C=this.options;if(this.helper||C.disabled||A(B.target).is("."+this.options.cssNamespace+"-resizable-handle")){return false}this.handle=this._getHandle(B);if(!this.handle){return false}return true},_mouseStart:function(B){var C=this.options;this.helper=this._createHelper(B);this._cacheHelperProportions();if(A.ui.ddmanager){A.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};A.extend(this.offset,{click:{left:B.pageX-this.offset.left,top:B.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(B);this.originalPageX=B.pageX;this.originalPageY=B.pageY;if(C.cursorAt){this._adjustOffsetFromHelper(C.cursorAt)}if(C.containment){this._setContainment()}this._trigger("start",B);this._cacheHelperProportions();if(A.ui.ddmanager&&!C.dropBehaviour){A.ui.ddmanager.prepareOffsets(this,B)}this.helper.addClass(C.cssNamespace+"-draggable-dragging");this._mouseDrag(B,true);return true},_mouseDrag:function(B,D){this.position=this._generatePosition(B);this.positionAbs=this._convertPositionTo("absolute");if(!D){var C=this._uiHash();this._trigger("drag",B,C);this.position=C.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(A.ui.ddmanager){A.ui.ddmanager.drag(this,B)}return false},_mouseStop:function(C){var D=false;if(A.ui.ddmanager&&!this.options.dropBehaviour){D=A.ui.ddmanager.drop(this,C)}if(this.dropped){D=this.dropped;this.dropped=false}if((this.options.revert=="invalid"&&!D)||(this.options.revert=="valid"&&D)||this.options.revert===true||(A.isFunction(this.options.revert)&&this.options.revert.call(this.element,D))){var B=this;A(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){B._trigger("stop",C);B._clear()})}else{this._trigger("stop",C);this._clear()}return false},_getHandle:function(C){var B=!this.options.handle||!A(this.options.handle,this.element).length?true:false;A(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==C.target){B=true}});return B},_createHelper:function(C){var D=this.options;var B=A.isFunction(D.helper)?A(D.helper.apply(this.element[0],[C])):(D.helper=="clone"?this.element.clone():this.element);if(!B.parents("body").length){B.appendTo((D.appendTo=="parent"?this.element[0].parentNode:D.appendTo))}if(B[0]!=this.element[0]&&!(/(fixed|absolute)/).test(B.css("position"))){B.css("position","absolute")}return B},_adjustOffsetFromHelper:function(B){if(B.left!=undefined){this.offset.click.left=B.left+this.margins.left}if(B.right!=undefined){this.offset.click.left=this.helperProportions.width-B.right+this.margins.left}if(B.top!=undefined){this.offset.click.top=B.top+this.margins.top}if(B.bottom!=undefined){this.offset.click.top=this.helperProportions.height-B.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var B=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0])){B.left+=this.scrollParent.scrollLeft();B.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body&&A.browser.mozilla)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&A.browser.msie)){B={top:0,left:0}}return{top:B.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:B.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var B=this.element.position();return{top:B.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:B.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var E=this.options;if(E.containment=="parent"){E.containment=this.helper[0].parentNode}if(E.containment=="document"||E.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,A(E.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(A(E.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(E.containment)){var C=A(E.containment)[0];var D=A(E.containment).offset();var B=(A(C).css("overflow")!="hidden");this.containment=[D.left+(parseInt(A(C).css("borderLeftWidth"),10)||0)-this.margins.left,D.top+(parseInt(A(C).css("borderTopWidth"),10)||0)-this.margins.top,D.left+(B?Math.max(C.scrollWidth,C.offsetWidth):C.offsetWidth)-(parseInt(A(C).css("borderLeftWidth"),10)||0)-this.helperProportions.width-this.margins.left,D.top+(B?Math.max(C.scrollHeight,C.offsetHeight):C.offsetHeight)-(parseInt(A(C).css("borderTopWidth"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(E,G){if(!G){G=this.position}var B=E=="absolute"?1:-1;var D=this.options,C=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,F=(/(html|body)/i).test(C[0].tagName);return{top:(G.top+this.offset.relative.top*B+this.offset.parent.top*B-(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(F?0:C.scrollTop()))*B),left:(G.left+this.offset.relative.left*B+this.offset.parent.left*B-(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():F?0:C.scrollLeft())*B)}},_generatePosition:function(D){var H=this.options,E=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,I=(/(html|body)/i).test(E[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var C=D.pageX;var B=D.pageY;if(this.originalPosition){if(this.containment){if(D.pageX-this.offset.click.left<this.containment[0]){C=this.containment[0]+this.offset.click.left}if(D.pageY-this.offset.click.top<this.containment[1]){B=this.containment[1]+this.offset.click.top}if(D.pageX-this.offset.click.left>this.containment[2]){C=this.containment[2]+this.offset.click.left}if(D.pageY-this.offset.click.top>this.containment[3]){B=this.containment[3]+this.offset.click.top}}if(H.grid){var G=this.originalPageY+Math.round((B-this.originalPageY)/H.grid[1])*H.grid[1];B=this.containment?(!(G-this.offset.click.top<this.containment[1]||G-this.offset.click.top>this.containment[3])?G:(!(G-this.offset.click.top<this.containment[1])?G-H.grid[1]:G+H.grid[1])):G;var F=this.originalPageX+Math.round((C-this.originalPageX)/H.grid[0])*H.grid[0];C=this.containment?(!(F-this.offset.click.left<this.containment[0]||F-this.offset.click.left>this.containment[2])?F:(!(F-this.offset.click.left<this.containment[0])?F-H.grid[0]:F+H.grid[0])):F}}return{top:(B-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(I?0:E.scrollTop()))),left:(C-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():I?0:E.scrollLeft()))}},_clear:function(){this.helper.removeClass(this.options.cssNamespace+"-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},_trigger:function(B,C,D){D=D||this._uiHash();A.ui.plugin.call(this,B,[C,D]);if(B=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return A.widget.prototype._trigger.call(this,B,C,D)},plugins:{},_uiHash:function(B){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,options:this.options}}}));A.extend(A.ui.draggable,{version:"1.6rc5",eventPrefix:"drag",defaults:{appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cssNamespace:"ui",cursor:"default",cursorAt:null,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:null,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:null}});A.ui.plugin.add("draggable","connectToSortable",{start:function(B,D){var C=A(this).data("draggable");C.sortables=[];A(D.options.connectToSortable).each(function(){A(this+"").each(function(){if(A.data(this,"sortable")){var E=A.data(this,"sortable");C.sortables.push({instance:E,shouldRevert:E.options.revert});E._refreshItems();E._trigger("activate",B,C)}})})},stop:function(B,D){var C=A(this).data("draggable");A.each(C.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;C.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(B);this.instance.element.triggerHandler("sortreceive",[B,A.extend(this.instance._uiHash(),{sender:C.element})],this.instance.options.receive);this.instance.options.helper=this.instance.options._helper;if(C.options.helper=="original"){this.instance.currentItem.css({top:"auto",left:"auto"})}}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",B,C)}})},drag:function(C,F){var E=A(this).data("draggable"),B=this;var D=function(I){var O=this.offset.click.top,M=this.offset.click.left;var G=this.positionAbs.top,K=this.positionAbs.left;var J=I.height,L=I.width;var N=I.top,H=I.left;return A.ui.isOver(G+O,K+M,N,H,J,L)};A.each(E.sortables,function(G){if(D.call(E,this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=A(B).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return F.helper[0]};C.target=this.instance.currentItem[0];this.instance._mouseCapture(C,true);this.instance._mouseStart(C,true,true);this.instance.offset.click.top=E.offset.click.top;this.instance.offset.click.left=E.offset.click.left;this.instance.offset.parent.left-=E.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=E.offset.parent.top-this.instance.offset.parent.top;E._trigger("toSortable",C);E.dropped=this.instance.element;this.instance.fromOutside=true}if(this.instance.currentItem){this.instance._mouseDrag(C)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._mouseStop(C,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}E._trigger("fromSortable",C);E.dropped=false}}})}});A.ui.plugin.add("draggable","cursor",{start:function(C,D){var B=A("body");if(B.css("cursor")){D.options._cursor=B.css("cursor")}B.css("cursor",D.options.cursor)},stop:function(B,C){if(C.options._cursor){A("body").css("cursor",C.options._cursor)}}});A.ui.plugin.add("draggable","iframeFix",{start:function(B,C){A(C.options.iframeFix===true?"iframe":C.options.iframeFix).each(function(){A('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(A(this).offset()).appendTo("body")})},stop:function(B,C){A("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});A.ui.plugin.add("draggable","opacity",{start:function(C,D){var B=A(D.helper);if(B.css("opacity")){D.options._opacity=B.css("opacity")}B.css("opacity",D.options.opacity)},stop:function(B,C){if(C.options._opacity){A(C.helper).css("opacity",C.options._opacity)}}});A.ui.plugin.add("draggable","scroll",{start:function(C,D){var E=D.options;var B=A(this).data("draggable");if(B.scrollParent[0]!=document&&B.scrollParent[0].tagName!="HTML"){B.overflowOffset=B.scrollParent.offset()}},drag:function(D,E){var F=E.options,C=false;var B=A(this).data("draggable");if(B.scrollParent[0]!=document&&B.scrollParent[0].tagName!="HTML"){if((B.overflowOffset.top+B.scrollParent[0].offsetHeight)-D.pageY<F.scrollSensitivity){B.scrollParent[0].scrollTop=C=B.scrollParent[0].scrollTop+F.scrollSpeed}else{if(D.pageY-B.overflowOffset.top<F.scrollSensitivity){B.scrollParent[0].scrollTop=C=B.scrollParent[0].scrollTop-F.scrollSpeed}}if((B.overflowOffset.left+B.scrollParent[0].offsetWidth)-D.pageX<F.scrollSensitivity){B.scrollParent[0].scrollLeft=C=B.scrollParent[0].scrollLeft+F.scrollSpeed}else{if(D.pageX-B.overflowOffset.left<F.scrollSensitivity){B.scrollParent[0].scrollLeft=C=B.scrollParent[0].scrollLeft-F.scrollSpeed}}}else{if(D.pageY-A(document).scrollTop()<F.scrollSensitivity){C=A(document).scrollTop(A(document).scrollTop()-F.scrollSpeed)}else{if(A(window).height()-(D.pageY-A(document).scrollTop())<F.scrollSensitivity){C=A(document).scrollTop(A(document).scrollTop()+F.scrollSpeed)}}if(D.pageX-A(document).scrollLeft()<F.scrollSensitivity){C=A(document).scrollLeft(A(document).scrollLeft()-F.scrollSpeed)}else{if(A(window).width()-(D.pageX-A(document).scrollLeft())<F.scrollSensitivity){C=A(document).scrollLeft(A(document).scrollLeft()+F.scrollSpeed)}}}if(C!==false&&A.ui.ddmanager&&!F.dropBehaviour){A.ui.ddmanager.prepareOffsets(B,D)}}});A.ui.plugin.add("draggable","snap",{start:function(B,D){var C=A(this).data("draggable");C.snapElements=[];A(D.options.snap.constructor!=String?(D.options.snap.items||":data(draggable)"):D.options.snap).each(function(){var F=A(this);var E=F.offset();if(this!=C.element[0]){C.snapElements.push({item:this,width:F.outerWidth(),height:F.outerHeight(),top:E.top,left:E.left})}})},drag:function(M,K){var E=A(this).data("draggable");var Q=K.options.snapTolerance;var P=K.absolutePosition.left,O=P+E.helperProportions.width,D=K.absolutePosition.top,C=D+E.helperProportions.height;for(var N=E.snapElements.length-1;N>=0;N--){var L=E.snapElements[N].left,J=L+E.snapElements[N].width,I=E.snapElements[N].top,R=I+E.snapElements[N].height;if(!((L-Q<P&&P<J+Q&&I-Q<D&&D<R+Q)||(L-Q<P&&P<J+Q&&I-Q<C&&C<R+Q)||(L-Q<O&&O<J+Q&&I-Q<D&&D<R+Q)||(L-Q<O&&O<J+Q&&I-Q<C&&C<R+Q))){if(E.snapElements[N].snapping){(E.options.snap.release&&E.options.snap.release.call(E.element,M,A.extend(E._uiHash(),{snapItem:E.snapElements[N].item})))}E.snapElements[N].snapping=false;continue}if(K.options.snapMode!="inner"){var B=Math.abs(I-C)<=Q;var S=Math.abs(R-D)<=Q;var G=Math.abs(L-O)<=Q;var H=Math.abs(J-P)<=Q;if(B){K.position.top=E._convertPositionTo("relative",{top:I-E.helperProportions.height,left:0}).top}if(S){K.position.top=E._convertPositionTo("relative",{top:R,left:0}).top}if(G){K.position.left=E._convertPositionTo("relative",{top:0,left:L-E.helperProportions.width}).left}if(H){K.position.left=E._convertPositionTo("relative",{top:0,left:J}).left}}var F=(B||S||G||H);if(K.options.snapMode!="outer"){var B=Math.abs(I-D)<=Q;var S=Math.abs(R-C)<=Q;var G=Math.abs(L-P)<=Q;var H=Math.abs(J-O)<=Q;if(B){K.position.top=E._convertPositionTo("relative",{top:I,left:0}).top}if(S){K.position.top=E._convertPositionTo("relative",{top:R-E.helperProportions.height,left:0}).top}if(G){K.position.left=E._convertPositionTo("relative",{top:0,left:L}).left}if(H){K.position.left=E._convertPositionTo("relative",{top:0,left:J-E.helperProportions.width}).left}}if(!E.snapElements[N].snapping&&(B||S||G||H||F)){(E.options.snap.snap&&E.options.snap.snap.call(E.element,M,A.extend(E._uiHash(),{snapItem:E.snapElements[N].item})))}E.snapElements[N].snapping=(B||S||G||H||F)}}});A.ui.plugin.add("draggable","stack",{start:function(B,C){var D=A.makeArray(A(C.options.stack.group)).sort(function(F,E){return(parseInt(A(F).css("zIndex"),10)||C.options.stack.min)-(parseInt(A(E).css("zIndex"),10)||C.options.stack.min)});A(D).each(function(E){this.style.zIndex=C.options.stack.min+E});this[0].style.zIndex=C.options.stack.min+D.length}});A.ui.plugin.add("draggable","zIndex",{start:function(C,D){var B=A(D.helper);if(B.css("zIndex")){D.options._zIndex=B.css("zIndex")}B.css("zIndex",D.options.zIndex)},stop:function(B,C){if(C.options._zIndex){A(C.helper).css("zIndex",C.options._zIndex)}}})})(jQuery);(function(A){A.widget("ui.droppable",{_init:function(){var C=this.options,B=C.accept;this.isover=0;this.isout=1;this.options.accept=this.options.accept&&A.isFunction(this.options.accept)?this.options.accept:function(D){return D.is(B)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};A.ui.ddmanager.droppables[this.options.scope]=A.ui.ddmanager.droppables[this.options.scope]||[];A.ui.ddmanager.droppables[this.options.scope].push(this);(this.options.cssNamespace&&this.element.addClass(this.options.cssNamespace+"-droppable"))},destroy:function(){var B=A.ui.ddmanager.droppables[this.options.scope];for(var C=0;C<B.length;C++){if(B[C]==this){B.splice(C,1)}}this.element.removeClass(this.options.cssNamespace+"-droppable "+this.options.cssNamespace+"-droppable-disabled").removeData("droppable").unbind(".droppable")},_setData:function(B,C){if(B=="accept"){this.options.accept=C&&A.isFunction(C)?C:function(D){return D.is(accept)}}else{A.widget.prototype._setData.apply(this,arguments)}},_activate:function(B){var C=A.ui.ddmanager.current;A.ui.plugin.call(this,"activate",[B,this.ui(C)]);(C&&this._trigger("activate",B,this.ui(C)))},_deactivate:function(B){var C=A.ui.ddmanager.current;A.ui.plugin.call(this,"deactivate",[B,this.ui(C)]);(C&&this._trigger("deactivate",B,this.ui(C)))},_over:function(B){var C=A.ui.ddmanager.current;if(!C||(C.currentItem||C.element)[0]==this.element[0]){return }if(this.options.accept.call(this.element,(C.currentItem||C.element))){A.ui.plugin.call(this,"over",[B,this.ui(C)]);this._trigger("over",B,this.ui(C))}},_out:function(B){var C=A.ui.ddmanager.current;if(!C||(C.currentItem||C.element)[0]==this.element[0]){return }if(this.options.accept.call(this.element,(C.currentItem||C.element))){A.ui.plugin.call(this,"out",[B,this.ui(C)]);this._trigger("out",B,this.ui(C))}},_drop:function(C,B){var D=B||A.ui.ddmanager.current;if(!D||(D.currentItem||D.element)[0]==this.element[0]){return false}var E=false;this.element.find(":data(droppable)").not("."+D.options.cssNamespace+"-draggable-dragging").each(function(){var F=A.data(this,"droppable");if(F.options.greedy&&A.ui.intersect(D,A.extend(F,{offset:F.element.offset()}),F.options.tolerance)){E=true;return false}});if(E){return false}if(this.options.accept.call(this.element,(D.currentItem||D.element))){A.ui.plugin.call(this,"drop",[C,this.ui(D)]);this._trigger("drop",C,this.ui(D));return this.element}return false},plugins:{},ui:function(B){return{draggable:(B.currentItem||B.element),helper:B.helper,position:B.position,absolutePosition:B.positionAbs,options:this.options,element:this.element}}});A.extend(A.ui.droppable,{version:"1.6rc5",eventPrefix:"drop",defaults:{accept:"*",activeClass:null,cssNamespace:"ui",greedy:false,hoverClass:null,scope:"default",tolerance:"intersect"}});A.ui.intersect=function(L,E,M){if(!E.offset){return false}var D=(L.positionAbs||L.position.absolute).left,C=D+L.helperProportions.width,N=(L.positionAbs||L.position.absolute).top,K=N+L.helperProportions.height;var F=E.offset.left,B=F+E.proportions.width,O=E.offset.top,J=O+E.proportions.height;switch(M){case"fit":return(F<D&&C<B&&O<N&&K<J);break;case"intersect":return(F<D+(L.helperProportions.width/2)&&C-(L.helperProportions.width/2)<B&&O<N+(L.helperProportions.height/2)&&K-(L.helperProportions.height/2)<J);break;case"pointer":var G=((L.positionAbs||L.position.absolute).left+(L.clickOffset||L.offset.click).left),H=((L.positionAbs||L.position.absolute).top+(L.clickOffset||L.offset.click).top),I=A.ui.isOver(H,G,O,F,E.proportions.height,E.proportions.width);return I;break;case"touch":return((N>=O&&N<=J)||(K>=O&&K<=J)||(N<O&&K>J))&&((D>=F&&D<=B)||(C>=F&&C<=B)||(D<F&&C>B));break;default:return false;break}};A.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(E,G){var B=A.ui.ddmanager.droppables[E.options.scope];var F=G?G.type:null;var H=(E.currentItem||E.element).find(":data(droppable)").andSelf();droppablesLoop:for(var D=0;D<B.length;D++){if(B[D].options.disabled||(E&&!B[D].options.accept.call(B[D].element,(E.currentItem||E.element)))){continue}for(var C=0;C<H.length;C++){if(H[C]==B[D].element[0]){B[D].proportions.height=0;continue droppablesLoop}}B[D].visible=B[D].element.css("display")!="none";if(!B[D].visible){continue}B[D].offset=B[D].element.offset();B[D].proportions={width:B[D].element[0].offsetWidth,height:B[D].element[0].offsetHeight};if(F=="dragstart"||F=="sortactivate"){B[D]._activate.call(B[D],G)}}},drop:function(C,B){var D=false;A.each(A.ui.ddmanager.droppables[C.options.scope],function(){if(!this.options){return }if(!this.options.disabled&&this.visible&&A.ui.intersect(C,this,this.options.tolerance)){D=this._drop.call(this,B)}if(!this.options.disabled&&this.visible&&this.options.accept.call(this.element,(C.currentItem||C.element))){this.isout=1;this.isover=0;this._deactivate.call(this,B)}});return D},drag:function(C,B){if(C.options.refreshPositions){A.ui.ddmanager.prepareOffsets(C,B)}A.each(A.ui.ddmanager.droppables[C.options.scope],function(){if(this.options.disabled||this.greedyChild||!this.visible){return }var D=A.ui.intersect(C,this,this.options.tolerance);var G=!D&&this.isover==1?"isout":(D&&this.isover==0?"isover":null);if(!G){return }var F;if(this.options.greedy){var E=this.element.parents(":data(droppable):eq(0)");if(E.length){F=A.data(E[0],"droppable");F.greedyChild=(G=="isover"?1:0)}}if(F&&G=="isover"){F.isover=0;F.isout=1;F._out.call(F,B)}this[G]=1;this[G=="isout"?"isover":"isout"]=0;this[G=="isover"?"_over":"_out"].call(this,B);if(F&&G=="isout"){F.isout=0;F.isover=1;F._over.call(F,B)}})}};A.ui.plugin.add("droppable","activeClass",{activate:function(B,C){A(this).addClass(C.options.activeClass)},deactivate:function(B,C){A(this).removeClass(C.options.activeClass)},drop:function(B,C){A(this).removeClass(C.options.activeClass)}});A.ui.plugin.add("droppable","hoverClass",{over:function(B,C){A(this).addClass(C.options.hoverClass)},out:function(B,C){A(this).removeClass(C.options.hoverClass)},drop:function(B,C){A(this).removeClass(C.options.hoverClass)}})})(jQuery);(function(A){A.widget("ui.sortable",A.extend({},A.ui.mouse,{_init:function(){var B=this.options;this.containerCache={};(this.options.cssNamespace&&this.element.addClass(this.options.cssNamespace+"-sortable"));this.refresh();this.floating=this.items.length?(/left|right/).test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass(this.options.cssNamespace+"-sortable "+this.options.cssNamespace+"-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var B=this.items.length-1;B>=0;B--){this.items[B].item.removeData("sortable-item")}},_mouseCapture:function(F,B){if(this.reverting){return false}if(this.options.disabled||this.options.type=="static"){return false}this._refreshItems(F);var E=null,D=this,C=A(F.target).parents().each(function(){if(A.data(this,"sortable-item")==D){E=A(this);return false}});if(A.data(F.target,"sortable-item")==D){E=A(F.target)}if(!E){return false}if(this.options.handle&&!B){var G=false;A(this.options.handle,E).find("*").andSelf().each(function(){if(this==F.target){G=true}});if(!G){return false}}this.currentItem=E;this._removeCurrentsFromItems();return true},_mouseStart:function(E,B,D){var F=this.options;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(E);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");A.extend(this.offset,{click:{left:E.pageX-this.offset.left,top:E.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(E);this.originalPageX=E.pageX;this.originalPageY=E.pageY;if(F.cursorAt){this._adjustOffsetFromHelper(F.cursorAt)}this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(F.containment){this._setContainment()}this._trigger("start",E);if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!D){for(var C=this.containers.length-1;C>=0;C--){this.containers[C]._trigger("activate",E,this)}}if(A.ui.ddmanager){A.ui.ddmanager.current=this}if(A.ui.ddmanager&&!F.dropBehaviour){A.ui.ddmanager.prepareOffsets(this,E)}this.dragging=true;this.helper.addClass(F.cssNamespace+"-sortable-helper");this._mouseDrag(E);return true},_mouseDrag:function(E){this.position=this._generatePosition(E);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}A.ui.plugin.call(this,"sort",[E,this._uiHash()]);this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}for(var C=this.items.length-1;C>=0;C--){var D=this.items[C],B=D.item[0],F=this._intersectsWithPointer(D);if(!F){continue}if(B!=this.currentItem[0]&&this.placeholder[F==1?"next":"prev"]()[0]!=B&&!A.ui.contains(this.placeholder[0],B)&&(this.options.type=="semi-dynamic"?!A.ui.contains(this.element[0],B):true)){this.direction=F==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(D)){this.options.sortIndicator.call(this,E,D)}else{break}this._trigger("change",E);break}}this._contactContainers(E);if(A.ui.ddmanager){A.ui.ddmanager.drag(this,E)}this._trigger("sort",E);this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(C,E){if(!C){return }if(A.ui.ddmanager&&!this.options.dropBehaviour){A.ui.ddmanager.drop(this,C)}if(this.options.revert){var B=this;var D=B.placeholder.offset();B.reverting=true;A(this.helper).animate({left:D.left-this.offset.parent.left-B.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:D.top-this.offset.parent.top-B.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){B._clear(C)})}else{this._clear(C,E)}return false},cancel:function(){if(this.dragging){this._mouseUp();if(this.options.helper=="original"){this.currentItem.css(this._storedCSS).removeClass(this.options.cssNamespace+"-sortable-helper")}else{this.currentItem.show()}for(var B=this.containers.length-1;B>=0;B--){this.containers[B]._trigger("deactivate",null,this);if(this.containers[B].containerCache.over){this.containers[B]._trigger("out",null,this);this.containers[B].containerCache.over=0}}}if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}A.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){A(this.domPosition.prev).after(this.currentItem)}else{A(this.domPosition.parent).prepend(this.currentItem)}return true},serialize:function(D){var B=this._getItemsAsjQuery(D&&D.connected);var C=[];D=D||{};A(B).each(function(){var E=(A(D.item||this).attr(D.attribute||"id")||"").match(D.expression||(/(.+)[-=_](.+)/));if(E){C.push((D.key||E[1]+"[]")+"="+(D.key&&D.expression?E[1]:E[2]))}});return C.join("&")},toArray:function(D){var B=this._getItemsAsjQuery(D&&D.connected);var C=[];D=D||{};B.each(function(){C.push(A(D.item||this).attr(D.attribute||"id")||"")});return C},_intersectsWith:function(L){var D=this.positionAbs.left,C=D+this.helperProportions.width,J=this.positionAbs.top,I=J+this.helperProportions.height;var E=L.left,B=E+L.width,K=L.top,H=K+L.height;var M=this.offset.click.top,G=this.offset.click.left;var F=(J+M)>K&&(J+M)<H&&(D+G)>E&&(D+G)<B;if(this.options.tolerance=="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>L[this.floating?"width":"height"])){return F}else{return(E<D+(this.helperProportions.width/2)&&C-(this.helperProportions.width/2)<B&&K<J+(this.helperProportions.height/2)&&I-(this.helperProportions.height/2)<H)}},_intersectsWithPointer:function(D){var G=A.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,D.top,D.height),C=A.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,D.left,D.width),F=G&&C,B=this._getDragVerticalDirection(),E=this._getDragHorizontalDirection();if(!F){return false}return this.floating?(((E&&E=="right")||B=="down")?2:1):(B&&(B=="down"?2:1))},_intersectsWithSides:function(E){var D=A.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,E.top+(E.height/2),E.height),C=A.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,E.left+(E.width/2),E.width),B=this._getDragVerticalDirection(),F=this._getDragHorizontalDirection();if(this.floating&&F){return((F=="right"&&C)||(F=="left"&&!C))}else{return B&&((B=="down"&&D)||(B=="up"&&!D))}},_getDragVerticalDirection:function(){var B=this.positionAbs.top-this.lastPositionAbs.top;return B!=0&&(B>0?"down":"up")},_getDragHorizontalDirection:function(){var B=this.positionAbs.left-this.lastPositionAbs.left;return B!=0&&(B>0?"right":"left")},refresh:function(B){this._refreshItems(B);this.refreshPositions()},_getItemsAsjQuery:function(B){var D=this;var C=[];var F=[];if(this.options.connectWith&&B){for(var G=this.options.connectWith.length-1;G>=0;G--){var I=A(this.options.connectWith[G]);for(var E=I.length-1;E>=0;E--){var H=A.data(I[E],"sortable");if(H&&H!=this&&!H.options.disabled){F.push([A.isFunction(H.options.items)?H.options.items.call(H.element):A(H.options.items,H.element).not("."+H.options.cssNamespace+"-sortable-helper"),H])}}}}F.push([A.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):A(this.options.items,this.element).not("."+this.options.cssNamespace+"-sortable-helper"),this]);for(var G=F.length-1;G>=0;G--){F[G][0].each(function(){C.push(this)})}return A(C)},_removeCurrentsFromItems:function(){var D=this.currentItem.find(":data(sortable-item)");for(var C=0;C<this.items.length;C++){for(var B=0;B<D.length;B++){if(D[B]==this.items[C].item[0]){this.items.splice(C,1)}}}},_refreshItems:function(B){this.items=[];this.containers=[this];var H=this.items;var M=this;var E=[[A.isFunction(this.options.items)?this.options.items.call(this.element[0],B,{item:this.currentItem}):A(this.options.items,this.element),this]];if(this.options.connectWith){for(var F=this.options.connectWith.length-1;F>=0;F--){var J=A(this.options.connectWith[F]);for(var D=J.length-1;D>=0;D--){var G=A.data(J[D],"sortable");if(G&&G!=this&&!G.options.disabled){E.push([A.isFunction(G.options.items)?G.options.items.call(G.element[0],B,{item:this.currentItem}):A(G.options.items,G.element),G]);this.containers.push(G)}}}}for(var F=E.length-1;F>=0;F--){var I=E[F][1];var C=E[F][0];for(var D=0,K=C.length;D<K;D++){var L=A(C[D]);L.data("sortable-item",I);H.push({item:L,instance:I,width:0,height:0,left:0,top:0})}}},refreshPositions:function(B){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()}for(var D=this.items.length-1;D>=0;D--){var E=this.items[D];if(E.instance!=this.currentContainer&&this.currentContainer&&E.item[0]!=this.currentItem[0]){continue}var C=this.options.toleranceElement?A(this.options.toleranceElement,E.item):E.item;if(!B){if(this.options.accurateIntersection){E.width=C.outerWidth();E.height=C.outerHeight()}else{E.width=C[0].offsetWidth;E.height=C[0].offsetHeight}}var F=C.offset();E.left=F.left;E.top=F.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var D=this.containers.length-1;D>=0;D--){var F=this.containers[D].element.offset();this.containers[D].containerCache.left=F.left;this.containers[D].containerCache.top=F.top;this.containers[D].containerCache.width=this.containers[D].element.outerWidth();this.containers[D].containerCache.height=this.containers[D].element.outerHeight()}}},_createPlaceholder:function(D){var C=D||this,E=C.options;if(!E.placeholder||E.placeholder.constructor==String){var B=E.placeholder;E.placeholder={element:function(){var F=A(document.createElement(C.currentItem[0].nodeName)).addClass(B||C.currentItem[0].className+" "+C.options.cssNamespace+"-sortable-placeholder").removeClass(C.options.cssNamespace+"-sortable-helper")[0];if(!B){F.style.visibility="hidden"}return F},update:function(F,G){if(B&&!E.forcePlaceholderSize){return }if(!G.height()){G.height(C.currentItem.innerHeight()-parseInt(C.currentItem.css("paddingTop")||0,10)-parseInt(C.currentItem.css("paddingBottom")||0,10))}if(!G.width()){G.width(C.currentItem.innerWidth()-parseInt(C.currentItem.css("paddingLeft")||0,10)-parseInt(C.currentItem.css("paddingRight")||0,10))}}}}C.placeholder=A(E.placeholder.element.call(C.element,C.currentItem));C.currentItem.after(C.placeholder);E.placeholder.update(C,C.placeholder)},_contactContainers:function(D){for(var C=this.containers.length-1;C>=0;C--){if(this._intersectsWith(this.containers[C].containerCache)){if(!this.containers[C].containerCache.over){if(this.currentContainer!=this.containers[C]){var H=10000;var G=null;var E=this.positionAbs[this.containers[C].floating?"left":"top"];for(var B=this.items.length-1;B>=0;B--){if(!A.ui.contains(this.containers[C].element[0],this.items[B].item[0])){continue}var F=this.items[B][this.containers[C].floating?"left":"top"];if(Math.abs(F-E)<H){H=Math.abs(F-E);G=this.items[B]}}if(!G&&!this.options.dropOnEmpty){continue}this.currentContainer=this.containers[C];G?this.options.sortIndicator.call(this,D,G,null,true):this.options.sortIndicator.call(this,D,null,this.containers[C].element,true);this._trigger("change",D);this.containers[C]._trigger("change",D,this);this.options.placeholder.update(this.currentContainer,this.placeholder)}this.containers[C]._trigger("over",D,this);this.containers[C].containerCache.over=1}}else{if(this.containers[C].containerCache.over){this.containers[C]._trigger("out",D,this);this.containers[C].containerCache.over=0}}}},_createHelper:function(C){var D=this.options;var B=A.isFunction(D.helper)?A(D.helper.apply(this.element[0],[C,this.currentItem])):(D.helper=="clone"?this.currentItem.clone():this.currentItem);if(!B.parents("body").length){A(D.appendTo!="parent"?D.appendTo:this.currentItem[0].parentNode)[0].appendChild(B[0])}if(B[0]==this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}}if(B[0].style.width==""||D.forceHelperSize){B.width(this.currentItem.width())}if(B[0].style.height==""||D.forceHelperSize){B.height(this.currentItem.height())}return B},_adjustOffsetFromHelper:function(B){if(B.left!=undefined){this.offset.click.left=B.left+this.margins.left}if(B.right!=undefined){this.offset.click.left=this.helperProportions.width-B.right+this.margins.left}if(B.top!=undefined){this.offset.click.top=B.top+this.margins.top}if(B.bottom!=undefined){this.offset.click.top=this.helperProportions.height-B.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var B=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0])){B.left+=this.scrollParent.scrollLeft();B.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body&&A.browser.mozilla)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&A.browser.msie)){B={top:0,left:0}}return{top:B.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:B.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var B=this.currentItem.position();return{top:B.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:B.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var E=this.options;if(E.containment=="parent"){E.containment=this.helper[0].parentNode}if(E.containment=="document"||E.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,A(E.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(A(E.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(E.containment)){var C=A(E.containment)[0];var D=A(E.containment).offset();var B=(A(C).css("overflow")!="hidden");this.containment=[D.left+(parseInt(A(C).css("borderLeftWidth"),10)||0)-this.margins.left,D.top+(parseInt(A(C).css("borderTopWidth"),10)||0)-this.margins.top,D.left+(B?Math.max(C.scrollWidth,C.offsetWidth):C.offsetWidth)-(parseInt(A(C).css("borderLeftWidth"),10)||0)-this.helperProportions.width-this.margins.left,D.top+(B?Math.max(C.scrollHeight,C.offsetHeight):C.offsetHeight)-(parseInt(A(C).css("borderTopWidth"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(E,G){if(!G){G=this.position}var B=E=="absolute"?1:-1;var D=this.options,C=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,F=(/(html|body)/i).test(C[0].tagName);return{top:(G.top+this.offset.relative.top*B+this.offset.parent.top*B-(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(F?0:C.scrollTop()))*B),left:(G.left+this.offset.relative.left*B+this.offset.parent.left*B-(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():F?0:C.scrollLeft())*B)}},_generatePosition:function(D){var H=this.options,E=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,I=(/(html|body)/i).test(E[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var C=D.pageX;var B=D.pageY;if(this.originalPosition){if(this.containment){if(D.pageX-this.offset.click.left<this.containment[0]){C=this.containment[0]+this.offset.click.left}if(D.pageY-this.offset.click.top<this.containment[1]){B=this.containment[1]+this.offset.click.top}if(D.pageX-this.offset.click.left>this.containment[2]){C=this.containment[2]+this.offset.click.left}if(D.pageY-this.offset.click.top>this.containment[3]){B=this.containment[3]+this.offset.click.top}}if(H.grid){var G=this.originalPageY+Math.round((B-this.originalPageY)/H.grid[1])*H.grid[1];B=this.containment?(!(G-this.offset.click.top<this.containment[1]||G-this.offset.click.top>this.containment[3])?G:(!(G-this.offset.click.top<this.containment[1])?G-H.grid[1]:G+H.grid[1])):G;var F=this.originalPageX+Math.round((C-this.originalPageX)/H.grid[0])*H.grid[0];C=this.containment?(!(F-this.offset.click.left<this.containment[0]||F-this.offset.click.left>this.containment[2])?F:(!(F-this.offset.click.left<this.containment[0])?F-H.grid[0]:F+H.grid[0])):F}}return{top:(B-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(I?0:E.scrollTop()))),left:(C-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():I?0:E.scrollLeft()))}},_rearrange:function(G,F,C,E){C?C[0].appendChild(this.placeholder[0]):F.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction=="down"?F.item[0]:F.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var D=this,B=this.counter;window.setTimeout(function(){if(B==D.counter){D.refreshPositions(!E)}},0)},_clear:function(C,D){this.reverting=false;if(!this._noFinalSort){this.placeholder.before(this.currentItem)}this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var B in this._storedCSS){if(this._storedCSS[B]=="auto"||this._storedCSS[B]=="static"){this._storedCSS[B]=""}}this.currentItem.css(this._storedCSS).removeClass(this.options.cssNamespace+"-sortable-helper")}else{this.currentItem.show()}if(this.fromOutside){this._trigger("receive",C,this,D)}if(this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not("."+this.options.cssNamespace+"-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0]){this._trigger("update",C,null,D)}if(!A.ui.contains(this.element[0],this.currentItem[0])){this._trigger("remove",C,null,D);for(var B=this.containers.length-1;B>=0;B--){if(A.ui.contains(this.containers[B].element[0],this.currentItem[0])){this.containers[B]._trigger("receive",C,this,D);this.containers[B]._trigger("update",C,this,D)}}}for(var B=this.containers.length-1;B>=0;B--){this.containers[B]._trigger("deactivate",C,this,D);if(this.containers[B].containerCache.over){this.containers[B]._trigger("out",C,this);this.containers[B].containerCache.over=0}}this.dragging=false;if(this.cancelHelperRemoval){this._trigger("beforeStop",C,null,D);this._trigger("stop",C,null,D);return false}this._trigger("beforeStop",C,null,D);this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.helper[0]!=this.currentItem[0]){this.helper.remove()}this.helper=null;this._trigger("stop",C,null,D);this.fromOutside=false;return true},_trigger:function(B,C,D,E){A.ui.plugin.call(this,B,[C,this._uiHash(D)]);if(!E){if(A.widget.prototype._trigger.call(this,B,C,this._uiHash(D))===false){this.cancel()}}},plugins:{},_uiHash:function(C){var B=C||this;return{helper:B.helper,placeholder:B.placeholder||A([]),position:B.position,absolutePosition:B.positionAbs,item:B.currentItem,sender:C?C.element:null}}}));A.extend(A.ui.sortable,{getter:"serialize toArray",version:"1.6rc5",defaults:{accurateIntersection:true,appendTo:"parent",cancel:":input,option",cssNamespace:"ui",delay:0,distance:1,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,helper:"original",items:"> *",scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,sortIndicator:A.ui.sortable.prototype._rearrange,tolerance:"default",zIndex:1000}});A.ui.plugin.add("sortable","cursor",{start:function(D,E){var C=A("body"),B=A(this).data("sortable");if(C.css("cursor")){B.options._cursor=C.css("cursor")}C.css("cursor",B.options.cursor)},beforeStop:function(C,D){var B=A(this).data("sortable");if(B.options._cursor){A("body").css("cursor",B.options._cursor)}}});A.ui.plugin.add("sortable","opacity",{start:function(D,E){var C=E.helper,B=A(this).data("sortable");if(C.css("opacity")){B.options._opacity=C.css("opacity")}C.css("opacity",B.options.opacity)},beforeStop:function(C,D){var B=A(this).data("sortable");if(B.options._opacity){A(D.helper).css("opacity",B.options._opacity)}}});A.ui.plugin.add("sortable","scroll",{start:function(C,D){var B=A(this).data("sortable"),E=B.options;if(B.scrollParent[0]!=document&&B.scrollParent[0].tagName!="HTML"){B.overflowOffset=B.scrollParent.offset()}},sort:function(D,E){var C=A(this).data("sortable"),F=C.options,B=false;if(C.scrollParent[0]!=document&&C.scrollParent[0].tagName!="HTML"){if((C.overflowOffset.top+C.scrollParent[0].offsetHeight)-D.pageY<F.scrollSensitivity){C.scrollParent[0].scrollTop=B=C.scrollParent[0].scrollTop+F.scrollSpeed}else{if(D.pageY-C.overflowOffset.top<F.scrollSensitivity){C.scrollParent[0].scrollTop=B=C.scrollParent[0].scrollTop-F.scrollSpeed}}if((C.overflowOffset.left+C.scrollParent[0].offsetWidth)-D.pageX<F.scrollSensitivity){C.scrollParent[0].scrollLeft=B=C.scrollParent[0].scrollLeft+F.scrollSpeed}else{if(D.pageX-C.overflowOffset.left<F.scrollSensitivity){C.scrollParent[0].scrollLeft=B=C.scrollParent[0].scrollLeft-F.scrollSpeed}}}else{if(D.pageY-A(document).scrollTop()<F.scrollSensitivity){B=A(document).scrollTop(A(document).scrollTop()-F.scrollSpeed)}else{if(A(window).height()-(D.pageY-A(document).scrollTop())<F.scrollSensitivity){B=A(document).scrollTop(A(document).scrollTop()+F.scrollSpeed)}}if(D.pageX-A(document).scrollLeft()<F.scrollSensitivity){B=A(document).scrollLeft(A(document).scrollLeft()-F.scrollSpeed)}else{if(A(window).width()-(D.pageX-A(document).scrollLeft())<F.scrollSensitivity){B=A(document).scrollLeft(A(document).scrollLeft()+F.scrollSpeed)}}}if(B!==false&&A.ui.ddmanager&&!F.dropBehaviour){A.ui.ddmanager.prepareOffsets(C,D)}}});A.ui.plugin.add("sortable","zIndex",{start:function(D,E){var C=E.helper,B=A(this).data("sortable");if(C.css("zIndex")){B.options._zIndex=C.css("zIndex")}C.css("zIndex",B.options.zIndex)},beforeStop:function(C,D){var B=A(this).data("sortable");if(B.options._zIndex){A(D.helper).css("zIndex",B.options._zIndex=="auto"?"":B.options._zIndex)}}})})(jQuery);(function(C){C.effects=C.effects||{};C.extend(C.effects,{version:"1.6rc5",save:function(E,G){for(var F=0;F<G.length;F++){if(G[F]!==null){E.data("ec.storage."+G[F],E[0].style[G[F]])}}},restore:function(E,G){for(var F=0;F<G.length;F++){if(G[F]!==null){E.css(G[F],E.data("ec.storage."+G[F]))}}},setMode:function(E,F){if(F=="toggle"){F=E.is(":hidden")?"show":"hide"}return F},getBaseline:function(G,F){var H,E;switch(G[0]){case"top":H=0;break;case"middle":H=0.5;break;case"bottom":H=1;break;default:H=G[0]/F.height}switch(G[1]){case"left":E=0;break;case"center":E=0.5;break;case"right":E=1;break;default:E=G[1]/F.width}return{x:E,y:H}},createWrapper:function(E){if(E.parent().is(".ui-effects-wrapper")){return E.parent()}var F={width:E.outerWidth(true),height:E.outerHeight(true),"float":E.css("float")};E.wrap('<div class="ui-effects-wrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');var I=E.parent();if(E.css("position")=="static"){I.css({position:"relative"});E.css({position:"relative"})}else{var H=E.css("top");if(isNaN(parseInt(H,10))){H="auto"}var G=E.css("left");if(isNaN(parseInt(G,10))){G="auto"}I.css({position:E.css("position"),top:H,left:G,zIndex:E.css("z-index")}).show();E.css({position:"relative",top:0,left:0})}I.css(F);return I},removeWrapper:function(E){if(E.parent().is(".ui-effects-wrapper")){return E.parent().replaceWith(E)}return E},setTransition:function(F,H,E,G){G=G||{};C.each(H,function(J,I){unit=F.cssUnit(I);if(unit[0]>0){G[I]=unit[0]*E+unit[1]}});return G},animateClass:function(G,J,I,H){var E=(typeof I=="function"?I:(H?H:null));var F=(typeof I=="string"?I:null);return this.each(function(){var O={};var M=C(this);var N=M.attr("style")||"";if(typeof N=="object"){N=N.cssText}if(G.toggle){M.hasClass(G.toggle)?G.remove=G.toggle:G.add=G.toggle}var K=C.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(G.add){M.addClass(G.add)}if(G.remove){M.removeClass(G.remove)}var L=C.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(G.add){M.removeClass(G.add)}if(G.remove){M.addClass(G.remove)}for(var P in L){if(typeof L[P]!="function"&&L[P]&&P.indexOf("Moz")==-1&&P.indexOf("length")==-1&&L[P]!=K[P]&&(P.match(/color/i)||(!P.match(/color/i)&&!isNaN(parseInt(L[P],10))))&&(K.position!="static"||(K.position=="static"&&!P.match(/left|top|bottom|right/)))){O[P]=L[P]}}M.animate(O,J,F,function(){if(typeof C(this).attr("style")=="object"){C(this).attr("style")["cssText"]="";C(this).attr("style")["cssText"]=N}else{C(this).attr("style",N)}if(G.add){C(this).addClass(G.add)}if(G.remove){C(this).removeClass(G.remove)}if(E){E.apply(this,arguments)}})})}});C.fn.extend({_show:C.fn.show,_hide:C.fn.hide,__toggle:C.fn.toggle,_addClass:C.fn.addClass,_removeClass:C.fn.removeClass,_toggleClass:C.fn.toggleClass,effect:function(F,E,G,H){return C.effects[F]?C.effects[F].call(this,{method:F,options:E||{},duration:G,callback:H}):null},show:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._show.apply(this,arguments)}else{var E=arguments[1]||{};E.mode="show";return this.effect.apply(this,[arguments[0],E,arguments[2]||E.duration,arguments[3]||E.callback])}},hide:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._hide.apply(this,arguments)}else{var E=arguments[1]||{};E.mode="hide";return this.effect.apply(this,[arguments[0],E,arguments[2]||E.duration,arguments[3]||E.callback])}},toggle:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))||(arguments[0].constructor==Function)){return this.__toggle.apply(this,arguments)}else{var E=arguments[1]||{};E.mode="toggle";return this.effect.apply(this,[arguments[0],E,arguments[2]||E.duration,arguments[3]||E.callback])}},addClass:function(H,E,G,F){return E?C.effects.animateClass.apply(this,[{add:H},E,G,F]):this._addClass(H)},removeClass:function(H,E,G,F){return E?C.effects.animateClass.apply(this,[{remove:H},E,G,F]):this._removeClass(H)},toggleClass:function(H,E,G,F){return E?C.effects.animateClass.apply(this,[{toggle:H},E,G,F]):this._toggleClass(H)},morph:function(F,I,E,H,G){return C.effects.animateClass.apply(this,[{add:I,remove:F},E,H,G])},switchClass:function(){return this.morph.apply(this,arguments)},cssUnit:function(E){var F=this.css(E),G=[];C.each(["em","px","%","pt"],function(H,I){if(F.indexOf(I)>0){G=[parseFloat(F),I]}});return G}});C.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(F,E){C.fx.step[E]=function(G){if(G.state==0){G.start=D(G.elem,E);G.end=A(G.end)}G.elem.style[E]="rgb("+[Math.max(Math.min(parseInt((G.pos*(G.end[0]-G.start[0]))+G.start[0],10),255),0),Math.max(Math.min(parseInt((G.pos*(G.end[1]-G.start[1]))+G.start[1],10),255),0),Math.max(Math.min(parseInt((G.pos*(G.end[2]-G.start[2]))+G.start[2],10),255),0)].join(",")+")"}});function A(E){var F;if(E&&E.constructor==Array&&E.length==3){return E}if(F=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(E)){return[parseInt(F[1],10),parseInt(F[2],10),parseInt(F[3],10)]}if(F=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(E)){return[parseFloat(F[1])*2.55,parseFloat(F[2])*2.55,parseFloat(F[3])*2.55]}if(F=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(E)){return[parseInt(F[1],16),parseInt(F[2],16),parseInt(F[3],16)]}if(F=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(E)){return[parseInt(F[1]+F[1],16),parseInt(F[2]+F[2],16),parseInt(F[3]+F[3],16)]}if(F=/rgba\(0, 0, 0, 0\)/.exec(E)){return B.transparent}return B[C.trim(E).toLowerCase()]}function D(G,E){var F;do{F=C.curCSS(G,E);if(F!=""&&F!="transparent"||C.nodeName(G,"body")){break}E="backgroundColor"}while(G=G.parentNode);return A(F)}var B={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};C.easing.jswing=C.easing.swing;C.extend(C.easing,{def:"easeOutQuad",swing:function(F,G,E,I,H){return C.easing[C.easing.def](F,G,E,I,H)},easeInQuad:function(F,G,E,I,H){return I*(G/=H)*G+E},easeOutQuad:function(F,G,E,I,H){return -I*(G/=H)*(G-2)+E},easeInOutQuad:function(F,G,E,I,H){if((G/=H/2)<1){return I/2*G*G+E}return -I/2*((--G)*(G-2)-1)+E},easeInCubic:function(F,G,E,I,H){return I*(G/=H)*G*G+E},easeOutCubic:function(F,G,E,I,H){return I*((G=G/H-1)*G*G+1)+E},easeInOutCubic:function(F,G,E,I,H){if((G/=H/2)<1){return I/2*G*G*G+E}return I/2*((G-=2)*G*G+2)+E},easeInQuart:function(F,G,E,I,H){return I*(G/=H)*G*G*G+E},easeOutQuart:function(F,G,E,I,H){return -I*((G=G/H-1)*G*G*G-1)+E},easeInOutQuart:function(F,G,E,I,H){if((G/=H/2)<1){return I/2*G*G*G*G+E}return -I/2*((G-=2)*G*G*G-2)+E},easeInQuint:function(F,G,E,I,H){return I*(G/=H)*G*G*G*G+E},easeOutQuint:function(F,G,E,I,H){return I*((G=G/H-1)*G*G*G*G+1)+E},easeInOutQuint:function(F,G,E,I,H){if((G/=H/2)<1){return I/2*G*G*G*G*G+E}return I/2*((G-=2)*G*G*G*G+2)+E},easeInSine:function(F,G,E,I,H){return -I*Math.cos(G/H*(Math.PI/2))+I+E},easeOutSine:function(F,G,E,I,H){return I*Math.sin(G/H*(Math.PI/2))+E},easeInOutSine:function(F,G,E,I,H){return -I/2*(Math.cos(Math.PI*G/H)-1)+E},easeInExpo:function(F,G,E,I,H){return(G==0)?E:I*Math.pow(2,10*(G/H-1))+E},easeOutExpo:function(F,G,E,I,H){return(G==H)?E+I:I*(-Math.pow(2,-10*G/H)+1)+E},easeInOutExpo:function(F,G,E,I,H){if(G==0){return E}if(G==H){return E+I}if((G/=H/2)<1){return I/2*Math.pow(2,10*(G-1))+E}return I/2*(-Math.pow(2,-10*--G)+2)+E},easeInCirc:function(F,G,E,I,H){return -I*(Math.sqrt(1-(G/=H)*G)-1)+E},easeOutCirc:function(F,G,E,I,H){return I*Math.sqrt(1-(G=G/H-1)*G)+E},easeInOutCirc:function(F,G,E,I,H){if((G/=H/2)<1){return -I/2*(Math.sqrt(1-G*G)-1)+E}return I/2*(Math.sqrt(1-(G-=2)*G)+1)+E},easeInElastic:function(F,H,E,L,K){var I=1.70158;var J=0;var G=L;if(H==0){return E}if((H/=K)==1){return E+L}if(!J){J=K*0.3}if(G<Math.abs(L)){G=L;var I=J/4}else{var I=J/(2*Math.PI)*Math.asin(L/G)}return -(G*Math.pow(2,10*(H-=1))*Math.sin((H*K-I)*(2*Math.PI)/J))+E},easeOutElastic:function(F,H,E,L,K){var I=1.70158;var J=0;var G=L;if(H==0){return E}if((H/=K)==1){return E+L}if(!J){J=K*0.3}if(G<Math.abs(L)){G=L;var I=J/4}else{var I=J/(2*Math.PI)*Math.asin(L/G)}return G*Math.pow(2,-10*H)*Math.sin((H*K-I)*(2*Math.PI)/J)+L+E},easeInOutElastic:function(F,H,E,L,K){var I=1.70158;var J=0;var G=L;if(H==0){return E}if((H/=K/2)==2){return E+L}if(!J){J=K*(0.3*1.5)}if(G<Math.abs(L)){G=L;var I=J/4}else{var I=J/(2*Math.PI)*Math.asin(L/G)}if(H<1){return -0.5*(G*Math.pow(2,10*(H-=1))*Math.sin((H*K-I)*(2*Math.PI)/J))+E}return G*Math.pow(2,-10*(H-=1))*Math.sin((H*K-I)*(2*Math.PI)/J)*0.5+L+E},easeInBack:function(F,G,E,J,I,H){if(H==undefined){H=1.70158}return J*(G/=I)*G*((H+1)*G-H)+E},easeOutBack:function(F,G,E,J,I,H){if(H==undefined){H=1.70158}return J*((G=G/I-1)*G*((H+1)*G+H)+1)+E},easeInOutBack:function(F,G,E,J,I,H){if(H==undefined){H=1.70158}if((G/=I/2)<1){return J/2*(G*G*(((H*=(1.525))+1)*G-H))+E}return J/2*((G-=2)*G*(((H*=(1.525))+1)*G+H)+2)+E},easeInBounce:function(F,G,E,I,H){return I-C.easing.easeOutBounce(F,H-G,0,I,H)+E},easeOutBounce:function(F,G,E,I,H){if((G/=H)<(1/2.75)){return I*(7.5625*G*G)+E}else{if(G<(2/2.75)){return I*(7.5625*(G-=(1.5/2.75))*G+0.75)+E}else{if(G<(2.5/2.75)){return I*(7.5625*(G-=(2.25/2.75))*G+0.9375)+E}else{return I*(7.5625*(G-=(2.625/2.75))*G+0.984375)+E}}}},easeInOutBounce:function(F,G,E,I,H){if(G<H/2){return C.easing.easeInBounce(F,G*2,0,I,H)*0.5+E}return C.easing.easeOutBounce(F,G*2-H,0,I,H)*0.5+I*0.5+E}})})(jQuery);(function(A){A.effects.blind=function(B){return this.queue(function(){var D=A(this),C=["position","top","left"];var G=A.effects.setMode(D,B.options.mode||"hide");var J=B.options.direction||"vertical";A.effects.save(D,C);D.show();var I=A.effects.createWrapper(D).css({overflow:"hidden"});var E=(J=="vertical")?"height":"width";var H=(J=="vertical")?I.height():I.width();if(G=="show"){I.css(E,0)}var F={};F[E]=G=="show"?H:0;I.animate(F,B.duration,B.options.easing,function(){if(G=="hide"){D.hide()}A.effects.restore(D,C);A.effects.removeWrapper(D);if(B.callback){B.callback.apply(D[0],arguments)}D.dequeue()})})}})(jQuery);(function(A){A.effects.bounce=function(B){return this.queue(function(){var E=A(this),K=["position","top","left"];var J=A.effects.setMode(E,B.options.mode||"effect");var O=B.options.direction||"up";var D=B.options.distance||20;var C=B.options.times||5;var G=B.duration||250;if(/show|hide/.test(J)){K.push("opacity")}A.effects.save(E,K);E.show();A.effects.createWrapper(E);var F=(O=="up"||O=="down")?"top":"left";var M=(O=="up"||O=="left")?"pos":"neg";var D=B.options.distance||(F=="top"?E.outerHeight({margin:true})/3:E.outerWidth({margin:true})/3);if(J=="show"){E.css("opacity",0).css(F,M=="pos"?-D:D)}if(J=="hide"){D=D/(C*2)}if(J!="hide"){C--}if(J=="show"){var H={opacity:1};H[F]=(M=="pos"?"+=":"-=")+D;E.animate(H,G/2,B.options.easing);D=D/2;C--}for(var I=0;I<C;I++){var N={},L={};N[F]=(M=="pos"?"-=":"+=")+D;L[F]=(M=="pos"?"+=":"-=")+D;E.animate(N,G/2,B.options.easing).animate(L,G/2,B.options.easing);D=(J=="hide")?D*2:D/2}if(J=="hide"){var H={opacity:0};H[F]=(M=="pos"?"-=":"+=")+D;E.animate(H,G/2,B.options.easing,function(){E.hide();A.effects.restore(E,K);A.effects.removeWrapper(E);if(B.callback){B.callback.apply(this,arguments)}})}else{var N={},L={};N[F]=(M=="pos"?"-=":"+=")+D;L[F]=(M=="pos"?"+=":"-=")+D;E.animate(N,G/2,B.options.easing).animate(L,G/2,B.options.easing,function(){A.effects.restore(E,K);A.effects.removeWrapper(E);if(B.callback){B.callback.apply(this,arguments)}})}E.queue("fx",function(){E.dequeue()});E.dequeue()})}})(jQuery);(function(A){A.effects.clip=function(B){return this.queue(function(){var E=A(this),J=["position","top","left","height","width"];var H=A.effects.setMode(E,B.options.mode||"hide");var K=B.options.direction||"vertical";A.effects.save(E,J);E.show();var D=A.effects.createWrapper(E).css({overflow:"hidden"});var I=E[0].tagName=="IMG"?D:E;var F={size:(K=="vertical")?"height":"width",position:(K=="vertical")?"top":"left"};var C=(K=="vertical")?I.height():I.width();if(H=="show"){I.css(F.size,0);I.css(F.position,C/2)}var G={};G[F.size]=H=="show"?C:0;G[F.position]=H=="show"?0:C/2;I.animate(G,{queue:false,duration:B.duration,easing:B.options.easing,complete:function(){if(H=="hide"){E.hide()}A.effects.restore(E,J);A.effects.removeWrapper(E);if(B.callback){B.callback.apply(E[0],arguments)}E.dequeue()}})})}})(jQuery);(function(A){A.effects.drop=function(B){return this.queue(function(){var D=A(this),C=["position","top","left","opacity"];var H=A.effects.setMode(D,B.options.mode||"hide");var J=B.options.direction||"left";A.effects.save(D,C);D.show();A.effects.createWrapper(D);var F=(J=="up"||J=="down")?"top":"left";var E=(J=="up"||J=="left")?"pos":"neg";var I=B.options.distance||(F=="top"?D.outerHeight({margin:true})/2:D.outerWidth({margin:true})/2);if(H=="show"){D.css("opacity",0).css(F,E=="pos"?-I:I)}var G={opacity:H=="show"?1:0};G[F]=(H=="show"?(E=="pos"?"+=":"-="):(E=="pos"?"-=":"+="))+I;D.animate(G,{queue:false,duration:B.duration,easing:B.options.easing,complete:function(){if(H=="hide"){D.hide()}A.effects.restore(D,C);A.effects.removeWrapper(D);if(B.callback){B.callback.apply(this,arguments)}D.dequeue()}})})}})(jQuery);(function(A){A.effects.fold=function(B){return this.queue(function(){var F=A(this),K=["position","top","left"];var J=A.effects.setMode(F,B.options.mode||"hide");var O=B.options.size||15;var N=!(!B.options.horizFirst);var I=B.duration?B.duration/2:A.fx.speeds._default/2;A.effects.save(F,K);F.show();var D=A.effects.createWrapper(F).css({overflow:"hidden"});var H=((J=="show")!=N);var G=H?["width","height"]:["height","width"];var C=H?[D.width(),D.height()]:[D.height(),D.width()];var E=/([0-9]+)%/.exec(O);if(E){O=parseInt(E[1])/100*C[J=="hide"?0:1]}if(J=="show"){D.css(N?{height:0,width:O}:{height:O,width:0})}var M={},L={};M[G[0]]=J=="show"?C[0]:O;L[G[1]]=J=="show"?C[1]:0;D.animate(M,I,B.options.easing).animate(L,I,B.options.easing,function(){if(J=="hide"){F.hide()}A.effects.restore(F,K);A.effects.removeWrapper(F);if(B.callback){B.callback.apply(F[0],arguments)}F.dequeue()})})}})(jQuery);(function(A){A.effects.highlight=function(B){return this.queue(function(){var E=A(this),D=["backgroundImage","backgroundColor","opacity"];var H=A.effects.setMode(E,B.options.mode||"show");var C=B.options.color||"#ffff99";var G=E.css("backgroundColor");A.effects.save(E,D);E.show();E.css({backgroundImage:"none",backgroundColor:C});var F={backgroundColor:G};if(H=="hide"){F.opacity=0}E.animate(F,{queue:false,duration:B.duration,easing:B.options.easing,complete:function(){if(H=="hide"){E.hide()}A.effects.restore(E,D);if(H=="show"&&A.browser.msie){this.style.removeAttribute("filter")}if(B.callback){B.callback.apply(this,arguments)}E.dequeue()}})})}})(jQuery);(function(A){A.effects.pulsate=function(B){return this.queue(function(){var D=A(this);var F=A.effects.setMode(D,B.options.mode||"show");var E=B.options.times||5;var G=B.duration?B.duration/2:A.fx.speeds._default/2;if(F=="hide"){E--}if(D.is(":hidden")){D.css("opacity",0);D.show();D.animate({opacity:1},G,B.options.easing);E=E-2}for(var C=0;C<E;C++){D.animate({opacity:0},G,B.options.easing).animate({opacity:1},G,B.options.easing)}if(F=="hide"){D.animate({opacity:0},G,B.options.easing,function(){D.hide();if(B.callback){B.callback.apply(this,arguments)}})}else{D.animate({opacity:0},G,B.options.easing).animate({opacity:1},G,B.options.easing,function(){if(B.callback){B.callback.apply(this,arguments)}})}D.queue("fx",function(){D.dequeue()});D.dequeue()})}})(jQuery);(function(A){A.effects.puff=function(B){return this.queue(function(){var G=A(this);var F=A.extend(true,{},B.options);var H=A.effects.setMode(G,B.options.mode||"hide");var C=parseInt(B.options.percent)||150;F.fade=true;var E={height:G.height(),width:G.width()};var D=C/100;G.from=(H=="hide")?E:{height:E.height*D,width:E.width*D};F.from=G.from;F.percent=(H=="hide")?C:100;F.mode=H;G.effect("scale",F,B.duration,B.callback);G.dequeue()})};A.effects.scale=function(B){return this.queue(function(){var H=A(this);var F=A.extend(true,{},B.options);var I=A.effects.setMode(H,B.options.mode||"effect");var C=parseInt(B.options.percent)||(parseInt(B.options.percent)==0?0:(I=="hide"?0:100));var J=B.options.direction||"both";var G=B.options.origin;if(I!="effect"){F.origin=G||["middle","center"];F.restore=true}var E={height:H.height(),width:H.width()};H.from=B.options.from||(I=="show"?{height:0,width:0}:E);var D={y:J!="horizontal"?(C/100):1,x:J!="vertical"?(C/100):1};H.to={height:E.height*D.y,width:E.width*D.x};if(B.options.fade){if(I=="show"){H.from.opacity=0;H.to.opacity=1}if(I=="hide"){H.from.opacity=1;H.to.opacity=0}}F.from=H.from;F.to=H.to;F.mode=I;H.effect("size",F,B.duration,B.callback);H.dequeue()})};A.effects.size=function(B){return this.queue(function(){var H=A(this),N=["position","top","left","width","height","overflow","opacity"];var D=["position","top","left","overflow","opacity"];var F=["width","height","overflow"];var O=["fontSize"];var E=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"];var K=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"];var L=A.effects.setMode(H,B.options.mode||"effect");var M=B.options.restore||false;var J=B.options.scale||"both";var P=B.options.origin;var I={height:H.height(),width:H.width()};H.from=B.options.from||I;H.to=B.options.to||I;if(P){var G=A.effects.getBaseline(P,I);H.from.top=(I.height-H.from.height)*G.y;H.from.left=(I.width-H.from.width)*G.x;H.to.top=(I.height-H.to.height)*G.y;H.to.left=(I.width-H.to.width)*G.x}var C={from:{y:H.from.height/I.height,x:H.from.width/I.width},to:{y:H.to.height/I.height,x:H.to.width/I.width}};if(J=="box"||J=="both"){if(C.from.y!=C.to.y){N=N.concat(E);H.from=A.effects.setTransition(H,E,C.from.y,H.from);H.to=A.effects.setTransition(H,E,C.to.y,H.to)}if(C.from.x!=C.to.x){N=N.concat(K);H.from=A.effects.setTransition(H,K,C.from.x,H.from);H.to=A.effects.setTransition(H,K,C.to.x,H.to)}}if(J=="content"||J=="both"){if(C.from.y!=C.to.y){N=N.concat(O);H.from=A.effects.setTransition(H,O,C.from.y,H.from);H.to=A.effects.setTransition(H,O,C.to.y,H.to)}}A.effects.save(H,M?N:D);H.show();A.effects.createWrapper(H);H.css("overflow","hidden").css(H.from);if(J=="content"||J=="both"){E=E.concat(["marginTop","marginBottom"]).concat(O);K=K.concat(["marginLeft","marginRight"]);F=N.concat(E).concat(K);H.find("*[width]").each(function(){child=A(this);if(M){A.effects.save(child,F)}var Q={height:child.height(),width:child.width()};child.from={height:Q.height*C.from.y,width:Q.width*C.from.x};child.to={height:Q.height*C.to.y,width:Q.width*C.to.x};if(C.from.y!=C.to.y){child.from=A.effects.setTransition(child,E,C.from.y,child.from);child.to=A.effects.setTransition(child,E,C.to.y,child.to)}if(C.from.x!=C.to.x){child.from=A.effects.setTransition(child,K,C.from.x,child.from);child.to=A.effects.setTransition(child,K,C.to.x,child.to)}child.css(child.from);child.animate(child.to,B.duration,B.options.easing,function(){if(M){A.effects.restore(child,F)}})})}H.animate(H.to,{queue:false,duration:B.duration,easing:B.options.easing,complete:function(){if(L=="hide"){H.hide()}A.effects.restore(H,M?N:D);A.effects.removeWrapper(H);if(B.callback){B.callback.apply(this,arguments)}H.dequeue()}})})}})(jQuery);(function(A){A.effects.shake=function(B){return this.queue(function(){var E=A(this),K=["position","top","left"];var J=A.effects.setMode(E,B.options.mode||"effect");var O=B.options.direction||"left";var D=B.options.distance||20;var C=B.options.times||3;var G=B.duration||B.options.duration||140;A.effects.save(E,K);E.show();A.effects.createWrapper(E);var F=(O=="up"||O=="down")?"top":"left";var M=(O=="up"||O=="left")?"pos":"neg";var H={},N={},L={};H[F]=(M=="pos"?"-=":"+=")+D;N[F]=(M=="pos"?"+=":"-=")+D*2;L[F]=(M=="pos"?"-=":"+=")+D*2;E.animate(H,G,B.options.easing);for(var I=1;I<C;I++){E.animate(N,G,B.options.easing).animate(L,G,B.options.easing)}E.animate(N,G,B.options.easing).animate(H,G/2,B.options.easing,function(){A.effects.restore(E,K);A.effects.removeWrapper(E);if(B.callback){B.callback.apply(this,arguments)}});E.queue("fx",function(){E.dequeue()});E.dequeue()})}})(jQuery);(function(A){A.effects.slide=function(B){return this.queue(function(){var D=A(this),C=["position","top","left"];var H=A.effects.setMode(D,B.options.mode||"show");var J=B.options.direction||"left";A.effects.save(D,C);D.show();A.effects.createWrapper(D).css({overflow:"hidden"});var F=(J=="up"||J=="down")?"top":"left";var E=(J=="up"||J=="left")?"pos":"neg";var I=B.options.distance||(F=="top"?D.outerHeight({margin:true}):D.outerWidth({margin:true}));if(H=="show"){D.css(F,E=="pos"?-I:I)}var G={};G[F]=(H=="show"?(E=="pos"?"+=":"-="):(E=="pos"?"-=":"+="))+I;D.animate(G,{queue:false,duration:B.duration,easing:B.options.easing,complete:function(){if(H=="hide"){D.hide()}A.effects.restore(D,C);A.effects.removeWrapper(D);if(B.callback){B.callback.apply(this,arguments)}D.dequeue()}})})}})(jQuery); | |
2 | 0 | \ No newline at end of file |
vendor/plugins/jrails/javascripts/jquery.js
... | ... | @@ -1,19 +0,0 @@ |
1 | -/* | |
2 | - * jQuery JavaScript Library v1.3 | |
3 | - * http://jquery.com/ | |
4 | - * | |
5 | - * Copyright (c) 2009 John Resig | |
6 | - * Dual licensed under the MIT and GPL licenses. | |
7 | - * http://docs.jquery.com/License | |
8 | - * | |
9 | - * Date: 2009-01-13 12:50:31 -0500 (Tue, 13 Jan 2009) | |
10 | - * Revision: 6104 | |
11 | - */ | |
12 | -(function(){var l=this,g,x=l.jQuery,o=l.$,n=l.jQuery=l.$=function(D,E){return new n.fn.init(D,E)},C=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;n.fn=n.prototype={init:function(D,G){D=D||document;if(D.nodeType){this[0]=D;this.length=1;this.context=D;return this}if(typeof D==="string"){var F=C.exec(D);if(F&&(F[1]||!G)){if(F[1]){D=n.clean([F[1]],G)}else{var H=document.getElementById(F[3]);if(H){if(H.id!=F[3]){return n().find(D)}var E=n(H);E.context=document;E.selector=D;return E}D=[]}}else{return n(G).find(D)}}else{if(n.isFunction(D)){return n(document).ready(D)}}if(D.selector&&D.context){this.selector=D.selector;this.context=D.context}return this.setArray(n.makeArray(D))},selector:"",jquery:"1.3",size:function(){return this.length},get:function(D){return D===g?n.makeArray(this):this[D]},pushStack:function(E,G,D){var F=n(E);F.prevObject=this;F.context=this.context;if(G==="find"){F.selector=this.selector+(this.selector?" ":"")+D}else{if(G){F.selector=this.selector+"."+G+"("+D+")"}}return F},setArray:function(D){this.length=0;Array.prototype.push.apply(this,D);return this},each:function(E,D){return n.each(this,E,D)},index:function(D){return n.inArray(D&&D.jquery?D[0]:D,this)},attr:function(E,G,F){var D=E;if(typeof E==="string"){if(G===g){return this[0]&&n[F||"attr"](this[0],E)}else{D={};D[E]=G}}return this.each(function(H){for(E in D){n.attr(F?this.style:this,E,n.prop(this,D[E],F,H,E))}})},css:function(D,E){if((D=="width"||D=="height")&&parseFloat(E)<0){E=g}return this.attr(D,E,"curCSS")},text:function(E){if(typeof E!=="object"&&E!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(E))}var D="";n.each(E||this,function(){n.each(this.childNodes,function(){if(this.nodeType!=8){D+=this.nodeType!=1?this.nodeValue:n.fn.text([this])}})});return D},wrapAll:function(D){if(this[0]){var E=n(D,this[0].ownerDocument).clone();if(this[0].parentNode){E.insertBefore(this[0])}E.map(function(){var F=this;while(F.firstChild){F=F.firstChild}return F}).append(this)}return this},wrapInner:function(D){return this.each(function(){n(this).contents().wrapAll(D)})},wrap:function(D){return this.each(function(){n(this).wrapAll(D)})},append:function(){return this.domManip(arguments,true,function(D){if(this.nodeType==1){this.appendChild(D)}})},prepend:function(){return this.domManip(arguments,true,function(D){if(this.nodeType==1){this.insertBefore(D,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(D){this.parentNode.insertBefore(D,this)})},after:function(){return this.domManip(arguments,false,function(D){this.parentNode.insertBefore(D,this.nextSibling)})},end:function(){return this.prevObject||n([])},push:[].push,find:function(D){if(this.length===1&&!/,/.test(D)){var F=this.pushStack([],"find",D);F.length=0;n.find(D,this[0],F);return F}else{var E=n.map(this,function(G){return n.find(D,G)});return this.pushStack(/[^+>] [^+>]/.test(D)?n.unique(E):E,"find",D)}},clone:function(E){var D=this.map(function(){if(!n.support.noCloneEvent&&!n.isXMLDoc(this)){var H=this.cloneNode(true),G=document.createElement("div");G.appendChild(H);return n.clean([G.innerHTML])[0]}else{return this.cloneNode(true)}});var F=D.find("*").andSelf().each(function(){if(this[h]!==g){this[h]=null}});if(E===true){this.find("*").andSelf().each(function(H){if(this.nodeType==3){return}var G=n.data(this,"events");for(var J in G){for(var I in G[J]){n.event.add(F[H],J,G[J][I],G[J][I].data)}}})}return D},filter:function(D){return this.pushStack(n.isFunction(D)&&n.grep(this,function(F,E){return D.call(F,E)})||n.multiFilter(D,n.grep(this,function(E){return E.nodeType===1})),"filter",D)},closest:function(D){var E=n.expr.match.POS.test(D)?n(D):null;return this.map(function(){var F=this;while(F&&F.ownerDocument){if(E?E.index(F)>-1:n(F).is(D)){return F}F=F.parentNode}})},not:function(D){if(typeof D==="string"){if(f.test(D)){return this.pushStack(n.multiFilter(D,this,true),"not",D)}else{D=n.multiFilter(D,this)}}var E=D.length&&D[D.length-1]!==g&&!D.nodeType;return this.filter(function(){return E?n.inArray(this,D)<0:this!=D})},add:function(D){return this.pushStack(n.unique(n.merge(this.get(),typeof D==="string"?n(D):n.makeArray(D))))},is:function(D){return !!D&&n.multiFilter(D,this).length>0},hasClass:function(D){return !!D&&this.is("."+D)},val:function(J){if(J===g){var D=this[0];if(D){if(n.nodeName(D,"option")){return(D.attributes.value||{}).specified?D.value:D.text}if(n.nodeName(D,"select")){var H=D.selectedIndex,K=[],L=D.options,G=D.type=="select-one";if(H<0){return null}for(var E=G?H:0,I=G?H+1:L.length;E<I;E++){var F=L[E];if(F.selected){J=n(F).val();if(G){return J}K.push(J)}}return K}return(D.value||"").replace(/\r/g,"")}return g}if(typeof J==="number"){J+=""}return this.each(function(){if(this.nodeType!=1){return}if(n.isArray(J)&&/radio|checkbox/.test(this.type)){this.checked=(n.inArray(this.value,J)>=0||n.inArray(this.name,J)>=0)}else{if(n.nodeName(this,"select")){var M=n.makeArray(J);n("option",this).each(function(){this.selected=(n.inArray(this.value,M)>=0||n.inArray(this.text,M)>=0)});if(!M.length){this.selectedIndex=-1}}else{this.value=J}}})},html:function(D){return D===g?(this[0]?this[0].innerHTML:null):this.empty().append(D)},replaceWith:function(D){return this.after(D).remove()},eq:function(D){return this.slice(D,+D+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(D){return this.pushStack(n.map(this,function(F,E){return D.call(F,E,F)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=n.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild,D=this.length>1?I.cloneNode(true):I;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),G>0?D.cloneNode(true):I)}}if(F){n.each(F,y)}}return this;function K(N,O){return M&&n.nodeName(N,"table")&&n.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};n.fn.init.prototype=n.fn;function y(D,E){if(E.src){n.ajax({url:E.src,async:false,dataType:"script"})}else{n.globalEval(E.text||E.textContent||E.innerHTML||"")}if(E.parentNode){E.parentNode.removeChild(E)}}function e(){return +new Date}n.extend=n.fn.extend=function(){var I=arguments[0]||{},G=1,H=arguments.length,D=false,F;if(typeof I==="boolean"){D=I;I=arguments[1]||{};G=2}if(typeof I!=="object"&&!n.isFunction(I)){I={}}if(H==G){I=this;--G}for(;G<H;G++){if((F=arguments[G])!=null){for(var E in F){var J=I[E],K=F[E];if(I===K){continue}if(D&&K&&typeof K==="object"&&!K.nodeType){I[E]=n.extend(D,J||(K.length!=null?[]:{}),K)}else{if(K!==g){I[E]=K}}}}}return I};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,p=document.defaultView||{},r=Object.prototype.toString;n.extend({noConflict:function(D){l.$=o;if(D){l.jQuery=x}return n},isFunction:function(D){return r.call(D)==="[object Function]"},isArray:function(D){return r.call(D)==="[object Array]"},isXMLDoc:function(D){return D.documentElement&&!D.body||D.tagName&&D.ownerDocument&&!D.ownerDocument.body},globalEval:function(F){F=n.trim(F);if(F){var E=document.getElementsByTagName("head")[0]||document.documentElement,D=document.createElement("script");D.type="text/javascript";if(n.support.scriptEval){D.appendChild(document.createTextNode(F))}else{D.text=F}E.insertBefore(D,E.firstChild);E.removeChild(D)}},nodeName:function(E,D){return E.nodeName&&E.nodeName.toUpperCase()==D.toUpperCase()},each:function(F,J,E){var D,G=0,H=F.length;if(E){if(H===g){for(D in F){if(J.apply(F[D],E)===false){break}}}else{for(;G<H;){if(J.apply(F[G++],E)===false){break}}}}else{if(H===g){for(D in F){if(J.call(F[D],D,F[D])===false){break}}}else{for(var I=F[0];G<H&&J.call(I,G,I)!==false;I=F[++G]){}}}return F},prop:function(G,H,F,E,D){if(n.isFunction(H)){H=H.call(G,E)}return typeof H==="number"&&F=="curCSS"&&!b.test(D)?H+"px":H},className:{add:function(D,E){n.each((E||"").split(/\s+/),function(F,G){if(D.nodeType==1&&!n.className.has(D.className,G)){D.className+=(D.className?" ":"")+G}})},remove:function(D,E){if(D.nodeType==1){D.className=E!==g?n.grep(D.className.split(/\s+/),function(F){return !n.className.has(E,F)}).join(" "):""}},has:function(E,D){return n.inArray(D,(E.className||E).toString().split(/\s+/))>-1}},swap:function(G,F,H){var D={};for(var E in F){D[E]=G.style[E];G.style[E]=F[E]}H.call(G);for(var E in F){G.style[E]=D[E]}},css:function(F,D,H){if(D=="width"||D=="height"){var J,E={position:"absolute",visibility:"hidden",display:"block"},I=D=="width"?["Left","Right"]:["Top","Bottom"];function G(){J=D=="width"?F.offsetWidth:F.offsetHeight;var L=0,K=0;n.each(I,function(){L+=parseFloat(n.curCSS(F,"padding"+this,true))||0;K+=parseFloat(n.curCSS(F,"border"+this+"Width",true))||0});J-=Math.round(L+K)}if(n(F).is(":visible")){G()}else{n.swap(F,E,G)}return Math.max(0,J)}return n.curCSS(F,D,H)},curCSS:function(H,E,F){var K,D=H.style;if(E=="opacity"&&!n.support.opacity){K=n.attr(D,"opacity");return K==""?"1":K}if(E.match(/float/i)){E=v}if(!F&&D&&D[E]){K=D[E]}else{if(p.getComputedStyle){if(E.match(/float/i)){E="float"}E=E.replace(/([A-Z])/g,"-$1").toLowerCase();var L=p.getComputedStyle(H,null);if(L){K=L.getPropertyValue(E)}if(E=="opacity"&&K==""){K="1"}}else{if(H.currentStyle){var I=E.replace(/\-(\w)/g,function(M,N){return N.toUpperCase()});K=H.currentStyle[E]||H.currentStyle[I];if(!/^\d+(px)?$/i.test(K)&&/^\d/.test(K)){var G=D.left,J=H.runtimeStyle.left;H.runtimeStyle.left=H.currentStyle.left;D.left=K||0;K=D.pixelLeft+"px";D.left=G;H.runtimeStyle.left=J}}}}return K},clean:function(E,J,H){J=J||document;if(typeof J.createElement==="undefined"){J=J.ownerDocument||J[0]&&J[0].ownerDocument||document}if(!H&&E.length===1&&typeof E[0]==="string"){var G=/^<(\w+)\s*\/?>$/.exec(E[0]);if(G){return[J.createElement(G[1])]}}var F=[],D=[],K=J.createElement("div");n.each(E,function(O,Q){if(typeof Q==="number"){Q+=""}if(!Q){return}if(typeof Q==="string"){Q=Q.replace(/(<(\w+)[^>]*?)\/>/g,function(S,T,R){return R.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?S:T+"></"+R+">"});var N=n.trim(Q).toLowerCase();var P=!N.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!N.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||N.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!N.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!N.indexOf("<td")||!N.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!N.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!n.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];K.innerHTML=P[1]+Q+P[2];while(P[0]--){K=K.lastChild}if(!n.support.tbody){var M=!N.indexOf("<table")&&N.indexOf("<tbody")<0?K.firstChild&&K.firstChild.childNodes:P[1]=="<table>"&&N.indexOf("<tbody")<0?K.childNodes:[];for(var L=M.length-1;L>=0;--L){if(n.nodeName(M[L],"tbody")&&!M[L].childNodes.length){M[L].parentNode.removeChild(M[L])}}}if(!n.support.leadingWhitespace&&/^\s/.test(Q)){K.insertBefore(J.createTextNode(Q.match(/^\s*/)[0]),K.firstChild)}Q=n.makeArray(K.childNodes)}if(Q.nodeType){F.push(Q)}else{F=n.merge(F,Q)}});if(H){for(var I=0;F[I];I++){if(n.nodeName(F[I],"script")&&(!F[I].type||F[I].type.toLowerCase()==="text/javascript")){D.push(F[I].parentNode?F[I].parentNode.removeChild(F[I]):F[I])}else{if(F[I].nodeType===1){F.splice.apply(F,[I+1,0].concat(n.makeArray(F[I].getElementsByTagName("script"))))}H.appendChild(F[I])}}return D}return F},attr:function(I,F,J){if(!I||I.nodeType==3||I.nodeType==8){return g}var G=!n.isXMLDoc(I),K=J!==g;F=G&&n.props[F]||F;if(I.tagName){var E=/href|src|style/.test(F);if(F=="selected"&&I.parentNode){I.parentNode.selectedIndex}if(F in I&&G&&!E){if(K){if(F=="type"&&n.nodeName(I,"input")&&I.parentNode){throw"type property can't be changed"}I[F]=J}if(n.nodeName(I,"form")&&I.getAttributeNode(F)){return I.getAttributeNode(F).nodeValue}if(F=="tabIndex"){var H=I.getAttributeNode("tabIndex");return H&&H.specified?H.value:I.nodeName.match(/^(a|area|button|input|object|select|textarea)$/i)?0:g}return I[F]}if(!n.support.style&&G&&F=="style"){return n.attr(I.style,"cssText",J)}if(K){I.setAttribute(F,""+J)}var D=!n.support.hrefNormalized&&G&&E?I.getAttribute(F,2):I.getAttribute(F);return D===null?g:D}if(!n.support.opacity&&F=="opacity"){if(K){I.zoom=1;I.filter=(I.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(J)+""=="NaN"?"":"alpha(opacity="+J*100+")")}return I.filter&&I.filter.indexOf("opacity=")>=0?(parseFloat(I.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}F=F.replace(/-([a-z])/ig,function(L,M){return M.toUpperCase()});if(K){I[F]=J}return I[F]},trim:function(D){return(D||"").replace(/^\s+|\s+$/g,"")},makeArray:function(F){var D=[];if(F!=null){var E=F.length;if(E==null||typeof F==="string"||n.isFunction(F)||F.setInterval){D[0]=F}else{while(E){D[--E]=F[E]}}}return D},inArray:function(F,G){for(var D=0,E=G.length;D<E;D++){if(G[D]===F){return D}}return -1},merge:function(G,D){var E=0,F,H=G.length;if(!n.support.getAll){while((F=D[E++])!=null){if(F.nodeType!=8){G[H++]=F}}}else{while((F=D[E++])!=null){G[H++]=F}}return G},unique:function(J){var E=[],D={};try{for(var F=0,G=J.length;F<G;F++){var I=n.data(J[F]);if(!D[I]){D[I]=true;E.push(J[F])}}}catch(H){E=J}return E},grep:function(E,I,D){var F=[];for(var G=0,H=E.length;G<H;G++){if(!D!=!I(E[G],G)){F.push(E[G])}}return F},map:function(D,I){var E=[];for(var F=0,G=D.length;F<G;F++){var H=I(D[F],F);if(H!=null){E[E.length]=H}}return E.concat.apply([],E)}});var B=navigator.userAgent.toLowerCase();n.browser={version:(B.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(B),opera:/opera/.test(B),msie:/msie/.test(B)&&!/opera/.test(B),mozilla:/mozilla/.test(B)&&!/(compatible|webkit)/.test(B)};n.each({parent:function(D){return D.parentNode},parents:function(D){return n.dir(D,"parentNode")},next:function(D){return n.nth(D,2,"nextSibling")},prev:function(D){return n.nth(D,2,"previousSibling")},nextAll:function(D){return n.dir(D,"nextSibling")},prevAll:function(D){return n.dir(D,"previousSibling")},siblings:function(D){return n.sibling(D.parentNode.firstChild,D)},children:function(D){return n.sibling(D.firstChild)},contents:function(D){return n.nodeName(D,"iframe")?D.contentDocument||D.contentWindow.document:n.makeArray(D.childNodes)}},function(D,E){n.fn[D]=function(F){var G=n.map(this,E);if(F&&typeof F=="string"){G=n.multiFilter(F,G)}return this.pushStack(n.unique(G),D,F)}});n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(D,E){n.fn[D]=function(){var F=arguments;return this.each(function(){for(var G=0,H=F.length;G<H;G++){n(F[G])[E](this)}})}});n.each({removeAttr:function(D){n.attr(this,D,"");if(this.nodeType==1){this.removeAttribute(D)}},addClass:function(D){n.className.add(this,D)},removeClass:function(D){n.className.remove(this,D)},toggleClass:function(E,D){if(typeof D!=="boolean"){D=!n.className.has(this,E)}n.className[D?"add":"remove"](this,E)},remove:function(D){if(!D||n.filter(D,[this]).length){n("*",this).add([this]).each(function(){n.event.remove(this);n.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){n(">*",this).remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(D,E){n.fn[D]=function(){return this.each(E,arguments)}});function j(D,E){return D[0]&&parseInt(n.curCSS(D[0],E,true),10)||0}var h="jQuery"+e(),u=0,z={};n.extend({cache:{},data:function(E,D,F){E=E==l?z:E;var G=E[h];if(!G){G=E[h]=++u}if(D&&!n.cache[G]){n.cache[G]={}}if(F!==g){n.cache[G][D]=F}return D?n.cache[G][D]:G},removeData:function(E,D){E=E==l?z:E;var G=E[h];if(D){if(n.cache[G]){delete n.cache[G][D];D="";for(D in n.cache[G]){break}if(!D){n.removeData(E)}}}else{try{delete E[h]}catch(F){if(E.removeAttribute){E.removeAttribute(h)}}delete n.cache[G]}},queue:function(E,D,G){if(E){D=(D||"fx")+"queue";var F=n.data(E,D);if(!F||n.isArray(G)){F=n.data(E,D,n.makeArray(G))}else{if(G){F.push(G)}}}return F},dequeue:function(G,F){var D=n.queue(G,F),E=D.shift();if(!F||F==="fx"){E=D[0]}if(E!==g){E.call(G)}}});n.fn.extend({data:function(D,F){var G=D.split(".");G[1]=G[1]?"."+G[1]:"";if(F===g){var E=this.triggerHandler("getData"+G[1]+"!",[G[0]]);if(E===g&&this.length){E=n.data(this[0],D)}return E===g&&G[1]?this.data(G[0]):E}else{return this.trigger("setData"+G[1]+"!",[G[0],F]).each(function(){n.data(this,D,F)})}},removeData:function(D){return this.each(function(){n.removeData(this,D)})},queue:function(D,E){if(typeof D!=="string"){E=D;D="fx"}if(E===g){return n.queue(this[0],D)}return this.each(function(){var F=n.queue(this,D,E);if(D=="fx"&&F.length==1){F[0].call(this)}})},dequeue:function(D){return this.each(function(){n.dequeue(this,D)})}}); | |
13 | -/* | |
14 | - * Sizzle CSS Selector Engine - v0.9.1 | |
15 | - * Copyright 2009, The Dojo Foundation | |
16 | - * Released under the MIT, BSD, and GPL Licenses. | |
17 | - * More information: http://sizzlejs.com/ | |
18 | - */ | |
19 | -(function(){var N=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|[^[\]]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,I=0,F=Object.prototype.toString;var E=function(ae,S,aa,V){aa=aa||[];S=S||document;if(S.nodeType!==1&&S.nodeType!==9){return[]}if(!ae||typeof ae!=="string"){return aa}var ab=[],ac,Y,ah,ag,Z,R,Q=true;N.lastIndex=0;while((ac=N.exec(ae))!==null){ab.push(ac[1]);if(ac[2]){R=RegExp.rightContext;break}}if(ab.length>1&&G.match.POS.exec(ae)){if(ab.length===2&&G.relative[ab[0]]){var U="",X;while((X=G.match.POS.exec(ae))){U+=X[0];ae=ae.replace(G.match.POS,"")}Y=E.filter(U,E(/\s$/.test(ae)?ae+"*":ae,S))}else{Y=G.relative[ab[0]]?[S]:E(ab.shift(),S);while(ab.length){var P=[];ae=ab.shift();if(G.relative[ae]){ae+=ab.shift()}for(var af=0,ad=Y.length;af<ad;af++){E(ae,Y[af],P)}Y=P}}}else{var ai=V?{expr:ab.pop(),set:D(V)}:E.find(ab.pop(),ab.length===1&&S.parentNode?S.parentNode:S);Y=E.filter(ai.expr,ai.set);if(ab.length>0){ah=D(Y)}else{Q=false}while(ab.length){var T=ab.pop(),W=T;if(!G.relative[T]){T=""}else{W=ab.pop()}if(W==null){W=S}G.relative[T](ah,W,M(S))}}if(!ah){ah=Y}if(!ah){throw"Syntax error, unrecognized expression: "+(T||ae)}if(F.call(ah)==="[object Array]"){if(!Q){aa.push.apply(aa,ah)}else{if(S.nodeType===1){for(var af=0;ah[af]!=null;af++){if(ah[af]&&(ah[af]===true||ah[af].nodeType===1&&H(S,ah[af]))){aa.push(Y[af])}}}else{for(var af=0;ah[af]!=null;af++){if(ah[af]&&ah[af].nodeType===1){aa.push(Y[af])}}}}}else{D(ah,aa)}if(R){E(R,S,aa,V)}return aa};E.matches=function(P,Q){return E(P,null,null,Q)};E.find=function(V,S){var W,Q;if(!V){return[]}for(var R=0,P=G.order.length;R<P;R++){var T=G.order[R],Q;if((Q=G.match[T].exec(V))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){Q[1]=(Q[1]||"").replace(/\\/g,"");W=G.find[T](Q,S);if(W!=null){V=V.replace(G.match[T],"");break}}}}if(!W){W=S.getElementsByTagName("*")}return{set:W,expr:V}};E.filter=function(S,ac,ad,T){var Q=S,Y=[],ah=ac,V,ab;while(S&&ac.length){for(var U in G.filter){if((V=G.match[U].exec(S))!=null){var Z=G.filter[U],R=null,X=0,aa,ag;ab=false;if(ah==Y){Y=[]}if(G.preFilter[U]){V=G.preFilter[U](V,ah,ad,Y,T);if(!V){ab=aa=true}else{if(V===true){continue}else{if(V[0]===true){R=[];var W=null,af;for(var ae=0;(af=ah[ae])!==g;ae++){if(af&&W!==af){R.push(af);W=af}}}}}}if(V){for(var ae=0;(ag=ah[ae])!==g;ae++){if(ag){if(R&&ag!=R[X]){X++}aa=Z(ag,V,X,R);var P=T^!!aa;if(ad&&aa!=null){if(P){ab=true}else{ah[ae]=false}}else{if(P){Y.push(ag);ab=true}}}}}if(aa!==g){if(!ad){ah=Y}S=S.replace(G.match[U],"");if(!ab){return[]}break}}}S=S.replace(/\s*,\s*/,"");if(S==Q){if(ab==null){throw"Syntax error, unrecognized expression: "+S}else{break}}Q=S}return ah};var G=E.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(P){return P.getAttribute("href")}},relative:{"+":function(T,Q){for(var R=0,P=T.length;R<P;R++){var S=T[R];if(S){var U=S.previousSibling;while(U&&U.nodeType!==1){U=U.previousSibling}T[R]=typeof Q==="string"?U||false:U===Q}}if(typeof Q==="string"){E.filter(Q,T,true)}},">":function(U,Q,V){if(typeof Q==="string"&&!/\W/.test(Q)){Q=V?Q:Q.toUpperCase();for(var R=0,P=U.length;R<P;R++){var T=U[R];if(T){var S=T.parentNode;U[R]=S.nodeName===Q?S:false}}}else{for(var R=0,P=U.length;R<P;R++){var T=U[R];if(T){U[R]=typeof Q==="string"?T.parentNode:T.parentNode===Q}}if(typeof Q==="string"){E.filter(Q,U,true)}}},"":function(S,Q,U){var R="done"+(I++),P=O;if(!Q.match(/\W/)){var T=Q=U?Q:Q.toUpperCase();P=L}P("parentNode",Q,R,S,T,U)},"~":function(S,Q,U){var R="done"+(I++),P=O;if(typeof Q==="string"&&!Q.match(/\W/)){var T=Q=U?Q:Q.toUpperCase();P=L}P("previousSibling",Q,R,S,T,U)}},find:{ID:function(Q,R){if(R.getElementById){var P=R.getElementById(Q[1]);return P?[P]:[]}},NAME:function(P,Q){return Q.getElementsByName?Q.getElementsByName(P[1]):null},TAG:function(P,Q){return Q.getElementsByTagName(P[1])}},preFilter:{CLASS:function(S,Q,R,P,U){S=" "+S[1].replace(/\\/g,"")+" ";for(var T=0;Q[T];T++){if(U^(" "+Q[T].className+" ").indexOf(S)>=0){if(!R){P.push(Q[T])}}else{if(R){Q[T]=false}}}return false},ID:function(P){return P[1].replace(/\\/g,"")},TAG:function(Q,P){for(var R=0;!P[R];R++){}return M(P[R])?Q[1]:Q[1].toUpperCase()},CHILD:function(P){if(P[1]=="nth"){var Q=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(P[2]=="even"&&"2n"||P[2]=="odd"&&"2n+1"||!/\D/.test(P[2])&&"0n+"+P[2]||P[2]);P[2]=(Q[1]+(Q[2]||1))-0;P[3]=Q[3]-0}P[0]="done"+(I++);return P},ATTR:function(Q){var P=Q[1];if(G.attrMap[P]){Q[1]=G.attrMap[P]}if(Q[2]==="~="){Q[4]=" "+Q[4]+" "}return Q},PSEUDO:function(T,Q,R,P,U){if(T[1]==="not"){if(T[3].match(N).length>1){T[3]=E(T[3],null,null,Q)}else{var S=E.filter(T[3],Q,R,true^U);if(!R){P.push.apply(P,S)}return false}}else{if(G.match.POS.test(T[0])){return true}}return T},POS:function(P){P.unshift(true);return P}},filters:{enabled:function(P){return P.disabled===false&&P.type!=="hidden"},disabled:function(P){return P.disabled===true},checked:function(P){return P.checked===true},selected:function(P){P.parentNode.selectedIndex;return P.selected===true},parent:function(P){return !!P.firstChild},empty:function(P){return !P.firstChild},has:function(R,Q,P){return !!E(P[3],R).length},header:function(P){return/h\d/i.test(P.nodeName)},text:function(P){return"text"===P.type},radio:function(P){return"radio"===P.type},checkbox:function(P){return"checkbox"===P.type},file:function(P){return"file"===P.type},password:function(P){return"password"===P.type},submit:function(P){return"submit"===P.type},image:function(P){return"image"===P.type},reset:function(P){return"reset"===P.type},button:function(P){return"button"===P.type||P.nodeName.toUpperCase()==="BUTTON"},input:function(P){return/input|select|textarea|button/i.test(P.nodeName)}},setFilters:{first:function(Q,P){return P===0},last:function(R,Q,P,S){return Q===S.length-1},even:function(Q,P){return P%2===0},odd:function(Q,P){return P%2===1},lt:function(R,Q,P){return Q<P[3]-0},gt:function(R,Q,P){return Q>P[3]-0},nth:function(R,Q,P){return P[3]-0==Q},eq:function(R,Q,P){return P[3]-0==Q}},filter:{CHILD:function(P,S){var V=S[1],W=P.parentNode;var U="child"+W.childNodes.length;if(W&&(!W[U]||!P.nodeIndex)){var T=1;for(var Q=W.firstChild;Q;Q=Q.nextSibling){if(Q.nodeType==1){Q.nodeIndex=T++}}W[U]=T-1}if(V=="first"){return P.nodeIndex==1}else{if(V=="last"){return P.nodeIndex==W[U]}else{if(V=="only"){return W[U]==1}else{if(V=="nth"){var Y=false,R=S[2],X=S[3];if(R==1&&X==0){return true}if(R==0){if(P.nodeIndex==X){Y=true}}else{if((P.nodeIndex-X)%R==0&&(P.nodeIndex-X)/R>=0){Y=true}}return Y}}}}},PSEUDO:function(V,R,S,W){var Q=R[1],T=G.filters[Q];if(T){return T(V,S,R,W)}else{if(Q==="contains"){return(V.textContent||V.innerText||"").indexOf(R[3])>=0}else{if(Q==="not"){var U=R[3];for(var S=0,P=U.length;S<P;S++){if(U[S]===V){return false}}return true}}}},ID:function(Q,P){return Q.nodeType===1&&Q.getAttribute("id")===P},TAG:function(Q,P){return(P==="*"&&Q.nodeType===1)||Q.nodeName===P},CLASS:function(Q,P){return P.test(Q.className)},ATTR:function(T,R){var P=G.attrHandle[R[1]]?G.attrHandle[R[1]](T):T[R[1]]||T.getAttribute(R[1]),U=P+"",S=R[2],Q=R[4];return P==null?false:S==="="?U===Q:S==="*="?U.indexOf(Q)>=0:S==="~="?(" "+U+" ").indexOf(Q)>=0:!R[4]?P:S==="!="?U!=Q:S==="^="?U.indexOf(Q)===0:S==="$="?U.substr(U.length-Q.length)===Q:S==="|="?U===Q||U.substr(0,Q.length+1)===Q+"-":false},POS:function(T,Q,R,U){var P=Q[2],S=G.setFilters[P];if(S){return S(T,R,Q,U)}}}};for(var K in G.match){G.match[K]=RegExp(G.match[K].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var D=function(Q,P){Q=Array.prototype.slice.call(Q);if(P){P.push.apply(P,Q);return P}return Q};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(J){D=function(T,S){var Q=S||[];if(F.call(T)==="[object Array]"){Array.prototype.push.apply(Q,T)}else{if(typeof T.length==="number"){for(var R=0,P=T.length;R<P;R++){Q.push(T[R])}}else{for(var R=0;T[R];R++){Q.push(T[R])}}}return Q}}(function(){var Q=document.createElement("form"),R="script"+(new Date).getTime();Q.innerHTML="<input name='"+R+"'/>";var P=document.documentElement;P.insertBefore(Q,P.firstChild);if(!!document.getElementById(R)){G.find.ID=function(T,U){if(U.getElementById){var S=U.getElementById(T[1]);return S?S.id===T[1]||S.getAttributeNode&&S.getAttributeNode("id").nodeValue===T[1]?[S]:g:[]}};G.filter.ID=function(U,S){var T=U.getAttributeNode&&U.getAttributeNode("id");return U.nodeType===1&&T&&T.nodeValue===S}}P.removeChild(Q)})();(function(){var P=document.createElement("div");P.appendChild(document.createComment(""));if(P.getElementsByTagName("*").length>0){G.find.TAG=function(Q,U){var T=U.getElementsByTagName(Q[1]);if(Q[1]==="*"){var S=[];for(var R=0;T[R];R++){if(T[R].nodeType===1){S.push(T[R])}}T=S}return T}}P.innerHTML="<a href='#'></a>";if(P.firstChild.getAttribute("href")!=="#"){G.attrHandle.href=function(Q){return Q.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var P=E;E=function(T,S,Q,R){S=S||document;if(!R&&S.nodeType===9){try{return D(S.querySelectorAll(T),Q)}catch(U){}}return P(T,S,Q,R)};E.find=P.find;E.filter=P.filter;E.selectors=P.selectors;E.matches=P.matches})()}if(document.documentElement.getElementsByClassName){G.order.splice(1,0,"CLASS");G.find.CLASS=function(P,Q){return Q.getElementsByClassName(P[1])}}function L(Q,W,V,Z,X,Y){for(var T=0,R=Z.length;T<R;T++){var P=Z[T];if(P){P=P[Q];var U=false;while(P&&P.nodeType){var S=P[V];if(S){U=Z[S];break}if(P.nodeType===1&&!Y){P[V]=T}if(P.nodeName===W){U=P;break}P=P[Q]}Z[T]=U}}}function O(Q,V,U,Y,W,X){for(var S=0,R=Y.length;S<R;S++){var P=Y[S];if(P){P=P[Q];var T=false;while(P&&P.nodeType){if(P[U]){T=Y[P[U]];break}if(P.nodeType===1){if(!X){P[U]=S}if(typeof V!=="string"){if(P===V){T=true;break}}else{if(E.filter(V,[P]).length>0){T=P;break}}}P=P[Q]}Y[S]=T}}}var H=document.compareDocumentPosition?function(Q,P){return Q.compareDocumentPosition(P)&16}:function(Q,P){return Q!==P&&(Q.contains?Q.contains(P):true)};var M=function(P){return P.documentElement&&!P.body||P.tagName&&P.ownerDocument&&!P.ownerDocument.body};n.find=E;n.filter=E.filter;n.expr=E.selectors;n.expr[":"]=n.expr.filters;E.selectors.filters.hidden=function(P){return"hidden"===P.type||n.css(P,"display")==="none"||n.css(P,"visibility")==="hidden"};E.selectors.filters.visible=function(P){return"hidden"!==P.type&&n.css(P,"display")!=="none"&&n.css(P,"visibility")!=="hidden"};E.selectors.filters.animated=function(P){return n.grep(n.timers,function(Q){return P===Q.elem}).length};n.multiFilter=function(R,P,Q){if(Q){R=":not("+R+")"}return E.matches(R,P)};n.dir=function(R,Q){var P=[],S=R[Q];while(S&&S!=document){if(S.nodeType==1){P.push(S)}S=S[Q]}return P};n.nth=function(T,P,R,S){P=P||1;var Q=0;for(;T;T=T[R]){if(T.nodeType==1&&++Q==P){break}}return T};n.sibling=function(R,Q){var P=[];for(;R;R=R.nextSibling){if(R.nodeType==1&&R!=Q){P.push(R)}}return P};return;l.Sizzle=E})();n.event={add:function(H,E,G,J){if(H.nodeType==3||H.nodeType==8){return}if(H.setInterval&&H!=l){H=l}if(!G.guid){G.guid=this.guid++}if(J!==g){var F=G;G=this.proxy(F);G.data=J}var D=n.data(H,"events")||n.data(H,"events",{}),I=n.data(H,"handle")||n.data(H,"handle",function(){return typeof n!=="undefined"&&!n.event.triggered?n.event.handle.apply(arguments.callee.elem,arguments):g});I.elem=H;n.each(E.split(/\s+/),function(L,M){var N=M.split(".");M=N.shift();G.type=N.slice().sort().join(".");var K=D[M];if(n.event.specialAll[M]){n.event.specialAll[M].setup.call(H,J,N)}if(!K){K=D[M]={};if(!n.event.special[M]||n.event.special[M].setup.call(H,J,N)===false){if(H.addEventListener){H.addEventListener(M,I,false)}else{if(H.attachEvent){H.attachEvent("on"+M,I)}}}}K[G.guid]=G;n.event.global[M]=true});H=null},guid:1,global:{},remove:function(J,G,I){if(J.nodeType==3||J.nodeType==8){return}var F=n.data(J,"events"),E,D;if(F){if(G===g||(typeof G==="string"&&G.charAt(0)==".")){for(var H in F){this.remove(J,H+(G||""))}}else{if(G.type){I=G.handler;G=G.type}n.each(G.split(/\s+/),function(L,N){var P=N.split(".");N=P.shift();var M=RegExp("(^|\\.)"+P.slice().sort().join(".*\\.")+"(\\.|$)");if(F[N]){if(I){delete F[N][I.guid]}else{for(var O in F[N]){if(M.test(F[N][O].type)){delete F[N][O]}}}if(n.event.specialAll[N]){n.event.specialAll[N].teardown.call(J,P)}for(E in F[N]){break}if(!E){if(!n.event.special[N]||n.event.special[N].teardown.call(J,P)===false){if(J.removeEventListener){J.removeEventListener(N,n.data(J,"handle"),false)}else{if(J.detachEvent){J.detachEvent("on"+N,n.data(J,"handle"))}}}E=null;delete F[N]}}})}for(E in F){break}if(!E){var K=n.data(J,"handle");if(K){K.elem=null}n.removeData(J,"events");n.removeData(J,"handle")}}},trigger:function(H,J,G,D){var F=H.type||H;if(!D){H=typeof H==="object"?H[h]?H:n.extend(n.Event(F),H):n.Event(F);if(F.indexOf("!")>=0){H.type=F=F.slice(0,-1);H.exclusive=true}if(!G){H.stopPropagation();if(this.global[F]){n.each(n.cache,function(){if(this.events&&this.events[F]){n.event.trigger(H,J,this.handle.elem)}})}}if(!G||G.nodeType==3||G.nodeType==8){return g}H.result=g;H.target=G;J=n.makeArray(J);J.unshift(H)}H.currentTarget=G;var I=n.data(G,"handle");if(I){I.apply(G,J)}if((!G[F]||(n.nodeName(G,"a")&&F=="click"))&&G["on"+F]&&G["on"+F].apply(G,J)===false){H.result=false}if(!D&&G[F]&&!H.isDefaultPrevented()&&!(n.nodeName(G,"a")&&F=="click")){this.triggered=true;try{G[F]()}catch(K){}}this.triggered=false;if(!H.isPropagationStopped()){var E=G.parentNode||G.ownerDocument;if(E){n.event.trigger(H,J,E,true)}}},handle:function(J){var I,D;J=arguments[0]=n.event.fix(J||l.event);var K=J.type.split(".");J.type=K.shift();I=!K.length&&!J.exclusive;var H=RegExp("(^|\\.)"+K.slice().sort().join(".*\\.")+"(\\.|$)");D=(n.data(this,"events")||{})[J.type];for(var F in D){var G=D[F];if(I||H.test(G.type)){J.handler=G;J.data=G.data;var E=G.apply(this,arguments);if(E!==g){J.result=E;if(E===false){J.preventDefault();J.stopPropagation()}}if(J.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(G){if(G[h]){return G}var E=G;G=n.Event(E);for(var F=this.props.length,I;F;){I=this.props[--F];G[I]=E[I]}if(!G.target){G.target=G.srcElement||document}if(G.target.nodeType==3){G.target=G.target.parentNode}if(!G.relatedTarget&&G.fromElement){G.relatedTarget=G.fromElement==G.target?G.toElement:G.fromElement}if(G.pageX==null&&G.clientX!=null){var H=document.documentElement,D=document.body;G.pageX=G.clientX+(H&&H.scrollLeft||D&&D.scrollLeft||0)-(H.clientLeft||0);G.pageY=G.clientY+(H&&H.scrollTop||D&&D.scrollTop||0)-(H.clientTop||0)}if(!G.which&&((G.charCode||G.charCode===0)?G.charCode:G.keyCode)){G.which=G.charCode||G.keyCode}if(!G.metaKey&&G.ctrlKey){G.metaKey=G.ctrlKey}if(!G.which&&G.button){G.which=(G.button&1?1:(G.button&2?3:(G.button&4?2:0)))}return G},proxy:function(E,D){D=D||function(){return E.apply(this,arguments)};D.guid=E.guid=E.guid||D.guid||this.guid++;return D},special:{ready:{setup:A,teardown:function(){}}},specialAll:{live:{setup:function(D,E){n.event.add(this,E[0],c)},teardown:function(F){if(F.length){var D=0,E=RegExp("(^|\\.)"+F[0]+"(\\.|$)");n.each((n.data(this,"events").live||{}),function(){if(E.test(this.type)){D++}});if(D<1){n.event.remove(this,F[0],c)}}}}}};n.Event=function(D){if(!this.preventDefault){return new n.Event(D)}if(D&&D.type){this.originalEvent=D;this.type=D.type;this.timeStamp=D.timeStamp}else{this.type=D}if(!this.timeStamp){this.timeStamp=e()}this[h]=true};function k(){return false}function t(){return true}n.Event.prototype={preventDefault:function(){this.isDefaultPrevented=t;var D=this.originalEvent;if(!D){return}if(D.preventDefault){D.preventDefault()}D.returnValue=false},stopPropagation:function(){this.isPropagationStopped=t;var D=this.originalEvent;if(!D){return}if(D.stopPropagation){D.stopPropagation()}D.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=t;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(E){var D=E.relatedTarget;while(D&&D!=this){try{D=D.parentNode}catch(F){D=this}}if(D!=this){E.type=E.data;n.event.handle.apply(this,arguments)}};n.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(E,D){n.event.special[D]={setup:function(){n.event.add(this,E,a,D)},teardown:function(){n.event.remove(this,E,a)}}});n.fn.extend({bind:function(E,F,D){return E=="unload"?this.one(E,F,D):this.each(function(){n.event.add(this,E,D||F,D&&F)})},one:function(F,G,E){var D=n.event.proxy(E||G,function(H){n(this).unbind(H,D);return(E||G).apply(this,arguments)});return this.each(function(){n.event.add(this,F,D,E&&G)})},unbind:function(E,D){return this.each(function(){n.event.remove(this,E,D)})},trigger:function(D,E){return this.each(function(){n.event.trigger(D,E,this)})},triggerHandler:function(D,F){if(this[0]){var E=n.Event(D);E.preventDefault();E.stopPropagation();n.event.trigger(E,F,this[0]);return E.result}},toggle:function(F){var D=arguments,E=1;while(E<D.length){n.event.proxy(F,D[E++])}return this.click(n.event.proxy(F,function(G){this.lastToggle=(this.lastToggle||0)%E;G.preventDefault();return D[this.lastToggle++].apply(this,arguments)||false}))},hover:function(D,E){return this.mouseenter(D).mouseleave(E)},ready:function(D){A();if(n.isReady){D.call(document,n)}else{n.readyList.push(D)}return this},live:function(F,E){var D=n.event.proxy(E);D.guid+=this.selector+F;n(document).bind(i(F,this.selector),this.selector,D);return this},die:function(E,D){n(document).unbind(i(E,this.selector),D?{guid:D.guid+this.selector+E}:null);return this}});function c(G){var D=RegExp("(^|\\.)"+G.type+"(\\.|$)"),F=true,E=[];n.each(n.data(this,"events").live||[],function(H,I){if(D.test(I.type)){var J=n(G.target).closest(I.data)[0];if(J){E.push({elem:J,fn:I})}}});n.each(E,function(){if(!G.isImmediatePropagationStopped()&&this.fn.call(this.elem,G,this.fn.data)===false){F=false}});return F}function i(E,D){return["live",E,D.replace(/\./g,"`").replace(/ /g,"|")].join(".")}n.extend({isReady:false,readyList:[],ready:function(){if(!n.isReady){n.isReady=true;if(n.readyList){n.each(n.readyList,function(){this.call(document,n)});n.readyList=null}n(document).triggerHandler("ready")}}});var w=false;function A(){if(w){return}w=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);n.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);n.ready()}});if(document.documentElement.doScroll&&!l.frameElement){(function(){if(n.isReady){return}try{document.documentElement.doScroll("left")}catch(D){setTimeout(arguments.callee,0);return}n.ready()})()}}}n.event.add(l,"load",n.ready)}n.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(E,D){n.fn[D]=function(F){return F?this.bind(D,F):this.trigger(D)}});n(l).bind("unload",function(){for(var D in n.cache){if(D!=1&&n.cache[D].handle){n.event.remove(n.cache[D].handle.elem)}}});(function(){n.support={};var E=document.documentElement,F=document.createElement("script"),J=document.createElement("div"),I="script"+(new Date).getTime();J.style.display="none";J.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var G=J.getElementsByTagName("*"),D=J.getElementsByTagName("a")[0];if(!G||!G.length||!D){return}n.support={leadingWhitespace:J.firstChild.nodeType==3,tbody:!J.getElementsByTagName("tbody").length,objectAll:!!J.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!J.getElementsByTagName("link").length,style:/red/.test(D.getAttribute("style")),hrefNormalized:D.getAttribute("href")==="/a",opacity:D.style.opacity==="0.5",cssFloat:!!D.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};F.type="text/javascript";try{F.appendChild(document.createTextNode("window."+I+"=1;"))}catch(H){}E.insertBefore(F,E.firstChild);if(l[I]){n.support.scriptEval=true;delete l[I]}E.removeChild(F);if(J.attachEvent&&J.fireEvent){J.attachEvent("onclick",function(){n.support.noCloneEvent=false;J.detachEvent("onclick",arguments.callee)});J.cloneNode(true).fireEvent("onclick")}n(function(){var K=document.createElement("div");K.style.width="1px";K.style.paddingLeft="1px";document.body.appendChild(K);n.boxModel=n.support.boxModel=K.offsetWidth===2;document.body.removeChild(K)})})();var v=n.support.cssFloat?"cssFloat":"styleFloat";n.props={"for":"htmlFor","class":"className","float":v,cssFloat:v,styleFloat:v,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};n.fn.extend({_load:n.fn.load,load:function(F,I,J){if(typeof F!=="string"){return this._load(F)}var H=F.indexOf(" ");if(H>=0){var D=F.slice(H,F.length);F=F.slice(0,H)}var G="GET";if(I){if(n.isFunction(I)){J=I;I=null}else{if(typeof I==="object"){I=n.param(I);G="POST"}}}var E=this;n.ajax({url:F,type:G,dataType:"html",data:I,complete:function(L,K){if(K=="success"||K=="notmodified"){E.html(D?n("<div/>").append(L.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(D):L.responseText)}if(J){E.each(J,[L.responseText,K,L])}}});return this},serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?n.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))}).map(function(D,E){var F=n(this).val();return F==null?null:n.isArray(F)?n.map(F,function(H,G){return{name:E.name,value:H}}):{name:E.name,value:F}}).get()}});n.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(D,E){n.fn[E]=function(F){return this.bind(E,F)}});var q=e();n.extend({get:function(D,F,G,E){if(n.isFunction(F)){G=F;F=null}return n.ajax({type:"GET",url:D,data:F,success:G,dataType:E})},getScript:function(D,E){return n.get(D,null,E,"script")},getJSON:function(D,E,F){return n.get(D,E,F,"json")},post:function(D,F,G,E){if(n.isFunction(F)){G=F;F={}}return n.ajax({type:"POST",url:D,data:F,success:G,dataType:E})},ajaxSetup:function(D){n.extend(n.ajaxSettings,D)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(L){L=n.extend(true,L,n.extend(true,{},n.ajaxSettings,L));var V,E=/=\?(&|$)/g,Q,U,F=L.type.toUpperCase();if(L.data&&L.processData&&typeof L.data!=="string"){L.data=n.param(L.data)}if(L.dataType=="jsonp"){if(F=="GET"){if(!L.url.match(E)){L.url+=(L.url.match(/\?/)?"&":"?")+(L.jsonp||"callback")+"=?"}}else{if(!L.data||!L.data.match(E)){L.data=(L.data?L.data+"&":"")+(L.jsonp||"callback")+"=?"}}L.dataType="json"}if(L.dataType=="json"&&(L.data&&L.data.match(E)||L.url.match(E))){V="jsonp"+q++;if(L.data){L.data=(L.data+"").replace(E,"="+V+"$1")}L.url=L.url.replace(E,"="+V+"$1");L.dataType="script";l[V]=function(W){U=W;H();K();l[V]=g;try{delete l[V]}catch(X){}if(G){G.removeChild(S)}}}if(L.dataType=="script"&&L.cache==null){L.cache=false}if(L.cache===false&&F=="GET"){var D=e();var T=L.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+D+"$2");L.url=T+((T==L.url)?(L.url.match(/\?/)?"&":"?")+"_="+D:"")}if(L.data&&F=="GET"){L.url+=(L.url.match(/\?/)?"&":"?")+L.data;L.data=null}if(L.global&&!n.active++){n.event.trigger("ajaxStart")}var P=/^(\w+:)?\/\/([^\/?#]+)/.exec(L.url);if(L.dataType=="script"&&F=="GET"&&P&&(P[1]&&P[1]!=location.protocol||P[2]!=location.host)){var G=document.getElementsByTagName("head")[0];var S=document.createElement("script");S.src=L.url;if(L.scriptCharset){S.charset=L.scriptCharset}if(!V){var N=false;S.onload=S.onreadystatechange=function(){if(!N&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){N=true;H();K();G.removeChild(S)}}}G.appendChild(S);return g}var J=false;var I=L.xhr();if(L.username){I.open(F,L.url,L.async,L.username,L.password)}else{I.open(F,L.url,L.async)}try{if(L.data){I.setRequestHeader("Content-Type",L.contentType)}if(L.ifModified){I.setRequestHeader("If-Modified-Since",n.lastModified[L.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}I.setRequestHeader("X-Requested-With","XMLHttpRequest");I.setRequestHeader("Accept",L.dataType&&L.accepts[L.dataType]?L.accepts[L.dataType]+", */*":L.accepts._default)}catch(R){}if(L.beforeSend&&L.beforeSend(I,L)===false){if(L.global&&!--n.active){n.event.trigger("ajaxStop")}I.abort();return false}if(L.global){n.event.trigger("ajaxSend",[I,L])}var M=function(W){if(I.readyState==0){if(O){clearInterval(O);O=null;if(L.global&&!--n.active){n.event.trigger("ajaxStop")}}}else{if(!J&&I&&(I.readyState==4||W=="timeout")){J=true;if(O){clearInterval(O);O=null}Q=W=="timeout"?"timeout":!n.httpSuccess(I)?"error":L.ifModified&&n.httpNotModified(I,L.url)?"notmodified":"success";if(Q=="success"){try{U=n.httpData(I,L.dataType,L)}catch(Y){Q="parsererror"}}if(Q=="success"){var X;try{X=I.getResponseHeader("Last-Modified")}catch(Y){}if(L.ifModified&&X){n.lastModified[L.url]=X}if(!V){H()}}else{n.handleError(L,I,Q)}K();if(L.async){I=null}}}};if(L.async){var O=setInterval(M,13);if(L.timeout>0){setTimeout(function(){if(I){if(!J){M("timeout")}if(I){I.abort()}}},L.timeout)}}try{I.send(L.data)}catch(R){n.handleError(L,I,null,R)}if(!L.async){M()}function H(){if(L.success){L.success(U,Q)}if(L.global){n.event.trigger("ajaxSuccess",[I,L])}}function K(){if(L.complete){L.complete(I,Q)}if(L.global){n.event.trigger("ajaxComplete",[I,L])}if(L.global&&!--n.active){n.event.trigger("ajaxStop")}}return I},handleError:function(E,G,D,F){if(E.error){E.error(G,D,F)}if(E.global){n.event.trigger("ajaxError",[G,E,F])}},active:0,httpSuccess:function(E){try{return !E.status&&location.protocol=="file:"||(E.status>=200&&E.status<300)||E.status==304||E.status==1223}catch(D){}return false},httpNotModified:function(F,D){try{var G=F.getResponseHeader("Last-Modified");return F.status==304||G==n.lastModified[D]}catch(E){}return false},httpData:function(I,G,F){var E=I.getResponseHeader("content-type"),D=G=="xml"||!G&&E&&E.indexOf("xml")>=0,H=D?I.responseXML:I.responseText;if(D&&H.documentElement.tagName=="parsererror"){throw"parsererror"}if(F&&F.dataFilter){H=F.dataFilter(H,G)}if(typeof H==="string"){if(G=="script"){n.globalEval(H)}if(G=="json"){H=l["eval"]("("+H+")")}}return H},param:function(D){var F=[];function G(H,I){F[F.length]=encodeURIComponent(H)+"="+encodeURIComponent(I)}if(n.isArray(D)||D.jquery){n.each(D,function(){G(this.name,this.value)})}else{for(var E in D){if(n.isArray(D[E])){n.each(D[E],function(){G(E,this)})}else{G(E,n.isFunction(D[E])?D[E]():D[E])}}}return F.join("&").replace(/%20/g,"+")}});var m={},d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function s(E,D){var F={};n.each(d.concat.apply([],d.slice(0,D)),function(){F[this]=E});return F}n.fn.extend({show:function(I,K){if(I){return this.animate(s("show",3),I,K)}else{for(var G=0,E=this.length;G<E;G++){var D=n.data(this[G],"olddisplay");this[G].style.display=D||"";if(n.css(this[G],"display")==="none"){var F=this[G].tagName,J;if(m[F]){J=m[F]}else{var H=n("<"+F+" />").appendTo("body");J=H.css("display");if(J==="none"){J="block"}H.remove();m[F]=J}this[G].style.display=n.data(this[G],"olddisplay",J)}}return this}},hide:function(G,H){if(G){return this.animate(s("hide",3),G,H)}else{for(var F=0,E=this.length;F<E;F++){var D=n.data(this[F],"olddisplay");if(!D&&D!=="none"){n.data(this[F],"olddisplay",n.css(this[F],"display"))}this[F].style.display="none"}return this}},_toggle:n.fn.toggle,toggle:function(F,E){var D=typeof F==="boolean";return n.isFunction(F)&&n.isFunction(E)?this._toggle.apply(this,arguments):F==null||D?this.each(function(){var G=D?F:n(this).is(":hidden");n(this)[G?"show":"hide"]()}):this.animate(s("toggle",3),F,E)},fadeTo:function(D,F,E){return this.animate({opacity:F},D,E)},animate:function(H,E,G,F){var D=n.speed(E,G,F);return this[D.queue===false?"each":"queue"](function(){var J=n.extend({},D),L,K=this.nodeType==1&&n(this).is(":hidden"),I=this;for(L in H){if(H[L]=="hide"&&K||H[L]=="show"&&!K){return J.complete.call(this)}if((L=="height"||L=="width")&&this.style){J.display=n.css(this,"display");J.overflow=this.style.overflow}}if(J.overflow!=null){this.style.overflow="hidden"}J.curAnim=n.extend({},H);n.each(H,function(N,R){var Q=new n.fx(I,J,N);if(/toggle|show|hide/.test(R)){Q[R=="toggle"?K?"show":"hide":R](H)}else{var P=R.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),S=Q.cur(true)||0;if(P){var M=parseFloat(P[2]),O=P[3]||"px";if(O!="px"){I.style[N]=(M||1)+O;S=((M||1)/Q.cur(true))*S;I.style[N]=S+O}if(P[1]){M=((P[1]=="-="?-1:1)*M)+S}Q.custom(S,M,O)}else{Q.custom(S,R,"")}}});return true})},stop:function(E,D){var F=n.timers;if(E){this.queue([])}this.each(function(){for(var G=F.length-1;G>=0;G--){if(F[G].elem==this){if(D){F[G](true)}F.splice(G,1)}}});if(!D){this.dequeue()}return this}});n.each({slideDown:s("show",1),slideUp:s("hide",1),slideToggle:s("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(D,E){n.fn[D]=function(F,G){return this.animate(E,F,G)}});n.extend({speed:function(F,G,E){var D=typeof F==="object"?F:{complete:E||!E&&G||n.isFunction(F)&&F,duration:F,easing:E&&G||G&&!n.isFunction(G)&&G};D.duration=n.fx.off?0:typeof D.duration==="number"?D.duration:n.fx.speeds[D.duration]||n.fx.speeds._default;D.old=D.complete;D.complete=function(){if(D.queue!==false){n(this).dequeue()}if(n.isFunction(D.old)){D.old.call(this)}};return D},easing:{linear:function(F,G,D,E){return D+E*F},swing:function(F,G,D,E){return((-Math.cos(F*Math.PI)/2)+0.5)*E+D}},timers:[],timerId:null,fx:function(E,D,F){this.options=D;this.elem=E;this.prop=F;if(!D.orig){D.orig={}}}});n.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(n.fx.step[this.prop]||n.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(E){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var D=parseFloat(n.css(this.elem,this.prop,E));return D&&D>-10000?D:parseFloat(n.curCSS(this.elem,this.prop))||0},custom:function(H,G,F){this.startTime=e();this.start=H;this.end=G;this.unit=F||this.unit||"px";this.now=this.start;this.pos=this.state=0;var D=this;function E(I){return D.step(I)}E.elem=this.elem;n.timers.push(E);if(E()&&n.timerId==null){n.timerId=setInterval(function(){var J=n.timers;for(var I=0;I<J.length;I++){if(!J[I]()){J.splice(I--,1)}}if(!J.length){clearInterval(n.timerId);n.timerId=null}},13)}},show:function(){this.options.orig[this.prop]=n.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());n(this.elem).show()},hide:function(){this.options.orig[this.prop]=n.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(G){var F=e();if(G||F>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var D=true;for(var E in this.options.curAnim){if(this.options.curAnim[E]!==true){D=false}}if(D){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(n.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){n(this.elem).hide()}if(this.options.hide||this.options.show){for(var H in this.options.curAnim){n.attr(this.elem.style,H,this.options.orig[H])}}}if(D){this.options.complete.call(this.elem)}return false}else{var I=F-this.startTime;this.state=I/this.options.duration;this.pos=n.easing[this.options.easing||(n.easing.swing?"swing":"linear")](this.state,I,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};n.extend(n.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(D){n.attr(D.elem.style,"opacity",D.now)},_default:function(D){if(D.elem.style&&D.elem.style[D.prop]!=null){D.elem.style[D.prop]=D.now+D.unit}else{D.elem[D.prop]=D.now}}}});if(document.documentElement.getBoundingClientRect){n.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return n.offset.bodyOffset(this[0])}var F=this[0].getBoundingClientRect(),I=this[0].ownerDocument,E=I.body,D=I.documentElement,K=D.clientTop||E.clientTop||0,J=D.clientLeft||E.clientLeft||0,H=F.top+(self.pageYOffset||n.boxModel&&D.scrollTop||E.scrollTop)-K,G=F.left+(self.pageXOffset||n.boxModel&&D.scrollLeft||E.scrollLeft)-J;return{top:H,left:G}}}else{n.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return n.offset.bodyOffset(this[0])}n.offset.initialized||n.offset.initialize();var I=this[0],F=I.offsetParent,E=I,N=I.ownerDocument,L,G=N.documentElement,J=N.body,K=N.defaultView,D=K.getComputedStyle(I,null),M=I.offsetTop,H=I.offsetLeft;while((I=I.parentNode)&&I!==J&&I!==G){L=K.getComputedStyle(I,null);M-=I.scrollTop,H-=I.scrollLeft;if(I===F){M+=I.offsetTop,H+=I.offsetLeft;if(n.offset.doesNotAddBorder&&!(n.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(I.tagName))){M+=parseInt(L.borderTopWidth,10)||0,H+=parseInt(L.borderLeftWidth,10)||0}E=F,F=I.offsetParent}if(n.offset.subtractsBorderForOverflowNotVisible&&L.overflow!=="visible"){M+=parseInt(L.borderTopWidth,10)||0,H+=parseInt(L.borderLeftWidth,10)||0}D=L}if(D.position==="relative"||D.position==="static"){M+=J.offsetTop,H+=J.offsetLeft}if(D.position==="fixed"){M+=Math.max(G.scrollTop,J.scrollTop),H+=Math.max(G.scrollLeft,J.scrollLeft)}return{top:M,left:H}}}n.offset={initialize:function(){if(this.initialized){return}var K=document.body,E=document.createElement("div"),G,F,M,H,L,D,I=K.style.marginTop,J='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"cellpadding="0"cellspacing="0"><tr><td></td></tr></table>';L={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(D in L){E.style[D]=L[D]}E.innerHTML=J;K.insertBefore(E,K.firstChild);G=E.firstChild,F=G.firstChild,H=G.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(F.offsetTop!==5);this.doesAddBorderForTableAndCells=(H.offsetTop===5);G.style.overflow="hidden",G.style.position="relative";this.subtractsBorderForOverflowNotVisible=(F.offsetTop===-5);K.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(K.offsetTop===0);K.style.marginTop=I;K.removeChild(E);this.initialized=true},bodyOffset:function(D){n.offset.initialized||n.offset.initialize();var F=D.offsetTop,E=D.offsetLeft;if(n.offset.doesNotIncludeMarginInBodyOffset){F+=parseInt(n.curCSS(D,"marginTop",true),10)||0,E+=parseInt(n.curCSS(D,"marginLeft",true),10)||0}return{top:F,left:E}}};n.fn.extend({position:function(){var H=0,G=0,E;if(this[0]){var F=this.offsetParent(),I=this.offset(),D=/^body|html$/i.test(F[0].tagName)?{top:0,left:0}:F.offset();I.top-=j(this,"marginTop");I.left-=j(this,"marginLeft");D.top+=j(F,"borderTopWidth");D.left+=j(F,"borderLeftWidth");E={top:I.top-D.top,left:I.left-D.left}}return E},offsetParent:function(){var D=this[0].offsetParent||document.body;while(D&&(!/^body|html$/i.test(D.tagName)&&n.css(D,"position")=="static")){D=D.offsetParent}return n(D)}});n.each(["Left","Top"],function(E,D){var F="scroll"+D;n.fn[F]=function(G){if(!this[0]){return null}return G!==g?this.each(function(){this==l||this==document?l.scrollTo(!E?G:n(l).scrollLeft(),E?G:n(l).scrollTop()):this[F]=G}):this[0]==l||this[0]==document?self[E?"pageYOffset":"pageXOffset"]||n.boxModel&&document.documentElement[F]||document.body[F]:this[0][F]}});n.each(["Height","Width"],function(G,E){var D=G?"Left":"Top",F=G?"Right":"Bottom";n.fn["inner"+E]=function(){return this[E.toLowerCase()]()+j(this,"padding"+D)+j(this,"padding"+F)};n.fn["outer"+E]=function(I){return this["inner"+E]()+j(this,"border"+D+"Width")+j(this,"border"+F+"Width")+(I?j(this,"margin"+D)+j(this,"margin"+F):0)};var H=E.toLowerCase();n.fn[H]=function(I){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+E]||document.body["client"+E]:this[0]==document?Math.max(document.documentElement["client"+E],document.body["scroll"+E],document.documentElement["scroll"+E],document.body["offset"+E],document.documentElement["offset"+E]):I===g?(this.length?n.css(this[0],H):null):this.css(H,typeof I==="string"?I:I+"px")}})})(); | |
20 | 0 | \ No newline at end of file |
vendor/plugins/jrails/javascripts/jrails.js
... | ... | @@ -1 +0,0 @@ |
1 | -(function($){$.ajaxSettings.accepts._default = "text/javascript, text/html, application/xml, text/xml, */*"})(jQuery);(function($){$.fn.reset=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};$.fn.enable=function(){return this.each(function(){this.disabled=false})};$.fn.disable=function(){return this.each(function(){this.disabled=true})}})(jQuery);(function($){$.extend({fieldEvent:function(el,obs){var field=el[0]||el,e="change";if(field.type=="radio"||field.type=="checkbox"){e="click"}else{if(obs&&field.type=="text"||field.type=="textarea"){e="keyup"}}return e}});$.fn.extend({delayedObserver:function(delay,callback){var el=$(this);if(typeof window.delayedObserverStack=="undefined"){window.delayedObserverStack=[]}if(typeof window.delayedObserverCallback=="undefined"){window.delayedObserverCallback=function(stackPos){observed=window.delayedObserverStack[stackPos];if(observed.timer){clearTimeout(observed.timer)}observed.timer=setTimeout(function(){observed.timer=null;observed.callback(observed.obj,observed.obj.formVal())},observed.delay*1000);observed.oldVal=observed.obj.formVal()}}window.delayedObserverStack.push({obj:el,timer:null,delay:delay,oldVal:el.formVal(),callback:callback});var stackPos=window.delayedObserverStack.length-1;if(el[0].tagName=="FORM"){$(":input",el).each(function(){var field=$(this);field.bind($.fieldEvent(field,delay),function(){observed=window.delayedObserverStack[stackPos];if(observed.obj.formVal()==observed.obj.oldVal){return}else{window.delayedObserverCallback(stackPos)}})})}else{el.bind($.fieldEvent(el,delay),function(){observed=window.delayedObserverStack[stackPos];if(observed.obj.formVal()==observed.obj.oldVal){return}else{window.delayedObserverCallback(stackPos)}})}},formVal:function(){var el=this[0];if(el.tagName=="FORM"){return this.serialize()}if(el.type=="checkbox"||self.type=="radio"){return this.filter("input:checked").val()||""}else{return this.val()}}})})(jQuery);(function($){$.fn.extend({visualEffect:function(o){e=o.replace(/\_(.)/g,function(m,l){return l.toUpperCase()});return eval("$(this)."+e+"()")},appear:function(speed,callback){return this.fadeIn(speed,callback)},blindDown:function(speed,callback){return this.show("blind",{direction:"vertical"},speed,callback)},blindUp:function(speed,callback){return this.hide("blind",{direction:"vertical"},speed,callback)},blindRight:function(speed,callback){return this.show("blind",{direction:"horizontal"},speed,callback)},blindLeft:function(speed,callback){this.hide("blind",{direction:"horizontal"},speed,callback);return this},dropOut:function(speed,callback){return this.hide("drop",{direction:"down"},speed,callback)},dropIn:function(speed,callback){return this.show("drop",{direction:"up"},speed,callback)},fade:function(speed,callback){return this.fadeOut(speed,callback)},fadeToggle:function(speed,callback){return this.animate({opacity:"toggle"},speed,callback)},fold:function(speed,callback){return this.hide("fold",{},speed,callback)},foldOut:function(speed,callback){return this.show("fold",{},speed,callback)},grow:function(speed,callback){return this.show("scale",{},speed,callback)},highlight:function(speed,callback){return this.show("highlight",{},speed,callback)},puff:function(speed,callback){return this.hide("puff",{},speed,callback)},pulsate:function(speed,callback){return this.show("pulsate",{},speed,callback)},shake:function(speed,callback){return this.show("shake",{},speed,callback)},shrink:function(speed,callback){return this.hide("scale",{},speed,callback)},squish:function(speed,callback){return this.hide("scale",{origin:["top","left"]},speed,callback)},slideUp:function(speed,callback){return this.hide("slide",{direction:"up"},speed,callback)},slideDown:function(speed,callback){return this.show("slide",{direction:"up"},speed,callback)},switchOff:function(speed,callback){return this.hide("clip",{},speed,callback)},switchOn:function(speed,callback){return this.show("clip",{},speed,callback)}})})(jQuery); | |
2 | 0 | \ No newline at end of file |
vendor/plugins/jrails/javascripts/sources/jrails.js
... | ... | @@ -1,192 +0,0 @@ |
1 | -/* | |
2 | -* | |
3 | -* jRails ajax extras | |
4 | -* version 0.1 | |
5 | -* <aaron@ennerchi.com> | http://www.ennerchi.com | |
6 | -* | |
7 | -*/ | |
8 | - | |
9 | -(function($) { | |
10 | - $.ajaxSettings.accepts._default = "text/javascript, text/html, application/xml, text/xml, */*"; | |
11 | -})(jQuery); | |
12 | - | |
13 | - | |
14 | -/* | |
15 | -* | |
16 | -* jRails form extras | |
17 | -* <aaron@ennerchi.com> | http://www.ennerchi.com | |
18 | -* | |
19 | -*/ | |
20 | - | |
21 | - | |
22 | -(function($) { | |
23 | - // reset a form | |
24 | - $.fn.reset = function() { | |
25 | - return this.each(function() { | |
26 | - // guard against an input with the name of 'reset' | |
27 | - // note that IE reports the reset function as an 'object' | |
28 | - if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) | |
29 | - this.reset(); | |
30 | - }); | |
31 | - }; | |
32 | - // enable a form element | |
33 | - $.fn.enable = function() { | |
34 | - return this.each(function() { | |
35 | - this.disabled = false; | |
36 | - }); | |
37 | - }; | |
38 | - // disable a form element | |
39 | - $.fn.disable = function() { | |
40 | - return this.each(function() { | |
41 | - this.disabled = true; | |
42 | - }); | |
43 | - }; | |
44 | - | |
45 | -})(jQuery); | |
46 | - | |
47 | -/* | |
48 | -* | |
49 | -* jRails form observer plugin | |
50 | -* version 0.2 | |
51 | -* <aaron@ennerchi.com> | http://www.ennerchi.com | |
52 | -* | |
53 | -*/ | |
54 | - | |
55 | -(function($) { | |
56 | - $.extend({ // Translate field to event | |
57 | - fieldEvent: function(el, obs) { | |
58 | - var field = el[0] || el, e = 'change'; | |
59 | - if (field.type == 'radio' || field.type == 'checkbox') e = 'click'; | |
60 | - else if (obs && field.type == 'text' || field.type == 'textarea') e = 'keyup'; | |
61 | - return e; | |
62 | - } | |
63 | - }); | |
64 | - $.fn.extend({ // Delayed observer for fields and forms | |
65 | - delayedObserver: function(delay, callback){ | |
66 | - var el = $(this); | |
67 | - if (typeof window.delayedObserverStack == 'undefined') window.delayedObserverStack = []; | |
68 | - if (typeof window.delayedObserverCallback == 'undefined') { | |
69 | - window.delayedObserverCallback = function(stackPos) { | |
70 | - var observed = window.delayedObserverStack[stackPos]; | |
71 | - if (observed.timer) clearTimeout(observed.timer); | |
72 | - observed.timer = setTimeout(function(){ | |
73 | - observed.timer = null; | |
74 | - observed.callback(observed.obj, observed.obj.formVal()); | |
75 | - }, observed.delay * 1000); | |
76 | - observed.oldVal = observed.obj.formVal(); | |
77 | - }; | |
78 | - } | |
79 | - window.delayedObserverStack.push({ | |
80 | - obj: el, timer: null, delay: delay, | |
81 | - oldVal: el.formVal(), callback: callback | |
82 | - }); | |
83 | - var stackPos = window.delayedObserverStack.length-1; | |
84 | - if (el[0].tagName == 'FORM') { | |
85 | - $(':input', el).each(function(){ | |
86 | - var field = $(this); | |
87 | - field.bind($.fieldEvent(field, delay), function(){ | |
88 | - var observed = window.delayedObserverStack[stackPos]; | |
89 | - if (observed.obj.formVal() == observed.oldVal) return; | |
90 | - else window.delayedObserverCallback(stackPos); | |
91 | - }); | |
92 | - }); | |
93 | - } else { | |
94 | - el.bind($.fieldEvent(el, delay), function(){ | |
95 | - var observed = window.delayedObserverStack[stackPos]; | |
96 | - if (observed.obj.formVal() == observed.oldVal) return; | |
97 | - else window.delayedObserverCallback(stackPos); | |
98 | - }); | |
99 | - }; | |
100 | - }, | |
101 | - formVal: function() { // Gets form values | |
102 | - var el = this[0]; | |
103 | - if(el.tagName == 'FORM') return this.serialize(); | |
104 | - if(el.type == 'checkbox' || el.type == 'radio') return this.filter('input:checked').val() || ''; | |
105 | - else return this.val(); | |
106 | - } | |
107 | - }); | |
108 | -})(jQuery); | |
109 | - | |
110 | -/* | |
111 | -* | |
112 | -* jRails visual effects stubs | |
113 | -* version 0.2 | |
114 | -* <aaron@ennerchi.com> | http://www.ennerchi.com | |
115 | -* | |
116 | -*/ | |
117 | - | |
118 | -(function($) { | |
119 | - $.fn.extend({ | |
120 | - visualEffect : function(o) { | |
121 | - e = o.replace(/\_(.)/g, function(m, l){return l.toUpperCase()}); | |
122 | - return eval('$(this).'+e+'()'); | |
123 | - }, | |
124 | - appear : function(speed, callback) { | |
125 | - return this.fadeIn(speed, callback); | |
126 | - }, | |
127 | - blindDown : function(speed, callback) { | |
128 | - return this.show('blind', { direction: 'vertical' }, speed, callback); | |
129 | - }, | |
130 | - blindUp : function(speed, callback) { | |
131 | - return this.hide('blind', { direction: 'vertical' }, speed, callback); | |
132 | - }, | |
133 | - blindRight : function(speed, callback) { | |
134 | - return this.show('blind', { direction: 'horizontal' }, speed, callback); | |
135 | - }, | |
136 | - blindLeft : function(speed, callback) { | |
137 | - this.hide('blind', { direction: 'horizontal' }, speed, callback); | |
138 | - return this; | |
139 | - }, | |
140 | - dropOut : function(speed, callback) { | |
141 | - return this.hide('drop', {direction: 'down' }, speed, callback); | |
142 | - }, | |
143 | - dropIn : function(speed, callback) { | |
144 | - return this.show('drop', { direction: 'up' }, speed, callback); | |
145 | - }, | |
146 | - fade : function(speed, callback) { | |
147 | - return this.fadeOut(speed, callback); | |
148 | - }, | |
149 | - fadeToggle : function(speed, callback) { | |
150 | - return this.animate({opacity: 'toggle'}, speed, callback); | |
151 | - }, | |
152 | - fold : function(speed, callback) { | |
153 | - return this.hide('fold', {}, speed, callback); | |
154 | - }, | |
155 | - foldOut : function(speed, callback) { | |
156 | - return this.show('fold', {}, speed, callback); | |
157 | - }, | |
158 | - grow : function(speed, callback) { | |
159 | - return this.show('scale', {}, speed, callback); | |
160 | - }, | |
161 | - highlight : function(speed, callback) { | |
162 | - return this.show('highlight', {}, speed, callback); | |
163 | - }, | |
164 | - puff : function(speed, callback) { | |
165 | - return this.hide('puff', {}, speed, callback); | |
166 | - }, | |
167 | - pulsate : function(speed, callback) { | |
168 | - return this.show('pulsate', {}, speed, callback); | |
169 | - }, | |
170 | - shake : function(speed, callback) { | |
171 | - return this.show('shake', {}, speed, callback); | |
172 | - }, | |
173 | - shrink : function(speed, callback) { | |
174 | - return this.hide('scale', {}, speed, callback); | |
175 | - }, | |
176 | - squish : function(speed, callback) { | |
177 | - return this.hide('scale', { origin: ['top', 'left'] }, speed, callback); | |
178 | - }, | |
179 | - slideUp : function(speed, callback) { | |
180 | - return this.hide('slide', { direction: 'up'}, speed, callback); | |
181 | - }, | |
182 | - slideDown : function(speed, callback) { | |
183 | - return this.show('slide', { direction: 'up'}, speed, callback); | |
184 | - }, | |
185 | - switchOff : function(speed, callback) { | |
186 | - return this.hide('clip', {}, speed, callback); | |
187 | - }, | |
188 | - switchOn : function(speed, callback) { | |
189 | - return this.show('clip', {}, speed, callback); | |
190 | - } | |
191 | - }); | |
192 | -})(jQuery); |
vendor/plugins/jrails/lib/jrails.rb
... | ... | @@ -1,410 +0,0 @@ |
1 | -module ActionView | |
2 | - module Helpers | |
3 | - | |
4 | - module JavaScriptHelper | |
5 | - | |
6 | - # This function can be used to render rjs inline | |
7 | - # | |
8 | - # <%= javascript_function do |page| | |
9 | - # page.replace_html :list, :partial => 'list', :object => @list | |
10 | - # end %> | |
11 | - # | |
12 | - def javascript_function(*args, &block) | |
13 | - html_options = args.extract_options! | |
14 | - function = args[0] || '' | |
15 | - | |
16 | - html_options.symbolize_keys! | |
17 | - function = update_page(&block) if block_given? | |
18 | - javascript_tag(function) | |
19 | - end | |
20 | - | |
21 | - def jquery_id(id) | |
22 | - id.to_s.count('#.*,>+~:[/ ') == 0 ? "##{id}" : id | |
23 | - end | |
24 | - | |
25 | - def jquery_ids(ids) | |
26 | - Array(ids).map{|id| jquery_id(id)}.join(',') | |
27 | - end | |
28 | - | |
29 | - end | |
30 | - | |
31 | - module PrototypeHelper | |
32 | - | |
33 | - unless const_defined? :JQUERY_VAR | |
34 | - JQUERY_VAR = '$' | |
35 | - end | |
36 | - | |
37 | - unless const_defined? :JQCALLBACKS | |
38 | - JQCALLBACKS = Set.new([ :beforeSend, :complete, :error, :success ] + (100..599).to_a) | |
39 | - AJAX_OPTIONS = Set.new([ :before, :after, :condition, :url, | |
40 | - :asynchronous, :method, :insertion, :position, | |
41 | - :form, :with, :update, :script ]).merge(JQCALLBACKS) | |
42 | - end | |
43 | - | |
44 | - def periodically_call_remote(options = {}) | |
45 | - frequency = options[:frequency] || 10 # every ten seconds by default | |
46 | - code = "setInterval(function() {#{remote_function(options)}}, #{frequency} * 1000)" | |
47 | - javascript_tag(code) | |
48 | - end | |
49 | - | |
50 | - def remote_function(options) | |
51 | - javascript_options = options_for_ajax(options) | |
52 | - | |
53 | - update = '' | |
54 | - if options[:update] && options[:update].is_a?(Hash) | |
55 | - update = [] | |
56 | - update << "success:'#{options[:update][:success]}'" if options[:update][:success] | |
57 | - update << "failure:'#{options[:update][:failure]}'" if options[:update][:failure] | |
58 | - update = '{' + update.join(',') + '}' | |
59 | - elsif options[:update] | |
60 | - update << "'#{options[:update]}'" | |
61 | - end | |
62 | - | |
63 | - function = "#{JQUERY_VAR}.ajax(#{javascript_options})" | |
64 | - | |
65 | - function = "#{options[:before]}; #{function}" if options[:before] | |
66 | - function = "#{function}; #{options[:after]}" if options[:after] | |
67 | - function = "if (#{options[:condition]}) { #{function}; }" if options[:condition] | |
68 | - function = "if (confirm('#{escape_javascript(options[:confirm])}')) { #{function}; }" if options[:confirm] | |
69 | - return function | |
70 | - end | |
71 | - | |
72 | - class JavaScriptGenerator | |
73 | - module GeneratorMethods | |
74 | - | |
75 | - def insert_html(position, id, *options_for_render) | |
76 | - insertion = position.to_s.downcase | |
77 | - insertion = 'append' if insertion == 'bottom' | |
78 | - insertion = 'prepend' if insertion == 'top' | |
79 | - call "#{JQUERY_VAR}(\"#{jquery_id(id)}\").#{insertion}", render(*options_for_render) | |
80 | - end | |
81 | - | |
82 | - def replace_html(id, *options_for_render) | |
83 | - insert_html(:html, id, *options_for_render) | |
84 | - end | |
85 | - | |
86 | - def replace(id, *options_for_render) | |
87 | - call "#{JQUERY_VAR}(\"#{jquery_id(id)}\").replaceWith", render(*options_for_render) | |
88 | - end | |
89 | - | |
90 | - def remove(*ids) | |
91 | - call "#{JQUERY_VAR}(\"#{jquery_ids(ids)}\").remove" | |
92 | - end | |
93 | - | |
94 | - def show(*ids) | |
95 | - call "#{JQUERY_VAR}(\"#{jquery_ids(ids)}\").show" | |
96 | - end | |
97 | - | |
98 | - def hide(*ids) | |
99 | - call "#{JQUERY_VAR}(\"#{jquery_ids(ids)}\").hide" | |
100 | - end | |
101 | - | |
102 | - def toggle(*ids) | |
103 | - call "#{JQUERY_VAR}(\"#{jquery_ids(ids)}\").toggle" | |
104 | - end | |
105 | - | |
106 | - def jquery_id(id) | |
107 | - id.to_s.count('#.*,>+~:[/ ') == 0 ? "##{id}" : id | |
108 | - end | |
109 | - | |
110 | - def jquery_ids(ids) | |
111 | - Array(ids).map{|id| jquery_id(id)}.join(',') | |
112 | - end | |
113 | - | |
114 | - end | |
115 | - end | |
116 | - | |
117 | - protected | |
118 | - def options_for_ajax(options) | |
119 | - js_options = build_callbacks(options) | |
120 | - | |
121 | - url_options = options[:url] | |
122 | - url_options = url_options.merge(:escape => false) if url_options.is_a?(Hash) | |
123 | - js_options['url'] = "'#{url_for(url_options)}'" | |
124 | - js_options['async'] = false if options[:type] == :synchronous | |
125 | - js_options['type'] = options[:method] ? method_option_to_s(options[:method]) : ( options[:form] ? "'post'" : nil ) | |
126 | - js_options['dataType'] = options[:datatype] ? "'#{options[:datatype]}'" : (options[:update] ? nil : "'script'") | |
127 | - | |
128 | - if options[:form] | |
129 | - js_options['data'] = "#{JQUERY_VAR}.param(#{JQUERY_VAR}(this).serializeArray())" | |
130 | - elsif options[:submit] | |
131 | - js_options['data'] = "#{JQUERY_VAR}(\"##{options[:submit]} :input\").serialize()" | |
132 | - elsif options[:with] | |
133 | - js_options['data'] = options[:with].gsub("Form.serialize(this.form)","#{JQUERY_VAR}.param(#{JQUERY_VAR}(this.form).serializeArray())") | |
134 | - end | |
135 | - | |
136 | - js_options['type'] ||= "'post'" | |
137 | - if options[:method] | |
138 | - if method_option_to_s(options[:method]) == "'put'" || method_option_to_s(options[:method]) == "'delete'" | |
139 | - js_options['type'] = "'post'" | |
140 | - if js_options['data'] | |
141 | - js_options['data'] << " + '&" | |
142 | - else | |
143 | - js_options['data'] = "'" | |
144 | - end | |
145 | - js_options['data'] << "_method=#{options[:method]}'" | |
146 | - end | |
147 | - end | |
148 | - | |
149 | - if respond_to?('protect_against_forgery?') && protect_against_forgery? | |
150 | - if js_options['data'] | |
151 | - js_options['data'] << " + '&" | |
152 | - else | |
153 | - js_options['data'] = "'" | |
154 | - end | |
155 | - js_options['data'] << "#{request_forgery_protection_token}=' + encodeURIComponent('#{escape_javascript form_authenticity_token}')" | |
156 | - end | |
157 | - js_options['data'] = "''" if js_options['type'] == "'post'" && js_options['data'].nil? | |
158 | - options_for_javascript(js_options.reject {|key, value| value.nil?}) | |
159 | - end | |
160 | - | |
161 | - def build_update_for_success(html_id, insertion=nil) | |
162 | - insertion = build_insertion(insertion) | |
163 | - "#{JQUERY_VAR}('#{jquery_id(html_id)}').#{insertion}(request);" | |
164 | - end | |
165 | - | |
166 | - def build_update_for_error(html_id, insertion=nil) | |
167 | - insertion = build_insertion(insertion) | |
168 | - "#{JQUERY_VAR}('#{jquery_id(html_id)}').#{insertion}(request.responseText);" | |
169 | - end | |
170 | - | |
171 | - def build_insertion(insertion) | |
172 | - insertion = insertion ? insertion.to_s.downcase : 'html' | |
173 | - insertion = 'append' if insertion == 'bottom' | |
174 | - insertion = 'prepend' if insertion == 'top' | |
175 | - insertion | |
176 | - end | |
177 | - | |
178 | - def build_observer(klass, name, options = {}) | |
179 | - if options[:with] && (options[:with] !~ /[\{=(.]/) | |
180 | - options[:with] = "'#{options[:with]}=' + value" | |
181 | - else | |
182 | - options[:with] ||= 'value' unless options[:function] | |
183 | - end | |
184 | - | |
185 | - callback = options[:function] || remote_function(options) | |
186 | - javascript = "#{JQUERY_VAR}('#{jquery_id(name)}').delayedObserver(" | |
187 | - javascript << "#{options[:frequency] || 0}, " | |
188 | - javascript << "function(element, value) {" | |
189 | - javascript << "#{callback}}" | |
190 | - #javascript << ", '#{options[:on]}'" if options[:on] | |
191 | - javascript << ")" | |
192 | - javascript_tag(javascript) | |
193 | - end | |
194 | - | |
195 | - def build_callbacks(options) | |
196 | - callbacks = {} | |
197 | - options[:beforeSend] = ''; | |
198 | - [:uninitialized,:loading,:loaded].each do |key| | |
199 | - options[:beforeSend] << (options[key].last == ';' ? options.delete(key) : options.delete(key) << ';') if options[key] | |
200 | - end | |
201 | - options.delete(:beforeSend) if options[:beforeSend].blank? | |
202 | - options[:error] = options.delete(:failure) if options[:failure] | |
203 | - if options[:update] | |
204 | - if options[:update].is_a?(Hash) | |
205 | - options[:update][:error] = options[:update].delete(:failure) if options[:update][:failure] | |
206 | - if options[:update][:success] | |
207 | - options[:success] = build_update_for_success(options[:update][:success], options[:position]) << (options[:success] ? options[:success] : '') | |
208 | - end | |
209 | - if options[:update][:error] | |
210 | - options[:error] = build_update_for_error(options[:update][:error], options[:position]) << (options[:error] ? options[:error] : '') | |
211 | - end | |
212 | - else | |
213 | - options[:success] = build_update_for_success(options[:update], options[:position]) << (options[:success] ? options[:success] : '') | |
214 | - end | |
215 | - end | |
216 | - options.each do |callback, code| | |
217 | - if JQCALLBACKS.include?(callback) | |
218 | - callbacks[callback] = "function(request){#{code}}" | |
219 | - end | |
220 | - end | |
221 | - callbacks | |
222 | - end | |
223 | - | |
224 | - end | |
225 | - | |
226 | - class JavaScriptElementProxy < JavaScriptProxy #:nodoc: | |
227 | - | |
228 | - unless const_defined? :JQUERY_VAR | |
229 | - JQUERY_VAR = ActionView::Helpers::PrototypeHelper::JQUERY_VAR | |
230 | - end | |
231 | - | |
232 | - def initialize(generator, id) | |
233 | - id = id.to_s.count('#.*,>+~:[/ ') == 0 ? "##{id}" : id | |
234 | - @id = id | |
235 | - super(generator, "#{JQUERY_VAR}(\"#{id}\")") | |
236 | - end | |
237 | - | |
238 | - def replace_html(*options_for_render) | |
239 | - call 'html', @generator.send(:render, *options_for_render) | |
240 | - end | |
241 | - | |
242 | - def replace(*options_for_render) | |
243 | - call 'replaceWith', @generator.send(:render, *options_for_render) | |
244 | - end | |
245 | - | |
246 | - def reload(options_for_replace={}) | |
247 | - replace(options_for_replace.merge({ :partial => @id.to_s.sub(/^#/,'') })) | |
248 | - end | |
249 | - | |
250 | - def value() | |
251 | - call 'val()' | |
252 | - end | |
253 | - | |
254 | - def value=(value) | |
255 | - call 'val', value | |
256 | - end | |
257 | - | |
258 | - end | |
259 | - | |
260 | - class JavaScriptElementCollectionProxy < JavaScriptCollectionProxy #:nodoc:\ | |
261 | - | |
262 | - unless const_defined? :JQUERY_VAR | |
263 | - JQUERY_VAR = ActionView::Helpers::PrototypeHelper::JQUERY_VAR | |
264 | - end | |
265 | - | |
266 | - def initialize(generator, pattern) | |
267 | - super(generator, "#{JQUERY_VAR}(#{pattern.to_json})") | |
268 | - end | |
269 | - end | |
270 | - | |
271 | - module ScriptaculousHelper | |
272 | - | |
273 | - unless const_defined? :JQUERY_VAR | |
274 | - JQUERY_VAR = ActionView::Helpers::PrototypeHelper::JQUERY_VAR | |
275 | - end | |
276 | - | |
277 | - unless const_defined? :SCRIPTACULOUS_EFFECTS | |
278 | - SCRIPTACULOUS_EFFECTS = { | |
279 | - :appear => {:method => 'fadeIn'}, | |
280 | - :blind_down => {:method => 'blind', :mode => 'show', :options => {:direction => 'vertical'}}, | |
281 | - :blind_up => {:method => 'blind', :mode => 'hide', :options => {:direction => 'vertical'}}, | |
282 | - :blind_right => {:method => 'blind', :mode => 'show', :options => {:direction => 'horizontal'}}, | |
283 | - :blind_left => {:method => 'blind', :mode => 'hide', :options => {:direction => 'horizontal'}}, | |
284 | - :bounce_in => {:method => 'bounce', :mode => 'show', :options => {:direction => 'up'}}, | |
285 | - :bounce_out => {:method => 'bounce', :mode => 'hide', :options => {:direction => 'up'}}, | |
286 | - :drop_in => {:method => 'drop', :mode => 'show', :options => {:direction => 'up'}}, | |
287 | - :drop_out => {:method => 'drop', :mode => 'hide', :options => {:direction => 'down'}}, | |
288 | - :fade => {:method => 'fadeOut'}, | |
289 | - :fold_in => {:method => 'fold', :mode => 'hide'}, | |
290 | - :fold_out => {:method => 'fold', :mode => 'show'}, | |
291 | - :grow => {:method => 'scale', :mode => 'show'}, | |
292 | - :shrink => {:method => 'scale', :mode => 'hide'}, | |
293 | - :slide_down => {:method => 'slide', :mode => 'show', :options => {:direction => 'up'}}, | |
294 | - :slide_up => {:method => 'slide', :mode => 'hide', :options => {:direction => 'up'}}, | |
295 | - :slide_right => {:method => 'slide', :mode => 'show', :options => {:direction => 'left'}}, | |
296 | - :slide_left => {:method => 'slide', :mode => 'hide', :options => {:direction => 'left'}}, | |
297 | - :squish => {:method => 'scale', :mode => 'hide', :options => {:origin => "['top','left']"}}, | |
298 | - :switch_on => {:method => 'clip', :mode => 'show', :options => {:direction => 'vertical'}}, | |
299 | - :switch_off => {:method => 'clip', :mode => 'hide', :options => {:direction => 'vertical'}}, | |
300 | - :toggle_appear => {:method => 'fadeToggle'}, | |
301 | - :toggle_slide => {:method => 'slide', :mode => 'toggle', :options => {:direction => 'up'}}, | |
302 | - :toggle_blind => {:method => 'blind', :mode => 'toggle', :options => {:direction => 'vertical'}}, | |
303 | - } | |
304 | - end | |
305 | - | |
306 | - def visual_effect(name, element_id = false, js_options = {}) | |
307 | - element = element_id ? element_id : "this" | |
308 | - | |
309 | - if SCRIPTACULOUS_EFFECTS.has_key? name.to_sym | |
310 | - effect = SCRIPTACULOUS_EFFECTS[name.to_sym] | |
311 | - name = effect[:method] | |
312 | - mode = effect[:mode] | |
313 | - js_options = js_options.merge(effect[:options]) if effect[:options] | |
314 | - end | |
315 | - | |
316 | - [:color, :direction].each do |option| | |
317 | - js_options[option] = "'#{js_options[option]}'" if js_options[option] | |
318 | - end | |
319 | - | |
320 | - if js_options.has_key? :duration | |
321 | - speed = js_options.delete :duration | |
322 | - speed = (speed * 1000).to_i unless speed.nil? | |
323 | - else | |
324 | - speed = js_options.delete :speed | |
325 | - end | |
326 | - | |
327 | - if ['fadeIn','fadeOut','fadeToggle'].include?(name) | |
328 | - javascript = "#{JQUERY_VAR}('#{jquery_id(element_id)}').#{name}(" | |
329 | - javascript << "#{speed}" unless speed.nil? | |
330 | - javascript << ");" | |
331 | - else | |
332 | - javascript = "#{JQUERY_VAR}('#{jquery_id(element_id)}').#{mode || 'effect'}('#{name}'" | |
333 | - javascript << ",#{options_for_javascript(js_options)}" unless speed.nil? && js_options.empty? | |
334 | - javascript << ",#{speed}" unless speed.nil? | |
335 | - javascript << ");" | |
336 | - end | |
337 | - | |
338 | - end | |
339 | - | |
340 | - def sortable_element_js(element_id, options = {}) #:nodoc: | |
341 | - #convert similar attributes | |
342 | - options[:handle] = ".#{options[:handle]}" if options[:handle] | |
343 | - if options[:tag] || options[:only] | |
344 | - options[:items] = "> " | |
345 | - options[:items] << options.delete(:tag) if options[:tag] | |
346 | - options[:items] << ".#{options.delete(:only)}" if options[:only] | |
347 | - end | |
348 | - options[:connectWith] = options.delete(:containment).map {|x| "##{x}"} if options[:containment] | |
349 | - options[:containment] = options.delete(:container) if options[:container] | |
350 | - options[:dropOnEmpty] = false unless options[:dropOnEmpty] | |
351 | - options[:helper] = "'clone'" if options[:ghosting] == true | |
352 | - options[:axis] = case options.delete(:constraint) | |
353 | - when "vertical" | |
354 | - "y" | |
355 | - when "horizontal" | |
356 | - "x" | |
357 | - when false | |
358 | - nil | |
359 | - when nil | |
360 | - "y" | |
361 | - end | |
362 | - options.delete(:axis) if options[:axis].nil? | |
363 | - options.delete(:overlap) | |
364 | - options.delete(:ghosting) | |
365 | - | |
366 | - if options[:onUpdate] || options[:url] | |
367 | - options[:with] ||= "#{JQUERY_VAR}(this).sortable('serialize',{key:'#{element_id}[]'})" | |
368 | - options[:onUpdate] ||= "function(){" + remote_function(options) + "}" | |
369 | - end | |
370 | - | |
371 | - options.delete_if { |key, value| PrototypeHelper::AJAX_OPTIONS.include?(key) } | |
372 | - options[:update] = options.delete(:onUpdate) if options[:onUpdate] | |
373 | - | |
374 | - [:axis, :cancel, :containment, :cursor, :handle, :tolerance, :items, :placeholder].each do |option| | |
375 | - options[option] = "'#{options[option]}'" if options[option] | |
376 | - end | |
377 | - | |
378 | - options[:connectWith] = array_or_string_for_javascript(options[:connectWith]) if options[:connectWith] | |
379 | - | |
380 | - %(#{JQUERY_VAR}('#{jquery_id(element_id)}').sortable(#{options_for_javascript(options)});) | |
381 | - end | |
382 | - | |
383 | - def draggable_element_js(element_id, options = {}) | |
384 | - %(#{JQUERY_VAR}("#{jquery_id(element_id)}").draggable(#{options_for_javascript(options)});) | |
385 | - end | |
386 | - | |
387 | - def drop_receiving_element_js(element_id, options = {}) | |
388 | - #convert similar options | |
389 | - options[:hoverClass] = options.delete(:hoverclass) if options[:hoverclass] | |
390 | - options[:drop] = options.delete(:onDrop) if options[:onDrop] | |
391 | - | |
392 | - if options[:drop] || options[:url] | |
393 | - options[:with] ||= "'id=' + encodeURIComponent(#{JQUERY_VAR}(ui.draggable).attr('id'))" | |
394 | - options[:drop] ||= "function(ev, ui){" + remote_function(options) + "}" | |
395 | - end | |
396 | - | |
397 | - options.delete_if { |key, value| PrototypeHelper::AJAX_OPTIONS.include?(key) } | |
398 | - | |
399 | - options[:accept] = array_or_string_for_javascript(options[:accept]) if options[:accept] | |
400 | - [:activeClass, :hoverClass, :tolerance].each do |option| | |
401 | - options[option] = "'#{options[option]}'" if options[option] | |
402 | - end | |
403 | - | |
404 | - %(#{JQUERY_VAR}('#{jquery_id(element_id)}').droppable(#{options_for_javascript(options)});) | |
405 | - end | |
406 | - | |
407 | - end | |
408 | - | |
409 | - end | |
410 | -end |
vendor/plugins/jrails/lib/tasks/jrails.rake
... | ... | @@ -1,19 +0,0 @@ |
1 | -namespace :jrails do | |
2 | - namespace :update do | |
3 | - desc "Copies the jQuery and jRails javascripts to public/javascripts" | |
4 | - task :javascripts do | |
5 | - puts "Copying files..." | |
6 | - project_dir = RAILS_ROOT + '/public/javascripts/' | |
7 | - scripts = Dir[File.join(File.dirname(__FILE__), '..') + '/javascripts/*.js'] | |
8 | - FileUtils.cp(scripts, project_dir) | |
9 | - puts "files copied successfully." | |
10 | - end | |
11 | - end | |
12 | - | |
13 | - namespace :install do | |
14 | - desc "Installs the jQuery and jRails javascripts to public/javascripts" | |
15 | - task :javascripts do | |
16 | - Rake::Task['jrails:update:javascripts'].invoke | |
17 | - end | |
18 | - end | |
19 | -end |