galaxy-commits
Threads by month
- ----- 2026 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- 15302 discussions
commit/galaxy-central: dannon: Update hgignore to include all .lock, .pid, and .log files.
by commits-noreply@bitbucket.org 04 Feb '15
by commits-noreply@bitbucket.org 04 Feb '15
04 Feb '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/7c04c98d7b6a/
Changeset: 7c04c98d7b6a
User: dannon
Date: 2015-02-04 17:07:01+00:00
Summary: Update hgignore to include all .lock, .pid, and .log files.
Affected #: 1 file
diff -r f0ae870b22e955a6668dd46e55b31e708184abb4 -r 7c04c98d7b6af49164615bf3988942a19a1fc620 .hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -30,9 +30,9 @@
*.pyc
# Galaxy Runtime Files
-paster.lock
-paster.log
-paster.pid
+*.lock
+*.log
+*.pid
# Tool Shed Runtime Files
tool_shed_webapp.lock
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
4 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/09bfb4f3f60d/
Changeset: 09bfb4f3f60d
User: dannon
Date: 2015-02-04 15:33:07+00:00
Summary: Initial version of session_timeout. Still needs client side work to handle API/web.json requests better but that turned out to be a large project -- see TODOs for more details.
Affected #: 5 files
diff -r 11c8048ae648d3b8ddae7f180f6bbde4aac4fb83 -r 09bfb4f3f60d4fa31bc4f0ed91151cc60d0c6256 config/galaxy.ini.sample
--- a/config/galaxy.ini.sample
+++ b/config/galaxy.ini.sample
@@ -392,6 +392,13 @@
#inactivity_box_content = Your account has not been activated yet. Feel free to browse around and see what's available, but you won't be able to upload data or run jobs until you have verified your email address.
+
+# Galaxy Session Timeout
+# This provides a timeout (in minutes) after which a user will have to log back in.
+# A duration of 0 disables this feature.
+#session_duration = 0
+
+
# -- Analytics
# You can enter tracking code here to track visitor's behavior
diff -r 11c8048ae648d3b8ddae7f180f6bbde4aac4fb83 -r 09bfb4f3f60d4fa31bc4f0ed91151cc60d0c6256 lib/galaxy/config.py
--- a/lib/galaxy/config.py
+++ b/lib/galaxy/config.py
@@ -171,6 +171,7 @@
self.instance_resource_url = kwargs.get( 'instance_resource_url', None )
self.registration_warning_message = kwargs.get( 'registration_warning_message', None )
self.ga_code = kwargs.get( 'ga_code', None )
+ self.session_duration = int(kwargs.get( 'session_duration', 0 ))
# Get the disposable email domains blacklist file and its contents
self.blacklist_location = kwargs.get( 'blacklist_file', None )
self.blacklist_content = None
diff -r 11c8048ae648d3b8ddae7f180f6bbde4aac4fb83 -r 09bfb4f3f60d4fa31bc4f0ed91151cc60d0c6256 lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -1335,7 +1335,7 @@
FAILED_METADATA = 'failed_metadata',
RESUBMITTED = 'resubmitted' )
# failed_metadata and resubmitted are only valid as DatasetInstance states currently
-
+
non_ready_states = (
states.UPLOAD,
states.QUEUED,
@@ -2997,6 +2997,7 @@
self.is_valid = is_valid
self.prev_session_id = prev_session_id
self.histories = []
+ self.last_action = galaxy.model.orm.now.now()
def add_history( self, history, association=None ):
if association is None:
diff -r 11c8048ae648d3b8ddae7f180f6bbde4aac4fb83 -r 09bfb4f3f60d4fa31bc4f0ed91151cc60d0c6256 lib/galaxy/model/migrate/versions/0128_session_timeout.py
--- /dev/null
+++ b/lib/galaxy/model/migrate/versions/0128_session_timeout.py
@@ -0,0 +1,50 @@
+"""
+Migration script to add session update time (used for timeouts)
+"""
+from sqlalchemy import *
+from sqlalchemy.orm import *
+from migrate import *
+from migrate.changeset import *
+from galaxy.model.custom_types import *
+
+import datetime
+now = datetime.datetime.utcnow
+
+import logging
+log = logging.getLogger( __name__ )
+
+metadata = MetaData()
+
+
+def upgrade(migrate_engine):
+ metadata.bind = migrate_engine
+ print __doc__
+ metadata.reflect()
+
+ lastaction_column = Column( "last_action", DateTime, default=now )
+ __add_column( lastaction_column, "galaxy_session", metadata )
+
+
+def downgrade(migrate_engine):
+ metadata.bind = migrate_engine
+ metadata.reflect()
+
+ __drop_column( "last_action", "galaxy_session", metadata )
+
+
+def __add_column(column, table_name, metadata, **kwds):
+ try:
+ table = Table( table_name, metadata, autoload=True )
+ column.create( table, **kwds )
+ except Exception as e:
+ print str(e)
+ log.exception( "Adding column %s failed." % column)
+
+
+def __drop_column( column_name, table_name, metadata ):
+ try:
+ table = Table( table_name, metadata, autoload=True )
+ getattr( table.c, column_name ).drop()
+ except Exception as e:
+ print str(e)
+ log.exception( "Dropping column %s failed." % column_name )
diff -r 11c8048ae648d3b8ddae7f180f6bbde4aac4fb83 -r 09bfb4f3f60d4fa31bc4f0ed91151cc60d0c6256 lib/galaxy/web/framework/webapp.py
--- a/lib/galaxy/web/framework/webapp.py
+++ b/lib/galaxy/web/framework/webapp.py
@@ -1,5 +1,6 @@
"""
"""
+import datetime
import inspect
import os
import hashlib
@@ -210,6 +211,32 @@
self.response.send_redirect( url_for( '/static/user_disabled.html' ) )
if config.require_login:
self._ensure_logged_in_user( environ, session_cookie )
+ if config.session_duration and not self.environ.get('is_api_request', False):
+ # TODO DBTODO Session-based API requests need to be handled
+ # correctly here. Disabled for now. The issue is that API
+ # request response error codes aren't handled in a consistent
+ # way on the client side. All ajax calls from the client need
+ # to go through a single point of control where we can do things
+ # like redirect/etc. This is API calls as well as something
+ # like 40 @web.json requests that might not get handled well on
+ # the clientside.
+ #
+ # Make sure we're not past the duration, and either log out or
+ # update timestamp.
+ now = datetime.datetime.now()
+ expiration_time = self.galaxy_session.update_time + datetime.timedelta(minutes=config.session_duration)
+ if expiration_time < now:
+ # Expiration time has passed.
+ self.handle_user_logout()
+ self.response.send_redirect( url_for( controller='user',
+ action='login',
+ message="You have been logged out due to inactivity. Please log in again to continue using Galaxy.",
+ status='info',
+ use_panels=True ) )
+ else:
+ self.galaxy_session.update_time = datetime.datetime.now()
+ self.sa_session.add(self.galaxy_session)
+ self.sa_session.flush()
def setup_i18n( self ):
locales = []
https://bitbucket.org/galaxy/galaxy-central/commits/d3a4dca4bfa5/
Changeset: d3a4dca4bfa5
User: dannon
Date: 2015-02-04 16:06:53+00:00
Summary: Handle timeout correctly for API requests. There's still the issue of clients potentially not understanding this, and of course the @web.json requests.
Affected #: 1 file
diff -r 09bfb4f3f60d4fa31bc4f0ed91151cc60d0c6256 -r d3a4dca4bfa571599494a315343c2e635fbc7b5f lib/galaxy/web/framework/webapp.py
--- a/lib/galaxy/web/framework/webapp.py
+++ b/lib/galaxy/web/framework/webapp.py
@@ -211,7 +211,7 @@
self.response.send_redirect( url_for( '/static/user_disabled.html' ) )
if config.require_login:
self._ensure_logged_in_user( environ, session_cookie )
- if config.session_duration and not self.environ.get('is_api_request', False):
+ if config.session_duration:
# TODO DBTODO Session-based API requests need to be handled
# correctly here. Disabled for now. The issue is that API
# request response error codes aren't handled in a consistent
@@ -228,7 +228,12 @@
if expiration_time < now:
# Expiration time has passed.
self.handle_user_logout()
- self.response.send_redirect( url_for( controller='user',
+ if self.environ.get('is_api_request', False):
+ self.response.status = 401
+ self.user = None
+ self.galaxy_session = None
+ else:
+ self.response.send_redirect( url_for( controller='user',
action='login',
message="You have been logged out due to inactivity. Please log in again to continue using Galaxy.",
status='info',
https://bitbucket.org/galaxy/galaxy-central/commits/2d7653d16e02/
Changeset: 2d7653d16e02
User: dannon
Date: 2015-02-04 16:07:58+00:00
Summary: Update commentary per previous commit re: API request handling.
Affected #: 1 file
diff -r d3a4dca4bfa571599494a315343c2e635fbc7b5f -r 2d7653d16e02119e9028c63b4a4920f46a7cefa6 lib/galaxy/web/framework/webapp.py
--- a/lib/galaxy/web/framework/webapp.py
+++ b/lib/galaxy/web/framework/webapp.py
@@ -212,14 +212,11 @@
if config.require_login:
self._ensure_logged_in_user( environ, session_cookie )
if config.session_duration:
- # TODO DBTODO Session-based API requests need to be handled
- # correctly here. Disabled for now. The issue is that API
- # request response error codes aren't handled in a consistent
- # way on the client side. All ajax calls from the client need
- # to go through a single point of control where we can do things
- # like redirect/etc. This is API calls as well as something
- # like 40 @web.json requests that might not get handled well on
- # the clientside.
+ # TODO DBTODO All ajax calls from the client need to go through
+ # a single point of control where we can do things like
+ # redirect/etc. This is API calls as well as something like 40
+ # @web.json requests that might not get handled well on the
+ # clientside.
#
# Make sure we're not past the duration, and either log out or
# update timestamp.
https://bitbucket.org/galaxy/galaxy-central/commits/f0ae870b22e9/
Changeset: f0ae870b22e9
User: dannon
Date: 2015-02-04 16:08:25+00:00
Summary: pep8 webapp.py.
Affected #: 1 file
diff -r 2d7653d16e02119e9028c63b4a4920f46a7cefa6 -r f0ae870b22e955a6668dd46e55b31e708184abb4 lib/galaxy/web/framework/webapp.py
--- a/lib/galaxy/web/framework/webapp.py
+++ b/lib/galaxy/web/framework/webapp.py
@@ -231,10 +231,10 @@
self.galaxy_session = None
else:
self.response.send_redirect( url_for( controller='user',
- action='login',
- message="You have been logged out due to inactivity. Please log in again to continue using Galaxy.",
- status='info',
- use_panels=True ) )
+ action='login',
+ message="You have been logged out due to inactivity. Please log in again to continue using Galaxy.",
+ status='info',
+ use_panels=True ) )
else:
self.galaxy_session.update_time = datetime.datetime.now()
self.sa_session.add(self.galaxy_session)
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: carlfeberhard: UI, client build: change source for jquery-migrate (no version change)
by commits-noreply@bitbucket.org 04 Feb '15
by commits-noreply@bitbucket.org 04 Feb '15
04 Feb '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/11c8048ae648/
Changeset: 11c8048ae648
User: carlfeberhard
Date: 2015-02-04 15:04:20+00:00
Summary: UI, client build: change source for jquery-migrate (no version change)
Affected #: 4 files
diff -r 9bc22ec1a8156fe640fd049399cb39c8755eef73 -r 11c8048ae648d3b8ddae7f180f6bbde4aac4fb83 client/GruntFile.js
--- a/client/GruntFile.js
+++ b/client/GruntFile.js
@@ -68,13 +68,13 @@
// where to move fetched bower components into the build structure (libName: [ bower-location, libs-location ])
libraryLocations : {
"jquery": [ "dist/jquery.js", "jquery/jquery.js" ],
- "jquery-migrate-official": [ "index.js", "jquery/jquery.migrate.js" ],
+ "jquery-migrate": [ "jquery-migrate.js", "jquery/jquery.migrate.js" ],
"traceKit": [ "tracekit.js", "tracekit.js" ],
"ravenjs": [ "dist/raven.js", "raven.js" ],
"underscore": [ "underscore.js", "underscore.js" ],
+ "handlebars": [ "handlebars.runtime.js", "handlebars.runtime.js" ]
//"backbone": [ "backbone.js", "backbone/backbone.js" ],
- "handlebars": [ "handlebars.runtime.js", "handlebars.runtime.js" ]
// these need to be updated and tested
//"require": [ "build/require.js", "require.js" ],
diff -r 9bc22ec1a8156fe640fd049399cb39c8755eef73 -r 11c8048ae648d3b8ddae7f180f6bbde4aac4fb83 client/bower.json
--- a/client/bower.json
+++ b/client/bower.json
@@ -9,7 +9,6 @@
"homepage": "usegalaxy.org",
"dependencies": {
"jquery": "~1.11.1",
- "jquery-migrate-official": "http://code.jquery.com/jquery-migrate-1.2.1.js",
"traceKit": "*",
"ravenjs": "~1.1.16",
"require": "*",
@@ -32,7 +31,8 @@
"jstree": "~3.0.9",
"jquery-ui": "git://github.com/jquery/jquery-ui.git#~1.11.2",
"jquery.event.drag-drop": "~2.2.1",
- "handlebars": "~2.0.0"
+ "handlebars": "~2.0.0",
+ "jquery-migrate": "~1.2.1"
},
"resolutions": {
"jquery": "~1.11.1"
diff -r 9bc22ec1a8156fe640fd049399cb39c8755eef73 -r 11c8048ae648d3b8ddae7f180f6bbde4aac4fb83 client/galaxy/scripts/libs/jquery/jquery.migrate.js
--- a/client/galaxy/scripts/libs/jquery/jquery.migrate.js
+++ b/client/galaxy/scripts/libs/jquery/jquery.migrate.js
@@ -1,521 +1,521 @@
-/*!
- * jQuery Migrate - v1.2.1 - 2013-05-08
- * https://github.com/jquery/jquery-migrate
- * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors; Licensed MIT
- */
-(function( jQuery, window, undefined ) {
-// See http://bugs.jquery.com/ticket/13335
-// "use strict";
-
-
-var warnedAbout = {};
-
-// List of warnings already given; public read only
-jQuery.migrateWarnings = [];
-
-// Set to true to prevent console output; migrateWarnings still maintained
-// jQuery.migrateMute = false;
-
-// Show a message on the console so devs know we're active
-if ( !jQuery.migrateMute && window.console && window.console.log ) {
- window.console.log("JQMIGRATE: Logging is active");
-}
-
-// Set to false to disable traces that appear with warnings
-if ( jQuery.migrateTrace === undefined ) {
- jQuery.migrateTrace = true;
-}
-
-// Forget any warnings we've already given; public
-jQuery.migrateReset = function() {
- warnedAbout = {};
- jQuery.migrateWarnings.length = 0;
-};
-
-function migrateWarn( msg) {
- var console = window.console;
- if ( !warnedAbout[ msg ] ) {
- warnedAbout[ msg ] = true;
- jQuery.migrateWarnings.push( msg );
- if ( console && console.warn && !jQuery.migrateMute ) {
- console.warn( "JQMIGRATE: " + msg );
- if ( jQuery.migrateTrace && console.trace ) {
- console.trace();
- }
- }
- }
-}
-
-function migrateWarnProp( obj, prop, value, msg ) {
- if ( Object.defineProperty ) {
- // On ES5 browsers (non-oldIE), warn if the code tries to get prop;
- // allow property to be overwritten in case some other plugin wants it
- try {
- Object.defineProperty( obj, prop, {
- configurable: true,
- enumerable: true,
- get: function() {
- migrateWarn( msg );
- return value;
- },
- set: function( newValue ) {
- migrateWarn( msg );
- value = newValue;
- }
- });
- return;
- } catch( err ) {
- // IE8 is a dope about Object.defineProperty, can't warn there
- }
- }
-
- // Non-ES5 (or broken) browser; just set the property
- jQuery._definePropertyBroken = true;
- obj[ prop ] = value;
-}
-
-if ( document.compatMode === "BackCompat" ) {
- // jQuery has never supported or tested Quirks Mode
- migrateWarn( "jQuery is not compatible with Quirks Mode" );
-}
-
-
-var attrFn = jQuery( "<input/>", { size: 1 } ).attr("size") && jQuery.attrFn,
- oldAttr = jQuery.attr,
- valueAttrGet = jQuery.attrHooks.value && jQuery.attrHooks.value.get ||
- function() { return null; },
- valueAttrSet = jQuery.attrHooks.value && jQuery.attrHooks.value.set ||
- function() { return undefined; },
- rnoType = /^(?:input|button)$/i,
- rnoAttrNodeType = /^[238]$/,
- rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
- ruseDefault = /^(?:checked|selected)$/i;
-
-// jQuery.attrFn
-migrateWarnProp( jQuery, "attrFn", attrFn || {}, "jQuery.attrFn is deprecated" );
-
-jQuery.attr = function( elem, name, value, pass ) {
- var lowerName = name.toLowerCase(),
- nType = elem && elem.nodeType;
-
- if ( pass ) {
- // Since pass is used internally, we only warn for new jQuery
- // versions where there isn't a pass arg in the formal params
- if ( oldAttr.length < 4 ) {
- migrateWarn("jQuery.fn.attr( props, pass ) is deprecated");
- }
- if ( elem && !rnoAttrNodeType.test( nType ) &&
- (attrFn ? name in attrFn : jQuery.isFunction(jQuery.fn[name])) ) {
- return jQuery( elem )[ name ]( value );
- }
- }
-
- // Warn if user tries to set `type`, since it breaks on IE 6/7/8; by checking
- // for disconnected elements we don't warn on $( "<button>", { type: "button" } ).
- if ( name === "type" && value !== undefined && rnoType.test( elem.nodeName ) && elem.parentNode ) {
- migrateWarn("Can't change the 'type' of an input or button in IE 6/7/8");
- }
-
- // Restore boolHook for boolean property/attribute synchronization
- if ( !jQuery.attrHooks[ lowerName ] && rboolean.test( lowerName ) ) {
- jQuery.attrHooks[ lowerName ] = {
- get: function( elem, name ) {
- // Align boolean attributes with corresponding properties
- // Fall back to attribute presence where some booleans are not supported
- var attrNode,
- property = jQuery.prop( elem, name );
- return property === true || typeof property !== "boolean" &&
- ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
-
- name.toLowerCase() :
- undefined;
- },
- set: function( elem, value, name ) {
- var propName;
- if ( value === false ) {
- // Remove boolean attributes when set to false
- jQuery.removeAttr( elem, name );
- } else {
- // value is true since we know at this point it's type boolean and not false
- // Set boolean attributes to the same name and set the DOM property
- propName = jQuery.propFix[ name ] || name;
- if ( propName in elem ) {
- // Only set the IDL specifically if it already exists on the element
- elem[ propName ] = true;
- }
-
- elem.setAttribute( name, name.toLowerCase() );
- }
- return name;
- }
- };
-
- // Warn only for attributes that can remain distinct from their properties post-1.9
- if ( ruseDefault.test( lowerName ) ) {
- migrateWarn( "jQuery.fn.attr('" + lowerName + "') may use property instead of attribute" );
- }
- }
-
- return oldAttr.call( jQuery, elem, name, value );
-};
-
-// attrHooks: value
-jQuery.attrHooks.value = {
- get: function( elem, name ) {
- var nodeName = ( elem.nodeName || "" ).toLowerCase();
- if ( nodeName === "button" ) {
- return valueAttrGet.apply( this, arguments );
- }
- if ( nodeName !== "input" && nodeName !== "option" ) {
- migrateWarn("jQuery.fn.attr('value') no longer gets properties");
- }
- return name in elem ?
- elem.value :
- null;
- },
- set: function( elem, value ) {
- var nodeName = ( elem.nodeName || "" ).toLowerCase();
- if ( nodeName === "button" ) {
- return valueAttrSet.apply( this, arguments );
- }
- if ( nodeName !== "input" && nodeName !== "option" ) {
- migrateWarn("jQuery.fn.attr('value', val) no longer sets properties");
- }
- // Does not return so that setAttribute is also used
- elem.value = value;
- }
-};
-
-
-var matched, browser,
- oldInit = jQuery.fn.init,
- oldParseJSON = jQuery.parseJSON,
- // Note: XSS check is done below after string is trimmed
- rquickExpr = /^([^<]*)(<[\w\W]+>)([^>]*)$/;
-
-// $(html) "looks like html" rule change
-jQuery.fn.init = function( selector, context, rootjQuery ) {
- var match;
-
- if ( selector && typeof selector === "string" && !jQuery.isPlainObject( context ) &&
- (match = rquickExpr.exec( jQuery.trim( selector ) )) && match[ 0 ] ) {
- // This is an HTML string according to the "old" rules; is it still?
- if ( selector.charAt( 0 ) !== "<" ) {
- migrateWarn("$(html) HTML strings must start with '<' character");
- }
- if ( match[ 3 ] ) {
- migrateWarn("$(html) HTML text after last tag is ignored");
- }
- // Consistently reject any HTML-like string starting with a hash (#9521)
- // Note that this may break jQuery 1.6.x code that otherwise would work.
- if ( match[ 0 ].charAt( 0 ) === "#" ) {
- migrateWarn("HTML string cannot start with a '#' character");
- jQuery.error("JQMIGRATE: Invalid selector string (XSS)");
- }
- // Now process using loose rules; let pre-1.8 play too
- if ( context && context.context ) {
- // jQuery object as context; parseHTML expects a DOM object
- context = context.context;
- }
- if ( jQuery.parseHTML ) {
- return oldInit.call( this, jQuery.parseHTML( match[ 2 ], context, true ),
- context, rootjQuery );
- }
- }
- return oldInit.apply( this, arguments );
-};
-jQuery.fn.init.prototype = jQuery.fn;
-
-// Let $.parseJSON(falsy_value) return null
-jQuery.parseJSON = function( json ) {
- if ( !json && json !== null ) {
- migrateWarn("jQuery.parseJSON requires a valid JSON string");
- return null;
- }
- return oldParseJSON.apply( this, arguments );
-};
-
-jQuery.uaMatch = function( ua ) {
- ua = ua.toLowerCase();
-
- var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
- /(webkit)[ \/]([\w.]+)/.exec( ua ) ||
- /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
- /(msie) ([\w.]+)/.exec( ua ) ||
- ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
- [];
-
- return {
- browser: match[ 1 ] || "",
- version: match[ 2 ] || "0"
- };
-};
-
-// Don't clobber any existing jQuery.browser in case it's different
-if ( !jQuery.browser ) {
- matched = jQuery.uaMatch( navigator.userAgent );
- browser = {};
-
- if ( matched.browser ) {
- browser[ matched.browser ] = true;
- browser.version = matched.version;
- }
-
- // Chrome is Webkit, but Webkit is also Safari.
- if ( browser.chrome ) {
- browser.webkit = true;
- } else if ( browser.webkit ) {
- browser.safari = true;
- }
-
- jQuery.browser = browser;
-}
-
-// Warn if the code tries to get jQuery.browser
-migrateWarnProp( jQuery, "browser", jQuery.browser, "jQuery.browser is deprecated" );
-
-jQuery.sub = function() {
- function jQuerySub( selector, context ) {
- return new jQuerySub.fn.init( selector, context );
- }
- jQuery.extend( true, jQuerySub, this );
- jQuerySub.superclass = this;
- jQuerySub.fn = jQuerySub.prototype = this();
- jQuerySub.fn.constructor = jQuerySub;
- jQuerySub.sub = this.sub;
- jQuerySub.fn.init = function init( selector, context ) {
- if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
- context = jQuerySub( context );
- }
-
- return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
- };
- jQuerySub.fn.init.prototype = jQuerySub.fn;
- var rootjQuerySub = jQuerySub(document);
- migrateWarn( "jQuery.sub() is deprecated" );
- return jQuerySub;
-};
-
-
-// Ensure that $.ajax gets the new parseJSON defined in core.js
-jQuery.ajaxSetup({
- converters: {
- "text json": jQuery.parseJSON
- }
-});
-
-
-var oldFnData = jQuery.fn.data;
-
-jQuery.fn.data = function( name ) {
- var ret, evt,
- elem = this[0];
-
- // Handles 1.7 which has this behavior and 1.8 which doesn't
- if ( elem && name === "events" && arguments.length === 1 ) {
- ret = jQuery.data( elem, name );
- evt = jQuery._data( elem, name );
- if ( ( ret === undefined || ret === evt ) && evt !== undefined ) {
- migrateWarn("Use of jQuery.fn.data('events') is deprecated");
- return evt;
- }
- }
- return oldFnData.apply( this, arguments );
-};
-
-
-var rscriptType = /\/(java|ecma)script/i,
- oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack;
-
-jQuery.fn.andSelf = function() {
- migrateWarn("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()");
- return oldSelf.apply( this, arguments );
-};
-
-// Since jQuery.clean is used internally on older versions, we only shim if it's missing
-if ( !jQuery.clean ) {
- jQuery.clean = function( elems, context, fragment, scripts ) {
- // Set context per 1.8 logic
- context = context || document;
- context = !context.nodeType && context[0] || context;
- context = context.ownerDocument || context;
-
- migrateWarn("jQuery.clean() is deprecated");
-
- var i, elem, handleScript, jsTags,
- ret = [];
-
- jQuery.merge( ret, jQuery.buildFragment( elems, context ).childNodes );
-
- // Complex logic lifted directly from jQuery 1.8
- if ( fragment ) {
- // Special handling of each script element
- handleScript = function( elem ) {
- // Check if we consider it executable
- if ( !elem.type || rscriptType.test( elem.type ) ) {
- // Detach the script and store it in the scripts array (if provided) or the fragment
- // Return truthy to indicate that it has been handled
- return scripts ?
- scripts.push( elem.parentNode ? elem.parentNode.removeChild( elem ) : elem ) :
- fragment.appendChild( elem );
- }
- };
-
- for ( i = 0; (elem = ret[i]) != null; i++ ) {
- // Check if we're done after handling an executable script
- if ( !( jQuery.nodeName( elem, "script" ) && handleScript( elem ) ) ) {
- // Append to fragment and handle embedded scripts
- fragment.appendChild( elem );
- if ( typeof elem.getElementsByTagName !== "undefined" ) {
- // handleScript alters the DOM, so use jQuery.merge to ensure snapshot iteration
- jsTags = jQuery.grep( jQuery.merge( [], elem.getElementsByTagName("script") ), handleScript );
-
- // Splice the scripts into ret after their former ancestor and advance our index beyond them
- ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
- i += jsTags.length;
- }
- }
- }
- }
-
- return ret;
- };
-}
-
-var eventAdd = jQuery.event.add,
- eventRemove = jQuery.event.remove,
- eventTrigger = jQuery.event.trigger,
- oldToggle = jQuery.fn.toggle,
- oldLive = jQuery.fn.live,
- oldDie = jQuery.fn.die,
- ajaxEvents = "ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",
- rajaxEvent = new RegExp( "\\b(?:" + ajaxEvents + ")\\b" ),
- rhoverHack = /(?:^|\s)hover(\.\S+|)\b/,
- hoverHack = function( events ) {
- if ( typeof( events ) !== "string" || jQuery.event.special.hover ) {
- return events;
- }
- if ( rhoverHack.test( events ) ) {
- migrateWarn("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'");
- }
- return events && events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
- };
-
-// Event props removed in 1.9, put them back if needed; no practical way to warn them
-if ( jQuery.event.props && jQuery.event.props[ 0 ] !== "attrChange" ) {
- jQuery.event.props.unshift( "attrChange", "attrName", "relatedNode", "srcElement" );
-}
-
-// Undocumented jQuery.event.handle was "deprecated" in jQuery 1.7
-if ( jQuery.event.dispatch ) {
- migrateWarnProp( jQuery.event, "handle", jQuery.event.dispatch, "jQuery.event.handle is undocumented and deprecated" );
-}
-
-// Support for 'hover' pseudo-event and ajax event warnings
-jQuery.event.add = function( elem, types, handler, data, selector ){
- if ( elem !== document && rajaxEvent.test( types ) ) {
- migrateWarn( "AJAX events should be attached to document: " + types );
- }
- eventAdd.call( this, elem, hoverHack( types || "" ), handler, data, selector );
-};
-jQuery.event.remove = function( elem, types, handler, selector, mappedTypes ){
- eventRemove.call( this, elem, hoverHack( types ) || "", handler, selector, mappedTypes );
-};
-
-jQuery.fn.error = function() {
- var args = Array.prototype.slice.call( arguments, 0);
- migrateWarn("jQuery.fn.error() is deprecated");
- args.splice( 0, 0, "error" );
- if ( arguments.length ) {
- return this.bind.apply( this, args );
- }
- // error event should not bubble to window, although it does pre-1.7
- this.triggerHandler.apply( this, args );
- return this;
-};
-
-jQuery.fn.toggle = function( fn, fn2 ) {
-
- // Don't mess with animation or css toggles
- if ( !jQuery.isFunction( fn ) || !jQuery.isFunction( fn2 ) ) {
- return oldToggle.apply( this, arguments );
- }
- migrateWarn("jQuery.fn.toggle(handler, handler...) is deprecated");
-
- // Save reference to arguments for access in closure
- var args = arguments,
- guid = fn.guid || jQuery.guid++,
- i = 0,
- toggler = function( event ) {
- // Figure out which function to execute
- var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
- jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
-
- // Make sure that clicks stop
- event.preventDefault();
-
- // and execute the function
- return args[ lastToggle ].apply( this, arguments ) || false;
- };
-
- // link all the functions, so any of them can unbind this click handler
- toggler.guid = guid;
- while ( i < args.length ) {
- args[ i++ ].guid = guid;
- }
-
- return this.click( toggler );
-};
-
-jQuery.fn.live = function( types, data, fn ) {
- migrateWarn("jQuery.fn.live() is deprecated");
- if ( oldLive ) {
- return oldLive.apply( this, arguments );
- }
- jQuery( this.context ).on( types, this.selector, data, fn );
- return this;
-};
-
-jQuery.fn.die = function( types, fn ) {
- migrateWarn("jQuery.fn.die() is deprecated");
- if ( oldDie ) {
- return oldDie.apply( this, arguments );
- }
- jQuery( this.context ).off( types, this.selector || "**", fn );
- return this;
-};
-
-// Turn global events into document-triggered events
-jQuery.event.trigger = function( event, data, elem, onlyHandlers ){
- if ( !elem && !rajaxEvent.test( event ) ) {
- migrateWarn( "Global events are undocumented and deprecated" );
- }
- return eventTrigger.call( this, event, data, elem || document, onlyHandlers );
-};
-jQuery.each( ajaxEvents.split("|"),
- function( _, name ) {
- jQuery.event.special[ name ] = {
- setup: function() {
- var elem = this;
-
- // The document needs no shimming; must be !== for oldIE
- if ( elem !== document ) {
- jQuery.event.add( document, name + "." + jQuery.guid, function() {
- jQuery.event.trigger( name, null, elem, true );
- });
- jQuery._data( this, name, jQuery.guid++ );
- }
- return false;
- },
- teardown: function() {
- if ( this !== document ) {
- jQuery.event.remove( document, name + "." + jQuery._data( this, name ) );
- }
- return false;
- }
- };
- }
-);
-
-
-})( jQuery, window );
+/*!
+ * jQuery Migrate - v1.2.1 - 2013-05-08
+ * https://github.com/jquery/jquery-migrate
+ * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors; Licensed MIT
+ */
+(function( jQuery, window, undefined ) {
+// See http://bugs.jquery.com/ticket/13335
+// "use strict";
+
+
+var warnedAbout = {};
+
+// List of warnings already given; public read only
+jQuery.migrateWarnings = [];
+
+// Set to true to prevent console output; migrateWarnings still maintained
+// jQuery.migrateMute = false;
+
+// Show a message on the console so devs know we're active
+if ( !jQuery.migrateMute && window.console && window.console.log ) {
+ window.console.log("JQMIGRATE: Logging is active");
+}
+
+// Set to false to disable traces that appear with warnings
+if ( jQuery.migrateTrace === undefined ) {
+ jQuery.migrateTrace = true;
+}
+
+// Forget any warnings we've already given; public
+jQuery.migrateReset = function() {
+ warnedAbout = {};
+ jQuery.migrateWarnings.length = 0;
+};
+
+function migrateWarn( msg) {
+ var console = window.console;
+ if ( !warnedAbout[ msg ] ) {
+ warnedAbout[ msg ] = true;
+ jQuery.migrateWarnings.push( msg );
+ if ( console && console.warn && !jQuery.migrateMute ) {
+ console.warn( "JQMIGRATE: " + msg );
+ if ( jQuery.migrateTrace && console.trace ) {
+ console.trace();
+ }
+ }
+ }
+}
+
+function migrateWarnProp( obj, prop, value, msg ) {
+ if ( Object.defineProperty ) {
+ // On ES5 browsers (non-oldIE), warn if the code tries to get prop;
+ // allow property to be overwritten in case some other plugin wants it
+ try {
+ Object.defineProperty( obj, prop, {
+ configurable: true,
+ enumerable: true,
+ get: function() {
+ migrateWarn( msg );
+ return value;
+ },
+ set: function( newValue ) {
+ migrateWarn( msg );
+ value = newValue;
+ }
+ });
+ return;
+ } catch( err ) {
+ // IE8 is a dope about Object.defineProperty, can't warn there
+ }
+ }
+
+ // Non-ES5 (or broken) browser; just set the property
+ jQuery._definePropertyBroken = true;
+ obj[ prop ] = value;
+}
+
+if ( document.compatMode === "BackCompat" ) {
+ // jQuery has never supported or tested Quirks Mode
+ migrateWarn( "jQuery is not compatible with Quirks Mode" );
+}
+
+
+var attrFn = jQuery( "<input/>", { size: 1 } ).attr("size") && jQuery.attrFn,
+ oldAttr = jQuery.attr,
+ valueAttrGet = jQuery.attrHooks.value && jQuery.attrHooks.value.get ||
+ function() { return null; },
+ valueAttrSet = jQuery.attrHooks.value && jQuery.attrHooks.value.set ||
+ function() { return undefined; },
+ rnoType = /^(?:input|button)$/i,
+ rnoAttrNodeType = /^[238]$/,
+ rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
+ ruseDefault = /^(?:checked|selected)$/i;
+
+// jQuery.attrFn
+migrateWarnProp( jQuery, "attrFn", attrFn || {}, "jQuery.attrFn is deprecated" );
+
+jQuery.attr = function( elem, name, value, pass ) {
+ var lowerName = name.toLowerCase(),
+ nType = elem && elem.nodeType;
+
+ if ( pass ) {
+ // Since pass is used internally, we only warn for new jQuery
+ // versions where there isn't a pass arg in the formal params
+ if ( oldAttr.length < 4 ) {
+ migrateWarn("jQuery.fn.attr( props, pass ) is deprecated");
+ }
+ if ( elem && !rnoAttrNodeType.test( nType ) &&
+ (attrFn ? name in attrFn : jQuery.isFunction(jQuery.fn[name])) ) {
+ return jQuery( elem )[ name ]( value );
+ }
+ }
+
+ // Warn if user tries to set `type`, since it breaks on IE 6/7/8; by checking
+ // for disconnected elements we don't warn on $( "<button>", { type: "button" } ).
+ if ( name === "type" && value !== undefined && rnoType.test( elem.nodeName ) && elem.parentNode ) {
+ migrateWarn("Can't change the 'type' of an input or button in IE 6/7/8");
+ }
+
+ // Restore boolHook for boolean property/attribute synchronization
+ if ( !jQuery.attrHooks[ lowerName ] && rboolean.test( lowerName ) ) {
+ jQuery.attrHooks[ lowerName ] = {
+ get: function( elem, name ) {
+ // Align boolean attributes with corresponding properties
+ // Fall back to attribute presence where some booleans are not supported
+ var attrNode,
+ property = jQuery.prop( elem, name );
+ return property === true || typeof property !== "boolean" &&
+ ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
+
+ name.toLowerCase() :
+ undefined;
+ },
+ set: function( elem, value, name ) {
+ var propName;
+ if ( value === false ) {
+ // Remove boolean attributes when set to false
+ jQuery.removeAttr( elem, name );
+ } else {
+ // value is true since we know at this point it's type boolean and not false
+ // Set boolean attributes to the same name and set the DOM property
+ propName = jQuery.propFix[ name ] || name;
+ if ( propName in elem ) {
+ // Only set the IDL specifically if it already exists on the element
+ elem[ propName ] = true;
+ }
+
+ elem.setAttribute( name, name.toLowerCase() );
+ }
+ return name;
+ }
+ };
+
+ // Warn only for attributes that can remain distinct from their properties post-1.9
+ if ( ruseDefault.test( lowerName ) ) {
+ migrateWarn( "jQuery.fn.attr('" + lowerName + "') may use property instead of attribute" );
+ }
+ }
+
+ return oldAttr.call( jQuery, elem, name, value );
+};
+
+// attrHooks: value
+jQuery.attrHooks.value = {
+ get: function( elem, name ) {
+ var nodeName = ( elem.nodeName || "" ).toLowerCase();
+ if ( nodeName === "button" ) {
+ return valueAttrGet.apply( this, arguments );
+ }
+ if ( nodeName !== "input" && nodeName !== "option" ) {
+ migrateWarn("jQuery.fn.attr('value') no longer gets properties");
+ }
+ return name in elem ?
+ elem.value :
+ null;
+ },
+ set: function( elem, value ) {
+ var nodeName = ( elem.nodeName || "" ).toLowerCase();
+ if ( nodeName === "button" ) {
+ return valueAttrSet.apply( this, arguments );
+ }
+ if ( nodeName !== "input" && nodeName !== "option" ) {
+ migrateWarn("jQuery.fn.attr('value', val) no longer sets properties");
+ }
+ // Does not return so that setAttribute is also used
+ elem.value = value;
+ }
+};
+
+
+var matched, browser,
+ oldInit = jQuery.fn.init,
+ oldParseJSON = jQuery.parseJSON,
+ // Note: XSS check is done below after string is trimmed
+ rquickExpr = /^([^<]*)(<[\w\W]+>)([^>]*)$/;
+
+// $(html) "looks like html" rule change
+jQuery.fn.init = function( selector, context, rootjQuery ) {
+ var match;
+
+ if ( selector && typeof selector === "string" && !jQuery.isPlainObject( context ) &&
+ (match = rquickExpr.exec( jQuery.trim( selector ) )) && match[ 0 ] ) {
+ // This is an HTML string according to the "old" rules; is it still?
+ if ( selector.charAt( 0 ) !== "<" ) {
+ migrateWarn("$(html) HTML strings must start with '<' character");
+ }
+ if ( match[ 3 ] ) {
+ migrateWarn("$(html) HTML text after last tag is ignored");
+ }
+ // Consistently reject any HTML-like string starting with a hash (#9521)
+ // Note that this may break jQuery 1.6.x code that otherwise would work.
+ if ( match[ 0 ].charAt( 0 ) === "#" ) {
+ migrateWarn("HTML string cannot start with a '#' character");
+ jQuery.error("JQMIGRATE: Invalid selector string (XSS)");
+ }
+ // Now process using loose rules; let pre-1.8 play too
+ if ( context && context.context ) {
+ // jQuery object as context; parseHTML expects a DOM object
+ context = context.context;
+ }
+ if ( jQuery.parseHTML ) {
+ return oldInit.call( this, jQuery.parseHTML( match[ 2 ], context, true ),
+ context, rootjQuery );
+ }
+ }
+ return oldInit.apply( this, arguments );
+};
+jQuery.fn.init.prototype = jQuery.fn;
+
+// Let $.parseJSON(falsy_value) return null
+jQuery.parseJSON = function( json ) {
+ if ( !json && json !== null ) {
+ migrateWarn("jQuery.parseJSON requires a valid JSON string");
+ return null;
+ }
+ return oldParseJSON.apply( this, arguments );
+};
+
+jQuery.uaMatch = function( ua ) {
+ ua = ua.toLowerCase();
+
+ var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
+ /(webkit)[ \/]([\w.]+)/.exec( ua ) ||
+ /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
+ /(msie) ([\w.]+)/.exec( ua ) ||
+ ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
+ [];
+
+ return {
+ browser: match[ 1 ] || "",
+ version: match[ 2 ] || "0"
+ };
+};
+
+// Don't clobber any existing jQuery.browser in case it's different
+if ( !jQuery.browser ) {
+ matched = jQuery.uaMatch( navigator.userAgent );
+ browser = {};
+
+ if ( matched.browser ) {
+ browser[ matched.browser ] = true;
+ browser.version = matched.version;
+ }
+
+ // Chrome is Webkit, but Webkit is also Safari.
+ if ( browser.chrome ) {
+ browser.webkit = true;
+ } else if ( browser.webkit ) {
+ browser.safari = true;
+ }
+
+ jQuery.browser = browser;
+}
+
+// Warn if the code tries to get jQuery.browser
+migrateWarnProp( jQuery, "browser", jQuery.browser, "jQuery.browser is deprecated" );
+
+jQuery.sub = function() {
+ function jQuerySub( selector, context ) {
+ return new jQuerySub.fn.init( selector, context );
+ }
+ jQuery.extend( true, jQuerySub, this );
+ jQuerySub.superclass = this;
+ jQuerySub.fn = jQuerySub.prototype = this();
+ jQuerySub.fn.constructor = jQuerySub;
+ jQuerySub.sub = this.sub;
+ jQuerySub.fn.init = function init( selector, context ) {
+ if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
+ context = jQuerySub( context );
+ }
+
+ return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
+ };
+ jQuerySub.fn.init.prototype = jQuerySub.fn;
+ var rootjQuerySub = jQuerySub(document);
+ migrateWarn( "jQuery.sub() is deprecated" );
+ return jQuerySub;
+};
+
+
+// Ensure that $.ajax gets the new parseJSON defined in core.js
+jQuery.ajaxSetup({
+ converters: {
+ "text json": jQuery.parseJSON
+ }
+});
+
+
+var oldFnData = jQuery.fn.data;
+
+jQuery.fn.data = function( name ) {
+ var ret, evt,
+ elem = this[0];
+
+ // Handles 1.7 which has this behavior and 1.8 which doesn't
+ if ( elem && name === "events" && arguments.length === 1 ) {
+ ret = jQuery.data( elem, name );
+ evt = jQuery._data( elem, name );
+ if ( ( ret === undefined || ret === evt ) && evt !== undefined ) {
+ migrateWarn("Use of jQuery.fn.data('events') is deprecated");
+ return evt;
+ }
+ }
+ return oldFnData.apply( this, arguments );
+};
+
+
+var rscriptType = /\/(java|ecma)script/i,
+ oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack;
+
+jQuery.fn.andSelf = function() {
+ migrateWarn("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()");
+ return oldSelf.apply( this, arguments );
+};
+
+// Since jQuery.clean is used internally on older versions, we only shim if it's missing
+if ( !jQuery.clean ) {
+ jQuery.clean = function( elems, context, fragment, scripts ) {
+ // Set context per 1.8 logic
+ context = context || document;
+ context = !context.nodeType && context[0] || context;
+ context = context.ownerDocument || context;
+
+ migrateWarn("jQuery.clean() is deprecated");
+
+ var i, elem, handleScript, jsTags,
+ ret = [];
+
+ jQuery.merge( ret, jQuery.buildFragment( elems, context ).childNodes );
+
+ // Complex logic lifted directly from jQuery 1.8
+ if ( fragment ) {
+ // Special handling of each script element
+ handleScript = function( elem ) {
+ // Check if we consider it executable
+ if ( !elem.type || rscriptType.test( elem.type ) ) {
+ // Detach the script and store it in the scripts array (if provided) or the fragment
+ // Return truthy to indicate that it has been handled
+ return scripts ?
+ scripts.push( elem.parentNode ? elem.parentNode.removeChild( elem ) : elem ) :
+ fragment.appendChild( elem );
+ }
+ };
+
+ for ( i = 0; (elem = ret[i]) != null; i++ ) {
+ // Check if we're done after handling an executable script
+ if ( !( jQuery.nodeName( elem, "script" ) && handleScript( elem ) ) ) {
+ // Append to fragment and handle embedded scripts
+ fragment.appendChild( elem );
+ if ( typeof elem.getElementsByTagName !== "undefined" ) {
+ // handleScript alters the DOM, so use jQuery.merge to ensure snapshot iteration
+ jsTags = jQuery.grep( jQuery.merge( [], elem.getElementsByTagName("script") ), handleScript );
+
+ // Splice the scripts into ret after their former ancestor and advance our index beyond them
+ ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
+ i += jsTags.length;
+ }
+ }
+ }
+ }
+
+ return ret;
+ };
+}
+
+var eventAdd = jQuery.event.add,
+ eventRemove = jQuery.event.remove,
+ eventTrigger = jQuery.event.trigger,
+ oldToggle = jQuery.fn.toggle,
+ oldLive = jQuery.fn.live,
+ oldDie = jQuery.fn.die,
+ ajaxEvents = "ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",
+ rajaxEvent = new RegExp( "\\b(?:" + ajaxEvents + ")\\b" ),
+ rhoverHack = /(?:^|\s)hover(\.\S+|)\b/,
+ hoverHack = function( events ) {
+ if ( typeof( events ) !== "string" || jQuery.event.special.hover ) {
+ return events;
+ }
+ if ( rhoverHack.test( events ) ) {
+ migrateWarn("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'");
+ }
+ return events && events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
+ };
+
+// Event props removed in 1.9, put them back if needed; no practical way to warn them
+if ( jQuery.event.props && jQuery.event.props[ 0 ] !== "attrChange" ) {
+ jQuery.event.props.unshift( "attrChange", "attrName", "relatedNode", "srcElement" );
+}
+
+// Undocumented jQuery.event.handle was "deprecated" in jQuery 1.7
+if ( jQuery.event.dispatch ) {
+ migrateWarnProp( jQuery.event, "handle", jQuery.event.dispatch, "jQuery.event.handle is undocumented and deprecated" );
+}
+
+// Support for 'hover' pseudo-event and ajax event warnings
+jQuery.event.add = function( elem, types, handler, data, selector ){
+ if ( elem !== document && rajaxEvent.test( types ) ) {
+ migrateWarn( "AJAX events should be attached to document: " + types );
+ }
+ eventAdd.call( this, elem, hoverHack( types || "" ), handler, data, selector );
+};
+jQuery.event.remove = function( elem, types, handler, selector, mappedTypes ){
+ eventRemove.call( this, elem, hoverHack( types ) || "", handler, selector, mappedTypes );
+};
+
+jQuery.fn.error = function() {
+ var args = Array.prototype.slice.call( arguments, 0);
+ migrateWarn("jQuery.fn.error() is deprecated");
+ args.splice( 0, 0, "error" );
+ if ( arguments.length ) {
+ return this.bind.apply( this, args );
+ }
+ // error event should not bubble to window, although it does pre-1.7
+ this.triggerHandler.apply( this, args );
+ return this;
+};
+
+jQuery.fn.toggle = function( fn, fn2 ) {
+
+ // Don't mess with animation or css toggles
+ if ( !jQuery.isFunction( fn ) || !jQuery.isFunction( fn2 ) ) {
+ return oldToggle.apply( this, arguments );
+ }
+ migrateWarn("jQuery.fn.toggle(handler, handler...) is deprecated");
+
+ // Save reference to arguments for access in closure
+ var args = arguments,
+ guid = fn.guid || jQuery.guid++,
+ i = 0,
+ toggler = function( event ) {
+ // Figure out which function to execute
+ var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
+ jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
+
+ // Make sure that clicks stop
+ event.preventDefault();
+
+ // and execute the function
+ return args[ lastToggle ].apply( this, arguments ) || false;
+ };
+
+ // link all the functions, so any of them can unbind this click handler
+ toggler.guid = guid;
+ while ( i < args.length ) {
+ args[ i++ ].guid = guid;
+ }
+
+ return this.click( toggler );
+};
+
+jQuery.fn.live = function( types, data, fn ) {
+ migrateWarn("jQuery.fn.live() is deprecated");
+ if ( oldLive ) {
+ return oldLive.apply( this, arguments );
+ }
+ jQuery( this.context ).on( types, this.selector, data, fn );
+ return this;
+};
+
+jQuery.fn.die = function( types, fn ) {
+ migrateWarn("jQuery.fn.die() is deprecated");
+ if ( oldDie ) {
+ return oldDie.apply( this, arguments );
+ }
+ jQuery( this.context ).off( types, this.selector || "**", fn );
+ return this;
+};
+
+// Turn global events into document-triggered events
+jQuery.event.trigger = function( event, data, elem, onlyHandlers ){
+ if ( !elem && !rajaxEvent.test( event ) ) {
+ migrateWarn( "Global events are undocumented and deprecated" );
+ }
+ return eventTrigger.call( this, event, data, elem || document, onlyHandlers );
+};
+jQuery.each( ajaxEvents.split("|"),
+ function( _, name ) {
+ jQuery.event.special[ name ] = {
+ setup: function() {
+ var elem = this;
+
+ // The document needs no shimming; must be !== for oldIE
+ if ( elem !== document ) {
+ jQuery.event.add( document, name + "." + jQuery.guid, function() {
+ jQuery.event.trigger( name, null, elem, true );
+ });
+ jQuery._data( this, name, jQuery.guid++ );
+ }
+ return false;
+ },
+ teardown: function() {
+ if ( this !== document ) {
+ jQuery.event.remove( document, name + "." + jQuery._data( this, name ) );
+ }
+ return false;
+ }
+ };
+ }
+);
+
+
+})( jQuery, window );
This diff is so big that we needed to truncate the remainder.
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: carlfeberhard: UI, client build: sync underscore version in grunt file and libs at 1.7.0
by commits-noreply@bitbucket.org 04 Feb '15
by commits-noreply@bitbucket.org 04 Feb '15
04 Feb '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/9bc22ec1a815/
Changeset: 9bc22ec1a815
User: carlfeberhard
Date: 2015-02-04 14:42:59+00:00
Summary: UI, client build: sync underscore version in grunt file and libs at 1.7.0
Affected #: 3 files
diff -r 334ae138b7b66dbaa95292213aab86ccc08efcae -r 9bc22ec1a8156fe640fd049399cb39c8755eef73 client/GruntFile.js
--- a/client/GruntFile.js
+++ b/client/GruntFile.js
@@ -72,7 +72,7 @@
"traceKit": [ "tracekit.js", "tracekit.js" ],
"ravenjs": [ "dist/raven.js", "raven.js" ],
- //"underscore": [ "underscore.js", "underscore.js" ],
+ "underscore": [ "underscore.js", "underscore.js" ],
//"backbone": [ "backbone.js", "backbone/backbone.js" ],
"handlebars": [ "handlebars.runtime.js", "handlebars.runtime.js" ]
diff -r 334ae138b7b66dbaa95292213aab86ccc08efcae -r 9bc22ec1a8156fe640fd049399cb39c8755eef73 client/galaxy/scripts/libs/underscore.js
--- a/client/galaxy/scripts/libs/underscore.js
+++ b/client/galaxy/scripts/libs/underscore.js
@@ -1159,7 +1159,6 @@
return value;
};
- // Predicate-generating functions. Often useful outside of Underscore.
_.constant = function(value) {
return function() {
return value;
diff -r 334ae138b7b66dbaa95292213aab86ccc08efcae -r 9bc22ec1a8156fe640fd049399cb39c8755eef73 static/scripts/libs/underscore.js
--- a/static/scripts/libs/underscore.js
+++ b/static/scripts/libs/underscore.js
@@ -1159,7 +1159,6 @@
return value;
};
- // Predicate-generating functions. Often useful outside of Underscore.
_.constant = function(value) {
return function() {
return value;
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: carlfeberhard: UI, client build: correct handlebars bower source, update handlebars.runtime to 2.0.0, recompile templates w/ 2.0.0 precompiler
by commits-noreply@bitbucket.org 04 Feb '15
by commits-noreply@bitbucket.org 04 Feb '15
04 Feb '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/334ae138b7b6/
Changeset: 334ae138b7b6
User: carlfeberhard
Date: 2015-02-04 14:20:48+00:00
Summary: UI, client build: correct handlebars bower source, update handlebars.runtime to 2.0.0, recompile templates w/ 2.0.0 precompiler
Affected #: 17 files
diff -r 175feec6a9d3028812548d62f99fbaa8b69b18e1 -r 334ae138b7b66dbaa95292213aab86ccc08efcae client/GruntFile.js
--- a/client/GruntFile.js
+++ b/client/GruntFile.js
@@ -74,6 +74,7 @@
"ravenjs": [ "dist/raven.js", "raven.js" ],
//"underscore": [ "underscore.js", "underscore.js" ],
//"backbone": [ "backbone.js", "backbone/backbone.js" ],
+ "handlebars": [ "handlebars.runtime.js", "handlebars.runtime.js" ]
// these need to be updated and tested
//"require": [ "build/require.js", "require.js" ],
@@ -105,8 +106,6 @@
// [ "", "jquery/jquery-ui.js" ]
//],
- // building the runtime library is not so simple
- //"handlebars.js": [ "", "handlebars.runtime.js" ]
}
});
diff -r 175feec6a9d3028812548d62f99fbaa8b69b18e1 -r 334ae138b7b66dbaa95292213aab86ccc08efcae client/bower.json
--- a/client/bower.json
+++ b/client/bower.json
@@ -32,7 +32,7 @@
"jstree": "~3.0.9",
"jquery-ui": "git://github.com/jquery/jquery-ui.git#~1.11.2",
"jquery.event.drag-drop": "~2.2.1",
- "handlebars.js": "~2.0.0"
+ "handlebars": "~2.0.0"
},
"resolutions": {
"jquery": "~1.11.1"
diff -r 175feec6a9d3028812548d62f99fbaa8b69b18e1 -r 334ae138b7b66dbaa95292213aab86ccc08efcae client/galaxy/scripts/libs/handlebars.runtime.js
--- a/client/galaxy/scripts/libs/handlebars.runtime.js
+++ b/client/galaxy/scripts/libs/handlebars.runtime.js
@@ -1,6 +1,8 @@
-/*
+/*!
-Copyright (C) 2011 by Yehuda Katz
+ handlebars v2.0.0
+
+Copyright (C) 2011-2014 by Yehuda Katz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -20,343 +22,639 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
+@license
*/
-
-// lib/handlebars/browser-prefix.js
-var Handlebars = {};
-
-(function(Handlebars, undefined) {
-;
-// lib/handlebars/base.js
-
-Handlebars.VERSION = "1.0.0";
-Handlebars.COMPILER_REVISION = 4;
-
-Handlebars.REVISION_CHANGES = {
- 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
- 2: '== 1.0.0-rc.3',
- 3: '== 1.0.0-rc.4',
- 4: '>= 1.0.0'
-};
-
-Handlebars.helpers = {};
-Handlebars.partials = {};
-
-var toString = Object.prototype.toString,
- functionType = '[object Function]',
- objectType = '[object Object]';
-
-Handlebars.registerHelper = function(name, fn, inverse) {
- if (toString.call(name) === objectType) {
- if (inverse || fn) { throw new Handlebars.Exception('Arg not supported with multiple helpers'); }
- Handlebars.Utils.extend(this.helpers, name);
+/* exported Handlebars */
+(function (root, factory) {
+ if (typeof define === 'function' && define.amd) {
+ define([], factory);
+ } else if (typeof exports === 'object') {
+ module.exports = factory();
} else {
- if (inverse) { fn.not = inverse; }
- this.helpers[name] = fn;
+ root.Handlebars = root.Handlebars || factory();
}
-};
-
-Handlebars.registerPartial = function(name, str) {
- if (toString.call(name) === objectType) {
- Handlebars.Utils.extend(this.partials, name);
- } else {
- this.partials[name] = str;
- }
-};
-
-Handlebars.registerHelper('helperMissing', function(arg) {
- if(arguments.length === 2) {
- return undefined;
- } else {
- throw new Error("Missing helper: '" + arg + "'");
- }
-});
-
-Handlebars.registerHelper('blockHelperMissing', function(context, options) {
- var inverse = options.inverse || function() {}, fn = options.fn;
-
- var type = toString.call(context);
-
- if(type === functionType) { context = context.call(this); }
-
- if(context === true) {
- return fn(this);
- } else if(context === false || context == null) {
- return inverse(this);
- } else if(type === "[object Array]") {
- if(context.length > 0) {
- return Handlebars.helpers.each(context, options);
- } else {
- return inverse(this);
- }
- } else {
- return fn(context);
- }
-});
-
-Handlebars.K = function() {};
-
-Handlebars.createFrame = Object.create || function(object) {
- Handlebars.K.prototype = object;
- var obj = new Handlebars.K();
- Handlebars.K.prototype = null;
- return obj;
-};
-
-Handlebars.logger = {
- DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3, level: 3,
-
- methodMap: {0: 'debug', 1: 'info', 2: 'warn', 3: 'error'},
-
- // can be overridden in the host environment
- log: function(level, obj) {
- if (Handlebars.logger.level <= level) {
- var method = Handlebars.logger.methodMap[level];
- if (typeof console !== 'undefined' && console[method]) {
- console[method].call(console, obj);
- }
- }
- }
-};
-
-Handlebars.log = function(level, obj) { Handlebars.logger.log(level, obj); };
-
-Handlebars.registerHelper('each', function(context, options) {
- var fn = options.fn, inverse = options.inverse;
- var i = 0, ret = "", data;
-
- var type = toString.call(context);
- if(type === functionType) { context = context.call(this); }
-
- if (options.data) {
- data = Handlebars.createFrame(options.data);
+}(this, function () {
+// handlebars/safe-string.js
+var __module3__ = (function() {
+ "use strict";
+ var __exports__;
+ // Build out our basic SafeString type
+ function SafeString(string) {
+ this.string = string;
}
- if(context && typeof context === 'object') {
- if(context instanceof Array){
- for(var j = context.length; i<j; i++) {
- if (data) { data.index = i; }
- ret = ret + fn(context[i], { data: data });
- }
- } else {
- for(var key in context) {
- if(context.hasOwnProperty(key)) {
- if(data) { data.key = key; }
- ret = ret + fn(context[key], {data: data});
- i++;
+ SafeString.prototype.toString = function() {
+ return "" + this.string;
+ };
+
+ __exports__ = SafeString;
+ return __exports__;
+})();
+
+// handlebars/utils.js
+var __module2__ = (function(__dependency1__) {
+ "use strict";
+ var __exports__ = {};
+ /*jshint -W004 */
+ var SafeString = __dependency1__;
+
+ var escape = {
+ "&": "&",
+ "<": "<",
+ ">": ">",
+ '"': """,
+ "'": "'",
+ "`": "`"
+ };
+
+ var badChars = /[&<>"'`]/g;
+ var possible = /[&<>"'`]/;
+
+ function escapeChar(chr) {
+ return escape[chr];
+ }
+
+ function extend(obj /* , ...source */) {
+ for (var i = 1; i < arguments.length; i++) {
+ for (var key in arguments[i]) {
+ if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {
+ obj[key] = arguments[i][key];
}
}
}
+
+ return obj;
}
- if(i === 0){
- ret = inverse(this);
+ __exports__.extend = extend;var toString = Object.prototype.toString;
+ __exports__.toString = toString;
+ // Sourced from lodash
+ // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
+ var isFunction = function(value) {
+ return typeof value === 'function';
+ };
+ // fallback for older versions of Chrome and Safari
+ /* istanbul ignore next */
+ if (isFunction(/x/)) {
+ isFunction = function(value) {
+ return typeof value === 'function' && toString.call(value) === '[object Function]';
+ };
}
+ var isFunction;
+ __exports__.isFunction = isFunction;
+ /* istanbul ignore next */
+ var isArray = Array.isArray || function(value) {
+ return (value && typeof value === 'object') ? toString.call(value) === '[object Array]' : false;
+ };
+ __exports__.isArray = isArray;
- return ret;
-});
-
-Handlebars.registerHelper('if', function(conditional, options) {
- var type = toString.call(conditional);
- if(type === functionType) { conditional = conditional.call(this); }
-
- if(!conditional || Handlebars.Utils.isEmpty(conditional)) {
- return options.inverse(this);
- } else {
- return options.fn(this);
- }
-});
-
-Handlebars.registerHelper('unless', function(conditional, options) {
- return Handlebars.helpers['if'].call(this, conditional, {fn: options.inverse, inverse: options.fn});
-});
-
-Handlebars.registerHelper('with', function(context, options) {
- var type = toString.call(context);
- if(type === functionType) { context = context.call(this); }
-
- if (!Handlebars.Utils.isEmpty(context)) return options.fn(context);
-});
-
-Handlebars.registerHelper('log', function(context, options) {
- var level = options.data && options.data.level != null ? parseInt(options.data.level, 10) : 1;
- Handlebars.log(level, context);
-});
-;
-// lib/handlebars/utils.js
-
-var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
-
-Handlebars.Exception = function(message) {
- var tmp = Error.prototype.constructor.apply(this, arguments);
-
- // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
- for (var idx = 0; idx < errorProps.length; idx++) {
- this[errorProps[idx]] = tmp[errorProps[idx]];
- }
-};
-Handlebars.Exception.prototype = new Error();
-
-// Build out our basic SafeString type
-Handlebars.SafeString = function(string) {
- this.string = string;
-};
-Handlebars.SafeString.prototype.toString = function() {
- return this.string.toString();
-};
-
-var escape = {
- "&": "&",
- "<": "<",
- ">": ">",
- '"': """,
- "'": "'",
- "`": "`"
-};
-
-var badChars = /[&<>"'`]/g;
-var possible = /[&<>"'`]/;
-
-var escapeChar = function(chr) {
- return escape[chr] || "&";
-};
-
-Handlebars.Utils = {
- extend: function(obj, value) {
- for(var key in value) {
- if(value.hasOwnProperty(key)) {
- obj[key] = value[key];
- }
- }
- },
-
- escapeExpression: function(string) {
+ function escapeExpression(string) {
// don't escape SafeStrings, since they're already safe
- if (string instanceof Handlebars.SafeString) {
+ if (string instanceof SafeString) {
return string.toString();
- } else if (string == null || string === false) {
+ } else if (string == null) {
return "";
+ } else if (!string) {
+ return string + '';
}
// Force a string conversion as this will be done by the append regardless and
// the regex test will do this transparently behind the scenes, causing issues if
// an object's to string has escaped characters in it.
- string = string.toString();
+ string = "" + string;
if(!possible.test(string)) { return string; }
return string.replace(badChars, escapeChar);
- },
+ }
- isEmpty: function(value) {
+ __exports__.escapeExpression = escapeExpression;function isEmpty(value) {
if (!value && value !== 0) {
return true;
- } else if(toString.call(value) === "[object Array]" && value.length === 0) {
+ } else if (isArray(value) && value.length === 0) {
return true;
} else {
return false;
}
}
-};
-;
-// lib/handlebars/runtime.js
-Handlebars.VM = {
- template: function(templateSpec) {
+ __exports__.isEmpty = isEmpty;function appendContextPath(contextPath, id) {
+ return (contextPath ? contextPath + '.' : '') + id;
+ }
+
+ __exports__.appendContextPath = appendContextPath;
+ return __exports__;
+})(__module3__);
+
+// handlebars/exception.js
+var __module4__ = (function() {
+ "use strict";
+ var __exports__;
+
+ var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
+
+ function Exception(message, node) {
+ var line;
+ if (node && node.firstLine) {
+ line = node.firstLine;
+
+ message += ' - ' + line + ':' + node.firstColumn;
+ }
+
+ var tmp = Error.prototype.constructor.call(this, message);
+
+ // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
+ for (var idx = 0; idx < errorProps.length; idx++) {
+ this[errorProps[idx]] = tmp[errorProps[idx]];
+ }
+
+ if (line) {
+ this.lineNumber = line;
+ this.column = node.firstColumn;
+ }
+ }
+
+ Exception.prototype = new Error();
+
+ __exports__ = Exception;
+ return __exports__;
+})();
+
+// handlebars/base.js
+var __module1__ = (function(__dependency1__, __dependency2__) {
+ "use strict";
+ var __exports__ = {};
+ var Utils = __dependency1__;
+ var Exception = __dependency2__;
+
+ var VERSION = "2.0.0";
+ __exports__.VERSION = VERSION;var COMPILER_REVISION = 6;
+ __exports__.COMPILER_REVISION = COMPILER_REVISION;
+ var REVISION_CHANGES = {
+ 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
+ 2: '== 1.0.0-rc.3',
+ 3: '== 1.0.0-rc.4',
+ 4: '== 1.x.x',
+ 5: '== 2.0.0-alpha.x',
+ 6: '>= 2.0.0-beta.1'
+ };
+ __exports__.REVISION_CHANGES = REVISION_CHANGES;
+ var isArray = Utils.isArray,
+ isFunction = Utils.isFunction,
+ toString = Utils.toString,
+ objectType = '[object Object]';
+
+ function HandlebarsEnvironment(helpers, partials) {
+ this.helpers = helpers || {};
+ this.partials = partials || {};
+
+ registerDefaultHelpers(this);
+ }
+
+ __exports__.HandlebarsEnvironment = HandlebarsEnvironment;HandlebarsEnvironment.prototype = {
+ constructor: HandlebarsEnvironment,
+
+ logger: logger,
+ log: log,
+
+ registerHelper: function(name, fn) {
+ if (toString.call(name) === objectType) {
+ if (fn) { throw new Exception('Arg not supported with multiple helpers'); }
+ Utils.extend(this.helpers, name);
+ } else {
+ this.helpers[name] = fn;
+ }
+ },
+ unregisterHelper: function(name) {
+ delete this.helpers[name];
+ },
+
+ registerPartial: function(name, partial) {
+ if (toString.call(name) === objectType) {
+ Utils.extend(this.partials, name);
+ } else {
+ this.partials[name] = partial;
+ }
+ },
+ unregisterPartial: function(name) {
+ delete this.partials[name];
+ }
+ };
+
+ function registerDefaultHelpers(instance) {
+ instance.registerHelper('helperMissing', function(/* [args, ]options */) {
+ if(arguments.length === 1) {
+ // A missing field in a {{foo}} constuct.
+ return undefined;
+ } else {
+ // Someone is actually trying to call something, blow up.
+ throw new Exception("Missing helper: '" + arguments[arguments.length-1].name + "'");
+ }
+ });
+
+ instance.registerHelper('blockHelperMissing', function(context, options) {
+ var inverse = options.inverse,
+ fn = options.fn;
+
+ if(context === true) {
+ return fn(this);
+ } else if(context === false || context == null) {
+ return inverse(this);
+ } else if (isArray(context)) {
+ if(context.length > 0) {
+ if (options.ids) {
+ options.ids = [options.name];
+ }
+
+ return instance.helpers.each(context, options);
+ } else {
+ return inverse(this);
+ }
+ } else {
+ if (options.data && options.ids) {
+ var data = createFrame(options.data);
+ data.contextPath = Utils.appendContextPath(options.data.contextPath, options.name);
+ options = {data: data};
+ }
+
+ return fn(context, options);
+ }
+ });
+
+ instance.registerHelper('each', function(context, options) {
+ if (!options) {
+ throw new Exception('Must pass iterator to #each');
+ }
+
+ var fn = options.fn, inverse = options.inverse;
+ var i = 0, ret = "", data;
+
+ var contextPath;
+ if (options.data && options.ids) {
+ contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.';
+ }
+
+ if (isFunction(context)) { context = context.call(this); }
+
+ if (options.data) {
+ data = createFrame(options.data);
+ }
+
+ if(context && typeof context === 'object') {
+ if (isArray(context)) {
+ for(var j = context.length; i<j; i++) {
+ if (data) {
+ data.index = i;
+ data.first = (i === 0);
+ data.last = (i === (context.length-1));
+
+ if (contextPath) {
+ data.contextPath = contextPath + i;
+ }
+ }
+ ret = ret + fn(context[i], { data: data });
+ }
+ } else {
+ for(var key in context) {
+ if(context.hasOwnProperty(key)) {
+ if(data) {
+ data.key = key;
+ data.index = i;
+ data.first = (i === 0);
+
+ if (contextPath) {
+ data.contextPath = contextPath + key;
+ }
+ }
+ ret = ret + fn(context[key], {data: data});
+ i++;
+ }
+ }
+ }
+ }
+
+ if(i === 0){
+ ret = inverse(this);
+ }
+
+ return ret;
+ });
+
+ instance.registerHelper('if', function(conditional, options) {
+ if (isFunction(conditional)) { conditional = conditional.call(this); }
+
+ // Default behavior is to render the positive path if the value is truthy and not empty.
+ // The `includeZero` option may be set to treat the condtional as purely not empty based on the
+ // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
+ if ((!options.hash.includeZero && !conditional) || Utils.isEmpty(conditional)) {
+ return options.inverse(this);
+ } else {
+ return options.fn(this);
+ }
+ });
+
+ instance.registerHelper('unless', function(conditional, options) {
+ return instance.helpers['if'].call(this, conditional, {fn: options.inverse, inverse: options.fn, hash: options.hash});
+ });
+
+ instance.registerHelper('with', function(context, options) {
+ if (isFunction(context)) { context = context.call(this); }
+
+ var fn = options.fn;
+
+ if (!Utils.isEmpty(context)) {
+ if (options.data && options.ids) {
+ var data = createFrame(options.data);
+ data.contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]);
+ options = {data:data};
+ }
+
+ return fn(context, options);
+ } else {
+ return options.inverse(this);
+ }
+ });
+
+ instance.registerHelper('log', function(message, options) {
+ var level = options.data && options.data.level != null ? parseInt(options.data.level, 10) : 1;
+ instance.log(level, message);
+ });
+
+ instance.registerHelper('lookup', function(obj, field) {
+ return obj && obj[field];
+ });
+ }
+
+ var logger = {
+ methodMap: { 0: 'debug', 1: 'info', 2: 'warn', 3: 'error' },
+
+ // State enum
+ DEBUG: 0,
+ INFO: 1,
+ WARN: 2,
+ ERROR: 3,
+ level: 3,
+
+ // can be overridden in the host environment
+ log: function(level, message) {
+ if (logger.level <= level) {
+ var method = logger.methodMap[level];
+ if (typeof console !== 'undefined' && console[method]) {
+ console[method].call(console, message);
+ }
+ }
+ }
+ };
+ __exports__.logger = logger;
+ var log = logger.log;
+ __exports__.log = log;
+ var createFrame = function(object) {
+ var frame = Utils.extend({}, object);
+ frame._parent = object;
+ return frame;
+ };
+ __exports__.createFrame = createFrame;
+ return __exports__;
+})(__module2__, __module4__);
+
+// handlebars/runtime.js
+var __module5__ = (function(__dependency1__, __dependency2__, __dependency3__) {
+ "use strict";
+ var __exports__ = {};
+ var Utils = __dependency1__;
+ var Exception = __dependency2__;
+ var COMPILER_REVISION = __dependency3__.COMPILER_REVISION;
+ var REVISION_CHANGES = __dependency3__.REVISION_CHANGES;
+ var createFrame = __dependency3__.createFrame;
+
+ function checkRevision(compilerInfo) {
+ var compilerRevision = compilerInfo && compilerInfo[0] || 1,
+ currentRevision = COMPILER_REVISION;
+
+ if (compilerRevision !== currentRevision) {
+ if (compilerRevision < currentRevision) {
+ var runtimeVersions = REVISION_CHANGES[currentRevision],
+ compilerVersions = REVISION_CHANGES[compilerRevision];
+ throw new Exception("Template was precompiled with an older version of Handlebars than the current runtime. "+
+ "Please update your precompiler to a newer version ("+runtimeVersions+") or downgrade your runtime to an older version ("+compilerVersions+").");
+ } else {
+ // Use the embedded version info since the runtime doesn't know about this revision yet
+ throw new Exception("Template was precompiled with a newer version of Handlebars than the current runtime. "+
+ "Please update your runtime to a newer version ("+compilerInfo[1]+").");
+ }
+ }
+ }
+
+ __exports__.checkRevision = checkRevision;// TODO: Remove this line and break up compilePartial
+
+ function template(templateSpec, env) {
+ /* istanbul ignore next */
+ if (!env) {
+ throw new Exception("No environment passed to template");
+ }
+ if (!templateSpec || !templateSpec.main) {
+ throw new Exception('Unknown template object: ' + typeof templateSpec);
+ }
+
+ // Note: Using env.VM references rather than local var references throughout this section to allow
+ // for external users to override these as psuedo-supported APIs.
+ env.VM.checkRevision(templateSpec.compiler);
+
+ var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) {
+ if (hash) {
+ context = Utils.extend({}, context, hash);
+ }
+
+ var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data, depths);
+
+ if (result == null && env.compile) {
+ var options = { helpers: helpers, partials: partials, data: data, depths: depths };
+ partials[name] = env.compile(partial, { data: data !== undefined, compat: templateSpec.compat }, env);
+ result = partials[name](context, options);
+ }
+ if (result != null) {
+ if (indent) {
+ var lines = result.split('\n');
+ for (var i = 0, l = lines.length; i < l; i++) {
+ if (!lines[i] && i + 1 === l) {
+ break;
+ }
+
+ lines[i] = indent + lines[i];
+ }
+ result = lines.join('\n');
+ }
+ return result;
+ } else {
+ throw new Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
+ }
+ };
+
// Just add water
var container = {
- escapeExpression: Handlebars.Utils.escapeExpression,
- invokePartial: Handlebars.VM.invokePartial,
+ lookup: function(depths, name) {
+ var len = depths.length;
+ for (var i = 0; i < len; i++) {
+ if (depths[i] && depths[i][name] != null) {
+ return depths[i][name];
+ }
+ }
+ },
+ lambda: function(current, context) {
+ return typeof current === 'function' ? current.call(context) : current;
+ },
+
+ escapeExpression: Utils.escapeExpression,
+ invokePartial: invokePartialWrapper,
+
+ fn: function(i) {
+ return templateSpec[i];
+ },
+
programs: [],
- program: function(i, fn, data) {
- var programWrapper = this.programs[i];
- if(data) {
- programWrapper = Handlebars.VM.program(i, fn, data);
+ program: function(i, data, depths) {
+ var programWrapper = this.programs[i],
+ fn = this.fn(i);
+ if (data || depths) {
+ programWrapper = program(this, i, fn, data, depths);
} else if (!programWrapper) {
- programWrapper = this.programs[i] = Handlebars.VM.program(i, fn);
+ programWrapper = this.programs[i] = program(this, i, fn);
}
return programWrapper;
},
+
+ data: function(data, depth) {
+ while (data && depth--) {
+ data = data._parent;
+ }
+ return data;
+ },
merge: function(param, common) {
var ret = param || common;
- if (param && common) {
- ret = {};
- Handlebars.Utils.extend(ret, common);
- Handlebars.Utils.extend(ret, param);
+ if (param && common && (param !== common)) {
+ ret = Utils.extend({}, common, param);
}
+
return ret;
},
- programWithDepth: Handlebars.VM.programWithDepth,
- noop: Handlebars.VM.noop,
- compilerInfo: null
+
+ noop: env.VM.noop,
+ compilerInfo: templateSpec.compiler
};
- return function(context, options) {
+ var ret = function(context, options) {
options = options || {};
- var result = templateSpec.call(container, Handlebars, context, options.helpers, options.partials, options.data);
+ var data = options.data;
- var compilerInfo = container.compilerInfo || [],
- compilerRevision = compilerInfo[0] || 1,
- currentRevision = Handlebars.COMPILER_REVISION;
-
- if (compilerRevision !== currentRevision) {
- if (compilerRevision < currentRevision) {
- var runtimeVersions = Handlebars.REVISION_CHANGES[currentRevision],
- compilerVersions = Handlebars.REVISION_CHANGES[compilerRevision];
- throw "Template was precompiled with an older version of Handlebars than the current runtime. "+
- "Please update your precompiler to a newer version ("+runtimeVersions+") or downgrade your runtime to an older version ("+compilerVersions+").";
- } else {
- // Use the embedded version info since the runtime doesn't know about this revision yet
- throw "Template was precompiled with a newer version of Handlebars than the current runtime. "+
- "Please update your runtime to a newer version ("+compilerInfo[1]+").";
- }
+ ret._setup(options);
+ if (!options.partial && templateSpec.useData) {
+ data = initData(context, data);
+ }
+ var depths;
+ if (templateSpec.useDepths) {
+ depths = options.depths ? [context].concat(options.depths) : [context];
}
- return result;
+ return templateSpec.main.call(container, context, container.helpers, container.partials, data, depths);
};
- },
+ ret.isTop = true;
- programWithDepth: function(i, fn, data /*, $depth */) {
- var args = Array.prototype.slice.call(arguments, 3);
+ ret._setup = function(options) {
+ if (!options.partial) {
+ container.helpers = container.merge(options.helpers, env.helpers);
- var program = function(context, options) {
+ if (templateSpec.usePartial) {
+ container.partials = container.merge(options.partials, env.partials);
+ }
+ } else {
+ container.helpers = options.helpers;
+ container.partials = options.partials;
+ }
+ };
+
+ ret._child = function(i, data, depths) {
+ if (templateSpec.useDepths && !depths) {
+ throw new Exception('must pass parent depths');
+ }
+
+ return program(container, i, templateSpec[i], data, depths);
+ };
+ return ret;
+ }
+
+ __exports__.template = template;function program(container, i, fn, data, depths) {
+ var prog = function(context, options) {
options = options || {};
- return fn.apply(this, [context, options.data || data].concat(args));
+ return fn.call(container, context, container.helpers, container.partials, options.data || data, depths && [context].concat(depths));
};
- program.program = i;
- program.depth = args.length;
- return program;
- },
- program: function(i, fn, data) {
- var program = function(context, options) {
- options = options || {};
+ prog.program = i;
+ prog.depth = depths ? depths.length : 0;
+ return prog;
+ }
- return fn(context, options.data || data);
- };
- program.program = i;
- program.depth = 0;
- return program;
- },
- noop: function() { return ""; },
- invokePartial: function(partial, name, context, helpers, partials, data) {
- var options = { helpers: helpers, partials: partials, data: data };
+ __exports__.program = program;function invokePartial(partial, name, context, helpers, partials, data, depths) {
+ var options = { partial: true, helpers: helpers, partials: partials, data: data, depths: depths };
if(partial === undefined) {
- throw new Handlebars.Exception("The partial " + name + " could not be found");
+ throw new Exception("The partial " + name + " could not be found");
} else if(partial instanceof Function) {
return partial(context, options);
- } else if (!Handlebars.compile) {
- throw new Handlebars.Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
- } else {
- partials[name] = Handlebars.compile(partial, {data: data !== undefined});
- return partials[name](context, options);
}
}
-};
-Handlebars.template = Handlebars.VM.template;
-;
-// lib/handlebars/browser-suffix.js
-})(Handlebars);
-;
+ __exports__.invokePartial = invokePartial;function noop() { return ""; }
+
+ __exports__.noop = noop;function initData(context, data) {
+ if (!data || !('root' in data)) {
+ data = data ? createFrame(data) : {};
+ data.root = context;
+ }
+ return data;
+ }
+ return __exports__;
+})(__module2__, __module4__, __module1__);
+
+// handlebars.runtime.js
+var __module0__ = (function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__) {
+ "use strict";
+ var __exports__;
+ /*globals Handlebars: true */
+ var base = __dependency1__;
+
+ // Each of these augment the Handlebars object. No need to setup here.
+ // (This is done to easily share code between commonjs and browse envs)
+ var SafeString = __dependency2__;
+ var Exception = __dependency3__;
+ var Utils = __dependency4__;
+ var runtime = __dependency5__;
+
+ // For compatibility and usage outside of module systems, make the Handlebars object a namespace
+ var create = function() {
+ var hb = new base.HandlebarsEnvironment();
+
+ Utils.extend(hb, base);
+ hb.SafeString = SafeString;
+ hb.Exception = Exception;
+ hb.Utils = Utils;
+ hb.escapeExpression = Utils.escapeExpression;
+
+ hb.VM = runtime;
+ hb.template = function(spec) {
+ return runtime.template(spec, hb);
+ };
+
+ return hb;
+ };
+
+ var Handlebars = create();
+ Handlebars.create = create;
+
+ Handlebars['default'] = Handlebars;
+
+ __exports__ = Handlebars;
+ return __exports__;
+})(__module1__, __module3__, __module4__, __module2__, __module5__);
+
+ return __module0__;
+}));
diff -r 175feec6a9d3028812548d62f99fbaa8b69b18e1 -r 334ae138b7b66dbaa95292213aab86ccc08efcae client/galaxy/scripts/templates/compiled/panel_section.js
--- a/client/galaxy/scripts/templates/compiled/panel_section.js
+++ b/client/galaxy/scripts/templates/compiled/panel_section.js
@@ -1,24 +1,13 @@
(function() {
var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
-templates['panel_section'] = template(function (Handlebars,depth0,helpers,partials,data) {
- this.compilerInfo = [4,'>= 1.0.0'];
-helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
- var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression;
-
-
- buffer += "<div class=\"toolSectionTitle\" id=\"title_";
- if (stack1 = helpers.id) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.id; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + "\">\n <a href=\"javascript:void(0)\"><span>";
- if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + "</span></a>\n</div>\n<div id=\"";
- if (stack1 = helpers.id) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.id; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
+templates['panel_section'] = template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return "<div class=\"toolSectionTitle\" id=\"title_"
+ + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))
+ + "\">\n <a href=\"javascript:void(0)\"><span>"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "</span></a>\n</div>\n<div id=\""
+ + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))
+ "\" class=\"toolSectionBody\" style=\"display: none; \">\n <div class=\"toolSectionBg\"></div>\n<div>";
- return buffer;
- });
+},"useData":true});
})();
\ No newline at end of file
diff -r 175feec6a9d3028812548d62f99fbaa8b69b18e1 -r 334ae138b7b66dbaa95292213aab86ccc08efcae client/galaxy/scripts/templates/compiled/tool_form.js
--- a/client/galaxy/scripts/templates/compiled/tool_form.js
+++ b/client/galaxy/scripts/templates/compiled/tool_form.js
@@ -1,49 +1,26 @@
(function() {
var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
-templates['tool_form'] = template(function (Handlebars,depth0,helpers,partials,data) {
- this.compilerInfo = [4,'>= 1.0.0'];
-helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
- var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
-
-function program1(depth0,data) {
-
- var buffer = "", stack1;
- buffer += "\n <div class=\"form-row\">\n <label for=\"";
- if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + "\">";
- if (stack1 = helpers.label) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.label; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
+templates['tool_form'] = template({"1":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = " <div class=\"form-row\">\n <label for=\""
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "\">"
+ + escapeExpression(((helper = (helper = helpers.label || (depth0 != null ? depth0.label : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"label","hash":{},"data":data}) : helper)))
+ ":</label>\n <div class=\"form-row-input\">\n ";
- if (stack1 = helpers.html) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.html; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n </div>\n <div class=\"toolParamHelp\" style=\"clear: both;\">\n ";
- if (stack1 = helpers.help) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.help; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + "\n </div>\n <div style=\"clear: both;\"></div>\n </div>\n ";
- return buffer;
- }
-
- buffer += "<div class=\"toolFormTitle\">";
- if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + " (version ";
- if (stack1 = helpers.version) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.version; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + ")</div>\n <div class=\"toolFormBody\">\n ";
- stack1 = helpers.each.call(depth0, depth0.inputs, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\n </div>\n <div class=\"form-row form-actions\">\n <input type=\"submit\" class=\"btn btn-primary\" name=\"runtool_btn\" value=\"Execute\">\n</div>\n<div class=\"toolHelp\">\n <div class=\"toolHelpBody\">";
- if (stack1 = helpers.help) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.help; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
+ stack1 = ((helper = (helper = helpers.html || (depth0 != null ? depth0.html : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"html","hash":{},"data":data}) : helper));
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + "\n </div>\n <div class=\"toolParamHelp\" style=\"clear: both;\">\n "
+ + escapeExpression(((helper = (helper = helpers.help || (depth0 != null ? depth0.help : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"help","hash":{},"data":data}) : helper)))
+ + "\n </div>\n <div style=\"clear: both;\"></div>\n </div>\n";
+},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<div class=\"toolFormTitle\">"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + " (version "
+ + escapeExpression(((helper = (helper = helpers.version || (depth0 != null ? depth0.version : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"version","hash":{},"data":data}) : helper)))
+ + ")</div>\n <div class=\"toolFormBody\">\n";
+ stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.inputs : depth0), {"name":"each","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data});
+ if (stack1 != null) { buffer += stack1; }
+ return buffer + " </div>\n <div class=\"form-row form-actions\">\n <input type=\"submit\" class=\"btn btn-primary\" name=\"runtool_btn\" value=\"Execute\">\n</div>\n<div class=\"toolHelp\">\n <div class=\"toolHelpBody\">"
+ + escapeExpression(((helper = (helper = helpers.help || (depth0 != null ? depth0.help : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"help","hash":{},"data":data}) : helper)))
+ "</div>\n</div>";
- return buffer;
- });
+},"useData":true});
})();
\ No newline at end of file
diff -r 175feec6a9d3028812548d62f99fbaa8b69b18e1 -r 334ae138b7b66dbaa95292213aab86ccc08efcae client/galaxy/scripts/templates/compiled/tool_link.js
--- a/client/galaxy/scripts/templates/compiled/tool_link.js
+++ b/client/galaxy/scripts/templates/compiled/tool_link.js
@@ -1,35 +1,18 @@
(function() {
var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
-templates['tool_link'] = template(function (Handlebars,depth0,helpers,partials,data) {
- this.compilerInfo = [4,'>= 1.0.0'];
-helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
- var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression;
-
-
- buffer += "<a class=\"";
- if (stack1 = helpers.id) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.id; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + " tool-link\" href=\"";
- if (stack1 = helpers.link) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.link; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + "\" target=\"";
- if (stack1 = helpers.target) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.target; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + "\" minsizehint=\"";
- if (stack1 = helpers.min_width) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.min_width; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + "\">";
- if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + "</a> ";
- if (stack1 = helpers.description) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.description; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1);
- return buffer;
- });
+templates['tool_link'] = template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return "<a class=\""
+ + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))
+ + " tool-link\" href=\""
+ + escapeExpression(((helper = (helper = helpers.link || (depth0 != null ? depth0.link : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"link","hash":{},"data":data}) : helper)))
+ + "\" target=\""
+ + escapeExpression(((helper = (helper = helpers.target || (depth0 != null ? depth0.target : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"target","hash":{},"data":data}) : helper)))
+ + "\" minsizehint=\""
+ + escapeExpression(((helper = (helper = helpers.min_width || (depth0 != null ? depth0.min_width : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"min_width","hash":{},"data":data}) : helper)))
+ + "\">"
+ + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ + "</a> "
+ + escapeExpression(((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper)));
+},"useData":true});
})();
\ No newline at end of file
diff -r 175feec6a9d3028812548d62f99fbaa8b69b18e1 -r 334ae138b7b66dbaa95292213aab86ccc08efcae client/galaxy/scripts/templates/compiled/tool_search.js
--- a/client/galaxy/scripts/templates/compiled/tool_search.js
+++ b/client/galaxy/scripts/templates/compiled/tool_search.js
@@ -1,20 +1,11 @@
(function() {
var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
-templates['tool_search'] = template(function (Handlebars,depth0,helpers,partials,data) {
- this.compilerInfo = [4,'>= 1.0.0'];
-helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
- var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression;
-
-
- buffer += "<input type=\"text\" name=\"query\" value=\"";
- if (stack1 = helpers.search_hint_string) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.search_hint_string; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
- + "\" id=\"tool-search-query\" autocomplete=\"off\" class=\"search-query parent-width\" />\n<a id=\"search-clear-btn\" title=\"clear search (esc)\"></a>\n<img src=\"";
- if (stack1 = helpers.spinner_url) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.spinner_url; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- buffer += escapeExpression(stack1)
+templates['tool_search'] = template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
+ var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
+ return "<input type=\"text\" name=\"query\" value=\""
+ + escapeExpression(((helper = (helper = helpers.search_hint_string || (depth0 != null ? depth0.search_hint_string : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"search_hint_string","hash":{},"data":data}) : helper)))
+ + "\" id=\"tool-search-query\" autocomplete=\"off\" class=\"search-query parent-width\" />\n<a id=\"search-clear-btn\" title=\"clear search (esc)\"></a>\n<img src=\""
+ + escapeExpression(((helper = (helper = helpers.spinner_url || (depth0 != null ? depth0.spinner_url : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"spinner_url","hash":{},"data":data}) : helper)))
+ "\" id=\"search-spinner\" class=\"search-spinner\"/>";
- return buffer;
- });
+},"useData":true});
})();
\ No newline at end of file
This diff is so big that we needed to truncate the remainder.
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: ToolForm: Add optional tool state format
by commits-noreply@bitbucket.org 04 Feb '15
by commits-noreply@bitbucket.org 04 Feb '15
04 Feb '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/175feec6a9d3/
Changeset: 175feec6a9d3
User: guerler
Date: 2015-02-04 04:40:36+00:00
Summary: ToolForm: Add optional tool state format
Affected #: 9 files
diff -r 4e990792d37479e8fb4f6fec272efb51764c5252 -r 175feec6a9d3028812548d62f99fbaa8b69b18e1 client/galaxy/scripts/mvc/tools/tools-section.js
--- a/client/galaxy/scripts/mvc/tools/tools-section.js
+++ b/client/galaxy/scripts/mvc/tools/tools-section.js
@@ -317,6 +317,11 @@
// add to field list
this.app.field_list[id] = field;
+ // fix default value if missing
+ if (input_def.default_value === undefined) {
+ input_def.default_value = input_def.value;
+ }
+
// create input field wrapper
var input_element = new InputElement(this.app, {
label : input_def.label,
diff -r 4e990792d37479e8fb4f6fec272efb51764c5252 -r 175feec6a9d3028812548d62f99fbaa8b69b18e1 client/galaxy/scripts/mvc/tools/tools-tree.js
--- a/client/galaxy/scripts/mvc/tools/tools-tree.js
+++ b/client/galaxy/scripts/mvc/tools/tools-tree.js
@@ -123,14 +123,15 @@
}
// validate field value
- if (field.skip || (field.validate && !field.validate())) {
- if (self.app.options.use_defaults) {
- value = input.default_value;
- } else {
- value = null;
- }
+ if (field.skip) {
+ continue;
}
-
+
+ // validate field value
+ if (field.validate && !field.validate()) {
+ value = null;
+ }
+
// ignore certain values
if (input.ignore === undefined || (value !== null && input.ignore != value)) {
// add value to submission
diff -r 4e990792d37479e8fb4f6fec272efb51764c5252 -r 175feec6a9d3028812548d62f99fbaa8b69b18e1 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -2293,7 +2293,7 @@
job_params = job.get_param_values( trans.app, ignore_errors = True )
job_messages = self.check_and_update_param_values( job_params, trans, update_values=False )
tool_message = self._compare_tool_version(trans, job)
- params_to_incoming( kwd, self.inputs, job_params, trans.app )
+ params_to_incoming( kwd, self.inputs, job_params, trans.app, to_html=False )
except Exception, exception:
trans.response.status = 500
return { 'error': str( exception ) }
@@ -2463,7 +2463,7 @@
sanitize(tool_dict, 'default_value')
# use default value
- if not tool_dict['value']:
+ if tool_dict['value'] is None:
tool_dict['value'] = tool_dict['default_value']
# backup final input dictionary
diff -r 4e990792d37479e8fb4f6fec272efb51764c5252 -r 175feec6a9d3028812548d62f99fbaa8b69b18e1 lib/galaxy/tools/parameters/__init__.py
--- a/lib/galaxy/tools/parameters/__init__.py
+++ b/lib/galaxy/tools/parameters/__init__.py
@@ -105,7 +105,7 @@
return rval
-def params_to_incoming( incoming, inputs, input_values, app, name_prefix="" ):
+def params_to_incoming( incoming, inputs, input_values, app, name_prefix="", to_html=True ):
"""
Given a tool's parameter definition (`inputs`) and a specific set of
parameter `input_values` objects, populate `incoming` with the html values.
@@ -117,12 +117,15 @@
for i, d in enumerate( input_values[ input.name ] ):
index = d['__index__']
new_name_prefix = name_prefix + "%s_%d|" % ( input.name, index )
- params_to_incoming( incoming, input.inputs, d, app, new_name_prefix )
+ params_to_incoming( incoming, input.inputs, d, app, new_name_prefix, to_html=to_html)
elif isinstance( input, Conditional ):
values = input_values[ input.name ]
current = values["__current_case__"]
new_name_prefix = name_prefix + input.name + "|"
incoming[ new_name_prefix + input.test_param.name ] = values[ input.test_param.name ]
- params_to_incoming( incoming, input.cases[current].inputs, values, app, new_name_prefix )
+ params_to_incoming( incoming, input.cases[current].inputs, values, app, new_name_prefix, to_html=to_html )
else:
- incoming[ name_prefix + input.name ] = input.to_html_value( input_values.get( input.name ), app )
+ value = input_values.get( input.name )
+ if to_html:
+ value = input.to_html_value( value, app )
+ incoming[ name_prefix + input.name ] = value
diff -r 4e990792d37479e8fb4f6fec272efb51764c5252 -r 175feec6a9d3028812548d62f99fbaa8b69b18e1 static/scripts/mvc/tools/tools-section.js
--- a/static/scripts/mvc/tools/tools-section.js
+++ b/static/scripts/mvc/tools/tools-section.js
@@ -317,6 +317,11 @@
// add to field list
this.app.field_list[id] = field;
+ // fix default value if missing
+ if (input_def.default_value === undefined) {
+ input_def.default_value = input_def.value;
+ }
+
// create input field wrapper
var input_element = new InputElement(this.app, {
label : input_def.label,
diff -r 4e990792d37479e8fb4f6fec272efb51764c5252 -r 175feec6a9d3028812548d62f99fbaa8b69b18e1 static/scripts/mvc/tools/tools-tree.js
--- a/static/scripts/mvc/tools/tools-tree.js
+++ b/static/scripts/mvc/tools/tools-tree.js
@@ -123,14 +123,15 @@
}
// validate field value
- if (field.skip || (field.validate && !field.validate())) {
- if (self.app.options.use_defaults) {
- value = input.default_value;
- } else {
- value = null;
- }
+ if (field.skip) {
+ continue;
}
-
+
+ // validate field value
+ if (field.validate && !field.validate()) {
+ value = null;
+ }
+
// ignore certain values
if (input.ignore === undefined || (value !== null && input.ignore != value)) {
// add value to submission
diff -r 4e990792d37479e8fb4f6fec272efb51764c5252 -r 175feec6a9d3028812548d62f99fbaa8b69b18e1 static/scripts/packed/mvc/tools/tools-section.js
--- a/static/scripts/packed/mvc/tools/tools-section.js
+++ b/static/scripts/packed/mvc/tools/tools-section.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/ui/ui-portlet","mvc/tools/tools-repeat","mvc/tools/tools-select-content","mvc/tools/tools-input"],function(e,b,h,d,c,a,f){var g=Backbone.View.extend({initialize:function(j,i){this.app=j;this.inputs=i.inputs;i.cls="ui-table-plain";i.cls_tr="section-row";this.table=new b.View(i);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var j in this.inputs){this.add(this.inputs[j])}},add:function(k){var j=this;var i=jQuery.extend(true,{},k);i.id=k.id=e.uuid();this.app.input_list[i.id]=i;var l=i.type;switch(l){case"conditional":this._addConditional(i);break;case"repeat":this._addRepeat(i);break;case"section":this._addSection(i);break;default:this._addRow(i)}},_addConditional:function(j){var k=this;j.test_param.id=j.id;var n=this._addRow(j.test_param);n.options.onchange=function(w){var v=k.app.tree.matchCase(j,w);for(var u in j.cases){var q=j.cases[u];var t=j.id+"-section-"+u;var p=k.table.get(t);var s=false;for(var r in q.inputs){if(!q.inputs[r].hidden){s=true;break}}if(u==v&&s){p.fadeIn("fast")}else{p.hide()}}k.app.trigger("refresh")};for(var m in j.cases){var l=j.id+"-section-"+m;var o=new g(this.app,{inputs:j.cases[m].inputs});o.$el.addClass("ui-table-form-section");this.table.add(o.$el);this.table.append(l)}n.trigger("change")},_addRepeat:function(p){var s=this;var q=0;function n(i,u){var t=p.id+"-section-"+(q++);var v=null;if(u){v=function(){l.del(t);l.retitle(p.title);s.app.trigger("refresh")}}var w=new g(s.app,{inputs:i});l.add({id:t,title:p.title,$el:w.$el,ondel:v});l.retitle(p.title)}var l=new c.View({title_new:p.title,max:p.max,onnew:function(){n(p.inputs,true);s.app.trigger("refresh")}});var j=p.min;var r=_.size(p.cache);for(var m=0;m<Math.max(r,j);m++){var o=null;if(m<r){o=p.cache[m]}else{o=p.inputs}n(o,m>=j)}var k=new f(this.app,{label:p.title,help:p.help,field:l});k.$el.addClass("ui-table-form-section");this.table.add(k.$el);this.table.append(p.id)},_addSection:function(i){var j=this;var n=new g(j.app,{inputs:i.inputs});var m=new h.ButtonIcon({icon:"fa-eye-slash",tooltip:"Show/hide section",cls:"ui-button-icon-plain"});var l=new d.View({title:i.label,cls:"ui-portlet-section",operations:{button_visible:m}});l.append(n.$el);l.append($("<div/>").addClass("ui-table-form-info").html(i.help));var k=false;l.$content.hide();l.$header.css("cursor","pointer");l.$header.on("click",function(){if(k){k=false;l.$content.hide();m.setIcon("fa-eye-slash")}else{k=true;l.$content.fadeIn("fast");m.setIcon("fa-eye")}});if(i.expand){l.$header.trigger("click")}this.table.add(l.$el);this.table.append(i.id)},_addRow:function(i){var l=i.id;var j=this._createField(i);this.app.field_list[l]=j;var k=new f(this.app,{label:i.label,default_value:i.default_value,optional:i.optional,help:i.help,field:j});this.app.element_list[l]=k;this.table.add(k.$el);this.table.append(l);if(i.hidden){this.table.get(l).hide()}return j},_createField:function(i){var j=null;switch(i.type){case"text":j=this._fieldText(i);break;case"select":j=this._fieldSelect(i);break;case"data":j=this._fieldData(i);break;case"data_collection":j=this._fieldData(i);break;case"data_column":i.error_text="Missing columns in referenced dataset.";j=this._fieldSelect(i);break;case"hidden":j=this._fieldHidden(i);break;case"hidden_data":j=this._fieldHidden(i);break;case"integer":j=this._fieldSlider(i);break;case"float":j=this._fieldSlider(i);break;case"boolean":j=this._fieldBoolean(i);break;case"genomebuild":i.searchable=true;j=this._fieldSelect(i);break;case"drill_down":j=this._fieldDrilldown(i);break;case"baseurl":j=this._fieldHidden(i);break;default:this.app.incompatible=true;if(i.options){j=this._fieldSelect(i)}else{j=this._fieldText(i)}console.debug("tools-form::_addRow() : Auto matched field type ("+i.type+").")}if(i.value!==undefined){j.value(i.value)}return j},_fieldData:function(i){if(!this.app.options.is_dynamic){i.info="Data input '"+i.name+"' ("+e.textify(i.extensions.toString())+")";i.value=null;return this._fieldHidden(i)}var j=this;return new a.View(this.app,{id:"field-"+i.id,extensions:i.extensions,optional:i.optional,multiple:i.multiple,type:i.type,data:i.options,onchange:function(){j.app.trigger("refresh")}})},_fieldSelect:function(j){if(!this.app.options.is_dynamic&&j.is_dynamic){return this._fieldText(j)}var l=[];for(var m in j.options){var n=j.options[m];l.push({label:n[0],value:n[1]})}var o=h.Select;switch(j.display){case"checkboxes":o=h.Checkbox;break;case"radio":o=h.Radio;break}var k=this;return new o.View({id:"field-"+j.id,data:l,error_text:j.error_text||"No options available",multiple:j.multiple,searchable:j.searchable,onchange:function(){k.app.trigger("refresh")}})},_fieldDrilldown:function(i){if(!this.app.options.is_dynamic&&i.is_dynamic){return this._fieldText(i)}var j=this;return new h.Drilldown.View({id:"field-"+i.id,data:i.options,display:i.display,onchange:function(){j.app.trigger("refresh")}})},_fieldText:function(i){if(i.options){i.area=i.multiple;if(!e.validate(i.value)){i.value=""}else{if(i.value instanceof Array){i.value=value.toString()}else{i.value=String(i.value).replace(/[\[\]'"\s]/g,"");if(i.multiple){i.value=i.value.replace(/,/g,"\n")}}}}var j=this;return new h.Input({id:"field-"+i.id,area:i.area,onchange:function(){j.app.trigger("refresh")}})},_fieldSlider:function(i){var j=this;return new h.Slider.View({id:"field-"+i.id,precise:i.type=="float",min:i.min,max:i.max,onchange:function(){j.app.trigger("refresh")}})},_fieldHidden:function(i){return new h.Hidden({id:"field-"+i.id,info:i.info})},_fieldBoolean:function(i){var j=this;return new h.RadioButton.View({id:"field-"+i.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}],onchange:function(){j.app.trigger("refresh")}})}});return{View:g}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/ui/ui-portlet","mvc/tools/tools-repeat","mvc/tools/tools-select-content","mvc/tools/tools-input"],function(e,b,h,d,c,a,f){var g=Backbone.View.extend({initialize:function(j,i){this.app=j;this.inputs=i.inputs;i.cls="ui-table-plain";i.cls_tr="section-row";this.table=new b.View(i);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var j in this.inputs){this.add(this.inputs[j])}},add:function(k){var j=this;var i=jQuery.extend(true,{},k);i.id=k.id=e.uuid();this.app.input_list[i.id]=i;var l=i.type;switch(l){case"conditional":this._addConditional(i);break;case"repeat":this._addRepeat(i);break;case"section":this._addSection(i);break;default:this._addRow(i)}},_addConditional:function(j){var k=this;j.test_param.id=j.id;var n=this._addRow(j.test_param);n.options.onchange=function(w){var v=k.app.tree.matchCase(j,w);for(var u in j.cases){var q=j.cases[u];var t=j.id+"-section-"+u;var p=k.table.get(t);var s=false;for(var r in q.inputs){if(!q.inputs[r].hidden){s=true;break}}if(u==v&&s){p.fadeIn("fast")}else{p.hide()}}k.app.trigger("refresh")};for(var m in j.cases){var l=j.id+"-section-"+m;var o=new g(this.app,{inputs:j.cases[m].inputs});o.$el.addClass("ui-table-form-section");this.table.add(o.$el);this.table.append(l)}n.trigger("change")},_addRepeat:function(p){var s=this;var q=0;function n(i,u){var t=p.id+"-section-"+(q++);var v=null;if(u){v=function(){l.del(t);l.retitle(p.title);s.app.trigger("refresh")}}var w=new g(s.app,{inputs:i});l.add({id:t,title:p.title,$el:w.$el,ondel:v});l.retitle(p.title)}var l=new c.View({title_new:p.title,max:p.max,onnew:function(){n(p.inputs,true);s.app.trigger("refresh")}});var j=p.min;var r=_.size(p.cache);for(var m=0;m<Math.max(r,j);m++){var o=null;if(m<r){o=p.cache[m]}else{o=p.inputs}n(o,m>=j)}var k=new f(this.app,{label:p.title,help:p.help,field:l});k.$el.addClass("ui-table-form-section");this.table.add(k.$el);this.table.append(p.id)},_addSection:function(i){var j=this;var n=new g(j.app,{inputs:i.inputs});var m=new h.ButtonIcon({icon:"fa-eye-slash",tooltip:"Show/hide section",cls:"ui-button-icon-plain"});var l=new d.View({title:i.label,cls:"ui-portlet-section",operations:{button_visible:m}});l.append(n.$el);l.append($("<div/>").addClass("ui-table-form-info").html(i.help));var k=false;l.$content.hide();l.$header.css("cursor","pointer");l.$header.on("click",function(){if(k){k=false;l.$content.hide();m.setIcon("fa-eye-slash")}else{k=true;l.$content.fadeIn("fast");m.setIcon("fa-eye")}});if(i.expand){l.$header.trigger("click")}this.table.add(l.$el);this.table.append(i.id)},_addRow:function(i){var l=i.id;var j=this._createField(i);this.app.field_list[l]=j;if(i.default_value===undefined){i.default_value=i.value}var k=new f(this.app,{label:i.label,default_value:i.default_value,optional:i.optional,help:i.help,field:j});this.app.element_list[l]=k;this.table.add(k.$el);this.table.append(l);if(i.hidden){this.table.get(l).hide()}return j},_createField:function(i){var j=null;switch(i.type){case"text":j=this._fieldText(i);break;case"select":j=this._fieldSelect(i);break;case"data":j=this._fieldData(i);break;case"data_collection":j=this._fieldData(i);break;case"data_column":i.error_text="Missing columns in referenced dataset.";j=this._fieldSelect(i);break;case"hidden":j=this._fieldHidden(i);break;case"hidden_data":j=this._fieldHidden(i);break;case"integer":j=this._fieldSlider(i);break;case"float":j=this._fieldSlider(i);break;case"boolean":j=this._fieldBoolean(i);break;case"genomebuild":i.searchable=true;j=this._fieldSelect(i);break;case"drill_down":j=this._fieldDrilldown(i);break;case"baseurl":j=this._fieldHidden(i);break;default:this.app.incompatible=true;if(i.options){j=this._fieldSelect(i)}else{j=this._fieldText(i)}console.debug("tools-form::_addRow() : Auto matched field type ("+i.type+").")}if(i.value!==undefined){j.value(i.value)}return j},_fieldData:function(i){if(!this.app.options.is_dynamic){i.info="Data input '"+i.name+"' ("+e.textify(i.extensions.toString())+")";i.value=null;return this._fieldHidden(i)}var j=this;return new a.View(this.app,{id:"field-"+i.id,extensions:i.extensions,optional:i.optional,multiple:i.multiple,type:i.type,data:i.options,onchange:function(){j.app.trigger("refresh")}})},_fieldSelect:function(j){if(!this.app.options.is_dynamic&&j.is_dynamic){return this._fieldText(j)}var l=[];for(var m in j.options){var n=j.options[m];l.push({label:n[0],value:n[1]})}var o=h.Select;switch(j.display){case"checkboxes":o=h.Checkbox;break;case"radio":o=h.Radio;break}var k=this;return new o.View({id:"field-"+j.id,data:l,error_text:j.error_text||"No options available",multiple:j.multiple,searchable:j.searchable,onchange:function(){k.app.trigger("refresh")}})},_fieldDrilldown:function(i){if(!this.app.options.is_dynamic&&i.is_dynamic){return this._fieldText(i)}var j=this;return new h.Drilldown.View({id:"field-"+i.id,data:i.options,display:i.display,onchange:function(){j.app.trigger("refresh")}})},_fieldText:function(i){if(i.options){i.area=i.multiple;if(!e.validate(i.value)){i.value=""}else{if(i.value instanceof Array){i.value=value.toString()}else{i.value=String(i.value).replace(/[\[\]'"\s]/g,"");if(i.multiple){i.value=i.value.replace(/,/g,"\n")}}}}var j=this;return new h.Input({id:"field-"+i.id,area:i.area,onchange:function(){j.app.trigger("refresh")}})},_fieldSlider:function(i){var j=this;return new h.Slider.View({id:"field-"+i.id,precise:i.type=="float",min:i.min,max:i.max,onchange:function(){j.app.trigger("refresh")}})},_fieldHidden:function(i){return new h.Hidden({id:"field-"+i.id,info:i.info})},_fieldBoolean:function(i){var j=this;return new h.RadioButton.View({id:"field-"+i.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}],onchange:function(){j.app.trigger("refresh")}})}});return{View:g}});
\ No newline at end of file
diff -r 4e990792d37479e8fb4f6fec272efb51764c5252 -r 175feec6a9d3028812548d62f99fbaa8b69b18e1 static/scripts/packed/mvc/tools/tools-tree.js
--- a/static/scripts/packed/mvc/tools/tools-tree.js
+++ b/static/scripts/packed/mvc/tools/tools-tree.js
@@ -1,1 +1,1 @@
-define(["utils/utils"],function(a){return Backbone.Model.extend({initialize:function(b){this.app=b},finalize:function(g){var b=this;this.map_dict={};if(!this.app.section){return{}}g=g||{};var f={};var e={};this._iterate(this.app.section.$el,e);function d(j,i,h){f[j]=h;b.map_dict[j]=i}function c(p,s){for(var n in s){var k=s[n];if(k.input){var u=k.input;var o=p;if(p!=""){o+="|"}o+=u.name;switch(u.type){case"repeat":var j="section-";var x=[];var r=null;for(var w in k){var q=w.indexOf(j);if(q!=-1){q+=j.length;x.push(parseInt(w.substr(q)));if(!r){r=w.substr(0,q)}}}x.sort(function(y,i){return y-i});var n=0;for(var l in x){c(o+"_"+n++,k[r+x[l]])}break;case"conditional":var v=b.app.field_list[u.id].value();if(g[u.test_param.type]){v=g[u.test_param.type](v)}d(o+"|"+u.test_param.name,u.id,v);var h=b.matchCase(u,v);if(h!=-1){c(o,s[u.id+"-section-"+h])}break;case"section":c("",k);break;default:var t=b.app.field_list[u.id];if(t&&t.value){var v=t.value();if(g[u.type]){v=g[u.type](v)}if(t.skip||(t.validate&&!t.validate())){if(b.app.options.use_defaults){v=u.default_value}else{v=null}}if(u.ignore===undefined||(v!==null&&u.ignore!=v)){d(o,u.id,v);if(u.payload){for(var m in u.payload){d(m,u.id,u.payload[m])}}}}}}}}c("",e);return f},match:function(b){return this.map_dict&&this.map_dict[b]},matchCase:function(b,d){if(b.test_param.type=="boolean"){if(d=="true"){d=b.test_param.truevalue||"true"}else{d=b.test_param.falsevalue||"false"}}for(var c in b.cases){if(b.cases[c].value==d){return c}}return -1},matchModel:function(d,f){var b={};var c=this;function e(g,p){for(var m in p){var k=p[m];var n=k.name;if(g!=""){n=g+"|"+n}switch(k.type){case"repeat":for(var l in k.cache){e(n+"_"+l,k.cache[l])}break;case"conditional":var q=k.test_param&&k.test_param.value;var h=c.matchCase(k,q);if(h!=-1){e(n,k.cases[h].inputs)}break;default:var o=c.map_dict[n];if(o){f(o,k)}}}}e("",d.inputs);return b},matchResponse:function(d){var b={};var c=this;function e(l,j){if(typeof j==="string"){var g=c.map_dict[l];if(g){b[g]=j}}else{for(var h in j){var f=h;if(l!==""){var k="|";if(j instanceof Array){k="_"}f=l+k+f}e(f,j[h])}}}e("",d);return b},_iterate:function(d,e){var b=this;var c=$(d).children();c.each(function(){var h=this;var g=$(h).attr("id");if($(h).hasClass("section-row")){e[g]={};var f=b.app.input_list[g];if(f){e[g]={input:f}}b._iterate(h,e[g])}else{b._iterate(h,e)}})}})});
\ No newline at end of file
+define(["utils/utils"],function(a){return Backbone.Model.extend({initialize:function(b){this.app=b},finalize:function(g){var b=this;this.map_dict={};if(!this.app.section){return{}}g=g||{};var f={};var e={};this._iterate(this.app.section.$el,e);function d(j,i,h){f[j]=h;b.map_dict[j]=i}function c(p,s){for(var n in s){var k=s[n];if(k.input){var u=k.input;var o=p;if(p!=""){o+="|"}o+=u.name;switch(u.type){case"repeat":var j="section-";var x=[];var r=null;for(var w in k){var q=w.indexOf(j);if(q!=-1){q+=j.length;x.push(parseInt(w.substr(q)));if(!r){r=w.substr(0,q)}}}x.sort(function(y,i){return y-i});var n=0;for(var l in x){c(o+"_"+n++,k[r+x[l]])}break;case"conditional":var v=b.app.field_list[u.id].value();if(g[u.test_param.type]){v=g[u.test_param.type](v)}d(o+"|"+u.test_param.name,u.id,v);var h=b.matchCase(u,v);if(h!=-1){c(o,s[u.id+"-section-"+h])}break;case"section":c("",k);break;default:var t=b.app.field_list[u.id];if(t&&t.value){var v=t.value();if(g[u.type]){v=g[u.type](v)}if(t.skip){continue}if(t.validate&&!t.validate()){v=null}if(u.ignore===undefined||(v!==null&&u.ignore!=v)){d(o,u.id,v);if(u.payload){for(var m in u.payload){d(m,u.id,u.payload[m])}}}}}}}}c("",e);return f},match:function(b){return this.map_dict&&this.map_dict[b]},matchCase:function(b,d){if(b.test_param.type=="boolean"){if(d=="true"){d=b.test_param.truevalue||"true"}else{d=b.test_param.falsevalue||"false"}}for(var c in b.cases){if(b.cases[c].value==d){return c}}return -1},matchModel:function(d,f){var b={};var c=this;function e(g,p){for(var m in p){var k=p[m];var n=k.name;if(g!=""){n=g+"|"+n}switch(k.type){case"repeat":for(var l in k.cache){e(n+"_"+l,k.cache[l])}break;case"conditional":var q=k.test_param&&k.test_param.value;var h=c.matchCase(k,q);if(h!=-1){e(n,k.cases[h].inputs)}break;default:var o=c.map_dict[n];if(o){f(o,k)}}}}e("",d.inputs);return b},matchResponse:function(d){var b={};var c=this;function e(l,j){if(typeof j==="string"){var g=c.map_dict[l];if(g){b[g]=j}}else{for(var h in j){var f=h;if(l!==""){var k="|";if(j instanceof Array){k="_"}f=l+k+f}e(f,j[h])}}}e("",d);return b},_iterate:function(d,e){var b=this;var c=$(d).children();c.each(function(){var h=this;var g=$(h).attr("id");if($(h).hasClass("section-row")){e[g]={};var f=b.app.input_list[g];if(f){e[g]={input:f}}b._iterate(h,e[g])}else{b._iterate(h,e)}})}})});
\ No newline at end of file
diff -r 4e990792d37479e8fb4f6fec272efb51764c5252 -r 175feec6a9d3028812548d62f99fbaa8b69b18e1 templates/webapps/galaxy/workflow/editor_tool_form.mako
--- a/templates/webapps/galaxy/workflow/editor_tool_form.mako
+++ b/templates/webapps/galaxy/workflow/editor_tool_form.mako
@@ -9,7 +9,7 @@
incoming = {
'__is_dynamic__' : False
}
- params_to_incoming( incoming, tool.inputs, module.state.inputs, trans.app )
+ params_to_incoming( incoming, tool.inputs, module.state.inputs, trans.app, to_html=False)
self.form_config = tool.to_json(trans, **incoming)
self.form_config.update({
'id' : tool.id,
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jmchilton: Fix unit tests for ddbe0d1.
by commits-noreply@bitbucket.org 04 Feb '15
by commits-noreply@bitbucket.org 04 Feb '15
04 Feb '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4e990792d374/
Changeset: 4e990792d374
User: jmchilton
Date: 2015-02-04 01:09:46+00:00
Summary: Fix unit tests for ddbe0d1.
Affected #: 1 file
diff -r 655ddcb3e5a8a5eda97a031b3803d053caa5e963 -r 4e990792d37479e8fb4f6fec272efb51764c5252 test/unit/tools/test_evaluation.py
--- a/test/unit/tools/test_evaluation.py
+++ b/test/unit/tools/test_evaluation.py
@@ -29,6 +29,7 @@
# To Test:
# - param_file handling.
+TEST_TOOL_DIRECTORY = "/path/to/the/tool"
class ToolEvaluatorTestCase(TestCase, UsesApp):
@@ -245,6 +246,9 @@
else:
return super(TestComputeEnviornment, self).unstructured_path_rewriter()
+ def tool_directory( self ):
+ return TEST_TOOL_DIRECTORY
+
class MockTool( object ):
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: carlfeberhard: Browser test: use new object param style in history api tests
by commits-noreply@bitbucket.org 03 Feb '15
by commits-noreply@bitbucket.org 03 Feb '15
03 Feb '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/655ddcb3e5a8/
Changeset: 655ddcb3e5a8
User: carlfeberhard
Date: 2015-02-03 21:54:39+00:00
Summary: Browser test: use new object param style in history api tests
Affected #: 1 file
diff -r b9dd3817bdabd5c61990af589d31c1097b3c5de6 -r 655ddcb3e5a8a5eda97a031b3803d053caa5e963 test/casperjs/api-history-tests.js
--- a/test/casperjs/api-history-tests.js
+++ b/test/casperjs/api-history-tests.js
@@ -99,7 +99,7 @@
"Id of last history (from index) DOES NOT appear: " + newFirstHistory.id );
this.test.comment( 'calling index with delete=true should include the deleted history' );
- newFirstHistory = this.api.histories.index( true )[0];
+ newFirstHistory = this.api.histories.index({ deleted: true })[0];
//this.debug( 'newFirstHistory:\n' + this.jsonStr( newFirstHistory ) );
this.test.assert( newFirstHistory.id === createdHistory.id,
"Id of last history (from index) DOES appear using index( deleted=true ): " + newFirstHistory.id );
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: carlfeberhard: API, tests: add datasets API tests in test/API and casperjs sections; Browser tests: add datasets api, allow api to send extra params for history show & index
by commits-noreply@bitbucket.org 03 Feb '15
by commits-noreply@bitbucket.org 03 Feb '15
03 Feb '15
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b9dd3817bdab/
Changeset: b9dd3817bdab
User: carlfeberhard
Date: 2015-02-03 21:11:10+00:00
Summary: API, tests: add datasets API tests in test/API and casperjs sections; Browser tests: add datasets api, allow api to send extra params for history show & index
Affected #: 3 files
diff -r 5aa058b09609351defd3161754b23a27ea9bef99 -r b9dd3817bdabd5c61990af589d31c1097b3c5de6 test/api/test_datasets.py
--- /dev/null
+++ b/test/api/test_datasets.py
@@ -0,0 +1,41 @@
+import textwrap
+
+from base import api
+from .helpers import TestsDatasets
+
+class DatasetsApiTestCase( api.ApiTestCase, TestsDatasets ):
+
+ def setUp( self ):
+ super( DatasetsApiTestCase, self ).setUp()
+ self.history_id = self._new_history()
+
+ def test_index( self ):
+ index_response = self._get( "datasets" )
+ print index_response
+ print dir( index_response )
+ self._assert_status_code_is( index_response, 501 )
+
+ def test_show( self ):
+ hda1 = self._new_dataset( self.history_id )
+ show_response = self._get( "datasets/%s" % ( hda1[ "id" ] ) )
+ self._assert_status_code_is( show_response, 200 )
+ self.__assert_matches_hda( hda1, show_response.json() )
+
+ def __assert_matches_hda( self, input_hda, query_hda ):
+ self._assert_has_keys( query_hda, "id", "name" )
+ assert input_hda[ "name" ] == query_hda[ "name" ]
+ assert input_hda[ "id" ] == query_hda[ "id" ]
+
+ def test_display( self ):
+ contents = textwrap.dedent( """\
+ 1 2 3 4
+ A B C D
+ 10 20 30 40
+ """ )
+ hda1 = self._new_dataset( self.history_id, content=contents )
+ display_response = self._get( "histories/%s/contents/%s/display" % ( self.history_id, hda1[ "id" ] ), {
+ 'raw' : 'True'
+ })
+ self._assert_status_code_is( display_response, 200 )
+ #TODO: doesn't work
+ #assert display_response.text == contents
diff -r 5aa058b09609351defd3161754b23a27ea9bef99 -r b9dd3817bdabd5c61990af589d31c1097b3c5de6 test/casperjs/api-dataset-tests.js
--- /dev/null
+++ b/test/casperjs/api-dataset-tests.js
@@ -0,0 +1,59 @@
+var require = patchRequire( require ),
+ spaceghost = require( 'spaceghost' ).fromCasper( casper ),
+ xpath = require( 'casper' ).selectXPath,
+ utils = require( 'utils' ),
+ format = utils.format;
+
+spaceghost.test.begin( 'Test the HDA API', 0, function suite( test ){
+ spaceghost.start();
+
+ // =================================================================== SET UP
+ var email = spaceghost.user.getRandomEmail(),
+ password = '123456';
+ if( spaceghost.fixtureData.testUser ){
+ email = spaceghost.fixtureData.testUser.email;
+ password = spaceghost.fixtureData.testUser.password;
+ }
+
+ var detailKeys = [
+ // the following are always present regardless of datatype
+ 'id', 'name', 'api_type', 'model_class',
+ 'history_id', 'hid',
+ 'accessible', 'deleted', 'visible', 'purged',
+ 'state', 'data_type', 'file_ext', 'file_size',
+ 'misc_info', 'misc_blurb',
+ 'download_url', 'visualizations', 'display_apps', 'display_types',
+ 'genome_build'
+ ];
+
+ spaceghost.user.loginOrRegisterUser( email, password );
+ spaceghost.openHomePage();
+ spaceghost.api.tools.thenUploadToCurrent({ filepath: '../../test-data/1.bed' });
+
+ spaceghost.then( function(){
+ // ------------------------------------------------------------------------------------------- INDEX
+ this.test.comment( 'index should error with not implemented' );
+ this.api.assertRaises( function(){
+ this.api.datasets.index();
+ }, 501, 'not implemented', 'throws unimplemented' );
+
+ // ------------------------------------------------------------------------------------------- SHOW
+ this.test.comment( 'show should get an HDA details object' );
+ var history = this.api.histories.show( 'most_recently_used', { keys : 'id,hdas' } ),
+ hdaId = history.hdas[0],
+ show = this.api.datasets.show( hdaId );
+ this.debug( this.jsonStr( history ) );
+ this.debug( this.jsonStr( show ) );
+ this.test.assert( this.hasKeys( show, detailKeys ), 'Has the proper keys' );
+
+ // ------------------------------------------------------------------------------------------- DISPLAY
+ this.test.comment( 'show should get an HDA details object' );
+ var fileContents = this.api.datasets.display( history.id, hdaId, { raw: 'True' });
+ this.test.assert( fileContents.split( '\n' ).length === 66, '1.bed has 66 lines' );
+ });
+
+
+ // ===================================================================
+ spaceghost.run( function(){ test.done(); });
+});
+
diff -r 5aa058b09609351defd3161754b23a27ea9bef99 -r b9dd3817bdabd5c61990af589d31c1097b3c5de6 test/casperjs/modules/api.js
--- a/test/casperjs/modules/api.js
+++ b/test/casperjs/modules/api.js
@@ -13,6 +13,7 @@
this.configuration = new ConfigurationAPI( this );
this.histories = new HistoriesAPI( this );
this.hdas = new HDAAPI( this );
+ this.datasets = new DatasetsAPI( this );
this.tools = new ToolsAPI( this );
this.workflows = new WorkflowsAPI( this );
this.users = new UsersAPI( this );
@@ -80,7 +81,10 @@
( resp.responseJSON? this.spaceghost.jsonStr( resp.responseJSON ) : resp.responseText ) );
throw new APIError( resp.responseText, resp.status );
}
- return JSON.parse( resp.responseText );
+ if( options.dataType === undefined || options.dataType === 'json' ){
+ return JSON.parse( resp.responseText );
+ }
+ return resp.responseText;
};
// =================================================================== TESTING
@@ -217,22 +221,34 @@
update : '/api/histories/%s',
};
-HistoriesAPI.prototype.index = function index( deleted ){
- this.api.spaceghost.info( 'histories.index: ' + (( deleted )?( 'w deleted' ):( '(wo deleted)' )) );
-
- deleted = deleted || false;
+HistoriesAPI.prototype.index = function index( params ){
+ var spaceghost = this.api.spaceghost;
+ spaceghost.info( 'histories.index:\n' + spaceghost.jsonStr( params ) );
+ if( params === undefined ){
+ params = { deleted: false };
+ }
+ if( params.deleted === undefined ){
+ params.deleted = false;
+ }
+ spaceghost.debug( 'params (now):' + spaceghost.jsonStr( params ) );
return this.api._ajax( this.urlTpls.index, {
- data : { deleted: deleted }
+ data : params
});
};
-HistoriesAPI.prototype.show = function show( id, deleted ){
- this.api.spaceghost.info( 'histories.show: ' + [ id, (( deleted )?( 'w deleted' ):( '' )) ] );
-
- id = ( id === 'most_recently_used' || id === 'current' )?( id ):( this.api.ensureId( id ) );
- deleted = deleted || false;
+HistoriesAPI.prototype.show = function show( id, params ){
+ var spaceghost = this.api.spaceghost;
+ this.api.spaceghost.info( 'histories.show: ' + id + '\n' + spaceghost.jsonStr( params ) );
+ id = ( id === 'most_recently_used' )?( id ):( this.api.ensureId( id ) );
+ if( params === undefined ){
+ params = { deleted: false };
+ }
+ if( params.deleted === undefined ){
+ params.deleted = false;
+ }
+ spaceghost.debug( 'params (now):' + spaceghost.jsonStr( params ) );
return this.api._ajax( utils.format( this.urlTpls.show, id ), {
- data : { deleted: deleted }
+ data : params
});
};
@@ -365,8 +381,55 @@
//TODO: delete_
+// =================================================================== HDAS
+var DatasetsAPI = function DatasetsAPI( api ){
+ this.api = api;
+};
+DatasetsAPI.prototype.toString = function toString(){
+ return this.api + '.DatasetsAPI';
+};
+
+// -------------------------------------------------------------------
+DatasetsAPI.prototype.urlTpls = {
+ index : '/api/datasets',
+ show : '/api/datasets/%s',
+ // wut.
+ display : '/api/histories/%s/contents/%s/display'
+};
+
+DatasetsAPI.prototype.index = function index(){
+ this.api.spaceghost.info( 'datasets.index: ' );
+ var data = {};
+
+ return this.api._ajax( utils.format( this.urlTpls.index ), {
+ data : data
+ });
+};
+
+DatasetsAPI.prototype.show = function show( id ){
+ this.api.spaceghost.info( 'datasets.show: ' + [ id ] );
+ var data = {};
+
+ return this.api._ajax( utils.format( this.urlTpls.show, id ), {
+ data : data
+ });
+};
+
+DatasetsAPI.prototype.display = function show( historyId, id, params ){
+ this.api.spaceghost.info( 'datasets.display: ' + [ historyId, id ] );
+ if( params === undefined ){
+ params = {};
+ }
+ return this.api._ajax( utils.format( this.urlTpls.display, this.api.ensureId( historyId ), id ), {
+ data : params,
+ dataType : 'text'
+ });
+};
+
+
+
// =================================================================== TOOLS
-var ToolsAPI = function HDAAPI( api ){
+var ToolsAPI = function ToolsAPI( api ){
this.api = api;
};
ToolsAPI.prototype.toString = function toString(){
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
03 Feb '15
Branch: refs/heads/master
Home: https://github.com/galaxyproject/usegalaxy-playbook
Commit: b99609e7179ffbd6a05466f93a3bc29c5cdad125
https://github.com/galaxyproject/usegalaxy-playbook/commit/b99609e7179ffbd6…
Author: Nate Coraor <nate(a)bx.psu.edu>
Date: 2015-02-03 (Tue, 03 Feb 2015)
Changed paths:
M templates/galaxy/test.galaxyproject.org/config/job_conf.xml.j2
Log Message:
-----------
Add 16GB destination on Test.
Commit: ba5ac03d2c051b739c2269026691d4ccc05748ea
https://github.com/galaxyproject/usegalaxy-playbook/commit/ba5ac03d2c051b73…
Author: Nate Coraor <nate(a)bx.psu.edu>
Date: 2015-02-03 (Tue, 03 Feb 2015)
Log Message:
-----------
Merge branch 'master' of github.com:galaxyproject/usegalaxy-playbook
Commit: 45d9f85fc733f8b948aaf5980bdc1e183a88e007
https://github.com/galaxyproject/usegalaxy-playbook/commit/45d9f85fc733f8b9…
Author: Nate Coraor <nate(a)bx.psu.edu>
Date: 2015-02-03 (Tue, 03 Feb 2015)
Changed paths:
M files/galaxy/test.galaxyproject.org/var/integrated_tool_panel.xml
M files/galaxy/test.galaxyproject.org/var/shed_tool_conf.xml
M files/galaxy/test.galaxyproject.org/var/shed_tool_data_table_conf.xml
Log Message:
-----------
Updated mutable configs on Test.
Compare: https://github.com/galaxyproject/usegalaxy-playbook/compare/a613651323a6...…
1
0