1 new changeset in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/1dfad17e81a8/ changeset: r5093:1dfad17e81a8 user: kanwei date: 2011-02-18 21:06:34 summary: Use jStorage (http://www.jstorage.info/) instead of jStore. Tested to be working on IE7 and IE8, where the latter was failing. Fixes links not showing up in history pane to expand histories. affected #: 15 files (779 bytes) --- a/static/scripts/class.js Fri Feb 18 14:53:35 2011 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -/*! - * Class definition - * - * Copyright (c) 2008 John Resig (http://ejohn.org/blog/simple-javascript-inheritance/) - * Inspired by base2 and Prototype - */ - -//"use strict"; - -(function () { - - var initializing = false, - - fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/; - - // The base Class implementation (does nothing) - this.Class = function(){}; - - // Create a new Class that inherits from this class - Class.extend = function (prop) - { - var _super = this.prototype; - - // Instantiate a base class (but only create the instance, don't run the init constructor) - initializing = true; - - var prototype = new this(); - - initializing = false; - - // Copy the properties over onto the new prototype - for (var name in prop) - { - - // Check if we're overwriting an existing function - prototype[name] = (typeof prop[name] === "function" && typeof _super[name] === "function" && fnTest.test(prop[name]) ? - - (function(name, fn) - { - return function() - { - var tmp = this._super; - - // Add a new ._super() method that is the same method - // but on the super-class - this._super = _super[name]; - - // The method only need to be bound temporarily, so we - // remove it when we're done executing - var ret = fn.apply(this, arguments); - this._super = tmp; - - return ret; - }; - }(name, prop[name])) : prop[name]); - } - - // The dummy class constructor - function Class() - { - // All construction is actually done in the init method - if (!initializing && this.init) - { - this.init.apply(this, arguments); - } - } - - // Populate our constructed prototype object - Class.prototype = prototype; - - // Enforce the constructor to be what we expect - Class.constructor = Class; - - // And make this class extendable - Class.extend = arguments.callee; - - return Class; - }; - -}()); --- a/static/scripts/galaxy.base.js Fri Feb 18 14:53:35 2011 -0500 +++ b/static/scripts/galaxy.base.js Fri Feb 18 15:06:34 2011 -0500 @@ -424,7 +424,7 @@ var action = function() { // Load saved state and show as necessary try { - var stored = $.jStore.store("history_expand_state"); + var stored = $.jStorage.get("history_expand_state"); if (stored) { for (var id in stored) { $("#" + id + " div.historyItemBody" ).show(); @@ -432,7 +432,7 @@ } } catch(err) { // Something was wrong with values in storage, so clear storage - $.jStore.remove("history_expand_state"); + $.jStorage.deleteKey("history_expand_state"); } // If Mozilla, hide scrollbars in hidden items since they cause animation bugs @@ -455,10 +455,10 @@ if (!nochanges) { // Ignore embedded item actions // Save setting - prefs = $.jStore.store("history_expand_state"); + prefs = $.jStorage.get("history_expand_state"); if (prefs) { delete prefs[id]; - $.jStore.store("history_expand_state", prefs); + $.jStorage.set("history_expand_state", prefs); } } } else { @@ -469,10 +469,10 @@ if (!nochanges) { // Save setting - prefs = $.jStore.store("history_expand_state"); - if (prefs === undefined) { prefs = {}; } + prefs = $.jStorage.get("history_expand_state"); + if (!prefs) { prefs = {}; } prefs[id] = true; - $.jStore.store("history_expand_state", prefs); + $.jStorage.set("history_expand_state", prefs); } } return false; @@ -481,8 +481,8 @@ // Generate 'collapse all' link $("#top-links > a.toggle").click( function() { - var prefs = $.jStore.store("history_expand_state"); - if (prefs === undefined) { prefs = {}; } + var prefs = $.jStorage.get("history_expand_state"); + if (!prefs) { prefs = {}; } $( "div.historyItemBody:visible" ).each( function() { if ( $.browser.mozilla ) { $(this).find( "pre.peek" ).css( "overflow", "hidden" ); @@ -492,19 +492,11 @@ delete prefs[$(this).parent().attr("id")]; } }); - $.jStore.store("history_expand_state", prefs); + $.jStorage.set("history_expand_state", prefs); }).show(); }; - if (noinit) { - action(); - } else { - // Load jStore for local storage - $.jStore.init("galaxy"); // Auto-select best storage - $.jStore.ready(function() { - action(); - }); - } + action(); } function commatize( number ) { --- a/static/scripts/jquery.jstore.js Fri Feb 18 14:53:35 2011 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1810 +0,0 @@ -/*! - * jStore 2.0 - Persistent Client Side Storage - * - * Copyright (c) 2010 Eric Garside (http://eric.garside.name/) - * Dual licensed under: - * MIT: http://www.opensource.org/licenses/mit-license.php - * GPLv3: http://www.opensource.org/licenses/gpl-3.0.html - * - * --------------------------- - * - * jStore Flash Storage Component - * - * Copyright (c) 2006 Jeff Lerman (jeff@blip.tv) - * Licensed under the Creative Commons Attribution 3.0 United States License: - * http://creativecommons.org/licenses/by/3.0/us - */ - -//"use strict"; - -/*global Class, window, jQuery, ActiveXObject, google */ - -/*jslint white: true, browser: true, onevar: true, undef: true, eqeqeq: true, bitwise: true, regexp: false, strict: true, newcap: true, immed: true, maxerr: 50, indent: 4 */ - -(function ($, window) { - - //------------------------------ - // - // Constants - // - //------------------------------ - - //------------------------------ - // Exceptions - //------------------------------ - - /** - * An exception thrown by the StorageEngine class whenever its data accessor methods - * are called before the engine is ready to transact data. - */ - var EX_UNSTABLE = 'JSTORE_ENGINE_UNSTABLE', - - /** - * An exception thrown by jStore whenever an undefined storage engine is referenced for - * some task by an invalid JRI (jStore Resource Identifier). - */ - EX_UNKNOWN = 'JSTORE_UNKNOWN_ENGINE_REQUESTED', - - /** - * An exception thrown by jStore whenever a given flavor of storage is double defined. - */ - EX_COLLISION = 'JSTORE_ENGINE_NAMESPACE_COLLISION', - - /** - * An exception thrown by jStore whenever a jri is double applied to a resource. - */ - EX_DUPLICATE = 'JSTORE_RESOURCE_NAMESPACE_COLLISION', - - /** - * An exception thrown by jStore whenever a given flavor of storage has no defined engine. - */ - EX_UNAVAILABLE = 'JSTORE_ENGINE_UNAVAILABLE', - - /** - * An exception thrown by jStore whenever an invalid flavor type is used. - */ - EX_INVALID = 'JSTORE_INVALID_FLAVOR', - - //------------------------------ - // Regular Expressions - //------------------------------ - - /** - * Regular expression to test property values for being JSON. - */ - RX_JSON = (function () - { - try - { - return new RegExp('^("(\\\\.|[^"\\\\\\n\\r])*?"|[,:{}\\[\\]0-9.\\-+Eaeflnr-u \\n\\r\\t])+?$'); - } - catch (e) - { - return (/^(true|false|null|\[.*\]|\{.*\}|".*"|\d+|\d+\.\d+)$/); - } - }()), - - //------------------------------ - // Storage Flavors - //------------------------------ - - /** - * The storage flavor identifier for HTML5 local storage. - */ - FLAVOR_LOCAL = 'jstore-html5-local', - - /** - * The storage flavor identifier for HTML5 database storage. - */ - FLAVOR_SQL = 'jstore-html5-sql', - - /** - * The storage flavor identifier for Adobe Flash SharedObject storage. - */ - FLAVOR_FLASH = 'jstore-flash', - - /** - * The storage flavor identifier for Google Gears storage. - */ - FLAVOR_GEARS = 'jstore-google-gears', - - /** - * The storage flavor identifier for Internet Explorer storage, available to IE7 and IE6. - */ - FLAVOR_MSIE = 'jstore-msie', - - //------------------------------ - // - // Property Declaration - // - //------------------------------ - - /** - * The base StorageEngine class which each "storage flavor" will extend to meet the - * requirements for its specific implementation. - */ - StorageEngine, - - /** - * The jStore object. Internal to this closure, jStore is referenced by "_". It is - * exposed to jQuery below, and made publicly accessible through jQuery.jStore - */ - _ = {}, - - /** - * The engines available to jStore for use. These are the class definitions for flavored - * storage engines. - * - * Signature: - * { - * <storageFlavor>: <flavoredStorageEngineDefinition>, - * - * ... - * } - */ - definitions = {}, - - /** - * Active engines instantiated by jStore, indexed by their JRI. - * - * Signature: - * { - * <engineJRI>: <engineInstance>, - * - * ... - * } - */ - engines = {}, - - /** - * If we are going to be using the flash storage engine, we want to postpone the jStore ready event until the jStore - * isFlashReady flag is also true. This property is set whenever flash is determined to be the storage engine. - */ - waitForFlash = false, - - /** - * Storage for listeners, indexed by content and event type. - * - * Signature: - * { - * <context>: - * { - * <eventType>: [<listener>, ...], - * - * ... - * }, - * - * ... - * } - */ - events = {}, - - /** - * The configuration for this implementation. - * - * Signature: - * { - * project: <defaultProjectName>, - * - * flash: <pathToFlashBootloader>, - * - * json: <pathToJSONFile>, - * - * errorCallback: <listenerToNotifyOnError> - * } - */ - configurations = - { - project: undefined, - - flash: 'jStore.Flash.html', - - json: 'browser.json.js' - }, - - /** - * The active storage engine, being used to satisfy the get/set/remove functions on the jStore and jQuery - * objects. - */ - active; - - //------------------------------ - // - // Internal Methods - // - //------------------------------ - - /** - * Determine if the given flavor is valid. - * - * @param flavor The flavor to test. - * - * @return True if the flavor is valid, false otherwise. - */ - function validFlavor(flavor) - { - switch (flavor) - { - - case FLAVOR_LOCAL: - case FLAVOR_SQL: - case FLAVOR_FLASH: - case FLAVOR_GEARS: - case FLAVOR_MSIE: - return true; - - default: - return false; - - } - } - - /** - * Performs enhanced type comparison on an object. This is more reliable method - * of type checking a variable than a simple typeof comparison. The reason is that, - * typeof will reduce to the lowest common type. - * - * "typeof []" returns Object, and not Array. - * "typeof {}" returns Object as well. - * - * typecheck( [], 'Array' ) : returns true; - * typecheck( [], 'Object' ) : returns false; - * - * @param type The variable type to check. - * - * @param compare A string representing the literal type to check. - * - * @return True if the variable "type" matches the compare literal. - */ - function typecheck(type, compare) - { - return !type ? false : type.constructor.toString().match(new RegExp(compare + '\\(\\)', 'i')) !== null; - } - - /** - * If the provided listener is a valid function, it will be triggered with the provided context - * and parameters. - * - * @param listener The listener being triggered. - * - * @param context The context to provide to the listener. - * - * @param parameters The parameters to pass to the listener as arguments. - * - * @return The response of the notified listener. - */ - function notify(listener, context, parameters) - { - if (typecheck(listener, 'Function')) - { - return listener.apply(context || _, typecheck(parameters, 'Array') ? parameters : [parameters]); - } - } - - /** - * Load the given script. - * - * @param path The path to the file to include. - * - * @param listener The listener to notify when the file finishes loading. - */ - function loadScript(path, listener) - { - $.ajax( - { - url: path, - complete: listener || $.noop(), - type: 'GET', - dataType: 'script', - cache: false - }); - } - - /** - * Checks the type of the value, and returns a value safe to persist in any client-side mechanism. - * - * @param value The value which should be prepared for storage. - * - * @return A value safe for storage. - */ - function prepareForStorage(value) - { - if (value === undefined) - { - return ''; - } - - if (typecheck(value, 'Object') || - typecheck(value, 'Array') || - typecheck(value, 'Function')) - { - return JSON.stringify(value); - } - - return value; - } - - /** - * Checks the type of the value, and returns a value safe for access in any client-side mechanism. - * - * @param value The value which should be prepared for use. - * - * @return A value safe for use. - */ - function prepareForRevival(value) - { - return RX_JSON.test(value) ? JSON.parse(value) : value; - } - - /** - * Normalize a key before using it, to ensure it's valid. - * - * @param key The key to normalize. - * - * @return A normalized key, safe for storage. - */ - function normalizeKey(key) - { - return key.replace(/^\s+|\s+$/g, ""); - } - - /** - * Define a flavored storage engine. - * - * @throws EX_COLLISION, EX_INVALID - * - * @param flavor The flavor of engine being defined. - * - * @param definition An object containing the new properties and methods for the engine extension. - * - * @param availability A function to invoke which must return a boolean value indicating the - * availability of the storage flavor on this browser. - */ - function define(flavor, definition, availability) - { - if (!validFlavor(flavor)) - { - throw EX_INVALID; - } - - if (availability[flavor] !== undefined) - { - throw EX_COLLISION; - } - - /** - * The logic here has been reworked so unavailable flavors are discarded, so we don't needlessly - * bloat the runtime size of jStore. - */ - if (notify(availability) === true) - { - _.available[flavor] = true; - - definition.flavor = flavor; - - definitions[flavor] = StorageEngine.extend(definition); - } - else - { - _.available[flavor] = false; - - // Filter the invalid flavor out of the priority list. - _.enginePriority = $.map(_.enginePriority, function (engine) - { - if (engine === flavor) - { - return null; - } - else - { - return engine; - } - }); - } - } - - /** - * Make the jStore library ready. - */ - function makeReady() - { - if (_.isReady) - { - return; - } - - if ((waitForFlash && _.isFlashReady) || !waitForFlash) - { - _.isReady = true; - _.trigger('jstore-ready', [engines[active]]); - } - } - - /** - * Create a best-fit engine. - */ - function createBestFitEngine() - { - _.create(_.enginePriority[0], undefined, 'best-fit'); - } - - /** - * Get the flash version currently supported in this browser. - * - * @return The flash version. - */ - function flashVersion() - { - // MSIE - try - { - // avoid fp6 minor version lookup issues - // see: http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-... - var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6'); - - try - { - axo.AllowScriptAccess = 'always'; - } - catch (axo_e) - { - return '6,0,0'; - } - - return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1]; - } - - // Real browsers - catch (e) - { - try - { - if (navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) - { - return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1]; - } - } - catch (flash_e) - {} - } - - return '0,0,0'; - } - - /** - * Flash Detection functions copied from the jQuery Flash Plugin - * - * Copyright (c) 2006 Luke Lutman (http://jquery.lukelutman.com/plugins/flash) - * - * Dual licensed under the MIT and GPL licenses. - * http://www.opensource.org/licenses/mit-license.php - * http://www.opensource.org/licenses/gpl-license.php - * - * @param version The version to compare to. - * - * @return True if the version is greater than or equal to the required version, false otherwise. - */ - function hasFlashVersion(version) - { - var playerVersion = flashVersion().match(/\d+/g), - requiredVersion = version.match(/\d+/g), - index = 0, - player, - required; - - for (; index < 3; index++) - { - player = parseInt(playerVersion[index], 10); - required = parseInt(requiredVersion[index], 10); - - // Player version is less than what is required. - if (player < required) - { - return false; - } - - // Player version is greater than what is required. - else if (player > required) - { - return true; - } - } - - // Player and required version match exactly. - return true; - } - - //------------------------------ - // - // Plugin Definition - // - //------------------------------ - - //------------------------------ - // Error Declaration - //------------------------------ - - //------------------------------ - // Plugin Creation - //------------------------------ - - /** - * The jStore object. Manages a collection of StorageEngines for particular "storage flavors", or the types - * of storage solutions available to each browser. - * - * 2.0 Version Notes: - * - * - The user is now responsible for third-party script includes, with the exception of flash. - * - * - jStore has been given sole responsibility for testing engine availability. - * - * - For the sake of naming conventions, all property names now start with a lowercase, and are camel-cased. - * - * The following properties have been changed since the 1.2.x release: - * - * - EngineOrder: For the sake of naming conventions, renamed to enginePriority. - * - * The following properties and methods have been removed since the 1.2.x release: - * - * - Availability: jStore's engines would add their availability tests to this object, so jStore could test - * them. With the changes to how availability testing works, this property has been removed. - * A new property, "available" on jStore contains a set of available engines. - * - * - Engines: Formerly contained the definitions of storage engines. This property has been removed, and - * storage of these definitions has been moved internal to the closure. - * - * - Instances: Formerly contained instantiated storage engines. This property has been removed, and storage - * of instantiated engines has been moved internal to the closure. - * - * - CurrentEngine: Formerly contained the active storage engine being used for transacting data through the jStore - * and/or jQuery objects. This property has been removed, and storage of the current engine has - * been moved internal to the closure. A new method, "activeEngine" has been added to jQuery to - * get and set the active engine to use. - * - * - defaults: Formerly used to set the implementation options for jStore. This property has been removed and - * replaced with a new configuration metho on the jStore object. - * - * - delegate: The delegate class has been removed in favor of a much simpler bind/trigger accessor system, which - * is accessible contextually through storage engines, or generically through jStore. - * - * + fail: This registration class bound events on the delegate for jstore-fail events. Instead, use: - * jStore.bind('jstore-failure', listener); - * - * + flashReady: This registration class bound events on the delegate for flash-ready events. The jstore-ready method - * now accounts for waiting for flash readyness, if and only if the flash engine is being used. Simply - * call to jStore.ready(). - * - * + load: Replaced with the init() method, which performs the same basic functions as the old load() method. Also, - * the init function is now domready safe, meaning it wraps itself in a domready listener, so the end user - * doesn't have to. - * - * + FindEngine: Removed entirely. The functionality provided by this method now implicitly occurs with the new define() - * system implemented for engine flavors. - * - * + setCurrentEngine: Replaced by activeEngine(). Set the current active engine by passing in the JRI. - * - * + safeStore: Replaced by a method internal to this closure, "prepareForStorage". - * - * + safeResurrect: Replaced by a method internal to this closure, "prepareForRevival". - * - * + use: Replaced by "create". - */ - $.extend(_, { - - //------------------------------ - // Properties - //------------------------------ - - /** - * The priority order in which engines should be tested for use. The lower their index in the array, the higher - * their priority for use. - * - * Be weary when reconfiguring the priority order of engines! jStore will use the first available engine it finds - * based on its priority when autoloading. - * - * This array is filtered out as engines are defined, with invalid engines being removed. - * - * Signature: - * [FLAVOR_<storageFlavor>, ...] - */ - enginePriority: [FLAVOR_LOCAL, FLAVOR_SQL, FLAVOR_FLASH, FLAVOR_MSIE], - - /** - * A collection of the availability states of engines, indexed by their flavor. - * - * Signature: - * { - * <storageFlavor>: true|false, - * - * ... - * } - */ - available: {}, - - /** - * Flag to determine if the jStore library is ready. jStore becomes ready once the dom is ready and all necessary - * startup procedures required by jStore to function properly are completed. - */ - isReady: false, - - /** - * With the flash storage engine, we have to jump through a couple of hoops before the flash engine is ready to work. - * This flag tracks whether or not the flash storage is available. - */ - isFlashReady: false, - - /** - * The available engine flavors. - */ - flavors: - { - local: FLAVOR_LOCAL, - - sql: FLAVOR_SQL, - - flash: FLAVOR_FLASH, - - gears: FLAVOR_GEARS, - - msie: FLAVOR_MSIE - }, - - //------------------------------ - // Constructor - //------------------------------ - - /** - * Constructor. - * - * @throws EX_INVALID - * - * @param project The name of the jStore project. Used to generate a JRI for the engine we create. - * - * @param configuration Optionally, an object containing configuration options for this implementation. - * - * @param flavor Optionally, the flavor of storage to use. If not provided, jStore will pick the - * best flavor, based on the current browser. - * - * @return jStore - */ - init: function (project, configuration, flavor) - { - // Extend our plugin configurations - $.extend(configurations, {project: project}, configuration); - - $(function () - { - // If JSON parsing isn't defined in this browser, include it. - if (window.JSON === undefined) - { - loadScript(configurations.json); - } - - // If we have an explicit flavor to use, use it. - if (flavor !== undefined) - { - _.create(flavor, project, 'default'); - } - - // Otherwise, attempt to create a best-fit engine. - else - { - createBestFitEngine(); - } - }); - - return _; - }, - - //------------------------------ - // Methods - //------------------------------ - - /** - * Create an instance of a flavored engine. - * - * @throws EX_INVALID, EX_UNAVAILABLE, EX_DUPLICATE - * - * @param flavor The flavor to create the engine with. - * - * @param project The project identifier for this instance. - * - * @param identifier Some arbitrary identifier for this project instance of the engine. - * - * @return The created instance. - */ - create: function (flavor, project, identifier) - { - project = project || configurations.project || location.hostname.replace(/\./g, '-') || 'unknown'; - - if (!validFlavor(flavor)) - { - throw EX_INVALID; - } - - if (definitions[flavor] === undefined) - { - throw EX_UNAVAILABLE; - } - - var jri = (identifier !== undefined ? identifier + '.' : '') + project + '.' + flavor, - engine; - - if (engines[jri] !== undefined) - { - throw EX_DUPLICATE; - } - - // Create our engine instance. - engine = engines[jri] = new definitions[flavor](project, jri); - - // Set up a listener for our jstore-engine-ready event. - engine.ready(function () - { - _.trigger('jstore-engine-ready', [engine]); - }); - - if (flavor === FLAVOR_FLASH && !_.isFlashReady) - { - if (active === undefined) - { - waitForFlash = true; - } - - // Define a window-accessible function for flash to call via ExternalInterface - window.jstore_ready = function () - { - _.isFlashReady = true; - _.trigger('flash-ready'); - - if (active === undefined) - { - makeReady(); - } - - // Remove the callback from the window scope, as it is no longer necessary - window.flash_ready = undefined; - }; - - window.jstore_error = function (message) - { - _.trigger('jstore-error', ['JSTORE_FLASH_EXCEPTION', null, message]); - }; - - $('<iframe style="height:1px;width:1px;position:absolute;left:0;top:0;margin-left:-100px;" id="jStoreFlashFrame" src="' + - configurations.flash + '"></iframe>').appendTo('body'); - } - else if (active === undefined) - { - active = jri; - makeReady(); - } - - return engine; - }, - - /** - * Fetch an engine by it's JRI. - * - * @param jri The JRI of the engine to retrieve. - * - * @return The requested engine. - */ - engine: function (jri) - { - return engines[jri]; - }, - - /** - * Returns the active storage engine being used. If a value is passed, sets that engine as the active engine. - * - * @throws EX_UNKNOWN - * - * @param jri Optionally, the JRI of the engine to make active, if it should be changed. - * - * @return The active storage engine. - */ - activeEngine: function (jri) - { - if (jri !== undefined) - { - if (engines[jri] === undefined) - { - throw EX_UNKNOWN; - } - else - { - active = jri; - } - } - - return engines[active]; - }, - - /** - * Bind an event listener. - * - * @param event The event to bind a listener on. - * - * @param listener The listener to notify when the event occurs. - * - * @param context The context of the binding. A string representing the engine flavor - * binding the event, or undefined to indicate it's a jStore event. - * - * @return jStore - */ - bind: function (event, listener, context) - { - context = context || 'jstore'; - - if (events[context] === undefined) - { - events[context] = {}; - } - - if (events[context][event] === undefined) - { - events[context][event] = [listener]; - } - else - { - events[context][event].push(listener); - } - - return _; - }, - - /** - * Trigger an event, notifying any bound listeners. - * - * @param event The event to trigger. - * - * @param parameters Any additional parameters to pass to the listeners being notified. - * - * @param context The context of the binding. A string representing the engine flavor - * binding the event, or undefined to indicate it's a jStore event. - * - * @return jStore - */ - trigger: function (event, parameters, context) - { - context = context || 'jstore'; - - if (events[context] !== undefined) - { - if (events[context][event] !== undefined) - { - $.each(events[context][event], function () - { - notify(this, _, parameters); - }); - } - } - - return _; - }, - - /** - * Bind a listener to be notified when jStore causes a non-fatal exception. - * - * @param listener The listener to notify when a failure occurs. - */ - error: function (listener) - { - _.bind('jstore-error', listener); - }, - - /** - * Bind a listener to be notified when jStore is ready. - * - * @param listener The listener to notify when jStore is ready. - * - * @return jStore - */ - ready: function (listener) - { - if (_.isReady) - { - notify(listener); - } - else - { - _.bind('jstore-ready', listener); - } - - return _; - }, - - /** - * Bind a listener to be notified when jStore and the default engine are ready. - * - * @param listener The listener to notify when jStore and it's default engine are ready. - * - * @return jStore - */ - engineReady: function (listener) - { - if (_.isReady) - { - notify(listener); - } - else - { - _.bind('jstore-engine-ready', listener); - } - - return _; - }, - - /** - * A combined getter/setter for the active engine. - * - * @param key The key of the property to get, or set. - * - * @param value If a valid value is provided, sets the engine. - * - * @return The requested property value. - */ - store: function (key, value) - { - return value === undefined ? _.get(key) : _.set(key, value); - }, - - /** - * Remove a property from the active engine. - * - * @param key The key of the property to remove. - * - * @return The value of the property before removal. - */ - remove: function (key) - { - return _.activeEngine().remove(key); - }, - - /** - * Get a property from the active engine. - * - * @param key The key of the property to get. - * - * @return The value of the property. - */ - get: function (key) - { - return _.activeEngine().get(key); - }, - - /** - * Set a property on the active engine. - * - * @param key The key of the property to set. - * - * @param value The value to set the property to. - * - * @return The new value of the property. - */ - set: function (key, value) - { - return _.activeEngine().set(key, value); - } - - }); - - //------------------------------ - // Core Extension - //------------------------------ - - //------------------------------ - // - // Class Definition - // - //------------------------------ - - /** - * The StorageEngine class is the unified API through which jStore accesses and manipulates - * the various storage flavors available. - * - * 2.0 Version Notes: - * - * - All third-party loading is now the responsibility of the developer. - * - * - The delegate class has been removed entirely. Engines have been given "bind" and "trigger" methods - * to interact directly with the delegate like-replacement that has been added to jStore. - * - * - Engine availability has been moved out of the engines themselves, and elevated to a jStore - * responsibility. - * - * The following methods have changed since the 1.2.x release: - * - * - get: When "get"ting a non-stored property, the get function will now return "undefined" - * instead of "null". "null" can now be used as a valid property value. - * - * - rem: Renamed to "remove". I always felt dirty about "rem" being vaguely explicit. - * - * The following properties have been removed since the 1.2.x release: - * - * - autoload: Part of the third-party loading logic. - * - * - hasIncluded: Part of the third-party loading logic. - * - * - includes: Part of the third-party loading logic. - * - * - isAvailable: Part of the availability logic elevated to jStore. - * - * @throws EX_UNSTABLE - */ - StorageEngine = Class.extend({ - - //------------------------------ - // Properties - //------------------------------ - - /** - * The project which owns this storage engine. - */ - project: undefined, - - /** - * The JRI (jStore Resource Identifier) acts as a uuid for this specific instance - * of the storage engine. - */ - jri: undefined, - - /** - * The flavor of this engine. - */ - flavor: undefined, - - /** - * The actual database object which data is transacted through. - */ - database: undefined, - - /** - * A StorageEngine should always respond to fetch requests synchronously. However, some - * of the storage flavors require callback-based asynchronous access. To get around this, - * we simlpy require all engines to function off a primary data cache, to allow for - * synchronous access across all implementations. - * - * Signature: - * { - * <propertyKey>: <propertyValue>, - * - * ... - * } - */ - data: undefined, - - /** - * A number of storage engines enforce a size limit as to what they will persist for a given site. - * This limit is not monitored or computed by jStore currently, and this property will merely give - * a static indication of the total size alloted to the engine, as defined by the storage flavor. - */ - limit: undefined, - - /** - * Each storage flavor has a different process to go through before it's "ready" to transact data. This - * property stores the state of the engine's readyness, and uses it to notify listeners whenever jStore - * is ready to function. - */ - isReady: undefined, - - //------------------------------ - // Constructor - //------------------------------ - - /** - * Constructor. - * - * @param project The project which instantiated this engine. - * - * @param jri The uuid assigned to this instance by jStore. - */ - init: function (project, jri) - { - this.project = project; - this.jri = jri; - this.data = {}; - this.isReady = false; - this.updateCache(); - }, - - //------------------------------ - // Methods - //------------------------------ - - /** - * Update the cache. - */ - updateCache: function () - { - this.isReady = true; - this.trigger('engine-ready', [this]); - }, - - /** - * Bind a listener to an event dispatched by this engine. - * - * @param event The event to bind on. - * - * @param listener The listener to notify when the event occurs. - */ - bind: function (event, listener) - { - _.bind(event, listener, this.jri); - }, - - /** - * Trigger an event, notifying all bound listeners. - * - * @param event The event to trigger. - * - * @param parameters An optional Array of parameters to pass to the listeners. - */ - trigger: function (event, parameters) - { - _.trigger(event, parameters, this.jri); - }, - - /** - * Bind a listener to the StorageEngine's ready event. - * - * @param listener The listener to notify whenever this engine is ready to transact data. - */ - ready: function (listener) - { - if (this.isReady) - { - notify(listener, this); - } - else - { - this.bind('engine-ready', listener); - } - }, - - /** - * Get a property from the StorageEngine. - * - * @param key The property key of the data to retrieve. - * - * @return The property value, or "undefined" if the property isn't stored. - */ - get: function (key) - { - this.__interruptAccess(); - - return this.data[key]; - }, - - /** - * Sets a property in the StorageEngine. - * - * @param key The key of the property. - * - * @param value The value of the property. - * - * @return The new value of the property. - */ - set: function (key, value) - { - this.__interruptAccess(); - - key = normalizeKey(key); - - try - { - this.__set(key, value); - } - catch (e) - { - _.trigger('jstore-error', ['JSTORE_STORAGE_FAILURE', this.jri, e]); - } - - this.data[key] = value; - - return value; - }, - - /** - * Removes a property from the StorageEngine. - * - * @param key The property key of the data to remove. - * - * @return The value of the property, before it was removed. - */ - remove: function (key) - { - this.__interruptAccess(); - - key = normalizeKey(key); - - try - { - this.__remove(key); - } - catch (e) - { - _.trigger('jstore-error', ['JSTORE_REMOVE_FAILURE', this.jri, e]); - } - - var buffer = this.data[key]; - - this.data[key] = undefined; - - return buffer; - }, - - //------------------------------ - // Internal Methods - //------------------------------ - - /** - * Ensures the engine is in a stable state for transacting data. - * - * @throws EX_UNSTABLE - */ - __interruptAccess: function () - { - if (!this.isReady) - { - throw EX_UNSTABLE; - } - }, - - /** - * Sets a property in the StorageEngine. This method should be overloaded to provide actual - * storage flavor integration. - * - * @param key The key of the property. - * - * @param value The value of the property. - * - * @return The new value of the property. - */ - __set: function (key, value) - { - return; - }, - - /** - * Removes a property from the StorageEngine. This method should be overloaded to provide actual - * storage flavor integration. - * - * @param key The property key of the data to remove. - * - * @return The value of the property, before it was removed. - */ - __remove: function (key) - { - return; - } - - }); - - //------------------------------ - // - // jQuery Hooks - // - //------------------------------ - - $.extend($.fn, { - - //------------------------------ - // Methods - //------------------------------ - - /** - * A combined getter/setter for the active engine. - * - * @param key The key of the property to get, or set. - * - * @param value If a valid value is provided, sets the engine. - * - * @return jQuery - */ - store: function (key, value) - { - if (value === undefined) - { - _.get(key); - } - else - { - _.set(key, value); - } - - return this; - }, - - /** - * Remove a property from the active engine. - * - * @param key The key of the property to remove. - * - * @return jQuery - */ - removeStore: function (key) - { - _.activeEngine().remove(key); - - return this; - }, - - /** - * Get a property from the active engine. - * - * @param key The key of the property to get. - * - * @return The value of the property. - */ - getStore: function (key) - { - return _.activeEngine().get(key); - }, - - /** - * Set a property on the active engine. - * - * @param key The key of the property to set. - * - * @param value The value to set the property to. - * - * @return jQuery - */ - setStore: function (key, value) - { - _.activeEngine().set(key, value); - - return this; - } - - }); - - //------------------------------ - // - // Event Bindings - // - //------------------------------ - - //------------------------------ - // - // Startup Code - // - //------------------------------ - - //------------------------------ - // Expose jStore through jQuery - //------------------------------ - - window.jStore = $.jStore = _; - - //------------------------------ - // - // Engine Definitions - // - //------------------------------ - - //------------------------------ - // Local - //------------------------------ - - define(FLAVOR_LOCAL, - { - //------------------------------ - // Properties - //------------------------------ - - limit: parseInt(5e5, 16), - - //------------------------------ - // Constructor - //------------------------------ - - init: function (project, name) - { - this.database = window.globalStorage === undefined ? window.localStorage : window.globalStorage[location.hostname]; - - this._super(project, name); - }, - - //------------------------------ - // Methods - //------------------------------ - - updateCache: function () - { - var key, value; - - for (key in this.database) - { - var has_key = false; - if (this.database.hasOwnProperty) { - if (this.database.hasOwnProperty(key)) { - has_key = true; - } - } else { // IE 8 - if (this.database.getItem(key) !== null) { - has_key = true; - } - } - - if (has_key) { - value = this.database.getItem(key); - - // Gecko's getItem returns {value: 'the value'}, WebKit returns 'the value' - this.data[key] = prepareForRevival(value && value.value ? value.value : value); - } - } - - this._super(); - }, - - //------------------------------ - // Internal methods - //------------------------------ - - __set: function (key, value) - { - this.database.setItem(key, prepareForStorage(value)); - }, - - __remove: function (key) - { - this.database.removeItem(key); - } - }, - - function () - { - return window.localStorage !== undefined || window.globalStorage !== undefined; - }); - - //------------------------------ - // SQL - //------------------------------ - - define(FLAVOR_SQL, - { - //------------------------------ - // Properties - //------------------------------ - - limit: parseInt(32e3, 16), - - //------------------------------ - // Constructor - //------------------------------ - - init: function (project, name) - { - this.database = window.openDatabase('jstore-' + project, '1.0', project, this.limit); - - if (!this.database) - { - throw 'JSTORE_SQL_NO_DB'; - } - - this.database.transaction(function (database) - { - database.executeSql('CREATE TABLE IF NOT EXISTS jstore (k TEXT UNIQUE NOT NULL PRIMARY KEY, v TEXT NOT NULL)'); - }); - - this._super(project, name); - }, - - //------------------------------ - // Methods - //------------------------------ - - updateCache: function () - { - var self = this, - _super = this._super; - - this.database.transaction(function (database) - { - database.executeSql('SELECT k,v FROM jstore', [], function (database, result) - { - var rows = result.rows, - index = 0, - row; - - for (; index < rows.length; ++index) - { - row = rows.item(index); - self.data[row.k] = prepareForRevival(row.v); - } - - _super.apply(self); - }); - }); - }, - - //------------------------------ - // Internal methods - //------------------------------ - - __set: function (key, value) - { - this.database.transaction(function (database) - { - database.executeSql('INSERT OR REPLACE INTO jstore(k, v) VALUES (?, ?)', [key, prepareForStorage(value)]); - }); - }, - - __remove: function (key) - { - this.database.transaction(function (database) - { - database.executeSql('DELETE FROM jstore WHERE k = ?', [key]); - }); - } - }, - - function () - { - return window.openDatabase !== undefined; - }); - - //------------------------------ - // Flash - //------------------------------ - - define(FLAVOR_FLASH, - { - //------------------------------ - // Properties - //------------------------------ - - limit: -1, - - //------------------------------ - // Constructor - //------------------------------ - - init: function (project, name) - { - var self = this; - - _.bind('flash-ready', function () - { - self.__flashReadyListener(); - }); - - this._super(project, name); - }, - - //------------------------------ - // Methods - //------------------------------ - - updateCache: function (enable) - { - /** - * The default call to updateCache passes no variable, so we can short circuit the - * ready state until we explictly call this after flash ready. - */ - if (enable === true) - { - var key, - dataset = this.database.jstore_get_all(); - - for (key in dataset) - { - if (dataset.hasOwnProperty(key)) - { - this.data[key] = prepareForRevival(this.database.jstore_get(key)); - } - } - - this._super(); - } - }, - - //------------------------------ - // Internal methods - //------------------------------ - - __set: function (key, value) - { - if (!this.database.jstore_set(key, prepareForStorage(value))) - { - _.trigger('jstore-error', ['JSTORE_STORAGE_FAILURE', this.jri, 'Flash Exception']); - } - }, - - __remove: function (key) - { - this.database.jstore_remove(key); - }, - - /** - * Triggered whenever flash is ready. - */ - __flashReadyListener: function () - { - var iFrame = $('#jStoreFlashFrame')[0], - frameDocument; - - // MSIE - if (iFrame.Document !== undefined && typecheck(iFrame.Document.jStoreFlash.jstore_get, 'Function')) - { - this.database = iFrame.Document.jStoreFlash; - } - - // Real Browsers - else if (iFrame.contentWindow && iFrame.contentWindow.document) - { - frameDocument = $(iFrame.contentWindow.document); - - // Webkit - if (typecheck($('object', frameDocument)[0].jstore_get, 'Function')) - { - this.database = $('object', frameDocument)[0]; - } - - // Gecko - else if (typecheck($('embed', frameDocument)[0].jstore_get, 'Function')) - { - this.database = $('embed', frameDocument)[0]; - } - } - - if (this.database === undefined) - { - throw 'JSTORE_FLASH_REFERENCE_ISSUE'; - } - else - { - this.updateCache(true); - } - } - }, - - function () - { - return hasFlashVersion('9.0.0'); - }); - - //------------------------------ - // Gears - //------------------------------ - - define(FLAVOR_GEARS, - { - //------------------------------ - // Properties - //------------------------------ - - limit: -1, - - //------------------------------ - // Constructor - //------------------------------ - - init: function (project, name) - { - this.database = google.gears.factory.create('beta.database'); - this.database.open('jstore-' + project); - this.database.execute('CREATE TABLE IF NOT EXISTS jstore (k TEXT UNIQUE NOT NULL PRIMARY KEY, v TEXT NOT NULL)'); - - this._super(project, name); - }, - - //------------------------------ - // Methods - //------------------------------ - - updateCache: function () - { - var result = this.database.execute('SELECT k,v FROM jstore'); - - while (result.isValidRow()) - { - this.data[result.field(0)] = prepareForRevival(result.field(1)); - result.next(); - } - - result.close(); - - this._super(); - }, - - //------------------------------ - // Internal methods - //------------------------------ - - __set: function (key, value) - { - this.database.execute('BEGIN'); - this.database.execute('INSERT OR REPLACE INTO jstore(k, v) VALUES (?, ?)', [key, prepareForStorage(value)]); - this.database.execute('COMMIT'); - }, - - __remove: function (key) - { - this.database.execute('BEGIN'); - this.database.execute('DELETE FROM jstore WHERE k = ?', [key]); - this.database.execute('COMMIT'); - } - }, - - function () - { - return window.google !== undefined && window.google.gears !== undefined; - }); - - //------------------------------ - // MSIE - //------------------------------ - - define(FLAVOR_MSIE, - { - //------------------------------ - // Properties - //------------------------------ - - limit: parseInt(1e4, 16), - - //------------------------------ - // Constructor - //------------------------------ - - init: function (project, name) - { - this.database = $('<div style="display:none;behavior:url(\'#default#userData\')" id="jstore-' + project + '"></div>') - .appendTo(document.body).get(0); - - this._super(project, name); - }, - - //------------------------------ - // Methods - //------------------------------ - - updateCache: function () - { - this.database.load(this.project); - - var node = document.getElementById('jstore-' + this.project), - xmlDoc = node.XMLDocument, - root, - index = 0; - - if (xmlDoc && xmlDoc.documentElement && xmlDoc.documentElement.attributes) - { - root = xmlDoc.documentElement; - - for (; index < root.attributes.length; ++index) - { - this.data[root.attributes.item(index).nodeName] = prepareForRevival(root.attributes.item(index).nodeValue); - } - } - - this._super(); - }, - - //------------------------------ - // Internal methods - //------------------------------ - - __set: function (key, value) - { - this.database.setAttribute(key, prepareForStorage(value)); - this.database.save(this.project); - }, - - __remove: function (key) - { - this.database.removeAttribute(key); - this.database.save(this.project); - } - }, - - function () - { - return window.ActiveXObject !== undefined; - }); - -}(jQuery, window)); --- a/static/scripts/packed/class.js Fri Feb 18 14:53:35 2011 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -/* - * Class definition - * - * Copyright (c) 2008 John Resig (http://ejohn.org/blog/simple-javascript-inheritance/) - * Inspired by base2 and Prototype - */ -(function(){var a=false,b=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){};Class.extend=function(g){var f=this.prototype;a=true;var e=new this();a=false;for(var d in g){e[d]=(typeof g[d]==="function"&&typeof f[d]==="function"&&b.test(g[d])?(function(h,i){return function(){var k=this._super;this._super=f[h];var j=i.apply(this,arguments);this._super=k;return j}}(d,g[d])):g[d])}function c(){if(!a&&this.init){this.init.apply(this,arguments)}}c.prototype=e;c.constructor=c;c.extend=arguments.callee;return c}}()); \ No newline at end of file --- a/static/scripts/packed/galaxy.base.js Fri Feb 18 14:53:35 2011 -0500 +++ b/static/scripts/packed/galaxy.base.js Fri Feb 18 15:06:34 2011 -0500 @@ -1,1 +1,1 @@ -if(!Array.indexOf){Array.prototype.indexOf=function(c){for(var b=0,a=this.length;b<a;b++){if(this[b]==c){return b}}return -1}}function obj_length(c){if(c.length!==undefined){return c.length}var b=0;for(var a in c){b++}return b}$.fn.makeAbsolute=function(a){return this.each(function(){var b=$(this);var c=b.position();b.css({position:"absolute",marginLeft:0,marginTop:0,top:c.top,left:c.left,right:$(window).width()-(c.left+b.width())});if(a){b.remove().appendTo("body")}})};function show_hide_popupmenu_options(d,c,a){a=(a===undefined?true:a);var b=new RegExp(c);$(d).find("li").each(function(){if(b.exec($(this).text())){if(a){$(this).show()}else{$(this).hide()}}})}function make_popupmenu(a,b){a.data("menu_options",b);a.bind("click.show_popup",function(c){$(".popmenu-wrapper").remove();setTimeout(function(){var f=$("<ul id='"+a.attr("id")+"-menu'></ul>");var e=a.data("menu_options");if(obj_length(e)<=0){$("<li>No Options.</li>").appendTo(f)}$.each(e,function(i,h){if(h){$("<li/>").html(i).click(h).appendTo(f)}else{$("<li class='head'/>").html(i).appendTo(f)}});var g=$("<div class='popmenu-wrapper' style='position: absolute;left: 0; top: -1000;'>");g.append(f).append("<div class='overlay-border'>").appendTo("body");var d=c.pageX-g.width()/2;d=Math.min(d,$(document).scrollLeft()+$(window).width()-$(g).width()-20);d=Math.max(d,$(document).scrollLeft()+20);g.css({top:c.pageY-5,left:d})},10);setTimeout(function(){var e=function(g){$(g).bind("click.close_popup",function(){$(".popmenu-wrapper").remove();g.unbind("click.close_popup")})};e($(window.document));e($(window.top.document));for(var d=window.top.frames.length;d--;){var f=$(window.top.frames[d].document);e(f)}},50);return false})}function make_popup_menus(){jQuery("div[popupmenu]").each(function(){var a={};var c=$(this);c.find("a").each(function(){var f=$(this),h=f.get(0);var d=h.getAttribute("confirm"),e=h.getAttribute("href"),g=h.getAttribute("target");if(!e){a[f.text()]=null}else{a[f.text()]=function(){if(!d||confirm(d)){var i;if(g=="_parent"){window.parent.location=e}else{if(g=="_top"){window.top.location=e}else{if(g=="demo"){if(i==undefined||i.closed){i=window.open(e,g);i.creator=self}}else{window.location=e}}}}}}});var b=$("#"+c.attr("popupmenu"));b.find("a").bind("click",function(d){d.stopPropagation();return true});make_popupmenu(b,a);b.addClass("popup");c.remove()})}function naturalSort(j,h){var p=/(-?[0-9\.]+)/g,k=j.toString().toLowerCase()||"",g=h.toString().toLowerCase()||"",l=String.fromCharCode(0),n=k.replace(p,l+"$1"+l).split(l),e=g.replace(p,l+"$1"+l).split(l),d=(new Date(k)).getTime(),o=d?(new Date(g)).getTime():null;if(o){if(d<o){return -1}else{if(d>o){return 1}}}var m,f;for(var i=0,c=Math.max(n.length,e.length);i<c;i++){m=parseFloat(n[i])||n[i];f=parseFloat(e[i])||e[i];if(m<f){return -1}else{if(m>f){return 1}}}return 0}function replace_big_select_inputs(a,b){if(!jQuery().autocomplete){return}if(a===undefined){a=20}if(b===undefined){b=3000}$("select").each(function(){var d=$(this);var g=d.find("option").length;if((g<a)||(g>b)){return}if(d.attr("multiple")===true){return}if(d.hasClass("no-autocomplete")){return}var m=d.attr("value");var c=$("<input type='text' class='text-and-autocomplete-select'></input>");c.attr("size",40);c.attr("name",d.attr("name"));c.attr("id",d.attr("id"));c.click(function(){var n=$(this).val();$(this).val("Loading...");$(this).showAllInCache();$(this).val(n);$(this).select()});var e=[];var i={};d.children("option").each(function(){var o=$(this).text();var n=$(this).attr("value");e.push(o);i[o]=n;i[n]=n;if(n==m){c.attr("value",o)}});if(m===""||m==="?"){c.attr("value","Click to Search or Select")}if(d.attr("name")=="dbkey"){e=e.sort(naturalSort)}var f={selectFirst:false,autoFill:false,mustMatch:false,matchContains:true,max:b,minChars:0,hideForLessThanMinChars:false};c.autocomplete(e,f);d.replaceWith(c);var k=function(){var o=c.attr("value");var n=i[o];if(n!==null&&n!==undefined){c.attr("value",n)}else{if(m!==""){c.attr("value",m)}else{c.attr("value","?")}}};c.parents("form").submit(function(){k()});$(document).bind("convert_to_values",function(){k()});if(d.attr("refresh_on_change")=="true"){var h=d.attr("refresh_on_change_values"),l=d.attr("last_selected_value");if(h!==undefined){h=h.split(",")}var j=function(){var n=i[c.attr("value")];if(l!==n&&n!==null&&n!==undefined){if(h!==undefined&&$.inArray(n,h)===-1&&$.inArray(l,h)===-1){return}c.attr("value",n);$(window).trigger("refresh_on_change");c.parents("form").submit()}};c.bind("result",j);c.keyup(function(n){if(n.keyCode===13){j()}});c.keydown(function(n){if(n.keyCode===13){return false}})}})}function async_save_text(d,f,e,a,c,h,i,g,b){if(c===undefined){c=30}if(i===undefined){i=4}$("#"+d).live("click",function(){if($("#renaming-active").length>0){return}var l=$("#"+f),k=l.text(),j;if(h){j=$("<textarea></textarea>").attr({rows:i,cols:c}).text($.trim(k))}else{j=$("<input type='text'></input>").attr({value:$.trim(k),size:c})}j.attr("id","renaming-active");j.blur(function(){$(this).remove();l.show();if(b){b(j)}});j.keyup(function(n){if(n.keyCode===27){$(this).trigger("blur")}else{if(n.keyCode===13){var m={};m[a]=$(this).val();$(this).trigger("blur");$.ajax({url:e,data:m,error:function(){alert("Text editing for elt "+f+" failed")},success:function(o){if(o!==""){l.text(o)}else{l.html("<em>None</em>")}if(b){b(j)}}})}}});if(g){g(j)}l.hide();j.insertAfter(l);j.focus();j.select();return})}function init_history_items(d,a,c){var b=function(){try{var e=$.jStore.store("history_expand_state");if(e){for(var g in e){$("#"+g+" div.historyItemBody").show()}}}catch(f){$.jStore.remove("history_expand_state")}if($.browser.mozilla){$("div.historyItemBody").each(function(){if(!$(this).is(":visible")){$(this).find("pre.peek").css("overflow","hidden")}})}d.each(function(){var j=this.id,h=$(this).children("div.historyItemBody"),i=h.find("pre.peek");$(this).find(".historyItemTitleBar > .historyItemTitle").wrap("<a href='javascript:void(0);'></a>").click(function(){var k;if(h.is(":visible")){if($.browser.mozilla){i.css("overflow","hidden")}h.slideUp("fast");if(!c){k=$.jStore.store("history_expand_state");if(k){delete k[j];$.jStore.store("history_expand_state",k)}}}else{h.slideDown("fast",function(){if($.browser.mozilla){i.css("overflow","auto")}});if(!c){k=$.jStore.store("history_expand_state");if(k===undefined){k={}}k[j]=true;$.jStore.store("history_expand_state",k)}}return false})});$("#top-links > a.toggle").click(function(){var h=$.jStore.store("history_expand_state");if(h===undefined){h={}}$("div.historyItemBody:visible").each(function(){if($.browser.mozilla){$(this).find("pre.peek").css("overflow","hidden")}$(this).slideUp("fast");if(h){delete h[$(this).parent().attr("id")]}});$.jStore.store("history_expand_state",h)}).show()};if(a){b()}else{$.jStore.init("galaxy");$.jStore.ready(function(){b()})}}function commatize(b){b+="";var a=/(\d+)(\d{3})/;while(a.test(b)){b=b.replace(a,"$1,$2")}return b}function reset_tool_search(a){var c=$("#galaxy_tools").contents();if(c.length===0){c=$(document)}$(this).removeClass("search_active");c.find(".toolTitle").removeClass("search_match");c.find(".toolSectionBody").hide();c.find(".toolTitle").show();c.find(".toolPanelLabel").show();c.find(".toolSectionWrapper").each(function(){if($(this).attr("id")!="recently_used_wrapper"){$(this).show()}else{if($(this).hasClass("user_pref_visible")){$(this).show()}}});c.find("#search-no-results").hide();c.find("#search-spinner").hide();if(a){var b=c.find("#tool-search-query");b.val("search tools");b.css("font-style","italic")}}var GalaxyAsync=function(a){this.url_dict={};this.log_action=(a===undefined?false:a)};GalaxyAsync.prototype.set_func_url=function(a,b){this.url_dict[a]=b};GalaxyAsync.prototype.set_user_pref=function(a,b){var c=this.url_dict[arguments.callee];if(c===undefined){return false}$.ajax({url:c,data:{pref_name:a,pref_value:b},error:function(){return false},success:function(){return true}})};GalaxyAsync.prototype.log_user_action=function(c,b,d){if(!this.log_action){return}var a=this.url_dict[arguments.callee];if(a===undefined){return false}$.ajax({url:a,data:{action:c,context:b,params:d},error:function(){return false},success:function(){return true}})};$(document).ready(function(){$("select[refresh_on_change='true']").change(function(){var a=$(this),e=a.val(),d=false,c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var b=a.attr("last_selected_value");if($.inArray(e,c)===-1&&$.inArray(b,c)===-1){return}}$(window).trigger("refresh_on_change");$(document).trigger("convert_to_values");a.get(0).form.submit()});$("a[confirm]").click(function(){return confirm($(this).attr("confirm"))});if($.fn.tipsy){$(".tooltip").tipsy({gravity:"s"})}make_popup_menus();replace_big_select_inputs(20,1500);$("a").click(function(){var b=$(this);var c=(parent.frames&&parent.frames.galaxy_main);if((b.attr("target")=="galaxy_main")&&(!c)){var a=b.attr("href");if(a.indexOf("?")==-1){a+="?"}else{a+="&"}a+="use_panels=True";b.attr("href",a);b.attr("target","_self")}return b})}); \ No newline at end of file +if(!Array.indexOf){Array.prototype.indexOf=function(c){for(var b=0,a=this.length;b<a;b++){if(this[b]==c){return b}}return -1}}function obj_length(c){if(c.length!==undefined){return c.length}var b=0;for(var a in c){b++}return b}$.fn.makeAbsolute=function(a){return this.each(function(){var b=$(this);var c=b.position();b.css({position:"absolute",marginLeft:0,marginTop:0,top:c.top,left:c.left,right:$(window).width()-(c.left+b.width())});if(a){b.remove().appendTo("body")}})};function show_hide_popupmenu_options(d,c,a){a=(a===undefined?true:a);var b=new RegExp(c);$(d).find("li").each(function(){if(b.exec($(this).text())){if(a){$(this).show()}else{$(this).hide()}}})}function make_popupmenu(a,b){a.data("menu_options",b);a.bind("click.show_popup",function(c){$(".popmenu-wrapper").remove();setTimeout(function(){var f=$("<ul id='"+a.attr("id")+"-menu'></ul>");var e=a.data("menu_options");if(obj_length(e)<=0){$("<li>No Options.</li>").appendTo(f)}$.each(e,function(i,h){if(h){$("<li/>").html(i).click(h).appendTo(f)}else{$("<li class='head'/>").html(i).appendTo(f)}});var g=$("<div class='popmenu-wrapper' style='position: absolute;left: 0; top: -1000;'>");g.append(f).append("<div class='overlay-border'>").appendTo("body");var d=c.pageX-g.width()/2;d=Math.min(d,$(document).scrollLeft()+$(window).width()-$(g).width()-20);d=Math.max(d,$(document).scrollLeft()+20);g.css({top:c.pageY-5,left:d})},10);setTimeout(function(){var e=function(g){$(g).bind("click.close_popup",function(){$(".popmenu-wrapper").remove();g.unbind("click.close_popup")})};e($(window.document));e($(window.top.document));for(var d=window.top.frames.length;d--;){var f=$(window.top.frames[d].document);e(f)}},50);return false})}function make_popup_menus(){jQuery("div[popupmenu]").each(function(){var a={};var c=$(this);c.find("a").each(function(){var f=$(this),h=f.get(0);var d=h.getAttribute("confirm"),e=h.getAttribute("href"),g=h.getAttribute("target");if(!e){a[f.text()]=null}else{a[f.text()]=function(){if(!d||confirm(d)){var i;if(g=="_parent"){window.parent.location=e}else{if(g=="_top"){window.top.location=e}else{if(g=="demo"){if(i==undefined||i.closed){i=window.open(e,g);i.creator=self}}else{window.location=e}}}}}}});var b=$("#"+c.attr("popupmenu"));b.find("a").bind("click",function(d){d.stopPropagation();return true});make_popupmenu(b,a);b.addClass("popup");c.remove()})}function naturalSort(j,h){var p=/(-?[0-9\.]+)/g,k=j.toString().toLowerCase()||"",g=h.toString().toLowerCase()||"",l=String.fromCharCode(0),n=k.replace(p,l+"$1"+l).split(l),e=g.replace(p,l+"$1"+l).split(l),d=(new Date(k)).getTime(),o=d?(new Date(g)).getTime():null;if(o){if(d<o){return -1}else{if(d>o){return 1}}}var m,f;for(var i=0,c=Math.max(n.length,e.length);i<c;i++){m=parseFloat(n[i])||n[i];f=parseFloat(e[i])||e[i];if(m<f){return -1}else{if(m>f){return 1}}}return 0}function replace_big_select_inputs(a,b){if(!jQuery().autocomplete){return}if(a===undefined){a=20}if(b===undefined){b=3000}$("select").each(function(){var d=$(this);var g=d.find("option").length;if((g<a)||(g>b)){return}if(d.attr("multiple")===true){return}if(d.hasClass("no-autocomplete")){return}var m=d.attr("value");var c=$("<input type='text' class='text-and-autocomplete-select'></input>");c.attr("size",40);c.attr("name",d.attr("name"));c.attr("id",d.attr("id"));c.click(function(){var n=$(this).val();$(this).val("Loading...");$(this).showAllInCache();$(this).val(n);$(this).select()});var e=[];var i={};d.children("option").each(function(){var o=$(this).text();var n=$(this).attr("value");e.push(o);i[o]=n;i[n]=n;if(n==m){c.attr("value",o)}});if(m===""||m==="?"){c.attr("value","Click to Search or Select")}if(d.attr("name")=="dbkey"){e=e.sort(naturalSort)}var f={selectFirst:false,autoFill:false,mustMatch:false,matchContains:true,max:b,minChars:0,hideForLessThanMinChars:false};c.autocomplete(e,f);d.replaceWith(c);var k=function(){var o=c.attr("value");var n=i[o];if(n!==null&&n!==undefined){c.attr("value",n)}else{if(m!==""){c.attr("value",m)}else{c.attr("value","?")}}};c.parents("form").submit(function(){k()});$(document).bind("convert_to_values",function(){k()});if(d.attr("refresh_on_change")=="true"){var h=d.attr("refresh_on_change_values"),l=d.attr("last_selected_value");if(h!==undefined){h=h.split(",")}var j=function(){var n=i[c.attr("value")];if(l!==n&&n!==null&&n!==undefined){if(h!==undefined&&$.inArray(n,h)===-1&&$.inArray(l,h)===-1){return}c.attr("value",n);$(window).trigger("refresh_on_change");c.parents("form").submit()}};c.bind("result",j);c.keyup(function(n){if(n.keyCode===13){j()}});c.keydown(function(n){if(n.keyCode===13){return false}})}})}function async_save_text(d,f,e,a,c,h,i,g,b){if(c===undefined){c=30}if(i===undefined){i=4}$("#"+d).live("click",function(){if($("#renaming-active").length>0){return}var l=$("#"+f),k=l.text(),j;if(h){j=$("<textarea></textarea>").attr({rows:i,cols:c}).text($.trim(k))}else{j=$("<input type='text'></input>").attr({value:$.trim(k),size:c})}j.attr("id","renaming-active");j.blur(function(){$(this).remove();l.show();if(b){b(j)}});j.keyup(function(n){if(n.keyCode===27){$(this).trigger("blur")}else{if(n.keyCode===13){var m={};m[a]=$(this).val();$(this).trigger("blur");$.ajax({url:e,data:m,error:function(){alert("Text editing for elt "+f+" failed")},success:function(o){if(o!==""){l.text(o)}else{l.html("<em>None</em>")}if(b){b(j)}}})}}});if(g){g(j)}l.hide();j.insertAfter(l);j.focus();j.select();return})}function init_history_items(d,a,c){var b=function(){try{var e=$.jStorage.get("history_expand_state");if(e){for(var g in e){$("#"+g+" div.historyItemBody").show()}}}catch(f){$.jStorage.deleteKey("history_expand_state")}if($.browser.mozilla){$("div.historyItemBody").each(function(){if(!$(this).is(":visible")){$(this).find("pre.peek").css("overflow","hidden")}})}d.each(function(){var j=this.id,h=$(this).children("div.historyItemBody"),i=h.find("pre.peek");$(this).find(".historyItemTitleBar > .historyItemTitle").wrap("<a href='javascript:void(0);'></a>").click(function(){var k;if(h.is(":visible")){if($.browser.mozilla){i.css("overflow","hidden")}h.slideUp("fast");if(!c){k=$.jStorage.get("history_expand_state");if(k){delete k[j];$.jStorage.set("history_expand_state",k)}}}else{h.slideDown("fast",function(){if($.browser.mozilla){i.css("overflow","auto")}});if(!c){k=$.jStorage.get("history_expand_state");if(!k){k={}}k[j]=true;$.jStorage.set("history_expand_state",k)}}return false})});$("#top-links > a.toggle").click(function(){var h=$.jStorage.get("history_expand_state");if(!h){h={}}$("div.historyItemBody:visible").each(function(){if($.browser.mozilla){$(this).find("pre.peek").css("overflow","hidden")}$(this).slideUp("fast");if(h){delete h[$(this).parent().attr("id")]}});$.jStorage.set("history_expand_state",h)}).show()};b()}function commatize(b){b+="";var a=/(\d+)(\d{3})/;while(a.test(b)){b=b.replace(a,"$1,$2")}return b}function reset_tool_search(a){var c=$("#galaxy_tools").contents();if(c.length===0){c=$(document)}$(this).removeClass("search_active");c.find(".toolTitle").removeClass("search_match");c.find(".toolSectionBody").hide();c.find(".toolTitle").show();c.find(".toolPanelLabel").show();c.find(".toolSectionWrapper").each(function(){if($(this).attr("id")!="recently_used_wrapper"){$(this).show()}else{if($(this).hasClass("user_pref_visible")){$(this).show()}}});c.find("#search-no-results").hide();c.find("#search-spinner").hide();if(a){var b=c.find("#tool-search-query");b.val("search tools");b.css("font-style","italic")}}var GalaxyAsync=function(a){this.url_dict={};this.log_action=(a===undefined?false:a)};GalaxyAsync.prototype.set_func_url=function(a,b){this.url_dict[a]=b};GalaxyAsync.prototype.set_user_pref=function(a,b){var c=this.url_dict[arguments.callee];if(c===undefined){return false}$.ajax({url:c,data:{pref_name:a,pref_value:b},error:function(){return false},success:function(){return true}})};GalaxyAsync.prototype.log_user_action=function(c,b,d){if(!this.log_action){return}var a=this.url_dict[arguments.callee];if(a===undefined){return false}$.ajax({url:a,data:{action:c,context:b,params:d},error:function(){return false},success:function(){return true}})};$(document).ready(function(){$("select[refresh_on_change='true']").change(function(){var a=$(this),e=a.val(),d=false,c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var b=a.attr("last_selected_value");if($.inArray(e,c)===-1&&$.inArray(b,c)===-1){return}}$(window).trigger("refresh_on_change");$(document).trigger("convert_to_values");a.get(0).form.submit()});$("a[confirm]").click(function(){return confirm($(this).attr("confirm"))});if($.fn.tipsy){$(".tooltip").tipsy({gravity:"s"})}make_popup_menus();replace_big_select_inputs(20,1500);$("a").click(function(){var b=$(this);var c=(parent.frames&&parent.frames.galaxy_main);if((b.attr("target")=="galaxy_main")&&(!c)){var a=b.attr("href");if(a.indexOf("?")==-1){a+="?"}else{a+="&"}a+="use_panels=True";b.attr("href",a);b.attr("target","_self")}return b})}); \ No newline at end of file --- a/static/scripts/packed/jquery.jstore.js Fri Feb 18 14:53:35 2011 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -/* - * jStore 2.0 - Persistent Client Side Storage - * - * Copyright (c) 2010 Eric Garside (http://eric.garside.name/) - * Dual licensed under: - * MIT: http://www.opensource.org/licenses/mit-license.php - * GPLv3: http://www.opensource.org/licenses/gpl-3.0.html - * - * --------------------------- - * - * jStore Flash Storage Component - * - * Copyright (c) 2006 Jeff Lerman (jeff@blip.tv) - * Licensed under the Creative Commons Attribution 3.0 United States License: - * http://creativecommons.org/licenses/by/3.0/us - */ -(function(i,n){var h="JSTORE_ENGINE_UNSTABLE",t="JSTORE_UNKNOWN_ENGINE_REQUESTED",r="JSTORE_ENGINE_NAMESPACE_COLLISION",j="JSTORE_RESOURCE_NAMESPACE_COLLISION",m="JSTORE_ENGINE_UNAVAILABLE",o="JSTORE_INVALID_FLAVOR",f=(function(){try{return new RegExp('^("(\\\\.|[^"\\\\\\n\\r])*?"|[,:{}\\[\\]0-9.\\-+Eaeflnr-u \\n\\r\\t])+?$')}catch(I){return(/^(true|false|null|\[.*\]|\{.*\}|".*"|\d+|\d+\.\d+)$/)}}()),b="jstore-html5-local",y="jstore-html5-sql",F="jstore-flash",G="jstore-google-gears",A="jstore-msie",u,E={},D={},C={},c=false,d={},q={project:undefined,flash:"jStore.Flash.html",json:"browser.json.js"},l;function z(I){switch(I){case b:case y:case F:case G:case A:return true;default:return false}}function g(I,J){return !I?false:I.constructor.toString().match(new RegExp(J+"\\(\\)","i"))!==null}function s(K,I,J){if(g(K,"Function")){return K.apply(I||E,g(J,"Array")?J:[J])}}function p(J,I){i.ajax({url:J,complete:I||i.noop(),type:"GET",dataType:"script",cache:false})}function x(I){if(I===undefined){return""}if(g(I,"Object")||g(I,"Array")||g(I,"Function")){return JSON.stringify(I)}return I}function k(I){return f.test(I)?JSON.parse(I):I}function w(I){return I.replace(/^\s+|\s+$/g,"")}function e(I,J,K){if(!z(I)){throw o}if(K[I]!==undefined){throw r}if(s(K)===true){E.available[I]=true;J.flavor=I;D[I]=u.extend(J)}else{E.available[I]=false;E.enginePriority=i.map(E.enginePriority,function(L){if(L===I){return null}else{return L}})}}function v(){if(E.isReady){return}if((c&&E.isFlashReady)||!c){E.isReady=true;E.trigger("jstore-ready",[C[l]])}}function a(){E.create(E.enginePriority[0],undefined,"best-fit")}function H(){try{var J=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");try{J.AllowScriptAccess="always"}catch(L){return"6,0,0"}return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch(K){try{if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){return(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}}catch(I){}}return"0,0,0"}function B(I){var N=H().match(/\d+/g),L=I.match(/\d+/g),J=0,K,M;for(;J<3;J++){K=parseInt(N[J],10);M=parseInt(L[J],10);if(K<M){return false}else{if(K>M){return true}}}return true}i.extend(E,{enginePriority:[b,y,F,A],available:{},isReady:false,isFlashReady:false,flavors:{local:b,sql:y,flash:F,gears:G,msie:A},init:function(J,K,I){i.extend(q,{project:J},K);i(function(){if(n.JSON===undefined){p(q.json)}if(I!==undefined){E.create(I,J,"default")}else{a()}});return E},create:function(I,M,J){M=M||q.project||location.hostname.replace(/\./g,"-")||"unknown";if(!z(I)){throw o}if(D[I]===undefined){throw m}var L=(J!==undefined?J+".":"")+M+"."+I,K;if(C[L]!==undefined){throw j}K=C[L]=new D[I](M,L);K.ready(function(){E.trigger("jstore-engine-ready",[K])});if(I===F&&!E.isFlashReady){if(l===undefined){c=true}n.jstore_ready=function(){E.isFlashReady=true;E.trigger("flash-ready");if(l===undefined){v()}n.flash_ready=undefined};n.jstore_error=function(N){E.trigger("jstore-error",["JSTORE_FLASH_EXCEPTION",null,N])};i('<iframe style="height:1px;width:1px;position:absolute;left:0;top:0;margin-left:-100px;" id="jStoreFlashFrame" src="'+q.flash+'"></iframe>').appendTo("body")}else{if(l===undefined){l=L;v()}}return K},engine:function(I){return C[I]},activeEngine:function(I){if(I!==undefined){if(C[I]===undefined){throw t}else{l=I}}return C[l]},bind:function(J,K,I){I=I||"jstore";if(d[I]===undefined){d[I]={}}if(d[I][J]===undefined){d[I][J]=[K]}else{d[I][J].push(K)}return E},trigger:function(K,J,I){I=I||"jstore";if(d[I]!==undefined){if(d[I][K]!==undefined){i.each(d[I][K],function(){s(this,E,J)})}}return E},error:function(I){E.bind("jstore-error",I)},ready:function(I){if(E.isReady){s(I)}else{E.bind("jstore-ready",I)}return E},engineReady:function(I){if(E.isReady){s(I)}else{E.bind("jstore-engine-ready",I)}return E},store:function(I,J){return J===undefined?E.get(I):E.set(I,J)},remove:function(I){return E.activeEngine().remove(I)},get:function(I){return E.activeEngine().get(I)},set:function(I,J){return E.activeEngine().set(I,J)}});u=Class.extend({project:undefined,jri:undefined,flavor:undefined,database:undefined,data:undefined,limit:undefined,isReady:undefined,init:function(J,I){this.project=J;this.jri=I;this.data={};this.isReady=false;this.updateCache()},updateCache:function(){this.isReady=true;this.trigger("engine-ready",[this])},bind:function(I,J){E.bind(I,J,this.jri)},trigger:function(J,I){E.trigger(J,I,this.jri)},ready:function(I){if(this.isReady){s(I,this)}else{this.bind("engine-ready",I)}},get:function(I){this.__interruptAccess();return this.data[I]},set:function(I,J){this.__interruptAccess();I=w(I);try{this.__set(I,J)}catch(K){E.trigger("jstore-error",["JSTORE_STORAGE_FAILURE",this.jri,K])}this.data[I]=J;return J},remove:function(J){this.__interruptAccess();J=w(J);try{this.__remove(J)}catch(K){E.trigger("jstore-error",["JSTORE_REMOVE_FAILURE",this.jri,K])}var I=this.data[J];this.data[J]=undefined;return I},__interruptAccess:function(){if(!this.isReady){throw h}},__set:function(I,J){return},__remove:function(I){return}});i.extend(i.fn,{store:function(I,J){if(J===undefined){E.get(I)}else{E.set(I,J)}return this},removeStore:function(I){E.activeEngine().remove(I);return this},getStore:function(I){return E.activeEngine().get(I)},setStore:function(I,J){E.activeEngine().set(I,J);return this}});n.jStore=i.jStore=E;e(b,{limit:parseInt(500000,16),init:function(J,I){this.database=n.globalStorage===undefined?n.localStorage:n.globalStorage[location.hostname];this._super(J,I)},updateCache:function(){var J,K;for(J in this.database){var I=false;if(this.database.hasOwnProperty){if(this.database.hasOwnProperty(J)){I=true}}else{if(this.database.getItem(J)!==null){I=true}}if(I){K=this.database.getItem(J);this.data[J]=k(K&&K.value?K.value:K)}}this._super()},__set:function(I,J){this.database.setItem(I,x(J))},__remove:function(I){this.database.removeItem(I)}},function(){return n.localStorage!==undefined||n.globalStorage!==undefined});e(y,{limit:parseInt(32000,16),init:function(J,I){this.database=n.openDatabase("jstore-"+J,"1.0",J,this.limit);if(!this.database){throw"JSTORE_SQL_NO_DB"}this.database.transaction(function(K){K.executeSql("CREATE TABLE IF NOT EXISTS jstore (k TEXT UNIQUE NOT NULL PRIMARY KEY, v TEXT NOT NULL)")});this._super(J,I)},updateCache:function(){var I=this,J=this._super;this.database.transaction(function(K){K.executeSql("SELECT k,v FROM jstore",[],function(O,L){var N=L.rows,M=0,P;for(;M<N.length;++M){P=N.item(M);I.data[P.k]=k(P.v)}J.apply(I)})})},__set:function(I,J){this.database.transaction(function(K){K.executeSql("INSERT OR REPLACE INTO jstore(k, v) VALUES (?, ?)",[I,x(J)])})},__remove:function(I){this.database.transaction(function(J){J.executeSql("DELETE FROM jstore WHERE k = ?",[I])})}},function(){return n.openDatabase!==undefined});e(F,{limit:-1,init:function(K,J){var I=this;E.bind("flash-ready",function(){I.__flashReadyListener()});this._super(K,J)},updateCache:function(I){if(I===true){var J,K=this.database.jstore_get_all();for(J in K){if(K.hasOwnProperty(J)){this.data[J]=k(this.database.jstore_get(J))}}this._super()}},__set:function(I,J){if(!this.database.jstore_set(I,x(J))){E.trigger("jstore-error",["JSTORE_STORAGE_FAILURE",this.jri,"Flash Exception"])}},__remove:function(I){this.database.jstore_remove(I)},__flashReadyListener:function(){var I=i("#jStoreFlashFrame")[0],J;if(I.Document!==undefined&&g(I.Document.jStoreFlash.jstore_get,"Function")){this.database=I.Document.jStoreFlash}else{if(I.contentWindow&&I.contentWindow.document){J=i(I.contentWindow.document);if(g(i("object",J)[0].jstore_get,"Function")){this.database=i("object",J)[0]}else{if(g(i("embed",J)[0].jstore_get,"Function")){this.database=i("embed",J)[0]}}}}if(this.database===undefined){throw"JSTORE_FLASH_REFERENCE_ISSUE"}else{this.updateCache(true)}}},function(){return B("9.0.0")});e(G,{limit:-1,init:function(J,I){this.database=google.gears.factory.create("beta.database");this.database.open("jstore-"+J);this.database.execute("CREATE TABLE IF NOT EXISTS jstore (k TEXT UNIQUE NOT NULL PRIMARY KEY, v TEXT NOT NULL)");this._super(J,I)},updateCache:function(){var I=this.database.execute("SELECT k,v FROM jstore");while(I.isValidRow()){this.data[I.field(0)]=k(I.field(1));I.next()}I.close();this._super()},__set:function(I,J){this.database.execute("BEGIN");this.database.execute("INSERT OR REPLACE INTO jstore(k, v) VALUES (?, ?)",[I,x(J)]);this.database.execute("COMMIT")},__remove:function(I){this.database.execute("BEGIN");this.database.execute("DELETE FROM jstore WHERE k = ?",[I]);this.database.execute("COMMIT")}},function(){return n.google!==undefined&&n.google.gears!==undefined});e(A,{limit:parseInt(10000,16),init:function(J,I){this.database=i('<div style="display:none;behavior:url(\'#default#userData\')" id="jstore-'+J+'"></div>').appendTo(document.body).get(0);this._super(J,I)},updateCache:function(){this.database.load(this.project);var K=document.getElementById("jstore-"+this.project),L=K.XMLDocument,I,J=0;if(L&&L.documentElement&&L.documentElement.attributes){I=L.documentElement;for(;J<I.attributes.length;++J){this.data[I.attributes.item(J).nodeName]=k(I.attributes.item(J).nodeValue)}}this._super()},__set:function(I,J){this.database.setAttribute(I,x(J));this.database.save(this.project)},__remove:function(I){this.database.removeAttribute(I);this.database.save(this.project)}},function(){return n.ActiveXObject!==undefined})}(jQuery,window)); \ No newline at end of file --- a/templates/display_base.mako Fri Feb 18 14:53:35 2011 -0500 +++ b/templates/display_base.mako Fri Feb 18 15:06:34 2011 -0500 @@ -32,7 +32,7 @@ <%def name="javascripts()"> ${parent.javascripts()} - ${h.js( "jquery", "jquery.tipsy", "galaxy.base", "json2", "class", "jquery.jstore", "jquery.autocomplete", "jquery.rating", "autocomplete_tagging", "trackster" )} + ${h.js( "jquery", "jquery.tipsy", "galaxy.base", "json2", "jstorage", "jquery.autocomplete", "jquery.rating", "autocomplete_tagging", "trackster" )} <script type="text/javascript"> --- a/templates/history/view.mako Fri Feb 18 14:53:35 2011 -0500 +++ b/templates/history/view.mako Fri Feb 18 15:06:34 2011 -0500 @@ -5,7 +5,7 @@ <%def name="javascripts()"> ${parent.javascripts()} - ${h.js( "galaxy.base", "jquery", "json2", "class", "jquery.jstore" )} + ${h.js( "galaxy.base", "jquery", "json2", "jstorage" )} <script type="text/javascript"> $(function() { init_history_items( $("div.historyItemWrapper"), false, "nochanges" ); --- a/templates/library/common/browse_library.mako Fri Feb 18 14:53:35 2011 -0500 +++ b/templates/library/common/browse_library.mako Fri Feb 18 15:06:34 2011 -0500 @@ -48,7 +48,7 @@ <%def name="javascripts()"> ${parent.javascripts()} - ${h.js("class", "jquery.jstore")} + ${h.js("json2", "jstorage")} ${common_javascripts()} ${self.grid_javascripts()} </%def> @@ -56,11 +56,10 @@ <%def name="grid_javascripts()"><script type="text/javascript"> $(function() { - $.jStore.init("galaxy"); // Auto-select best storage var storage_id = "library-expand-state-${trans.security.encode_id(library.id)}"; var restore_folder_state = function() { - var state = $.jStore.store(storage_id); + var state = $.jStorage.get(storage_id); if (state) { for (var id in state) { if (state[id] === true) { @@ -79,7 +78,7 @@ var folder = $(this); state[folder.attr("id")] = folder.hasClass("expanded"); }); - $.jStore.store(storage_id, state); + $.jStorage.set(storage_id, state); }; $("#library-grid").each(function() { @@ -131,10 +130,10 @@ // Initialize dict[parent_id] = rows_which_have_that_parent_id_as_parent_attr var par_child_dict = {}, no_parent = []; - + $(this).find("tbody tr").each( function() { - if (this.hasAttribute("parent")) { - var parent = this.getAttribute("parent"); + if ( $(this).attr("parent")) { + var parent = $(this).attr("parent"); if (par_child_dict[parent] !== undefined) { par_child_dict[parent].push(this); } else { @@ -151,9 +150,7 @@ }); }); - $.jStore.engineReady(function() { - restore_folder_state(); - }); + restore_folder_state(); }); // Looks for changes in dataset state using an async request. Keeps --- a/templates/library/common/library_dataset_search_results.mako Fri Feb 18 14:53:35 2011 -0500 +++ b/templates/library/common/library_dataset_search_results.mako Fri Feb 18 15:06:34 2011 -0500 @@ -46,7 +46,7 @@ <%def name="javascripts()"> ${parent.javascripts()} - ${h.js("class", "jquery.jstore")} + ${h.js("jstorage")} ${common_javascripts()} </%def> --- a/templates/page/editor.mako Fri Feb 18 14:53:35 2011 -0500 +++ b/templates/page/editor.mako Fri Feb 18 15:06:34 2011 -0500 @@ -21,7 +21,7 @@ <%def name="javascripts()"> ${parent.javascripts()} - ${h.js( "jquery.event.drag", "jquery.event.drop", "jquery.event.hover", "jquery.form", "class", "jquery.jstore", "json2", + ${h.js( "jquery.event.drag", "jquery.event.drop", "jquery.event.hover", "jquery.form", "json2", "jstorage" "galaxy.base", "jquery.wymeditor", "jquery.autocomplete", "autocomplete_tagging")} <script type="text/javascript"> --- a/templates/root/history.mako Fri Feb 18 14:53:35 2011 -0500 +++ b/templates/root/history.mako Fri Feb 18 15:06:34 2011 -0500 @@ -15,7 +15,7 @@ <meta http-equiv="Pragma" content="no-cache"> ${h.css( "base", "history", "autocomplete_tagging" )} -${h.js( "jquery", "jquery.tipsy", "galaxy.base", "json2", "class", "jquery.jstore", "jquery.autocomplete", "autocomplete_tagging" )} +${h.js( "jquery", "jquery.tipsy", "galaxy.base", "json2", "jstorage", "jquery.autocomplete", "autocomplete_tagging" )} <script type="text/javascript"> --- a/templates/workflow/editor.mako Fri Feb 18 14:53:35 2011 -0500 +++ b/templates/workflow/editor.mako Fri Feb 18 15:06:34 2011 -0500 @@ -31,9 +31,8 @@ "jquery.event.drop", "jquery.event.hover", "jquery.form", - "class", "json2", - "jquery.jstore", + "jstorage", "galaxy.base", "galaxy.workflow_editor.canvas", "jquery.autocomplete", @@ -177,9 +176,6 @@ }); %endif - // Load jStore for local storage - $.jStore.init("galaxy"); // Auto-select best storage - // Canvas overview management canvas_manager = new CanvasManager( $("#canvas-viewport"), $("#overview") ); @@ -309,23 +305,21 @@ } - $.jStore.ready(function() { - // On load, set the size to the pref stored in local storage if it exists - overview_size = $.jStore.store("overview-size"); - if (overview_size !== undefined) { - $("#overview-border").css( { - width: overview_size, - height: overview_size - }); - } - - // Show viewport on load unless pref says it's off - if ($.jStore.store("overview-off")) { - hide_overview(); - } else { - show_overview(); - } - }); + // On load, set the size to the pref stored in local storage if it exists + overview_size = $.jStorage.get("overview-size"); + if (overview_size !== undefined) { + $("#overview-border").css( { + width: overview_size, + height: overview_size + }); + } + + // Show viewport on load unless pref says it's off + if ($.jStorage.get("overview-off")) { + hide_overview(); + } else { + show_overview(); + } // Stores the size of the overview into local storage when it's resized $("#overview-border").bind( "dragend", function( e, d ) { @@ -333,17 +327,17 @@ var opo = op.offset(); var new_size = Math.max( op.width() - ( d.offsetX - opo.left ), op.height() - ( d.offsetY - opo.top ) ); - $.jStore.store("overview-size", new_size + "px"); + $.jStorage.set("overview-size", new_size + "px"); }); function show_overview() { - $.jStore.remove("overview-off"); + $.jStorage.set("overview-off", false); $("#overview-border").css("right", "0px"); $("#close-viewport").css("background-position", "0px 0px"); } function hide_overview() { - $.jStore.store("overview-off", true); + $.jStorage.set("overview-off", true); $("#overview-border").css("right", "20000px"); $("#close-viewport").css("background-position", "12px 0px"); } 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.