You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@clerezza.apache.org by re...@apache.org on 2011/07/12 14:37:35 UTC
svn commit: r1145568 [14/18] - in /incubator/clerezza/trunk/parent:
bundledevtool/ bundledevtool/src/main/resources/OSGI-INF/
bundledevtool/src/main/resources/org/apache/clerezza/bundledevtool/skeletons/scala_with_activator/
bundledevtool/src/main/reso...
Modified: incubator/clerezza/trunk/parent/web.resources.jquery/src/main/resources/org/apache/clerezza/web/resources/jquery/staticweb/jquery.MultiFile.js
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/parent/web.resources.jquery/src/main/resources/org/apache/clerezza/web/resources/jquery/staticweb/jquery.MultiFile.js?rev=1145568&r1=1145567&r2=1145568&view=diff
==============================================================================
--- incubator/clerezza/trunk/parent/web.resources.jquery/src/main/resources/org/apache/clerezza/web/resources/jquery/staticweb/jquery.MultiFile.js (original)
+++ incubator/clerezza/trunk/parent/web.resources.jquery/src/main/resources/org/apache/clerezza/web/resources/jquery/staticweb/jquery.MultiFile.js Tue Jul 12 12:37:23 2011
@@ -1,531 +1,552 @@
-/*
- ### jQuery Multiple File Upload Plugin v1.44 - 2009-04-08 ###
- * Home: http://www.fyneworks.com/jquery/multiple-file-upload/
- * Code: http://code.google.com/p/jquery-multifile-plugin/
- *
- * Dual licensed under the MIT and GPL licenses:
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
- ###
-*/
-
-/*# AVOID COLLISIONS #*/
-;if(window.jQuery) (function($){
-/*# AVOID COLLISIONS #*/
-
- // plugin initialization
- $.fn.MultiFile = function(options){
- if(this.length==0) return this; // quick fail
-
- // Handle API methods
- if(typeof arguments[0]=='string'){
- // Perform API methods on individual elements
- if(this.length>1){
- var args = arguments;
- return this.each(function(){
- $.fn.MultiFile.apply($(this), args);
- });
- };
- // Invoke API method handler
- $.fn.MultiFile[arguments[0]].apply(this, $.makeArray(arguments).slice(1) || []);
- // Quick exit...
- return this;
- };
-
- // Initialize options for this call
- var options = $.extend(
- {}/* new object */,
- $.fn.MultiFile.options/* default options */,
- options || {} /* just-in-time options */
- );
-
- // Empty Element Fix!!!
- // this code will automatically intercept native form submissions
- // and disable empty file elements
- $('form')
- .not('MultiFile-intercepted')
- .addClass('MultiFile-intercepted')
- .submit($.fn.MultiFile.disableEmpty);
-
- //### http://plugins.jquery.com/node/1363
- // utility method to integrate this plugin with others...
- if($.fn.MultiFile.options.autoIntercept){
- $.fn.MultiFile.intercept( $.fn.MultiFile.options.autoIntercept /* array of methods to intercept */ );
- $.fn.MultiFile.options.autoIntercept = null; /* only run this once */
- };
-
- // loop through each matched element
- this
- .not('.MultiFile-applied')
- .addClass('MultiFile-applied')
- .each(function(){
- //#####################################################################
- // MAIN PLUGIN FUNCTIONALITY - START
- //#####################################################################
-
- // BUG 1251 FIX: http://plugins.jquery.com/project/comments/add/1251
- // variable group_count would repeat itself on multiple calls to the plugin.
- // this would cause a conflict with multiple elements
- // changes scope of variable to global so id will be unique over n calls
- window.MultiFile = (window.MultiFile || 0) + 1;
- var group_count = window.MultiFile;
-
- // Copy parent attributes - Thanks to Jonas Wagner
- // we will use this one to create new input elements
- var MultiFile = {e:this, E:$(this), clone:$(this).clone()};
-
- //===
-
- //# USE CONFIGURATION
- if(typeof options=='number') options = {max:options};
- var o = $.extend({},
- $.fn.MultiFile.options,
- options || {},
- ($.metadata? MultiFile.E.metadata(): ($.meta?MultiFile.E.data():null)) || {}, /* metadata options */
- {} /* internals */
- );
- // limit number of files that can be selected?
- if(!(o.max>0) /*IsNull(MultiFile.max)*/){
- o.max = MultiFile.E.attr('maxlength');
- if(!(o.max>0) /*IsNull(MultiFile.max)*/){
- o.max = (String(MultiFile.e.className.match(/\b(max|limit)\-([0-9]+)\b/gi) || ['']).match(/[0-9]+/gi) || [''])[0];
- if(!(o.max>0)) o.max = -1;
- else o.max = String(o.max).match(/[0-9]+/gi)[0];
- }
- };
- o.max = new Number(o.max);
- // limit extensions?
- o.accept = o.accept || MultiFile.E.attr('accept') || '';
- if(!o.accept){
- o.accept = (MultiFile.e.className.match(/\b(accept\-[\w\|]+)\b/gi)) || '';
- o.accept = new String(o.accept).replace(/^(accept|ext)\-/i,'');
- };
-
- //===
-
- // APPLY CONFIGURATION
- $.extend(MultiFile, o || {});
- MultiFile.STRING = $.extend({},$.fn.MultiFile.options.STRING,MultiFile.STRING);
-
- //===
-
- //#########################################
- // PRIVATE PROPERTIES/METHODS
- $.extend(MultiFile, {
- n: 0, // How many elements are currently selected?
- slaves: [], files: [],
- instanceKey: MultiFile.e.id || 'MultiFile'+String(group_count), // Instance Key?
- generateID: function(z){ return MultiFile.instanceKey + (z>0 ?'_F'+String(z):''); },
- trigger: function(event, element){
- var handler = MultiFile[event], value = $(element).attr('value');
- if(handler){
- var returnValue = handler(element, value, MultiFile);
- if( returnValue!=null ) return returnValue;
- }
- return true;
- }
- });
-
- //===
-
- // Setup dynamic regular expression for extension validation
- // - thanks to John-Paul Bader: http://smyck.de/2006/08/11/javascript-dynamic-regular-expresions/
- if(String(MultiFile.accept).length>1){
- MultiFile.rxAccept = new RegExp('\\.('+(MultiFile.accept?MultiFile.accept:'')+')$','gi');
- };
-
- //===
-
- // Create wrapper to hold our file list
- MultiFile.wrapID = MultiFile.instanceKey+'_wrap'; // Wrapper ID?
- MultiFile.E.wrap('<div class="MultiFile-wrap" id="'+MultiFile.wrapID+'"></div>');
- MultiFile.wrapper = $('#'+MultiFile.wrapID+'');
-
- //===
-
- // MultiFile MUST have a name - default: file1[], file2[], file3[]
- MultiFile.e.name = MultiFile.e.name || 'file'+ group_count +'[]';
-
- //===
-
- if(!MultiFile.list){
- // Create a wrapper for the list
- // * OPERA BUG: NO_MODIFICATION_ALLOWED_ERR ('list' is a read-only property)
- // this change allows us to keep the files in the order they were selected
- MultiFile.wrapper.append( '<div class="MultiFile-list" id="'+MultiFile.wrapID+'_list"></div>' );
- MultiFile.list = $('#'+MultiFile.wrapID+'_list');
- };
- MultiFile.list = $(MultiFile.list);
-
- //===
-
- // Bind a new element
- MultiFile.addSlave = function( slave, slave_count ){
- //if(window.console) console.log('MultiFile.addSlave',slave_count);
-
- // Keep track of how many elements have been displayed
- MultiFile.n++;
- // Add reference to master element
- slave.MultiFile = MultiFile;
-
- // BUG FIX: http://plugins.jquery.com/node/1495
- // Clear identifying properties from clones
- if(slave_count>0) slave.id = slave.name = '';
-
- // Define element's ID and name (upload components need this!)
- //slave.id = slave.id || MultiFile.generateID(slave_count);
- if(slave_count>0) slave.id = MultiFile.generateID(slave_count);
- //FIX for: http://code.google.com/p/jquery-multifile-plugin/issues/detail?id=23
-
- // 2008-Apr-29: New customizable naming convention (see url below)
- // http://groups.google.com/group/jquery-dev/browse_frm/thread/765c73e41b34f924#
- slave.name = String(MultiFile.namePattern
- /*master name*/.replace(/\$name/gi,$(MultiFile.clone).attr('name'))
- /*master id */.replace(/\$id/gi, $(MultiFile.clone).attr('id'))
- /*group count*/.replace(/\$g/gi, group_count)//(group_count>0?group_count:''))
- /*slave count*/.replace(/\$i/gi, slave_count)//(slave_count>0?slave_count:''))
- );
-
- // If we've reached maximum number, disable input slave
- if( (MultiFile.max > 0) && ((MultiFile.n-1) > (MultiFile.max)) )//{ // MultiFile.n Starts at 1, so subtract 1 to find true count
- slave.disabled = true;
- //};
-
- // Remember most recent slave
- MultiFile.current = MultiFile.slaves[slave_count] = slave;
-
- // We'll use jQuery from now on
- slave = $(slave);
-
- // Clear value
- slave.val('').attr('value','')[0].value = '';
-
- // Stop plugin initializing on slaves
- slave.addClass('MultiFile-applied');
-
- // Triggered when a file is selected
- slave.change(function(){
- //if(window.console) console.log('MultiFile.slave.change',slave_count);
-
- // Lose focus to stop IE7 firing onchange again
- $(this).blur();
-
- //# Trigger Event! onFileSelect
- if(!MultiFile.trigger('onFileSelect', this, MultiFile)) return false;
- //# End Event!
-
- //# Retrive value of selected file from element
- var ERROR = '', v = String(this.value || ''/*.attr('value)*/);
-
- // check extension
- if(MultiFile.accept && v && !v.match(MultiFile.rxAccept))//{
- ERROR = MultiFile.STRING.denied.replace('$ext', String(v.match(/\.\w{1,4}$/gi)));
- //}
- //};
-
- // Disallow duplicates
- for(var f in MultiFile.slaves)//{
- if(MultiFile.slaves[f] && MultiFile.slaves[f]!=this)//{
- //console.log(MultiFile.slaves[f],MultiFile.slaves[f].value);
- if(MultiFile.slaves[f].value==v)//{
- ERROR = MultiFile.STRING.duplicate.replace('$file', v.match(/[^\/\\]+$/gi));
- //};
- //};
- //};
-
- // Create a new file input element
- var newEle = $(MultiFile.clone).clone();// Copy parent attributes - Thanks to Jonas Wagner
- //# Let's remember which input we've generated so
- // we can disable the empty ones before submission
- // See: http://plugins.jquery.com/node/1495
- newEle.addClass('MultiFile');
-
- // Handle error
- if(ERROR!=''){
- // Handle error
- MultiFile.error(ERROR);
-
- // 2007-06-24: BUG FIX - Thanks to Adrian Wróbel <adrian [dot] wrobel [at] gmail.com>
- // Ditch the trouble maker and add a fresh new element
- MultiFile.n--;
- MultiFile.addSlave(newEle[0], slave_count);
- slave.parent().prepend(newEle);
- slave.remove();
- return false;
- };
-
- // Hide this element (NB: display:none is evil!)
- $(this).css({ position:'absolute', top: '-3000px' });
-
- // Add new element to the form
- slave.after(newEle);
-
- // Update list
- MultiFile.addToList( this, slave_count );
-
- // Bind functionality
- MultiFile.addSlave( newEle[0], slave_count+1 );
-
- //# Trigger Event! afterFileSelect
- if(!MultiFile.trigger('afterFileSelect', this, MultiFile)) return false;
- //# End Event!
-
- }); // slave.change()
-
- // Save control to element
- $(slave).data('MultiFile', MultiFile);
-
- };// MultiFile.addSlave
- // Bind a new element
-
-
-
- // Add a new file to the list
- MultiFile.addToList = function( slave, slave_count ){
- //if(window.console) console.log('MultiFile.addToList',slave_count);
-
- //# Trigger Event! onFileAppend
- if(!MultiFile.trigger('onFileAppend', slave, MultiFile)) return false;
- //# End Event!
-
- // Create label elements
- var
- r = $('<div class="MultiFile-label"></div>'),
- v = String(slave.value || ''/*.attr('value)*/),
- a = $('<span class="MultiFile-title" title="'+MultiFile.STRING.selected.replace('$file', v)+'">'+MultiFile.STRING.file.replace('$file', v.match(/[^\/\\]+$/gi)[0])+'</span>'),
- b = $('<a class="MultiFile-remove" href="#'+MultiFile.wrapID+'">'+MultiFile.STRING.remove+'</a>');
-
- // Insert label
- MultiFile.list.append(
- r.append(b, ' ', a)
- );
-
- b
- .click(function(){
-
- //# Trigger Event! onFileRemove
- if(!MultiFile.trigger('onFileRemove', slave, MultiFile)) return false;
- //# End Event!
-
- MultiFile.n--;
- MultiFile.current.disabled = false;
-
- // Remove element, remove label, point to current
- MultiFile.slaves[slave_count] = null;
- $(slave).remove();
- $(this).parent().remove();
-
- // Show most current element again (move into view) and clear selection
- $(MultiFile.current).css({ position:'', top: '' });
- $(MultiFile.current).reset().val('').attr('value', '')[0].value = '';
-
- //# Trigger Event! afterFileRemove
- if(!MultiFile.trigger('afterFileRemove', slave, MultiFile)) return false;
- //# End Event!
-
- return false;
- });
-
- //# Trigger Event! afterFileAppend
- if(!MultiFile.trigger('afterFileAppend', slave, MultiFile)) return false;
- //# End Event!
-
- }; // MultiFile.addToList
- // Add element to selected files list
-
-
-
- // Bind functionality to the first element
- if(!MultiFile.MultiFile) MultiFile.addSlave(MultiFile.e, 0);
-
- // Increment control count
- //MultiFile.I++; // using window.MultiFile
- MultiFile.n++;
-
- // Save control to element
- MultiFile.E.data('MultiFile', MultiFile);
-
-
- //#####################################################################
- // MAIN PLUGIN FUNCTIONALITY - END
- //#####################################################################
- }); // each element
- };
-
- /*--------------------------------------------------------*/
-
- /*
- ### Core functionality and API ###
- */
- $.extend($.fn.MultiFile, {
- /**
- * This method removes all selected files
- *
- * Returns a jQuery collection of all affected elements.
- *
- * @name reset
- * @type jQuery
- * @cat Plugins/MultiFile
- * @author Diego A. (http://www.fyneworks.com/)
- *
- * @example $.fn.MultiFile.reset();
- */
- reset: function(){
- var settings = $(this).data('MultiFile');
- //if(settings) settings.wrapper.find('a.MultiFile-remove').click();
- if(settings) settings.list.find('a.MultiFile-remove').click();
- return $(this);
- },
-
-
- /**
- * This utility makes it easy to disable all 'empty' file elements in the document before submitting a form.
- * It marks the affected elements so they can be easily re-enabled after the form submission or validation.
- *
- * Returns a jQuery collection of all affected elements.
- *
- * @name disableEmpty
- * @type jQuery
- * @cat Plugins/MultiFile
- * @author Diego A. (http://www.fyneworks.com/)
- *
- * @example $.fn.MultiFile.disableEmpty();
- * @param String class (optional) A string specifying a class to be applied to all affected elements - Default: 'mfD'.
- */
- disableEmpty: function(klass){ klass = String(klass || 'mfD');
- var o = [];
- $('input:file').each(function(){ if($(this).val()=='') o[o.length] = this; });
- return $(o).each(function(){ this.disabled = true }).addClass(klass);
- },
-
-
- /**
- * This method re-enables 'empty' file elements that were disabled (and marked) with the $.fn.MultiFile.disableEmpty method.
- *
- * Returns a jQuery collection of all affected elements.
- *
- * @name reEnableEmpty
- * @type jQuery
- * @cat Plugins/MultiFile
- * @author Diego A. (http://www.fyneworks.com/)
- *
- * @example $.fn.MultiFile.reEnableEmpty();
- * @param String klass (optional) A string specifying the class that was used to mark affected elements - Default: 'mfD'.
- */
- reEnableEmpty: function(klass){ klass = String(klass || 'mfD');
- return $('input:file.'+klass).removeClass(klass).each(function(){ this.disabled = false });
- },
-
-
- /**
- * This method will intercept other jQuery plugins and disable empty file input elements prior to form submission
- *
- * @name intercept
- * @cat Plugins/MultiFile
- * @author Diego A. (http://www.fyneworks.com/)
- *
- * @example $.fn.MultiFile.intercept();
- * @param Array methods (optional) Array of method names to be intercepted
- */
- intercepted: {},
- intercept: function(methods, context, args){
- var method, value; args = args || [];
- if(args.constructor.toString().indexOf("Array")<0) args = [ args ];
- if(typeof(methods)=='function'){
- $.fn.MultiFile.disableEmpty();
- value = methods.apply(context || window, args);
- $.fn.MultiFile.reEnableEmpty();
- return value;
- };
- if(methods.constructor.toString().indexOf("Array")<0) methods = [methods];
- for(var i=0;i<methods.length;i++){
- method = methods[i]+''; // make sure that we have a STRING
- if(method) (function(method){ // make sure that method is ISOLATED for the interception
- $.fn.MultiFile.intercepted[method] = $.fn[method] || function(){};
- $.fn[method] = function(){
- $.fn.MultiFile.disableEmpty();
- value = $.fn.MultiFile.intercepted[method].apply(this, arguments);
- $.fn.MultiFile.reEnableEmpty();
- return value;
- }; // interception
- })(method); // MAKE SURE THAT method IS ISOLATED for the interception
- };// for each method
- }
- });
-
- /*--------------------------------------------------------*/
-
- /*
- ### Default Settings ###
- eg.: You can override default control like this:
- $.fn.MultiFile.options.accept = 'gif|jpg';
- */
- $.fn.MultiFile.options = { //$.extend($.fn.MultiFile, { options: {
- accept: '', // accepted file extensions
- max: -1, // maximum number of selectable files
-
- // name to use for newly created elements
- namePattern: '$name', // same name by default (which creates an array)
-
- // STRING: collection lets you show messages in different languages
- STRING: {
- remove:'x',
- denied:'You cannot select a $ext file.\nTry again...',
- file:'$file',
- selected:'File selected: $file',
- duplicate:'This file has already been selected:\n$file'
- },
-
- // name of methods that should be automcatically intercepted so the plugin can disable
- // extra file elements that are empty before execution and automatically re-enable them afterwards
- autoIntercept: [ 'submit', 'ajaxSubmit', 'validate' /* array of methods to intercept */ ],
-
- // error handling function
- error: function(s){
- /*
- ERROR! blockUI is not currently working in IE
- if($.blockUI){
- $.blockUI({
- message: s.replace(/\n/gi,'<br/>'),
- css: {
- border:'none', padding:'15px', size:'12.0pt',
- backgroundColor:'#900', color:'#fff',
- opacity:'.8','-webkit-border-radius': '10px','-moz-border-radius': '10px'
- }
- });
- window.setTimeout($.unblockUI, 2000);
- }
- else//{// save a byte!
- */
- alert(s);
- //}// save a byte!
- }
- }; //} });
-
- /*--------------------------------------------------------*/
-
- /*
- ### Additional Methods ###
- Required functionality outside the plugin's scope
- */
-
- // Native input reset method - because this alone doesn't always work: $(element).val('').attr('value', '')[0].value = '';
- $.fn.reset = function(){ return this.each(function(){ try{ this.reset(); }catch(e){} }); };
-
- /*--------------------------------------------------------*/
-
- /*
- ### Default implementation ###
- The plugin will attach itself to file inputs
- with the class 'multi' when the page loads
- */
- $(function(){
- //$("input:file.multi").MultiFile();
- $("input[type=file].multi").MultiFile();
- });
-
-
-
-/*# AVOID COLLISIONS #*/
-})(jQuery);
-/*# AVOID COLLISIONS #*/
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/*
+ ### jQuery Multiple File Upload Plugin v1.44 - 2009-04-08 ###
+ * Home: http://www.fyneworks.com/jquery/multiple-file-upload/
+ * Code: http://code.google.com/p/jquery-multifile-plugin/
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ ###
+*/
+
+/*# AVOID COLLISIONS #*/
+;if(window.jQuery) (function($){
+/*# AVOID COLLISIONS #*/
+
+ // plugin initialization
+ $.fn.MultiFile = function(options){
+ if(this.length==0) return this; // quick fail
+
+ // Handle API methods
+ if(typeof arguments[0]=='string'){
+ // Perform API methods on individual elements
+ if(this.length>1){
+ var args = arguments;
+ return this.each(function(){
+ $.fn.MultiFile.apply($(this), args);
+ });
+ };
+ // Invoke API method handler
+ $.fn.MultiFile[arguments[0]].apply(this, $.makeArray(arguments).slice(1) || []);
+ // Quick exit...
+ return this;
+ };
+
+ // Initialize options for this call
+ var options = $.extend(
+ {}/* new object */,
+ $.fn.MultiFile.options/* default options */,
+ options || {} /* just-in-time options */
+ );
+
+ // Empty Element Fix!!!
+ // this code will automatically intercept native form submissions
+ // and disable empty file elements
+ $('form')
+ .not('MultiFile-intercepted')
+ .addClass('MultiFile-intercepted')
+ .submit($.fn.MultiFile.disableEmpty);
+
+ //### http://plugins.jquery.com/node/1363
+ // utility method to integrate this plugin with others...
+ if($.fn.MultiFile.options.autoIntercept){
+ $.fn.MultiFile.intercept( $.fn.MultiFile.options.autoIntercept /* array of methods to intercept */ );
+ $.fn.MultiFile.options.autoIntercept = null; /* only run this once */
+ };
+
+ // loop through each matched element
+ this
+ .not('.MultiFile-applied')
+ .addClass('MultiFile-applied')
+ .each(function(){
+ //#####################################################################
+ // MAIN PLUGIN FUNCTIONALITY - START
+ //#####################################################################
+
+ // BUG 1251 FIX: http://plugins.jquery.com/project/comments/add/1251
+ // variable group_count would repeat itself on multiple calls to the plugin.
+ // this would cause a conflict with multiple elements
+ // changes scope of variable to global so id will be unique over n calls
+ window.MultiFile = (window.MultiFile || 0) + 1;
+ var group_count = window.MultiFile;
+
+ // Copy parent attributes - Thanks to Jonas Wagner
+ // we will use this one to create new input elements
+ var MultiFile = {e:this, E:$(this), clone:$(this).clone()};
+
+ //===
+
+ //# USE CONFIGURATION
+ if(typeof options=='number') options = {max:options};
+ var o = $.extend({},
+ $.fn.MultiFile.options,
+ options || {},
+ ($.metadata? MultiFile.E.metadata(): ($.meta?MultiFile.E.data():null)) || {}, /* metadata options */
+ {} /* internals */
+ );
+ // limit number of files that can be selected?
+ if(!(o.max>0) /*IsNull(MultiFile.max)*/){
+ o.max = MultiFile.E.attr('maxlength');
+ if(!(o.max>0) /*IsNull(MultiFile.max)*/){
+ o.max = (String(MultiFile.e.className.match(/\b(max|limit)\-([0-9]+)\b/gi) || ['']).match(/[0-9]+/gi) || [''])[0];
+ if(!(o.max>0)) o.max = -1;
+ else o.max = String(o.max).match(/[0-9]+/gi)[0];
+ }
+ };
+ o.max = new Number(o.max);
+ // limit extensions?
+ o.accept = o.accept || MultiFile.E.attr('accept') || '';
+ if(!o.accept){
+ o.accept = (MultiFile.e.className.match(/\b(accept\-[\w\|]+)\b/gi)) || '';
+ o.accept = new String(o.accept).replace(/^(accept|ext)\-/i,'');
+ };
+
+ //===
+
+ // APPLY CONFIGURATION
+ $.extend(MultiFile, o || {});
+ MultiFile.STRING = $.extend({},$.fn.MultiFile.options.STRING,MultiFile.STRING);
+
+ //===
+
+ //#########################################
+ // PRIVATE PROPERTIES/METHODS
+ $.extend(MultiFile, {
+ n: 0, // How many elements are currently selected?
+ slaves: [], files: [],
+ instanceKey: MultiFile.e.id || 'MultiFile'+String(group_count), // Instance Key?
+ generateID: function(z){ return MultiFile.instanceKey + (z>0 ?'_F'+String(z):''); },
+ trigger: function(event, element){
+ var handler = MultiFile[event], value = $(element).attr('value');
+ if(handler){
+ var returnValue = handler(element, value, MultiFile);
+ if( returnValue!=null ) return returnValue;
+ }
+ return true;
+ }
+ });
+
+ //===
+
+ // Setup dynamic regular expression for extension validation
+ // - thanks to John-Paul Bader: http://smyck.de/2006/08/11/javascript-dynamic-regular-expresions/
+ if(String(MultiFile.accept).length>1){
+ MultiFile.rxAccept = new RegExp('\\.('+(MultiFile.accept?MultiFile.accept:'')+')$','gi');
+ };
+
+ //===
+
+ // Create wrapper to hold our file list
+ MultiFile.wrapID = MultiFile.instanceKey+'_wrap'; // Wrapper ID?
+ MultiFile.E.wrap('<div class="MultiFile-wrap" id="'+MultiFile.wrapID+'"></div>');
+ MultiFile.wrapper = $('#'+MultiFile.wrapID+'');
+
+ //===
+
+ // MultiFile MUST have a name - default: file1[], file2[], file3[]
+ MultiFile.e.name = MultiFile.e.name || 'file'+ group_count +'[]';
+
+ //===
+
+ if(!MultiFile.list){
+ // Create a wrapper for the list
+ // * OPERA BUG: NO_MODIFICATION_ALLOWED_ERR ('list' is a read-only property)
+ // this change allows us to keep the files in the order they were selected
+ MultiFile.wrapper.append( '<div class="MultiFile-list" id="'+MultiFile.wrapID+'_list"></div>' );
+ MultiFile.list = $('#'+MultiFile.wrapID+'_list');
+ };
+ MultiFile.list = $(MultiFile.list);
+
+ //===
+
+ // Bind a new element
+ MultiFile.addSlave = function( slave, slave_count ){
+ //if(window.console) console.log('MultiFile.addSlave',slave_count);
+
+ // Keep track of how many elements have been displayed
+ MultiFile.n++;
+ // Add reference to master element
+ slave.MultiFile = MultiFile;
+
+ // BUG FIX: http://plugins.jquery.com/node/1495
+ // Clear identifying properties from clones
+ if(slave_count>0) slave.id = slave.name = '';
+
+ // Define element's ID and name (upload components need this!)
+ //slave.id = slave.id || MultiFile.generateID(slave_count);
+ if(slave_count>0) slave.id = MultiFile.generateID(slave_count);
+ //FIX for: http://code.google.com/p/jquery-multifile-plugin/issues/detail?id=23
+
+ // 2008-Apr-29: New customizable naming convention (see url below)
+ // http://groups.google.com/group/jquery-dev/browse_frm/thread/765c73e41b34f924#
+ slave.name = String(MultiFile.namePattern
+ /*master name*/.replace(/\$name/gi,$(MultiFile.clone).attr('name'))
+ /*master id */.replace(/\$id/gi, $(MultiFile.clone).attr('id'))
+ /*group count*/.replace(/\$g/gi, group_count)//(group_count>0?group_count:''))
+ /*slave count*/.replace(/\$i/gi, slave_count)//(slave_count>0?slave_count:''))
+ );
+
+ // If we've reached maximum number, disable input slave
+ if( (MultiFile.max > 0) && ((MultiFile.n-1) > (MultiFile.max)) )//{ // MultiFile.n Starts at 1, so subtract 1 to find true count
+ slave.disabled = true;
+ //};
+
+ // Remember most recent slave
+ MultiFile.current = MultiFile.slaves[slave_count] = slave;
+
+ // We'll use jQuery from now on
+ slave = $(slave);
+
+ // Clear value
+ slave.val('').attr('value','')[0].value = '';
+
+ // Stop plugin initializing on slaves
+ slave.addClass('MultiFile-applied');
+
+ // Triggered when a file is selected
+ slave.change(function(){
+ //if(window.console) console.log('MultiFile.slave.change',slave_count);
+
+ // Lose focus to stop IE7 firing onchange again
+ $(this).blur();
+
+ //# Trigger Event! onFileSelect
+ if(!MultiFile.trigger('onFileSelect', this, MultiFile)) return false;
+ //# End Event!
+
+ //# Retrive value of selected file from element
+ var ERROR = '', v = String(this.value || ''/*.attr('value)*/);
+
+ // check extension
+ if(MultiFile.accept && v && !v.match(MultiFile.rxAccept))//{
+ ERROR = MultiFile.STRING.denied.replace('$ext', String(v.match(/\.\w{1,4}$/gi)));
+ //}
+ //};
+
+ // Disallow duplicates
+ for(var f in MultiFile.slaves)//{
+ if(MultiFile.slaves[f] && MultiFile.slaves[f]!=this)//{
+ //console.log(MultiFile.slaves[f],MultiFile.slaves[f].value);
+ if(MultiFile.slaves[f].value==v)//{
+ ERROR = MultiFile.STRING.duplicate.replace('$file', v.match(/[^\/\\]+$/gi));
+ //};
+ //};
+ //};
+
+ // Create a new file input element
+ var newEle = $(MultiFile.clone).clone();// Copy parent attributes - Thanks to Jonas Wagner
+ //# Let's remember which input we've generated so
+ // we can disable the empty ones before submission
+ // See: http://plugins.jquery.com/node/1495
+ newEle.addClass('MultiFile');
+
+ // Handle error
+ if(ERROR!=''){
+ // Handle error
+ MultiFile.error(ERROR);
+
+ // 2007-06-24: BUG FIX - Thanks to Adrian Wr�bel <adrian [dot] wrobel [at] gmail.com>
+ // Ditch the trouble maker and add a fresh new element
+ MultiFile.n--;
+ MultiFile.addSlave(newEle[0], slave_count);
+ slave.parent().prepend(newEle);
+ slave.remove();
+ return false;
+ };
+
+ // Hide this element (NB: display:none is evil!)
+ $(this).css({ position:'absolute', top: '-3000px' });
+
+ // Add new element to the form
+ slave.after(newEle);
+
+ // Update list
+ MultiFile.addToList( this, slave_count );
+
+ // Bind functionality
+ MultiFile.addSlave( newEle[0], slave_count+1 );
+
+ //# Trigger Event! afterFileSelect
+ if(!MultiFile.trigger('afterFileSelect', this, MultiFile)) return false;
+ //# End Event!
+
+ }); // slave.change()
+
+ // Save control to element
+ $(slave).data('MultiFile', MultiFile);
+
+ };// MultiFile.addSlave
+ // Bind a new element
+
+
+
+ // Add a new file to the list
+ MultiFile.addToList = function( slave, slave_count ){
+ //if(window.console) console.log('MultiFile.addToList',slave_count);
+
+ //# Trigger Event! onFileAppend
+ if(!MultiFile.trigger('onFileAppend', slave, MultiFile)) return false;
+ //# End Event!
+
+ // Create label elements
+ var
+ r = $('<div class="MultiFile-label"></div>'),
+ v = String(slave.value || ''/*.attr('value)*/),
+ a = $('<span class="MultiFile-title" title="'+MultiFile.STRING.selected.replace('$file', v)+'">'+MultiFile.STRING.file.replace('$file', v.match(/[^\/\\]+$/gi)[0])+'</span>'),
+ b = $('<a class="MultiFile-remove" href="#'+MultiFile.wrapID+'">'+MultiFile.STRING.remove+'</a>');
+
+ // Insert label
+ MultiFile.list.append(
+ r.append(b, ' ', a)
+ );
+
+ b
+ .click(function(){
+
+ //# Trigger Event! onFileRemove
+ if(!MultiFile.trigger('onFileRemove', slave, MultiFile)) return false;
+ //# End Event!
+
+ MultiFile.n--;
+ MultiFile.current.disabled = false;
+
+ // Remove element, remove label, point to current
+ MultiFile.slaves[slave_count] = null;
+ $(slave).remove();
+ $(this).parent().remove();
+
+ // Show most current element again (move into view) and clear selection
+ $(MultiFile.current).css({ position:'', top: '' });
+ $(MultiFile.current).reset().val('').attr('value', '')[0].value = '';
+
+ //# Trigger Event! afterFileRemove
+ if(!MultiFile.trigger('afterFileRemove', slave, MultiFile)) return false;
+ //# End Event!
+
+ return false;
+ });
+
+ //# Trigger Event! afterFileAppend
+ if(!MultiFile.trigger('afterFileAppend', slave, MultiFile)) return false;
+ //# End Event!
+
+ }; // MultiFile.addToList
+ // Add element to selected files list
+
+
+
+ // Bind functionality to the first element
+ if(!MultiFile.MultiFile) MultiFile.addSlave(MultiFile.e, 0);
+
+ // Increment control count
+ //MultiFile.I++; // using window.MultiFile
+ MultiFile.n++;
+
+ // Save control to element
+ MultiFile.E.data('MultiFile', MultiFile);
+
+
+ //#####################################################################
+ // MAIN PLUGIN FUNCTIONALITY - END
+ //#####################################################################
+ }); // each element
+ };
+
+ /*--------------------------------------------------------*/
+
+ /*
+ ### Core functionality and API ###
+ */
+ $.extend($.fn.MultiFile, {
+ /**
+ * This method removes all selected files
+ *
+ * Returns a jQuery collection of all affected elements.
+ *
+ * @name reset
+ * @type jQuery
+ * @cat Plugins/MultiFile
+ * @author Diego A. (http://www.fyneworks.com/)
+ *
+ * @example $.fn.MultiFile.reset();
+ */
+ reset: function(){
+ var settings = $(this).data('MultiFile');
+ //if(settings) settings.wrapper.find('a.MultiFile-remove').click();
+ if(settings) settings.list.find('a.MultiFile-remove').click();
+ return $(this);
+ },
+
+
+ /**
+ * This utility makes it easy to disable all 'empty' file elements in the document before submitting a form.
+ * It marks the affected elements so they can be easily re-enabled after the form submission or validation.
+ *
+ * Returns a jQuery collection of all affected elements.
+ *
+ * @name disableEmpty
+ * @type jQuery
+ * @cat Plugins/MultiFile
+ * @author Diego A. (http://www.fyneworks.com/)
+ *
+ * @example $.fn.MultiFile.disableEmpty();
+ * @param String class (optional) A string specifying a class to be applied to all affected elements - Default: 'mfD'.
+ */
+ disableEmpty: function(klass){ klass = String(klass || 'mfD');
+ var o = [];
+ $('input:file').each(function(){ if($(this).val()=='') o[o.length] = this; });
+ return $(o).each(function(){ this.disabled = true }).addClass(klass);
+ },
+
+
+ /**
+ * This method re-enables 'empty' file elements that were disabled (and marked) with the $.fn.MultiFile.disableEmpty method.
+ *
+ * Returns a jQuery collection of all affected elements.
+ *
+ * @name reEnableEmpty
+ * @type jQuery
+ * @cat Plugins/MultiFile
+ * @author Diego A. (http://www.fyneworks.com/)
+ *
+ * @example $.fn.MultiFile.reEnableEmpty();
+ * @param String klass (optional) A string specifying the class that was used to mark affected elements - Default: 'mfD'.
+ */
+ reEnableEmpty: function(klass){ klass = String(klass || 'mfD');
+ return $('input:file.'+klass).removeClass(klass).each(function(){ this.disabled = false });
+ },
+
+
+ /**
+ * This method will intercept other jQuery plugins and disable empty file input elements prior to form submission
+ *
+ * @name intercept
+ * @cat Plugins/MultiFile
+ * @author Diego A. (http://www.fyneworks.com/)
+ *
+ * @example $.fn.MultiFile.intercept();
+ * @param Array methods (optional) Array of method names to be intercepted
+ */
+ intercepted: {},
+ intercept: function(methods, context, args){
+ var method, value; args = args || [];
+ if(args.constructor.toString().indexOf("Array")<0) args = [ args ];
+ if(typeof(methods)=='function'){
+ $.fn.MultiFile.disableEmpty();
+ value = methods.apply(context || window, args);
+ $.fn.MultiFile.reEnableEmpty();
+ return value;
+ };
+ if(methods.constructor.toString().indexOf("Array")<0) methods = [methods];
+ for(var i=0;i<methods.length;i++){
+ method = methods[i]+''; // make sure that we have a STRING
+ if(method) (function(method){ // make sure that method is ISOLATED for the interception
+ $.fn.MultiFile.intercepted[method] = $.fn[method] || function(){};
+ $.fn[method] = function(){
+ $.fn.MultiFile.disableEmpty();
+ value = $.fn.MultiFile.intercepted[method].apply(this, arguments);
+ $.fn.MultiFile.reEnableEmpty();
+ return value;
+ }; // interception
+ })(method); // MAKE SURE THAT method IS ISOLATED for the interception
+ };// for each method
+ }
+ });
+
+ /*--------------------------------------------------------*/
+
+ /*
+ ### Default Settings ###
+ eg.: You can override default control like this:
+ $.fn.MultiFile.options.accept = 'gif|jpg';
+ */
+ $.fn.MultiFile.options = { //$.extend($.fn.MultiFile, { options: {
+ accept: '', // accepted file extensions
+ max: -1, // maximum number of selectable files
+
+ // name to use for newly created elements
+ namePattern: '$name', // same name by default (which creates an array)
+
+ // STRING: collection lets you show messages in different languages
+ STRING: {
+ remove:'x',
+ denied:'You cannot select a $ext file.\nTry again...',
+ file:'$file',
+ selected:'File selected: $file',
+ duplicate:'This file has already been selected:\n$file'
+ },
+
+ // name of methods that should be automcatically intercepted so the plugin can disable
+ // extra file elements that are empty before execution and automatically re-enable them afterwards
+ autoIntercept: [ 'submit', 'ajaxSubmit', 'validate' /* array of methods to intercept */ ],
+
+ // error handling function
+ error: function(s){
+ /*
+ ERROR! blockUI is not currently working in IE
+ if($.blockUI){
+ $.blockUI({
+ message: s.replace(/\n/gi,'<br/>'),
+ css: {
+ border:'none', padding:'15px', size:'12.0pt',
+ backgroundColor:'#900', color:'#fff',
+ opacity:'.8','-webkit-border-radius': '10px','-moz-border-radius': '10px'
+ }
+ });
+ window.setTimeout($.unblockUI, 2000);
+ }
+ else//{// save a byte!
+ */
+ alert(s);
+ //}// save a byte!
+ }
+ }; //} });
+
+ /*--------------------------------------------------------*/
+
+ /*
+ ### Additional Methods ###
+ Required functionality outside the plugin's scope
+ */
+
+ // Native input reset method - because this alone doesn't always work: $(element).val('').attr('value', '')[0].value = '';
+ $.fn.reset = function(){ return this.each(function(){ try{ this.reset(); }catch(e){} }); };
+
+ /*--------------------------------------------------------*/
+
+ /*
+ ### Default implementation ###
+ The plugin will attach itself to file inputs
+ with the class 'multi' when the page loads
+ */
+ $(function(){
+ //$("input:file.multi").MultiFile();
+ $("input[type=file].multi").MultiFile();
+ });
+
+
+
+/*# AVOID COLLISIONS #*/
+})(jQuery);
+/*# AVOID COLLISIONS #*/
Modified: incubator/clerezza/trunk/parent/web.resources.jquery/src/main/resources/org/apache/clerezza/web/resources/jquery/staticweb/jquery.MultiFile.pack.js
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/parent/web.resources.jquery/src/main/resources/org/apache/clerezza/web/resources/jquery/staticweb/jquery.MultiFile.pack.js?rev=1145568&r1=1145567&r2=1145568&view=diff
==============================================================================
--- incubator/clerezza/trunk/parent/web.resources.jquery/src/main/resources/org/apache/clerezza/web/resources/jquery/staticweb/jquery.MultiFile.pack.js (original)
+++ incubator/clerezza/trunk/parent/web.resources.jquery/src/main/resources/org/apache/clerezza/web/resources/jquery/staticweb/jquery.MultiFile.pack.js Tue Jul 12 12:37:23 2011
@@ -1,11 +1,32 @@
-/*
- ### jQuery Multiple File Upload Plugin v1.44 - 2009-04-08 ###
- * Home: http://www.fyneworks.com/jquery/multiple-file-upload/
- * Code: http://code.google.com/p/jquery-multifile-plugin/
- *
- * Dual licensed under the MIT and GPL licenses:
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
- ###
-*/
-eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';3(Q.1w)(6($){$.7.2=6(h){3(5.U==0)8 5;3(18 T[0]==\'1J\'){3(5.U>1){l i=T;8 5.L(6(){$.7.2.10($(5),i)})};$.7.2[T[0]].10(5,$.28(T).1Z(1)||[]);8 5};l h=$.O({},$.7.2.I,h||{});$(\'1X\').1l(\'2-R\').S(\'2-R\').1k($.7.2.12);3($.7.2.I.13){$.7.2.1i($.7.2.I.13);$.7.2.I.13=W};5.1l(\'.2-16\').S(\'2-16\').L(6(){Q.2=(Q.2||0)+1;l e=Q.2;l g={e:5,E:$(5),N:$(5).N()};3(18 h==\'26\')h={k:h};l o=$.O({},$.7.2.I,h||{},($.1D?g.E.1D():($.1Q?g.E.Y():W))||{},{});3(!(o.k>0)){o.k=g.E.H(\'1N\');3(!(o.k>0)){o.k=(q(g.e.1I.B(/\\b(k|1S)\\-([0-9]+)\\b/t)||[\'\']).B(/[0-9]+/t)||[\'\'])[0];3(!(o.k>0))o.k=-1;2o o.k=q(o.k).B(/[0-9]+/t)[0]}};o.k=1e 25(o.k);o.p=o.p||g.E.H(\'p\')||\'\';3(!o.p){o.p=
(g.e.1I.B(/\\b(p\\-[\\w\\|]+)\\b/t))||\'\';o.p=1e q(o.p).y(/^(p|1b)\\-/i,\'\')};$.O(g,o||{});g.A=$.O({},$.7.2.I.A,g.A);$.O(g,{n:0,J:[],2a:[],1f:g.e.K||\'2\'+q(e),1g:6(z){8 g.1f+(z>0?\'1L\'+q(z):\'\')},F:6(a,b){l c=g[a],j=$(b).H(\'j\');3(c){l d=c(b,j,g);3(d!=W)8 d}8 1d}});3(q(g.p).U>1){g.1m=1e 2b(\'\\\\.(\'+(g.p?g.p:\'\')+\')$\',\'t\')};g.P=g.1f+\'1K\';g.E.1z(\'<M V="2-1z" K="\'+g.P+\'"></M>\');g.1C=$(\'#\'+g.P+\'\');g.e.D=g.e.D||\'m\'+e+\'[]\';3(!g.G){g.1C.1c(\'<M V="2-G" K="\'+g.P+\'1h"></M>\');g.G=$(\'#\'+g.P+\'1h\')};g.G=$(g.G);g.11=6(c,d){g.n++;c.2=g;3(d>0)c.K=c.D=\'\';3(d>0)c.K=g.1g(d);c.D=q(g.1j.y(/\\$D/t,$(g.N).H(\'D\')).y(/\\$K/t,$(g.N).H(\'K\')).y(/\\$g/t,e).y(/\\$i/t,d));3((g.k>0)&&((g.n-1)>(g.k)))c.Z=1d;g.X=g.J[d]=c;c=$(c);c.17(\'\').H(\'j\',\'\')[0].j=\'\';c.S(\'2-16\');c.1T(6(){$(5).1V();3(!g.F(\'1W\',5,g))8 u;l a=\'\',v=q(5.j||\'\');3(g.p&&v&&!v.B(g.1m))a=g.A.1n.y(\'$1b\',q(v.B(/\\.\\w{1,4}$/t)));1o(l f 29 g.J)3(g.J[f]&&g.J[f]!=5)3(g.J[f].j==v)a=g.A.1p.y(\'$m\'
,v.B(/[^\\/\\\\]+$/t));l b=$(g.N).N();b.S(\'2\');3(a!=\'\'){g.1q(a);g.n--;g.11(b[0],d);c.1r().2t(b);c.C();8 u};$(5).1s({1t:\'1M\',1u:\'-1O\'});c.1P(b);g.1v(5,d);g.11(b[0],d+1);3(!g.F(\'1R\',5,g))8 u});$(c).Y(\'2\',g)};g.1v=6(c,d){3(!g.F(\'2u\',c,g))8 u;l r=$(\'<M V="2-1U"></M>\'),v=q(c.j||\'\'),a=$(\'<1x V="2-1y" 1y="\'+g.A.14.y(\'$m\',v)+\'">\'+g.A.m.y(\'$m\',v.B(/[^\\/\\\\]+$/t)[0])+\'</1x>\'),b=$(\'<a V="2-C" 1Y="#\'+g.P+\'">\'+g.A.C+\'</a>\');g.G.1c(r.1c(b,\' \',a));b.1A(6(){3(!g.F(\'20\',c,g))8 u;g.n--;g.X.Z=u;g.J[d]=W;$(c).C();$(5).1r().C();$(g.X).1s({1t:\'\',1u:\'\'});$(g.X).15().17(\'\').H(\'j\',\'\')[0].j=\'\';3(!g.F(\'22\',c,g))8 u;8 u});3(!g.F(\'23\',c,g))8 u};3(!g.2)g.11(g.e,0);g.n++;g.E.Y(\'2\',g)})};$.O($.7.2,{15:6(){l a=$(5).Y(\'2\');3(a)a.G.24(\'a.2-C\').1A();8 $(5)},12:6(a){a=q(a||\'1B\');l o=[];$(\'1a:m\').L(6(){3($(5).17()==\'\')o[o.U]=5});8 $(o).L(6(){5.Z=1d}).S(a)},19:6(a){a=q(a||\'1B\');8 $(\'1a:m.\'+a).27(a).L(6(){5.Z=u})},R:{},1i:6(b,c,d){l e,j;d=d||[
];3(d.1E.1F().1G("1H")<0)d=[d];3(18(b)==\'6\'){$.7.2.12();j=b.10(c||Q,d);$.7.2.19();8 j};3(b.1E.1F().1G("1H")<0)b=[b];1o(l i=0;i<b.U;i++){e=b[i]+\'\';3(e)(6(a){$.7.2.R[a]=$.7[a]||6(){};$.7[a]=6(){$.7.2.12();j=$.7.2.R[a].10(5,T);$.7.2.19();8 j}})(e)}}});$.7.2.I={p:\'\',k:-1,1j:\'$D\',A:{C:\'x\',1n:\'2c 2d 2e a $1b m.\\2f 2g...\',m:\'$m\',14:\'2h 14: $m\',1p:\'2i m 2j 2k 2l 14:\\n$m\'},13:[\'1k\',\'2m\',\'2n\'],1q:6(s){2p(s)}};$.7.15=6(){8 5.L(6(){2q{5.15()}2r(e){}})};$(6(){$("1a[2s=m].21").2()})})(1w);',62,155,'||MultiFile|if||this|function|fn|return|||||||||||value|max|var|file|||accept|String|||gi|false||||replace||STRING|match|remove|name||trigger|list|attr|options|slaves|id|each|div|clone|extend|wrapID|window|intercepted|addClass|arguments|length|class|null|current|data|disabled|apply|addSlave|disableEmpty|autoIntercept|selected|reset|applied|val|typeof|reEnableEmpty|input|ext|append|true|new|instanceKey|generateID|_list|intercept|namePattern|submit|not|rxAccept|denied|fo
r|duplicate|error|parent|css|position|top|addToList|jQuery|span|title|wrap|click|mfD|wrapper|metadata|constructor|toString|indexOf|Array|className|string|_wrap|_F|absolute|maxlength|3000px|after|meta|afterFileSelect|limit|change|label|blur|onFileSelect|form|href|slice|onFileRemove|multi|afterFileRemove|afterFileAppend|find|Number|number|removeClass|makeArray|in|files|RegExp|You|cannot|select|nTry|again|File|This|has|already|been|ajaxSubmit|validate|else|alert|try|catch|type|prepend|onFileAppend'.split('|'),0,{}))
\ No newline at end of file
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/*
+ ### jQuery Multiple File Upload Plugin v1.44 - 2009-04-08 ###
+ * Home: http://www.fyneworks.com/jquery/multiple-file-upload/
+ * Code: http://code.google.com/p/jquery-multifile-plugin/
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ ###
+*/
+eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';3(Q.1w)(6($){$.7.2=6(h){3(5.U==0)8 5;3(18 T[0]==\'1J\'){3(5.U>1){l i=T;8 5.L(6(){$.7.2.10($(5),i)})};$.7.2[T[0]].10(5,$.28(T).1Z(1)||[]);8 5};l h=$.O({},$.7.2.I,h||{});$(\'1X\').1l(\'2-R\').S(\'2-R\').1k($.7.2.12);3($.7.2.I.13){$.7.2.1i($.7.2.I.13);$.7.2.I.13=W};5.1l(\'.2-16\').S(\'2-16\').L(6(){Q.2=(Q.2||0)+1;l e=Q.2;l g={e:5,E:$(5),N:$(5).N()};3(18 h==\'26\')h={k:h};l o=$.O({},$.7.2.I,h||{},($.1D?g.E.1D():($.1Q?g.E.Y():W))||{},{});3(!(o.k>0)){o.k=g.E.H(\'1N\');3(!(o.k>0)){o.k=(q(g.e.1I.B(/\\b(k|1S)\\-([0-9]+)\\b/t)||[\'\']).B(/[0-9]+/t)||[\'\'])[0];3(!(o.k>0))o.k=-1;2o o.k=q(o.k).B(/[0-9]+/t)[0]}};o.k=1e 25(o.k);o.p=o.p||g.E.H(\'p\')||\'\';3(!o.p){o.p=
(g.e.1I.B(/\\b(p\\-[\\w\\|]+)\\b/t))||\'\';o.p=1e q(o.p).y(/^(p|1b)\\-/i,\'\')};$.O(g,o||{});g.A=$.O({},$.7.2.I.A,g.A);$.O(g,{n:0,J:[],2a:[],1f:g.e.K||\'2\'+q(e),1g:6(z){8 g.1f+(z>0?\'1L\'+q(z):\'\')},F:6(a,b){l c=g[a],j=$(b).H(\'j\');3(c){l d=c(b,j,g);3(d!=W)8 d}8 1d}});3(q(g.p).U>1){g.1m=1e 2b(\'\\\\.(\'+(g.p?g.p:\'\')+\')$\',\'t\')};g.P=g.1f+\'1K\';g.E.1z(\'<M V="2-1z" K="\'+g.P+\'"></M>\');g.1C=$(\'#\'+g.P+\'\');g.e.D=g.e.D||\'m\'+e+\'[]\';3(!g.G){g.1C.1c(\'<M V="2-G" K="\'+g.P+\'1h"></M>\');g.G=$(\'#\'+g.P+\'1h\')};g.G=$(g.G);g.11=6(c,d){g.n++;c.2=g;3(d>0)c.K=c.D=\'\';3(d>0)c.K=g.1g(d);c.D=q(g.1j.y(/\\$D/t,$(g.N).H(\'D\')).y(/\\$K/t,$(g.N).H(\'K\')).y(/\\$g/t,e).y(/\\$i/t,d));3((g.k>0)&&((g.n-1)>(g.k)))c.Z=1d;g.X=g.J[d]=c;c=$(c);c.17(\'\').H(\'j\',\'\')[0].j=\'\';c.S(\'2-16\');c.1T(6(){$(5).1V();3(!g.F(\'1W\',5,g))8 u;l a=\'\',v=q(5.j||\'\');3(g.p&&v&&!v.B(g.1m))a=g.A.1n.y(\'$1b\',q(v.B(/\\.\\w{1,4}$/t)));1o(l f 29 g.J)3(g.J[f]&&g.J[f]!=5)3(g.J[f].j==v)a=g.A.1p.y(\'$m\'
,v.B(/[^\\/\\\\]+$/t));l b=$(g.N).N();b.S(\'2\');3(a!=\'\'){g.1q(a);g.n--;g.11(b[0],d);c.1r().2t(b);c.C();8 u};$(5).1s({1t:\'1M\',1u:\'-1O\'});c.1P(b);g.1v(5,d);g.11(b[0],d+1);3(!g.F(\'1R\',5,g))8 u});$(c).Y(\'2\',g)};g.1v=6(c,d){3(!g.F(\'2u\',c,g))8 u;l r=$(\'<M V="2-1U"></M>\'),v=q(c.j||\'\'),a=$(\'<1x V="2-1y" 1y="\'+g.A.14.y(\'$m\',v)+\'">\'+g.A.m.y(\'$m\',v.B(/[^\\/\\\\]+$/t)[0])+\'</1x>\'),b=$(\'<a V="2-C" 1Y="#\'+g.P+\'">\'+g.A.C+\'</a>\');g.G.1c(r.1c(b,\' \',a));b.1A(6(){3(!g.F(\'20\',c,g))8 u;g.n--;g.X.Z=u;g.J[d]=W;$(c).C();$(5).1r().C();$(g.X).1s({1t:\'\',1u:\'\'});$(g.X).15().17(\'\').H(\'j\',\'\')[0].j=\'\';3(!g.F(\'22\',c,g))8 u;8 u});3(!g.F(\'23\',c,g))8 u};3(!g.2)g.11(g.e,0);g.n++;g.E.Y(\'2\',g)})};$.O($.7.2,{15:6(){l a=$(5).Y(\'2\');3(a)a.G.24(\'a.2-C\').1A();8 $(5)},12:6(a){a=q(a||\'1B\');l o=[];$(\'1a:m\').L(6(){3($(5).17()==\'\')o[o.U]=5});8 $(o).L(6(){5.Z=1d}).S(a)},19:6(a){a=q(a||\'1B\');8 $(\'1a:m.\'+a).27(a).L(6(){5.Z=u})},R:{},1i:6(b,c,d){l e,j;d=d||[
];3(d.1E.1F().1G("1H")<0)d=[d];3(18(b)==\'6\'){$.7.2.12();j=b.10(c||Q,d);$.7.2.19();8 j};3(b.1E.1F().1G("1H")<0)b=[b];1o(l i=0;i<b.U;i++){e=b[i]+\'\';3(e)(6(a){$.7.2.R[a]=$.7[a]||6(){};$.7[a]=6(){$.7.2.12();j=$.7.2.R[a].10(5,T);$.7.2.19();8 j}})(e)}}});$.7.2.I={p:\'\',k:-1,1j:\'$D\',A:{C:\'x\',1n:\'2c 2d 2e a $1b m.\\2f 2g...\',m:\'$m\',14:\'2h 14: $m\',1p:\'2i m 2j 2k 2l 14:\\n$m\'},13:[\'1k\',\'2m\',\'2n\'],1q:6(s){2p(s)}};$.7.15=6(){8 5.L(6(){2q{5.15()}2r(e){}})};$(6(){$("1a[2s=m].21").2()})})(1w);',62,155,'||MultiFile|if||this|function|fn|return|||||||||||value|max|var|file|||accept|String|||gi|false||||replace||STRING|match|remove|name||trigger|list|attr|options|slaves|id|each|div|clone|extend|wrapID|window|intercepted|addClass|arguments|length|class|null|current|data|disabled|apply|addSlave|disableEmpty|autoIntercept|selected|reset|applied|val|typeof|reEnableEmpty|input|ext|append|true|new|instanceKey|generateID|_list|intercept|namePattern|submit|not|rxAccept|denied|fo
r|duplicate|error|parent|css|position|top|addToList|jQuery|span|title|wrap|click|mfD|wrapper|metadata|constructor|toString|indexOf|Array|className|string|_wrap|_F|absolute|maxlength|3000px|after|meta|afterFileSelect|limit|change|label|blur|onFileSelect|form|href|slice|onFileRemove|multi|afterFileRemove|afterFileAppend|find|Number|number|removeClass|makeArray|in|files|RegExp|You|cannot|select|nTry|again|File|This|has|already|been|ajaxSubmit|validate|else|alert|try|catch|type|prepend|onFileAppend'.split('|'),0,{}))
Modified: incubator/clerezza/trunk/parent/web.resources.jquery/src/main/resources/org/apache/clerezza/web/resources/jquery/staticweb/jquery.ajaxQueue.js
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/parent/web.resources.jquery/src/main/resources/org/apache/clerezza/web/resources/jquery/staticweb/jquery.ajaxQueue.js?rev=1145568&r1=1145567&r2=1145568&view=diff
==============================================================================
--- incubator/clerezza/trunk/parent/web.resources.jquery/src/main/resources/org/apache/clerezza/web/resources/jquery/staticweb/jquery.ajaxQueue.js (original)
+++ incubator/clerezza/trunk/parent/web.resources.jquery/src/main/resources/org/apache/clerezza/web/resources/jquery/staticweb/jquery.ajaxQueue.js Tue Jul 12 12:37:23 2011
@@ -1,116 +1,137 @@
-/**
- * Ajax Queue Plugin
- *
- * Homepage: http://jquery.com/plugins/project/ajaxqueue
- * Documentation: http://docs.jquery.com/AjaxQueue
- */
-
-/**
-
-<script>
-$(function(){
- jQuery.ajaxQueue({
- url: "test.php",
- success: function(html){ jQuery("ul").append(html); }
- });
- jQuery.ajaxQueue({
- url: "test.php",
- success: function(html){ jQuery("ul").append(html); }
- });
- jQuery.ajaxSync({
- url: "test.php",
- success: function(html){ jQuery("ul").append("<b>"+html+"</b>"); }
- });
- jQuery.ajaxSync({
- url: "test.php",
- success: function(html){ jQuery("ul").append("<b>"+html+"</b>"); }
- });
-});
-</script>
-<ul style="position: absolute; top: 5px; right: 5px;"></ul>
-
- */
-/*
- * Queued Ajax requests.
- * A new Ajax request won't be started until the previous queued
- * request has finished.
- */
-
-/*
- * Synced Ajax requests.
- * The Ajax request will happen as soon as you call this method, but
- * the callbacks (success/error/complete) won't fire until all previous
- * synced requests have been completed.
- */
-
-
-(function($) {
-
- var ajax = $.ajax;
-
- var pendingRequests = {};
-
- var synced = [];
- var syncedData = [];
-
- $.ajax = function(settings) {
- // create settings for compatibility with ajaxSetup
- settings = jQuery.extend(settings, jQuery.extend({}, jQuery.ajaxSettings, settings));
-
- var port = settings.port;
-
- switch(settings.mode) {
- case "abort":
- if ( pendingRequests[port] ) {
- pendingRequests[port].abort();
- }
- return pendingRequests[port] = ajax.apply(this, arguments);
- case "queue":
- var _old = settings.complete;
- settings.complete = function(){
- if ( _old )
- _old.apply( this, arguments );
- jQuery([ajax]).dequeue("ajax" + port );;
- };
-
- jQuery([ ajax ]).queue("ajax" + port, function(){
- ajax( settings );
- });
- return;
- case "sync":
- var pos = synced.length;
-
- synced[ pos ] = {
- error: settings.error,
- success: settings.success,
- complete: settings.complete,
- done: false
- };
-
- syncedData[ pos ] = {
- error: [],
- success: [],
- complete: []
- };
-
- settings.error = function(){ syncedData[ pos ].error = arguments; };
- settings.success = function(){ syncedData[ pos ].success = arguments; };
- settings.complete = function(){
- syncedData[ pos ].complete = arguments;
- synced[ pos ].done = true;
-
- if ( pos == 0 || !synced[ pos-1 ] )
- for ( var i = pos; i < synced.length && synced[i].done; i++ ) {
- if ( synced[i].error ) synced[i].error.apply( jQuery, syncedData[i].error );
- if ( synced[i].success ) synced[i].success.apply( jQuery, syncedData[i].success );
- if ( synced[i].complete ) synced[i].complete.apply( jQuery, syncedData[i].complete );
-
- synced[i] = null;
- syncedData[i] = null;
- }
- };
- }
- return ajax.apply(this, arguments);
- };
-
-})(jQuery);
\ No newline at end of file
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/**
+ * Ajax Queue Plugin
+ *
+ * Homepage: http://jquery.com/plugins/project/ajaxqueue
+ * Documentation: http://docs.jquery.com/AjaxQueue
+ */
+
+/**
+
+<script>
+$(function(){
+ jQuery.ajaxQueue({
+ url: "test.php",
+ success: function(html){ jQuery("ul").append(html); }
+ });
+ jQuery.ajaxQueue({
+ url: "test.php",
+ success: function(html){ jQuery("ul").append(html); }
+ });
+ jQuery.ajaxSync({
+ url: "test.php",
+ success: function(html){ jQuery("ul").append("<b>"+html+"</b>"); }
+ });
+ jQuery.ajaxSync({
+ url: "test.php",
+ success: function(html){ jQuery("ul").append("<b>"+html+"</b>"); }
+ });
+});
+</script>
+<ul style="position: absolute; top: 5px; right: 5px;"></ul>
+
+ */
+/*
+ * Queued Ajax requests.
+ * A new Ajax request won't be started until the previous queued
+ * request has finished.
+ */
+
+/*
+ * Synced Ajax requests.
+ * The Ajax request will happen as soon as you call this method, but
+ * the callbacks (success/error/complete) won't fire until all previous
+ * synced requests have been completed.
+ */
+
+
+(function($) {
+
+ var ajax = $.ajax;
+
+ var pendingRequests = {};
+
+ var synced = [];
+ var syncedData = [];
+
+ $.ajax = function(settings) {
+ // create settings for compatibility with ajaxSetup
+ settings = jQuery.extend(settings, jQuery.extend({}, jQuery.ajaxSettings, settings));
+
+ var port = settings.port;
+
+ switch(settings.mode) {
+ case "abort":
+ if ( pendingRequests[port] ) {
+ pendingRequests[port].abort();
+ }
+ return pendingRequests[port] = ajax.apply(this, arguments);
+ case "queue":
+ var _old = settings.complete;
+ settings.complete = function(){
+ if ( _old )
+ _old.apply( this, arguments );
+ jQuery([ajax]).dequeue("ajax" + port );;
+ };
+
+ jQuery([ ajax ]).queue("ajax" + port, function(){
+ ajax( settings );
+ });
+ return;
+ case "sync":
+ var pos = synced.length;
+
+ synced[ pos ] = {
+ error: settings.error,
+ success: settings.success,
+ complete: settings.complete,
+ done: false
+ };
+
+ syncedData[ pos ] = {
+ error: [],
+ success: [],
+ complete: []
+ };
+
+ settings.error = function(){ syncedData[ pos ].error = arguments; };
+ settings.success = function(){ syncedData[ pos ].success = arguments; };
+ settings.complete = function(){
+ syncedData[ pos ].complete = arguments;
+ synced[ pos ].done = true;
+
+ if ( pos == 0 || !synced[ pos-1 ] )
+ for ( var i = pos; i < synced.length && synced[i].done; i++ ) {
+ if ( synced[i].error ) synced[i].error.apply( jQuery, syncedData[i].error );
+ if ( synced[i].success ) synced[i].success.apply( jQuery, syncedData[i].success );
+ if ( synced[i].complete ) synced[i].complete.apply( jQuery, syncedData[i].complete );
+
+ synced[i] = null;
+ syncedData[i] = null;
+ }
+ };
+ }
+ return ajax.apply(this, arguments);
+ };
+
+})(jQuery);
Modified: incubator/clerezza/trunk/parent/web.resources.jquery/src/main/resources/org/apache/clerezza/web/resources/jquery/staticweb/jquery.autocomplete.min.js
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/parent/web.resources.jquery/src/main/resources/org/apache/clerezza/web/resources/jquery/staticweb/jquery.autocomplete.min.js?rev=1145568&r1=1145567&r2=1145568&view=diff
==============================================================================
--- incubator/clerezza/trunk/parent/web.resources.jquery/src/main/resources/org/apache/clerezza/web/resources/jquery/staticweb/jquery.autocomplete.min.js (original)
+++ incubator/clerezza/trunk/parent/web.resources.jquery/src/main/resources/org/apache/clerezza/web/resources/jquery/staticweb/jquery.autocomplete.min.js Tue Jul 12 12:37:23 2011
@@ -1,4 +1,25 @@
/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/*
* jQuery Autocomplete plugin 1.1
*
* Copyright (c) 2009 Jörn Zaefferer
@@ -10,4 +31,4 @@
* Revision: $Id: jquery.autocomplete.js 15 2009-08-22 10:30:27Z joern.zaefferer $
*/;(function($){$.fn.extend({autocomplete:function(urlOrData,options){var isUrl=typeof urlOrData=="string";options=$.extend({},$.Autocompleter.defaults,{url:isUrl?urlOrData:null,data:isUrl?null:urlOrData,delay:isUrl?$.Autocompleter.defaults.delay:10,max:options&&!options.scroll?10:150},options);options.highlight=options.highlight||function(value){return value;};options.formatMatch=options.formatMatch||options.formatItem;return this.each(function(){new $.Autocompleter(this,options);});},result:function(handler){return this.bind("result",handler);},search:function(handler){return this.trigger("search",[handler]);},flushCache:function(){return this.trigger("flushCache");},setOptions:function(options){return this.trigger("setOptions",[options]);},unautocomplete:function(){return this.trigger("unautocomplete");}});$.Autocompleter=function(input,options){var KEY={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var $input=$(input).attr("aut
ocomplete","off").addClass(options.inputClass);var timeout;var previousValue="";var cache=$.Autocompleter.Cache(options);var hasFocus=0;var lastKeyPressCode;var config={mouseDownOnSelect:false};var select=$.Autocompleter.Select(options,input,selectCurrent,config);var blockSubmit;$.browser.opera&&$(input.form).bind("submit.autocomplete",function(){if(blockSubmit){blockSubmit=false;return false;}});$input.bind(($.browser.opera?"keypress":"keydown")+".autocomplete",function(event){hasFocus=1;lastKeyPressCode=event.keyCode;switch(event.keyCode){case KEY.UP:event.preventDefault();if(select.visible()){select.prev();}else{onChange(0,true);}break;case KEY.DOWN:event.preventDefault();if(select.visible()){select.next();}else{onChange(0,true);}break;case KEY.PAGEUP:event.preventDefault();if(select.visible()){select.pageUp();}else{onChange(0,true);}break;case KEY.PAGEDOWN:event.preventDefault();if(select.visible()){select.pageDown();}else{onChange(0,true);}break;case options.multiple&&$
.trim(options.multipleSeparator)==","&&KEY.COMMA:case KEY.TAB:case KEY.RETURN:if(selectCurrent()){event.preventDefault();blockSubmit=true;return false;}break;case KEY.ESC:select.hide();break;default:clearTimeout(timeout);timeout=setTimeout(onChange,options.delay);break;}}).focus(function(){hasFocus++;}).blur(function(){hasFocus=0;if(!config.mouseDownOnSelect){hideResults();}}).click(function(){if(hasFocus++>1&&!select.visible()){onChange(0,true);}}).bind("search",function(){var fn=(arguments.length>1)?arguments[1]:null;function findValueCallback(q,data){var result;if(data&&data.length){for(var i=0;i<data.length;i++){if(data[i].result.toLowerCase()==q.toLowerCase()){result=data[i];break;}}}if(typeof fn=="function")fn(result);else $input.trigger("result",result&&[result.data,result.value]);}$.each(trimWords($input.val()),function(i,value){request(value,findValueCallback,findValueCallback);});}).bind("flushCache",function(){cache.flush();}).bind("setOptions",function(){$.extend
(options,arguments[1]);if("data"in arguments[1])cache.populate();}).bind("unautocomplete",function(){select.unbind();$input.unbind();$(input.form).unbind(".autocomplete");});function selectCurrent(){var selected=select.selected();if(!selected)return false;var v=selected.result;previousValue=v;if(options.multiple){var words=trimWords($input.val());if(words.length>1){var seperator=options.multipleSeparator.length;var cursorAt=$(input).selection().start;var wordAt,progress=0;$.each(words,function(i,word){progress+=word.length;if(cursorAt<=progress){wordAt=i;return false;}progress+=seperator;});words[wordAt]=v;v=words.join(options.multipleSeparator);}v+=options.multipleSeparator;}$input.val(v);hideResultsNow();$input.trigger("result",[selected.data,selected.value]);return true;}function onChange(crap,skipPrevCheck){if(lastKeyPressCode==KEY.DEL){select.hide();return;}var currentValue=$input.val();if(!skipPrevCheck&¤tValue==previousValue)return;previousValue=currentValue;cur
rentValue=lastWord(currentValue);if(currentValue.length>=options.minChars){$input.addClass(options.loadingClass);if(!options.matchCase)currentValue=currentValue.toLowerCase();request(currentValue,receiveData,hideResultsNow);}else{stopLoading();select.hide();}};function trimWords(value){if(!value)return[""];if(!options.multiple)return[$.trim(value)];return $.map(value.split(options.multipleSeparator),function(word){return $.trim(value).length?$.trim(word):null;});}function lastWord(value){if(!options.multiple)return value;var words=trimWords(value);if(words.length==1)return words[0];var cursorAt=$(input).selection().start;if(cursorAt==value.length){words=trimWords(value)}else{words=trimWords(value.replace(value.substring(cursorAt),""));}return words[words.length-1];}function autoFill(q,sValue){if(options.autoFill&&(lastWord($input.val()).toLowerCase()==q.toLowerCase())&&lastKeyPressCode!=KEY.BACKSPACE){$input.val($input.val()+sValue.substring(lastWord(previousValue).length));
$(input).selection(previousValue.length,previousValue.length+sValue.length);}};function hideResults(){clearTimeout(timeout);timeout=setTimeout(hideResultsNow,200);};function hideResultsNow(){var wasVisible=select.visible();select.hide();clearTimeout(timeout);stopLoading();if(options.mustMatch){$input.search(function(result){if(!result){if(options.multiple){var words=trimWords($input.val()).slice(0,-1);$input.val(words.join(options.multipleSeparator)+(words.length?options.multipleSeparator:""));}else{$input.val("");$input.trigger("result",null);}}});}};function receiveData(q,data){if(data&&data.length&&hasFocus){stopLoading();select.display(data,q);autoFill(q,data[0].value);select.show();}else{hideResultsNow();}};function request(term,success,failure){if(!options.matchCase)term=term.toLowerCase();var data=cache.load(term);if(data&&data.length){success(term,data);}else if((typeof options.url=="string")&&(options.url.length>0)){var extraParams={timestamp:+new Date()};$.each(opt
ions.extraParams,function(key,param){extraParams[key]=typeof param=="function"?param():param;});$.ajax({mode:"abort",port:"autocomplete"+input.name,dataType:options.dataType,url:options.url,data:$.extend({q:lastWord(term),limit:options.max},extraParams),success:function(data){var parsed=options.parse&&options.parse(data)||parse(data);cache.add(term,parsed);success(term,parsed);}});}else{select.emptyList();failure(term);}};function parse(data){var parsed=[];var rows=data.split("\n");for(var i=0;i<rows.length;i++){var row=$.trim(rows[i]);if(row){row=row.split("|");parsed[parsed.length]={data:row,value:row[0],result:options.formatResult&&options.formatResult(row,row[0])||row[0]};}}return parsed;};function stopLoading(){$input.removeClass(options.loadingClass);};};$.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extra
Params:{},selectFirst:true,formatItem:function(row){return row[0];},formatMatch:null,autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(value,term){return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>");},scroll:true,scrollHeight:180};$.Autocompleter.Cache=function(options){var data={};var length=0;function matchSubset(s,sub){if(!options.matchCase)s=s.toLowerCase();var i=s.indexOf(sub);if(options.matchContains=="word"){i=s.toLowerCase().search("\\b"+sub.toLowerCase());}if(i==-1)return false;return i==0||options.matchContains;};function add(q,value){if(length>options.cacheLength){flush();}if(!data[q]){length++;}data[q]=value;}function populate(){if(!options.data)return false;var stMatchSets={},nullData=0;if(!options.url)options.cacheLength=1;stMatchSets[""]=[];for(var i=0,ol=options.data.length;i<ol;i++){var rawValue=options.data[i];
rawValue=(typeof rawValue=="string")?[rawValue]:rawValue;var value=options.formatMatch(rawValue,i+1,options.data.length);if(value===false)continue;var firstChar=value.charAt(0).toLowerCase();if(!stMatchSets[firstChar])stMatchSets[firstChar]=[];var row={value:value,data:rawValue,result:options.formatResult&&options.formatResult(rawValue)||value};stMatchSets[firstChar].push(row);if(nullData++<options.max){stMatchSets[""].push(row);}};$.each(stMatchSets,function(i,value){options.cacheLength++;add(i,value);});}setTimeout(populate,25);function flush(){data={};length=0;}return{flush:flush,add:add,populate:populate,load:function(q){if(!options.cacheLength||!length)return null;if(!options.url&&options.matchContains){var csub=[];for(var k in data){if(k.length>0){var c=data[k];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub.push(x);}});}}return csub;}else
if(data[q]){return data[q];}else
-if(options.matchSubset){for(var i=q.length-1;i>=options.minChars;i--){var c=data[q.substr(0,i)];if(c){var csub=[];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub[csub.length]=x;}});return csub;}}}return null;}};};$.Autocompleter.Select=function(options,input,select,config){var CLASSES={ACTIVE:"ac_over"};var listItems,active=-1,data,term="",needsInit=true,element,list;function init(){if(!needsInit)return;element=$("<div/>").hide().addClass(options.resultsClass).css("position","absolute").appendTo(document.body);list=$("<ul/>").appendTo(element).mouseover(function(event){if(target(event).nodeName&&target(event).nodeName.toUpperCase()=='LI'){active=$("li",list).removeClass(CLASSES.ACTIVE).index(target(event));$(target(event)).addClass(CLASSES.ACTIVE);}}).click(function(event){$(target(event)).addClass(CLASSES.ACTIVE);select();input.focus();return false;}).mousedown(function(){config.mouseDownOnSelect=true;}).mouseup(function(){config.mouseDownOnSelect=false;});if(options
.width>0)element.css("width",options.width);needsInit=false;}function target(event){var element=event.target;while(element&&element.tagName!="LI")element=element.parentNode;if(!element)return[];return element;}function moveSelect(step){listItems.slice(active,active+1).removeClass(CLASSES.ACTIVE);movePosition(step);var activeItem=listItems.slice(active,active+1).addClass(CLASSES.ACTIVE);if(options.scroll){var offset=0;listItems.slice(0,active).each(function(){offset+=this.offsetHeight;});if((offset+activeItem[0].offsetHeight-list.scrollTop())>list[0].clientHeight){list.scrollTop(offset+activeItem[0].offsetHeight-list.innerHeight());}else if(offset<list.scrollTop()){list.scrollTop(offset);}}};function movePosition(step){active+=step;if(active<0){active=listItems.size()-1;}else if(active>=listItems.size()){active=0;}}function limitNumberOfItems(available){return options.max&&options.max<available?options.max:available;}function fillList(){list.empty();var max=limitNumberOfItems
(data.length);for(var i=0;i<max;i++){if(!data[i])continue;var formatted=options.formatItem(data[i].data,i+1,max,data[i].value,term);if(formatted===false)continue;var li=$("<li/>").html(options.highlight(formatted,term)).addClass(i%2==0?"ac_even":"ac_odd").appendTo(list)[0];$.data(li,"ac_data",data[i]);}listItems=list.find("li");if(options.selectFirst){listItems.slice(0,1).addClass(CLASSES.ACTIVE);active=0;}if($.fn.bgiframe)list.bgiframe();}return{display:function(d,q){init();data=d;term=q;fillList();},next:function(){moveSelect(1);},prev:function(){moveSelect(-1);},pageUp:function(){if(active!=0&&active-8<0){moveSelect(-active);}else{moveSelect(-8);}},pageDown:function(){if(active!=listItems.size()-1&&active+8>listItems.size()){moveSelect(listItems.size()-1-active);}else{moveSelect(8);}},hide:function(){element&&element.hide();listItems&&listItems.removeClass(CLASSES.ACTIVE);active=-1;},visible:function(){return element&&element.is(":visible");},current:function(){return thi
s.visible()&&(listItems.filter("."+CLASSES.ACTIVE)[0]||options.selectFirst&&listItems[0]);},show:function(){var offset=$(input).offset();element.css({width:typeof options.width=="string"||options.width>0?options.width:$(input).width(),top:offset.top+input.offsetHeight,left:offset.left}).show();if(options.scroll){list.scrollTop(0);list.css({maxHeight:options.scrollHeight,overflow:'auto'});if($.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var listHeight=0;listItems.each(function(){listHeight+=this.offsetHeight;});var scrollbarsVisible=listHeight>options.scrollHeight;list.css('height',scrollbarsVisible?options.scrollHeight:listHeight);if(!scrollbarsVisible){listItems.width(list.width()-parseInt(listItems.css("padding-left"))-parseInt(listItems.css("padding-right")));}}}},selected:function(){var selected=listItems&&listItems.filter("."+CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);return selected&&selected.length&&$.data(selected[0],"ac_data");},emptyList:func
tion(){list&&list.empty();},unbind:function(){element&&element.remove();}};};$.fn.selection=function(start,end){if(start!==undefined){return this.each(function(){if(this.createTextRange){var selRange=this.createTextRange();if(end===undefined||start==end){selRange.move("character",start);selRange.select();}else{selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select();}}else if(this.setSelectionRange){this.setSelectionRange(start,end);}else if(this.selectionStart){this.selectionStart=start;this.selectionEnd=end;}});}var field=this[0];if(field.createTextRange){var range=document.selection.createRange(),orig=field.value,teststring="<->",textLength=range.text.length;range.text=teststring;var caretAt=field.value.indexOf(teststring);field.value=orig;this.selection(caretAt,caretAt+textLength);return{start:caretAt,end:caretAt+textLength}}else if(field.selectionStart!==undefined){return{start:field.selectionStart,end:field.selec
tionEnd}}};})(jQuery);
\ No newline at end of file
+if(options.matchSubset){for(var i=q.length-1;i>=options.minChars;i--){var c=data[q.substr(0,i)];if(c){var csub=[];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub[csub.length]=x;}});return csub;}}}return null;}};};$.Autocompleter.Select=function(options,input,select,config){var CLASSES={ACTIVE:"ac_over"};var listItems,active=-1,data,term="",needsInit=true,element,list;function init(){if(!needsInit)return;element=$("<div/>").hide().addClass(options.resultsClass).css("position","absolute").appendTo(document.body);list=$("<ul/>").appendTo(element).mouseover(function(event){if(target(event).nodeName&&target(event).nodeName.toUpperCase()=='LI'){active=$("li",list).removeClass(CLASSES.ACTIVE).index(target(event));$(target(event)).addClass(CLASSES.ACTIVE);}}).click(function(event){$(target(event)).addClass(CLASSES.ACTIVE);select();input.focus();return false;}).mousedown(function(){config.mouseDownOnSelect=true;}).mouseup(function(){config.mouseDownOnSelect=false;});if(options
.width>0)element.css("width",options.width);needsInit=false;}function target(event){var element=event.target;while(element&&element.tagName!="LI")element=element.parentNode;if(!element)return[];return element;}function moveSelect(step){listItems.slice(active,active+1).removeClass(CLASSES.ACTIVE);movePosition(step);var activeItem=listItems.slice(active,active+1).addClass(CLASSES.ACTIVE);if(options.scroll){var offset=0;listItems.slice(0,active).each(function(){offset+=this.offsetHeight;});if((offset+activeItem[0].offsetHeight-list.scrollTop())>list[0].clientHeight){list.scrollTop(offset+activeItem[0].offsetHeight-list.innerHeight());}else if(offset<list.scrollTop()){list.scrollTop(offset);}}};function movePosition(step){active+=step;if(active<0){active=listItems.size()-1;}else if(active>=listItems.size()){active=0;}}function limitNumberOfItems(available){return options.max&&options.max<available?options.max:available;}function fillList(){list.empty();var max=limitNumberOfItems
(data.length);for(var i=0;i<max;i++){if(!data[i])continue;var formatted=options.formatItem(data[i].data,i+1,max,data[i].value,term);if(formatted===false)continue;var li=$("<li/>").html(options.highlight(formatted,term)).addClass(i%2==0?"ac_even":"ac_odd").appendTo(list)[0];$.data(li,"ac_data",data[i]);}listItems=list.find("li");if(options.selectFirst){listItems.slice(0,1).addClass(CLASSES.ACTIVE);active=0;}if($.fn.bgiframe)list.bgiframe();}return{display:function(d,q){init();data=d;term=q;fillList();},next:function(){moveSelect(1);},prev:function(){moveSelect(-1);},pageUp:function(){if(active!=0&&active-8<0){moveSelect(-active);}else{moveSelect(-8);}},pageDown:function(){if(active!=listItems.size()-1&&active+8>listItems.size()){moveSelect(listItems.size()-1-active);}else{moveSelect(8);}},hide:function(){element&&element.hide();listItems&&listItems.removeClass(CLASSES.ACTIVE);active=-1;},visible:function(){return element&&element.is(":visible");},current:function(){return thi
s.visible()&&(listItems.filter("."+CLASSES.ACTIVE)[0]||options.selectFirst&&listItems[0]);},show:function(){var offset=$(input).offset();element.css({width:typeof options.width=="string"||options.width>0?options.width:$(input).width(),top:offset.top+input.offsetHeight,left:offset.left}).show();if(options.scroll){list.scrollTop(0);list.css({maxHeight:options.scrollHeight,overflow:'auto'});if($.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var listHeight=0;listItems.each(function(){listHeight+=this.offsetHeight;});var scrollbarsVisible=listHeight>options.scrollHeight;list.css('height',scrollbarsVisible?options.scrollHeight:listHeight);if(!scrollbarsVisible){listItems.width(list.width()-parseInt(listItems.css("padding-left"))-parseInt(listItems.css("padding-right")));}}}},selected:function(){var selected=listItems&&listItems.filter("."+CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);return selected&&selected.length&&$.data(selected[0],"ac_data");},emptyList:func
tion(){list&&list.empty();},unbind:function(){element&&element.remove();}};};$.fn.selection=function(start,end){if(start!==undefined){return this.each(function(){if(this.createTextRange){var selRange=this.createTextRange();if(end===undefined||start==end){selRange.move("character",start);selRange.select();}else{selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select();}}else if(this.setSelectionRange){this.setSelectionRange(start,end);}else if(this.selectionStart){this.selectionStart=start;this.selectionEnd=end;}});}var field=this[0];if(field.createTextRange){var range=document.selection.createRange(),orig=field.value,teststring="<->",textLength=range.text.length;range.text=teststring;var caretAt=field.value.indexOf(teststring);field.value=orig;this.selection(caretAt,caretAt+textLength);return{start:caretAt,end:caretAt+textLength}}else if(field.selectionStart!==undefined){return{start:field.selectionStart,end:field.selec
tionEnd}}};})(jQuery);