diff --git a/README.md b/README.md
index 572d1e6..ae3ca68 100644
--- a/README.md
+++ b/README.md
@@ -10,3 +10,4 @@ Every other project is owned by the original owner, I'm just aggregating for my
* [Ajax File Upload](http://phpletter.com/Our-Projects/AjaxFileUpload/)
* [jQuery UI Timepicker Addon](http://trentrichardson.com/examples/timepicker/)
* [underscore.string](https://github.com/edtsech/underscore.string)
+* [jScroll](http://www.wduffy.co.uk/jScroll/)
diff --git a/Rakefile b/Rakefile
index 8ff0150..890d44b 100644
--- a/Rakefile
+++ b/Rakefile
@@ -2,30 +2,6 @@ require "bundler/gem_tasks"
require 'httparty'
require 'zip/zip'
-def process_zip_url(url, entries = {})
- mkdir_p 'tmp'
-
- response = HTTParty.get(url)
- File.open(target = 'tmp/elastic.zip', 'wb') { |fh| fh.print response.body }
-
- Zip::ZipFile.foreach(target) do |entry|
- entries.each do |search_entry, target_filename|
- if entry.name[search_entry]
- case File.extname(search_entry)
- when '.js'
- target = 'vendor/assets/javascripts'
- when '.css'
- target = 'vendor/assets/stylesheets'
- end
-
- entry.extract(File.join(target, target_filename))
- end
-
- yield entry if block_given?
- end
- end
-end
-
sources = {
'jquery.cookies' => [
'http://cookies.googlecode.com/svn/trunk/jquery.cookies.js'
@@ -55,9 +31,36 @@ sources = {
],
'underscore.string' => [
'https://raw.github.com/edtsech/underscore.string/master/lib/underscore.string.js'
+ ],
+ 'jScroll' => [
+ 'https://github.com/downloads/wduffy/jScroll/jquery.jscroll.js'
]
}
+def process_zip_url(url, entries = {})
+ mkdir_p 'tmp'
+
+ response = HTTParty.get(url)
+ File.open(target = 'tmp/elastic.zip', 'wb') { |fh| fh.print response.body }
+
+ Zip::ZipFile.foreach(target) do |entry|
+ entries.each do |search_entry, target_filename|
+ if entry.name[search_entry]
+ case File.extname(search_entry)
+ when '.js'
+ target = 'vendor/assets/javascripts'
+ when '.css'
+ target = 'vendor/assets/stylesheets'
+ end
+
+ entry.extract(File.join(target, target_filename))
+ end
+
+ yield entry if block_given?
+ end
+ end
+end
+
desc 'Update verything'
task :update do
rm_rf 'vendor/assets'
diff --git a/vendor/assets/javascripts/jquery-ui-timepicker-addon.js b/vendor/assets/javascripts/jquery-ui-timepicker-addon.js
index d72c481..ade2f29 100644
--- a/vendor/assets/javascripts/jquery-ui-timepicker-addon.js
+++ b/vendor/assets/javascripts/jquery-ui-timepicker-addon.js
@@ -1,8 +1,8 @@
/*
* jQuery timepicker addon
* By: Trent Richardson [http://trentrichardson.com]
-* Version 0.9.7
-* Last Modified: 10/02/2011
+* Version 0.9.8
+* Last Modified: 12/03/2011
*
* Copyright 2011 Trent Richardson
* Dual licensed under the MIT and GPL licenses.
@@ -12,15 +12,15 @@
* HERES THE CSS:
* .ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
* .ui-timepicker-div dl { text-align: left; }
-* .ui-timepicker-div dl dt { height: 25px; }
-* .ui-timepicker-div dl dd { margin: -25px 10px 10px 65px; }
+* .ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; }
+* .ui-timepicker-div dl dd { margin: 0 10px 10px 65px; }
* .ui-timepicker-div td { font-size: 90%; }
* .ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
*/
(function($) {
-$.extend($.ui, { timepicker: { version: "0.9.7" } });
+$.extend($.ui, { timepicker: { version: "0.9.8" } });
/* Time picker manager.
Use the singleton instance of this class, $.timepicker, to interact with the time picker.
@@ -54,10 +54,10 @@ function Timepicker() {
showMillisec: false,
showTimezone: false,
showTime: true,
- stepHour: 0.05,
- stepMinute: 0.05,
- stepSecond: 0.05,
- stepMillisec: 0.5,
+ stepHour: 1,
+ stepMinute: 1,
+ stepSecond: 1,
+ stepMillisec: 1,
hour: 0,
minute: 0,
second: 0,
@@ -83,7 +83,9 @@ function Timepicker() {
altFieldTimeOnly: true,
showTimepicker: true,
timezoneIso8609: false,
- timezoneList: null
+ timezoneList: null,
+ addSliderAccess: false,
+ sliderAccessArgs: null
};
$.extend(this._defaults, this.regional['']);
}
@@ -341,10 +343,10 @@ $.extend(Timepicker.prototype, {
// Added by Peter Medeiros:
// - Figure out what the hour/minute/second max should be based on the step values.
// - Example: if stepMinute is 15, then minMax is 45.
- hourMax = (o.hourMax - ((o.hourMax - o.hourMin) % o.stepHour)).toFixed(0),
- minMax = (o.minuteMax - ((o.minuteMax - o.minuteMin) % o.stepMinute)).toFixed(0),
- secMax = (o.secondMax - ((o.secondMax - o.secondMin) % o.stepSecond)).toFixed(0),
- millisecMax = (o.millisecMax - ((o.millisecMax - o.millisecMin) % o.stepMillisec)).toFixed(0),
+ hourMax = parseInt((o.hourMax - ((o.hourMax - o.hourMin) % o.stepHour)) ,10),
+ minMax = parseInt((o.minuteMax - ((o.minuteMax - o.minuteMin) % o.stepMinute)) ,10),
+ secMax = parseInt((o.secondMax - ((o.secondMax - o.secondMin) % o.stepSecond)) ,10),
+ millisecMax = parseInt((o.millisecMax - ((o.millisecMax - o.millisecMin) % o.stepMillisec)) ,10),
dp_id = this.inst.id.toString().replace(/([^A-Za-z0-9_])/g, '');
// Prevent displaying twice
@@ -365,10 +367,10 @@ $.extend(Timepicker.prototype, {
size;
// Hours
+ html += '
';
if (o.showHour && o.hourGrid > 0) {
- html += '' +
- '' +
- '';
+ html += '';
for (var h = o.hourMin; h <= hourMax; h += parseInt(o.hourGrid,10)) {
hourGridSize++;
@@ -382,70 +384,63 @@ $.extend(Timepicker.prototype, {
html += '' + tmph + ' | ';
}
- html += '
' +
- '';
- } else html += '';
-
- html += '' + o.minuteText + '';
+ html += '
';
+ }
+ html += '';
// Minutes
+ html += '' + o.minuteText + ''+
+ '';
+
if (o.showMinute && o.minuteGrid > 0) {
- html += '' +
- '' +
- '';
+ html += '';
for (var m = o.minuteMin; m <= minMax; m += parseInt(o.minuteGrid,10)) {
minuteGridSize++;
html += '' + ((m < 10) ? '0' : '') + m + ' | ';
}
- html += '
' +
- '';
- } else html += '';
+ html += '
';
+ }
+ html += '';
// Seconds
html += '' + o.secondText + '';
+ ((o.showSecond) ? '' : noDisplay) + '>' + o.secondText + ''+
+ '';
if (o.showSecond && o.secondGrid > 0) {
- html += '' +
- '' +
- '';
+ html += '';
for (var s = o.secondMin; s <= secMax; s += parseInt(o.secondGrid,10)) {
secondGridSize++;
html += '' + ((s < 10) ? '0' : '') + s + ' | ';
}
- html += '
' +
- '';
- } else html += '';
+ html += '
';
+ }
+ html += '';
// Milliseconds
html += '' + o.millisecText + '';
+ ((o.showMillisec) ? '' : noDisplay) + '>' + o.millisecText + ''+
+ '';
if (o.showMillisec && o.millisecGrid > 0) {
- html += '' +
- '' +
- '';
+ html += '';
for (var l = o.millisecMin; l <= millisecMax; l += parseInt(o.millisecGrid,10)) {
millisecGridSize++;
- html += '' + ((l < 10) ? '0' : '') + s + ' | ';
+ html += '' + ((l < 10) ? '0' : '') + l + ' | ';
}
- html += '
' +
- '';
- } else html += '';
+ html += '
';
+ }
+ html += '';
// Timezone
html += '= 1 )
- {
- rawValue = splitOnEquals.join( '=' );
- }
- else
- {
- rawValue = '';
- }
-
- try
- {
- value = decodeURIComponent( rawValue );
- }
- catch( e2 )
- {
- value = rawValue;
- }
-
- //Logic borrowed from http://jquery.com/ dataAttr method
- try
- {
- value = value === 'true' ?
- true :
- value === 'false' ?
- false :
- ! isNaN( value ) ?
- parseFloat( value ) :
- rbrace.test( value ) ?
- parseJSON( value ) :
- value;
- }
- catch( e3 ) {}
-
- cookies[name] = value;
- }
- return cookies;
- };
- }() );
-
- Constructor = function(){};
-
- /**
- * get - get one, several, or all cookies
- *
- * @access public
- * @paramater Mixed cookieName - String:name of single cookie; Array:list of multiple cookie names; Void (no param):if you want all cookies
- * @return Mixed - Value of cookie as set; Null:if only one cookie is requested and is not found; Object:hash of multiple or all cookies (if multiple or all requested);
- */
- Constructor.prototype.get = function( cookieName )
- {
- var returnValue, item, cookies;
-
- cookies = parseCookies();
-
- if( typeof cookieName === 'string' )
- {
- returnValue = ( typeof cookies[cookieName] !== 'undefined' ) ? cookies[cookieName] : null;
- }
- else if( typeof cookieName === 'object' && cookieName !== null )
- {
- returnValue = {};
- for( item in cookieName )
- {
- if( Object.prototype.hasOwnProperty.call( cookieName, item ) )
- {
- if( typeof cookies[cookieName[item]] !== 'undefined' )
- {
- returnValue[cookieName[item]] = cookies[cookieName[item]];
- }
- else
- {
- returnValue[cookieName[item]] = null;
- }
- }
- }
- }
- else
- {
- returnValue = cookies;
- }
-
- return returnValue;
- };
- /**
- * filter - get array of cookies whose names match the provided RegExp
- *
- * @access public
- * @paramater Object RegExp - The regular expression to match against cookie names
- * @return Mixed - Object:hash of cookies whose names match the RegExp
- */
- Constructor.prototype.filter = function( cookieNameRegExp )
- {
- var cookieName, returnValue, cookies;
-
- returnValue = {};
- cookies = parseCookies();
-
- if( typeof cookieNameRegExp === 'string' )
- {
- cookieNameRegExp = new RegExp( cookieNameRegExp );
- }
-
- for( cookieName in cookies )
- {
- if( Object.prototype.hasOwnProperty.call( cookies, cookieName ) && cookieName.match( cookieNameRegExp ) )
- {
- returnValue[cookieName] = cookies[cookieName];
- }
- }
-
- return returnValue;
- };
- /**
- * set - set or delete a cookie with desired options
- *
- * @access public
- * @paramater String cookieName - name of cookie to set
- * @paramater Mixed value - Any JS value. If not a string, will be JSON encoded (http://code.google.com/p/cookies/wiki/JSON); NULL to delete
- * @paramater Object options - optional list of cookie options to specify
- * @return void
- */
- Constructor.prototype.set = function( cookieName, value, options )
- {
- if( typeof options !== 'object' || options === null )
- {
- options = {};
- }
-
- // TODO: consider value serialization method to parallel parse cookies
- if( typeof value === 'undefined' || value === null )
- {
- value = '';
- options.hoursToLive = -8760;
- }
- else
- {
- //Logic borrowed from http://jquery.com/ dataAttr method and reversed
- value = value === true ?
- 'true' :
- value === false ?
- 'false' :
- ! isNaN( value ) ?
- '' + value :
- value;
- if( typeof value !== 'string' )
- {
- if( typeof JSON === 'object' && JSON !== null && typeof JSON.stringify === 'function' )
- {
- value = JSON.stringify( value );
- }
- else
- {
- throw new Error( 'cookies.set() received value which could not be serialized.' );
- }
- }
- }
-
- var optionsString = assembleOptionsString( options );
-
- document.cookie = cookieName + '=' + encodeURIComponent( value ) + optionsString;
- };
- /**
- * del - delete a cookie (domain and path options must match those with which the cookie was set; this is really an alias for set() with parameters simplified for this use)
- *
- * @access public
- * @paramater MIxed cookieName - String name of cookie to delete, or Bool true to delete all
- * @paramater Object options - optional list of cookie options to specify ( path, domain )
- * @return void
- */
- Constructor.prototype.del = function( cookieName, options )
- {
- var allCookies, name;
-
- allCookies = {};
-
- if( typeof options !== 'object' || options === null )
- {
- options = {};
- }
-
- if( typeof cookieName === 'boolean' && cookieName === true )
- {
- allCookies = this.get();
- }
- else if( typeof cookieName === 'string' )
- {
- allCookies[cookieName] = true;
- }
-
- for( name in allCookies )
- {
- if( Object.prototype.hasOwnProperty.call( allCookies, name ) && typeof name === 'string' && name !== '' )
- {
- this.set( name, null, options );
- }
- }
- };
- /**
- * test - test whether the browser is accepting cookies
- *
- * @access public
- * @return Boolean
- */
- Constructor.prototype.test = function()
- {
- var returnValue, testName, testValue;
-
- testName = 'cookiesCT';
- testValue = 'data';
-
- this.set( testName, testValue );
-
- if( this.get( testName ) === testValue )
- {
- this.del( testName );
- returnValue = true;
- }
-
- return returnValue;
- };
- /**
- * setOptions - set default options for calls to cookie methods
- *
- * @access public
- * @param Object options - list of cookie options to specify
- * @return void
- */
- Constructor.prototype.setOptions = function( options )
- {
- if( typeof options !== 'object' )
- {
- options = null;
- }
-
- defaultOptions = resolveOptions( options );
- };
-
- return new Constructor();
- }() );
-
- if( global.jQuery )
- {
- ( function( $ )
- {
- var NameTokenAttrResolver, cookies, extensions;
-
- NameTokenAttrResolver = function()
- {
- var nameTokenAttrs = ['name', 'id'];
- this.current = null;
- this.nextAttrName = function()
- {
- this.current = nameTokenAttrs.shift();
- return !! this.current;
- };
- };
-
- cookies = $.cookies = jaaulde.utils.cookies;
-
- extensions = {
- /**
- * $( 'selector' ).cookify - set the value of an input field, or the innerHTML of an element, to a cookie by the name or id of the field or element
- * (field or element MUST have name or id attribute)
- *
- * @access public
- * @param options OBJECT - list of cookie options to specify
- * @return jQuery
- */
- cookify: function( options )
- {
- this
- .not( ':input' )
- /*
- Iterate non input elements
- */
- .each( function()
- {
- var $this, NTAR, nameToken, value;
-
- $this = $( this );
-
- NTAR = new NameTokenAttrResolver();
-
- while( NTAR.nextAttrName() )
- {
- nameToken = $this.attr( NTAR.current );
- if( typeof nameToken === 'string' && nameToken !== '' )
- {
- value = $this.html();
-
- cookies.set(
- nameToken,
- ( typeof value === 'string' && value !== '' ) ? value : null,
- options
- );
-
- break;
- }
- }
- } )
- .end()
- .filter( ':input')
- .filter( ':radio' )
- /*
- Iterate radio inputs
- */
- .each( function()
- {
-
- } )
- .end()
- .filter( ':checkbox' )
- /*
- Iterate checkbox inputs
- */
- .each( function()
- {
-
- } )
- .end()
- .not( ':radio, :checkbox' )
- /*
- Iterate all other inputs
- */
- .each( function()
- {
- var $this, NTAR, nameToken, value;
-
- $this = $( this );
-
- NTAR = new NameTokenAttrResolver();
-
- while( NTAR.nextAttrName() )
- {
- nameToken = $this.attr( NTAR.current );
- if( typeof nameToken === 'string' && nameToken !== '' )
- {
- value = $this.val();
-
- cookies.set(
- nameToken,
- ( typeof value === 'string' && value !== '' ) ? value : null,
- options
- );
-
- break;
- }
- }
- } );
-
- return this;
- },
- /**
- * $( 'selector' ).cookieFill - set the value of an input field or the innerHTML of an element from a cookie by the name or id of the field or element
- *
- * @access public
- * @return jQuery
- */
- cookieFill: function()
- {
- this
- .not( ':input' )
- /*
- Iterate non input elements
- */
- .each( function()
- {
- var $this, NTAR, nameToken, value;
-
- $this = $( this );
-
- NTAR = new NameTokenAttrResolver();
-
- while( NTAR.nextAttrName() )
- {
- nameToken = $this.attr( NTAR.current );
- if( typeof nameToken === 'string' && nameToken !== '' )
- {
- value = cookies.get( nameToken );
- if( value !== null )
- {
- $this.html( value );
- }
-
- break;
- }
- }
- } )
- .end()
- .filter( ':input')
- .filter( ':radio' )
- /*
- Iterate radio inputs
- */
- .each( function()
- {
-
- } )
- .end()
- .filter( ':checkbox' )
- /*
- Iterate checkbox inputs
- */
- .each( function()
- {
-
- } )
- .end()
- .not( ':radio, :checkbox' )
- /*
- Iterate all other inputs
- */
- .each( function()
- {
- var $this, NTAR, nameToken, value;
-
- $this = $( this );
-
- NTAR = new NameTokenAttrResolver();
-
- while( NTAR.nextAttrName() )
- {
- nameToken = $this.attr( NTAR.current );
- if( typeof nameToken === 'string' && nameToken !== '' )
- {
- value = cookies.get( nameToken );
- if( value !== null )
- {
- $this.val( value );
- }
-
- break;
- }
- }
- } );
-
- return this;
- },
- /**
- * $( 'selector' ).cookieBind - call cookie fill on matching elements, and bind their change events to cookify()
- *
- * @access public
- * @param options OBJECT - list of cookie options to specify
- * @return jQuery
- */
- cookieBind: function( options )
- {
- return this.each( function()
- {
- var $this = $( this );
- $this.cookieFill().change( function()
- {
- $this.cookify( options );
- } );
- } );
- }
- };
-
- $.each( extensions, function( i )
- {
- $.fn[i] = this;
- } );
-
- }( global.jQuery ) );
- }
+ "use strict";
+
+ /* localize 3rd party support */
+ var $ = global.jQuery,
+ /* localize first party support */
+ jaaulde = global.jaaulde,
+ cookies = jaaulde.utils.cookies,
+ /* declarations */
+ NameTokenAttrResolver;
+
+ /* alias cookies lib under jQ to meet general audience expectations */
+ $.cookies = cookies;
+
+ NameTokenAttrResolver = function()
+ {
+ var nameTokenAttrs = ['name', 'id'];
+ this.current = null;
+ this.nextAttrName = function()
+ {
+ this.current = nameTokenAttrs.shift();
+ return !! this.current;
+ };
+ };
+
+ $.each( {
+ /**
+ * $( 'selector' ).cookify - set the value of an input field, or the innerHTML of an element, to a cookie by the name or id of the field or element
+ * (field or element MUST have name or id attribute)
+ *
+ * @access public
+ * @param options OBJECT - list of cookie options to specify
+ * @return jQuery
+ */
+ cookify: function( options )
+ {
+ this
+ .not( ':input' )
+ /*
+ Iterate non input elements
+ */
+ .each( function()
+ {
+ var $this, NTAR, nameToken, value;
+
+ $this = $( this );
+
+ NTAR = new NameTokenAttrResolver();
+
+ while( NTAR.nextAttrName() )
+ {
+ nameToken = $this.attr( NTAR.current );
+ if( typeof nameToken === 'string' && nameToken !== '' )
+ {
+ value = $this.html();
+
+ cookies.set(
+ nameToken,
+ ( typeof value === 'string' && value !== '' ) ? value : null,
+ options
+ );
+
+ break;
+ }
+ }
+ } )
+ .end()
+ .filter( ':input')
+ .filter( ':radio' )
+ /*
+ Iterate radio inputs
+ */
+ .each( function()
+ {
+
+ } )
+ .end()
+ .filter( ':checkbox' )
+ /*
+ Iterate checkbox inputs
+ */
+ .each( function()
+ {
+
+ } )
+ .end()
+ .not( ':radio, :checkbox' )
+ /*
+ Iterate all other inputs
+ */
+ .each( function()
+ {
+ var $this, NTAR, nameToken, value;
+
+ $this = $( this );
+
+ NTAR = new NameTokenAttrResolver();
+
+ while( NTAR.nextAttrName() )
+ {
+ nameToken = $this.attr( NTAR.current );
+ if( typeof nameToken === 'string' && nameToken !== '' )
+ {
+ value = $this.val();
+
+ cookies.set(
+ nameToken,
+ ( typeof value === 'string' && value !== '' ) ? value : null,
+ options
+ );
+
+ break;
+ }
+ }
+ } );
+
+ return this;
+ },
+ /**
+ * $( 'selector' ).cookieFill - set the value of an input field or the innerHTML of an element from a cookie by the name or id of the field or element
+ *
+ * @access public
+ * @return jQuery
+ */
+ cookieFill: function()
+ {
+ this
+ .not( ':input' )
+ /*
+ Iterate non input elements
+ */
+ .each( function()
+ {
+ var $this, NTAR, nameToken, value;
+
+ $this = $( this );
+
+ NTAR = new NameTokenAttrResolver();
+
+ while( NTAR.nextAttrName() )
+ {
+ nameToken = $this.attr( NTAR.current );
+ if( typeof nameToken === 'string' && nameToken !== '' )
+ {
+ value = cookies.get( nameToken );
+ if( value !== null )
+ {
+ $this.html( value );
+ }
+
+ break;
+ }
+ }
+ } )
+ .end()
+ .filter( ':input')
+ .filter( ':radio' )
+ /*
+ Iterate radio inputs
+ */
+ .each( function()
+ {
+
+ } )
+ .end()
+ .filter( ':checkbox' )
+ /*
+ Iterate checkbox inputs
+ */
+ .each( function()
+ {
+
+ } )
+ .end()
+ .not( ':radio, :checkbox' )
+ /*
+ Iterate all other inputs
+ */
+ .each( function()
+ {
+ var $this, NTAR, nameToken, value;
+
+ $this = $( this );
+
+ NTAR = new NameTokenAttrResolver();
+
+ while( NTAR.nextAttrName() )
+ {
+ nameToken = $this.attr( NTAR.current );
+ if( typeof nameToken === 'string' && nameToken !== '' )
+ {
+ value = cookies.get( nameToken );
+ if( value !== null )
+ {
+ $this.val( value );
+ }
+
+ break;
+ }
+ }
+ } );
+
+ return this;
+ },
+ /**
+ * $( 'selector' ).cookieBind - call cookie fill on matching elements, and bind their change events to cookify()
+ *
+ * @access public
+ * @param options OBJECT - list of cookie options to specify
+ * @return jQuery
+ */
+ cookieBind: function( options )
+ {
+ return this.each( function()
+ {
+ var $this = $( this );
+ $this.cookieFill().change( function()
+ {
+ $this.cookify( options );
+ } );
+ } );
+ }
+ }, function( i )
+ {
+ $.fn[i] = this;
+ } );
}( window ) );
\ No newline at end of file
diff --git a/vendor/assets/javascripts/jquery.jscroll.js b/vendor/assets/javascripts/jquery.jscroll.js
new file mode 100644
index 0000000..eac6d4e
--- /dev/null
+++ b/vendor/assets/javascripts/jquery.jscroll.js
@@ -0,0 +1,80 @@
+// ####################################################################################
+// ####### #######
+// ####### Plugin: jScroll #######
+// ####### Author: William Duffy #######
+// ####### Website: http://www.wduffy.co.uk/jScroll #######
+// ####### Version: 1.1 #######
+// ####### #######
+// ####### Copyright (c) 2011, William Duffy - www.wduffy.co.uk #######
+// ####### #######
+// ####### Permission is hereby granted, free of charge, to any person #######
+// ####### obtaining a copy of this software and associated documentation #######
+// ####### files (the "Software"), to deal in the Software without #######
+// ####### restriction, including without limitation the rights to use, #######
+// ####### copy, modify, merge, publish, distribute, sublicense, and/or sell #######
+// ####### copies of the Software, and to permit persons to whom the #######
+// ####### Software is furnished to do so, subject to the following #######
+// ####### conditions: #######
+// ####### #######
+// ####### The above copyright notice and this permission notice shall be #######
+// ####### included in all copies or substantial portions of the Software. #######
+// ####### #######
+// ####### THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, #######
+// ####### EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES #######
+// ####### OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND #######
+// ####### NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT #######
+// ####### HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, #######
+// ####### WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #######
+// ####### FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR #######
+// ####### OTHER DEALINGS IN THE SOFTWARE. #######
+// ####### #######
+// ####################################################################################
+(function($) {
+
+ // Public: jScroll Plugin
+ $.fn.jScroll = function(options) {
+
+ var opts = $.extend({}, $.fn.jScroll.defaults, options);
+
+ return this.each(function() {
+ var $element = $(this);
+ var $window = $(window);
+ var locator = new location($element);
+
+ $window.scroll(function() {
+ $element
+ .stop()
+ .animate(locator.getMargin($window), opts.speed);
+ });
+ });
+
+ // Private
+ function location($element)
+ {
+ this.min = $element.offset().top;
+ this.originalMargin = parseInt($element.css("margin-top"), 10) || 0;
+
+ this.getMargin = function ($window)
+ {
+ var max = $element.parent().height() - $element.outerHeight();
+ var margin = this.originalMargin;
+
+ if ($window.scrollTop() >= this.min)
+ margin = margin + opts.top + $window.scrollTop() - this.min;
+
+ if (margin > max)
+ margin = max;
+
+ return ({"marginTop" : margin + 'px'});
+ }
+ }
+
+ };
+
+ // Public: Default values
+ $.fn.jScroll.defaults = {
+ speed : "slow",
+ top : 10
+ };
+
+})(jQuery);
\ No newline at end of file
diff --git a/vendor/assets/javascripts/moment.js b/vendor/assets/javascripts/moment.js
index 9565ed1..31e2039 100644
--- a/vendor/assets/javascripts/moment.js
+++ b/vendor/assets/javascripts/moment.js
@@ -3,7 +3,7 @@
// (c) 2011 Tim Wood
// Moment.js is freely distributable under the terms of the MIT license.
//
-// Version 1.1.2
+// Version 1.2.0
(function (Date, undefined) {
@@ -13,7 +13,7 @@
hasModule = (typeof module !== 'undefined'),
paramsToParse = 'months|monthsShort|weekdays|weekdaysShort|longDateFormat|relativeTime|ordinal|meridiem'.split('|'),
i,
- VERSION = "1.1.2",
+ VERSION = "1.2.0",
shortcuts = 'Month|Date|Hours|Minutes|Seconds'.split('|');
// left zero fill a number
@@ -30,21 +30,24 @@
function dateAddRemove(date, _input, adding, val) {
var isString = (typeof _input === 'string'),
input = isString ? {} : _input,
- ms, M, currentDate;
+ ms, d, M, currentDate;
if (isString && val) {
input[_input] = val;
}
ms = (input.ms || input.milliseconds || 0) +
(input.s || input.seconds || 0) * 1e3 + // 1000
(input.m || input.minutes || 0) * 6e4 + // 1000 * 60
- (input.h || input.hours || 0) * 36e5 + // 1000 * 60 * 60
- (input.d || input.days || 0) * 864e5 + // 1000 * 60 * 60 * 24
- (input.w || input.weeks || 0) * 6048e5; // 1000 * 60 * 60 * 24 * 7
+ (input.h || input.hours || 0) * 36e5; // 1000 * 60 * 60
+ d = (input.d || input.days || 0) +
+ (input.w || input.weeks || 0) * 7;
M = (input.M || input.months || 0) +
(input.y || input.years || 0) * 12;
if (ms) {
date.setTime(+date + ms * adding);
}
+ if (d) {
+ date.setDate(date.getDate() + d * adding);
+ }
if (M) {
currentDate = date.getDate();
date.setDate(1);
@@ -76,7 +79,8 @@
currentHours = date.getHours(),
currentMinutes = date.getMinutes(),
currentSeconds = date.getSeconds(),
- charactersToReplace = /(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|dddd?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|zz?|LL?L?L?)/g,
+ currentZone = date.getTimezoneOffset(),
+ charactersToReplace = /(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|dddd?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|zz?|ZZ?|LL?L?L?)/g,
nonuppercaseLetters = /[^A-Z]/g,
timezoneRegex = /\([A-Za-z ]+\)|:[0-9]{2} [A-Z]{3} /g,
ordinal = moment.ordinal,
@@ -173,6 +177,10 @@
// depreciating 'zz' fall through to 'z'
case 'z' :
return (date.toString().match(timezoneRegex) || [''])[0].replace(nonuppercaseLetters, '');
+ case 'Z' :
+ return (currentZone > 0 ? '+' : '-') + leftZeroFill(~~(currentZone / 60), 2) + ':' + leftZeroFill(~~(currentZone % 60), 2);
+ case 'ZZ' :
+ return (currentZone > 0 ? '+' : '-') + leftZeroFill(~~(10 * currentZone / 6), 4);
// LONG DATES
case 'L' :
case 'LL' :
@@ -189,9 +197,13 @@
// date from string and format string
function makeDateFromStringAndFormat(string, format) {
- var inArray = [0],
- tokenCharacters = /(\\)?(MM?|DD?D?D?|YYYY|YY|a|A|hh?|HH?|mm?|ss?)/g,
- inputCharacters = /(\\)?([0-9]+|am|pm)/gi,
+ var inArray = [0, 0, 1, 0, 0, 0, 0],
+ timezoneHours = 0,
+ timezoneMinutes = 0,
+ isUsingUTC = false,
+ tokenCharacters = /(\\)?(MM?|DD?D?D?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|ZZ?)/g,
+ inputCharacters = /(\\)?([0-9]+|am|pm|([\+\-]\d\d:?\d\d))/gi,
+ timezoneParseRegex = /([\+\-]|\d\d)/gi,
inputParts = string.match(inputCharacters),
formatParts = format.match(tokenCharacters),
i,
@@ -199,6 +211,7 @@
// function to convert string input to date
function addTime(format, input) {
+ var a;
switch (format) {
// MONTH
case 'M' :
@@ -222,7 +235,7 @@
inArray[0] = input + (input > 70 ? 1900 : 2000);
break;
case 'YYYY' :
- inArray[0] = ~~input;
+ inArray[0] = ~~Math.abs(input);
break;
// AM / PM
case 'a' :
@@ -252,6 +265,24 @@
case 'ss' :
inArray[5] = ~~input;
break;
+ // TIMEZONE
+ case 'Z' :
+ // fall through to ZZ
+ case 'ZZ' :
+ isUsingUTC = true;
+ a = input.match(timezoneParseRegex);
+ if (a[1]) {
+ timezoneHours = ~~a[1];
+ }
+ if (a[2]) {
+ timezoneMinutes = ~~a[2];
+ }
+ // reverse offsets
+ if (a[0] === '-') {
+ timezoneHours = -timezoneHours;
+ timezoneMinutes = -timezoneMinutes;
+ }
+ break;
}
}
for (i = 0; i < formatParts.length; i++) {
@@ -261,7 +292,15 @@
if (isPm && inArray[3] < 12) {
inArray[3] += 12;
}
- return dateFromArray(inArray);
+ // if is 12 am, change hours to 0
+ if (! isPm && inArray[3] === 12) {
+ inArray[3] = 0;
+ }
+ // handle timezone
+ inArray[3] += timezoneHours;
+ inArray[4] += timezoneMinutes;
+ // return
+ return isUsingUTC ? new Date(Date.UTC.apply({}, inArray)) : dateFromArray(inArray);
}
// compare two arrays, return the number of differences
@@ -281,7 +320,7 @@
// date from string and array of format strings
function makeDateFromStringAndArray(string, formats) {
var output,
- inputCharacters = /(\\)?([0-9]+|am|pm)/gi,
+ inputCharacters = /(\\)?([0-9]+|am|pm|([\+\-]\d\d:?\d\d))/gi,
inputParts = string.match(inputCharacters),
scores = [],
scoreToBeat = 99,
@@ -436,6 +475,14 @@
return this._d;
},
+ toString : function () {
+ return this._d.toString();
+ },
+
+ toDate : function () {
+ return this._d;
+ },
+
format : function (inputString) {
return formatDate(this._d, inputString);
},
@@ -484,8 +531,12 @@
},
isLeapYear : function () {
- var year = this._d.getFullYear();
+ var year = this.year();
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
+ },
+
+ isDST : function () {
+ return this.zone() !== moment([this.year()]).zone();
}
};
@@ -501,7 +552,7 @@
};
}
- // loop through and add shortcuts
+ // loop through and add shortcuts (Month, Date, Hours, Minutes, Seconds)
for (i = 0; i < shortcuts.length; i ++) {
makeShortcut(shortcuts[i].toLowerCase(), shortcuts[i]);
}
@@ -514,6 +565,11 @@
return this._d.getDay();
};
+ // add shortcut for timezone offset (no setter)
+ moment.fn.zone = function () {
+ return this._d.getTimezoneOffset();
+ };
+
// CommonJS module is defined
if (hasModule) {
module.exports = moment;
diff --git a/vendor/assets/javascripts/underscore.string.js b/vendor/assets/javascripts/underscore.string.js
index 4392984..221cf48 100644
--- a/vendor/assets/javascripts/underscore.string.js
+++ b/vendor/assets/javascripts/underscore.string.js
@@ -167,8 +167,8 @@
// Defining underscore.string
var _s = {
-
- VERSION: '1.2.0',
+
+ VERSION: '2.0.0',
isBlank: sArgs(function(str){
return (/^\s*$/).test(str);