packr 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/{README.txt → README.rdoc} +40 -44
- data/bin/packr +44 -38
- data/lib/packr.rb +0 -6
- data/test/assets/packed/controls.js +1 -0
- data/test/assets/packed/domready.js +1 -0
- data/test/assets/packed/dragdrop.js +1 -0
- data/test/assets/packed/effects.js +1 -0
- data/test/assets/packed/prototype.js +1 -0
- data/test/assets/packed/prototype_shrunk.js +1 -0
- data/test/assets/packed/selector.js +1 -0
- data/test/assets/src/controls.js +833 -0
- data/test/assets/src/domready.js +36 -0
- data/test/assets/src/dragdrop.js +942 -0
- data/test/assets/src/effects.js +1088 -0
- data/test/assets/src/prototype.js +2515 -0
- data/test/assets/src/selector.js +666 -0
- data/test/assets/test/controls.js +1 -0
- data/test/assets/test/domready.js +1 -0
- data/test/assets/test/dragdrop.js +1 -0
- data/test/assets/test/effects.js +1 -0
- data/test/assets/test/prototype.js +1 -0
- data/test/assets/test/prototype_shrunk.js +1 -0
- data/test/assets/test/selector.js +1 -0
- data/test/test_packr.rb +4 -1
- metadata +56 -38
- data/Manifest.txt +0 -19
- data/Rakefile +0 -12
data/History.txt
CHANGED
data/{README.txt → README.rdoc}
RENAMED
@@ -4,10 +4,12 @@
|
|
4
4
|
* http://dean.edwards.name/packer/
|
5
5
|
* http://base2.googlecode.com
|
6
6
|
|
7
|
+
|
7
8
|
== Description
|
8
9
|
|
9
10
|
PackR is a Ruby version of Dean Edwards' JavaScript compressor.
|
10
11
|
|
12
|
+
|
11
13
|
== Features
|
12
14
|
|
13
15
|
* Whitespace and comment removal
|
@@ -15,11 +17,11 @@ PackR is a Ruby version of Dean Edwards' JavaScript compressor.
|
|
15
17
|
* Compression and obfuscation of 'private' (_underscored) identifiers
|
16
18
|
* Base-62 encoding
|
17
19
|
|
20
|
+
|
18
21
|
== Synopsis
|
19
22
|
|
20
23
|
To call from within a Ruby program:
|
21
24
|
|
22
|
-
require 'rubygems'
|
23
25
|
require 'packr'
|
24
26
|
|
25
27
|
code = File.read('my_script.js')
|
@@ -41,24 +43,28 @@ The full list of available options is:
|
|
41
43
|
compressed = Packr.pack(code, :shrink_vars => true,
|
42
44
|
:protect => %w[$super self])
|
43
45
|
|
44
|
-
To call from the command line (use <tt>packr --help</tt> to see available
|
46
|
+
To call from the command line (use <tt>packr --help</tt> to see available
|
47
|
+
options):
|
45
48
|
|
46
49
|
packr my_script.js > my_script.min.js
|
47
|
-
|
50
|
+
|
51
|
+
|
48
52
|
== Notes
|
49
53
|
|
50
54
|
This program is not a JavaScript parser, and rewrites your files using regular
|
51
|
-
expressions. Be sure to include semicolons and braces everywhere they are
|
52
|
-
so that your program will work correctly when packed down to a single
|
55
|
+
expressions. Be sure to include semicolons and braces everywhere they are
|
56
|
+
required so that your program will work correctly when packed down to a single
|
57
|
+
line.
|
53
58
|
|
54
59
|
By far the most efficient way to serve JavaScript over the web is to use PackR
|
55
|
-
with the --shrink-vars flag, combined with gzip compression. If you don't have
|
56
|
-
to your server config to set up mod_deflate, you can generate gzip files
|
57
|
-
(on Unix-like systems):
|
60
|
+
with the --shrink-vars flag, combined with gzip compression. If you don't have
|
61
|
+
access to your server config to set up mod_deflate, you can generate gzip files
|
62
|
+
using (on Unix-like systems):
|
58
63
|
|
59
64
|
packr -s my-file.js | gzip > my-file.js.gz
|
60
65
|
|
61
|
-
You can then get Apache to serve the files by putting this in your .htaccess
|
66
|
+
You can then get Apache to serve the files by putting this in your .htaccess
|
67
|
+
file:
|
62
68
|
|
63
69
|
AddEncoding gzip .gz
|
64
70
|
RewriteCond %{HTTP:Accept-encoding} gzip
|
@@ -66,47 +72,37 @@ You can then get Apache to serve the files by putting this in your .htaccess fil
|
|
66
72
|
RewriteCond %{REQUEST_FILENAME}.gz -f
|
67
73
|
RewriteRule ^(.*)$ $1.gz [QSA,L]
|
68
74
|
|
69
|
-
If you really cannot serve gzip files, use the --base62 option to further
|
70
|
-
your code. This mode is at its best when compressing large files with
|
71
|
-
tokens.
|
75
|
+
If you really cannot serve gzip files, use the --base62 option to further
|
76
|
+
compress your code. This mode is at its best when compressing large files with
|
77
|
+
many repeated tokens.
|
72
78
|
|
73
79
|
The --private option can be used to stop other programs calling private methods
|
74
|
-
in your code by renaming anything beginning with a single underscore. Beware
|
75
|
-
you should not use this if the generated file contains 'private' methods
|
76
|
-
to be accessible by other files. Also know that all the files that
|
77
|
-
particular private method must be compressed together so they all get
|
78
|
-
rewritten name for the private method.
|
80
|
+
in your code by renaming anything beginning with a single underscore. Beware
|
81
|
+
that you should not use this if the generated file contains 'private' methods
|
82
|
+
that need to be accessible by other files. Also know that all the files that
|
83
|
+
access any particular private method must be compressed together so they all get
|
84
|
+
the same rewritten name for the private method.
|
79
85
|
|
80
|
-
== Requirements
|
81
86
|
|
82
|
-
|
83
|
-
* Oyster (installed automatically)
|
87
|
+
== License
|
84
88
|
|
85
|
-
|
89
|
+
(The MIT License)
|
86
90
|
|
87
|
-
|
91
|
+
Copyright (c) 2004-2011 Dean Edwards, James Coglan
|
88
92
|
|
89
|
-
|
93
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
94
|
+
this software and associated documentation files (the 'Software'), to deal in
|
95
|
+
the Software without restriction, including without limitation the rights to use,
|
96
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
97
|
+
Software, and to permit persons to whom the Software is furnished to do so,
|
98
|
+
subject to the following conditions:
|
90
99
|
|
91
|
-
|
100
|
+
The above copyright notice and this permission notice shall be included in all
|
101
|
+
copies or substantial portions of the Software.
|
92
102
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
100
|
-
permit persons to whom the Software is furnished to do so, subject to
|
101
|
-
the following conditions:
|
102
|
-
|
103
|
-
The above copyright notice and this permission notice shall be
|
104
|
-
included in all copies or substantial portions of the Software.
|
105
|
-
|
106
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
107
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
108
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
109
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
110
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
111
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
112
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
103
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
104
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
105
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
106
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
107
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
108
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/bin/packr
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
1
3
|
require 'rubygems'
|
2
4
|
require 'oyster'
|
3
|
-
require 'packr'
|
5
|
+
require File.expand_path('../../lib/packr', __FILE__)
|
4
6
|
|
5
7
|
spec = Oyster.spec do
|
6
8
|
name "packr -- JavaScript code compressor based on Dean Edwards' Packer"
|
@@ -11,13 +13,14 @@ spec = Oyster.spec do
|
|
11
13
|
EOS
|
12
14
|
|
13
15
|
description <<-EOS
|
14
|
-
PackR is a program for compressing JavaScript programs. It can remove
|
15
|
-
and comments, compress local variable names, compress/obfuscate
|
16
|
-
and encode the program in base-62.
|
16
|
+
PackR is a program for compressing JavaScript programs. It can remove
|
17
|
+
whitespace and comments, compress local variable names, compress/obfuscate
|
18
|
+
private identifiers, and encode the program in base-62.
|
17
19
|
|
18
|
-
When invoked from the command line, it concatenates all the code in
|
19
|
-
from standard input) and compresses the code using the given
|
20
|
-
result to standard output. You can pipe this output into
|
20
|
+
When invoked from the command line, it concatenates all the code in
|
21
|
+
INPUT_FILES (or from standard input) and compresses the code using the given
|
22
|
+
options, printing the result to standard output. You can pipe this output into
|
23
|
+
another file to save it.
|
21
24
|
EOS
|
22
25
|
|
23
26
|
flag :'shrink-vars', :default => true,
|
@@ -34,17 +37,19 @@ spec = Oyster.spec do
|
|
34
37
|
|
35
38
|
notes <<-EOS
|
36
39
|
This program is not a JavaScript parser, and rewrites your files using regular
|
37
|
-
expressions. Be sure to include semicolons and braces everywhere they are
|
38
|
-
so that your program will work correctly when packed down to a single
|
40
|
+
expressions. Be sure to include semicolons and braces everywhere they are
|
41
|
+
required so that your program will work correctly when packed down to a single
|
42
|
+
line.
|
39
43
|
|
40
44
|
By far the most efficient way to serve JavaScript over the web is to use PackR
|
41
|
-
with the --shrink-vars flag, combined with gzip compression. If you don't have
|
42
|
-
to your server config to set up mod_deflate, you can generate gzip
|
43
|
-
(on Unix-like systems):
|
45
|
+
with the --shrink-vars flag, combined with gzip compression. If you don't have
|
46
|
+
access to your server config to set up mod_deflate, you can generate gzip
|
47
|
+
files using (on Unix-like systems):
|
44
48
|
|
45
49
|
packr -s my-file.js | gzip > my-file.js.gz
|
46
50
|
|
47
|
-
You can then get Apache to serve the files by putting this in your .htaccess
|
51
|
+
You can then get Apache to serve the files by putting this in your .htaccess
|
52
|
+
file:
|
48
53
|
|
49
54
|
AddEncoding gzip .gz
|
50
55
|
RewriteCond %{HTTP:Accept-encoding} gzip
|
@@ -52,16 +57,16 @@ spec = Oyster.spec do
|
|
52
57
|
RewriteCond %{REQUEST_FILENAME}.gz -f
|
53
58
|
RewriteRule ^(.*)$ $1.gz [QSA,L]
|
54
59
|
|
55
|
-
If you really cannot serve gzip files, use the --base62 option to further
|
56
|
-
your code. This mode is at its best when compressing large files with
|
57
|
-
tokens.
|
60
|
+
If you really cannot serve gzip files, use the --base62 option to further
|
61
|
+
compress your code. This mode is at its best when compressing large files with
|
62
|
+
many repeated tokens.
|
58
63
|
|
59
|
-
The --private option can be used to stop other programs calling private
|
60
|
-
in your code by renaming anything beginning with a single underscore.
|
61
|
-
you should not use this if the generated file contains 'private'
|
62
|
-
to be accessible by other files. Also know that all the
|
63
|
-
particular private method must be compressed together so
|
64
|
-
rewritten name for the private method.
|
64
|
+
The --private option can be used to stop other programs calling private
|
65
|
+
methods in your code by renaming anything beginning with a single underscore.
|
66
|
+
Beware that you should not use this if the generated file contains 'private'
|
67
|
+
methods that need to be accessible by other files. Also know that all the
|
68
|
+
files that access any particular private method must be compressed together so
|
69
|
+
they all get the same rewritten name for the private method.
|
65
70
|
EOS
|
66
71
|
|
67
72
|
author <<-EOS
|
@@ -69,23 +74,24 @@ spec = Oyster.spec do
|
|
69
74
|
EOS
|
70
75
|
|
71
76
|
copyright <<-EOS
|
72
|
-
Copyright (c) 2004-
|
73
|
-
distributed under the MIT license.
|
77
|
+
Copyright (c) 2004-2011 Dean Edwards, James Coglan. This program is free
|
78
|
+
software, distributed under the MIT license.
|
74
79
|
EOS
|
75
80
|
end
|
76
81
|
|
77
|
-
begin
|
78
|
-
|
82
|
+
begin
|
83
|
+
opts = spec.parse
|
84
|
+
|
85
|
+
inputs = opts[:unclaimed]
|
86
|
+
code = inputs.empty? ?
|
87
|
+
$stdin.read :
|
88
|
+
inputs.map { |f| File.read(f) }.join("\n")
|
89
|
+
|
90
|
+
$stdout.puts Packr.pack(code,
|
91
|
+
:shrink_vars => !!opts[:'shrink-vars'],
|
92
|
+
:protect => opts[:protect],
|
93
|
+
:private => !!opts[:private],
|
94
|
+
:base62 => !!opts[:base62])
|
95
|
+
|
96
|
+
rescue Oyster::HelpRendered
|
79
97
|
end
|
80
|
-
|
81
|
-
inputs = opts[:unclaimed]
|
82
|
-
code = inputs.empty? ?
|
83
|
-
$stdin.read :
|
84
|
-
inputs.map { |f| File.read(f) }.join("\n")
|
85
|
-
|
86
|
-
$stdout.puts Packr.pack(code,
|
87
|
-
:shrink_vars => !!opts[:'shrink-vars'],
|
88
|
-
:protect => opts[:protect],
|
89
|
-
:private => !!opts[:private],
|
90
|
-
:base62 => !!opts[:base62])
|
91
|
-
|
data/lib/packr.rb
CHANGED
@@ -1,7 +1,3 @@
|
|
1
|
-
# PackR -- a Ruby port of Packer by Dean Edwards
|
2
|
-
# Packer version 3.1 copyright 2004-2009, Dean Edwards
|
3
|
-
# http://www.opensource.org/licenses/mit-license
|
4
|
-
|
5
1
|
[ '/string',
|
6
2
|
'/packr/map',
|
7
3
|
'/packr/collection',
|
@@ -20,8 +16,6 @@ end
|
|
20
16
|
|
21
17
|
class Packr
|
22
18
|
|
23
|
-
VERSION = '3.1.0'
|
24
|
-
|
25
19
|
DATA = Parser.new.
|
26
20
|
put("STRING1", IGNORE).
|
27
21
|
put('STRING2', IGNORE).
|
@@ -0,0 +1 @@
|
|
1
|
+
if(typeof Effect=='undefined')throw("controls.js requires including script.aculo.us' effects.js library");var Autocompleter={}Autocompleter.Base=function(){};Autocompleter.Base.prototype={baseInitialize:function(element,update,options){this.element=$(element);this.update=$(update);this.hasFocus=false;this.changed=false;this.active=false;this.index=0;this.entryCount=0;if(this.setOptions)this.setOptions(options);else this.options=options||{};this.options.paramName=this.options.paramName||this.element.name;this.options.tokens=this.options.tokens||[];this.options.frequency=this.options.frequency||0.4;this.options.minChars=this.options.minChars||1;this.options.onShow=this.options.onShow||function(element,update){if(!update.style.position||update.style.position=='absolute'){update.style.position='absolute';Position.clone(element,update,{setHeight:false,offsetTop:element.offsetHeight})}Effect.Appear(update,{duration:0.15})};this.options.onHide=this.options.onHide||function(element,update){new Effect.Fade(update,{duration:0.15})};if(typeof(this.options.tokens)=='string')this.options.tokens=new Array(this.options.tokens);this.observer=null;this.element.setAttribute('autocomplete','off');Element.hide(this.update);Event.observe(this.element,"blur",this.onBlur.bindAsEventListener(this));Event.observe(this.element,"keypress",this.onKeyPress.bindAsEventListener(this))},show:function(){if(Element.getStyle(this.update,'display')=='none')this.options.onShow(this.element,this.update);if(!this.iefix&&(navigator.appVersion.indexOf('MSIE')>0)&&(navigator.userAgent.indexOf('Opera')<0)&&(Element.getStyle(this.update,'position')=='absolute')){new Insertion.After(this.update,'<iframe id="'+this.update.id+'_iefix" style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" src="javascript:false;" frameborder="0" scrolling="no"></iframe>');this.iefix=$(this.update.id+'_iefix');}if(this.iefix)setTimeout(this.fixIEOverlapping.bind(this),50);},fixIEOverlapping:function(){Position.clone(this.update,this.iefix,{setTop:(!this.update.style.height)});this.iefix.style.zIndex=1;this.update.style.zIndex=2;Element.show(this.iefix);},hide:function(){this.stopIndicator();if(Element.getStyle(this.update,'display')!='none')this.options.onHide(this.element,this.update);if(this.iefix)Element.hide(this.iefix);},startIndicator:function(){if(this.options.indicator)Element.show(this.options.indicator);},stopIndicator:function(){if(this.options.indicator)Element.hide(this.options.indicator);},onKeyPress:function(event){if(this.active)switch(event.keyCode){case Event.KEY_TAB:case Event.KEY_RETURN:this.selectEntry();Event.stop(event);case Event.KEY_ESC:this.hide();this.active=false;Event.stop(event);return;case Event.KEY_LEFT:case Event.KEY_RIGHT:return;case Event.KEY_UP:this.markPrevious();this.render();if(navigator.appVersion.indexOf('AppleWebKit')>0)Event.stop(event);return;case Event.KEY_DOWN:this.markNext();this.render();if(navigator.appVersion.indexOf('AppleWebKit')>0)Event.stop(event);return;}else if(event.keyCode==Event.KEY_TAB||event.keyCode==Event.KEY_RETURN||(navigator.appVersion.indexOf('AppleWebKit')>0&&event.keyCode==0))return;this.changed=true;this.hasFocus=true;if(this.observer)clearTimeout(this.observer);this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1000);},activate:function(){this.changed=false;this.hasFocus=true;this.getUpdatedChoices();},onHover:function(event){var element=Event.findElement(event,'LI');if(this.index!=element.autocompleteIndex){this.index=element.autocompleteIndex;this.render();}Event.stop(event);},onClick:function(event){var element=Event.findElement(event,'LI');this.index=element.autocompleteIndex;this.selectEntry();this.hide();},onBlur:function(event){setTimeout(this.hide.bind(this),250);this.hasFocus=false;this.active=false;},render:function(){if(this.entryCount>0){for(var i=0;i<this.entryCount;i++)this.index==i?Element.addClassName(this.getEntry(i),"selected"):Element.removeClassName(this.getEntry(i),"selected");if(this.hasFocus){this.show();this.active=true;}}else{this.active=false;this.hide();}},markPrevious:function(){if(this.index>0)this.index--else this.index=this.entryCount-1;this.getEntry(this.index);},markNext:function(){if(this.index<this.entryCount-1)this.index++else this.index=0;this.getEntry(this.index);},getEntry:function(index){return this.update.firstChild.childNodes[index];},getCurrentEntry:function(){return this.getEntry(this.index);},selectEntry:function(){this.active=false;this.updateElement(this.getCurrentEntry());},updateElement:function(selectedElement){if(this.options.updateElement){this.options.updateElement(selectedElement);return;}var value='';if(this.options.select){var nodes=document.getElementsByClassName(this.options.select,selectedElement)||[];if(nodes.length>0)value=Element.collectTextNodes(nodes[0],this.options.select);}else value=Element.collectTextNodesIgnoreClass(selectedElement,'informal');var lastTokenPos=this.findLastToken();if(lastTokenPos!=-1){var newValue=this.element.value.substr(0,lastTokenPos+1);var whitespace=this.element.value.substr(lastTokenPos+1).match(/^\s+/);if(whitespace)newValue+=whitespace[0];this.element.value=newValue+value;}else{this.element.value=value;}this.element.focus();if(this.options.afterUpdateElement)this.options.afterUpdateElement(this.element,selectedElement);},updateChoices:function(choices){if(!this.changed&&this.hasFocus){this.update.innerHTML=choices;Element.cleanWhitespace(this.update);Element.cleanWhitespace(this.update.down());if(this.update.firstChild&&this.update.down().childNodes){this.entryCount=this.update.down().childNodes.length;for(var i=0;i<this.entryCount;i++){var entry=this.getEntry(i);entry.autocompleteIndex=i;this.addObservers(entry);}}else{this.entryCount=0;}this.stopIndicator();this.index=0;if(this.entryCount==1&&this.options.autoSelect){this.selectEntry();this.hide();}else{this.render();}}},addObservers:function(element){Event.observe(element,"mouseover",this.onHover.bindAsEventListener(this));Event.observe(element,"click",this.onClick.bindAsEventListener(this));},onObserverEvent:function(){this.changed=false;if(this.getToken().length>=this.options.minChars){this.startIndicator();this.getUpdatedChoices();}else{this.active=false;this.hide();}},getToken:function(){var tokenPos=this.findLastToken();if(tokenPos!=-1)var ret=this.element.value.substr(tokenPos+1).replace(/^\s+/,'').replace(/\s+$/,'');else var ret=this.element.value;return/\n/.test(ret)?'':ret;},findLastToken:function(){var lastTokenPos=-1;for(var i=0;i<this.options.tokens.length;i++){var thisTokenPos=this.element.value.lastIndexOf(this.options.tokens[i]);if(thisTokenPos>lastTokenPos)lastTokenPos=thisTokenPos;}return lastTokenPos;}}Ajax.Autocompleter=Class.create();Object.extend(Object.extend(Ajax.Autocompleter.prototype,Autocompleter.Base.prototype),{initialize:function(element,update,url,options){this.baseInitialize(element,update,options);this.options.asynchronous=true;this.options.onComplete=this.onComplete.bind(this);this.options.defaultParams=this.options.parameters||null;this.url=url;},getUpdatedChoices:function(){entry=encodeURIComponent(this.options.paramName)+'='+encodeURIComponent(this.getToken());this.options.parameters=this.options.callback?this.options.callback(this.element,entry):entry;if(this.options.defaultParams)this.options.parameters+='&'+this.options.defaultParams;new Ajax.Request(this.url,this.options);},onComplete:function(request){this.updateChoices(request.responseText);}});Autocompleter.Local=Class.create();Autocompleter.Local.prototype=Object.extend(new Autocompleter.Base(),{initialize:function(element,update,array,options){this.baseInitialize(element,update,options);this.options.array=array;},getUpdatedChoices:function(){this.updateChoices(this.options.selector(this));},setOptions:function(options){this.options=Object.extend({choices:10,partialSearch:true,partialChars:2,ignoreCase:true,fullSearch:false,selector:function(instance){var ret=[];var partial=[];var entry=instance.getToken();var count=0;for(var i=0;i<instance.options.array.length&&ret.length<instance.options.choices;i++){var elem=instance.options.array[i];var foundPos=instance.options.ignoreCase?elem.toLowerCase().indexOf(entry.toLowerCase()):elem.indexOf(entry);while(foundPos!=-1){if(foundPos==0&&elem.length!=entry.length){ret.push("<li><strong>"+elem.substr(0,entry.length)+"</strong>"+elem.substr(entry.length)+"</li>");break;}else if(entry.length>=instance.options.partialChars&&instance.options.partialSearch&&foundPos!=-1){if(instance.options.fullSearch||/\s/.test(elem.substr(foundPos-1,1))){partial.push("<li>"+elem.substr(0,foundPos)+"<strong>"+elem.substr(foundPos,entry.length)+"</strong>"+elem.substr(foundPos+entry.length)+"</li>");break;}}foundPos=instance.options.ignoreCase?elem.toLowerCase().indexOf(entry.toLowerCase(),foundPos+1):elem.indexOf(entry,foundPos+1);}}if(partial.length)ret=ret.concat(partial.slice(0,instance.options.choices-ret.length))return"<ul>"+ret.join('')+"</ul>";}},options||{});}});Field.scrollFreeActivate=function(field){setTimeout(function(){Field.activate(field);},1);}Ajax.InPlaceEditor=Class.create();Ajax.InPlaceEditor.defaultHighlightColor="#FFFF99";Ajax.InPlaceEditor.prototype={initialize:function(element,url,options){this.url=url;this.element=$(element);this.options=Object.extend({paramName:"value",okButton:true,okText:"ok",cancelLink:true,cancelText:"cancel",savingText:"Saving...",clickToEditText:"Click to edit",okText:"ok",rows:1,onComplete:function(transport,element){new Effect.Highlight(element,{startcolor:this.options.highlightcolor});},onFailure:function(transport){alert("Error communicating with the server: "+transport.responseText.stripTags());},callback:function(form){return Form.serialize(form);},handleLineBreaks:true,loadingText:'Loading...',savingClassName:'inplaceeditor-saving',loadingClassName:'inplaceeditor-loading',formClassName:'inplaceeditor-form',highlightcolor:Ajax.InPlaceEditor.defaultHighlightColor,highlightendcolor:"#FFFFFF",externalControl:null,submitOnBlur:false,ajaxOptions:{},evalScripts:false},options||{});if(!this.options.formId&&this.element.id){this.options.formId=this.element.id+"-inplaceeditor";if($(this.options.formId)){this.options.formId=null;}}if(this.options.externalControl){this.options.externalControl=$(this.options.externalControl);}this.originalBackground=Element.getStyle(this.element,'background-color');if(!this.originalBackground){this.originalBackground="transparent";}this.element.title=this.options.clickToEditText;this.onclickListener=this.enterEditMode.bindAsEventListener(this);this.mouseoverListener=this.enterHover.bindAsEventListener(this);this.mouseoutListener=this.leaveHover.bindAsEventListener(this);Event.observe(this.element,'click',this.onclickListener);Event.observe(this.element,'mouseover',this.mouseoverListener);Event.observe(this.element,'mouseout',this.mouseoutListener);if(this.options.externalControl){Event.observe(this.options.externalControl,'click',this.onclickListener);Event.observe(this.options.externalControl,'mouseover',this.mouseoverListener);Event.observe(this.options.externalControl,'mouseout',this.mouseoutListener);}},enterEditMode:function(evt){if(this.saving)return;if(this.editing)return;this.editing=true;this.onEnterEditMode();if(this.options.externalControl){Element.hide(this.options.externalControl);}Element.hide(this.element);this.createForm();this.element.parentNode.insertBefore(this.form,this.element);if(!this.options.loadTextURL)Field.scrollFreeActivate(this.editField);if(evt){Event.stop(evt);}return false;},createForm:function(){this.form=document.createElement("form");this.form.id=this.options.formId;Element.addClassName(this.form,this.options.formClassName)this.form.onsubmit=this.onSubmit.bind(this);this.createEditField();if(this.options.textarea){var br=document.createElement("br");this.form.appendChild(br);}if(this.options.okButton){okButton=document.createElement("input");okButton.type="submit";okButton.value=this.options.okText;okButton.className='editor_ok_button';this.form.appendChild(okButton);}if(this.options.cancelLink){cancelLink=document.createElement("a");cancelLink.href="#";cancelLink.appendChild(document.createTextNode(this.options.cancelText));cancelLink.onclick=this.onclickCancel.bind(this);cancelLink.className='editor_cancel';this.form.appendChild(cancelLink);}},hasHTMLLineBreaks:function(string){if(!this.options.handleLineBreaks)return false;return string.match(/<br/i)||string.match(/<p>/i);},convertHTMLLineBreaks:function(string){return string.replace(/<br>/gi,"\n").replace(/<br\/>/gi,"\n").replace(/<\/p>/gi,"\n").replace(/<p>/gi,"");},createEditField:function(){var text;if(this.options.loadTextURL){text=this.options.loadingText;}else{text=this.getText();}var obj=this;if(this.options.rows==1&&!this.hasHTMLLineBreaks(text)){this.options.textarea=false;var textField=document.createElement("input");textField.obj=this;textField.type="text";textField.name=this.options.paramName;textField.value=text;textField.style.backgroundColor=this.options.highlightcolor;textField.className='editor_field';var size=this.options.size||this.options.cols||0;if(size!=0)textField.size=size;if(this.options.submitOnBlur)textField.onblur=this.onSubmit.bind(this);this.editField=textField;}else{this.options.textarea=true;var textArea=document.createElement("textarea");textArea.obj=this;textArea.name=this.options.paramName;textArea.value=this.convertHTMLLineBreaks(text);textArea.rows=this.options.rows;textArea.cols=this.options.cols||40;textArea.className='editor_field';if(this.options.submitOnBlur)textArea.onblur=this.onSubmit.bind(this);this.editField=textArea;}if(this.options.loadTextURL){this.loadExternalText();}this.form.appendChild(this.editField);},getText:function(){return this.element.innerHTML;},loadExternalText:function(){Element.addClassName(this.form,this.options.loadingClassName);this.editField.disabled=true;new Ajax.Request(this.options.loadTextURL,Object.extend({asynchronous:true,onComplete:this.onLoadedExternalText.bind(this)},this.options.ajaxOptions));},onLoadedExternalText:function(transport){Element.removeClassName(this.form,this.options.loadingClassName);this.editField.disabled=false;this.editField.value=transport.responseText.stripTags();Field.scrollFreeActivate(this.editField);},onclickCancel:function(){this.onComplete();this.leaveEditMode();return false;},onFailure:function(transport){this.options.onFailure(transport);if(this.oldInnerHTML){this.element.innerHTML=this.oldInnerHTML;this.oldInnerHTML=null;}return false;},onSubmit:function(){var form=this.form;var value=this.editField.value;this.onLoading();if(this.options.evalScripts){new Ajax.Request(this.url,Object.extend({parameters:this.options.callback(form,value),onComplete:this.onComplete.bind(this),onFailure:this.onFailure.bind(this),asynchronous:true,evalScripts:true},this.options.ajaxOptions));}else{new Ajax.Updater({success:this.element,failure:null},this.url,Object.extend({parameters:this.options.callback(form,value),onComplete:this.onComplete.bind(this),onFailure:this.onFailure.bind(this)},this.options.ajaxOptions));}if(arguments.length>1){Event.stop(arguments[0]);}return false;},onLoading:function(){this.saving=true;this.removeForm();this.leaveHover();this.showSaving();},showSaving:function(){this.oldInnerHTML=this.element.innerHTML;this.element.innerHTML=this.options.savingText;Element.addClassName(this.element,this.options.savingClassName);this.element.style.backgroundColor=this.originalBackground;Element.show(this.element);},removeForm:function(){if(this.form){if(this.form.parentNode)Element.remove(this.form);this.form=null;}},enterHover:function(){if(this.saving)return;this.element.style.backgroundColor=this.options.highlightcolor;if(this.effect){this.effect.cancel();}Element.addClassName(this.element,this.options.hoverClassName)},leaveHover:function(){if(this.options.backgroundColor){this.element.style.backgroundColor=this.oldBackground;}Element.removeClassName(this.element,this.options.hoverClassName)if(this.saving)return;this.effect=new Effect.Highlight(this.element,{startcolor:this.options.highlightcolor,endcolor:this.options.highlightendcolor,restorecolor:this.originalBackground});},leaveEditMode:function(){Element.removeClassName(this.element,this.options.savingClassName);this.removeForm();this.leaveHover();this.element.style.backgroundColor=this.originalBackground;Element.show(this.element);if(this.options.externalControl){Element.show(this.options.externalControl);}this.editing=false;this.saving=false;this.oldInnerHTML=null;this.onLeaveEditMode();},onComplete:function(transport){this.leaveEditMode();this.options.onComplete.bind(this)(transport,this.element);},onEnterEditMode:function(){},onLeaveEditMode:function(){},dispose:function(){if(this.oldInnerHTML){this.element.innerHTML=this.oldInnerHTML;}this.leaveEditMode();Event.stopObserving(this.element,'click',this.onclickListener);Event.stopObserving(this.element,'mouseover',this.mouseoverListener);Event.stopObserving(this.element,'mouseout',this.mouseoutListener);if(this.options.externalControl){Event.stopObserving(this.options.externalControl,'click',this.onclickListener);Event.stopObserving(this.options.externalControl,'mouseover',this.mouseoverListener);Event.stopObserving(this.options.externalControl,'mouseout',this.mouseoutListener);}}};Ajax.InPlaceCollectionEditor=Class.create();Object.extend(Ajax.InPlaceCollectionEditor.prototype,Ajax.InPlaceEditor.prototype);Object.extend(Ajax.InPlaceCollectionEditor.prototype,{createEditField:function(){if(!this.cached_selectTag){var selectTag=document.createElement("select");var collection=this.options.collection||[];var optionTag;collection.each(function(e,i){optionTag=document.createElement("option");optionTag.value=(e instanceof Array)?e[0]:e;if((typeof this.options.value=='undefined')&&((e instanceof Array)?this.element.innerHTML==e[1]:e==optionTag.value))optionTag.selected=true;if(this.options.value==optionTag.value)optionTag.selected=true;optionTag.appendChild(document.createTextNode((e instanceof Array)?e[1]:e));selectTag.appendChild(optionTag);}.bind(this));this.cached_selectTag=selectTag;}this.editField=this.cached_selectTag;if(this.options.loadTextURL)this.loadExternalText();this.form.appendChild(this.editField);this.options.callback=function(form,value){return"value="+encodeURIComponent(value)}}});Form.Element.DelayedObserver=Class.create();Form.Element.DelayedObserver.prototype={initialize:function(element,delay,callback){this.delay=delay||0.5;this.element=$(element);this.callback=callback;this.timer=null;this.lastValue=$F(this.element);Event.observe(this.element,'keyup',this.delayedListener.bindAsEventListener(this))},delayedListener:function(event){if(this.lastValue==$F(this.element))return;if(this.timer)clearTimeout(this.timer);this.timer=setTimeout(this.onTimerEvent.bind(this),this.delay*1000);this.lastValue=$F(this.element)},onTimerEvent:function(){this.timer=null;this.callback(this.element,$F(this.element))}};
|
@@ -0,0 +1 @@
|
|
1
|
+
Object.extend(Event,{_domReady:function(){if(arguments.callee.done)return;arguments.callee.done=true;if(this._timer)clearInterval(this._timer);this._readyCallbacks.each(function(b){b()});this._readyCallbacks=null},onDOMReady:function(b){if(!this._readyCallbacks){var a=this._domReady.bind(this);if(document.addEventListener)document.addEventListener("DOMContentLoaded",a,false);/*@cc_on @*/ /*@if(@_win32)document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");document.getElementById("__ie_onload").onreadystatechange=function(){if(this.readyState=="complete")a()};/*@end @*/ if (/WebKit/i.test(navigator.userAgent)){this._timer=setInterval(function(){if(/loaded|complete/.test(document.readyState))a()},10)}Event.observe(window,'load',a);Event._readyCallbacks=[]}Event._readyCallbacks.push(b)}});
|
@@ -0,0 +1 @@
|
|
1
|
+
if(typeof Effect=='undefined')throw("dragdrop.js requires including script.aculo.us' effects.js library");var Droppables={drops:[],remove:function(b){this.drops=this.drops.reject(function(a){return a.element==$(b)})},add:function(b){b=$(b);var c=Object.extend({greedy:true,hoverclass:null,tree:false},arguments[1]||{});if(c.containment){c._containers=[];var d=c.containment;if((typeof d=='object')&&(d.constructor==Array)){d.each(function(a){c._containers.push($(a))})}else{c._containers.push($(d))}}if(c.accept)c.accept=[c.accept].flatten();Element.makePositioned(b);c.element=b;this.drops.push(c)},findDeepestChild:function(a){deepest=a[0];for(i=1;i<a.length;++i)if(Element.isParent(a[i].element,deepest.element))deepest=a[i];return deepest},isContained:function(b,c){var d;if(c.tree){d=b.treeNode}else{d=b.parentNode}return c._containers.detect(function(a){return d==a})},isAffected:function(b,c,d){return((d.element!=c)&&((!d._containers)||this.isContained(c,d))&&((!d.accept)||(Element.classNames(c).detect(function(a){return d.accept.include(a)})))&&Position.within(d.element,b[0],b[1]))},deactivate:function(a){if(a.hoverclass)Element.removeClassName(a.element,a.hoverclass);this.last_active=null},activate:function(a){if(a.hoverclass)Element.addClassName(a.element,a.hoverclass);this.last_active=a},show:function(b,c){if(!this.drops.length)return;var d=[];if(this.last_active)this.deactivate(this.last_active);this.drops.each(function(a){if(Droppables.isAffected(b,c,a))d.push(a)});if(d.length>0){drop=Droppables.findDeepestChild(d);Position.within(drop.element,b[0],b[1]);if(drop.onHover)drop.onHover(c,drop.element,Position.overlap(drop.overlap,drop.element));Droppables.activate(drop)}},fire:function(a,b){if(!this.last_active)return;Position.prepare();if(this.isAffected([Event.pointerX(a),Event.pointerY(a)],b,this.last_active))if(this.last_active.onDrop)this.last_active.onDrop(b,this.last_active.element,a)},reset:function(){if(this.last_active)this.deactivate(this.last_active)}}var Draggables={drags:[],observers:[],register:function(a){if(this.drags.length==0){this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.updateDrag.bindAsEventListener(this);this.eventKeypress=this.keyPress.bindAsEventListener(this);Event.observe(document,"mouseup",this.eventMouseUp);Event.observe(document,"mousemove",this.eventMouseMove);Event.observe(document,"keypress",this.eventKeypress)}this.drags.push(a)},unregister:function(b){this.drags=this.drags.reject(function(a){return a==b});if(this.drags.length==0){Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);Event.stopObserving(document,"keypress",this.eventKeypress)}},activate:function(a){if(a.options.delay){this._timeout=setTimeout(function(){Draggables._timeout=null;window.focus();Draggables.activeDraggable=a}.bind(this),a.options.delay)}else{window.focus();this.activeDraggable=a}},deactivate:function(){this.activeDraggable=null},updateDrag:function(a){if(!this.activeDraggable)return;var b=[Event.pointerX(a),Event.pointerY(a)];if(this._lastPointer&&(this._lastPointer.inspect()==b.inspect()))return;this._lastPointer=b;this.activeDraggable.updateDrag(a,b)},endDrag:function(a){if(this._timeout){clearTimeout(this._timeout);this._timeout=null}if(!this.activeDraggable)return;this._lastPointer=null;this.activeDraggable.endDrag(a);this.activeDraggable=null},keyPress:function(a){if(this.activeDraggable)this.activeDraggable.keyPress(a)},addObserver:function(a){this.observers.push(a);this._cacheObserverCallbacks()},removeObserver:function(b){this.observers=this.observers.reject(function(a){return a.element==b});this._cacheObserverCallbacks()},notify:function(a,b,c){if(this[a+'Count']>0)this.observers.each(function(o){if(o[a])o[a](a,b,c)});if(b.options[a])b.options[a](b,c)},_cacheObserverCallbacks:function(){['onStart','onEnd','onDrag'].each(function(b){Draggables[b+'Count']=Draggables.observers.select(function(a){return a[b]}).length})}}var Draggable=Class.create();Draggable._dragging={};Draggable.prototype={initialize:function(f){var g={handle:false,reverteffect:function(a,b,c){var d=Math.sqrt(Math.abs(b^2)+Math.abs(c^2))*0.02;new Effect.Move(a,{x:-c,y:-b,duration:d,queue:{scope:'_draggable',position:'end'}})},endeffect:function(a){var b=typeof a._opacity=='number'?a._opacity:1.0;new Effect.Opacity(a,{duration:0.2,from:0.7,to:b,queue:{scope:'_draggable',position:'end'},afterFinish:function(){Draggable._dragging[a]=false}})},zindex:1000,revert:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,snap:false,delay:0};if(!arguments[1]||typeof arguments[1].endeffect=='undefined')Object.extend(g,{starteffect:function(a){a._opacity=Element.getOpacity(a);Draggable._dragging[a]=true;new Effect.Opacity(a,{duration:0.2,from:a._opacity,to:0.7})}});var e=Object.extend(g,arguments[1]||{});this.element=$(f);if(e.handle&&(typeof e.handle=='string'))this.handle=this.element.down('.'+e.handle,0);if(!this.handle)this.handle=$(e.handle);if(!this.handle)this.handle=this.element;if(e.scroll&&!e.scroll.scrollTo&&!e.scroll.outerHTML){e.scroll=$(e.scroll);this._isScrollChild=Element.childOf(this.element,e.scroll)}Element.makePositioned(this.element);this.delta=this.currentDelta();this.options=e;this.dragging=false;this.eventMouseDown=this.initDrag.bindAsEventListener(this);Event.observe(this.handle,"mousedown",this.eventMouseDown);Draggables.register(this)},destroy:function(){Event.stopObserving(this.handle,"mousedown",this.eventMouseDown);Draggables.unregister(this)},currentDelta:function(){return([parseInt(Element.getStyle(this.element,'left')||'0'),parseInt(Element.getStyle(this.element,'top')||'0')])},initDrag:function(b){if(typeof Draggable._dragging[this.element]!='undefined'&&Draggable._dragging[this.element])return;if(Event.isLeftClick(b)){var c=Event.element(b);if(c.tagName&&(c.tagName=='INPUT'||c.tagName=='SELECT'||c.tagName=='OPTION'||c.tagName=='BUTTON'||c.tagName=='TEXTAREA'))return;var d=[Event.pointerX(b),Event.pointerY(b)];var f=Position.cumulativeOffset(this.element);this.offset=[0,1].map(function(a){return(d[a]-f[a])});Draggables.activate(this);Event.stop(b)}},startDrag:function(a){this.dragging=true;if(this.options.zindex){this.originalZ=parseInt(Element.getStyle(this.element,'z-index')||0);this.element.style.zIndex=this.options.zindex}if(this.options.ghosting){this._clone=this.element.cloneNode(true);Position.absolutize(this.element);this.element.parentNode.insertBefore(this._clone,this.element)}if(this.options.scroll){if(this.options.scroll==window){var b=this._getWindowScroll(this.options.scroll);this.originalScrollLeft=b.left;this.originalScrollTop=b.top}else{this.originalScrollLeft=this.options.scroll.scrollLeft;this.originalScrollTop=this.options.scroll.scrollTop}}Draggables.notify('onStart',this,a);if(this.options.starteffect)this.options.starteffect(this.element)},updateDrag:function(a,b){if(!this.dragging)this.startDrag(a);Position.prepare();Droppables.show(b,this.element);Draggables.notify('onDrag',this,a);this.draw(b);if(this.options.change)this.options.change(this);if(this.options.scroll){this.stopScrolling();var c;if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){c=[left,top,left+width,top+height]}}else{c=Position.page(this.options.scroll);c[0]+=this.options.scroll.scrollLeft+Position.deltaX;c[1]+=this.options.scroll.scrollTop+Position.deltaY;c.push(c[0]+this.options.scroll.offsetWidth);c.push(c[1]+this.options.scroll.offsetHeight)}var d=[0,0];if(b[0]<(c[0]+this.options.scrollSensitivity))d[0]=b[0]-(c[0]+this.options.scrollSensitivity);if(b[1]<(c[1]+this.options.scrollSensitivity))d[1]=b[1]-(c[1]+this.options.scrollSensitivity);if(b[0]>(c[2]-this.options.scrollSensitivity))d[0]=b[0]-(c[2]-this.options.scrollSensitivity);if(b[1]>(c[3]-this.options.scrollSensitivity))d[1]=b[1]-(c[3]-this.options.scrollSensitivity);this.startScrolling(d)}if(navigator.appVersion.indexOf('AppleWebKit')>0)window.scrollBy(0,0);Event.stop(a)},finishDrag:function(a,b){this.dragging=false;if(this.options.ghosting){Position.relativize(this.element);Element.remove(this._clone);this._clone=null}if(b)Droppables.fire(a,this.element);Draggables.notify('onEnd',this,a);var c=this.options.revert;if(c&&typeof c=='function')c=c(this.element);var d=this.currentDelta();if(c&&this.options.reverteffect){this.options.reverteffect(this.element,d[1]-this.delta[1],d[0]-this.delta[0])}else{this.delta=d}if(this.options.zindex)this.element.style.zIndex=this.originalZ;if(this.options.endeffect)this.options.endeffect(this.element);Draggables.deactivate(this);Droppables.reset()},keyPress:function(a){if(a.keyCode!=Event.KEY_ESC)return;this.finishDrag(a,false);Event.stop(a)},endDrag:function(a){if(!this.dragging)return;this.stopScrolling();this.finishDrag(a,true);Event.stop(a)},draw:function(c){var d=Position.cumulativeOffset(this.element);if(this.options.ghosting){var f=Position.realOffset(this.element);d[0]+=f[0]-Position.deltaX;d[1]+=f[1]-Position.deltaY}var g=this.currentDelta();d[0]-=g[0];d[1]-=g[1];if(this.options.scroll&&(this.options.scroll!=window&&this._isScrollChild)){d[0]-=this.options.scroll.scrollLeft-this.originalScrollLeft;d[1]-=this.options.scroll.scrollTop-this.originalScrollTop}var e=[0,1].map(function(a){return(c[a]-d[a]-this.offset[a])}.bind(this));if(this.options.snap){if(typeof this.options.snap=='function'){e=this.options.snap(e[0],e[1],this)}else{if(this.options.snap instanceof Array){e=e.map(function(a,b){return Math.round(a/this.options.snap[b])*this.options.snap[b]}.bind(this))}else{e=e.map(function(a){return Math.round(a/this.options.snap)*this.options.snap}.bind(this))}}}var h=this.element.style;if((!this.options.constraint)||(this.options.constraint=='horizontal'))h.left=e[0]+"px";if((!this.options.constraint)||(this.options.constraint=='vertical'))h.top=e[1]+"px";if(h.visibility=="hidden")h.visibility=""},stopScrolling:function(){if(this.scrollInterval){clearInterval(this.scrollInterval);this.scrollInterval=null;Draggables._lastScrollPointer=null}},startScrolling:function(a){if(!(a[0]||a[1]))return;this.scrollSpeed=[a[0]*this.options.scrollSpeed,a[1]*this.options.scrollSpeed];this.lastScrolled=new Date();this.scrollInterval=setInterval(this.scroll.bind(this),10)},scroll:function(){var a=new Date();var b=a-this.lastScrolled;this.lastScrolled=a;if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){if(this.scrollSpeed[0]||this.scrollSpeed[1]){var c=b/1000;this.options.scroll.scrollTo(left+c*this.scrollSpeed[0],top+c*this.scrollSpeed[1])}}}else{this.options.scroll.scrollLeft+=this.scrollSpeed[0]*b/1000;this.options.scroll.scrollTop+=this.scrollSpeed[1]*b/1000}Position.prepare();Droppables.show(Draggables._lastPointer,this.element);Draggables.notify('onDrag',this);if(this._isScrollChild){Draggables._lastScrollPointer=Draggables._lastScrollPointer||$A(Draggables._lastPointer);Draggables._lastScrollPointer[0]+=this.scrollSpeed[0]*b/1000;Draggables._lastScrollPointer[1]+=this.scrollSpeed[1]*b/1000;if(Draggables._lastScrollPointer[0]<0)Draggables._lastScrollPointer[0]=0;if(Draggables._lastScrollPointer[1]<0)Draggables._lastScrollPointer[1]=0;this.draw(Draggables._lastScrollPointer)}if(this.options.change)this.options.change(this)},_getWindowScroll:function(a){var b,c,d,f;with(a.document){if(a.document.documentElement&&documentElement.scrollTop){b=documentElement.scrollTop;c=documentElement.scrollLeft}else if(a.document.body){b=body.scrollTop;c=body.scrollLeft}if(a.innerWidth){d=a.innerWidth;f=a.innerHeight}else if(a.document.documentElement&&documentElement.clientWidth){d=documentElement.clientWidth;f=documentElement.clientHeight}else{d=body.offsetWidth;f=body.offsetHeight}}return{top:b,left:c,width:d,height:f}}}var SortableObserver=Class.create();SortableObserver.prototype={initialize:function(a,b){this.element=$(a);this.observer=b;this.lastValue=Sortable.serialize(this.element)},onStart:function(){this.lastValue=Sortable.serialize(this.element)},onEnd:function(){Sortable.unmark();if(this.lastValue!=Sortable.serialize(this.element))this.observer(this.element)}}var Sortable={SERIALIZE_RULE:/^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,sortables:{},_findRootElement:function(a){while(a.tagName!="BODY"){if(a.id&&Sortable.sortables[a.id])return a;a=a.parentNode}},options:function(a){a=Sortable._findRootElement($(a));if(!a)return;return Sortable.sortables[a.id]},destroy:function(b){var c=Sortable.options(b);if(c){Draggables.removeObserver(c.element);c.droppables.each(function(a){Droppables.remove(a)});c.draggables.invoke('destroy');delete Sortable.sortables[c.element.id]}},create:function(c){c=$(c);var d=Object.extend({element:c,tag:'li',dropOnEmpty:false,tree:false,treeTag:'ul',overlap:'vertical',constraint:'vertical',containment:c,handle:false,only:false,delay:0,hoverclass:null,ghosting:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,format:this.SERIALIZE_RULE,onChange:Prototype.emptyFunction,onUpdate:Prototype.emptyFunction},arguments[1]||{});this.destroy(c);var f={revert:true,scroll:d.scroll,scrollSpeed:d.scrollSpeed,scrollSensitivity:d.scrollSensitivity,delay:d.delay,ghosting:d.ghosting,constraint:d.constraint,handle:d.handle};if(d.starteffect)f.starteffect=d.starteffect;if(d.reverteffect)f.reverteffect=d.reverteffect;else if(d.ghosting)f.reverteffect=function(c){c.style.top=0;c.style.left=0};if(d.endeffect)f.endeffect=d.endeffect;if(d.zindex)f.zindex=d.zindex;var g={overlap:d.overlap,containment:d.containment,tree:d.tree,hoverclass:d.hoverclass,onHover:Sortable.onHover}var e={onHover:Sortable.onEmptyHover,overlap:d.overlap,containment:d.containment,hoverclass:d.hoverclass}Element.cleanWhitespace(c);d.draggables=[];d.droppables=[];if(d.dropOnEmpty||d.tree){Droppables.add(c,e);d.droppables.push(c)}(this.findElements(c,d)||[]).each(function(a){var b=d.handle?$(a).down('.'+d.handle,0):a;d.draggables.push(new Draggable(a,Object.extend(f,{handle:b})));Droppables.add(a,g);if(d.tree)a.treeNode=c;d.droppables.push(a)});if(d.tree){(Sortable.findTreeElements(c,d)||[]).each(function(a){Droppables.add(a,e);a.treeNode=c;d.droppables.push(a)})}this.sortables[c.id]=d;Draggables.addObserver(new SortableObserver(c,d.onUpdate))},findElements:function(a,b){return Element.findChildren(a,b.only,b.tree?true:false,b.tag)},findTreeElements:function(a,b){return Element.findChildren(a,b.only,b.tree?true:false,b.treeTag)},onHover:function(a,b,c){if(Element.isParent(b,a))return;if(c>.33&&c<.66&&Sortable.options(b).tree){return}else if(c>0.5){Sortable.mark(b,'before');if(b.previousSibling!=a){var d=a.parentNode;a.style.visibility="hidden";b.parentNode.insertBefore(a,b);if(b.parentNode!=d)Sortable.options(d).onChange(a);Sortable.options(b.parentNode).onChange(a)}}else{Sortable.mark(b,'after');var f=b.nextSibling||null;if(f!=a){var d=a.parentNode;a.style.visibility="hidden";b.parentNode.insertBefore(a,f);if(b.parentNode!=d)Sortable.options(d).onChange(a);Sortable.options(b.parentNode).onChange(a)}}},onEmptyHover:function(a,b,c){var d=a.parentNode;var f=Sortable.options(b);if(!Element.isParent(b,a)){var g;var e=Sortable.findElements(b,{tag:f.tag,only:f.only});var h=null;if(e){var j=Element.offsetSize(b,f.overlap)*(1.0-c);for(g=0;g<e.length;g+=1){if(j-Element.offsetSize(e[g],f.overlap)>=0){j-=Element.offsetSize(e[g],f.overlap)}else if(j-(Element.offsetSize(e[g],f.overlap)/2)>=0){h=g+1<e.length?e[g+1]:null;break}else{h=e[g];break}}}b.insertBefore(a,h);Sortable.options(d).onChange(a);f.onChange(a)}},unmark:function(){if(Sortable._marker)Sortable._marker.hide()},mark:function(a,b){var c=Sortable.options(a.parentNode);if(c&&!c.ghosting)return;if(!Sortable._marker){Sortable._marker=($('dropmarker')||Element.extend(document.createElement('DIV'))).hide().addClassName('dropmarker').setStyle({position:'absolute'});document.getElementsByTagName("body").item(0).appendChild(Sortable._marker)}var d=Position.cumulativeOffset(a);Sortable._marker.setStyle({left:d[0]+'px',top:d[1]+'px'});if(b=='after')if(c.overlap=='horizontal')Sortable._marker.setStyle({left:(d[0]+a.clientWidth)+'px'});else Sortable._marker.setStyle({top:(d[1]+a.clientHeight)+'px'});Sortable._marker.show()},_tree:function(a,b,c){var d=Sortable.findElements(a,b)||[];for(var f=0;f<d.length;++f){var g=d[f].id.match(b.format);if(!g)continue;var e={id:encodeURIComponent(g?g[1]:null),element:a,parent:c,children:[],position:c.children.length,container:$(d[f]).down(b.treeTag)}if(e.container)this._tree(e.container,b,e)c.children.push(e)}return c},tree:function(a){a=$(a);var b=this.options(a);var c=Object.extend({tag:b.tag,treeTag:b.treeTag,only:b.only,name:a.id,format:b.format},arguments[1]||{});var d={id:null,parent:null,children:[],container:a,position:0}return Sortable._tree(a,c,d)},_constructIndex:function(a){var b='';do{if(a.id)b='['+a.position+']'+b}while((a=a.parent)!=null);return b},sequence:function(b){b=$(b);var c=Object.extend(this.options(b),arguments[1]||{});return $(this.findElements(b,c)||[]).map(function(a){return a.id.match(c.format)?a.id.match(c.format)[1]:''})},setSequence:function(c,d){c=$(c);var f=Object.extend(this.options(c),arguments[2]||{});var g={};this.findElements(c,f).each(function(a){if(a.id.match(f.format))g[a.id.match(f.format)[1]]=[a,a.parentNode];a.parentNode.removeChild(a)});d.each(function(a){var b=g[a];if(b){b[1].appendChild(b[0]);delete g[a]}})},serialize:function(b){b=$(b);var c=Object.extend(Sortable.options(b),arguments[1]||{});var d=encodeURIComponent((arguments[1]&&arguments[1].name)?arguments[1].name:b.id);if(c.tree){return Sortable.tree(b,arguments[1]).children.map(function(a){return[d+Sortable._constructIndex(a)+"[id]="+encodeURIComponent(a.id)].concat(a.children.map(arguments.callee))}).flatten().join('&')}else{return Sortable.sequence(b,arguments[1]).map(function(a){return d+"[]="+encodeURIComponent(a)}).join('&')}}}Element.isParent=function(a,b){if(!a.parentNode||a==b)return false;if(a.parentNode==b)return true;return Element.isParent(a.parentNode,b)}Element.findChildren=function(c,d,f,g){if(!c.hasChildNodes())return null;g=g.toUpperCase();if(d)d=[d].flatten();var e=[];$A(c.childNodes).each(function(a){if(a.tagName&&a.tagName.toUpperCase()==g&&(!d||(Element.classNames(a).detect(function(v){return d.include(v)}))))e.push(a);if(f){var b=Element.findChildren(a,d,f,g);if(b)e.push(b)}});return(e.length>0?e.flatten():[])}Element.offsetSize=function(a,b){return a['offset'+((b=='vertical'||b=='height')?'Height':'Width')]}
|
@@ -0,0 +1 @@
|
|
1
|
+
eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'([68a-cghjlo-rtuwzB-GIJL-QS-Z]|[1-5]\\w)'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('31.J.1H=a(){j N=\'#\';h(8.22(0,4)==\'rgb(\'){j 3L=8.22(4,8.1I-1).split(\',\');j i=0;do{N+=2z(3L[i]).32()}while(++i<3)}2g{h(8.22(0,1)==\'#\'){h(8.1I==4)3M(j i=1;i<4;i++)N+=(8.33(i)+8.33(i)).34();h(8.1I==7)N=8.34()}}l(N.1I==7?N:(C[0]||8))}L.35=a(6){l $A($(6).2A).3N(a(19){l(19.36==3?19.37:(19.3O()?L.35(19):\'\'))}).2B().3P(\'\')}L.38=a(6,39){l $A($(6).2A).3N(a(19){l(19.36==3?19.37:((19.3O()&&!L.hasClassName(19,39))?L.38(19,39):\'\'))}).2B().3P(\'\')}L.3Q=a(6,2C){6=$(6);6.u({1k:(2C/1a)+\'em\'});h(1N.appVersion.3R(\'AppleWebKit\')>0)U.scrollBy(0,0);l 6}L.2h=a(6){6=$(6);j P;h(P=6.O(\'P\'))l 1O(P);h(P=(6.O(\'2i\')||\'\').3S(/2D\\(P=(.*)\\)/))h(P[1])l 1O(P[1])/1a;l 1.0}L.2E=a(6,Q){6=$(6);h(Q==1){6.u({P:(/Gecko/.1J(1N.23)&&!/Konqueror|Safari|KHTML/.1J(1N.23))?0.999999:1.0});h(/2F/.1J(1N.23)&&!U.1e)6.u({2i:L.O(6,\'2i\').3T(/2D\\([^\\)]*\\)/gi,\'\')})}2g{h(Q<0.00001)Q=0;6.u({P:Q});h(/2F/.1J(1N.23)&&!U.1e)6.u({2i:6.O(\'2i\').3T(/2D\\([^\\)]*\\)/gi,\'\')+\'2D(P=\'+Q*1a+\')\'})}l 6}L.1x=a(6){l $(6).r.P||\'\'}L.3b=a(6){try{6=$(6);j n=24.createTextNode(\' \');6.appendChild(n);6.removeChild(n)}catch(e){}};Array.J.call=a(){j 3V=C;8.13(a(f){f.apply(8,3V)})}j c={26:{name:\'ElementDoesNotExistError\',message:\'The specified DOM 6 does not exist, but is required 3M 8 b to operate\'},3W:a(6){h(1P 3X==\'undefined\')27("c.3W requires including script.aculo.us\' builder.js library");j 3c=\'w:3Y\';h(/2F/.1J(1N.23)&&!U.1e)3c+=\';3Z:1\';6=$(6);$A(6.2A).13(a(2j){h(2j.36==3){2j.37.toArray().13(a(3d){6.insertBefore(3X.19(\'span\',{r:3c},3d==\' \'?31.fromCharCode(160):3d),2j)});L.3e(2j)}})},multiple:a(6,b){j 28;h(((1P 6==\'object\')||(1P 6==\'a\'))&&(6.1I))28=6;2g 28=$(6).2A;j g=p.o({41:0.1,2k:0.0},C[2]||{});j 42=g.2k;$A(28).13(a(6,43){q b(6,p.o(g,{2k:43*g.41+42}))})},3f:{\'slide\':[\'44\',\'45\'],\'blind\':[\'46\',\'47\'],\'48\':[\'3g\',\'49\']},toggle:a(6,b){6=$(6);b=(b||\'48\').34();j g=p.o({1g:{w:\'4a\',3h:(6.id||\'2G\'),3i:1}},C[2]||{});c[6.visible()?c.3f[b][1]:c.3f[b][0]](6,g)}};j Effect2=c;c.1h={linear:4b.K,1Q:a(B){l(-S.3j(B*S.PI)/2)+0.5},reverse:a(B){l 1-B},4c:a(B){l((-S.3j(B*S.PI)/4)+0.75)+S.random()/4},wobble:a(B){l(-S.3j(B*S.PI*(9*B))/2)+0.5},4d:a(B,1l){1l=1l||5;l(S.1y((B%(1/1l))*1l)==0?((B*1l*2)-S.4e(B*1l*2)):1-((B*1l*2)-S.4e(B*1l*2)))},2l:a(B){l 0},4f:a(B){l 1}};c.3l=1m.1n();p.o(p.o(c.3l.J,Enumerable),{1o:a(){8.F=[];8.2m=1R},4g:a(4h){8.F.4g(4h)},4i:a(b){j 1S=q 4j().4k();j w=(1P b.g.1g==\'2H\')?b.g.1g:b.g.1g.w;3m(w){14\'front\':8.F.findAll(a(e){l e.29==\'3n\'}).13(a(e){e.1K+=b.1L;e.1L+=b.1L});15;14\'with-last\':1S=8.F.4l(\'1K\').2n()||1S;15;14\'4a\':1S=8.F.4l(\'1L\').2n()||1S;15}b.1K+=1S;b.1L+=1S;h(!b.g.1g.3i||(8.F.1I<b.g.1g.3i))8.F.4m(b);h(!8.2m)8.2m=setInterval(8.2I.1p(8),40)},3e:a(b){8.F=8.F.4n(a(e){l e==b});h(8.F.1I==0){clearInterval(8.2m);8.2m=1R}},2I:a(){j 2a=q 4j().4k();8.F.4o(\'2I\',2a)}});c.2J={2K:$H(),2L:a(2b){h(1P 2b!=\'2H\')l 2b;h(!8.2K[2b])8.2K[2b]=q c.3l();l 8.2K[2b]}}c.Queue=c.2J.2L(\'2G\');c.4p={X:c.1h.1Q,V:1.0,4q:25.0,Y:T,1i:0.0,to:1.0,2k:0.0,1g:\'parallel\'}c.1q=a(){};c.1q.J={w:1R,1z:a(g){8.g=p.o(p.o({},c.4p),g||{});8.3o=0;8.29=\'3n\';8.1K=8.g.2k*2M;8.1L=8.1K+(8.g.V*2M);8.1r(\'beforeStart\');h(!8.g.Y)c.2J.2L(1P 8.g.1g==\'2H\'?\'2G\':8.g.1g.3h).4i(8)},2I:a(2a){h(2a>=8.1K){h(2a>=8.1L){8.2o(1.0);8.2N();8.1r(\'4r\');h(8.1T)8.1T();8.1r(\'4s\');l}j B=(2a-8.1K)/(8.1L-8.1K);j 3p=S.1y(B*8.g.4q*8.g.V);h(3p>8.3o){8.2o(B);8.3o=3p}}},2o:a(B){h(8.29==\'3n\'){8.29=\'4t\';8.1r(\'1U\');h(8.1V)8.1V();8.1r(\'3q\')}h(8.29==\'4t\'){h(8.g.X)B=8.g.X(B);B*=(8.g.to-8.g.1i);B+=8.g.1i;8.w=B;8.1r(\'beforeUpdate\');h(8.1s)8.1s(B);8.1r(\'afterUpdate\')}},2N:a(){h(!8.g.Y)c.2J.2L(1P 8.g.1g==\'2H\'?\'2G\':8.g.1g.3h).3e(8);8.29=\'finished\'},1r:a(2p){h(8.g[2p+\'4u\'])8.g[2p+\'4u\'](8);h(8.g[2p])8.g[2p](8)},3r:a(){l\'#<c:\'+$H(8).3r()+\',g:\'+$H(8.g).3r()+\'>\'}}c.1W=1m.1n();p.o(p.o(c.1W.J,c.1q.J),{1o:a(F){8.F=F||[];8.1z(C[1])},1s:a(w){8.F.4o(\'2o\',w)},1T:a(w){8.F.13(a(b){b.2o(1.0);b.2N();b.1r(\'4r\');h(b.1T)b.1T(w);b.1r(\'4s\')})}});c.4v=1m.1n();p.o(p.o(c.4v.J,c.1q.J),{1o:a(){j g=p.o({V:0},C[0]||{});8.1z(g)},1s:4b.emptyFunction});c.1A=1m.1n();p.o(p.o(c.1A.J,c.1q.J),{1o:a(6){8.6=$(6);h(!8.6)27(c.26);h(/2F/.1J(1N.23)&&!U.1e&&(!8.6.currentStyle.hasLayout))8.6.u({3Z:1});j g=p.o({1i:8.6.2h()||0.0,to:1.0},C[1]||{});8.1z(g)},1s:a(w){8.6.2E(w)}});c.17=1m.1n();p.o(p.o(c.17.J,c.1q.J),{1o:a(6){8.6=$(6);h(!8.6)27(c.26);j g=p.o({x:0,y:0,4w:\'3Y\'},C[1]||{});8.1z(g)},1V:a(){8.6.1B();8.2q=1O(8.6.O(\'M\')||\'0\');8.2r=1O(8.6.O(\'G\')||\'0\');h(8.g.4w==\'4x\'){8.g.x=8.g.x-8.2q;8.g.y=8.g.y-8.2r}},1s:a(w){8.6.u({M:S.1y(8.g.x*w+8.2q)+\'px\',G:S.1y(8.g.y*w+8.2r)+\'px\'})}});c.MoveBy=a(6,4y,4z){l q c.17(6,p.o({x:4z,y:4y},C[3]||{}))};c.18=1m.1n();p.o(p.o(c.18.J,c.1q.J),{1o:a(6,2C){8.6=$(6);h(!8.6)27(c.26);j g=p.o({1t:D,2s:D,1u:D,2O:T,1C:\'3s\',1X:1a.0,4A:2C},C[2]||{});8.1z(g)},1V:a(){8.1c=8.g.1c||T;8.4B=8.6.O(\'w\');8.3t={};[\'G\',\'M\',\'E\',\'z\',\'1k\'].13(a(k){8.3t[k]=8.6.r[k]}.1p(8));8.2r=8.6.offsetTop;8.2q=8.6.offsetLeft;j 1k=8.6.O(\'font-4C\')||\'1a%\';[\'em\',\'px\',\'%\',\'pt\'].13(a(2t){h(1k.3R(2t)>0){8.1k=1O(1k);8.2t=2t}}.1p(8));8.4E=(8.g.4A-8.g.1X)/1a;8.t=1R;h(8.g.1C==\'3s\')8.t=[8.6.offsetHeight,8.6.offsetWidth];h(/^4F/.1J(8.g.1C))8.t=[8.6.4G,8.6.scrollWidth];h(!8.t)8.t=[8.g.1C.2P,8.g.1C.2Q]},1s:a(w){j 2R=(8.g.1X/1a.0)+(8.4E*w);h(8.g.1u&&8.1k)8.6.u({1k:8.1k*2R+8.2t});8.4H(8.t[0]*2R,8.t[1]*2R)},1T:a(w){h(8.1c)8.6.u(8.3t)},4H:a(z,E){j d={};h(8.g.1t)d.E=S.1y(E)+\'px\';h(8.g.2s)d.z=S.1y(z)+\'px\';h(8.g.2O){j 3u=(z-8.t[0])/2;j 3v=(E-8.t[1])/2;h(8.4B==\'4x\'){h(8.g.2s)d.G=8.2r-3u+\'px\';h(8.g.1t)d.M=8.2q-3v+\'px\'}2g{h(8.g.2s)d.G=-3u+\'px\';h(8.g.1t)d.M=-3v+\'px\'}}8.6.u(d)}});c.4I=1m.1n();p.o(p.o(c.4I.J,c.1q.J),{1o:a(6){8.6=$(6);h(!8.6)27(c.26);j g=p.o({4J:\'#ffff99\'},C[1]||{});8.1z(g)},1V:a(){h(8.6.O(\'3w\')==\'2l\'){8.2N();l}8.Z={3x:8.6.O(\'3y-image\')};8.6.u({3x:\'2l\'});h(!8.g.3z)8.g.3z=8.6.O(\'3y-N\').1H(\'#4K\');h(!8.g.3A)8.g.3A=8.6.O(\'3y-N\');8.3B=$R(0,2).2c(a(i){l 2z(8.g.4J.22(i*2+1,i*2+3),16)}.1p(8));8.4L=$R(0,2).2c(a(i){l 2z(8.g.3z.22(i*2+1,i*2+3),16)-8.3B[i]}.1p(8))},1s:a(w){8.6.u({3C:$R(0,2).4M(\'#\',a(m,v,i){l m+(S.1y(8.3B[i]+(8.4L[i]*w)).32())}.1p(8))})},1T:a(){8.6.u(p.o(8.Z,{3C:8.g.3A}))}});c.4N=1m.1n();p.o(p.o(c.4N.J,c.1q.J),{1o:a(6){8.6=$(6);8.1z(C[1]||{})},1V:a(){2d.4O();j 2S=2d.cumulativeOffset(8.6);h(8.g.4P)2S[1]+=8.g.4P;j 2n=U.4Q?U.z-U.4Q:24.4R.4G-(24.4S.2u?24.4S.2u:24.4R.2u);8.3D=2d.deltaY;8.4T=(2S[1]>2n?2n:2S[1])-8.3D},1s:a(w){2d.4O();U.scrollTo(2d.deltaX,8.3D+(w*8.4T))}});c.49=a(6){6=$(6);j 2e=6.1x();j g=p.o({1i:6.2h()||1.0,to:0.0,I:a(b){h(b.g.to!=0)l;b.6.1v().u({P:2e})}},C[1]||{});l q c.1A(6,g)}c.3g=a(6){6=$(6);j g=p.o({1i:(6.O(\'3w\')==\'2l\'?0.0:6.2h()||0.0),to:1.0,I:a(b){b.6.3b()},1U:a(b){b.6.2E(b.g.1i).2v()}},C[1]||{});l q c.1A(6,g)}c.Puff=a(6){6=$(6);j Z={P:6.1x(),w:6.O(\'w\'),G:6.r.G,M:6.r.M,E:6.r.E,z:6.r.z};l q c.1W([q c.18(6,200,{Y:D,2O:D,1u:D,1c:D}),q c.1A(6,{Y:D,to:0.0})],p.o({V:1.0,beforeSetupInternal:a(b){2d.absolutize(b.F[0].6)},I:a(b){b.F[0].6.1v().u(Z)}},C[1]||{}))}c.47=a(6){6=$(6);6.1D();l q c.18(6,0,p.o({1u:T,1t:T,1c:D,I:a(b){b.6.1v().1E()}},C[1]||{}))}c.46=a(6){6=$(6);j 2f=6.2T();l q c.18(6,1a,p.o({1u:T,1t:T,1X:0,1C:{2P:2f.z,2Q:2f.E},1c:D,3q:a(b){b.6.1D().u({z:\'3E\'}).2v()},I:a(b){b.6.1E()}},C[1]||{}))}c.SwitchOff=a(6){6=$(6);j 2e=6.1x();l q c.3g(6,p.o({V:0.4,1i:0,X:c.1h.4c,I:a(b){q c.18(b.6,1,{V:0.3,2O:D,1t:T,1u:T,1c:D,1U:a(b){b.6.1B().1D()},I:a(b){b.6.1v().1E().1F().u({P:2e})}})}},C[1]||{}))}c.DropOut=a(6){6=$(6);j Z={G:6.O(\'G\'),M:6.O(\'M\'),P:6.1x()};l q c.1W([q c.17(6,{x:0,y:1a,Y:D}),q c.1A(6,{Y:D,to:0.0})],p.o({V:0.5,1U:a(b){b.F[0].6.1B()},I:a(b){b.F[0].6.1v().1F().u(Z)}},C[1]||{}))}c.Shake=a(6){6=$(6);j Z={G:6.O(\'G\'),M:6.O(\'M\')};l q c.17(6,{x:20,y:0,V:0.05,I:a(b){q c.17(b.6,{x:-40,y:0,V:0.1,I:a(b){q c.17(b.6,{x:40,y:0,V:0.1,I:a(b){q c.17(b.6,{x:-40,y:0,V:0.1,I:a(b){q c.17(b.6,{x:40,y:0,V:0.1,I:a(b){q c.17(b.6,{x:-20,y:0,V:0.05,I:a(b){b.6.1F().u(Z)}})}})}})}})}})}})}c.44=a(6){6=$(6).4V();j 2U=6.1G().O(\'1j\');j 2f=6.2T();l q c.18(6,1a,p.o({1u:T,1t:T,1X:U.1e?0:1,1C:{2P:2f.z,2Q:2f.E},1c:D,3q:a(b){b.6.1B();b.6.1G().1B();h(U.1e)b.6.u({G:\'\'});b.6.1D().u({z:\'3E\'}).2v()},4W:a(b){b.6.1G().u({1j:(b.t[0]-b.6.2u)+\'px\'})},I:a(b){b.6.1E().1F();b.6.1G().1F().u({1j:2U})}},C[1]||{}))}c.45=a(6){6=$(6).4V();j 2U=6.1G().O(\'1j\');l q c.18(6,U.1e?0:1,p.o({1u:T,1t:T,1C:\'3s\',1X:1a,1c:D,4X:a(b){b.6.1B();b.6.1G().1B();h(U.1e)b.6.u({G:\'\'});b.6.1D().2v()},4W:a(b){b.6.1G().u({1j:(b.t[0]-b.6.2u)+\'px\'})},I:a(b){b.6.1v().1E().1F().u({1j:2U});b.6.1G().1F()}},C[1]||{}))}c.Squish=a(6){l q c.18(6,U.1e?1:0,{1c:D,1U:a(b){b.6.1D()},I:a(b){b.6.1v().1E()}})}c.Grow=a(6){6=$(6);j g=p.o({2w:\'2V\',2W:c.1h.1Q,2X:c.1h.1Q,2Y:c.1h.4f},C[1]||{});j Z={G:6.r.G,M:6.r.M,z:6.r.z,E:6.r.E,P:6.1x()};j t=6.2T();j 1Y,1Z;j 10,11;3m(g.2w){14\'G-M\':1Y=1Z=10=11=0;15;14\'G-2x\':1Y=t.E;1Z=11=0;10=-t.E;15;14\'1j-M\':1Y=10=0;1Z=t.z;11=-t.z;15;14\'1j-2x\':1Y=t.E;1Z=t.z;10=-t.E;11=-t.z;15;14\'2V\':1Y=t.E/2;1Z=t.z/2;10=-t.E/2;11=-t.z/2;15}l q c.17(6,{x:1Y,y:1Z,V:0.01,1U:a(b){b.6.1v().1D().1B()},I:a(b){q c.1W([q c.1A(b.6,{Y:D,to:1.0,1i:0.0,X:g.2Y}),q c.17(b.6,{x:10,y:11,Y:D,X:g.2W}),q c.18(b.6,1a,{1C:{2P:t.z,2Q:t.E},Y:D,1X:U.1e?1:0,X:g.2X,1c:D})],p.o({1U:a(b){b.F[0].6.u({z:\'3E\'}).2v()},I:a(b){b.F[0].6.1E().1F().u(Z)}},g))}})}c.Shrink=a(6){6=$(6);j g=p.o({2w:\'2V\',2W:c.1h.1Q,2X:c.1h.1Q,2Y:c.1h.2l},C[1]||{});j Z={G:6.r.G,M:6.r.M,z:6.r.z,E:6.r.E,P:6.1x()};j t=6.2T();j 10,11;3m(g.2w){14\'G-M\':10=11=0;15;14\'G-2x\':10=t.E;11=0;15;14\'1j-M\':10=0;11=t.z;15;14\'1j-2x\':10=t.E;11=t.z;15;14\'2V\':10=t.E/2;11=t.z/2;15}l q c.1W([q c.1A(6,{Y:D,to:0.0,1i:1.0,X:g.2Y}),q c.18(6,U.1e?1:0,{Y:D,X:g.2X,1c:D}),q c.17(6,{x:10,y:11,Y:D,X:g.2W})],p.o({4X:a(b){b.F[0].6.1B().1D()},I:a(b){b.F[0].6.1v().1E().1F().u(Z)}},g))}c.Pulsate=a(6){6=$(6);j g=C[1]||{};j 2e=6.1x();j X=g.X||c.1h.1Q;j 3F=a(B){l X(1-c.1h.4d(B,g.1l))};3F.1p(X);l q c.1A(6,p.o(p.o({V:2.0,1i:0,I:a(b){b.6.u({P:2e})}},g),{X:3F}))}c.Fold=a(6){6=$(6);j Z={G:6.r.G,M:6.r.M,E:6.r.E,z:6.r.z};6.1D();l q c.18(6,5,p.o({1u:T,1t:T,I:a(b){q c.18(6,1,{1u:T,2s:T,I:a(b){b.6.1v().1E().u(Z)}})}},C[1]||{}))};c.2Z=1m.1n();p.o(p.o(c.2Z.J,c.1q.J),{1o:a(6){8.6=$(6);h(!8.6)27(c.26);j g=p.o({r:\'\'},C[1]||{});8.1z(g)},1V:a(){a 1H(N){h(!N||[\'rgba(0, 0, 0, 0)\',\'transparent\'].include(N))N=\'#4K\';N=N.1H();l $R(0,2).2c(a(i){l 2z(N.22(i*2+1,i*2+3),16)})}8.4Y=8.g.r.4Z().2c(a(12){j 1w=8.6.O(12[0]);l $H({r:12[0],1w:12[1].1d==\'N\'?1H(1w):1O(1w||0),2y:12[1].1d==\'N\'?1H(12[1].Q):12[1].Q,1d:12[1].1d})}.1p(8)).4n(a(W){l((W.1w==W.2y)||(W.1d!=\'N\'&&(50(W.1w)||50(W.2y))))})},1s:a(w){j r=$H(),Q=1R;8.4Y.13(a(W){Q=W.1d==\'N\'?$R(0,2).4M(\'#\',a(m,v,i){l m+(S.1y(W.1w[i]+(W.2y[i]-W.1w[i])*w)).32()}):W.1w+S.1y(((W.2y-W.1w)*w)*2M)/2M+W.1d;r[W.r]=Q});8.6.u(r)}});c.51=1m.1n();p.o(c.51.J,{1o:a(21){8.21=[];8.g=C[1]||{};8.52(21)},52:a(21){21.13(a(1M){j 53=$H(1M).values().54();8.21.4m($H({3G:$H(1M).keys().54(),b:c.2Z,g:{r:53}}))}.1p(8));l 8},play:a(){l q c.1W(8.21.2c(a(1M){j 28=[$(1M.3G)||$$(1M.3G)].2B();l 28.2c(a(e){l q 1M.b(e,p.o({Y:D},1M.g))})}).2B(),8.g)}});L.55=[\'azimuth\',\'backgroundAttachment\',\'3C\',\'3x\',\'backgroundPosition\',\'backgroundRepeat\',\'borderBottomColor\',\'borderBottomStyle\',\'borderBottomWidth\',\'borderCollapse\',\'borderLeftColor\',\'borderLeftStyle\',\'borderLeftWidth\',\'borderRightColor\',\'borderRightStyle\',\'borderRightWidth\',\'borderSpacing\',\'borderTopColor\',\'borderTopStyle\',\'borderTopWidth\',\'1j\',\'captionSide\',\'clear\',\'clip\',\'N\',\'4F\',\'counterIncrement\',\'counterReset\',\'cssFloat\',\'cueAfter\',\'cueBefore\',\'cursor\',\'2w\',\'3w\',\'elevation\',\'emptyCells\',\'fontFamily\',\'1k\',\'fontSizeAdjust\',\'fontStretch\',\'fontStyle\',\'fontVariant\',\'fontWeight\',\'z\',\'M\',\'letterSpacing\',\'lineHeight\',\'listStyleImage\',\'listStylePosition\',\'listStyleType\',\'marginBottom\',\'marginLeft\',\'marginRight\',\'marginTop\',\'markerOffset\',\'marks\',\'maxHeight\',\'maxWidth\',\'minHeight\',\'minWidth\',\'P\',\'orphans\',\'outlineColor\',\'outlineOffset\',\'outlineStyle\',\'outlineWidth\',\'overflowX\',\'overflowY\',\'paddingBottom\',\'paddingLeft\',\'paddingRight\',\'paddingTop\',\'page\',\'pageBreakAfter\',\'pageBreakBefore\',\'pageBreakInside\',\'pauseAfter\',\'pauseBefore\',\'pitch\',\'pitchRange\',\'w\',\'quotes\',\'richness\',\'2x\',\'4C\',\'speakHeader\',\'speakNumeral\',\'speakPunctuation\',\'speechRate\',\'stress\',\'tableLayout\',\'textAlign\',\'textDecoration\',\'textIndent\',\'textShadow\',\'textTransform\',\'G\',\'unicodeBidi\',\'verticalAlign\',\'visibility\',\'voiceFamily\',\'volume\',\'whiteSpace\',\'widows\',\'E\',\'wordSpacing\',\'zIndex\'];L.56=/^(([\\+\\-]?[0-9\\.]+)(em|ex|px|in|cm|mm|pt|pc|\\%))|0$/;31.J.4Z=a(){j 6=L.o(24.createElement(\'3H\'));6.innerHTML=\'<3H r="\'+8+\'"></3H>\';j r=6.1G().r,3I=$H();L.55.13(a(12){h(r[12])3I[12]=r[12]});j 3J=$H();3I.13(a(3K){j 12=3K[0],Q=3K[1],1d=1R;h(Q.1H(\'#57\')!=\'#57\'){Q=Q.1H();1d=\'N\'}2g h(L.56.1J(Q))j 30=Q.3S(/^([\\+\\-]?[0-9\\.]+)(.*)$/),Q=1O(30[1]),1d=(30.1I==3)?30[2]:1R;3J[12.underscore().dasherize()]=$H({Q:Q,1d:1d})}.1p(8));l 3J};L.58=a(6,r){q c.2Z(6,p.o({r:r},C[2]||{}));l 6};[\'2E\',\'2h\',\'1x\',\'3b\',\'3Q\',\'35\',\'38\',\'58\'].13(a(f){L.59[f]=L[f]});L.59.visualEffect=a(6,b,g){s=b.gsub(/_/,\'-\').camelize();5a=s.33(0).toUpperCase()+s.substring(1);q c[5a](6,g);l $(6)};L.addMethods();',[],321,'||||||element||this||function|effect|Effect||||options|if||var||return|||extend|Object|new|style||dims|setStyle||position|||height||pos|arguments|true|width|effects|top||afterFinishInternal|prototype||Element|left|color|getStyle|opacity|value||Math|false|window|duration|transform|transition|sync|oldStyle|moveX|moveY|property|each|case|break||Move|Scale|node|100||restoreAfterFinish|unit|opera||queue|Transitions|from|bottom|fontSize|pulses|Class|create|initialize|bind|Base|event|update|scaleX|scaleContent|hide|originalValue|getInlineOpacity|round|start|Opacity|makePositioned|scaleMode|makeClipping|undoClipping|undoPositioned|down|parseColor|length|test|startOn|finishOn|track|navigator|parseFloat|typeof|sinoidal|null|timestamp|finish|beforeSetup|setup|Parallel|scaleFrom|initialMoveX|initialMoveY||tracks|slice|userAgent|document||_elementDoesNotExistError|throw|elements|state|timePos|queueName|map|Position|oldOpacity|elementDimensions|else|getOpacity|filter|child|delay|none|interval|max|render|eventName|originalLeft|originalTop|scaleY|fontSizeType|clientHeight|show|direction|right|targetValue|parseInt|childNodes|flatten|percent|alpha|setOpacity|MSIE|global|string|loop|Queues|instances|get|1000|cancel|scaleFromCenter|originalHeight|originalWidth|currentScale|offsets|getDimensions|oldInnerBottom|center|moveTransition|scaleTransition|opacityTransition|Morph|components|String|toColorPart|charAt|toLowerCase|collectTextNodes|nodeType|nodeValue|collectTextNodesIgnoreClass|className||forceRerendering|tagifyStyle|character|remove|PAIRS|Appear|scope|limit|cos||ScopedQueue|switch|idle|currentFrame|frame|afterSetup|inspect|box|originalStyle|topd|leftd|display|backgroundImage|background|endcolor|restorecolor|_base|backgroundColor|scrollStart|0px|reverser|ids|div|styleRules|result|pair|cols|for|collect|hasChildNodes|join|setContentZoom|indexOf|match|replace||args|tagifyText|Builder|relative|zoom||speed|masterDelay|index|SlideDown|SlideUp|BlindDown|BlindUp|appear|Fade|end|Prototype|flicker|pulse|floor|full|_each|iterator|add|Date|getTime|pluck|push|reject|invoke|DefaultOptions|fps|beforeFinish|afterFinish|running|Internal|Event|mode|absolute|toTop|toLeft|scaleTo|elementPositioning|size||factor|content|scrollHeight|setDimensions|Highlight|startcolor|ffffff|_delta|inject|ScrollTo|prepare|offset|innerHeight|body|documentElement|delta||cleanWhitespace|afterUpdateInternal|beforeStartInternal|transforms|parseStyle|isNaN|Transform|addTracks|data|first|CSS_PROPERTIES|CSS_LENGTH|zzzzzz|morph|Methods|effect_class'.split('|'),0,{}))
|
@@ -0,0 +1 @@
|
|
1
|
+
eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'([67k-mo-qt-vyB-EGIJL-QT-WY]|[1-7]\\w)'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('m W={4e:\'1.5.0\',4f:{4g:!!B.3t},3u:\'(?:<4h.*?>)((\\n|\\r|.)*?)(?:<\\/4h>)\',2g:7(){},K:7(a){k a}}m 1d={1e:7(){k 7(){6.1v.1K(6,I)}}}m 1i=G q();q.p=7(a,b){M(m c in b){a[c]=b[c]}k a}q.p(q,{P:7(a){1m{l(a===N)k\'N\';l(a===L)k\'L\';k a.P?a.P():a.1E()}1p(e){l(e instanceof RangeError)k\'...\';1L e;}},5r:7(a){m b=[];M(m c in a)b.v(c);k b},1x:7(a){m b=[];M(m c in a)b.v(a[c]);k b},2U:7(a){k q.p({},a)}});4i.t.1f=7(){m a=6,b=$A(I),c=b.4j();k 7(){k a.1K(c,b.1n($A(I)))}}4i.t.bindAsEventListener=7(b){m c=6,d=$A(I),b=d.4j();k 7(a){k c.1K(b,[(a||17.event)].1n(d).1n($A(I)))}}q.p(Number.t,{toColorPart:7(){m a=6.1E(16);l(6<16)k\'0\'+a;k a},4k:7(){k 6+1},5s:7(a){$R(0,6,T).J(a);k 6}});m 5t={5u:7(){m a;M(m b=0,c=I.C;b<c;b++){m d=I[b];1m{a=d();U}1p(e){}}k a}}m 5v=1d.1e();5v.t={1v:7(a,b){6.2u=a;6.2h=b;6.3v=Q;6.2i()},2i:7(){6.2v=5w(6.2j.1f(6),6.2h*4l)},4m:7(){l(!6.2v)k;clearInterval(6.2v);6.2v=L},2j:7(){l(!6.3v){1m{6.3v=T;6.2u(6)}finally{6.3v=Q}}}}1F.4n=7(a){k a==L?\'\':1F(a)}q.p(1F.t,{1G:7(a,b){m c=\'\',d=6,f;b=I.callee.4o(b);1a(d.C>0){l(f=d.Y(a)){c+=d.2w(0,f.5x);c+=1F.4n(b(f));d=d.2w(f.5x+f[0].C)}V{c+=d,d=\'\'}}k c},sub:7(b,c,d){c=6.1G.4o(c);d=d===N?1:d;k 6.1G(b,7(a){l(--d<0)k a[0];k c(a)})},scan:7(a,b){6.1G(a,b);k 6},truncate:7(a,b){a=a||30;b=b===N?\'...\':b;k 6.C>a?6.2w(0,a-b.C)+b:6},2V:7(){k 6.1H(/^\\s+/,\'\').1H(/\\s+$/,\'\')},5y:7(){k 6.1H(/<\\/?[^>]+>/gi,\'\')},1M:7(){k 6.1H(G 3x(W.3u,\'5z\'),\'\')},5A:7(){m b=G 3x(W.3u,\'5z\');m c=G 3x(W.3u,\'im\');k(6.Y(b)||[]).1g(7(a){k(a.Y(c)||[\'\',\'\'])[1]})},2x:7(){k 6.5A().1g(7(a){k 4p(a)})},escapeHTML:7(){m a=B.2W(\'2X\');m b=B.createTextNode(6);a.4q(b);k a.1S},unescapeHTML:7(){m c=B.2W(\'2X\');c.1S=6.5y();k c.1T[0]?(c.1T.C>1?$A(c.1T).1N(\'\',7(a,b){k a+b.2Y}):c.1T[0].2Y):\'\'},4r:7(f){m g=6.2V().Y(/([^?#]*)(#.*)?$/);l(!g)k{};k g[1].2k(f||\'&\').1N({},7(a,b){l((b=b.2k(\'=\'))[0]){m c=5B(b[0]);m d=b[1]?5B(b[1]):N;l(a[c]!==N){l(a[c].2l!=1j)a[c]=[a[c]];l(d)a[c].v(d)}V a[c]=d}k a})},1O:7(){k 6.2k(\'\')},4k:7(){k 6.2w(0,6.C-1)+1F.fromCharCode(6.charCodeAt(6.C-1)+1)},4s:7(){m a=6.2k(\'-\'),b=a.C;l(b==1)k a[0];m c=6.3y(0)==\'-\'?a[0].3y(0).1y()+a[0].4t(1):a[0];M(m d=1;d<b;d++)c+=a[d].3y(0).1y()+a[d].4t(1);k c},5C:7(){k 6.3y(0).1y()+6.4t(1).1q()},underscore:7(){k 6.1G(/::/,\'/\').1G(/([A-Z]+)([A-Z][a-z])/,\'#{1}_#{2}\').1G(/([a-z\\d])([A-Z])/,\'#{1}_#{2}\').1G(/-/,\'_\').1q()},dasherize:7(){k 6.1G(/_/,\'-\')},P:7(a){m b=6.1H(/\\\\/g,\'\\\\\\\\\');l(a)k\'"\'+b.1H(/"/g,\'\\\\"\')+\'"\';V k"\'"+b.1H(/\'/g,\'\\\\\\\'\')+"\'"}});1F.t.1G.4o=7(b){l(1b b==\'7\')k b;m c=G 2Z(b);k 7(a){k c.3t(a)}}1F.t.parseQuery=1F.t.4r;m 2Z=1d.1e();2Z.5D=/(^|.|\\r|\\n)(#\\{(.*?)\\})/;2Z.t={1v:7(a,b){6.5E=a.1E();6.5F=b||2Z.5D},3t:7(c){k 6.5E.1G(6.5F,7(a){m b=a[1];l(b==\'\\\\\')k a[2];k b+1F.4n(c[a[3]])})}}m $U=G q();m $3z=G q();m 1r={J:7(b){m c=0;1m{6.1U(7(a){1m{b(a,c++)}1p(e){l(e!=$3z)1L e;}})}1p(e){l(e!=$U)1L e;}k 6},5G:7(a,b){m c=-a,d=[],f=6.1O();1a((c+=a)<f.C)d.v(f.2w(c,c+a));k d.1g(b)},4u:7(c){m d=T;6.J(7(a,b){d=d&&!!(c||W.K)(a,b);l(!d)1L $U;});k d},any:7(c){m d=Q;6.J(7(a,b){l(d=!!(c||W.K)(a,b))1L $U;});k d},5H:7(c){m d=[];6.J(7(a,b){d.v((c||W.K)(a,b))});k d},5I:7(c){m d;6.J(7(a,b){l(c(a,b)){d=a;1L $U;}});k d},5J:7(c){m d=[];6.J(7(a,b){l(c(a,b))d.v(a)});k d},grep:7(d,f){m g=[];6.J(7(a,b){m c=a.1E();l(c.Y(d))g.v((f||W.K)(a,b))})k g},12:7(b){m c=Q;6.J(7(a){l(a==b){c=T;1L $U;}});k c},inGroupsOf:7(b,c){c=c===N?L:c;k 6.5G(b,7(a){1a(a.C<b)a.v(c);k a})},1N:7(c,d){6.J(7(a,b){c=d(c,a,b)});k c},invoke:7(b){m c=$A(I).2w(1);k 6.1g(7(a){k a[b].1K(a,c)})},max:7(c){m d;6.J(7(a,b){a=(c||W.K)(a,b);l(d==N||a>=d)d=a});k d},min:7(c){m d;6.J(7(a,b){a=(c||W.K)(a,b);l(d==N||a<d)d=a});k d},partition:7(c){m d=[],f=[];6.J(7(a,b){((c||W.K)(a,b)?d:f).v(a)});k[d,f]},31:7(c){m d=[];6.J(7(a,b){d.v(a[c])});k d},reject:7(c){m d=[];6.J(7(a,b){l(!c(a,b))d.v(a)});k d},sortBy:7(f){k 6.1g(7(a,b){k{11:a,4v:f(a,b)}}).sort(7(a,b){m c=a.4v,d=b.4v;k c<d?-1:c>d?1:0}).31(\'11\')},1O:7(){k 6.1g()},zip:7(){m c=W.K,d=$A(I);l(1b d.4w()==\'7\')c=d.pop();m f=[6].1n(d).1g($A);k 6.1g(7(a,b){k c(f.31(b))})},5K:7(){k 6.1O().C},P:7(){k\'#<1r:\'+6.1O().P()+\'>\'}}q.p(1r,{1g:1r.5H,5L:1r.5I,1z:1r.5J,member:1r.12,entries:1r.1O});m $A=1j.from=7(a){l(!a)k[];l(a.1O){k a.1O()}V{m b=[];M(m c=0,d=a.C;c<d;c++)b.v(a[c]);k b}}q.p(1j.t,1r);l(!1j.t.4x)1j.t.4x=1j.t.3A;q.p(1j.t,{1U:7(a){M(m b=0,c=6.C;b<c;b++)a(6[b])},5M:7(){6.C=0;k 6},32:7(){k 6[0]},4w:7(){k 6[6.C-1]},5N:7(){k 6.1z(7(a){k a!=L})},4y:7(){k 6.1N([],7(a,b){k a.1n(b&&b.2l==1j?b.4y():[b])})},4z:7(){m b=$A(I);k 6.1z(7(a){k!b.12(a)})},5O:7(a){M(m b=0,c=6.C;b<c;b++)l(6[b]==a)k b;k-1},3A:7(a){k(a!==Q?6:6.1O()).4x()},5P:7(){k 6.C>1?6:6[0]},uniq:7(){k 6.1N([],7(a,b){k a.12(b)?a:a.1n([b])})},2U:7(){k[].1n(6)},5K:7(){k 6.C},P:7(){k\'[\'+6.1g(q.P).1V(\', \')+\']\'}});1j.t.1O=1j.t.2U;7 $w(a){a=a.2V();k a?a.2k(/\\s+/):[]}l(17.1W){1j.t.1n=7(){m a=[];M(m b=0,c=6.C;b<c;b++)a.v(6[b]);M(m b=0,c=I.C;b<c;b++){l(I[b].2l==1j){M(m d=0,f=I[b].C;d<f;d++)a.v(I[b][d])}V{a.v(I[b])}}k a}}m 1A=7(a){q.p(6,a||{})};q.p(1A,{2y:7(d){m f=[];6.t.1U.call(d,7(b){l(!b.22)k;l(b.11&&b.11.2l==1j){m c=b.11.5N();l(c.C<2)b.11=c.5P();V{22=3B(b.22);c.J(7(a){a=a!=N?3B(a):\'\';f.v(22+\'=\'+3B(a))});k}}l(b.11==N)b[1]=\'\';f.v(b.1g(3B).1V(\'=\'))});k f.1V(\'&\')}});q.p(1A.t,1r);q.p(1A.t,{1U:7(a){M(m b in 6){m c=6[b];l(c&&c==1A.t[b])3z;m d=[b,c];d.22=b;d.11=c;a(d)}},5r:7(){k 6.31(\'22\')},1x:7(){k 6.31(\'11\')},merge:7(c){k $H(c).1N(6,7(a,b){a[b.22]=b.11;k a})},3a:7(){m a;M(m b=0,c=I.C;b<c;b++){m d=6[I[b]];l(d!==N){l(a===N)a=d;V{l(a.2l!=1j)a=[a];a.v(d)}}delete 6[I[b]]}k a},2y:7(){k 1A.2y(6)},P:7(){k\'#<1A:{\'+6.1g(7(a){k a.1g(q.P).1V(\': \')}).1V(\', \')+\'}>\'}});7 $H(a){l(a&&a.2l==1A)k a;k G 1A(a)};3C=1d.1e();q.p(3C.t,1r);q.p(3C.t,{1v:7(a,b,c){6.3b=a;6.4A=b;6.5Q=c},1U:7(a){m b=6.3b;1a(6.12(b)){a(b);b=b.4k()}},12:7(a){l(a<6.3b)k Q;l(6.5Q)k a<6.4A;k a<=6.4A}});m $R=7(a,b,c){k G 3C(a,b,c)}m O={4B:7(){k 5t.5u(7(){k G 5R()},7(){k G 5S(\'Msxml2.5T\')},7(){k G 5S(\'Microsoft.5T\')})||Q},4C:0}O.2z={3c:[],1U:7(a){6.3c.1U(a)},5U:7(a){l(!6.12(a))6.3c.v(a)},unregister:7(a){6.3c=6.3c.4z(a)},3D:7(b,c,d,f){6.J(7(a){l(1b a[b]==\'7\'){1m{a[b].1K(a,[c,d,f])}1p(e){}}})}};q.p(O.2z,1r);O.2z.5U({5V:7(){O.4C++},1P:7(){O.4C--}});O.3E=7(){};O.3E.t={3F:7(a){6.D={1B:\'3d\',3G:T,5W:\'4D/x-www-5X-urlencoded\',4E:\'UTF-8\',3e:\'\'}q.p(6.D,a||{});6.D.1B=6.D.1B.1q();l(1b 6.D.3e==\'3f\')6.D.3e=6.D.3e.4r()}}O.3g=1d.1e();O.3g.5Y=[\'Uninitialized\',\'Loading\',\'Loaded\',\'Interactive\',\'4F\'];O.3g.t=q.p(G O.3E(),{4G:Q,1v:7(a,b){6.14=O.4B();6.3F(b);6.4H(a)},4H:7(a){6.2A=a;6.1B=6.D.1B;m b=6.D.3e;l(![\'5Z\',\'3d\'].12(6.1B)){b[\'_method\']=6.1B;6.1B=\'3d\'}b=1A.2y(b);l(b&&/2B|2C|2D/.1X(1C.1Y))b+=\'&_=\'l(6.1B==\'5Z\'&&b)6.2A+=(6.2A.5O(\'?\')>-1?\'&\':\'?\')+b;1m{O.2z.3D(\'5V\',6,6.14);6.14.open(6.1B.1y(),6.2A,6.D.3G);l(6.D.3G)2m(7(){6.4I(1)}.1f(6),10);6.14.60=6.4J.1f(6);6.61();m c=6.1B==\'3d\'?(6.D.postBody||b):L;6.14.send(c);l(!6.D.3G&&6.14.62)6.4J()}1p(e){6.3h(e)}},4J:7(){m a=6.14.63;l(a>1&&!((a==4)&&6.4G))6.4I(6.14.63)},61:7(){m b={\'X-Requested-With\':\'5R\',\'X-W-4e\':W.4e,\'Accept\':\'2E/64, 2E/html, 4D/65, 2E/65, */*\'};l(6.1B==\'3d\'){b[\'66-1Z\']=6.D.5W+(6.D.4E?\'; charset=\'+6.D.4E:\'\');l(6.14.62&&(1C.1Y.Y(/67\\/(\\d{4})/)||[0,68])[1]<68)b[\'Connection\']=\'close\'}l(1b 6.D.69==\'object\'){m c=6.D.69;l(1b c.v==\'7\')M(m d=0,f=c.C;d<f;d+=2)b[c[d]]=c[d+1];V $H(c).J(7(a){b[a.22]=a.11})}M(m g in b)6.14.setRequestHeader(g,b[g])},23:7(){k!6.14.3H||(6.14.3H>=200&&6.14.3H<300)},4I:7(a){m b=O.3g.5Y[a];m c=6.14,d=6.6a();l(b==\'4F\'){1m{6.4G=T;(6.D[\'on\'+6.14.3H]||6.D[\'on\'+(6.23()?\'Success\':\'Failure\')]||W.2g)(c,d)}1p(e){6.3h(e)}l((6.4K(\'66-1Z\')||\'2E/64\').2V().Y(/^(2E|4D)\\/(x-)?(java|ecma)4h(;.*)?$/i))6.6b()}1m{(6.D[\'on\'+b]||W.2g)(c,d);O.2z.3D(\'on\'+b,6,c,d)}1p(e){6.3h(e)}l(b==\'4F\'){6.14.60=W.2g}},4K:7(a){1m{k 6.14.getResponseHeader(a)}1p(e){k L}},6a:7(){1m{m a=6.4K(\'X-JSON\');k a?4p(\'(\'+a+\')\'):L}1p(e){k L}},6b:7(){1m{k 4p(6.14.3I)}1p(e){6.3h(e)}},3h:7(a){(6.D.6c||W.2g)(6,a);O.2z.3D(\'6c\',6,a)}});O.4L=1d.1e();q.p(q.p(O.4L.t,O.3g.t),{1v:7(c,d,f){6.3J={23:(c.23||c),4M:(c.4M||(c.23?L:c))}6.14=O.4B();6.3F(f);m g=6.D.1P||W.2g;6.D.1P=(7(a,b){6.6d();g(a,b)}).1f(6);6.4H(d)},6d:7(){m a=6.3J[6.23()?\'23\':\'4M\'];m b=6.14.3I;l(!6.D.2x)b=b.1M();l(a=$(a)){l(6.D.6e)G 6.D.6e(a,b);V a.4N(b)}l(6.23()){l(6.1P)2m(6.1P.1f(6),10)}}});O.6f=1d.1e();O.6f.t=q.p(G O.3E(),{1v:7(a,b,c){6.3F(c);6.1P=6.D.1P;6.2h=(6.D.2h||2);6.2n=(6.D.2n||1);6.4O={};6.3J=a;6.2A=b;6.3b()},3b:7(){6.D.1P=6.6g.1f(6);6.2j()},4m:7(){6.4O.D.1P=N;clearTimeout(6.2v);(6.1P||W.2g).1K(6,I)},6g:7(a){l(6.D.2n){6.2n=(a.3I==6.6h?6.2n*6.D.2n:1);6.6h=a.3I}6.2v=2m(6.2j.1f(6),6.2n*6.2h*4l)},2j:7(){6.4O=G O.4L(6.3J,6.2A,6.D)}});7 $(a){l(I.C>1){M(m b=0,c=[],d=I.C;b<d;b++)c.v($(I[b]));k c}l(1b a==\'3f\')a=B.getElementById(a);k o.p(a)}l(W.4f.4g){B.6i=7(a,b){m c=[];m d=B.3t(a,$(b)||B,L,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,L);M(m f=0,g=d.snapshotLength;f<g;f++)c.v(d.snapshotItem(f));k c}}B.4P=7(a,b){l(W.4f.4g){m c=".//*[contains(1n(\' \', @6j, \' \'), \' "+a+" \')]";k B.6i(c,b)}V{m d=($(b)||B.1s).3i(\'*\');m f=[],g;M(m h=0,i=d.C;h<i;h++){g=d[h];l(o.3K(g,a))f.v(o.p(g))}k f}};l(!17.o)m o=G q();o.p=7(a){l(!a||4Q||a.3L==3)k a;l(!a.6k&&a.15&&a!=17){m b=q.2U(o.18),c=o.p.4R;l(a.15==\'FORM\')q.p(b,E.18);l([\'INPUT\',\'TEXTAREA\',\'SELECT\'].12(a.15))q.p(b,E.o.18);q.p(b,o.18.4S);M(m d in b){m f=b[d];l(1b f==\'7\'&&!(d in a))a[d]=c.4T(f)}}a.6k=T;k a};o.p.4R={4T:7(a){k 6[a]=6[a]||7(){k a.1K(L,[6].1n($A(I)))}}};o.18={4U:7(a){k $(a).u.20!=\'3M\'},6l:7(a){a=$(a);o[o.4U(a)?\'6m\':\'6n\'](a);k a},6m:7(a){$(a).u.20=\'3M\';k a},6n:7(a){$(a).u.20=\'\';k a},3a:7(a){a=$(a);a.1I.4V(a);k a},4N:7(a,b){b=1b b==\'N\'?\'\':b.1E();$(a).1S=b.1M();2m(7(){b.2x()},10);k a},1H:7(a,b){a=$(a);b=1b b==\'N\'?\'\':b.1E();l(a.6o){a.6o=b.1M()}V{m c=a.6p.6q();c.4W(a);a.1I.replaceChild(c.6r(b.1M()),a)}2m(7(){b.2x()},10);k a},P:7(f){f=$(f);m g=\'<\'+f.15.1q();$H({\'id\':\'id\',\'2o\':\'6j\'}).J(7(a){m b=a.32(),c=a.4w();m d=(f[b]||\'\').1E();l(d)g+=\' \'+c+\'=\'+d.P(T)});k g+\'>\'},3N:7(a,b){a=$(a);m c=[];1a(a=a[b])l(a.3L==1)c.v(o.p(a));k c},6s:7(a){k $(a).3N(\'1I\')},6t:7(a){k $A($(a).3i(\'*\'))},immediateDescendants:7(a){l(!(a=$(a).3O))k[];1a(a&&a.3L!=1)a=a.3P;l(a)k[a].1n($(a).3Q());k[]},4X:7(a){k $(a).3N(\'previousSibling\')},3Q:7(a){k $(a).3N(\'3P\')},siblings:7(a){a=$(a);k a.4X().3A().1n(a.3Q())},Y:7(a,b){l(1b b==\'3f\')b=G 1t(b);k b.Y($(a))},up:7(a,b,c){k 1t.2H($(a).6s(),b,c)},down:7(a,b,c){k 1t.2H($(a).6t(),b,c)},previous:7(a,b,c){k 1t.2H($(a).4X(),b,c)},next:7(a,b,c){k 1t.2H($(a).3Q(),b,c)},getElementsBySelector:7(){m a=$A(I),b=$(a.4j());k 1t.4Y(b,a)},4P:7(a,b){k B.4P(b,a)},4Z:7(a,b){a=$(a);l(B.4u&&!17.1W){m c=o.1D;l(c.1x[b])k c.1x[b](a,b);l(c.3R[b])b=c.3R[b];m d=a.3j[b];l(d)k d.2Y}k a.6u(b)},getHeight:7(a){k $(a).50().24},getWidth:7(a){k $(a).50().25},2p:7(a){k G o.3S(a)},3K:7(a,b){l(!(a=$(a)))k;m c=a.2o;l(c.C==0)k Q;l(c==b||c.Y(G 3x("(^|\\\\s)"+b+"(\\\\s|$)")))k T;k Q},addClassName:7(a,b){l(!(a=$(a)))k;o.2p(a).51(b);k a},removeClassName:7(a,b){l(!(a=$(a)))k;o.2p(a).3a(b);k a},toggleClassName:7(a,b){l(!(a=$(a)))k;o.2p(a)[a.3K(b)?\'3a\':\'51\'](b);k a},2I:7(){19.2I.1K(19,I);k $A(I).32()},3T:7(){19.3T.1K(19,I);k $A(I).32()},cleanWhitespace:7(a){a=$(a);m b=a.3O;1a(b){m c=b.3P;l(b.3L==3&&!/\\S/.1X(b.2Y))a.4V(b);b=c}k a},6v:7(a){k $(a).1S.Y(/^\\s*$/)},6w:7(a,b){a=$(a),b=$(b);1a(a=a.1I)l(a==b)k T;k Q},6x:7(a){a=$(a);m b=21.3k(a);17.6x(b[0],b[1]);k a},1k:7(a,b){a=$(a);l([\'6y\',\'3U\'].12(b))b=(1b a.u.3V!=\'N\'?\'3V\':\'3U\');b=b.4s();m c=a.u[b];l(!c){l(B.52&&B.52.6z){m d=B.52.6z(a,L);c=d?d[b]:L}V l(a.6A){c=a.6A[b]}}l((c==\'3l\')&&[\'25\',\'24\'].12(b)&&(a.1k(\'20\')!=\'3M\'))c=a[\'1u\'+b.5C()]+\'px\';l(17.1W&&[\'26\',\'28\',\'6B\',\'6C\'].12(b))l(o.1k(a,\'1h\')==\'53\')c=\'3l\';l(b==\'3W\'){l(c)k 2J(c);l(c=(a.1k(\'2q\')||\'\').Y(/3m\\(3W=(.*)\\)/))l(c[1])k 2J(c[1])/6D;k 1.0}k c==\'3l\'?L:c},setStyle:7(a,b){a=$(a);M(m c in b){m d=b[c];l(c==\'3W\'){l(d==1){d=(/67/.1X(1C.1Y)&&!/2B|2C|2D/.1X(1C.1Y))?0.999999:1.0;l(/54/.1X(1C.1Y)&&!17.1W)a.u.2q=a.1k(\'2q\').1H(/3m\\([^\\)]*\\)/gi,\'\')}V l(d==\'\'){l(/54/.1X(1C.1Y)&&!17.1W)a.u.2q=a.1k(\'2q\').1H(/3m\\([^\\)]*\\)/gi,\'\')}V{l(d<0.00001)d=0;l(/54/.1X(1C.1Y)&&!17.1W)a.u.2q=a.1k(\'2q\').1H(/3m\\([^\\)]*\\)/gi,\'\')+\'3m(3W=\'+d*6D+\')\'}}V l([\'6y\',\'3U\'].12(c))c=(1b a.u.3V!=\'N\')?\'3V\':\'3U\';a.u[c.4s()]=d}k a},50:7(a){a=$(a);m b=$(a).1k(\'20\');l(b!=\'3M\'&&b!=L)k{25:a.2K,24:a.2L};m c=a.u;m d=c.55;m f=c.1h;m g=c.20;c.55=\'3X\';c.1h=\'2r\';c.20=\'block\';m h=a.6E;m i=a.6F;c.20=g;c.1h=f;c.55=d;k{25:h,24:i}},makePositioned:7(a){a=$(a);m b=o.1k(a,\'1h\');l(b==\'53\'||!b){a.56=T;a.u.1h=\'3Y\';l(17.1W){a.u.28=0;a.u.26=0}}k a},undoPositioned:7(a){a=$(a);l(a.56){a.56=N;a.u.1h=a.u.28=a.u.26=a.u.6C=a.u.6B=\'\'}k a},makeClipping:7(a){a=$(a);l(a.2M)k a;a.2M=a.u.3Z||\'3l\';l((o.1k(a,\'3Z\')||\'4U\')!=\'3X\')a.u.3Z=\'3X\';k a},undoClipping:7(a){a=$(a);l(!a.2M)k a;a.u.3Z=a.2M==\'3l\'?\'\':a.2M;a.2M=L;k a}};q.p(o.18,{6G:o.18.6w});o.1D={};o.1D.3R={colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",datetime:"dateTime",accesskey:"accessKey",tabindex:"tabIndex",enctype:"encType",maxlength:"maxLength",6H:"readOnly",longdesc:"longDesc"};o.1D.1x={57:7(a,b){k a.6u(b,2)},3n:7(a,b){k $(a).41(b)?b:L},u:7(a){k a.u.cssText.1q()},6I:7(a){m b=a.6J(\'6I\');k b.6K?b.2Y:L}};q.p(o.1D.1x,{href:o.1D.1x.57,src:o.1D.1x.57,29:o.1D.1x.3n,6L:o.1D.1x.3n,6H:o.1D.1x.3n,multiple:o.1D.1x.3n});o.18.4S={41:7(a,b){m c=o.1D;b=c.3R[b]||b;k $(a).6J(b).6K}};l(B.4u&&!17.1W){o.18.4N=7(b,c){b=$(b);c=1b c==\'N\'?\'\':c.1E();m d=b.15.1y();l([\'6M\',\'58\',\'TR\',\'TD\'].12(d)){m f=B.2W(\'2X\');3o(d){1c\'6M\':1c\'58\':f.1S=\'<2a><2b>\'+c.1M()+\'</2b></2a>\';42=2;U;1c\'TR\':f.1S=\'<2a><2b><tr>\'+c.1M()+\'</tr></2b></2a>\';42=3;U;1c\'TD\':f.1S=\'<2a><2b><tr><td>\'+c.1M()+\'</td></tr></2b></2a>\';42=4}$A(b.1T).J(7(a){b.4V(a)});42.5s(7(){f=f.3O});$A(f.1T).J(7(a){b.4q(a)})}V{b.1S=c.1M()}2m(7(){c.2x()},10);k b}};q.p(o,o.18);m 4Q=Q;l(/2B|2C|2D/.1X(1C.1Y))[\'\',\'E\',\'Input\',\'TextArea\',\'Select\'].J(7(44){m 2o=\'HTML\'+44+\'o\';l(17[2o])k;m 6P=17[2o]={};6P.t=B.2W(44?44.1q():\'2X\').__proto__});o.6Q=7(h){q.p(o.18,h||{});7 i(a,b,c){c=c||Q;m d=o.p.4R;M(m f in a){m g=a[f];l(!c||!(f in b))b[f]=d.4T(g)}}l(1b 5a!=\'N\'){i(o.18,5a.t);i(o.18.4S,5a.t,T);i(E.18,HTMLFormElement.t);[HTMLInputElement,HTMLTextAreaElement,HTMLSelectElement].J(7(a){i(E.o.18,a.t)});4Q=T}}m 6R=G q();6R.20=o.6l;1i.1l=7(a){6.5b=a}1i.1l.t={1v:7(a,b){6.y=$(a);6.45=b.1M();l(6.5b&&6.y.6S){1m{6.y.6S(6.5b,6.45)}1p(e){m c=6.y.15.1y();l([\'58\',\'TR\'].12(c)){6.2N(6.6T())}V{1L e;}}}V{6.2c=6.y.6p.6q();l(6.2O)6.2O();6.2N([6.2c.6r(6.45)])}2m(7(){b.2x()},10)},6T:7(){m a=B.2W(\'2X\');a.1S=\'<2a><2b>\'+6.45+\'</2b></2a>\';k $A(a.1T[0].1T[0].1T)}}m 1l=G q();1l.6U=1d.1e();1l.6U.t=q.p(G 1i.1l(\'beforeBegin\'),{2O:7(){6.2c.setStartBefore(6.y)},2N:7(b){b.J((7(a){6.y.1I.5c(a,6.y)}).1f(6))}});1l.6V=1d.1e();1l.6V.t=q.p(G 1i.1l(\'afterBegin\'),{2O:7(){6.2c.4W(6.y);6.2c.6W(T)},2N:7(b){b.3A(Q).J((7(a){6.y.5c(a,6.y.3O)}).1f(6))}});1l.6X=1d.1e();1l.6X.t=q.p(G 1i.1l(\'beforeEnd\'),{2O:7(){6.2c.4W(6.y);6.2c.6W(6.y)},2N:7(b){b.J((7(a){6.y.4q(a)}).1f(6))}});1l.6Y=1d.1e();1l.6Y.t=q.p(G 1i.1l(\'afterEnd\'),{2O:7(){6.2c.setStartAfter(6.y)},2N:7(b){b.J((7(a){6.y.1I.5c(a,6.y.3P)}).1f(6))}});o.3S=1d.1e();o.3S.t={1v:7(a){6.y=$(a)},1U:7(b){6.y.2o.2k(/\\s+/).1z(7(a){k a.C>0}).1U(b)},5d:7(a){6.y.2o=a},51:7(a){l(6.12(a))k;6.5d($A(6).1n(a).1V(\' \'))},3a:7(a){l(!6.12(a))k;6.5d($A(6).4z(a).1V(\' \'))},1E:7(){k $A(6).1V(\' \')}};q.p(o.3S.t,1r);m 1t=1d.1e();1t.t={1v:7(a){6.2P={2p:[]};6.3p=a.1E().2V();6.6Z();6.70()},6Z:7(){7 b(a){1L\'Parse error in 71: \'+a;}l(6.3p==\'\')b(\'6v 3p\');m c=6.2P,d=6.3p,f,g,h,i;1a(f=d.Y(/^(.*)\\[([a-z0-9_:-]+?)(?:([~\\|!]?=)(?:"([^"]*)"|([^\\]\\s]*)))?\\]$/i)){c.3j=c.3j||[];c.3j.v({2d:f[2],47:f[3],11:f[4]||f[5]||\'\'});d=f[1]}l(d==\'*\')k 6.2P.72=T;1a(f=d.Y(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)){g=f[1],h=f[2],i=f[3];3o(g){1c\'#\':c.id=h;U;1c\'.\':c.2p.v(h);U;1c\'\':1c N:c.15=h.1y();U;48:b(d.P())}d=i}l(d.C>0)b(d.P())},73:7(){m f=6.2P,g=[],h;l(f.72)g.v(\'T\');l(h=f.id)g.v(\'y.4Z("id") == \'+h.P());l(h=f.15)g.v(\'y.15.1y() == \'+h.P());l((h=f.2p).C>0)M(m i=0,j=h.C;i<j;i++)g.v(\'y.3K(\'+h[i].P()+\')\');l(h=f.3j){h.J(7(b){m c=\'y.4Z(\'+b.2d.P()+\')\';m d=7(a){k c+\' && \'+c+\'.2k(\'+a.P()+\')\'}3o(b.47){1c\'=\':g.v(c+\' == \'+b.11.P());U;1c\'~=\':g.v(d(\' \')+\'.12(\'+b.11.P()+\')\');U;1c\'|=\':g.v(d(\'-\')+\'.32().1y() == \'+b.11.1y().P());U;1c\'!=\':g.v(c+\' != \'+b.11.P());U;1c\'\':1c N:g.v(\'y.41(\'+b.2d.P()+\')\');U;48:1L\'Unknown 47 \'+b.47+\' in 71\';}})}k g.1V(\' && \')},70:7(){6.Y=G 4i(\'y\',\'l (!y.15) k Q; y = $(y); k \'+6.73())},74:7(a){m b;l(b=$(6.2P.id))l(6.Y(b))l(!a||o.6G(b,a))k[b];a=(a||B).3i(6.2P.15||\'*\');m c=[];M(m d=0,f=a.C;d<f;d++)l(6.Y(b=a[d]))c.v(o.p(b));k c},1E:7(){k 6.3p}}q.p(1t,{75:7(a,b){m c=G 1t(b);k a.1z(c.Y.1f(c)).1g(o.p)},2H:7(a,b,c){l(1b b==\'number\')c=b,b=Q;k 1t.75(a,b||\'*\')[c||0]},4Y:7(h,i){k i.1g(7(g){k g.Y(/[^\\s"]+(?:"[^"]*"[^\\s"]+)*/g).1N([L],7(c,d){m f=G 1t(d);k c.1N([],7(a,b){k a.1n(f.74(b||h))})})}).4y()}});7 $$(){k 1t.4Y(B,$A(I))}m E={5g:7(a){$(a).5g();k a},76:7(f,g){m h=f.1N({},7(a,b){l(!b.29&&b.2d){m c=b.2d,d=$(b).1o();l(d!=N){l(a[c]){l(a[c].2l!=1j)a[c]=[a[c]];a[c].v(d)}V a[c]=d}}k a});k g?h:1A.2y(h)}};E.18={49:7(a,b){k E.76(E.2Q(a),b)},2Q:7(c){k $A($(c).3i(\'*\')).1N([],7(a,b){l(E.o.3q[b.15.1q()])a.v(o.p(b));k a})},getInputs:7(a,b,c){a=$(a);m d=a.3i(\'4a\');l(!b&&!c)k $A(d).1g(o.p);M(m f=0,g=[],h=d.C;f<h;f++){m i=d[f];l((b&&i.1Z!=b)||(c&&i.2d!=c))3z;g.v(o.p(i))}k g},77:7(b){b=$(b);b.2Q().J(7(a){a.78();a.29=\'T\'});k b},79:7(b){b=$(b);b.2Q().J(7(a){a.29=\'\'});k b},7a:7(b){k $(b).2Q().5L(7(a){k a.1Z!=\'3X\'&&!a.29&&[\'4a\',\'1z\',\'5h\'].12(a.15.1q())})},focusFirstElement:7(a){a=$(a);a.7a().7b();k a}}q.p(E,E.18);E.o={5i:7(a){$(a).5i();k a},1z:7(a){$(a).1z();k a}}E.o.18={49:7(a){a=$(a);l(!a.29&&a.2d){m b=a.1o();l(b!=N){m c={};c[a.2d]=b;k 1A.2y(c)}}k\'\'},1o:7(a){a=$(a);m b=a.15.1q();k E.o.3q[b](a)},5M:7(a){$(a).11=\'\';k a},present:7(a){k $(a).11!=\'\'},7b:7(a){a=$(a);a.5i();l(a.1z&&(a.15.1q()!=\'4a\'||![\'5j\',\'5g\',\'submit\'].12(a.1Z)))a.1z();k a},77:7(a){a=$(a);a.29=T;k a},79:7(a){a=$(a);a.78();a.29=Q;k a}}q.p(E.o,E.o.18);m Field=E.o;m $F=E.o.1o;E.o.3q={4a:7(a){3o(a.1Z.1q()){1c\'7c\':1c\'7d\':k E.o.3q.7e(a);48:k E.o.3q.5h(a)}},7e:7(a){k a.6L?a.11:L},5h:7(a){k a.11},1z:7(a){k 6[a.1Z==\'1z-one\'?\'7f\':\'7g\'](a)},7f:7(a){m b=a.selectedIndex;k b>=0?6.5k(a.D[b]):L},7g:7(a){m b,c=a.C;l(!c)k L;M(m d=0,b=[];d<c;d++){m f=a.D[d];l(f.selected)b.v(6.5k(f))}k b},5k:7(a){k o.p(a).41(\'11\')?a.11:a.2E}}1i.4b=7(){}1i.4b.t={1v:7(a,b,c){6.2h=b;6.y=$(a);6.2u=c;6.2e=6.1o();6.2i()},2i:7(){5w(6.2j.1f(6),6.2h*4l)},2j:7(){m a=6.1o();m b=(\'3f\'==1b 6.2e&&\'3f\'==1b a?6.2e!=a:1F(6.2e)!=1F(a));l(b){6.2u(6.y,a);6.2e=a}}}E.o.4c=1d.1e();E.o.4c.t=q.p(G 1i.4b(),{1o:7(){k E.o.1o(6.y)}});E.4c=1d.1e();E.4c.t=q.p(G 1i.4b(),{1o:7(){k E.49(6.y)}});1i.2f=7(){}1i.2f.t={1v:7(a,b){6.y=$(a);6.2u=b;6.2e=6.1o();l(6.y.15.1q()==\'5X\')6.7h();V 6.2i(6.y)},5l:7(){m a=6.1o();l(6.2e!=a){6.2u(6.y,a);6.2e=a}},7h:7(){E.2Q(6.y).J(6.2i.1f(6))},2i:7(a){l(a.1Z){3o(a.1Z.1q()){1c\'7c\':1c\'7d\':19.2I(a,\'click\',6.5l.1f(6));U;48:19.2I(a,\'change\',6.5l.1f(6));U}}}}E.o.2f=1d.1e();E.o.2f.t=q.p(G 1i.2f(),{1o:7(){k E.o.1o(6.y)}});E.2f=1d.1e();E.2f.t=q.p(G 1i.2f(),{1o:7(){k E.49(6.y)}});l(!17.19){m 19=G q()}q.p(19,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,y:7(a){k a.target||a.srcElement},isLeftClick:7(a){k(((a.7i)&&(a.7i==1))||((a.5j)&&(a.5j==1)))},pointerX:7(a){k a.pageX||(a.clientX+(B.4d.2R||B.1s.2R))},pointerY:7(a){k a.pageY||(a.clientY+(B.4d.2S||B.1s.2S))},4m:7(a){l(a.7j){a.7j();a.stopPropagation()}V{a.returnValue=Q;a.cancelBubble=T}},2H:7(a,b){m c=19.y(a);1a(c.1I&&(!c.15||(c.15.1y()!=b.1y())))c=c.1I;k c},1Q:Q,7k:7(a,b,c,d){l(!6.1Q)6.1Q=[];l(a.7l){6.1Q.v([a,b,c,d]);a.7l(b,c,d)}V l(a.5m){6.1Q.v([a,b,c,d]);a.5m(\'on\'+b,c)}},7m:7(){l(!19.1Q)k;M(m a=0,b=19.1Q.C;a<b;a++){19.3T.1K(6,19.1Q[a]);19.1Q[a][0]=L}19.1Q=Q},2I:7(a,b,c,d){a=$(a);d=d||Q;l(b==\'7n\'&&(1C.5n.Y(/2B|2C|2D/)||a.5m))b=\'7o\';19.7k(a,b,c,d)},3T:7(a,b,c,d){a=$(a);d=d||Q;l(b==\'7n\'&&(1C.5n.Y(/2B|2C|2D/)||a.5o))b=\'7o\';l(a.7p){a.7p(b,c,d)}V l(a.5o){1m{a.5o(\'on\'+b,c)}1p(e){}}}});l(1C.5n.Y(/\\bMSIE\\b/))19.2I(17,\'unload\',19.7m,Q);m 21={7q:Q,5p:7(){6.7r=17.pageXOffset||B.4d.2R||B.1s.2R||0;6.7s=17.pageYOffset||B.4d.2S||B.1s.2S||0},7t:7(a){m b=0,c=0;do{b+=a.2S||0;c+=a.2R||0;a=a.1I}1a(a);k[c,b]},3k:7(a){m b=0,c=0;do{b+=a.2s||0;c+=a.2t||0;a=a.1R}1a(a);k[c,b]},7u:7(a){m b=0,c=0;do{b+=a.2s||0;c+=a.2t||0;a=a.1R;l(a){l(a.15==\'7v\')U;m d=o.1k(a,\'1h\');l(d==\'3Y\'||d==\'2r\')U}}1a(a);k[c,b]},1R:7(a){l(a.1R)k a.1R;l(a==B.1s)k a;1a((a=a.1I)&&a!=B.1s)l(o.1k(a,\'1h\')!=\'53\')k a;k B.1s},within:7(a,b,c){l(6.7q)k 6.7w(a,b,c);6.3r=b;6.3s=c;6.1u=6.3k(a);k(c>=6.1u[1]&&c<6.1u[1]+a.2L&&b>=6.1u[0]&&b<6.1u[0]+a.2K)},7w:7(a,b,c){m d=6.7t(a);6.3r=b+d[0]-6.7r;6.3s=c+d[1]-6.7s;6.1u=6.3k(a);k(6.3s>=6.1u[1]&&6.3s<6.1u[1]+a.2L&&6.3r>=6.1u[0]&&6.3r<6.1u[0]+a.2K)},overlap:7(a,b){l(!a)k 0;l(a==\'vertical\')k((6.1u[1]+b.2L)-6.3s)/b.2L;l(a==\'horizontal\')k((6.1u[0]+b.2K)-6.3r)/b.2K},5q:7(a){m b=0,c=0;m d=a;do{b+=d.2s||0;c+=d.2t||0;l(d.1R==B.1s)l(o.1k(d,\'1h\')==\'2r\')U}1a(d=d.1R);d=a;do{l(!17.1W||d.15==\'7v\'){b-=d.2S||0;c-=d.2R||0}}1a(d=d.1I);k[c,b]},2U:7(a,b){m c=q.p({7x:T,7y:T,7z:T,7A:T,2s:0,2t:0},I[2]||{})a=$(a);m d=21.5q(a);b=$(b);m f=[0,0];m g=L;l(o.1k(b,\'1h\')==\'2r\'){g=21.1R(b);f=21.5q(g)}l(g==B.1s){f[0]-=B.1s.2t;f[1]-=B.1s.2s}l(c.7x)b.u.26=(d[0]-f[0]+c.2t)+\'px\';l(c.7y)b.u.28=(d[1]-f[1]+c.2s)+\'px\';l(c.7z)b.u.25=a.2K+\'px\';l(c.7A)b.u.24=a.2L+\'px\'},absolutize:7(a){a=$(a);l(a.u.1h==\'2r\')k;21.5p();m b=21.7u(a);m c=b[1];m d=b[0];m f=a.6E;m g=a.6F;a.7B=d-2J(a.u.26||0);a.7C=c-2J(a.u.28||0);a.7D=a.u.25;a.7E=a.u.24;a.u.1h=\'2r\';a.u.28=c+\'px\';a.u.26=d+\'px\';a.u.25=f+\'px\';a.u.24=g+\'px\'},relativize:7(a){a=$(a);l(a.u.1h==\'3Y\')k;21.5p();a.u.1h=\'3Y\';m b=2J(a.u.28||0)-(a.7C||0);m c=2J(a.u.26||0)-(a.7B||0);a.u.28=b+\'px\';a.u.26=c+\'px\';a.u.24=a.7E;a.u.25=a.7D}}l(/2B|2C|2D/.1X(1C.1Y)){21.3k=7(a){m b=0,c=0;do{b+=a.2s||0;c+=a.2t||0;l(a.1R==B.1s)l(o.1k(a,\'1h\')==\'2r\')U;a=a.1R}1a(a);k[c,b]}}o.6Q();',[],475,'||||||this|function|||||||||||||return|if|var||Element|extend|Object|||prototype|style|push|||element|||document|length|options|Form||new||arguments|each||null|for|undefined|Ajax|inspect|false|||true|break|else|Prototype||match|||value|include||transport|tagName||window|Methods|Event|while|typeof|case|Class|create|bind|map|position|Abstract|Array|getStyle|Insertion|try|concat|getValue|catch|toLowerCase|Enumerable|body|Selector|offset|initialize||values|toUpperCase|select|Hash|method|navigator|_attributeTranslations|toString|String|gsub|replace|parentNode||apply|throw|stripScripts|inject|toArray|onComplete|observers|offsetParent|innerHTML|childNodes|_each|join|opera|test|userAgent|type|display|Position|key|success|height|width|left||top|disabled|table|tbody|range|name|lastValue|EventObserver|emptyFunction|frequency|registerCallback|onTimerEvent|split|constructor|setTimeout|decay|className|classNames|filter|absolute|offsetTop|offsetLeft|callback|timer|slice|evalScripts|toQueryString|Responders|url|Konqueror|Safari|KHTML|text|||findElement|observe|parseFloat|offsetWidth|offsetHeight|_overflow|insertContent|initializeRange|params|getElements|scrollLeft|scrollTop||clone|strip|createElement|div|nodeValue|Template||pluck|first||||||||remove|start|responders|post|parameters|string|Request|dispatchException|getElementsByTagName|attributes|cumulativeOffset|auto|alpha|_flag|switch|expression|Serializers|xcomp|ycomp|evaluate|ScriptFragment|currentlyExecuting||RegExp|charAt|continue|reverse|encodeURIComponent|ObjectRange|dispatch|Base|setOptions|asynchronous|status|responseText|container|hasClassName|nodeType|none|recursivelyCollect|firstChild|nextSibling|nextSiblings|names|ClassNames|stopObserving|cssFloat|styleFloat|opacity|hidden|relative|overflow||hasAttribute|depth||tag|content||operator|default|serialize|input|TimedObserver|Observer|documentElement|Version|BrowserFeatures|XPath|script|Function|shift|succ|1000|stop|interpret|prepareReplacement|eval|appendChild|toQueryParams|camelize|substring|all|criteria|last|_reverse|flatten|without|end|getTransport|activeRequestCount|application|encoding|Complete|_complete|request|respondToReadyState|onStateChange|getHeader|Updater|failure|update|updater|getElementsByClassName|_nativeExtensions|cache|Simulated|findOrStore|visible|removeChild|selectNodeContents|previousSiblings|findChildElements|readAttribute|getDimensions|add|defaultView|static|MSIE|visibility|_madePositioned|_getAttr|TBODY||HTMLElement|adjacency|insertBefore|set|||reset|textarea|focus|button|optionValue|onElementEvent|attachEvent|appVersion|detachEvent|prepare|page|keys|times|Try|these|PeriodicalExecuter|setInterval|index|stripTags|img|extractScripts|decodeURIComponent|capitalize|Pattern|template|pattern|eachSlice|collect|detect|findAll|size|find|clear|compact|indexOf|reduce|exclusive|XMLHttpRequest|ActiveXObject|XMLHTTP|register|onCreate|contentType|form|Events|get|onreadystatechange|setRequestHeaders|overrideMimeType|readyState|javascript|xml|Content|Gecko|2005|requestHeaders|evalJSON|evalResponse|onException|updateContent|insertion|PeriodicalUpdater|updateComplete|lastText|_getElementsByXPath|class|_extended|toggle|hide|show|outerHTML|ownerDocument|createRange|createContextualFragment|ancestors|descendants|getAttribute|empty|descendantOf|scrollTo|float|getComputedStyle|currentStyle|right|bottom|100|clientWidth|clientHeight|childOf|readonly|title|getAttributeNode|specified|checked|THEAD|||klass|addMethods|Toggle|insertAdjacentHTML|contentFromAnonymousTable|Before|Top|collapse|Bottom|After|parseExpression|compileMatcher|selector|wildcard|buildMatchExpression|findElements|matchElements|serializeElements|disable|blur|enable|findFirstElement|activate|checkbox|radio|inputSelector|selectOne|selectMany|registerFormCallbacks|which|preventDefault|_observeAndCache|addEventListener|unloadCache|keypress|keydown|removeEventListener|includeScrollOffsets|deltaX|deltaY|realOffset|positionedOffset|BODY|withinIncludingScrolloffsets|setLeft|setTop|setWidth|setHeight|_originalLeft|_originalTop|_originalWidth|_originalHeight'.split('|'),0,{}))
|
@@ -0,0 +1 @@
|
|
1
|
+
var Prototype={Version:'1.5.0',BrowserFeatures:{XPath:!!document.evaluate},ScriptFragment:'(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)',emptyFunction:function(){},K:function(a){return a}}var Class={create:function(){return function(){this.initialize.apply(this,arguments)}}}var Abstract=new Object();Object.extend=function(a,b){for(var c in b){a[c]=b[c]}return a}Object.extend(Object,{inspect:function(a){try{if(a===undefined)return'undefined';if(a===null)return'null';return a.inspect?a.inspect():a.toString()}catch(e){if(e instanceof RangeError)return'...';throw e;}},keys:function(a){var b=[];for(var c in a)b.push(c);return b},values:function(a){var b=[];for(var c in a)b.push(a[c]);return b},clone:function(a){return Object.extend({},a)}});Function.prototype.bind=function(){var a=this,b=$A(arguments),c=b.shift();return function(){return a.apply(c,b.concat($A(arguments)))}}Function.prototype.bindAsEventListener=function(b){var c=this,d=$A(arguments),b=d.shift();return function(a){return c.apply(b,[(a||window.event)].concat(d).concat($A(arguments)))}}Object.extend(Number.prototype,{toColorPart:function(){var a=this.toString(16);if(this<16)return'0'+a;return a},succ:function(){return this+1},times:function(a){$R(0,this,true).each(a);return this}});var Try={these:function(){var a;for(var b=0,c=arguments.length;b<c;b++){var d=arguments[b];try{a=d();break}catch(e){}}return a}}var PeriodicalExecuter=Class.create();PeriodicalExecuter.prototype={initialize:function(a,b){this.callback=a;this.frequency=b;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},stop:function(){if(!this.timer)return;clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.callback(this)}finally{this.currentlyExecuting=false}}}}String.interpret=function(a){return a==null?'':String(a)}Object.extend(String.prototype,{gsub:function(a,b){var c='',d=this,f;b=arguments.callee.prepareReplacement(b);while(d.length>0){if(f=d.match(a)){c+=d.slice(0,f.index);c+=String.interpret(b(f));d=d.slice(f.index+f[0].length)}else{c+=d,d=''}}return c},sub:function(b,c,d){c=this.gsub.prepareReplacement(c);d=d===undefined?1:d;return this.gsub(b,function(a){if(--d<0)return a[0];return c(a)})},scan:function(a,b){this.gsub(a,b);return this},truncate:function(a,b){a=a||30;b=b===undefined?'...':b;return this.length>a?this.slice(0,a-b.length)+b:this},strip:function(){return this.replace(/^\s+/,'').replace(/\s+$/,'')},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,'')},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,'img'),'')},extractScripts:function(){var b=new RegExp(Prototype.ScriptFragment,'img');var c=new RegExp(Prototype.ScriptFragment,'im');return(this.match(b)||[]).map(function(a){return(a.match(c)||['',''])[1]})},evalScripts:function(){return this.extractScripts().map(function(a){return eval(a)})},escapeHTML:function(){var a=document.createElement('div');var b=document.createTextNode(this);a.appendChild(b);return a.innerHTML},unescapeHTML:function(){var c=document.createElement('div');c.innerHTML=this.stripTags();return c.childNodes[0]?(c.childNodes.length>1?$A(c.childNodes).inject('',function(a,b){return a+b.nodeValue}):c.childNodes[0].nodeValue):''},toQueryParams:function(f){var g=this.strip().match(/([^?#]*)(#.*)?$/);if(!g)return{};return g[1].split(f||'&').inject({},function(a,b){if((b=b.split('='))[0]){var c=decodeURIComponent(b[0]);var d=b[1]?decodeURIComponent(b[1]):undefined;if(a[c]!==undefined){if(a[c].constructor!=Array)a[c]=[a[c]];if(d)a[c].push(d)}else a[c]=d}return a})},toArray:function(){return this.split('')},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)},camelize:function(){var a=this.split('-'),b=a.length;if(b==1)return a[0];var c=this.charAt(0)=='-'?a[0].charAt(0).toUpperCase()+a[0].substring(1):a[0];for(var d=1;d<b;d++)c+=a[d].charAt(0).toUpperCase()+a[d].substring(1);return c},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()},underscore:function(){return this.gsub(/::/,'/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase()},dasherize:function(){return this.gsub(/_/,'-')},inspect:function(a){var b=this.replace(/\\/g,'\\\\');if(a)return'"'+b.replace(/"/g,'\\"')+'"';else return"'"+b.replace(/'/g,'\\\'')+"'"}});String.prototype.gsub.prepareReplacement=function(b){if(typeof b=='function')return b;var c=new Template(b);return function(a){return c.evaluate(a)}}String.prototype.parseQuery=String.prototype.toQueryParams;var Template=Class.create();Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;Template.prototype={initialize:function(a,b){this.template=a.toString();this.pattern=b||Template.Pattern},evaluate:function(c){return this.template.gsub(this.pattern,function(a){var b=a[1];if(b=='\\')return a[2];return b+String.interpret(c[a[3]])})}}var $break=new Object();var $continue=new Object();var Enumerable={each:function(b){var c=0;try{this._each(function(a){try{b(a,c++)}catch(e){if(e!=$continue)throw e;}})}catch(e){if(e!=$break)throw e;}return this},eachSlice:function(a,b){var c=-a,d=[],f=this.toArray();while((c+=a)<f.length)d.push(f.slice(c,c+a));return d.map(b)},all:function(c){var d=true;this.each(function(a,b){d=d&&!!(c||Prototype.K)(a,b);if(!d)throw $break;});return d},any:function(c){var d=false;this.each(function(a,b){if(d=!!(c||Prototype.K)(a,b))throw $break;});return d},collect:function(c){var d=[];this.each(function(a,b){d.push((c||Prototype.K)(a,b))});return d},detect:function(c){var d;this.each(function(a,b){if(c(a,b)){d=a;throw $break;}});return d},findAll:function(c){var d=[];this.each(function(a,b){if(c(a,b))d.push(a)});return d},grep:function(d,f){var g=[];this.each(function(a,b){var c=a.toString();if(c.match(d))g.push((f||Prototype.K)(a,b))})return g},include:function(b){var c=false;this.each(function(a){if(a==b){c=true;throw $break;}});return c},inGroupsOf:function(b,c){c=c===undefined?null:c;return this.eachSlice(b,function(a){while(a.length<b)a.push(c);return a})},inject:function(c,d){this.each(function(a,b){c=d(c,a,b)});return c},invoke:function(b){var c=$A(arguments).slice(1);return this.map(function(a){return a[b].apply(a,c)})},max:function(c){var d;this.each(function(a,b){a=(c||Prototype.K)(a,b);if(d==undefined||a>=d)d=a});return d},min:function(c){var d;this.each(function(a,b){a=(c||Prototype.K)(a,b);if(d==undefined||a<d)d=a});return d},partition:function(c){var d=[],f=[];this.each(function(a,b){((c||Prototype.K)(a,b)?d:f).push(a)});return[d,f]},pluck:function(c){var d=[];this.each(function(a,b){d.push(a[c])});return d},reject:function(c){var d=[];this.each(function(a,b){if(!c(a,b))d.push(a)});return d},sortBy:function(f){return this.map(function(a,b){return{value:a,criteria:f(a,b)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;return c<d?-1:c>d?1:0}).pluck('value')},toArray:function(){return this.map()},zip:function(){var c=Prototype.K,d=$A(arguments);if(typeof d.last()=='function')c=d.pop();var f=[this].concat(d).map($A);return this.map(function(a,b){return c(f.pluck(b))})},size:function(){return this.toArray().length},inspect:function(){return'#<Enumerable:'+this.toArray().inspect()+'>'}}Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});var $A=Array.from=function(a){if(!a)return[];if(a.toArray){return a.toArray()}else{var b=[];for(var c=0,d=a.length;c<d;c++)b.push(a[c]);return b}}Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse)Array.prototype._reverse=Array.prototype.reverse;Object.extend(Array.prototype,{_each:function(a){for(var b=0,c=this.length;b<c;b++)a(this[b])},clear:function(){this.length=0;return this},first:function(){return this[0]},last:function(){return this[this.length-1]},compact:function(){return this.select(function(a){return a!=null})},flatten:function(){return this.inject([],function(a,b){return a.concat(b&&b.constructor==Array?b.flatten():[b])})},without:function(){var b=$A(arguments);return this.select(function(a){return!b.include(a)})},indexOf:function(a){for(var b=0,c=this.length;b<c;b++)if(this[b]==a)return b;return-1},reverse:function(a){return(a!==false?this:this.toArray())._reverse()},reduce:function(){return this.length>1?this:this[0]},uniq:function(){return this.inject([],function(a,b){return a.include(b)?a:a.concat([b])})},clone:function(){return[].concat(this)},size:function(){return this.length},inspect:function(){return'['+this.map(Object.inspect).join(', ')+']'}});Array.prototype.toArray=Array.prototype.clone;function $w(a){a=a.strip();return a?a.split(/\s+/):[]}if(window.opera){Array.prototype.concat=function(){var a=[];for(var b=0,c=this.length;b<c;b++)a.push(this[b]);for(var b=0,c=arguments.length;b<c;b++){if(arguments[b].constructor==Array){for(var d=0,f=arguments[b].length;d<f;d++)a.push(arguments[b][d])}else{a.push(arguments[b])}}return a}}var Hash=function(a){Object.extend(this,a||{})};Object.extend(Hash,{toQueryString:function(d){var f=[];this.prototype._each.call(d,function(b){if(!b.key)return;if(b.value&&b.value.constructor==Array){var c=b.value.compact();if(c.length<2)b.value=c.reduce();else{key=encodeURIComponent(b.key);c.each(function(a){a=a!=undefined?encodeURIComponent(a):'';f.push(key+'='+encodeURIComponent(a))});return}}if(b.value==undefined)b[1]='';f.push(b.map(encodeURIComponent).join('='))});return f.join('&')}});Object.extend(Hash.prototype,Enumerable);Object.extend(Hash.prototype,{_each:function(a){for(var b in this){var c=this[b];if(c&&c==Hash.prototype[b])continue;var d=[b,c];d.key=b;d.value=c;a(d)}},keys:function(){return this.pluck('key')},values:function(){return this.pluck('value')},merge:function(c){return $H(c).inject(this,function(a,b){a[b.key]=b.value;return a})},remove:function(){var a;for(var b=0,c=arguments.length;b<c;b++){var d=this[arguments[b]];if(d!==undefined){if(a===undefined)a=d;else{if(a.constructor!=Array)a=[a];a.push(d)}}delete this[arguments[b]]}return a},toQueryString:function(){return Hash.toQueryString(this)},inspect:function(){return'#<Hash:{'+this.map(function(a){return a.map(Object.inspect).join(': ')}).join(', ')+'}>'}});function $H(a){if(a&&a.constructor==Hash)return a;return new Hash(a)};ObjectRange=Class.create();Object.extend(ObjectRange.prototype,Enumerable);Object.extend(ObjectRange.prototype,{initialize:function(a,b,c){this.start=a;this.end=b;this.exclusive=c},_each:function(a){var b=this.start;while(this.include(b)){a(b);b=b.succ()}},include:function(a){if(a<this.start)return false;if(this.exclusive)return a<this.end;return a<=this.end}});var $R=function(a,b,c){return new ObjectRange(a,b,c)}var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject('Msxml2.XMLHTTP')},function(){return new ActiveXObject('Microsoft.XMLHTTP')})||false},activeRequestCount:0}Ajax.Responders={responders:[],_each:function(a){this.responders._each(a)},register:function(a){if(!this.include(a))this.responders.push(a)},unregister:function(a){this.responders=this.responders.without(a)},dispatch:function(b,c,d,f){this.each(function(a){if(typeof a[b]=='function'){try{a[b].apply(a,[c,d,f])}catch(e){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=function(){};Ajax.Base.prototype={setOptions:function(a){this.options={method:'post',asynchronous:true,contentType:'application/x-www-form-urlencoded',encoding:'UTF-8',parameters:''}Object.extend(this.options,a||{});this.options.method=this.options.method.toLowerCase();if(typeof this.options.parameters=='string')this.options.parameters=this.options.parameters.toQueryParams()}}Ajax.Request=Class.create();Ajax.Request.Events=['Uninitialized','Loading','Loaded','Interactive','Complete'];Ajax.Request.prototype=Object.extend(new Ajax.Base(),{_complete:false,initialize:function(a,b){this.transport=Ajax.getTransport();this.setOptions(b);this.request(a)},request:function(a){this.url=a;this.method=this.options.method;var b=this.options.parameters;if(!['get','post'].include(this.method)){b['_method']=this.method;this.method='post'}b=Hash.toQueryString(b);if(b&&/Konqueror|Safari|KHTML/.test(navigator.userAgent))b+='&_='if(this.method=='get'&&b)this.url+=(this.url.indexOf('?')>-1?'&':'?')+b;try{Ajax.Responders.dispatch('onCreate',this,this.transport);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous)setTimeout(function(){this.respondToReadyState(1)}.bind(this),10);this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();var c=this.method=='post'?(this.options.postBody||b):null;this.transport.send(c);if(!this.options.asynchronous&&this.transport.overrideMimeType)this.onStateChange()}catch(e){this.dispatchException(e)}},onStateChange:function(){var a=this.transport.readyState;if(a>1&&!((a==4)&&this._complete))this.respondToReadyState(this.transport.readyState)},setRequestHeaders:function(){var b={'X-Requested-With':'XMLHttpRequest','X-Prototype-Version':Prototype.Version,'Accept':'text/javascript, text/html, application/xml, text/xml, */*'};if(this.method=='post'){b['Content-type']=this.options.contentType+(this.options.encoding?'; charset='+this.options.encoding:'');if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005)b['Connection']='close'}if(typeof this.options.requestHeaders=='object'){var c=this.options.requestHeaders;if(typeof c.push=='function')for(var d=0,f=c.length;d<f;d+=2)b[c[d]]=c[d+1];else $H(c).each(function(a){b[a.key]=a.value})}for(var g in b)this.transport.setRequestHeader(g,b[g])},success:function(){return!this.transport.status||(this.transport.status>=200&&this.transport.status<300)},respondToReadyState:function(a){var b=Ajax.Request.Events[a];var c=this.transport,d=this.evalJSON();if(b=='Complete'){try{this._complete=true;(this.options['on'+this.transport.status]||this.options['on'+(this.success()?'Success':'Failure')]||Prototype.emptyFunction)(c,d)}catch(e){this.dispatchException(e)}if((this.getHeader('Content-type')||'text/javascript').strip().match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i))this.evalResponse()}try{(this.options['on'+b]||Prototype.emptyFunction)(c,d);Ajax.Responders.dispatch('on'+b,this,c,d)}catch(e){this.dispatchException(e)}if(b=='Complete'){this.transport.onreadystatechange=Prototype.emptyFunction}},getHeader:function(a){try{return this.transport.getResponseHeader(a)}catch(e){return null}},evalJSON:function(){try{var a=this.getHeader('X-JSON');return a?eval('('+a+')'):null}catch(e){return null}},evalResponse:function(){try{return eval(this.transport.responseText)}catch(e){this.dispatchException(e)}},dispatchException:function(a){(this.options.onException||Prototype.emptyFunction)(this,a);Ajax.Responders.dispatch('onException',this,a)}});Ajax.Updater=Class.create();Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(c,d,f){this.container={success:(c.success||c),failure:(c.failure||(c.success?null:c))}this.transport=Ajax.getTransport();this.setOptions(f);var g=this.options.onComplete||Prototype.emptyFunction;this.options.onComplete=(function(a,b){this.updateContent();g(a,b)}).bind(this);this.request(d)},updateContent:function(){var a=this.container[this.success()?'success':'failure'];var b=this.transport.responseText;if(!this.options.evalScripts)b=b.stripScripts();if(a=$(a)){if(this.options.insertion)new this.options.insertion(a,b);else a.update(b)}if(this.success()){if(this.onComplete)setTimeout(this.onComplete.bind(this),10)}}});Ajax.PeriodicalUpdater=Class.create();Ajax.PeriodicalUpdater.prototype=Object.extend(new Ajax.Base(),{initialize:function(a,b,c){this.setOptions(c);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=a;this.url=b;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(a){if(this.options.decay){this.decay=(a.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=a.responseText}this.timer=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*1000)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(a){if(arguments.length>1){for(var b=0,c=[],d=arguments.length;b<d;b++)c.push($(arguments[b]));return c}if(typeof a=='string')a=document.getElementById(a);return Element.extend(a)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(a,b){var c=[];var d=document.evaluate(a,$(b)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var f=0,g=d.snapshotLength;f<g;f++)c.push(d.snapshotItem(f));return c}}document.getElementsByClassName=function(a,b){if(Prototype.BrowserFeatures.XPath){var c=".//*[contains(concat(' ', @class, ' '), ' "+a+" ')]";return document._getElementsByXPath(c,b)}else{var d=($(b)||document.body).getElementsByTagName('*');var f=[],g;for(var h=0,i=d.length;h<i;h++){g=d[h];if(Element.hasClassName(g,a))f.push(Element.extend(g))}return f}};if(!window.Element)var Element=new Object();Element.extend=function(a){if(!a||_nativeExtensions||a.nodeType==3)return a;if(!a._extended&&a.tagName&&a!=window){var b=Object.clone(Element.Methods),c=Element.extend.cache;if(a.tagName=='FORM')Object.extend(b,Form.Methods);if(['INPUT','TEXTAREA','SELECT'].include(a.tagName))Object.extend(b,Form.Element.Methods);Object.extend(b,Element.Methods.Simulated);for(var d in b){var f=b[d];if(typeof f=='function'&&!(d in a))a[d]=c.findOrStore(f)}}a._extended=true;return a};Element.extend.cache={findOrStore:function(a){return this[a]=this[a]||function(){return a.apply(null,[this].concat($A(arguments)))}}};Element.Methods={visible:function(a){return $(a).style.display!='none'},toggle:function(a){a=$(a);Element[Element.visible(a)?'hide':'show'](a);return a},hide:function(a){$(a).style.display='none';return a},show:function(a){$(a).style.display='';return a},remove:function(a){a=$(a);a.parentNode.removeChild(a);return a},update:function(a,b){b=typeof b=='undefined'?'':b.toString();$(a).innerHTML=b.stripScripts();setTimeout(function(){b.evalScripts()},10);return a},replace:function(a,b){a=$(a);b=typeof b=='undefined'?'':b.toString();if(a.outerHTML){a.outerHTML=b.stripScripts()}else{var c=a.ownerDocument.createRange();c.selectNodeContents(a);a.parentNode.replaceChild(c.createContextualFragment(b.stripScripts()),a)}setTimeout(function(){b.evalScripts()},10);return a},inspect:function(f){f=$(f);var g='<'+f.tagName.toLowerCase();$H({'id':'id','className':'class'}).each(function(a){var b=a.first(),c=a.last();var d=(f[b]||'').toString();if(d)g+=' '+c+'='+d.inspect(true)});return g+'>'},recursivelyCollect:function(a,b){a=$(a);var c=[];while(a=a[b])if(a.nodeType==1)c.push(Element.extend(a));return c},ancestors:function(a){return $(a).recursivelyCollect('parentNode')},descendants:function(a){return $A($(a).getElementsByTagName('*'))},immediateDescendants:function(a){if(!(a=$(a).firstChild))return[];while(a&&a.nodeType!=1)a=a.nextSibling;if(a)return[a].concat($(a).nextSiblings());return[]},previousSiblings:function(a){return $(a).recursivelyCollect('previousSibling')},nextSiblings:function(a){return $(a).recursivelyCollect('nextSibling')},siblings:function(a){a=$(a);return a.previousSiblings().reverse().concat(a.nextSiblings())},match:function(a,b){if(typeof b=='string')b=new Selector(b);return b.match($(a))},up:function(a,b,c){return Selector.findElement($(a).ancestors(),b,c)},down:function(a,b,c){return Selector.findElement($(a).descendants(),b,c)},previous:function(a,b,c){return Selector.findElement($(a).previousSiblings(),b,c)},next:function(a,b,c){return Selector.findElement($(a).nextSiblings(),b,c)},getElementsBySelector:function(){var a=$A(arguments),b=$(a.shift());return Selector.findChildElements(b,a)},getElementsByClassName:function(a,b){return document.getElementsByClassName(b,a)},readAttribute:function(a,b){a=$(a);if(document.all&&!window.opera){var c=Element._attributeTranslations;if(c.values[b])return c.values[b](a,b);if(c.names[b])b=c.names[b];var d=a.attributes[b];if(d)return d.nodeValue}return a.getAttribute(b)},getHeight:function(a){return $(a).getDimensions().height},getWidth:function(a){return $(a).getDimensions().width},classNames:function(a){return new Element.ClassNames(a)},hasClassName:function(a,b){if(!(a=$(a)))return;var c=a.className;if(c.length==0)return false;if(c==b||c.match(new RegExp("(^|\\s)"+b+"(\\s|$)")))return true;return false},addClassName:function(a,b){if(!(a=$(a)))return;Element.classNames(a).add(b);return a},removeClassName:function(a,b){if(!(a=$(a)))return;Element.classNames(a).remove(b);return a},toggleClassName:function(a,b){if(!(a=$(a)))return;Element.classNames(a)[a.hasClassName(b)?'remove':'add'](b);return a},observe:function(){Event.observe.apply(Event,arguments);return $A(arguments).first()},stopObserving:function(){Event.stopObserving.apply(Event,arguments);return $A(arguments).first()},cleanWhitespace:function(a){a=$(a);var b=a.firstChild;while(b){var c=b.nextSibling;if(b.nodeType==3&&!/\S/.test(b.nodeValue))a.removeChild(b);b=c}return a},empty:function(a){return $(a).innerHTML.match(/^\s*$/)},descendantOf:function(a,b){a=$(a),b=$(b);while(a=a.parentNode)if(a==b)return true;return false},scrollTo:function(a){a=$(a);var b=Position.cumulativeOffset(a);window.scrollTo(b[0],b[1]);return a},getStyle:function(a,b){a=$(a);if(['float','cssFloat'].include(b))b=(typeof a.style.styleFloat!='undefined'?'styleFloat':'cssFloat');b=b.camelize();var c=a.style[b];if(!c){if(document.defaultView&&document.defaultView.getComputedStyle){var d=document.defaultView.getComputedStyle(a,null);c=d?d[b]:null}else if(a.currentStyle){c=a.currentStyle[b]}}if((c=='auto')&&['width','height'].include(b)&&(a.getStyle('display')!='none'))c=a['offset'+b.capitalize()]+'px';if(window.opera&&['left','top','right','bottom'].include(b))if(Element.getStyle(a,'position')=='static')c='auto';if(b=='opacity'){if(c)return parseFloat(c);if(c=(a.getStyle('filter')||'').match(/alpha\(opacity=(.*)\)/))if(c[1])return parseFloat(c[1])/100;return 1.0}return c=='auto'?null:c},setStyle:function(a,b){a=$(a);for(var c in b){var d=b[c];if(c=='opacity'){if(d==1){d=(/Gecko/.test(navigator.userAgent)&&!/Konqueror|Safari|KHTML/.test(navigator.userAgent))?0.999999:1.0;if(/MSIE/.test(navigator.userAgent)&&!window.opera)a.style.filter=a.getStyle('filter').replace(/alpha\([^\)]*\)/gi,'')}else if(d==''){if(/MSIE/.test(navigator.userAgent)&&!window.opera)a.style.filter=a.getStyle('filter').replace(/alpha\([^\)]*\)/gi,'')}else{if(d<0.00001)d=0;if(/MSIE/.test(navigator.userAgent)&&!window.opera)a.style.filter=a.getStyle('filter').replace(/alpha\([^\)]*\)/gi,'')+'alpha(opacity='+d*100+')'}}else if(['float','cssFloat'].include(c))c=(typeof a.style.styleFloat!='undefined')?'styleFloat':'cssFloat';a.style[c.camelize()]=d}return a},getDimensions:function(a){a=$(a);var b=$(a).getStyle('display');if(b!='none'&&b!=null)return{width:a.offsetWidth,height:a.offsetHeight};var c=a.style;var d=c.visibility;var f=c.position;var g=c.display;c.visibility='hidden';c.position='absolute';c.display='block';var h=a.clientWidth;var i=a.clientHeight;c.display=g;c.position=f;c.visibility=d;return{width:h,height:i}},makePositioned:function(a){a=$(a);var b=Element.getStyle(a,'position');if(b=='static'||!b){a._madePositioned=true;a.style.position='relative';if(window.opera){a.style.top=0;a.style.left=0}}return a},undoPositioned:function(a){a=$(a);if(a._madePositioned){a._madePositioned=undefined;a.style.position=a.style.top=a.style.left=a.style.bottom=a.style.right=''}return a},makeClipping:function(a){a=$(a);if(a._overflow)return a;a._overflow=a.style.overflow||'auto';if((Element.getStyle(a,'overflow')||'visible')!='hidden')a.style.overflow='hidden';return a},undoClipping:function(a){a=$(a);if(!a._overflow)return a;a.style.overflow=a._overflow=='auto'?'':a._overflow;a._overflow=null;return a}};Object.extend(Element.Methods,{childOf:Element.Methods.descendantOf});Element._attributeTranslations={};Element._attributeTranslations.names={colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",datetime:"dateTime",accesskey:"accessKey",tabindex:"tabIndex",enctype:"encType",maxlength:"maxLength",readonly:"readOnly",longdesc:"longDesc"};Element._attributeTranslations.values={_getAttr:function(a,b){return a.getAttribute(b,2)},_flag:function(a,b){return $(a).hasAttribute(b)?b:null},style:function(a){return a.style.cssText.toLowerCase()},title:function(a){var b=a.getAttributeNode('title');return b.specified?b.nodeValue:null}};Object.extend(Element._attributeTranslations.values,{href:Element._attributeTranslations.values._getAttr,src:Element._attributeTranslations.values._getAttr,disabled:Element._attributeTranslations.values._flag,checked:Element._attributeTranslations.values._flag,readonly:Element._attributeTranslations.values._flag,multiple:Element._attributeTranslations.values._flag});Element.Methods.Simulated={hasAttribute:function(a,b){var c=Element._attributeTranslations;b=c.names[b]||b;return $(a).getAttributeNode(b).specified}};if(document.all&&!window.opera){Element.Methods.update=function(b,c){b=$(b);c=typeof c=='undefined'?'':c.toString();var d=b.tagName.toUpperCase();if(['THEAD','TBODY','TR','TD'].include(d)){var f=document.createElement('div');switch(d){case'THEAD':case'TBODY':f.innerHTML='<table><tbody>'+c.stripScripts()+'</tbody></table>';depth=2;break;case'TR':f.innerHTML='<table><tbody><tr>'+c.stripScripts()+'</tr></tbody></table>';depth=3;break;case'TD':f.innerHTML='<table><tbody><tr><td>'+c.stripScripts()+'</td></tr></tbody></table>';depth=4}$A(b.childNodes).each(function(a){b.removeChild(a)});depth.times(function(){f=f.firstChild});$A(f.childNodes).each(function(a){b.appendChild(a)})}else{b.innerHTML=c.stripScripts()}setTimeout(function(){c.evalScripts()},10);return b}};Object.extend(Element,Element.Methods);var _nativeExtensions=false;if(/Konqueror|Safari|KHTML/.test(navigator.userAgent))['','Form','Input','TextArea','Select'].each(function(tag){var className='HTML'+tag+'Element';if(window[className])return;var klass=window[className]={};klass.prototype=document.createElement(tag?tag.toLowerCase():'div').__proto__});Element.addMethods=function(h){Object.extend(Element.Methods,h||{});function i(a,b,c){c=c||false;var d=Element.extend.cache;for(var f in a){var g=a[f];if(!c||!(f in b))b[f]=d.findOrStore(g)}}if(typeof HTMLElement!='undefined'){i(Element.Methods,HTMLElement.prototype);i(Element.Methods.Simulated,HTMLElement.prototype,true);i(Form.Methods,HTMLFormElement.prototype);[HTMLInputElement,HTMLTextAreaElement,HTMLSelectElement].each(function(a){i(Form.Element.Methods,a.prototype)});_nativeExtensions=true}}var Toggle=new Object();Toggle.display=Element.toggle;Abstract.Insertion=function(a){this.adjacency=a}Abstract.Insertion.prototype={initialize:function(a,b){this.element=$(a);this.content=b.stripScripts();if(this.adjacency&&this.element.insertAdjacentHTML){try{this.element.insertAdjacentHTML(this.adjacency,this.content)}catch(e){var c=this.element.tagName.toUpperCase();if(['TBODY','TR'].include(c)){this.insertContent(this.contentFromAnonymousTable())}else{throw e;}}}else{this.range=this.element.ownerDocument.createRange();if(this.initializeRange)this.initializeRange();this.insertContent([this.range.createContextualFragment(this.content)])}setTimeout(function(){b.evalScripts()},10)},contentFromAnonymousTable:function(){var a=document.createElement('div');a.innerHTML='<table><tbody>'+this.content+'</tbody></table>';return $A(a.childNodes[0].childNodes[0].childNodes)}}var Insertion=new Object();Insertion.Before=Class.create();Insertion.Before.prototype=Object.extend(new Abstract.Insertion('beforeBegin'),{initializeRange:function(){this.range.setStartBefore(this.element)},insertContent:function(b){b.each((function(a){this.element.parentNode.insertBefore(a,this.element)}).bind(this))}});Insertion.Top=Class.create();Insertion.Top.prototype=Object.extend(new Abstract.Insertion('afterBegin'),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(true)},insertContent:function(b){b.reverse(false).each((function(a){this.element.insertBefore(a,this.element.firstChild)}).bind(this))}});Insertion.Bottom=Class.create();Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion('beforeEnd'),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(this.element)},insertContent:function(b){b.each((function(a){this.element.appendChild(a)}).bind(this))}});Insertion.After=Class.create();Insertion.After.prototype=Object.extend(new Abstract.Insertion('afterEnd'),{initializeRange:function(){this.range.setStartAfter(this.element)},insertContent:function(b){b.each((function(a){this.element.parentNode.insertBefore(a,this.element.nextSibling)}).bind(this))}});Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(a){this.element=$(a)},_each:function(b){this.element.className.split(/\s+/).select(function(a){return a.length>0})._each(b)},set:function(a){this.element.className=a},add:function(a){if(this.include(a))return;this.set($A(this).concat(a).join(' '))},remove:function(a){if(!this.include(a))return;this.set($A(this).without(a).join(' '))},toString:function(){return $A(this).join(' ')}};Object.extend(Element.ClassNames.prototype,Enumerable);var Selector=Class.create();Selector.prototype={initialize:function(a){this.params={classNames:[]};this.expression=a.toString().strip();this.parseExpression();this.compileMatcher()},parseExpression:function(){function b(a){throw'Parse error in selector: '+a;}if(this.expression=='')b('empty expression');var c=this.params,d=this.expression,f,g,h,i;while(f=d.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)){c.attributes=c.attributes||[];c.attributes.push({name:f[2],operator:f[3],value:f[4]||f[5]||''});d=f[1]}if(d=='*')return this.params.wildcard=true;while(f=d.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)){g=f[1],h=f[2],i=f[3];switch(g){case'#':c.id=h;break;case'.':c.classNames.push(h);break;case'':case undefined:c.tagName=h.toUpperCase();break;default:b(d.inspect())}d=i}if(d.length>0)b(d.inspect())},buildMatchExpression:function(){var f=this.params,g=[],h;if(f.wildcard)g.push('true');if(h=f.id)g.push('element.readAttribute("id") == '+h.inspect());if(h=f.tagName)g.push('element.tagName.toUpperCase() == '+h.inspect());if((h=f.classNames).length>0)for(var i=0,j=h.length;i<j;i++)g.push('element.hasClassName('+h[i].inspect()+')');if(h=f.attributes){h.each(function(b){var c='element.readAttribute('+b.name.inspect()+')';var d=function(a){return c+' && '+c+'.split('+a.inspect()+')'}switch(b.operator){case'=':g.push(c+' == '+b.value.inspect());break;case'~=':g.push(d(' ')+'.include('+b.value.inspect()+')');break;case'|=':g.push(d('-')+'.first().toUpperCase() == '+b.value.toUpperCase().inspect());break;case'!=':g.push(c+' != '+b.value.inspect());break;case'':case undefined:g.push('element.hasAttribute('+b.name.inspect()+')');break;default:throw'Unknown operator '+b.operator+' in selector';}})}return g.join(' && ')},compileMatcher:function(){this.match=new Function('element','if (!element.tagName) return false; element = $(element); return '+this.buildMatchExpression())},findElements:function(a){var b;if(b=$(this.params.id))if(this.match(b))if(!a||Element.childOf(b,a))return[b];a=(a||document).getElementsByTagName(this.params.tagName||'*');var c=[];for(var d=0,f=a.length;d<f;d++)if(this.match(b=a[d]))c.push(Element.extend(b));return c},toString:function(){return this.expression}}Object.extend(Selector,{matchElements:function(a,b){var c=new Selector(b);return a.select(c.match.bind(c)).map(Element.extend)},findElement:function(a,b,c){if(typeof b=='number')c=b,b=false;return Selector.matchElements(a,b||'*')[c||0]},findChildElements:function(h,i){return i.map(function(g){return g.match(/[^\s"]+(?:"[^"]*"[^\s"]+)*/g).inject([null],function(c,d){var f=new Selector(d);return c.inject([],function(a,b){return a.concat(f.findElements(b||h))})})}).flatten()}});function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(a){$(a).reset();return a},serializeElements:function(f,g){var h=f.inject({},function(a,b){if(!b.disabled&&b.name){var c=b.name,d=$(b).getValue();if(d!=undefined){if(a[c]){if(a[c].constructor!=Array)a[c]=[a[c]];a[c].push(d)}else a[c]=d}}return a});return g?h:Hash.toQueryString(h)}};Form.Methods={serialize:function(a,b){return Form.serializeElements(Form.getElements(a),b)},getElements:function(c){return $A($(c).getElementsByTagName('*')).inject([],function(a,b){if(Form.Element.Serializers[b.tagName.toLowerCase()])a.push(Element.extend(b));return a})},getInputs:function(a,b,c){a=$(a);var d=a.getElementsByTagName('input');if(!b&&!c)return $A(d).map(Element.extend);for(var f=0,g=[],h=d.length;f<h;f++){var i=d[f];if((b&&i.type!=b)||(c&&i.name!=c))continue;g.push(Element.extend(i))}return g},disable:function(b){b=$(b);b.getElements().each(function(a){a.blur();a.disabled='true'});return b},enable:function(b){b=$(b);b.getElements().each(function(a){a.disabled=''});return b},findFirstElement:function(b){return $(b).getElements().find(function(a){return a.type!='hidden'&&!a.disabled&&['input','select','textarea'].include(a.tagName.toLowerCase())})},focusFirstElement:function(a){a=$(a);a.findFirstElement().activate();return a}}Object.extend(Form,Form.Methods);Form.Element={focus:function(a){$(a).focus();return a},select:function(a){$(a).select();return a}}Form.Element.Methods={serialize:function(a){a=$(a);if(!a.disabled&&a.name){var b=a.getValue();if(b!=undefined){var c={};c[a.name]=b;return Hash.toQueryString(c)}}return''},getValue:function(a){a=$(a);var b=a.tagName.toLowerCase();return Form.Element.Serializers[b](a)},clear:function(a){$(a).value='';return a},present:function(a){return $(a).value!=''},activate:function(a){a=$(a);a.focus();if(a.select&&(a.tagName.toLowerCase()!='input'||!['button','reset','submit'].include(a.type)))a.select();return a},disable:function(a){a=$(a);a.disabled=true;return a},enable:function(a){a=$(a);a.blur();a.disabled=false;return a}}Object.extend(Form.Element,Form.Element.Methods);var Field=Form.Element;var $F=Form.Element.getValue;Form.Element.Serializers={input:function(a){switch(a.type.toLowerCase()){case'checkbox':case'radio':return Form.Element.Serializers.inputSelector(a);default:return Form.Element.Serializers.textarea(a)}},inputSelector:function(a){return a.checked?a.value:null},textarea:function(a){return a.value},select:function(a){return this[a.type=='select-one'?'selectOne':'selectMany'](a)},selectOne:function(a){var b=a.selectedIndex;return b>=0?this.optionValue(a.options[b]):null},selectMany:function(a){var b,c=a.length;if(!c)return null;for(var d=0,b=[];d<c;d++){var f=a.options[d];if(f.selected)b.push(this.optionValue(f))}return b},optionValue:function(a){return Element.extend(a).hasAttribute('value')?a.value:a.text}}Abstract.TimedObserver=function(){}Abstract.TimedObserver.prototype={initialize:function(a,b,c){this.frequency=b;this.element=$(a);this.callback=c;this.lastValue=this.getValue();this.registerCallback()},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},onTimerEvent:function(){var a=this.getValue();var b=('string'==typeof this.lastValue&&'string'==typeof a?this.lastValue!=a:String(this.lastValue)!=String(a));if(b){this.callback(this.element,a);this.lastValue=a}}}Form.Element.Observer=Class.create();Form.Element.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.Element.getValue(this.element)}});Form.Observer=Class.create();Form.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.serialize(this.element)}});Abstract.EventObserver=function(){}Abstract.EventObserver.prototype={initialize:function(a,b){this.element=$(a);this.callback=b;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=='form')this.registerFormCallbacks();else this.registerCallback(this.element)},onElementEvent:function(){var a=this.getValue();if(this.lastValue!=a){this.callback(this.element,a);this.lastValue=a}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback.bind(this))},registerCallback:function(a){if(a.type){switch(a.type.toLowerCase()){case'checkbox':case'radio':Event.observe(a,'click',this.onElementEvent.bind(this));break;default:Event.observe(a,'change',this.onElementEvent.bind(this));break}}}}Form.Element.EventObserver=Class.create();Form.Element.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create();Form.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.serialize(this.element)}});if(!window.Event){var Event=new Object()}Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,element:function(a){return a.target||a.srcElement},isLeftClick:function(a){return(((a.which)&&(a.which==1))||((a.button)&&(a.button==1)))},pointerX:function(a){return a.pageX||(a.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft))},pointerY:function(a){return a.pageY||(a.clientY+(document.documentElement.scrollTop||document.body.scrollTop))},stop:function(a){if(a.preventDefault){a.preventDefault();a.stopPropagation()}else{a.returnValue=false;a.cancelBubble=true}},findElement:function(a,b){var c=Event.element(a);while(c.parentNode&&(!c.tagName||(c.tagName.toUpperCase()!=b.toUpperCase())))c=c.parentNode;return c},observers:false,_observeAndCache:function(a,b,c,d){if(!this.observers)this.observers=[];if(a.addEventListener){this.observers.push([a,b,c,d]);a.addEventListener(b,c,d)}else if(a.attachEvent){this.observers.push([a,b,c,d]);a.attachEvent('on'+b,c)}},unloadCache:function(){if(!Event.observers)return;for(var a=0,b=Event.observers.length;a<b;a++){Event.stopObserving.apply(this,Event.observers[a]);Event.observers[a][0]=null}Event.observers=false},observe:function(a,b,c,d){a=$(a);d=d||false;if(b=='keypress'&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||a.attachEvent))b='keydown';Event._observeAndCache(a,b,c,d)},stopObserving:function(a,b,c,d){a=$(a);d=d||false;if(b=='keypress'&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||a.detachEvent))b='keydown';if(a.removeEventListener){a.removeEventListener(b,c,d)}else if(a.detachEvent){try{a.detachEvent('on'+b,c)}catch(e){}}}});if(navigator.appVersion.match(/\bMSIE\b/))Event.observe(window,'unload',Event.unloadCache,false);var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},realOffset:function(a){var b=0,c=0;do{b+=a.scrollTop||0;c+=a.scrollLeft||0;a=a.parentNode}while(a);return[c,b]},cumulativeOffset:function(a){var b=0,c=0;do{b+=a.offsetTop||0;c+=a.offsetLeft||0;a=a.offsetParent}while(a);return[c,b]},positionedOffset:function(a){var b=0,c=0;do{b+=a.offsetTop||0;c+=a.offsetLeft||0;a=a.offsetParent;if(a){if(a.tagName=='BODY')break;var d=Element.getStyle(a,'position');if(d=='relative'||d=='absolute')break}}while(a);return[c,b]},offsetParent:function(a){if(a.offsetParent)return a.offsetParent;if(a==document.body)return a;while((a=a.parentNode)&&a!=document.body)if(Element.getStyle(a,'position')!='static')return a;return document.body},within:function(a,b,c){if(this.includeScrollOffsets)return this.withinIncludingScrolloffsets(a,b,c);this.xcomp=b;this.ycomp=c;this.offset=this.cumulativeOffset(a);return(c>=this.offset[1]&&c<this.offset[1]+a.offsetHeight&&b>=this.offset[0]&&b<this.offset[0]+a.offsetWidth)},withinIncludingScrolloffsets:function(a,b,c){var d=this.realOffset(a);this.xcomp=b+d[0]-this.deltaX;this.ycomp=c+d[1]-this.deltaY;this.offset=this.cumulativeOffset(a);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+a.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+a.offsetWidth)},overlap:function(a,b){if(!a)return 0;if(a=='vertical')return((this.offset[1]+b.offsetHeight)-this.ycomp)/b.offsetHeight;if(a=='horizontal')return((this.offset[0]+b.offsetWidth)-this.xcomp)/b.offsetWidth},page:function(a){var b=0,c=0;var d=a;do{b+=d.offsetTop||0;c+=d.offsetLeft||0;if(d.offsetParent==document.body)if(Element.getStyle(d,'position')=='absolute')break}while(d=d.offsetParent);d=a;do{if(!window.opera||d.tagName=='BODY'){b-=d.scrollTop||0;c-=d.scrollLeft||0}}while(d=d.parentNode);return[c,b]},clone:function(a,b){var c=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{})a=$(a);var d=Position.page(a);b=$(b);var f=[0,0];var g=null;if(Element.getStyle(b,'position')=='absolute'){g=Position.offsetParent(b);f=Position.page(g)}if(g==document.body){f[0]-=document.body.offsetLeft;f[1]-=document.body.offsetTop}if(c.setLeft)b.style.left=(d[0]-f[0]+c.offsetLeft)+'px';if(c.setTop)b.style.top=(d[1]-f[1]+c.offsetTop)+'px';if(c.setWidth)b.style.width=a.offsetWidth+'px';if(c.setHeight)b.style.height=a.offsetHeight+'px'},absolutize:function(a){a=$(a);if(a.style.position=='absolute')return;Position.prepare();var b=Position.positionedOffset(a);var c=b[1];var d=b[0];var f=a.clientWidth;var g=a.clientHeight;a._originalLeft=d-parseFloat(a.style.left||0);a._originalTop=c-parseFloat(a.style.top||0);a._originalWidth=a.style.width;a._originalHeight=a.style.height;a.style.position='absolute';a.style.top=c+'px';a.style.left=d+'px';a.style.width=f+'px';a.style.height=g+'px'},relativize:function(a){a=$(a);if(a.style.position=='relative')return;Position.prepare();a.style.position='relative';var b=parseFloat(a.style.top||0)-(a._originalTop||0);var c=parseFloat(a.style.left||0)-(a._originalLeft||0);a.style.top=b+'px';a.style.left=c+'px';a.style.height=a._originalHeight;a.style.width=a._originalWidth}}if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){Position.cumulativeOffset=function(a){var b=0,c=0;do{b+=a.offsetTop||0;c+=a.offsetLeft||0;if(a.offsetParent==document.body)if(Element.getStyle(a,'position')=='absolute')break;a=a.offsetParent}while(a);return[c,b]}}Element.addMethods();
|
@@ -0,0 +1 @@
|
|
1
|
+
(function(){var i=function(){};var v=YAHOO.util;var E=/^(?:([-]?\d*)(n){1}|(odd|even)$)*([-+]?\d*)$/;i.prototype={document:window.document,attrAliases:{},shorthand:{'\\#(-?[_a-z]+[-\\w]*)':'[id=$1]','\\.(-?[_a-z]+[-\\w]*)':'[class~=$1]'},operators:{'=':function(a,b){return a===b},'!=':function(a,b){return a!==b},'~=':function(a,b){var c=' ';return(c+a+c).indexOf((c+b+c))>-1},'|=':function(a,b){return z('^'+b+'[-]?').test(a)},'^=':function(a,b){return a.indexOf(b)===0},'$=':function(a,b){return a.lastIndexOf(b)===a.length-b.length},'*=':function(a,b){return a.indexOf(b)>-1},'':function(a,b){return a}},pseudos:{'root':function(a){return a===a.ownerDocument.documentElement},'nth-child':function(a,b){return t(a,b)},'nth-last-child':function(a,b){return t(a,b,null,true)},'nth-of-type':function(a,b){return t(a,b,a.tagName)},'nth-last-of-type':function(a,b){return t(a,b,a.tagName,true)},'first-child':function(a){return o(a.parentNode)[0]===a},'last-child':function(a){var b=o(a.parentNode);return b[b.length-1]===a},'first-of-type':function(a,b){return o(a.parentNode,a.tagName.toLowerCase())[0]},'last-of-type':function(a,b){var c=o(a.parentNode,a.tagName.toLowerCase());return c[c.length-1]},'only-child':function(a){var b=o(a.parentNode);return b.length===1&&b[0]===a},'only-of-type':function(a){return o(a.parentNode,a.tagName.toLowerCase()).length===1},'empty':function(a){return a.childNodes.length===0},'not':function(a,b){return!i.test(a,b)},'contains':function(a,b){var c=a.innerText||a.textContent||'';return c.indexOf(b)>-1},'checked':function(a){return a.checked===true}},test:function(a,b){a=i.document.getElementById(a)||a;if(!a){return false}var c=b?b.split(','):[];if(c.length){for(var g=0,f=c.length;g<f;++g){if(n(a,c[g])){return true}}return false}return n(a,b)},filter:function(a,b){a=a||[];var c,g=[],f=u(b);if(!a.item){for(var d=0,h=a.length;d<h;++d){if(!a[d].tagName){c=i.document.getElementById(a[d]);if(c){a[d]=c}else{}}}}g=A(a,u(b)[0]);B();return g},query:function(a,b,c){var g=F(a,b,c);return g}};var F=function(a,b,c,g){var f=(c)?null:[];if(!a){return f}var d=a.split(',');if(d.length>1){var h;for(var l=0,C=d.length;l<C;++l){h=arguments.callee(d[l],b,c,true);f=c?h:f.concat(h)}G();return f}if(b&&!b.nodeName){b=i.document.getElementById(b);if(!b){return f}}b=b||i.document;var k=u(a);var j=k[H(k)],m=[],p,w,x=k.pop()||{};if(j){w=D(j.attributes)}if(w){p=i.document.getElementById(w);if(p&&(b.nodeName=='#document'||I(p,b))){if(n(p,null,j)){if(j===x){m=[p]}else{b=p}}}else{return f}}if(b&&!m.length){m=b.getElementsByTagName(x.tag)}if(m.length){f=A(m,x,c,g)}B();return f};var I=function(){if(document.documentElement.contains&&!YAHOO.env.ua.webkit<422){return function(a,b){return b.contains(a)}}else if(document.documentElement.compareDocumentPosition){return function(a,b){return!!(b.compareDocumentPosition(a)&16)}}else{return function(a,b){var c=a.parentNode;while(c){if(a===c){return true}c=c.parentNode}return false}}}();var A=function(a,b,c,g){var f=c?null:[];for(var d=0,h=a.length;d<h;d++){if(!n(a[d],'',b,g)){continue}if(c){return a[d]}if(g){if(a[d]._found){continue}a[d]._found=true;q[q.length]=a[d]}f[f.length]=a[d]}return f};var n=function(a,b,c,g){c=c||u(b).pop()||{};if(!a.tagName||(c.tag!=='*'&&a.tagName.toUpperCase()!==c.tag)||(g&&a._found)){return false}if(c.attributes.length){var f;for(var d=0,h=c.attributes.length;d<h;++d){f=a.getAttribute(c.attributes[d][0],2);if(f===null||f===undefined){return false}if(i.operators[c.attributes[d][1]]&&!i.operators[c.attributes[d][1]](f,c.attributes[d][2])){return false}}}if(c.pseudos.length){for(var d=0,h=c.pseudos.length;d<h;++d){if(i.pseudos[c.pseudos[d][0]]&&!i.pseudos[c.pseudos[d][0]](a,c.pseudos[d][1])){return false}}}return(c.previous&&c.previous.combinator!==',')?J[c.previous.combinator](a,c):true};var q=[];var s=[];var y={};var G=function(){for(var a=0,b=q.length;a<b;++a){try{delete q[a]._found}catch(e){q[a].removeAttribute('_found')}}q=[]};var B=function(){if(!document.documentElement.children){return function(){for(var a=0,b=s.length;a<b;++a){delete s[a]._children}s=[]}}else return function(){}}();var z=function(a,b){b=b||'';if(!y[a+b]){y[a+b]=new RegExp(a,b)}return y[a+b]};var J={' ':function(a,b){while(a=a.parentNode){if(n(a,'',b.previous)){return true}}return false},'>':function(a,b){return n(a.parentNode,null,b.previous)},'+':function(a,b){var c=a.previousSibling;while(c&&c.nodeType!==1){c=c.previousSibling}if(c&&n(c,null,b.previous)){return true}return false},'~':function(a,b){var c=a.previousSibling;while(c){if(c.nodeType===1&&n(c,null,b.previous)){return true}c=c.previousSibling}return false}};var o=function(){if(document.documentElement.children){return function(a,b){return(b)?a.children.tags(b):a.children||[]}}else{return function(a,b){if(a._children){return a._children}var c=[],g=a.childNodes;for(var f=0,d=g.length;f<d;++f){if(g[f].tagName){if(!b||g[f].tagName.toLowerCase()===b){c[c.length]=g[f]}}}a._children=c;s[s.length]=a;return c}}}();var t=function(a,b,c,g){if(c)c=c.toLowerCase();E.test(b);var f=parseInt(RegExp.$1,10),d=RegExp.$2,h=RegExp.$3,l=parseInt(RegExp.$4,10)||0,C=[];var k=o(a.parentNode,c);if(h){f=2;op='+';d='n';l=(h==='odd')?1:0}else if(isNaN(f)){f=(d)?1:0}if(f===0){if(g){l=k.length-l+1}if(k[l-1]===a){return true}else{return false}}else if(f<0){g=!!g;f=Math.abs(f)}if(!g){for(var j=l-1,m=k.length;j<m;j+=f){if(j>=0&&k[j]===a){return true}}}else{for(var j=k.length-l,m=k.length;j>=0;j-=f){if(j<m&&k[j]===a){return true}}}return false};var D=function(a){for(var b=0,c=a.length;b<c;++b){if(a[b][0]=='id'&&a[b][1]==='='){return a[b][2]}}};var H=function(a){for(var b=0,c=a.length;b<c;++b){if(D(a[b].attributes)){return b}}return-1};var r={tag:/^((?:-?[_a-z]+[\w-]*)|\*)/i,attributes:/^\[([a-z]+\w*)+([~\|\^\$\*!=]=?)?['"]?([^\]]*?)['"]?\]/i,pseudos:/^:([-\w]+)(?:\(['"]?(.+)['"]?\))*/i,combinator:/^\s*([>+~]|\s)\s*/};var u=function(a){var b={},c=[],g,f=false,d;a=K(a);do{f=false;for(var h in r){if(!YAHOO.lang.hasOwnProperty(r,h)){continue}if(h!='tag'&&h!='combinator'){b[h]=b[h]||[]}if(d=r[h].exec(a)){f=true;if(h!='tag'&&h!='combinator'){if(h==='attributes'&&d[1]==='id'){b.id=d[3]}b[h].push(d.slice(1))}else{b[h]=d[1]}a=a.replace(d[0],'');if(h==='combinator'||!a.length){b.attributes=L(b.attributes);b.pseudos=b.pseudos||[];b.tag=b.tag?b.tag.toUpperCase():'*';c.push(b);b={previous:b}}}}}while(f);return c};var L=function(a){var b=i.attrAliases;a=a||[];for(var c=0,g=a.length;c<g;++c){if(b[a[c][0]]){a[c][0]=b[a[c][0]]}if(!a[c][1]){a[c][1]=''}}return a};var K=function(a){var b=i.shorthand;var c=a.match(r.attributes);if(c){a=a.replace(r.attributes,'REPLACED_ATTRIBUTE')}for(var g in b){if(!YAHOO.lang.hasOwnProperty(b,g)){continue}a=a.replace(z(g,'gi'),b[g])}if(c){for(var f=0,d=c.length;f<d;++f){a=a.replace('REPLACED_ATTRIBUTE',c[f])}}return a};i=new i();i.patterns=r;v.Selector=i;if(YAHOO.env.ua.ie){v.Selector.attrAliases['class']='className';v.Selector.attrAliases['for']='htmlFor'}})();YAHOO.register("selector",YAHOO.util.Selector,{version:"2.6.0",build:"1321"});
|
@@ -0,0 +1,833 @@
|
|
1
|
+
// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
2
|
+
// (c) 2005, 2006 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
|
3
|
+
// (c) 2005, 2006 Jon Tirsen (http://www.tirsen.com)
|
4
|
+
// Contributors:
|
5
|
+
// Richard Livsey
|
6
|
+
// Rahul Bhargava
|
7
|
+
// Rob Wills
|
8
|
+
//
|
9
|
+
// script.aculo.us is freely distributable under the terms of an MIT-style license.
|
10
|
+
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
11
|
+
|
12
|
+
// Autocompleter.Base handles all the autocompletion functionality
|
13
|
+
// that's independent of the data source for autocompletion. This
|
14
|
+
// includes drawing the autocompletion menu, observing keyboard
|
15
|
+
// and mouse events, and similar.
|
16
|
+
//
|
17
|
+
// Specific autocompleters need to provide, at the very least,
|
18
|
+
// a getUpdatedChoices function that will be invoked every time
|
19
|
+
// the text inside the monitored textbox changes. This method
|
20
|
+
// should get the text for which to provide autocompletion by
|
21
|
+
// invoking this.getToken(), NOT by directly accessing
|
22
|
+
// this.element.value. This is to allow incremental tokenized
|
23
|
+
// autocompletion. Specific auto-completion logic (AJAX, etc)
|
24
|
+
// belongs in getUpdatedChoices.
|
25
|
+
//
|
26
|
+
// Tokenized incremental autocompletion is enabled automatically
|
27
|
+
// when an autocompleter is instantiated with the 'tokens' option
|
28
|
+
// in the options parameter, e.g.:
|
29
|
+
// new Ajax.Autocompleter('id','upd', '/url/', { tokens: ',' });
|
30
|
+
// will incrementally autocomplete with a comma as the token.
|
31
|
+
// Additionally, ',' in the above example can be replaced with
|
32
|
+
// a token array, e.g. { tokens: [',', '\n'] } which
|
33
|
+
// enables autocompletion on multiple tokens. This is most
|
34
|
+
// useful when one of the tokens is \n (a newline), as it
|
35
|
+
// allows smart autocompletion after linebreaks.
|
36
|
+
|
37
|
+
if(typeof Effect == 'undefined')
|
38
|
+
throw("controls.js requires including script.aculo.us' effects.js library");
|
39
|
+
|
40
|
+
var Autocompleter = {}
|
41
|
+
Autocompleter.Base = function() {};
|
42
|
+
Autocompleter.Base.prototype = {
|
43
|
+
baseInitialize: function(element, update, options) {
|
44
|
+
this.element = $(element);
|
45
|
+
this.update = $(update);
|
46
|
+
this.hasFocus = false;
|
47
|
+
this.changed = false;
|
48
|
+
this.active = false;
|
49
|
+
this.index = 0;
|
50
|
+
this.entryCount = 0;
|
51
|
+
|
52
|
+
if(this.setOptions)
|
53
|
+
this.setOptions(options);
|
54
|
+
else
|
55
|
+
this.options = options || {};
|
56
|
+
|
57
|
+
this.options.paramName = this.options.paramName || this.element.name;
|
58
|
+
this.options.tokens = this.options.tokens || [];
|
59
|
+
this.options.frequency = this.options.frequency || 0.4;
|
60
|
+
this.options.minChars = this.options.minChars || 1;
|
61
|
+
this.options.onShow = this.options.onShow ||
|
62
|
+
function(element, update){
|
63
|
+
if(!update.style.position || update.style.position=='absolute') {
|
64
|
+
update.style.position = 'absolute';
|
65
|
+
Position.clone(element, update, {
|
66
|
+
setHeight: false,
|
67
|
+
offsetTop: element.offsetHeight
|
68
|
+
});
|
69
|
+
}
|
70
|
+
Effect.Appear(update,{duration:0.15});
|
71
|
+
};
|
72
|
+
this.options.onHide = this.options.onHide ||
|
73
|
+
function(element, update){ new Effect.Fade(update,{duration:0.15}) };
|
74
|
+
|
75
|
+
if(typeof(this.options.tokens) == 'string')
|
76
|
+
this.options.tokens = new Array(this.options.tokens);
|
77
|
+
|
78
|
+
this.observer = null;
|
79
|
+
|
80
|
+
this.element.setAttribute('autocomplete','off');
|
81
|
+
|
82
|
+
Element.hide(this.update);
|
83
|
+
|
84
|
+
Event.observe(this.element, "blur", this.onBlur.bindAsEventListener(this));
|
85
|
+
Event.observe(this.element, "keypress", this.onKeyPress.bindAsEventListener(this));
|
86
|
+
},
|
87
|
+
|
88
|
+
show: function() {
|
89
|
+
if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update);
|
90
|
+
if(!this.iefix &&
|
91
|
+
(navigator.appVersion.indexOf('MSIE')>0) &&
|
92
|
+
(navigator.userAgent.indexOf('Opera')<0) &&
|
93
|
+
(Element.getStyle(this.update, 'position')=='absolute')) {
|
94
|
+
new Insertion.After(this.update,
|
95
|
+
'<iframe id="' + this.update.id + '_iefix" '+
|
96
|
+
'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" ' +
|
97
|
+
'src="javascript:false;" frameborder="0" scrolling="no"></iframe>');
|
98
|
+
this.iefix = $(this.update.id+'_iefix');
|
99
|
+
}
|
100
|
+
if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50);
|
101
|
+
},
|
102
|
+
|
103
|
+
fixIEOverlapping: function() {
|
104
|
+
Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)});
|
105
|
+
this.iefix.style.zIndex = 1;
|
106
|
+
this.update.style.zIndex = 2;
|
107
|
+
Element.show(this.iefix);
|
108
|
+
},
|
109
|
+
|
110
|
+
hide: function() {
|
111
|
+
this.stopIndicator();
|
112
|
+
if(Element.getStyle(this.update, 'display')!='none') this.options.onHide(this.element, this.update);
|
113
|
+
if(this.iefix) Element.hide(this.iefix);
|
114
|
+
},
|
115
|
+
|
116
|
+
startIndicator: function() {
|
117
|
+
if(this.options.indicator) Element.show(this.options.indicator);
|
118
|
+
},
|
119
|
+
|
120
|
+
stopIndicator: function() {
|
121
|
+
if(this.options.indicator) Element.hide(this.options.indicator);
|
122
|
+
},
|
123
|
+
|
124
|
+
onKeyPress: function(event) {
|
125
|
+
if(this.active)
|
126
|
+
switch(event.keyCode) {
|
127
|
+
case Event.KEY_TAB:
|
128
|
+
case Event.KEY_RETURN:
|
129
|
+
this.selectEntry();
|
130
|
+
Event.stop(event);
|
131
|
+
case Event.KEY_ESC:
|
132
|
+
this.hide();
|
133
|
+
this.active = false;
|
134
|
+
Event.stop(event);
|
135
|
+
return;
|
136
|
+
case Event.KEY_LEFT:
|
137
|
+
case Event.KEY_RIGHT:
|
138
|
+
return;
|
139
|
+
case Event.KEY_UP:
|
140
|
+
this.markPrevious();
|
141
|
+
this.render();
|
142
|
+
if(navigator.appVersion.indexOf('AppleWebKit')>0) Event.stop(event);
|
143
|
+
return;
|
144
|
+
case Event.KEY_DOWN:
|
145
|
+
this.markNext();
|
146
|
+
this.render();
|
147
|
+
if(navigator.appVersion.indexOf('AppleWebKit')>0) Event.stop(event);
|
148
|
+
return;
|
149
|
+
}
|
150
|
+
else
|
151
|
+
if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN ||
|
152
|
+
(navigator.appVersion.indexOf('AppleWebKit') > 0 && event.keyCode == 0)) return;
|
153
|
+
|
154
|
+
this.changed = true;
|
155
|
+
this.hasFocus = true;
|
156
|
+
|
157
|
+
if(this.observer) clearTimeout(this.observer);
|
158
|
+
this.observer =
|
159
|
+
setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000);
|
160
|
+
},
|
161
|
+
|
162
|
+
activate: function() {
|
163
|
+
this.changed = false;
|
164
|
+
this.hasFocus = true;
|
165
|
+
this.getUpdatedChoices();
|
166
|
+
},
|
167
|
+
|
168
|
+
onHover: function(event) {
|
169
|
+
var element = Event.findElement(event, 'LI');
|
170
|
+
if(this.index != element.autocompleteIndex)
|
171
|
+
{
|
172
|
+
this.index = element.autocompleteIndex;
|
173
|
+
this.render();
|
174
|
+
}
|
175
|
+
Event.stop(event);
|
176
|
+
},
|
177
|
+
|
178
|
+
onClick: function(event) {
|
179
|
+
var element = Event.findElement(event, 'LI');
|
180
|
+
this.index = element.autocompleteIndex;
|
181
|
+
this.selectEntry();
|
182
|
+
this.hide();
|
183
|
+
},
|
184
|
+
|
185
|
+
onBlur: function(event) {
|
186
|
+
// needed to make click events working
|
187
|
+
setTimeout(this.hide.bind(this), 250);
|
188
|
+
this.hasFocus = false;
|
189
|
+
this.active = false;
|
190
|
+
},
|
191
|
+
|
192
|
+
render: function() {
|
193
|
+
if(this.entryCount > 0) {
|
194
|
+
for (var i = 0; i < this.entryCount; i++)
|
195
|
+
this.index==i ?
|
196
|
+
Element.addClassName(this.getEntry(i),"selected") :
|
197
|
+
Element.removeClassName(this.getEntry(i),"selected");
|
198
|
+
|
199
|
+
if(this.hasFocus) {
|
200
|
+
this.show();
|
201
|
+
this.active = true;
|
202
|
+
}
|
203
|
+
} else {
|
204
|
+
this.active = false;
|
205
|
+
this.hide();
|
206
|
+
}
|
207
|
+
},
|
208
|
+
|
209
|
+
markPrevious: function() {
|
210
|
+
if(this.index > 0) this.index--
|
211
|
+
else this.index = this.entryCount-1;
|
212
|
+
this.getEntry(this.index);
|
213
|
+
},
|
214
|
+
|
215
|
+
markNext: function() {
|
216
|
+
if(this.index < this.entryCount-1) this.index++
|
217
|
+
else this.index = 0;
|
218
|
+
this.getEntry(this.index);
|
219
|
+
},
|
220
|
+
|
221
|
+
getEntry: function(index) {
|
222
|
+
return this.update.firstChild.childNodes[index];
|
223
|
+
},
|
224
|
+
|
225
|
+
getCurrentEntry: function() {
|
226
|
+
return this.getEntry(this.index);
|
227
|
+
},
|
228
|
+
|
229
|
+
selectEntry: function() {
|
230
|
+
this.active = false;
|
231
|
+
this.updateElement(this.getCurrentEntry());
|
232
|
+
},
|
233
|
+
|
234
|
+
updateElement: function(selectedElement) {
|
235
|
+
if (this.options.updateElement) {
|
236
|
+
this.options.updateElement(selectedElement);
|
237
|
+
return;
|
238
|
+
}
|
239
|
+
var value = '';
|
240
|
+
if (this.options.select) {
|
241
|
+
var nodes = document.getElementsByClassName(this.options.select, selectedElement) || [];
|
242
|
+
if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select);
|
243
|
+
} else
|
244
|
+
value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal');
|
245
|
+
|
246
|
+
var lastTokenPos = this.findLastToken();
|
247
|
+
if (lastTokenPos != -1) {
|
248
|
+
var newValue = this.element.value.substr(0, lastTokenPos + 1);
|
249
|
+
var whitespace = this.element.value.substr(lastTokenPos + 1).match(/^\s+/);
|
250
|
+
if (whitespace)
|
251
|
+
newValue += whitespace[0];
|
252
|
+
this.element.value = newValue + value;
|
253
|
+
} else {
|
254
|
+
this.element.value = value;
|
255
|
+
}
|
256
|
+
this.element.focus();
|
257
|
+
|
258
|
+
if (this.options.afterUpdateElement)
|
259
|
+
this.options.afterUpdateElement(this.element, selectedElement);
|
260
|
+
},
|
261
|
+
|
262
|
+
updateChoices: function(choices) {
|
263
|
+
if(!this.changed && this.hasFocus) {
|
264
|
+
this.update.innerHTML = choices;
|
265
|
+
Element.cleanWhitespace(this.update);
|
266
|
+
Element.cleanWhitespace(this.update.down());
|
267
|
+
|
268
|
+
if(this.update.firstChild && this.update.down().childNodes) {
|
269
|
+
this.entryCount =
|
270
|
+
this.update.down().childNodes.length;
|
271
|
+
for (var i = 0; i < this.entryCount; i++) {
|
272
|
+
var entry = this.getEntry(i);
|
273
|
+
entry.autocompleteIndex = i;
|
274
|
+
this.addObservers(entry);
|
275
|
+
}
|
276
|
+
} else {
|
277
|
+
this.entryCount = 0;
|
278
|
+
}
|
279
|
+
|
280
|
+
this.stopIndicator();
|
281
|
+
this.index = 0;
|
282
|
+
|
283
|
+
if(this.entryCount==1 && this.options.autoSelect) {
|
284
|
+
this.selectEntry();
|
285
|
+
this.hide();
|
286
|
+
} else {
|
287
|
+
this.render();
|
288
|
+
}
|
289
|
+
}
|
290
|
+
},
|
291
|
+
|
292
|
+
addObservers: function(element) {
|
293
|
+
Event.observe(element, "mouseover", this.onHover.bindAsEventListener(this));
|
294
|
+
Event.observe(element, "click", this.onClick.bindAsEventListener(this));
|
295
|
+
},
|
296
|
+
|
297
|
+
onObserverEvent: function() {
|
298
|
+
this.changed = false;
|
299
|
+
if(this.getToken().length>=this.options.minChars) {
|
300
|
+
this.startIndicator();
|
301
|
+
this.getUpdatedChoices();
|
302
|
+
} else {
|
303
|
+
this.active = false;
|
304
|
+
this.hide();
|
305
|
+
}
|
306
|
+
},
|
307
|
+
|
308
|
+
getToken: function() {
|
309
|
+
var tokenPos = this.findLastToken();
|
310
|
+
if (tokenPos != -1)
|
311
|
+
var ret = this.element.value.substr(tokenPos + 1).replace(/^\s+/,'').replace(/\s+$/,'');
|
312
|
+
else
|
313
|
+
var ret = this.element.value;
|
314
|
+
|
315
|
+
return /\n/.test(ret) ? '' : ret;
|
316
|
+
},
|
317
|
+
|
318
|
+
findLastToken: function() {
|
319
|
+
var lastTokenPos = -1;
|
320
|
+
|
321
|
+
for (var i=0; i<this.options.tokens.length; i++) {
|
322
|
+
var thisTokenPos = this.element.value.lastIndexOf(this.options.tokens[i]);
|
323
|
+
if (thisTokenPos > lastTokenPos)
|
324
|
+
lastTokenPos = thisTokenPos;
|
325
|
+
}
|
326
|
+
return lastTokenPos;
|
327
|
+
}
|
328
|
+
}
|
329
|
+
|
330
|
+
Ajax.Autocompleter = Class.create();
|
331
|
+
Object.extend(Object.extend(Ajax.Autocompleter.prototype, Autocompleter.Base.prototype), {
|
332
|
+
initialize: function(element, update, url, options) {
|
333
|
+
this.baseInitialize(element, update, options);
|
334
|
+
this.options.asynchronous = true;
|
335
|
+
this.options.onComplete = this.onComplete.bind(this);
|
336
|
+
this.options.defaultParams = this.options.parameters || null;
|
337
|
+
this.url = url;
|
338
|
+
},
|
339
|
+
|
340
|
+
getUpdatedChoices: function() {
|
341
|
+
entry = encodeURIComponent(this.options.paramName) + '=' +
|
342
|
+
encodeURIComponent(this.getToken());
|
343
|
+
|
344
|
+
this.options.parameters = this.options.callback ?
|
345
|
+
this.options.callback(this.element, entry) : entry;
|
346
|
+
|
347
|
+
if(this.options.defaultParams)
|
348
|
+
this.options.parameters += '&' + this.options.defaultParams;
|
349
|
+
|
350
|
+
new Ajax.Request(this.url, this.options);
|
351
|
+
},
|
352
|
+
|
353
|
+
onComplete: function(request) {
|
354
|
+
this.updateChoices(request.responseText);
|
355
|
+
}
|
356
|
+
|
357
|
+
});
|
358
|
+
|
359
|
+
// The local array autocompleter. Used when you'd prefer to
|
360
|
+
// inject an array of autocompletion options into the page, rather
|
361
|
+
// than sending out Ajax queries, which can be quite slow sometimes.
|
362
|
+
//
|
363
|
+
// The constructor takes four parameters. The first two are, as usual,
|
364
|
+
// the id of the monitored textbox, and id of the autocompletion menu.
|
365
|
+
// The third is the array you want to autocomplete from, and the fourth
|
366
|
+
// is the options block.
|
367
|
+
//
|
368
|
+
// Extra local autocompletion options:
|
369
|
+
// - choices - How many autocompletion choices to offer
|
370
|
+
//
|
371
|
+
// - partialSearch - If false, the autocompleter will match entered
|
372
|
+
// text only at the beginning of strings in the
|
373
|
+
// autocomplete array. Defaults to true, which will
|
374
|
+
// match text at the beginning of any *word* in the
|
375
|
+
// strings in the autocomplete array. If you want to
|
376
|
+
// search anywhere in the string, additionally set
|
377
|
+
// the option fullSearch to true (default: off).
|
378
|
+
//
|
379
|
+
// - fullSsearch - Search anywhere in autocomplete array strings.
|
380
|
+
//
|
381
|
+
// - partialChars - How many characters to enter before triggering
|
382
|
+
// a partial match (unlike minChars, which defines
|
383
|
+
// how many characters are required to do any match
|
384
|
+
// at all). Defaults to 2.
|
385
|
+
//
|
386
|
+
// - ignoreCase - Whether to ignore case when autocompleting.
|
387
|
+
// Defaults to true.
|
388
|
+
//
|
389
|
+
// It's possible to pass in a custom function as the 'selector'
|
390
|
+
// option, if you prefer to write your own autocompletion logic.
|
391
|
+
// In that case, the other options above will not apply unless
|
392
|
+
// you support them.
|
393
|
+
|
394
|
+
Autocompleter.Local = Class.create();
|
395
|
+
Autocompleter.Local.prototype = Object.extend(new Autocompleter.Base(), {
|
396
|
+
initialize: function(element, update, array, options) {
|
397
|
+
this.baseInitialize(element, update, options);
|
398
|
+
this.options.array = array;
|
399
|
+
},
|
400
|
+
|
401
|
+
getUpdatedChoices: function() {
|
402
|
+
this.updateChoices(this.options.selector(this));
|
403
|
+
},
|
404
|
+
|
405
|
+
setOptions: function(options) {
|
406
|
+
this.options = Object.extend({
|
407
|
+
choices: 10,
|
408
|
+
partialSearch: true,
|
409
|
+
partialChars: 2,
|
410
|
+
ignoreCase: true,
|
411
|
+
fullSearch: false,
|
412
|
+
selector: function(instance) {
|
413
|
+
var ret = []; // Beginning matches
|
414
|
+
var partial = []; // Inside matches
|
415
|
+
var entry = instance.getToken();
|
416
|
+
var count = 0;
|
417
|
+
|
418
|
+
for (var i = 0; i < instance.options.array.length &&
|
419
|
+
ret.length < instance.options.choices ; i++) {
|
420
|
+
|
421
|
+
var elem = instance.options.array[i];
|
422
|
+
var foundPos = instance.options.ignoreCase ?
|
423
|
+
elem.toLowerCase().indexOf(entry.toLowerCase()) :
|
424
|
+
elem.indexOf(entry);
|
425
|
+
|
426
|
+
while (foundPos != -1) {
|
427
|
+
if (foundPos == 0 && elem.length != entry.length) {
|
428
|
+
ret.push("<li><strong>" + elem.substr(0, entry.length) + "</strong>" +
|
429
|
+
elem.substr(entry.length) + "</li>");
|
430
|
+
break;
|
431
|
+
} else if (entry.length >= instance.options.partialChars &&
|
432
|
+
instance.options.partialSearch && foundPos != -1) {
|
433
|
+
if (instance.options.fullSearch || /\s/.test(elem.substr(foundPos-1,1))) {
|
434
|
+
partial.push("<li>" + elem.substr(0, foundPos) + "<strong>" +
|
435
|
+
elem.substr(foundPos, entry.length) + "</strong>" + elem.substr(
|
436
|
+
foundPos + entry.length) + "</li>");
|
437
|
+
break;
|
438
|
+
}
|
439
|
+
}
|
440
|
+
|
441
|
+
foundPos = instance.options.ignoreCase ?
|
442
|
+
elem.toLowerCase().indexOf(entry.toLowerCase(), foundPos + 1) :
|
443
|
+
elem.indexOf(entry, foundPos + 1);
|
444
|
+
|
445
|
+
}
|
446
|
+
}
|
447
|
+
if (partial.length)
|
448
|
+
ret = ret.concat(partial.slice(0, instance.options.choices - ret.length))
|
449
|
+
return "<ul>" + ret.join('') + "</ul>";
|
450
|
+
}
|
451
|
+
}, options || {});
|
452
|
+
}
|
453
|
+
});
|
454
|
+
|
455
|
+
// AJAX in-place editor
|
456
|
+
//
|
457
|
+
// see documentation on http://wiki.script.aculo.us/scriptaculous/show/Ajax.InPlaceEditor
|
458
|
+
|
459
|
+
// Use this if you notice weird scrolling problems on some browsers,
|
460
|
+
// the DOM might be a bit confused when this gets called so do this
|
461
|
+
// waits 1 ms (with setTimeout) until it does the activation
|
462
|
+
Field.scrollFreeActivate = function(field) {
|
463
|
+
setTimeout(function() {
|
464
|
+
Field.activate(field);
|
465
|
+
}, 1);
|
466
|
+
}
|
467
|
+
|
468
|
+
Ajax.InPlaceEditor = Class.create();
|
469
|
+
Ajax.InPlaceEditor.defaultHighlightColor = "#FFFF99";
|
470
|
+
Ajax.InPlaceEditor.prototype = {
|
471
|
+
initialize: function(element, url, options) {
|
472
|
+
this.url = url;
|
473
|
+
this.element = $(element);
|
474
|
+
|
475
|
+
this.options = Object.extend({
|
476
|
+
paramName: "value",
|
477
|
+
okButton: true,
|
478
|
+
okText: "ok",
|
479
|
+
cancelLink: true,
|
480
|
+
cancelText: "cancel",
|
481
|
+
savingText: "Saving...",
|
482
|
+
clickToEditText: "Click to edit",
|
483
|
+
okText: "ok",
|
484
|
+
rows: 1,
|
485
|
+
onComplete: function(transport, element) {
|
486
|
+
new Effect.Highlight(element, {startcolor: this.options.highlightcolor});
|
487
|
+
},
|
488
|
+
onFailure: function(transport) {
|
489
|
+
alert("Error communicating with the server: " + transport.responseText.stripTags());
|
490
|
+
},
|
491
|
+
callback: function(form) {
|
492
|
+
return Form.serialize(form);
|
493
|
+
},
|
494
|
+
handleLineBreaks: true,
|
495
|
+
loadingText: 'Loading...',
|
496
|
+
savingClassName: 'inplaceeditor-saving',
|
497
|
+
loadingClassName: 'inplaceeditor-loading',
|
498
|
+
formClassName: 'inplaceeditor-form',
|
499
|
+
highlightcolor: Ajax.InPlaceEditor.defaultHighlightColor,
|
500
|
+
highlightendcolor: "#FFFFFF",
|
501
|
+
externalControl: null,
|
502
|
+
submitOnBlur: false,
|
503
|
+
ajaxOptions: {},
|
504
|
+
evalScripts: false
|
505
|
+
}, options || {});
|
506
|
+
|
507
|
+
if(!this.options.formId && this.element.id) {
|
508
|
+
this.options.formId = this.element.id + "-inplaceeditor";
|
509
|
+
if ($(this.options.formId)) {
|
510
|
+
// there's already a form with that name, don't specify an id
|
511
|
+
this.options.formId = null;
|
512
|
+
}
|
513
|
+
}
|
514
|
+
|
515
|
+
if (this.options.externalControl) {
|
516
|
+
this.options.externalControl = $(this.options.externalControl);
|
517
|
+
}
|
518
|
+
|
519
|
+
this.originalBackground = Element.getStyle(this.element, 'background-color');
|
520
|
+
if (!this.originalBackground) {
|
521
|
+
this.originalBackground = "transparent";
|
522
|
+
}
|
523
|
+
|
524
|
+
this.element.title = this.options.clickToEditText;
|
525
|
+
|
526
|
+
this.onclickListener = this.enterEditMode.bindAsEventListener(this);
|
527
|
+
this.mouseoverListener = this.enterHover.bindAsEventListener(this);
|
528
|
+
this.mouseoutListener = this.leaveHover.bindAsEventListener(this);
|
529
|
+
Event.observe(this.element, 'click', this.onclickListener);
|
530
|
+
Event.observe(this.element, 'mouseover', this.mouseoverListener);
|
531
|
+
Event.observe(this.element, 'mouseout', this.mouseoutListener);
|
532
|
+
if (this.options.externalControl) {
|
533
|
+
Event.observe(this.options.externalControl, 'click', this.onclickListener);
|
534
|
+
Event.observe(this.options.externalControl, 'mouseover', this.mouseoverListener);
|
535
|
+
Event.observe(this.options.externalControl, 'mouseout', this.mouseoutListener);
|
536
|
+
}
|
537
|
+
},
|
538
|
+
enterEditMode: function(evt) {
|
539
|
+
if (this.saving) return;
|
540
|
+
if (this.editing) return;
|
541
|
+
this.editing = true;
|
542
|
+
this.onEnterEditMode();
|
543
|
+
if (this.options.externalControl) {
|
544
|
+
Element.hide(this.options.externalControl);
|
545
|
+
}
|
546
|
+
Element.hide(this.element);
|
547
|
+
this.createForm();
|
548
|
+
this.element.parentNode.insertBefore(this.form, this.element);
|
549
|
+
if (!this.options.loadTextURL) Field.scrollFreeActivate(this.editField);
|
550
|
+
// stop the event to avoid a page refresh in Safari
|
551
|
+
if (evt) {
|
552
|
+
Event.stop(evt);
|
553
|
+
}
|
554
|
+
return false;
|
555
|
+
},
|
556
|
+
createForm: function() {
|
557
|
+
this.form = document.createElement("form");
|
558
|
+
this.form.id = this.options.formId;
|
559
|
+
Element.addClassName(this.form, this.options.formClassName)
|
560
|
+
this.form.onsubmit = this.onSubmit.bind(this);
|
561
|
+
|
562
|
+
this.createEditField();
|
563
|
+
|
564
|
+
if (this.options.textarea) {
|
565
|
+
var br = document.createElement("br");
|
566
|
+
this.form.appendChild(br);
|
567
|
+
}
|
568
|
+
|
569
|
+
if (this.options.okButton) {
|
570
|
+
okButton = document.createElement("input");
|
571
|
+
okButton.type = "submit";
|
572
|
+
okButton.value = this.options.okText;
|
573
|
+
okButton.className = 'editor_ok_button';
|
574
|
+
this.form.appendChild(okButton);
|
575
|
+
}
|
576
|
+
|
577
|
+
if (this.options.cancelLink) {
|
578
|
+
cancelLink = document.createElement("a");
|
579
|
+
cancelLink.href = "#";
|
580
|
+
cancelLink.appendChild(document.createTextNode(this.options.cancelText));
|
581
|
+
cancelLink.onclick = this.onclickCancel.bind(this);
|
582
|
+
cancelLink.className = 'editor_cancel';
|
583
|
+
this.form.appendChild(cancelLink);
|
584
|
+
}
|
585
|
+
},
|
586
|
+
hasHTMLLineBreaks: function(string) {
|
587
|
+
if (!this.options.handleLineBreaks) return false;
|
588
|
+
return string.match(/<br/i) || string.match(/<p>/i);
|
589
|
+
},
|
590
|
+
convertHTMLLineBreaks: function(string) {
|
591
|
+
return string.replace(/<br>/gi, "\n").replace(/<br\/>/gi, "\n").replace(/<\/p>/gi, "\n").replace(/<p>/gi, "");
|
592
|
+
},
|
593
|
+
createEditField: function() {
|
594
|
+
var text;
|
595
|
+
if(this.options.loadTextURL) {
|
596
|
+
text = this.options.loadingText;
|
597
|
+
} else {
|
598
|
+
text = this.getText();
|
599
|
+
}
|
600
|
+
|
601
|
+
var obj = this;
|
602
|
+
|
603
|
+
if (this.options.rows == 1 && !this.hasHTMLLineBreaks(text)) {
|
604
|
+
this.options.textarea = false;
|
605
|
+
var textField = document.createElement("input");
|
606
|
+
textField.obj = this;
|
607
|
+
textField.type = "text";
|
608
|
+
textField.name = this.options.paramName;
|
609
|
+
textField.value = text;
|
610
|
+
textField.style.backgroundColor = this.options.highlightcolor;
|
611
|
+
textField.className = 'editor_field';
|
612
|
+
var size = this.options.size || this.options.cols || 0;
|
613
|
+
if (size != 0) textField.size = size;
|
614
|
+
if (this.options.submitOnBlur)
|
615
|
+
textField.onblur = this.onSubmit.bind(this);
|
616
|
+
this.editField = textField;
|
617
|
+
} else {
|
618
|
+
this.options.textarea = true;
|
619
|
+
var textArea = document.createElement("textarea");
|
620
|
+
textArea.obj = this;
|
621
|
+
textArea.name = this.options.paramName;
|
622
|
+
textArea.value = this.convertHTMLLineBreaks(text);
|
623
|
+
textArea.rows = this.options.rows;
|
624
|
+
textArea.cols = this.options.cols || 40;
|
625
|
+
textArea.className = 'editor_field';
|
626
|
+
if (this.options.submitOnBlur)
|
627
|
+
textArea.onblur = this.onSubmit.bind(this);
|
628
|
+
this.editField = textArea;
|
629
|
+
}
|
630
|
+
|
631
|
+
if(this.options.loadTextURL) {
|
632
|
+
this.loadExternalText();
|
633
|
+
}
|
634
|
+
this.form.appendChild(this.editField);
|
635
|
+
},
|
636
|
+
getText: function() {
|
637
|
+
return this.element.innerHTML;
|
638
|
+
},
|
639
|
+
loadExternalText: function() {
|
640
|
+
Element.addClassName(this.form, this.options.loadingClassName);
|
641
|
+
this.editField.disabled = true;
|
642
|
+
new Ajax.Request(
|
643
|
+
this.options.loadTextURL,
|
644
|
+
Object.extend({
|
645
|
+
asynchronous: true,
|
646
|
+
onComplete: this.onLoadedExternalText.bind(this)
|
647
|
+
}, this.options.ajaxOptions)
|
648
|
+
);
|
649
|
+
},
|
650
|
+
onLoadedExternalText: function(transport) {
|
651
|
+
Element.removeClassName(this.form, this.options.loadingClassName);
|
652
|
+
this.editField.disabled = false;
|
653
|
+
this.editField.value = transport.responseText.stripTags();
|
654
|
+
Field.scrollFreeActivate(this.editField);
|
655
|
+
},
|
656
|
+
onclickCancel: function() {
|
657
|
+
this.onComplete();
|
658
|
+
this.leaveEditMode();
|
659
|
+
return false;
|
660
|
+
},
|
661
|
+
onFailure: function(transport) {
|
662
|
+
this.options.onFailure(transport);
|
663
|
+
if (this.oldInnerHTML) {
|
664
|
+
this.element.innerHTML = this.oldInnerHTML;
|
665
|
+
this.oldInnerHTML = null;
|
666
|
+
}
|
667
|
+
return false;
|
668
|
+
},
|
669
|
+
onSubmit: function() {
|
670
|
+
// onLoading resets these so we need to save them away for the Ajax call
|
671
|
+
var form = this.form;
|
672
|
+
var value = this.editField.value;
|
673
|
+
|
674
|
+
// do this first, sometimes the ajax call returns before we get a chance to switch on Saving...
|
675
|
+
// which means this will actually switch on Saving... *after* we've left edit mode causing Saving...
|
676
|
+
// to be displayed indefinitely
|
677
|
+
this.onLoading();
|
678
|
+
|
679
|
+
if (this.options.evalScripts) {
|
680
|
+
new Ajax.Request(
|
681
|
+
this.url, Object.extend({
|
682
|
+
parameters: this.options.callback(form, value),
|
683
|
+
onComplete: this.onComplete.bind(this),
|
684
|
+
onFailure: this.onFailure.bind(this),
|
685
|
+
asynchronous:true,
|
686
|
+
evalScripts:true
|
687
|
+
}, this.options.ajaxOptions));
|
688
|
+
} else {
|
689
|
+
new Ajax.Updater(
|
690
|
+
{ success: this.element,
|
691
|
+
// don't update on failure (this could be an option)
|
692
|
+
failure: null },
|
693
|
+
this.url, Object.extend({
|
694
|
+
parameters: this.options.callback(form, value),
|
695
|
+
onComplete: this.onComplete.bind(this),
|
696
|
+
onFailure: this.onFailure.bind(this)
|
697
|
+
}, this.options.ajaxOptions));
|
698
|
+
}
|
699
|
+
// stop the event to avoid a page refresh in Safari
|
700
|
+
if (arguments.length > 1) {
|
701
|
+
Event.stop(arguments[0]);
|
702
|
+
}
|
703
|
+
return false;
|
704
|
+
},
|
705
|
+
onLoading: function() {
|
706
|
+
this.saving = true;
|
707
|
+
this.removeForm();
|
708
|
+
this.leaveHover();
|
709
|
+
this.showSaving();
|
710
|
+
},
|
711
|
+
showSaving: function() {
|
712
|
+
this.oldInnerHTML = this.element.innerHTML;
|
713
|
+
this.element.innerHTML = this.options.savingText;
|
714
|
+
Element.addClassName(this.element, this.options.savingClassName);
|
715
|
+
this.element.style.backgroundColor = this.originalBackground;
|
716
|
+
Element.show(this.element);
|
717
|
+
},
|
718
|
+
removeForm: function() {
|
719
|
+
if(this.form) {
|
720
|
+
if (this.form.parentNode) Element.remove(this.form);
|
721
|
+
this.form = null;
|
722
|
+
}
|
723
|
+
},
|
724
|
+
enterHover: function() {
|
725
|
+
if (this.saving) return;
|
726
|
+
this.element.style.backgroundColor = this.options.highlightcolor;
|
727
|
+
if (this.effect) {
|
728
|
+
this.effect.cancel();
|
729
|
+
}
|
730
|
+
Element.addClassName(this.element, this.options.hoverClassName)
|
731
|
+
},
|
732
|
+
leaveHover: function() {
|
733
|
+
if (this.options.backgroundColor) {
|
734
|
+
this.element.style.backgroundColor = this.oldBackground;
|
735
|
+
}
|
736
|
+
Element.removeClassName(this.element, this.options.hoverClassName)
|
737
|
+
if (this.saving) return;
|
738
|
+
this.effect = new Effect.Highlight(this.element, {
|
739
|
+
startcolor: this.options.highlightcolor,
|
740
|
+
endcolor: this.options.highlightendcolor,
|
741
|
+
restorecolor: this.originalBackground
|
742
|
+
});
|
743
|
+
},
|
744
|
+
leaveEditMode: function() {
|
745
|
+
Element.removeClassName(this.element, this.options.savingClassName);
|
746
|
+
this.removeForm();
|
747
|
+
this.leaveHover();
|
748
|
+
this.element.style.backgroundColor = this.originalBackground;
|
749
|
+
Element.show(this.element);
|
750
|
+
if (this.options.externalControl) {
|
751
|
+
Element.show(this.options.externalControl);
|
752
|
+
}
|
753
|
+
this.editing = false;
|
754
|
+
this.saving = false;
|
755
|
+
this.oldInnerHTML = null;
|
756
|
+
this.onLeaveEditMode();
|
757
|
+
},
|
758
|
+
onComplete: function(transport) {
|
759
|
+
this.leaveEditMode();
|
760
|
+
this.options.onComplete.bind(this)(transport, this.element);
|
761
|
+
},
|
762
|
+
onEnterEditMode: function() {},
|
763
|
+
onLeaveEditMode: function() {},
|
764
|
+
dispose: function() {
|
765
|
+
if (this.oldInnerHTML) {
|
766
|
+
this.element.innerHTML = this.oldInnerHTML;
|
767
|
+
}
|
768
|
+
this.leaveEditMode();
|
769
|
+
Event.stopObserving(this.element, 'click', this.onclickListener);
|
770
|
+
Event.stopObserving(this.element, 'mouseover', this.mouseoverListener);
|
771
|
+
Event.stopObserving(this.element, 'mouseout', this.mouseoutListener);
|
772
|
+
if (this.options.externalControl) {
|
773
|
+
Event.stopObserving(this.options.externalControl, 'click', this.onclickListener);
|
774
|
+
Event.stopObserving(this.options.externalControl, 'mouseover', this.mouseoverListener);
|
775
|
+
Event.stopObserving(this.options.externalControl, 'mouseout', this.mouseoutListener);
|
776
|
+
}
|
777
|
+
}
|
778
|
+
};
|
779
|
+
|
780
|
+
Ajax.InPlaceCollectionEditor = Class.create();
|
781
|
+
Object.extend(Ajax.InPlaceCollectionEditor.prototype, Ajax.InPlaceEditor.prototype);
|
782
|
+
Object.extend(Ajax.InPlaceCollectionEditor.prototype, {
|
783
|
+
createEditField: function() {
|
784
|
+
if (!this.cached_selectTag) {
|
785
|
+
var selectTag = document.createElement("select");
|
786
|
+
var collection = this.options.collection || [];
|
787
|
+
var optionTag;
|
788
|
+
collection.each(function(e,i) {
|
789
|
+
optionTag = document.createElement("option");
|
790
|
+
optionTag.value = (e instanceof Array) ? e[0] : e;
|
791
|
+
if((typeof this.options.value == 'undefined') &&
|
792
|
+
((e instanceof Array) ? this.element.innerHTML == e[1] : e == optionTag.value)) optionTag.selected = true;
|
793
|
+
if(this.options.value==optionTag.value) optionTag.selected = true;
|
794
|
+
optionTag.appendChild(document.createTextNode((e instanceof Array) ? e[1] : e));
|
795
|
+
selectTag.appendChild(optionTag);
|
796
|
+
}.bind(this));
|
797
|
+
this.cached_selectTag = selectTag;
|
798
|
+
}
|
799
|
+
|
800
|
+
this.editField = this.cached_selectTag;
|
801
|
+
if(this.options.loadTextURL) this.loadExternalText();
|
802
|
+
this.form.appendChild(this.editField);
|
803
|
+
this.options.callback = function(form, value) {
|
804
|
+
return "value=" + encodeURIComponent(value);
|
805
|
+
}
|
806
|
+
}
|
807
|
+
});
|
808
|
+
|
809
|
+
// Delayed observer, like Form.Element.Observer,
|
810
|
+
// but waits for delay after last key input
|
811
|
+
// Ideal for live-search fields
|
812
|
+
|
813
|
+
Form.Element.DelayedObserver = Class.create();
|
814
|
+
Form.Element.DelayedObserver.prototype = {
|
815
|
+
initialize: function(element, delay, callback) {
|
816
|
+
this.delay = delay || 0.5;
|
817
|
+
this.element = $(element);
|
818
|
+
this.callback = callback;
|
819
|
+
this.timer = null;
|
820
|
+
this.lastValue = $F(this.element);
|
821
|
+
Event.observe(this.element,'keyup',this.delayedListener.bindAsEventListener(this));
|
822
|
+
},
|
823
|
+
delayedListener: function(event) {
|
824
|
+
if(this.lastValue == $F(this.element)) return;
|
825
|
+
if(this.timer) clearTimeout(this.timer);
|
826
|
+
this.timer = setTimeout(this.onTimerEvent.bind(this), this.delay * 1000);
|
827
|
+
this.lastValue = $F(this.element);
|
828
|
+
},
|
829
|
+
onTimerEvent: function() {
|
830
|
+
this.timer = null;
|
831
|
+
this.callback(this.element, $F(this.element));
|
832
|
+
}
|
833
|
+
};
|