mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge pull request #4435 from dannon/es6
Galaxy client tooling overhaul, ES6
This commit is contained in:
@@ -125,6 +125,7 @@ sprite-*.less
|
||||
static/scripts/bundled/[0-9]*
|
||||
node_modules
|
||||
bower_components
|
||||
client/galaxy/scripts/libs/*
|
||||
|
||||
# Documentation build files.
|
||||
doc/build
|
||||
|
||||
@@ -12,10 +12,6 @@ VENV?=.venv
|
||||
IN_VENV=if [ -f $(VENV)/bin/activate ]; then . $(VENV)/bin/activate; fi;
|
||||
CONFIG_MANAGE=$(IN_VENV) python lib/galaxy/webapps/config_manage.py
|
||||
PROJECT_URL?=https://github.com/galaxyproject/galaxy
|
||||
GRUNT_DOCKER_NAME:=galaxy/client-builder:16.01
|
||||
GRUNT_EXEC?=node_modules/grunt-cli/bin/grunt
|
||||
WEBPACK_EXEC?=node_modules/webpack/bin/webpack.js
|
||||
GXY_NODE_MODULES=client/node_modules
|
||||
DOCS_DIR=doc
|
||||
DOC_SOURCE_DIR=$(DOCS_DIR)/source
|
||||
SLIDESHOW_DIR=$(DOC_SOURCE_DIR)/slideshow
|
||||
@@ -117,43 +113,18 @@ release-check-blocking-prs: ## Check github for release blocking PRs
|
||||
release-bootstrap-history: ## bootstrap history for a new release
|
||||
$(IN_VENV) python scripts/bootstrap_history.py --release $(RELEASE_CURR)
|
||||
|
||||
npm-deps: ## Install NodeJS dependencies.
|
||||
cd client && npm install
|
||||
node-deps: ## Install NodeJS dependencies.
|
||||
cd client && yarn install --check-files
|
||||
|
||||
grunt: npm-deps ## Calls out to Grunt to build client
|
||||
cd client && $(GRUNT_EXEC)
|
||||
client: node-deps ## Rebuild all client-side artifacts
|
||||
cd client && yarn run build
|
||||
|
||||
style: npm-deps ## Calls the style task of Grunt
|
||||
cd client && $(GRUNT_EXEC) style
|
||||
charts: node-deps ## Rebuild charts
|
||||
cd client && yarn run build-charts
|
||||
|
||||
client-install-libs: npm-deps ## Fetch updated client dependencies using bower.
|
||||
cd client && $(GRUNT_EXEC) install-libs
|
||||
|
||||
client: grunt style ## Rebuild all client-side artifacts
|
||||
|
||||
charts: npm-deps ## Rebuild charts
|
||||
NODE_PATH=$(GXY_NODE_MODULES) client/$(WEBPACK_EXEC) -p --config config/plugins/visualizations/charts/webpack.config.js
|
||||
|
||||
grunt-docker-image: ## Build docker image for running grunt
|
||||
docker build -t ${GRUNT_DOCKER_NAME} client
|
||||
|
||||
grunt-docker: grunt-docker-image ## Run grunt inside docker
|
||||
docker run -it -v `pwd`:/data ${GRUNT_DOCKER_NAME}
|
||||
|
||||
clean-grunt-docker-image: ## Remove grunt docker image
|
||||
docker rmi ${GRUNT_DOCKER_NAME}
|
||||
|
||||
grunt-watch-style: npm-deps ## Execute watching style builder for dev purposes
|
||||
cd client && $(GRUNT_EXEC) watch-style
|
||||
|
||||
grunt-watch-develop: npm-deps ## Execute watching grunt builder for dev purposes (unpacked, allows debugger statements)
|
||||
cd client && $(GRUNT_EXEC) watch --develop
|
||||
|
||||
webpack-watch: npm-deps ## Execute watching webpack for dev purposes
|
||||
cd client && ./node_modules/webpack/bin/webpack.js --watch
|
||||
|
||||
client-develop: grunt-watch-style grunt-watch-develop webpack-watch ## A useful target for parallel development building.
|
||||
@echo "Remember to rerun `make client` before committing!"
|
||||
client-watch: node-deps ## A useful target for parallel development building.
|
||||
cd client && yarn run watch
|
||||
@echo "Remember to 'make client' when finished developing!"
|
||||
|
||||
|
||||
# Release Targets
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"presets": ["env"]
|
||||
}
|
||||
+1
-3
@@ -20,9 +20,7 @@ module.exports = function(grunt) {
|
||||
grunt.config.set( 'paths', TOOLSHED_PATHS );
|
||||
}
|
||||
|
||||
grunt.loadNpmTasks('grunt-check-modules');
|
||||
// see the sub directory grunt-tasks/ for individual task definitions
|
||||
grunt.loadTasks( 'grunt-tasks' );
|
||||
// note: 'handlebars' *not* 'templates' since handlebars doesn't call uglify
|
||||
grunt.registerTask( 'default', [ 'check-modules', 'uglify', 'webpack' ] );
|
||||
grunt.registerTask( 'default', [ 'uglify' ] );
|
||||
};
|
||||
|
||||
+35
-96
@@ -1,123 +1,62 @@
|
||||
Client Build System
|
||||
===================
|
||||
|
||||
Builds and moves the client-side scripts necessary for running the Galaxy webapps. There's no need to use this system
|
||||
unless you are modifying or developing client-side scripts.
|
||||
Installs, stages, and builds the client-side scripts necessary for running the
|
||||
Galaxy webapp. There's no need to use this system unless you are modifying or
|
||||
developing client-side scripts.
|
||||
|
||||
The base dependencies you'll need are Node.js and the Node Package Manager
|
||||
(npm). See nodejs.org for more information.
|
||||
The base dependencies you will need are Node.js and Yarn. On OSX the easiest
|
||||
way to get set up is using homebrew and the command `brew install nodejs yarn`.
|
||||
More information including instructions for other platforms is available at
|
||||
nodejs.org and yarnpkg.com.
|
||||
|
||||
|
||||
Simple Full Build
|
||||
=================
|
||||
Complete Client Build
|
||||
================================================
|
||||
|
||||
The simplest way to rebuild the entire client to incorporate any local changes
|
||||
is to run the 'client' rule in the Galaxy makefile, which is in the repository
|
||||
root. This will also ensure any local node modules are installed.
|
||||
There are many moving parts to the client build system, but the entrypoint for
|
||||
most people is the 'client' rule in the Makefile at the root of the Galaxy
|
||||
repository. Execute the following to perform a complete build including
|
||||
dependency staging, style building, script processing and bundling.
|
||||
|
||||
make client
|
||||
|
||||
|
||||
Detailed Build Instructions
|
||||
===========================
|
||||
Automatic Rebuilding (Watch Mode)
|
||||
=================================
|
||||
|
||||
Once npm is installed, install the grunt task manager and its command line into your global scope:
|
||||
When you're actively developing, it is sometimes convenient to have the client
|
||||
automatically rebuild every time you save a file. You can do this using:
|
||||
|
||||
npm install -g grunt grunt-cli
|
||||
make client-watch
|
||||
|
||||
Next, from within this directory, install the local build dependencies:
|
||||
|
||||
cd client
|
||||
npm install
|
||||
|
||||
You're now ready to re-build the client scripts after modifying them.
|
||||
|
||||
|
||||
Rebuilding
|
||||
==========
|
||||
|
||||
There are two methods for rebuilding: a complete rebuild and automatic, partial rebuilds while you develop.
|
||||
|
||||
A complete rebuild can be done with the following (from the `client` directory):
|
||||
|
||||
grunt
|
||||
|
||||
This will:
|
||||
|
||||
1. compress the files in client/galaxy/scripts and place them in static/scripts
|
||||
2. generate source maps and place them in static/maps
|
||||
3. rebuild the webpack-based client apps
|
||||
|
||||
|
||||
Rebuilding Scripts Only
|
||||
=======================
|
||||
|
||||
To re-minify all the individual javascript files:
|
||||
|
||||
grunt scripts
|
||||
|
||||
|
||||
Rebuilding Webpack Apps
|
||||
=======================
|
||||
|
||||
To rebuild the webpack bundles for apps (compressed for production):
|
||||
|
||||
grunt webpack
|
||||
|
||||
To rebuild the apps without compression:
|
||||
|
||||
grunt webpack-dev
|
||||
|
||||
To rebuild without compression and watch and rebuild when scripts change:
|
||||
|
||||
grunt webpack-watch
|
||||
This will first stage any dependencies (yarn-installed packages like jquery,
|
||||
etc), and then will watch for changes in any of the galaxy client source files.
|
||||
When a file is changed, the client will automatically rebuild, after which you
|
||||
can usually force refresh your browser to see changes. Note that it is still
|
||||
recommended to run 'make client' after you are finished actively developing
|
||||
using 'make client-watch'.
|
||||
|
||||
|
||||
Changing Styles/CSS
|
||||
===================
|
||||
|
||||
The CSS and styling used by Galaxy is also controlled from this directory. Galaxy uses LESS, a superset of CSS that
|
||||
compiles to CSS, for its styling. LESS files are kept in client/galaxy/style/less. Compiled CSS is in static/style/blue.
|
||||
The CSS and styling used by Galaxy is also controlled from this directory.
|
||||
Galaxy uses LESS, a superset of CSS that compiles to CSS, for its styling. LESS
|
||||
files are kept in client/galaxy/style/less. Compiled CSS is in
|
||||
static/style/blue.
|
||||
|
||||
Use grunt to recompile the LESS in into CSS (from the `client` directory):
|
||||
As mentioned above, 'make client' will also rebuild styles. If you *only* want
|
||||
to run the style task, use the following command from the `client` directory:
|
||||
|
||||
grunt style
|
||||
|
||||
|
||||
Grunt watch
|
||||
===========
|
||||
|
||||
Grunt can also do an automatic, partial rebuild of any files you change *as you develop* by:
|
||||
|
||||
1. opening a new terminal session
|
||||
2. `cd client`
|
||||
3. Watch with:
|
||||
1. `grunt watch` to watch the *scripts/* folder
|
||||
2. `grunt watch-style` to watch the *style/* folder
|
||||
|
||||
This starts a new grunt watch process that will monitor the files, in the corresponding folder, for changes and copy and
|
||||
rebuild them when they change.
|
||||
|
||||
You can stop the watch task by pressing `Ctrl+C`. Note: you should also be able to background that task
|
||||
if you prefer.
|
||||
|
||||
|
||||
Using a Locally Installed Version of Grunt
|
||||
==========================================
|
||||
|
||||
A non-global version of grunt and the grunt-cli are installed when using 'npm install'. If you'd rather build with that
|
||||
version, you'll need to use the full, local path when calling it:
|
||||
|
||||
./node_modules/.bin/grunt
|
||||
# or
|
||||
./node_modules/.bin/grunt watch
|
||||
yarn run style
|
||||
|
||||
|
||||
The Toolshed Client Build
|
||||
=========================
|
||||
|
||||
The commands mentioned above in 'Rebuilding' and 'Grunt watch' also can be applied to toolshed scripts by using the
|
||||
`--app=toolshed` option:
|
||||
The toolshed client is not tightly integrated with the rest of the build
|
||||
system. To build the toolshed client, execute the following command from the
|
||||
`client` directory.
|
||||
|
||||
grunt watch --app=toolshed
|
||||
grunt --app=toolshed
|
||||
yarn run build-toolshed
|
||||
|
||||
+1
-15
@@ -8,32 +8,18 @@
|
||||
],
|
||||
"homepage": "usegalaxy.org",
|
||||
"dependencies": {
|
||||
"jquery": "~1.12",
|
||||
"ravenjs": "~3",
|
||||
"underscore": "~1",
|
||||
"backbone": "~1.3",
|
||||
"bootstrap": "~3.3.2",
|
||||
"bootstrap-tour": "~0.10.2",
|
||||
"d3": "~3",
|
||||
"farbtastic": "~2.0.0-alpha.1",
|
||||
"toastr": "~2.1.0",
|
||||
"bib2json": "git://github.com/galaxyproject/bib2json#galaxy",
|
||||
"jquery-form": "~3.46.0",
|
||||
"jquery-autocomplete": "git://github.com/dyve/jquery-autocomplete",
|
||||
"select2": "~3.5.2",
|
||||
"jStorage": "~0.4.12",
|
||||
"jquery.cookie": "~1.4.1",
|
||||
"dynatree": "~1.2.5",
|
||||
"jquery-mousewheel": "~3.1.12",
|
||||
"wymeditor": "~1.0.0-rc.1",
|
||||
"jstree": "~3.0.9",
|
||||
"jquery-ui": "git://github.com/jquery/jquery-ui.git#~1.11.2",
|
||||
"jquery.complexify": "git://github.com/danpalmer/jquery.complexify.js.git#~0.5.1",
|
||||
"threedubmedia.jquery.event": "*",
|
||||
"jquery-migrate": "~1.4",
|
||||
"requirejs": "~2"
|
||||
},
|
||||
"resolutions": {
|
||||
"jquery": "~1.12"
|
||||
"threedubmedia.jquery.event": "*"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
var Ui = require( 'mvc/ui/ui-misc' ),
|
||||
historyOptionsMenu = require( 'mvc/history/options-menu' );
|
||||
historyOptionsMenu = require( 'mvc/history/options-menu' ),
|
||||
CurrentHistoryView = require( 'mvc/history/history-view-edit-current' ).CurrentHistoryView,
|
||||
_l = require( 'utils/localization' );
|
||||
|
||||
@@ -84,7 +84,7 @@ var HistoryPanel = Backbone.View.extend({
|
||||
].join('');
|
||||
},
|
||||
|
||||
toString : function() { return 'historyPanel' }
|
||||
toString : function() { return 'historyPanel'; }
|
||||
});
|
||||
|
||||
module.exports = HistoryPanel;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Vendored
-9554
File diff suppressed because it is too large
Load Diff
@@ -1,192 +0,0 @@
|
||||
/*
|
||||
http://github.com/danpalmer/jquery.complexify.js
|
||||
|
||||
This code is distributed under the WTFPL v2:
|
||||
*/
|
||||
(function ($) {
|
||||
|
||||
$.fn.extend({
|
||||
complexify: function(options, callback) {
|
||||
|
||||
var MIN_COMPLEXITY = 49; // 12 chars with Upper, Lower and Number
|
||||
var MAX_COMPLEXITY = 120; // 25 chars, all charsets
|
||||
var CHARSETS = [
|
||||
// Commonly Used
|
||||
////////////////////
|
||||
[0x0020, 0x0020], // Space
|
||||
[0x0030, 0x0039], // Numbers
|
||||
[0x0041, 0x005A], // Uppercase
|
||||
[0x0061, 0x007A], // Lowercase
|
||||
[0x0021, 0x002F], // Punctuation
|
||||
[0x003A, 0x0040], // Punctuation
|
||||
[0x005B, 0x0060], // Punctuation
|
||||
[0x007B, 0x007E], // Punctuation
|
||||
// Everything Else
|
||||
////////////////////
|
||||
[0x0080, 0x00FF], // Latin-1 Supplement
|
||||
[0x0100, 0x017F], // Latin Extended-A
|
||||
[0x0180, 0x024F], // Latin Extended-B
|
||||
[0x0250, 0x02AF], // IPA Extensions
|
||||
[0x02B0, 0x02FF], // Spacing Modifier Letters
|
||||
[0x0300, 0x036F], // Combining Diacritical Marks
|
||||
[0x0370, 0x03FF], // Greek
|
||||
[0x0400, 0x04FF], // Cyrillic
|
||||
[0x0530, 0x058F], // Armenian
|
||||
[0x0590, 0x05FF], // Hebrew
|
||||
[0x0600, 0x06FF], // Arabic
|
||||
[0x0700, 0x074F], // Syriac
|
||||
[0x0780, 0x07BF], // Thaana
|
||||
[0x0900, 0x097F], // Devanagari
|
||||
[0x0980, 0x09FF], // Bengali
|
||||
[0x0A00, 0x0A7F], // Gurmukhi
|
||||
[0x0A80, 0x0AFF], // Gujarati
|
||||
[0x0B00, 0x0B7F], // Oriya
|
||||
[0x0B80, 0x0BFF], // Tamil
|
||||
[0x0C00, 0x0C7F], // Telugu
|
||||
[0x0C80, 0x0CFF], // Kannada
|
||||
[0x0D00, 0x0D7F], // Malayalam
|
||||
[0x0D80, 0x0DFF], // Sinhala
|
||||
[0x0E00, 0x0E7F], // Thai
|
||||
[0x0E80, 0x0EFF], // Lao
|
||||
[0x0F00, 0x0FFF], // Tibetan
|
||||
[0x1000, 0x109F], // Myanmar
|
||||
[0x10A0, 0x10FF], // Georgian
|
||||
[0x1100, 0x11FF], // Hangul Jamo
|
||||
[0x1200, 0x137F], // Ethiopic
|
||||
[0x13A0, 0x13FF], // Cherokee
|
||||
[0x1400, 0x167F], // Unified Canadian Aboriginal Syllabics
|
||||
[0x1680, 0x169F], // Ogham
|
||||
[0x16A0, 0x16FF], // Runic
|
||||
[0x1780, 0x17FF], // Khmer
|
||||
[0x1800, 0x18AF], // Mongolian
|
||||
[0x1E00, 0x1EFF], // Latin Extended Additional
|
||||
[0x1F00, 0x1FFF], // Greek Extended
|
||||
[0x2000, 0x206F], // General Punctuation
|
||||
[0x2070, 0x209F], // Superscripts and Subscripts
|
||||
[0x20A0, 0x20CF], // Currency Symbols
|
||||
[0x20D0, 0x20FF], // Combining Marks for Symbols
|
||||
[0x2100, 0x214F], // Letterlike Symbols
|
||||
[0x2150, 0x218F], // Number Forms
|
||||
[0x2190, 0x21FF], // Arrows
|
||||
[0x2200, 0x22FF], // Mathematical Operators
|
||||
[0x2300, 0x23FF], // Miscellaneous Technical
|
||||
[0x2400, 0x243F], // Control Pictures
|
||||
[0x2440, 0x245F], // Optical Character Recognition
|
||||
[0x2460, 0x24FF], // Enclosed Alphanumerics
|
||||
[0x2500, 0x257F], // Box Drawing
|
||||
[0x2580, 0x259F], // Block Elements
|
||||
[0x25A0, 0x25FF], // Geometric Shapes
|
||||
[0x2600, 0x26FF], // Miscellaneous Symbols
|
||||
[0x2700, 0x27BF], // Dingbats
|
||||
[0x2800, 0x28FF], // Braille Patterns
|
||||
[0x2E80, 0x2EFF], // CJK Radicals Supplement
|
||||
[0x2F00, 0x2FDF], // Kangxi Radicals
|
||||
[0x2FF0, 0x2FFF], // Ideographic Description Characters
|
||||
[0x3000, 0x303F], // CJK Symbols and Punctuation
|
||||
[0x3040, 0x309F], // Hiragana
|
||||
[0x30A0, 0x30FF], // Katakana
|
||||
[0x3100, 0x312F], // Bopomofo
|
||||
[0x3130, 0x318F], // Hangul Compatibility Jamo
|
||||
[0x3190, 0x319F], // Kanbun
|
||||
[0x31A0, 0x31BF], // Bopomofo Extended
|
||||
[0x3200, 0x32FF], // Enclosed CJK Letters and Months
|
||||
[0x3300, 0x33FF], // CJK Compatibility
|
||||
[0x3400, 0x4DB5], // CJK Unified Ideographs Extension A
|
||||
[0x4E00, 0x9FFF], // CJK Unified Ideographs
|
||||
[0xA000, 0xA48F], // Yi Syllables
|
||||
[0xA490, 0xA4CF], // Yi Radicals
|
||||
[0xAC00, 0xD7A3], // Hangul Syllables
|
||||
[0xD800, 0xDB7F], // High Surrogates
|
||||
[0xDB80, 0xDBFF], // High Private Use Surrogates
|
||||
[0xDC00, 0xDFFF], // Low Surrogates
|
||||
[0xE000, 0xF8FF], // Private Use
|
||||
[0xF900, 0xFAFF], // CJK Compatibility Ideographs
|
||||
[0xFB00, 0xFB4F], // Alphabetic Presentation Forms
|
||||
[0xFB50, 0xFDFF], // Arabic Presentation Forms-A
|
||||
[0xFE20, 0xFE2F], // Combining Half Marks
|
||||
[0xFE30, 0xFE4F], // CJK Compatibility Forms
|
||||
[0xFE50, 0xFE6F], // Small Form Variants
|
||||
[0xFE70, 0xFEFE], // Arabic Presentation Forms-B
|
||||
[0xFEFF, 0xFEFF], // Specials
|
||||
[0xFF00, 0xFFEF], // Halfwidth and Fullwidth Forms
|
||||
[0xFFF0, 0xFFFD] // Specials
|
||||
];
|
||||
|
||||
var defaults = {
|
||||
minimumChars: 8,
|
||||
strengthScaleFactor: 1,
|
||||
bannedPasswords: window.COMPLEXIFY_BANLIST || [],
|
||||
banMode: 'strict' // (strict|loose)
|
||||
};
|
||||
|
||||
if($.isFunction(options) && !callback) {
|
||||
callback = options;
|
||||
options = {};
|
||||
}
|
||||
|
||||
options = $.extend(defaults, options);
|
||||
|
||||
function additionalComplexityForCharset(str, charset) {
|
||||
for (var i = str.length - 1; i >= 0; i--) {
|
||||
if (charset[0] <= str.charCodeAt(i) && str.charCodeAt(i) <= charset[1]) {
|
||||
return charset[1] - charset[0] + 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
function inBanlist(str) {
|
||||
if (options.banMode === 'strict') {
|
||||
for (var i = 0; i < options.bannedPasswords.length; i++) {
|
||||
if (str.toLowerCase().indexOf(options.bannedPasswords[i].toLowerCase()) !== -1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
return $.inArray(str, options.bannedPasswords) > -1 ? true : false;
|
||||
}
|
||||
}
|
||||
|
||||
function evaluateSecurity() {
|
||||
var password = $(this).val();
|
||||
var complexity = 0, valid = false;
|
||||
|
||||
// Reset complexity to 0 when banned password is found
|
||||
if (!inBanlist(password)) {
|
||||
|
||||
// Add character complexity
|
||||
for (var i = CHARSETS.length - 1; i >= 0; i--) {
|
||||
complexity += additionalComplexityForCharset(password, CHARSETS[i]);
|
||||
}
|
||||
|
||||
} else {
|
||||
complexity = 1;
|
||||
}
|
||||
|
||||
// Use natural log to produce linear scale
|
||||
complexity = Math.log(Math.pow(complexity, password.length)) * (1/options.strengthScaleFactor);
|
||||
|
||||
valid = (complexity > MIN_COMPLEXITY && password.length >= options.minimumChars);
|
||||
|
||||
// Scale to percentage, so it can be used for a progress bar
|
||||
complexity = (complexity / MAX_COMPLEXITY) * 100;
|
||||
complexity = (complexity > 100) ? 100 : complexity;
|
||||
|
||||
callback.call(this, valid, complexity);
|
||||
}
|
||||
|
||||
this.each(function () {
|
||||
if($(this).val()) {
|
||||
evaluateSecurity.apply(this);
|
||||
}
|
||||
});
|
||||
|
||||
return this.each(function () {
|
||||
$(this).bind('keyup focus input propertychange mouseup', evaluateSecurity);
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
@@ -1,97 +0,0 @@
|
||||
/**
|
||||
* Cookie plugin
|
||||
*
|
||||
* Copyright (c) 2006 Klaus Hartl (stilbuero.de)
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a cookie with the given name and value and other optional parameters.
|
||||
*
|
||||
* @example $.cookie('the_cookie', 'the_value');
|
||||
* @desc Set the value of a cookie.
|
||||
* @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
|
||||
* @desc Create a cookie with all available options.
|
||||
* @example $.cookie('the_cookie', 'the_value');
|
||||
* @desc Create a session cookie.
|
||||
* @example $.cookie('the_cookie', null);
|
||||
* @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
|
||||
* used when the cookie was set.
|
||||
*
|
||||
* @param String name The name of the cookie.
|
||||
* @param String value The value of the cookie.
|
||||
* @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
|
||||
* @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
|
||||
* If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
|
||||
* If set to null or omitted, the cookie will be a session cookie and will not be retained
|
||||
* when the the browser exits.
|
||||
* @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
|
||||
* @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
|
||||
* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
|
||||
* require a secure protocol (like HTTPS).
|
||||
* @type undefined
|
||||
*
|
||||
* @name $.cookie
|
||||
* @cat Plugins/Cookie
|
||||
* @author Klaus Hartl/klaus.hartl@stilbuero.de
|
||||
*/
|
||||
|
||||
/**
|
||||
* Get the value of a cookie with the given name.
|
||||
*
|
||||
* @example $.cookie('the_cookie');
|
||||
* @desc Get the value of a cookie.
|
||||
*
|
||||
* @param String name The name of the cookie.
|
||||
* @return The value of the cookie.
|
||||
* @type String
|
||||
*
|
||||
* @name $.cookie
|
||||
* @cat Plugins/Cookie
|
||||
* @author Klaus Hartl/klaus.hartl@stilbuero.de
|
||||
*/
|
||||
jQuery.cookie = function(name, value, options) {
|
||||
if (typeof value != 'undefined') { // name and value given, set cookie
|
||||
options = options || {};
|
||||
if (value === null) {
|
||||
value = '';
|
||||
options = $.extend({}, options); // clone object since it's unexpected behavior if the expired property were changed
|
||||
options.expires = -1;
|
||||
}
|
||||
var expires = '';
|
||||
if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
|
||||
var date;
|
||||
if (typeof options.expires == 'number') {
|
||||
date = new Date();
|
||||
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
|
||||
} else {
|
||||
date = options.expires;
|
||||
}
|
||||
expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
|
||||
}
|
||||
// NOTE Needed to parenthesize options.path and options.domain
|
||||
// in the following expressions, otherwise they evaluate to undefined
|
||||
// in the packed version for some reason...
|
||||
var path = options.path ? '; path=' + (options.path) : '';
|
||||
var domain = options.domain ? '; domain=' + (options.domain) : '';
|
||||
var secure = options.secure ? '; secure' : '';
|
||||
document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
|
||||
} else { // only name given, get cookie
|
||||
var cookieValue = null;
|
||||
if (document.cookie && document.cookie != '') {
|
||||
var cookies = document.cookie.split(';');
|
||||
for (var i = 0; i < cookies.length; i++) {
|
||||
var cookie = jQuery.trim(cookies[i]);
|
||||
// Does this cookie string begin with the name we want?
|
||||
if (cookie.substring(0, name.length + 1) == (name + '=')) {
|
||||
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return cookieValue;
|
||||
}
|
||||
};
|
||||
-11008
File diff suppressed because it is too large
Load Diff
@@ -1,717 +0,0 @@
|
||||
/*!
|
||||
* jQuery Migrate - v1.4.0 - 2016-02-26
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
*/
|
||||
(function( jQuery, window, undefined ) {
|
||||
// See http://bugs.jquery.com/ticket/13335
|
||||
// "use strict";
|
||||
|
||||
|
||||
jQuery.migrateVersion = "1.4.0";
|
||||
|
||||
|
||||
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 ( window.console && window.console.log ) {
|
||||
window.console.log( "JQMIGRATE: Migrate is installed" +
|
||||
( jQuery.migrateMute ? "" : " with logging active" ) +
|
||||
", version " + jQuery.migrateVersion );
|
||||
}
|
||||
|
||||
// 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 + "') might 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,
|
||||
rspaceAngle = /^\s*</,
|
||||
rattrHash = /\[\s*\w+\s*[~|^$*]?=\s*(?![\s'"])[^#\]]*#/,
|
||||
// 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, ret;
|
||||
|
||||
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 ( !rspaceAngle.test( selector ) ) {
|
||||
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 && context.ownerDocument ||
|
||||
context || document, true ), context, rootjQuery );
|
||||
}
|
||||
}
|
||||
|
||||
if ( selector === "#" ) {
|
||||
|
||||
// jQuery( "#" ) is a bogus ID selector, but it returned an empty set before jQuery 3.0
|
||||
migrateWarn( "jQuery( '#' ) is not a valid selector" );
|
||||
selector = [];
|
||||
|
||||
} else if ( rattrHash.test( selector ) ) {
|
||||
|
||||
// The nonstandard and undocumented unquoted-hash was removed in jQuery 1.12.0
|
||||
// Note that this doesn't actually fix the selector due to potential false positives
|
||||
migrateWarn( "Attribute selectors with '#' must be quoted: '" + selector + "'" );
|
||||
}
|
||||
|
||||
ret = oldInit.apply( this, arguments );
|
||||
|
||||
// Fill in selector and context properties so .live() works
|
||||
if ( selector && selector.selector !== undefined ) {
|
||||
// A jQuery object, copy its properties
|
||||
ret.selector = selector.selector;
|
||||
ret.context = selector.context;
|
||||
|
||||
} else {
|
||||
ret.selector = typeof selector === "string" ? selector : "";
|
||||
if ( selector ) {
|
||||
ret.context = selector.nodeType? selector : context || document;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
};
|
||||
jQuery.fn.init.prototype = jQuery.fn;
|
||||
|
||||
// Let $.parseJSON(falsy_value) return null
|
||||
jQuery.parseJSON = function( json ) {
|
||||
if ( !json ) {
|
||||
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.boxModel deprecated in 1.3, jQuery.support.boxModel deprecated in 1.7
|
||||
jQuery.boxModel = jQuery.support.boxModel = (document.compatMode === "CSS1Compat");
|
||||
migrateWarnProp( jQuery, "boxModel", jQuery.boxModel, "jQuery.boxModel is deprecated" );
|
||||
migrateWarnProp( jQuery.support, "boxModel", jQuery.support.boxModel, "jQuery.support.boxModel 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 ) {
|
||||
var instance = jQuery.fn.init.call( this, selector, context, rootjQuerySub );
|
||||
return instance instanceof jQuerySub ?
|
||||
instance :
|
||||
jQuerySub( instance );
|
||||
};
|
||||
jQuerySub.fn.init.prototype = jQuerySub.fn;
|
||||
var rootjQuerySub = jQuerySub(document);
|
||||
migrateWarn( "jQuery.sub() is deprecated" );
|
||||
return jQuerySub;
|
||||
};
|
||||
|
||||
// The number of elements contained in the matched element set
|
||||
jQuery.fn.size = function() {
|
||||
migrateWarn( "jQuery.fn.size() is deprecated; use the .length property" );
|
||||
return this.length;
|
||||
};
|
||||
|
||||
|
||||
var internalSwapCall = false;
|
||||
|
||||
// If this version of jQuery has .swap(), don't false-alarm on internal uses
|
||||
if ( jQuery.swap ) {
|
||||
jQuery.each( [ "height", "width", "reliableMarginRight" ], function( _, name ) {
|
||||
var oldHook = jQuery.cssHooks[ name ] && jQuery.cssHooks[ name ].get;
|
||||
|
||||
if ( oldHook ) {
|
||||
jQuery.cssHooks[ name ].get = function() {
|
||||
var ret;
|
||||
|
||||
internalSwapCall = true;
|
||||
ret = oldHook.apply( this, arguments );
|
||||
internalSwapCall = false;
|
||||
return ret;
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
jQuery.swap = function( elem, options, callback, args ) {
|
||||
var ret, name,
|
||||
old = {};
|
||||
|
||||
if ( !internalSwapCall ) {
|
||||
migrateWarn( "jQuery.swap() is undocumented and deprecated" );
|
||||
}
|
||||
|
||||
// Remember the old values, and insert the new ones
|
||||
for ( name in options ) {
|
||||
old[ name ] = elem.style[ name ];
|
||||
elem.style[ name ] = options[ name ];
|
||||
}
|
||||
|
||||
ret = callback.apply( elem, args || [] );
|
||||
|
||||
// Revert the old values
|
||||
for ( name in options ) {
|
||||
elem.style[ name ] = old[ name ];
|
||||
}
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
||||
|
||||
// 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;
|
||||
|
||||
// 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,
|
||||
oldLoad = jQuery.fn.load,
|
||||
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.each( [ "load", "unload", "error" ], function( _, name ) {
|
||||
|
||||
jQuery.fn[ name ] = function() {
|
||||
var args = Array.prototype.slice.call( arguments, 0 );
|
||||
|
||||
// If this is an ajax load() the first arg should be the string URL;
|
||||
// technically this could also be the "Anything" arg of the event .load()
|
||||
// which just goes to show why this dumb signature has been deprecated!
|
||||
// jQuery custom builds that exclude the Ajax module justifiably die here.
|
||||
if ( name === "load" && typeof args[ 0 ] === "string" ) {
|
||||
return oldLoad.apply( this, args );
|
||||
}
|
||||
|
||||
migrateWarn( "jQuery.fn." + name + "() is deprecated" );
|
||||
|
||||
args.splice( 0, 0, name );
|
||||
if ( arguments.length ) {
|
||||
return this.bind.apply( this, args );
|
||||
}
|
||||
|
||||
// Use .triggerHandler here because:
|
||||
// - load and unload events don't need to bubble, only applied to window or image
|
||||
// - error event should not bubble to window, although it does pre-1.7
|
||||
// See http://bugs.jquery.com/ticket/11820
|
||||
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, Array.prototype.slice.call( arguments, 1 ), 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.event.special.ready = {
|
||||
setup: function() {
|
||||
if ( this === document ) {
|
||||
migrateWarn( "'ready' event is deprecated" );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack,
|
||||
oldFind = jQuery.fn.find;
|
||||
|
||||
jQuery.fn.andSelf = function() {
|
||||
migrateWarn("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()");
|
||||
return oldSelf.apply( this, arguments );
|
||||
};
|
||||
|
||||
jQuery.fn.find = function( selector ) {
|
||||
var ret = oldFind.apply( this, arguments );
|
||||
ret.context = this.context;
|
||||
ret.selector = this.selector ? this.selector + " " + selector : selector;
|
||||
return ret;
|
||||
};
|
||||
|
||||
|
||||
// jQuery 1.6 did not support Callbacks, do not warn there
|
||||
if ( jQuery.Callbacks ) {
|
||||
|
||||
var oldDeferred = jQuery.Deferred,
|
||||
tuples = [
|
||||
// action, add listener, callbacks, .then handlers, final state
|
||||
[ "resolve", "done", jQuery.Callbacks("once memory"),
|
||||
jQuery.Callbacks("once memory"), "resolved" ],
|
||||
[ "reject", "fail", jQuery.Callbacks("once memory"),
|
||||
jQuery.Callbacks("once memory"), "rejected" ],
|
||||
[ "notify", "progress", jQuery.Callbacks("memory"),
|
||||
jQuery.Callbacks("memory") ]
|
||||
];
|
||||
|
||||
jQuery.Deferred = function( func ) {
|
||||
var deferred = oldDeferred(),
|
||||
promise = deferred.promise();
|
||||
|
||||
deferred.pipe = promise.pipe = function( /* fnDone, fnFail, fnProgress */ ) {
|
||||
var fns = arguments;
|
||||
|
||||
migrateWarn( "deferred.pipe() is deprecated" );
|
||||
|
||||
return jQuery.Deferred(function( newDefer ) {
|
||||
jQuery.each( tuples, function( i, tuple ) {
|
||||
var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
|
||||
// deferred.done(function() { bind to newDefer or newDefer.resolve })
|
||||
// deferred.fail(function() { bind to newDefer or newDefer.reject })
|
||||
// deferred.progress(function() { bind to newDefer or newDefer.notify })
|
||||
deferred[ tuple[1] ](function() {
|
||||
var returned = fn && fn.apply( this, arguments );
|
||||
if ( returned && jQuery.isFunction( returned.promise ) ) {
|
||||
returned.promise()
|
||||
.done( newDefer.resolve )
|
||||
.fail( newDefer.reject )
|
||||
.progress( newDefer.notify );
|
||||
} else {
|
||||
newDefer[ tuple[ 0 ] + "With" ](
|
||||
this === promise ? newDefer.promise() : this,
|
||||
fn ? [ returned ] : arguments
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
fns = null;
|
||||
}).promise();
|
||||
|
||||
};
|
||||
|
||||
deferred.isResolved = function() {
|
||||
migrateWarn( "deferred.isResolved is deprecated" );
|
||||
return deferred.state() === "resolved";
|
||||
};
|
||||
|
||||
deferred.isRejected = function() {
|
||||
migrateWarn( "deferred.isRejected is deprecated" );
|
||||
return deferred.state() === "rejected";
|
||||
};
|
||||
|
||||
if ( func ) {
|
||||
func.call( deferred, deferred );
|
||||
}
|
||||
|
||||
return deferred;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
})( jQuery, window );
|
||||
@@ -1,125 +0,0 @@
|
||||
/*! Copyright (c) 2013 Brandon Aaron (http://brandonaaron.net)
|
||||
* Licensed under the MIT License (LICENSE.txt).
|
||||
*
|
||||
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
|
||||
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
|
||||
* Thanks to: Seamus Leahy for adding deltaX and deltaY
|
||||
*
|
||||
* Version: 3.1.3
|
||||
*
|
||||
* Requires: 1.2.2+
|
||||
*/
|
||||
|
||||
(function (factory) {
|
||||
// GALAXY HACK
|
||||
// (JG): Galaxy's mixing of a global jQuery and require modules doesn't work with
|
||||
// the logic below. Instead, do the right thing for this configuration without any checks.
|
||||
factory(jQuery);
|
||||
// END HACK
|
||||
|
||||
/*
|
||||
if ( typeof define === 'function' && define.amd ) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof exports === 'object') {
|
||||
// Node/CommonJS style for Browserify
|
||||
module.exports = factory;
|
||||
} else {
|
||||
// Browser globals
|
||||
factory(jQuery);
|
||||
}
|
||||
*/
|
||||
}(function ($) {
|
||||
|
||||
var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'];
|
||||
var toBind = 'onwheel' in document || document.documentMode >= 9 ? ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'];
|
||||
var lowestDelta, lowestDeltaXY;
|
||||
|
||||
if ( $.event.fixHooks ) {
|
||||
for ( var i = toFix.length; i; ) {
|
||||
$.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks;
|
||||
}
|
||||
}
|
||||
|
||||
$.event.special.mousewheel = {
|
||||
setup: function() {
|
||||
if ( this.addEventListener ) {
|
||||
for ( var i = toBind.length; i; ) {
|
||||
this.addEventListener( toBind[--i], handler, false );
|
||||
}
|
||||
} else {
|
||||
this.onmousewheel = handler;
|
||||
}
|
||||
},
|
||||
|
||||
teardown: function() {
|
||||
if ( this.removeEventListener ) {
|
||||
for ( var i = toBind.length; i; ) {
|
||||
this.removeEventListener( toBind[--i], handler, false );
|
||||
}
|
||||
} else {
|
||||
this.onmousewheel = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.extend({
|
||||
mousewheel: function(fn) {
|
||||
return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
|
||||
},
|
||||
|
||||
unmousewheel: function(fn) {
|
||||
return this.unbind("mousewheel", fn);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function handler(event) {
|
||||
var orgEvent = event || window.event,
|
||||
args = [].slice.call(arguments, 1),
|
||||
delta = 0,
|
||||
deltaX = 0,
|
||||
deltaY = 0,
|
||||
absDelta = 0,
|
||||
absDeltaXY = 0,
|
||||
fn;
|
||||
event = $.event.fix(orgEvent);
|
||||
event.type = "mousewheel";
|
||||
|
||||
// Old school scrollwheel delta
|
||||
if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta; }
|
||||
if ( orgEvent.detail ) { delta = orgEvent.detail * -1; }
|
||||
|
||||
// New school wheel delta (wheel event)
|
||||
if ( orgEvent.deltaY ) {
|
||||
deltaY = orgEvent.deltaY * -1;
|
||||
delta = deltaY;
|
||||
}
|
||||
if ( orgEvent.deltaX ) {
|
||||
deltaX = orgEvent.deltaX;
|
||||
delta = deltaX * -1;
|
||||
}
|
||||
|
||||
// Webkit
|
||||
if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY; }
|
||||
if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = orgEvent.wheelDeltaX * -1; }
|
||||
|
||||
// Look for lowest delta to normalize the delta values
|
||||
absDelta = Math.abs(delta);
|
||||
if ( !lowestDelta || absDelta < lowestDelta ) { lowestDelta = absDelta; }
|
||||
absDeltaXY = Math.max(Math.abs(deltaY), Math.abs(deltaX));
|
||||
if ( !lowestDeltaXY || absDeltaXY < lowestDeltaXY ) { lowestDeltaXY = absDeltaXY; }
|
||||
|
||||
// Get a whole value for the deltas
|
||||
fn = delta > 0 ? 'floor' : 'ceil';
|
||||
delta = Math[fn](delta / lowestDelta);
|
||||
deltaX = Math[fn](deltaX / lowestDeltaXY);
|
||||
deltaY = Math[fn](deltaY / lowestDeltaXY);
|
||||
|
||||
// Add event and delta to the front of the arguments
|
||||
args.unshift(event, delta, deltaX, deltaY);
|
||||
|
||||
return ($.event.dispatch || $.event.handle).apply(this, args);
|
||||
}
|
||||
|
||||
}));
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -8,6 +8,12 @@ define([
|
||||
// webpack will load via commonjs and plain requirejs will load as global. Check both
|
||||
parseBibtex = parseBibtex || window.BibtexParser;
|
||||
|
||||
_.extend(parseBibtex.ENTRY_TYPES_, {
|
||||
'online' : 998, // Galaxy MOD: Handle @online entries for preprints.
|
||||
'data' : 999 // Galaxy MOD: Handle @data citations coming from figshare.
|
||||
});
|
||||
|
||||
|
||||
var logNamespace = 'citation';
|
||||
//==============================================================================
|
||||
/** @class model for tool citations.
|
||||
@@ -94,4 +100,4 @@ return {
|
||||
};
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
@@ -99,10 +99,10 @@ var CollectionCreatorMixin = {
|
||||
|
||||
/** render the footer, completion controls, and cancel controls */
|
||||
_renderFooter : function( speed, callback ){
|
||||
var instance = this;
|
||||
var self = this;
|
||||
var $footer = this.$( '.footer' ).empty().html( this.templates.footer() );
|
||||
_.each( this.footerSettings, function( property, selector ) {
|
||||
this.$( selector ).prop( 'checked', instance[ property ] );
|
||||
self.$( selector ).prop( 'checked', self[ property ] );
|
||||
});
|
||||
if( typeof this.oncancel === 'function' ){
|
||||
this.$( '.cancel-create.btn' ).show();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
define([
|
||||
"utils/localization",
|
||||
"mvc/history/history-model",
|
||||
"mvc/history/history-view-edit",
|
||||
"mvc/history/copy-dialog",
|
||||
@@ -6,8 +7,8 @@ define([
|
||||
"mvc/base-mvc",
|
||||
"utils/ajax-queue",
|
||||
"ui/mode-button",
|
||||
"ui/search-input"
|
||||
], function( HISTORY_MODEL, HISTORY_VIEW_EDIT, historyCopyDialog, ERROR_MODAL, baseMVC, ajaxQueue ){
|
||||
"ui/search-input",
|
||||
], function( _l, HISTORY_MODEL, HISTORY_VIEW_EDIT, historyCopyDialog, ERROR_MODAL, baseMVC, ajaxQueue){
|
||||
'use strict';
|
||||
|
||||
var logNamespace = 'history';
|
||||
|
||||
@@ -99,23 +99,23 @@ define([ 'utils/utils', 'mvc/ui/ui-misc', 'mvc/ui/ui-modal', 'mvc/tool/tool-form
|
||||
var self = this;
|
||||
var options = form.model.attributes;
|
||||
// build execute button
|
||||
options.buttons = {
|
||||
execute: execute_btn = new Ui.Button({
|
||||
var execute_button = new Ui.Button({
|
||||
icon : 'fa-check',
|
||||
tooltip : 'Execute: ' + options.name + ' (' + options.version + ')',
|
||||
title : 'Execute',
|
||||
cls : 'btn btn-primary ui-clear-float',
|
||||
wait_cls : 'btn btn-info ui-clear-float',
|
||||
onclick : function() {
|
||||
execute_btn.wait();
|
||||
execute_button.wait();
|
||||
form.portlet.disable();
|
||||
self.submit( options, function() {
|
||||
execute_btn.unwait();
|
||||
execute_button.unwait();
|
||||
form.portlet.enable();
|
||||
} );
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
options.buttons = { execute: execute_button };
|
||||
|
||||
// remap feature
|
||||
if ( options.job_id && options.job_remap ) {
|
||||
options.inputs.push({
|
||||
@@ -265,4 +265,4 @@ define([ 'utils/utils', 'mvc/ui/ui-misc', 'mvc/ui/ui-modal', 'mvc/tool/tool-form
|
||||
return {
|
||||
View: View
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
+116
-112
@@ -1,123 +1,127 @@
|
||||
/**
|
||||
* This is the primary galaxy tours definition, currently only used for
|
||||
* rendering a tour menu.
|
||||
*
|
||||
* For now it's intended to be plunked into the center display a-la
|
||||
* Galaxy.app.display, but we could use a modal as well for more flexibility.
|
||||
*
|
||||
* DBTODO - This is downright backbone abuse, rewrite it.
|
||||
*/
|
||||
|
||||
define(['libs/bootstrap-tour'],function(BootstrapTour) {
|
||||
define(["libs/bootstrap-tour"], function(BootstrapTour) {
|
||||
var gxy_root = typeof Galaxy === "undefined" ? "/" : Galaxy.root;
|
||||
|
||||
var gxy_root = typeof Galaxy === "undefined" ? '/' : Galaxy.root;
|
||||
var tourpage_template = `<h2>Galaxy Tours</h2>
|
||||
<p>This page presents a list of interactive tours available on this Galaxy server.
|
||||
Select any tour to get started (and remember, you can click 'End Tour' at any time).</p>
|
||||
<ul>
|
||||
<% _.each(tours, function(tour) { %>
|
||||
<li>
|
||||
<a href="/tours/<%- tour.id %>" class="tourItem" data-tour.id=<%- tour.id %>>
|
||||
<%- tour.attributes.name || tour.id %>
|
||||
</a>
|
||||
- <%- tour.attributes.description || "No description given." %>
|
||||
</li>
|
||||
<% }); %>
|
||||
</ul>`;
|
||||
|
||||
var tour_opts = { storage: window.sessionStorage,
|
||||
onEnd: function(){
|
||||
sessionStorage.removeItem('activeGalaxyTour');
|
||||
},
|
||||
delay: 150, // Attempts to make it look natural
|
||||
orphan:true
|
||||
};
|
||||
var tour_opts = {
|
||||
storage: window.sessionStorage,
|
||||
onEnd: function() {
|
||||
sessionStorage.removeItem("activeGalaxyTour");
|
||||
},
|
||||
delay: 150, // Attempts to make it look natural
|
||||
orphan: true
|
||||
};
|
||||
|
||||
var hooked_tour_from_data = function(data){
|
||||
_.each(data.steps, function(step) {
|
||||
if (step.preclick){
|
||||
step.onShow= function(){
|
||||
_.each(step.preclick, function(preclick){
|
||||
// TODO: click delay between clicks
|
||||
$(preclick).click();
|
||||
});
|
||||
};
|
||||
}
|
||||
if (step.postclick){
|
||||
step.onNext = function(){
|
||||
_.each(step.postclick, function(postclick){
|
||||
// TODO: click delay between clicks
|
||||
$(postclick).click();
|
||||
});
|
||||
};
|
||||
}
|
||||
if (step.textinsert){
|
||||
// Have to manually trigger a change here, for some
|
||||
// elements which have additional logic, like the
|
||||
// upload input box
|
||||
step.onShown= function(){
|
||||
$(step.element).val(step.textinsert).trigger("change");
|
||||
};
|
||||
}
|
||||
var hooked_tour_from_data = function(data) {
|
||||
_.each(data.steps, function(step) {
|
||||
if (step.preclick) {
|
||||
step.onShow = function() {
|
||||
_.each(step.preclick, function(preclick) {
|
||||
// TODO: click delay between clicks
|
||||
$(preclick).click();
|
||||
});
|
||||
};
|
||||
}
|
||||
if (step.postclick) {
|
||||
step.onHide = function() {
|
||||
_.each(step.postclick, function(postclick) {
|
||||
// TODO: click delay between clicks
|
||||
$(postclick).click();
|
||||
});
|
||||
};
|
||||
}
|
||||
if (step.textinsert) {
|
||||
// Have to manually trigger a change here, for some
|
||||
// elements which have additional logic, like the
|
||||
// upload input box
|
||||
step.onShown = function() {
|
||||
$(step.element).val(step.textinsert).trigger("change");
|
||||
};
|
||||
}
|
||||
});
|
||||
return data;
|
||||
};
|
||||
|
||||
var TourItem = Backbone.Model.extend({
|
||||
urlRoot: gxy_root + "api/tours"
|
||||
});
|
||||
|
||||
var Tours = Backbone.Collection.extend({
|
||||
url: gxy_root + "api/tours",
|
||||
model: TourItem
|
||||
});
|
||||
|
||||
var giveTour = function(tour_id) {
|
||||
var url = gxy_root + "api/tours/" + tour_id;
|
||||
$.getJSON(url, function(data) {
|
||||
// Set hooks for additional click and data entry actions.
|
||||
var tourdata = hooked_tour_from_data(data);
|
||||
sessionStorage.setItem("activeGalaxyTour", JSON.stringify(data));
|
||||
// Store tour steps in sessionStorage to easily persist w/o hackery.
|
||||
var tour = new Tour(
|
||||
_.extend(
|
||||
{
|
||||
steps: tourdata.steps
|
||||
},
|
||||
tour_opts
|
||||
)
|
||||
);
|
||||
// Always clean restart, since this is a new, explicit giveTour execution.
|
||||
tour.init();
|
||||
tour.goTo(0);
|
||||
tour.restart();
|
||||
});
|
||||
};
|
||||
var ToursView = Backbone.View.extend({
|
||||
title: "Tours",
|
||||
// initialize
|
||||
initialize: function() {
|
||||
var self = this;
|
||||
this.setElement("<div/>");
|
||||
this.model = new Tours();
|
||||
this.model.fetch({
|
||||
success: function() {
|
||||
self.render();
|
||||
},
|
||||
error: function(){
|
||||
// Do something.
|
||||
console.error("Failed to fetch tours.");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
render: function() {
|
||||
var tpl = _.template(tourpage_template);
|
||||
this.$el
|
||||
.html(tpl({ tours: this.model.models }))
|
||||
.on("click", ".tourItem", function(e) {
|
||||
e.preventDefault();
|
||||
giveTour($(this).data("tour.id"));
|
||||
});
|
||||
return data;
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
var TourItem = Backbone.Model.extend({
|
||||
urlRoot: gxy_root + 'api/tours',
|
||||
});
|
||||
|
||||
var Tours = Backbone.Collection.extend({
|
||||
url: gxy_root + 'api/tours',
|
||||
model: TourItem,
|
||||
});
|
||||
|
||||
|
||||
var giveTour = function(tour_id){
|
||||
var url = gxy_root + 'api/tours/' + tour_id;
|
||||
$.getJSON( url, function( data ) {
|
||||
// Set hooks for additional click and data entry actions.
|
||||
var tourdata = hooked_tour_from_data(data);
|
||||
sessionStorage.setItem('activeGalaxyTour', JSON.stringify(data));
|
||||
// Store tour steps in sessionStorage to easily persist w/o hackery.
|
||||
var tour = new Tour(_.extend({
|
||||
steps: tourdata.steps,
|
||||
}, tour_opts));
|
||||
// Always clean restart, since this is a new, explicit giveTour execution.
|
||||
tour.init();
|
||||
tour.goTo(0);
|
||||
tour.restart();
|
||||
});
|
||||
};
|
||||
var ToursView = Backbone.View.extend({
|
||||
title: "Tours",
|
||||
// initialize
|
||||
initialize: function() {
|
||||
var self = this;
|
||||
this.setElement('<div/>');
|
||||
this.model = new Tours();
|
||||
this.model.fetch({
|
||||
success: function(){
|
||||
self.render();
|
||||
},
|
||||
error: function(){
|
||||
// Do something.
|
||||
console.error("Failed to fetch tours.");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
render: function(){
|
||||
var tpl = _.template([
|
||||
"<h2>Galaxy Tours</h2>",
|
||||
"<p>This page presents a list of interactive tours available on this Galaxy server. ",
|
||||
"Select any tour to get started (and remember, you can click 'End Tour' at any time).</p>",
|
||||
"<ul>",
|
||||
'<% _.each(tours, function(tour) { %>',
|
||||
'<li>',
|
||||
'<a href="/tours/<%- tour.id %>" class="tourItem" data-tour.id=<%- tour.id %>>',
|
||||
'<%- tour.attributes.name || tour.id %>',
|
||||
'</a>',
|
||||
' - <%- tour.attributes.description || "No description given." %>',
|
||||
'</li>',
|
||||
'<% }); %>',
|
||||
"</ul>"].join(''));
|
||||
this.$el.html(tpl({tours: this.model.models})).on("click", ".tourItem", function(e){
|
||||
e.preventDefault();
|
||||
giveTour($(this).data("tour.id"));
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return {ToursView: ToursView,
|
||||
hooked_tour_from_data: hooked_tour_from_data,
|
||||
tour_opts: tour_opts,
|
||||
giveTour: giveTour};
|
||||
return {
|
||||
ToursView: ToursView,
|
||||
hooked_tour_from_data: hooked_tour_from_data,
|
||||
tour_opts: tour_opts,
|
||||
giveTour: giveTour
|
||||
};
|
||||
});
|
||||
|
||||
@@ -25,7 +25,9 @@ var View = Backbone.View.extend({
|
||||
this.options = _.defaults( options || {}, this.optionsDefault );
|
||||
$( this.options.container ).prepend( this.el );
|
||||
// optional render
|
||||
options && this.render();
|
||||
if (options){
|
||||
this.render();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -41,8 +43,8 @@ var View = Backbone.View.extend({
|
||||
this.$el.fadeIn( 'fast' );
|
||||
if ( this.options.closing_events ) {
|
||||
var self = this;
|
||||
$( document ).on( 'keyup.ui-modal', function( e ) { e.keyCode == 27 && self.hide( true ) });
|
||||
this.$backdrop.on( 'click', function() { self.hide( true ) } );
|
||||
$( document ).on( 'keyup.ui-modal', function( e ) { if (e.keyCode == 27){ self.hide( true ); }});
|
||||
this.$backdrop.on( 'click', function() { self.hide( true ); } );
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -53,7 +55,9 @@ var View = Backbone.View.extend({
|
||||
hide: function( canceled ) {
|
||||
this.visible = false;
|
||||
this.$el.fadeOut( 'fast' );
|
||||
this.options.closing_callback && this.options.closing_callback( canceled );
|
||||
if (this.options.closing_callback){
|
||||
this.options.closing_callback( canceled );
|
||||
}
|
||||
$( document ).off( 'keyup.ui-modal' );
|
||||
this.$backdrop.off( 'click' );
|
||||
},
|
||||
@@ -184,6 +188,6 @@ var View = Backbone.View.extend({
|
||||
|
||||
return {
|
||||
View : View
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
@@ -48,7 +48,7 @@ function( Utils, Modal, Tabs, UploadButton, UploadViewDefault, UploadViewComposi
|
||||
Utils.get({
|
||||
url : Galaxy.root + 'api/datatypes?extension_only=False',
|
||||
success : function( datatypes ) {
|
||||
for (var key in datatypes ) {
|
||||
for ( var key in datatypes ) {
|
||||
self.list_extensions.push({
|
||||
id : datatypes[ key ].extension,
|
||||
text : datatypes[ key ].extension,
|
||||
@@ -72,7 +72,7 @@ function( Utils, Modal, Tabs, UploadButton, UploadViewDefault, UploadViewComposi
|
||||
Utils.get({
|
||||
url : Galaxy.root + 'api/genomes',
|
||||
success : function( genomes ) {
|
||||
for (var key in genomes ) {
|
||||
for ( var key in genomes ) {
|
||||
self.list_genomes.push({
|
||||
id : genomes[ key ][ 1 ],
|
||||
text : genomes[ key ][ 0 ]
|
||||
|
||||
@@ -165,9 +165,8 @@ define( [ 'utils/utils', 'mvc/form/form-view', 'mvc/tool/tool-form-base' ], func
|
||||
}
|
||||
if ( input.payload ) {
|
||||
for ( var p_id in input.payload ) {
|
||||
var p = input.payload[ p_id ];
|
||||
input.payload[ input.name + '__' + p_id ] = p;
|
||||
delete p;
|
||||
input.payload[ input.name + '__' + p_id ] = input.payload[ p_id ];
|
||||
delete input.payload[ p_id ];
|
||||
}
|
||||
}
|
||||
var d = post_job_actions[ input.action + output_id ];
|
||||
|
||||
@@ -76,7 +76,7 @@ function( Connector, Toastr ) {
|
||||
this.has_changes = true;
|
||||
},
|
||||
remove_all : function() {
|
||||
wf = this;
|
||||
var wf = this;
|
||||
$.each( this.nodes, function ( k, v ) {
|
||||
v.destroy();
|
||||
wf.remove_node( v );
|
||||
@@ -102,7 +102,7 @@ function( Connector, Toastr ) {
|
||||
$.each(this.nodes, function (k, node ){
|
||||
if (node.type === 'tool'){
|
||||
var node_changed = false;
|
||||
if (node.post_job_actions == null){
|
||||
if (node.post_job_actions === null){
|
||||
node.post_job_actions = {};
|
||||
node_changed = true;
|
||||
}
|
||||
@@ -127,7 +127,7 @@ function( Connector, Toastr ) {
|
||||
action_type : "HideDatasetAction",
|
||||
output_name : ot.name,
|
||||
action_arguments : {}
|
||||
}
|
||||
};
|
||||
node.post_job_actions['HideDatasetAction'+ot.name] = null;
|
||||
node.post_job_actions['HideDatasetAction'+ot.name] = pja;
|
||||
}
|
||||
@@ -149,7 +149,7 @@ function( Connector, Toastr ) {
|
||||
input_connections[ t.name ] = null;
|
||||
// There should only be 0 or 1 connectors, so this is
|
||||
// really a sneaky if statement
|
||||
var cons = []
|
||||
var cons = [];
|
||||
$.each( t.connectors, function ( i, c ) {
|
||||
if ( c.handle1 ) {
|
||||
var con_dict = { id: c.handle1.node.id, output_name: c.handle1.name };
|
||||
@@ -169,7 +169,7 @@ function( Connector, Toastr ) {
|
||||
action_type : act.action_type,
|
||||
output_name : act.output_name,
|
||||
action_arguments : act.action_arguments
|
||||
}
|
||||
};
|
||||
post_job_actions[ act.action_type + act.output_name ] = null;
|
||||
post_job_actions[ act.action_type + act.output_name ] = pja;
|
||||
});
|
||||
@@ -343,11 +343,11 @@ function( Connector, Toastr ) {
|
||||
// Everything without a predecessor
|
||||
var level_parents = [];
|
||||
for ( var pred_k in n_pred ) {
|
||||
if ( n_pred[ pred_k ] == 0 ) {
|
||||
if ( n_pred[ pred_k ] === 0 ) {
|
||||
level_parents.push( pred_k );
|
||||
}
|
||||
}
|
||||
if ( level_parents.length == 0 ) {
|
||||
if ( level_parents.length === 0 ) {
|
||||
break;
|
||||
}
|
||||
node_ids_by_level.push( level_parents );
|
||||
@@ -367,7 +367,8 @@ function( Connector, Toastr ) {
|
||||
}
|
||||
// Layout each level
|
||||
var all_nodes = this.nodes;
|
||||
var h_pad = 80; v_pad = 30;
|
||||
var h_pad = 80;
|
||||
var v_pad = 30;
|
||||
var left = h_pad;
|
||||
$.each( node_ids_by_level, function( i, ids ) {
|
||||
// We keep nodes in the same order in a level to give the user
|
||||
|
||||
@@ -47,7 +47,7 @@ define([
|
||||
}
|
||||
}
|
||||
|
||||
add_node_icon = function($to_el, nodeType) {
|
||||
function add_node_icon($to_el, nodeType) {
|
||||
var iconStyle = WorkflowIcons[nodeType];
|
||||
if(iconStyle) {
|
||||
var $icon = $('<i class="icon fa"> </i>').addClass(iconStyle);
|
||||
|
||||
@@ -5,13 +5,29 @@ define(['libs/underscore', 'viz/trackster/util', 'utils/config'], function(_, ut
|
||||
*/
|
||||
var ConfigSetting = Backbone.Model.extend({
|
||||
|
||||
|
||||
initialize: function(options) {
|
||||
// Use key as id for now.
|
||||
var key = this.get('key');
|
||||
this.set('id', key);
|
||||
|
||||
// Set defaults based on key.
|
||||
var defaults = _.find(ConfigSetting.known_settings_defaults, function(s) { return s.key === key; });
|
||||
var defaults = _.find([
|
||||
{ key: 'name', label: 'Name', type: 'text', default_value: '' },
|
||||
{ key: 'color', label: 'Color', type: 'color', default_value: null },
|
||||
{ key: 'min_value', label: 'Min Value', type: 'float', default_value: null },
|
||||
{ key: 'max_value', label: 'Max Value', type: 'float', default_value: null },
|
||||
{ key: 'mode', type: 'string', default_value: this.mode, hidden: true },
|
||||
{ key: 'height', type: 'int', default_value: 32, hidden: true },
|
||||
{ key: 'pos_color', label: 'Positive Color', type: 'color', default_value: "#FF8C00" },
|
||||
{ key: 'neg_color', label: 'Negative Color', type: 'color', default_value: "#4169E1" },
|
||||
{ key: 'block_color', label: 'Block color', type: 'color', default_value: null },
|
||||
{ key: 'label_color', label: 'Label color', type: 'color', default_value: 'black' },
|
||||
{ key: 'show_insertions', label: 'Show insertions', type: 'bool', default_value: false },
|
||||
{ key: 'show_counts', label: 'Show summary counts', type: 'bool', default_value: true },
|
||||
{ key: 'reverse_strand_color', label: 'Antisense strand color', type: 'color', default_value: null },
|
||||
{ key: 'show_differences', label: 'Show differences only', type: 'bool', default_value: true }
|
||||
], function(s) { return s.key === key; });
|
||||
if (defaults) {
|
||||
this.set(_.extend({}, defaults, options));
|
||||
}
|
||||
@@ -45,26 +61,6 @@ var ConfigSetting = Backbone.Model.extend({
|
||||
|
||||
this.set({value: value}, options);
|
||||
}
|
||||
}, {
|
||||
// This is a master list of default settings for known settings.
|
||||
known_settings_defaults: [
|
||||
{ key: 'name', label: 'Name', type: 'text', default_value: '' },
|
||||
{ key: 'color', label: 'Color', type: 'color', default_value: null },
|
||||
{ key: 'min_value', label: 'Min Value', type: 'float', default_value: null },
|
||||
{ key: 'max_value', label: 'Max Value', type: 'float', default_value: null },
|
||||
{ key: 'mode', type: 'string', default_value: this.mode, hidden: true },
|
||||
{ key: 'height', type: 'int', default_value: 32, hidden: true },
|
||||
{ key: 'pos_color', label: 'Positive Color', type: 'color', default_value: "#FF8C00" },
|
||||
{ key: 'neg_color', label: 'Negative Color', type: 'color', default_value: "#4169E1" },
|
||||
{ key: 'block_color', label: 'Block color', type: 'color', default_value: null },
|
||||
{ key: 'label_color', label: 'Label color', type: 'color', default_value: 'black' },
|
||||
{ key: 'show_insertions', label: 'Show insertions', type: 'bool', default_value: false },
|
||||
{ key: 'show_counts', label: 'Show summary counts', type: 'bool', default_value: true },
|
||||
{ key: 'mode', type: 'string', default_value: this.mode, hidden: true },
|
||||
{ key: 'reverse_strand_color', label: 'Antisense strand color', type: 'color', default_value: null },
|
||||
{ key: 'show_differences', label: 'Show differences only', type: 'bool', default_value: true },
|
||||
{ key: 'mode', type: 'string', default_value: this.mode, hidden: true }
|
||||
]
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -309,4 +305,4 @@ return {
|
||||
ConfigSettingCollectionView: ConfigSettingCollectionView
|
||||
};
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
@@ -3350,12 +3350,12 @@ var CompositeTrack = function(view, container, obj_dict) {
|
||||
extend(CompositeTrack.prototype, TiledTrack.prototype, {
|
||||
display_modes: CONTINUOUS_DATA_MODES,
|
||||
|
||||
config_params: _.union( Drawable.prototype.config_params, [
|
||||
build_config_params: function(){ return _.union( Drawable.prototype.config_params, [
|
||||
{ key: 'min_value', label: 'Min Value', type: 'float', default_value: undefined },
|
||||
{ key: 'max_value', label: 'Max Value', type: 'float', default_value: undefined },
|
||||
{ key: 'mode', type: 'string', default_value: this.mode, hidden: true },
|
||||
{ key: 'height', type: 'int', default_value: 30, hidden: true }
|
||||
] ),
|
||||
] ) },
|
||||
|
||||
action_icons_def:
|
||||
[
|
||||
@@ -3551,9 +3551,9 @@ var ReferenceTrack = function (view) {
|
||||
this.hide_contents();
|
||||
};
|
||||
extend(ReferenceTrack.prototype, Drawable.prototype, TiledTrack.prototype, {
|
||||
config_params: _.union( Drawable.prototype.config_params, [
|
||||
build_config_params: function() { return _.union( Drawable.prototype.config_params, [
|
||||
{ key: 'height', type: 'int', default_value: 13, hidden: true }
|
||||
] ),
|
||||
] ) },
|
||||
|
||||
init: function() {
|
||||
this.data_manager.clear();
|
||||
@@ -3646,13 +3646,13 @@ var LineTrack = function (view, container, obj_dict) {
|
||||
extend(LineTrack.prototype, Drawable.prototype, TiledTrack.prototype, {
|
||||
display_modes: CONTINUOUS_DATA_MODES,
|
||||
|
||||
config_params: _.union( Drawable.prototype.config_params, [
|
||||
build_config_params: function() { return _.union( Drawable.prototype.config_params, [
|
||||
{ key: 'color', label: 'Color', type: 'color' },
|
||||
{ key: 'min_value', label: 'Min Value', type: 'float', default_value: undefined },
|
||||
{ key: 'max_value', label: 'Max Value', type: 'float', default_value: undefined },
|
||||
{ key: 'mode', type: 'string', default_value: this.mode, hidden: true },
|
||||
{ key: 'height', type: 'int', default_value: 30, hidden: true }
|
||||
] ),
|
||||
] ) },
|
||||
|
||||
config_onchange: function() {
|
||||
this.set_name(this.config.get_value('name'));
|
||||
@@ -3700,14 +3700,14 @@ var DiagonalHeatmapTrack = function (view, container, obj_dict) {
|
||||
extend(DiagonalHeatmapTrack.prototype, Drawable.prototype, TiledTrack.prototype, {
|
||||
display_modes: ["Heatmap"],
|
||||
|
||||
config_params: _.union( Drawable.prototype.config_params, [
|
||||
build_config_params: function(){ return _.union( Drawable.prototype.config_params, [
|
||||
{ key: 'pos_color', label: 'Positive Color', type: 'color', default_value: "#FF8C00" },
|
||||
{ key: 'neg_color', label: 'Negative Color', type: 'color', default_value: "#4169E1" },
|
||||
{ key: 'min_value', label: 'Min Value', type: 'int', default_value: undefined },
|
||||
{ key: 'max_value', label: 'Max Value', type: 'int', default_value: undefined },
|
||||
{ key: 'mode', type: 'string', default_value: this.mode, hidden: true },
|
||||
{ key: 'height', type: 'int', default_value: 500, hidden: true }
|
||||
] ),
|
||||
] )},
|
||||
|
||||
config_onchange: function() {
|
||||
this.set_name(this.config.get_value('name'));
|
||||
@@ -3756,7 +3756,7 @@ var FeatureTrack = function(view, container, obj_dict) {
|
||||
extend(FeatureTrack.prototype, Drawable.prototype, TiledTrack.prototype, {
|
||||
display_modes: ["Auto", "Coverage", "Dense", "Squish", "Pack"],
|
||||
|
||||
config_params: _.union( Drawable.prototype.config_params, [
|
||||
build_config_params: function(){ return _.union( Drawable.prototype.config_params, [
|
||||
{ key: 'block_color', label: 'Block color', type: 'color' },
|
||||
{ key: 'reverse_strand_color', label: 'Antisense strand color', type: 'color' },
|
||||
{ key: 'label_color', label: 'Label color', type: 'color', default_value: 'black' },
|
||||
@@ -3768,7 +3768,7 @@ extend(FeatureTrack.prototype, Drawable.prototype, TiledTrack.prototype, {
|
||||
options: [ { label: 'Line with arrows', value: 'fishbone' }, { label: 'Arcs', value: 'arcs' } ] },
|
||||
{ key: 'mode', type: 'string', default_value: this.mode, hidden: true },
|
||||
{ key: 'height', type: 'int', default_value: 0, hidden: true}
|
||||
] ),
|
||||
] )},
|
||||
|
||||
config_onchange: function() {
|
||||
this.set_name(this.config.get_value('name'));
|
||||
@@ -4105,14 +4105,14 @@ var VariantTrack = function(view, container, obj_dict) {
|
||||
extend(VariantTrack.prototype, Drawable.prototype, TiledTrack.prototype, {
|
||||
display_modes: ["Auto", "Coverage", "Dense", "Squish", "Pack"],
|
||||
|
||||
config_params: _.union( Drawable.prototype.config_params, [
|
||||
build_config_params: function(){ return _.union( Drawable.prototype.config_params, [
|
||||
{ key: 'color', label: 'Histogram color', type: 'color' },
|
||||
{ key: 'show_sample_data', label: 'Show sample data', type: 'bool', default_value: true },
|
||||
{ key: 'show_labels', label: 'Show summary and sample labels', type: 'bool', default_value: true },
|
||||
{ key: 'summary_height', label: 'Locus summary height', type: 'float', default_value: 20 },
|
||||
{ key: 'mode', type: 'string', default_value: this.mode, hidden: true },
|
||||
{ key: 'height', type: 'int', default_value: 0, hidden: true }
|
||||
] ),
|
||||
] ) },
|
||||
|
||||
config_onchange: function() {
|
||||
this.set_name(this.config.get_value('name'));
|
||||
@@ -4248,7 +4248,7 @@ var ReadTrack = function (view, container, obj_dict) {
|
||||
};
|
||||
|
||||
extend(ReadTrack.prototype, Drawable.prototype, TiledTrack.prototype, FeatureTrack.prototype, {
|
||||
config_params: _.union( Drawable.prototype.config_params, [
|
||||
build_config_params: function() { return _.union( Drawable.prototype.config_params, [
|
||||
{ key: 'block_color', label: 'Histogram color', type: 'color' },
|
||||
{ key: 'detail_block_color', label: 'Sense strand block color', type: 'color', 'default_value': '#AAAAAA' },
|
||||
{ key: 'reverse_strand_color', label: 'Antisense strand block color', type: 'color', 'default_value': '#DDDDDD' },
|
||||
@@ -4260,7 +4260,7 @@ extend(ReadTrack.prototype, Drawable.prototype, TiledTrack.prototype, FeatureTra
|
||||
{ key: 'min_value', label: 'Histogram minimum', type: 'float', default_value: undefined, help: 'clear value to set automatically' },
|
||||
{ key: 'max_value', label: 'Histogram maximum', type: 'float', default_value: undefined, help: 'clear value to set automatically' },
|
||||
{ key: 'height', type: 'int', default_value: 0, hidden: true}
|
||||
] ),
|
||||
] ) },
|
||||
|
||||
config_onchange: function() {
|
||||
this.set_name(this.config.get_value('name'));
|
||||
|
||||
@@ -10,27 +10,15 @@ module.exports = function( grunt ){
|
||||
|
||||
// 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': [ 'jquery-migrate.js', 'jquery/jquery.migrate.js' ],
|
||||
'ravenjs': [ 'dist/raven.js', 'raven.js' ],
|
||||
'underscore': [ 'underscore.js', 'underscore.js' ],
|
||||
'backbone': [ 'backbone.js', 'backbone.js' ],
|
||||
'requirejs': [ 'require.js', 'require.js' ],
|
||||
'd3': [ 'd3.js', 'd3.js' ],
|
||||
'bib2json': [ 'Parser.js', 'bibtex.js' ],
|
||||
|
||||
'farbtastic': [ 'src/farbtastic.js', 'farbtastic.js' ],
|
||||
'bootstrap-tour': [ 'build/js/bootstrap-tour.js', 'bootstrap-tour.js' ],
|
||||
'jquery.complexify': [ 'jquery.complexify.js', 'jquery.complexify.js' ],
|
||||
|
||||
// these need to be updated and tested
|
||||
//'jquery-form': [ 'jquery.form.js', 'jquery/jquery.form.js' ],
|
||||
//'jquery-autocomplete': [ 'src/jquery.autocomplete.js', 'jquery/jquery.autocomplete.js' ],
|
||||
//'select2': [ 'select2.js', 'jquery/select2.js' ],
|
||||
//'jStorage': [ 'jstorage.js', 'jquery/jstorage.js' ],
|
||||
//'jquery.cookie': [ '', 'jquery/jquery.cookie.js' ],
|
||||
//'dynatree': [ 'dist/jquery.dynatree.js', 'jquery/jquery.dynatree.js' ],
|
||||
//'jquery-mousewheel': [ 'jquery.mousewheel.js', 'jquery/jquery.mousewheel.js' ],
|
||||
//'jquery.event.drag-drop': [
|
||||
// [ 'event.drag/jquery.event.drag.js', 'jquery/jquery.event.drag.js' ],
|
||||
// [ 'event.drag/jquery.event.drop.js', 'jquery/jquery.event.drop.js' ]
|
||||
|
||||
@@ -85,7 +85,7 @@ module.exports = function( grunt ){
|
||||
watch: {
|
||||
// watch for changes in the src dir
|
||||
files: [ lessPath + '/**' ],
|
||||
tasks: ['check-modules', 'sprite', 'less-site-config', 'less', 'clean'],
|
||||
tasks: ['sprite', 'less-site-config', 'less', 'clean'],
|
||||
options: {
|
||||
spawn: false
|
||||
}
|
||||
@@ -104,5 +104,5 @@ module.exports = function( grunt ){
|
||||
});
|
||||
|
||||
grunt.registerTask( 'watch-style', [ 'watch' ] );
|
||||
grunt.registerTask( 'style', [ 'check-modules', 'sprite', 'less-site-config', 'less', 'clean' ] );
|
||||
grunt.registerTask( 'style', [ 'sprite', 'less-site-config', 'less', 'clean' ] );
|
||||
};
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
/**
|
||||
* Grunt task to bundle apps using webpack (see also ../webpack.config.js).
|
||||
*/
|
||||
module.exports = function( grunt ){
|
||||
"use strict";
|
||||
|
||||
var path = require( 'path' );
|
||||
|
||||
// there is a taskrunner specifically for this - but it's not straightforward
|
||||
// and duplicates some of the config/code in webpack.config,
|
||||
// https://github.com/webpack/grunt-webpack
|
||||
// http://webpack.github.io/docs/usage-with-grunt.html
|
||||
|
||||
// so we'll use grunt-exec and call the webpack cli instead (until CLI and runner are unified a bit more?)
|
||||
|
||||
grunt.loadNpmTasks( 'grunt-exec' );
|
||||
|
||||
function webpackCLI(){
|
||||
var args = Array.prototype.slice.call( arguments );
|
||||
args.unshift( path.join( __dirname, '../node_modules/webpack/bin/webpack.js' ) );
|
||||
return args.join( ' ' );
|
||||
}
|
||||
grunt.registerTask( 'webpack', function(){
|
||||
grunt.log.writeln( 'bundling webpack apps for production...' );
|
||||
grunt.config( 'exec.webpack-production.command', webpackCLI( '-p' ) );
|
||||
grunt.task.run( 'exec:webpack-production' );
|
||||
});
|
||||
grunt.registerTask( 'webpack-dev', function(){
|
||||
grunt.log.writeln( 'bundling webpack apps for development...' );
|
||||
grunt.config( 'exec.webpack-dev.command', webpackCLI( '-d' ) );
|
||||
grunt.task.run( 'exec:webpack-dev' );
|
||||
});
|
||||
grunt.registerTask( 'webpack-watch', function(){
|
||||
grunt.log.writeln( 'bundling webpack apps for development and watching for changes...' );
|
||||
grunt.config( 'exec.webpack-watch.command', webpackCLI( '-d', '--watch' ) );
|
||||
grunt.task.run( 'exec:webpack-watch' );
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,78 @@
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var del = require('del');
|
||||
var _ = require('underscore');
|
||||
|
||||
var gulp = require('gulp');
|
||||
var babel = require('gulp-babel');
|
||||
var sourcemaps = require('gulp-sourcemaps');
|
||||
var uglify = require('gulp-uglify');
|
||||
var cached = require('gulp-cached');
|
||||
|
||||
var paths = {
|
||||
node_modules: './node_modules',
|
||||
scripts: [
|
||||
'galaxy/scripts/**/*.js',
|
||||
'!galaxy/scripts/apps/**/*.js',
|
||||
'!galaxy/scripts/libs/**/*.js'
|
||||
],
|
||||
lib_locs: {
|
||||
// This is a stepping stone towards having all this staged
|
||||
// automatically. Eventually, this dictionary and staging step will
|
||||
// not be necessary.
|
||||
'backbone': [ 'backbone.js', 'backbone.js' ],
|
||||
'd3': [ 'd3.js', 'd3.js' ],
|
||||
'bib2json': [ 'Parser.js', 'bibtex.js' ],
|
||||
'jquery': ['dist/jquery.js', 'jquery/jquery.js'],
|
||||
'jquery.complexify': [ 'jquery.complexify.js', 'jquery/jquery.complexify.js' ],
|
||||
'jquery.cookie': [ 'jquery.cookie.js', 'jquery/jquery.cookie.js' ],
|
||||
'jquery-migrate': [ 'dist/jquery-migrate.js', 'jquery/jquery.migrate.js' ],
|
||||
'jquery-mousewheel': [ 'jquery.mousewheel.js', 'jquery/jquery.mousewheel.js' ],
|
||||
'raven-js': ['dist/raven.js', 'raven.js'],
|
||||
'requirejs': [ 'require.js', 'require.js' ],
|
||||
'underscore': [ 'underscore.js', 'underscore.js' ],
|
||||
},
|
||||
libs: ['galaxy/scripts/libs/**/*.js']
|
||||
};
|
||||
|
||||
gulp.task('scripts', function() {
|
||||
return gulp.src(paths.scripts)
|
||||
.pipe(cached('scripts'))
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(babel())
|
||||
.pipe(uglify())
|
||||
.pipe(sourcemaps.write('../maps/'))
|
||||
.pipe(gulp.dest('../static/scripts/'));
|
||||
});
|
||||
|
||||
gulp.task('stage-libs', function(callback){
|
||||
_.each(_.keys(paths.lib_locs), function(lib){
|
||||
var p1 = path.resolve(path.join(paths.node_modules, lib, paths.lib_locs[lib][0]));
|
||||
var p2 = path.resolve(path.join('galaxy', 'scripts', 'libs', paths.lib_locs[lib][1]));
|
||||
if (fs.existsSync(p1)) {
|
||||
del.sync(p2);
|
||||
fs.createReadStream(p1).pipe(fs.createWriteStream(p2));
|
||||
} else {
|
||||
callback(p1 + " does not exist, yet it is a required library. This is an error. Check that the package in question exists in node_modules.");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task('libs', function() {
|
||||
return gulp.src(paths.libs)
|
||||
.pipe(uglify())
|
||||
.pipe(gulp.dest('../static/scripts/libs/'));
|
||||
});
|
||||
|
||||
gulp.task('clean', function(){
|
||||
//Wipe out all scripts that aren't handled by webpack
|
||||
return del(['../static/scripts/**/*.js',
|
||||
'!../static/scripts/bundled/**.*.js'],
|
||||
{force: true});
|
||||
});
|
||||
|
||||
gulp.task('watch', function(){
|
||||
gulp.watch(paths.scripts, ['scripts']);
|
||||
});
|
||||
|
||||
gulp.task('default', ['scripts', 'libs']);
|
||||
Generated
-6232
File diff suppressed because it is too large
Load Diff
+41
-6
@@ -11,12 +11,42 @@
|
||||
},
|
||||
"license": "AFL-3.0",
|
||||
"dependencies": {
|
||||
"amdi18n-loader": "^0.2.0",
|
||||
"amdi18n-loader": "^0.6.1",
|
||||
"backbone": "1.3",
|
||||
"bib2json": "^0.0.1",
|
||||
"d3": "3",
|
||||
"jquery": "2",
|
||||
"jquery-migrate": "~1.4",
|
||||
"jquery-mousewheel": "^3.1.13",
|
||||
"jquery.complexify": "^0.5.2",
|
||||
"jquery.cookie": "^1.4.1",
|
||||
"raven-js": "^3.17.0",
|
||||
"requirejs": "2",
|
||||
"underscore": "^1.8.3"
|
||||
},
|
||||
"scripts": {
|
||||
"watch": "gulp stage-libs && concurrently \"yarn run webpack-watch\" \"yarn run gulp watch\" \"yarn run style-watch\"",
|
||||
"build": "gulp stage-libs && concurrently \"yarn run style\" \"yarn run webpack\" \"yarn run gulp clean && yarn run gulp\"",
|
||||
"webpack": "webpack -p",
|
||||
"webpack-watch": "webpack -p --watch",
|
||||
"webpack-dev": "webpack -d",
|
||||
"webpack-dev-watch": "webpack -d --watch",
|
||||
"style": "grunt style",
|
||||
"style-watch": "grunt watch-style",
|
||||
"gulp": "gulp",
|
||||
"build-toolshed": "grunt --app=toolshed",
|
||||
"jshint": "jshint --exclude='galaxy/scripts/libs/**' galaxy/scripts/**/*.js",
|
||||
"build-charts": "webpack -p --config ../config/plugins/visualizations/charts/webpack.config.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-core": "^6.24.0",
|
||||
"babel-loader": "^6.4.1",
|
||||
"babel-loader": "^7.1.1",
|
||||
"babel-preset-env": "^1.3.2",
|
||||
"concurrently": "^3.4.0",
|
||||
"del": "^3.0.0",
|
||||
"expose-loader": "^0.7.3",
|
||||
"grunt": "^0.4.5",
|
||||
"grunt-bower-install-simple": "^1.1.0",
|
||||
"grunt-check-modules": "^1.0.0",
|
||||
"grunt-cli": "^0.1.13",
|
||||
"grunt-contrib-clean": "^0.6.0",
|
||||
"grunt-contrib-copy": "^0.5.0",
|
||||
@@ -25,8 +55,13 @@
|
||||
"grunt-contrib-watch": "^0.6.1",
|
||||
"grunt-exec": "^0.4.6",
|
||||
"grunt-spritesmith": "^4.7.1",
|
||||
"i18n-webpack-plugin": "^0.2.7",
|
||||
"webpack": "^1.10.1",
|
||||
"webpack-dev-server": "^1.7.0"
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-babel": "^7.0.0",
|
||||
"gulp-cached": "^1.1.1",
|
||||
"gulp-sourcemaps": "^2.5.1",
|
||||
"gulp-uglify": "^3.0.0",
|
||||
"gulp-watch": "^4.3.11",
|
||||
"jshint": "^2.9.4",
|
||||
"webpack": "^3.6.0"
|
||||
}
|
||||
}
|
||||
|
||||
+85
-65
@@ -1,85 +1,105 @@
|
||||
var webpack = require( 'webpack' ),
|
||||
// paths
|
||||
path = require( 'path' ),
|
||||
scriptsBase = path.join( __dirname, 'galaxy/scripts' ),
|
||||
libsBase = path.join( scriptsBase, 'libs' ),
|
||||
var webpack = require("webpack");
|
||||
|
||||
// libraries used on almost every page
|
||||
// TODO: reduce
|
||||
commonLibs = [
|
||||
'polyfills',
|
||||
// jquery et al
|
||||
'jquery',
|
||||
'libs/jquery/jquery.migrate',
|
||||
// jquery plugins
|
||||
'libs/jquery/select2',
|
||||
'libs/jquery/jquery.event.hover',
|
||||
'libs/jquery/jquery.form',
|
||||
'libs/jquery/jquery.rating',
|
||||
'libs/jquery.sparklines',
|
||||
'libs/jquery/jquery-ui',
|
||||
'libs/bootstrap',
|
||||
'libs/bootstrap-tour',
|
||||
'libs/jquery.complexify',
|
||||
'libs/jquery/jquery.autocomplete',
|
||||
// mvc
|
||||
'libs/underscore',
|
||||
'libs/backbone',
|
||||
// all pages get these
|
||||
'ui/autocom_tagging',
|
||||
'layout/modal',
|
||||
'layout/panel',
|
||||
'onload',
|
||||
];
|
||||
var path = require("path");
|
||||
var scriptsBase = path.join(__dirname, "galaxy/scripts");
|
||||
var libsBase = path.join(scriptsBase, "libs");
|
||||
|
||||
// libraries used on almost every page
|
||||
var commonLibs = [
|
||||
"polyfills",
|
||||
// jquery et al
|
||||
"jquery",
|
||||
"libs/jquery/jquery.migrate",
|
||||
// jquery plugins
|
||||
"libs/jquery/jquery.autocomplete",
|
||||
"libs/jquery/jquery.event.hover",
|
||||
"libs/jquery/jquery.event.drag",
|
||||
"libs/jquery/jquery.mousewheel",
|
||||
"libs/jquery/jquery.form",
|
||||
"libs/jquery/jquery.rating",
|
||||
"libs/jquery/select2",
|
||||
"libs/jquery.sparklines",
|
||||
"libs/jquery/jquery-ui",
|
||||
"libs/jquery/jstorage",
|
||||
"libs/jquery/jquery.complexify",
|
||||
"libs/farbtastic",
|
||||
"libs/bootstrap",
|
||||
"libs/bootstrap-tour",
|
||||
// mvc
|
||||
"libs/underscore",
|
||||
"libs/backbone",
|
||||
"libs/toastr",
|
||||
// all pages get these
|
||||
"ui/autocom_tagging",
|
||||
"layout/modal",
|
||||
"layout/panel",
|
||||
"onload"
|
||||
];
|
||||
|
||||
module.exports = {
|
||||
devtool : 'source-map',
|
||||
entry : {
|
||||
libs : commonLibs,
|
||||
login : './galaxy/scripts/apps/login.js',
|
||||
analysis: './galaxy/scripts/apps/analysis.js',
|
||||
admin : './galaxy/scripts/apps/admin.js',
|
||||
devtool: "source-map",
|
||||
entry: {
|
||||
libs: commonLibs,
|
||||
login: "./galaxy/scripts/apps/login.js",
|
||||
analysis: "./galaxy/scripts/apps/analysis.js",
|
||||
admin: "./galaxy/scripts/apps/admin.js"
|
||||
},
|
||||
output : {
|
||||
path : '../static/scripts/bundled',
|
||||
filename : '[name].bundled.js'
|
||||
output: {
|
||||
path: path.join(__dirname, "../", "static/scripts/bundled"),
|
||||
filename: "[name].bundled.js"
|
||||
},
|
||||
resolve : {
|
||||
root : scriptsBase,
|
||||
alias : {
|
||||
resolve: {
|
||||
modules: [scriptsBase],
|
||||
alias: {
|
||||
//TODO: correct our imports and remove these rules
|
||||
// Backbone looks for these in the same root directory
|
||||
jquery : path.join( libsBase, 'jquery/jquery' ),
|
||||
underscore : path.join( libsBase, 'underscore.js' ),
|
||||
jquery: path.join(libsBase, "jquery/jquery"),
|
||||
underscore: path.join(libsBase, "underscore.js")
|
||||
}
|
||||
},
|
||||
module : {
|
||||
loaders : [
|
||||
{ test: /\.js$/,
|
||||
exclude: /node_modules/,
|
||||
loader: 'babel-loader',
|
||||
query: { compact: false } },
|
||||
],
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: [/(node_modules|bower_components)/, libsBase],
|
||||
loader: "babel-loader"
|
||||
},
|
||||
{
|
||||
test: require.resolve("jquery"),
|
||||
use: [
|
||||
{
|
||||
loader: "expose-loader",
|
||||
options: "jQuery"
|
||||
},
|
||||
{
|
||||
loader: "expose-loader",
|
||||
options: "$"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
resolveLoader : {
|
||||
alias : {
|
||||
resolveLoader: {
|
||||
alias: {
|
||||
// since we support both requirejs i18n and non-requirejs and both use a similar syntax,
|
||||
// use an alias so we can just use one file
|
||||
i18n : 'amdi18n'
|
||||
i18n: "amdi18n-loader"
|
||||
}
|
||||
},
|
||||
plugins : [
|
||||
new webpack.optimize.CommonsChunkPlugin( 'libs', 'libs.bundled.js' ),
|
||||
plugins: [
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: "libs",
|
||||
filename: "libs.bundled.js"
|
||||
}),
|
||||
// this plugin allows using the following keys/globals in scripts (w/o req'ing them first)
|
||||
// and webpack will automagically require them in the bundle for you
|
||||
new webpack.ProvidePlugin({
|
||||
$: 'jquery',
|
||||
jQuery: 'jquery',
|
||||
'window.jQuery': 'jquery',
|
||||
_: "underscore",
|
||||
Backbone: 'libs/backbone',
|
||||
}),
|
||||
$: "jquery",
|
||||
jQuery: "jquery",
|
||||
"window.jQuery": "jquery",
|
||||
_: "underscore",
|
||||
Backbone: "libs/backbone"
|
||||
})
|
||||
// new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1 })
|
||||
],
|
||||
]
|
||||
};
|
||||
|
||||
+5118
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -42,6 +42,6 @@ module.exports = {
|
||||
libraryTarget : 'amd'
|
||||
},
|
||||
resolve : {
|
||||
root : root
|
||||
modules: [root]
|
||||
}
|
||||
};
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
{"version":3,"file":"router.js","sources":["../../src/layout/router.js"],"names":["jQuery","require","$","QUERY_STRING","Ui","Router","Backbone","extend","initialize","page","options","this","push","url","data","__identifer","Math","random","toString","substr","isEmptyObject","indexOf","param","Galaxy","params","navigate","trigger","execute","callback","args","name","debug","queryObj","parse","pop","authenticate","apply","access_denied","display","Message","status","message","persistent","module","exports"],"mappings":"AAAA,GAAIA,QAASC,QAAS,UAClBC,EAAIF,OACJG,aAAeF,QAAS,8BACxBG,GAAKH,QAAS,kBAEdI,OAASC,SAASD,OAAOE,QAGzBC,WAAa,SAAUC,EAAMC,GACzBC,KAAKF,KAAOA,EACZE,KAAKD,QAAUA,GAInBE,KAAM,SAAUC,EAAKC,GACjBA,EAAOA,MACPA,EAAKC,YAAcC,KAAKC,SAASC,SAAU,IAAKC,OAAQ,GAClDjB,EAAEkB,cAAeN,KACnBD,GAA6B,IAAtBA,EAAIQ,QAAS,KAAc,IAAM,IACxCR,GAAOX,EAAEoB,MAAOR,GAAO,IAE3BS,OAAOC,OAASV,EAChBH,KAAKc,SAAUZ,GAAOa,SAAW,KAIrCC,QAAS,SAAUC,EAAUC,EAAMC,GAC/BP,OAAOQ,MAAO,kBAAmBH,EAAUC,EAAMC,EACjD,IAAIE,GAAW7B,aAAa8B,MAAOJ,EAAKK,MACxCL,GAAKjB,KAAMoB,GACPJ,IACKjB,KAAKwB,aAAcN,EAAMC,GAC1BF,EAASQ,MAAOzB,KAAMkB,GAEtBlB,KAAK0B,kBAKjBF,aAAc,WACV,OAAO,GAGXE,cAAe,WACX1B,KAAKF,KAAK6B,QAAS,GAAIlC,IAAGmC,SAAWC,OAAQ,SAAUC,QAAS,sEAAuEC,YAAY,OAI3JC,QAAOC,QAAUvC"}
|
||||
{"version":3,"sources":["layout/router.js"],"names":["jQuery","require","$","Ui","Router","extend","initialize","page","options","this","push","url","data","__identifer","Math","toString","substr","random","isEmptyObject","param","navigate","trigger","execute","callback","args","name","Galaxy","debug","QUERY_STRING","queryObj","apply","authenticate","access_denied","display","Message","status","message","persistent","module","exports"],"mappings":"aAAA,IAAIA,OAASC,QAAS,UAClBC,EAAIF,OADJA,aAASC,QAAS,8BAClBC,GAAIF,QADR,kBAGIG,OAAKF,SAASG,OAAAC,QAGdC,WAAA,SAAAC,EAAAC,GACAC,KAAAF,KAAAA,EACAD,KAAAA,QAAaE,GAMbE,KAAM,SAAUC,EAAKC,IADrBA,EAAAA,OACMC,YAAAC,KAAeF,SAAOG,SAAA,IAAAC,OAAA,GACxBJ,EAAOA,cAAPA,KACAA,IAAiCG,GAA5BF,EAAAA,QAAmBI,KAASF,IAAd,IACdJ,GAAGO,EAAAA,MAAFN,GAAN,IAEID,OAAAA,OAASQ,EACZV,KAAAW,SAAAT,GAAAU,SAAA,KAMLC,QAAS,SAAUC,EAAUC,EAAMC,GADnCC,OAAAC,MAAA,kBAAAJ,EAAAC,EAAAC,GACAH,IAAAA,EAASM,aAAUL,MAAUC,EAAMC,OAC/BC,EAAAA,KAAOC,GACHE,IACJpB,KAAWoB,aAAXL,EAAAC,GACIF,EAAUO,MAAArB,KAAAe,GAEND,KAAAA,kBAKXQ,aAhC+B,SAAAP,EAAAC,GAmC5B,OAAO,GACVO,cApC+B,WAuC5BvB,KAAKF,KAAK0B,QAAS,IAAI9B,GAAG+B,SAAWC,OAAQ,SAAUC,QAAS,sEAAuEC,YAAY,QAvCvHC,OAApCC,QAAAnC","file":"../../scripts/layout/router.js","sourcesContent":["var jQuery = require( 'jquery' ),\n $ = jQuery,\n QUERY_STRING = require( 'utils/query-string-parsing' ),\n Ui = require( 'mvc/ui/ui-misc' );\n\nvar Router = Backbone.Router.extend({\n // TODO: not many client routes at this point - fill and remove from server.\n // since we're at root here, this may be the last to be routed entirely on the client.\n initialize : function( page, options ){\n this.page = page;\n this.options = options;\n },\n\n /** helper to push a new navigation state */\n push: function( url, data ) {\n data = data || {};\n data.__identifer = Math.random().toString( 36 ).substr( 2 );\n if ( !$.isEmptyObject( data ) ) {\n url += url.indexOf( '?' ) == -1 ? '?' : '&';\n url += $.param( data , true );\n }\n Galaxy.params = data;\n this.navigate( url, { 'trigger': true } );\n },\n\n /** override to parse query string into obj and send to each route */\n execute: function( callback, args, name ){\n Galaxy.debug( 'router execute:', callback, args, name );\n var queryObj = QUERY_STRING.parse( args.pop() );\n args.push( queryObj );\n if( callback ){\n if ( this.authenticate( args, name ) ) {\n callback.apply( this, args );\n } else {\n this.access_denied();\n }\n }\n },\n\n authenticate: function( args, name ) {\n return true;\n },\n\n access_denied: function() {\n this.page.display( new Ui.Message( { status: 'danger', message: 'You must be logged in with proper credentials to make this request.', persistent: true } ) );\n }\n});\n\nmodule.exports = Router"]}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
{"version":3,"file":"annotation.js","sources":["../../src/mvc/annotation.js"],"names":["define","baseMVC","_l","AnnotationEditor","Backbone","View","extend","LoggableMixin","HiddenUntilActivatedViewMixin","tagName","className","initialize","options","this","tooltipConfig","placement","listenTo","model","render","hiddenUntilActivated","$activator","view","$el","html","_template","$annotation","make_text_editable","use_textarea","on_finish","newAnnotation","text","save","annotation","silent","fail","previous","get","_","escape","join","find","remove","off","stopListening","prototype","call","toString"],"mappings":"AAAAA,QACI,eACA,qBACA,oBACD,SAAUC,EAASC,GAItB,GAAIC,GAAmBC,SAASC,KACvBC,OAAQL,EAAQM,eAChBD,OAAQL,EAAQO,+BAAgCF,QAErDG,QAAc,MACdC,UAAc,qBAGdC,WAAa,SAAUC,GACnBA,EAAUA,MACVC,KAAKC,cAAgBF,EAAQE,gBAAmBC,UAAW,UAG3DF,KAAKG,SAAUH,KAAKI,MAAO,oBAAqB,WAC5CJ,KAAKK,WAETL,KAAKM,qBAAsBP,EAAQQ,WAAYR,IAInDM,OAAS,WACL,GAAIG,GAAOR,IAcX,OAbAA,MAAKS,IAAIC,KAAMV,KAAKW,aAGpBX,KAAKY,cAAcC,oBACfC,cAAc,EACdC,UAAW,SAAUC,GACjBR,EAAKI,cAAcK,KAAMD,GACzBR,EAAKJ,MAAMc,MAAOC,WAAYH,IAAmBI,QAAQ,IACpDC,KAAM,WACHb,EAAKI,cAAcK,KAAMT,EAAKJ,MAAMkB,SAAU,oBAIvDtB,MAIXW,UAAY,WACR,GAAIQ,GAAanB,KAAKI,MAAMmB,IAAK,aACjC,QAEI,yBAA0BlC,EAAI,cAAgB,WAE9C,2BACImC,EAAEC,OAAQN,GACd,UACFO,KAAM,KAIZd,YAAc,WACV,MAAOZ,MAAKS,IAAIkB,KAAM,gBAI1BC,OAAS,WACL5B,KAAKY,YAAYiB,MACjB7B,KAAK8B,cAAe9B,KAAKI,OACzBb,SAASC,KAAKuC,UAAUH,OAAOI,KAAMhC,OAIzCiC,SAAW,WAAY,OAAS,oBAAqBjC,KAAKI,MAAQ,GAAI,KAAMsB,KAAK,MAGrF,QACIpC,iBAAmBA"}
|
||||
{"version":3,"sources":["mvc/annotation.js"],"names":["define","baseMVC","_l","AnnotationEditor","Backbone","View","className","LoggableMixin","extend","HiddenUntilActivatedViewMixin","initialize","options","listenTo","this","tooltipConfig","placement","model","render","$activator","view","$annotation","use_textarea","on_finish","newAnnotation","text","save","annotation","silent","fail","previous","_template","get","_","escape","join","$el","find","remove","off","stopListening","prototype","call","toString"],"mappings":"aAAAA,QACI,eADJA,qBAKA,oBACA,SAAAC,EAAAC,GAqEA,OACIC,iBAlE4DC,SAAAC,KAG5DC,OAAAA,EAAcC,eAHTC,OAAQP,EAAQQ,+BAAgCD,QAMrDE,QAAAA,MACIC,UAAAA,qBAGAD,WAAA,SAAAC,GACAA,EAAKC,MACDC,KAAAC,cAAAH,EAAAG,gBAAAC,UAAA,UAGPF,KAf2DD,SAAAC,KAAAG,MAAA,oBAAA,WAYpDH,KAAKI,WAMbA,KAAAA,qBAAmBN,EAAAO,WAAAP,IAIfM,OAAA,WACA,IAAAE,EAAKC,KAeL,OAdIC,KAAAA,IAAAA,KAAAA,KAAAA,aAGIF,KAAAA,cAAKH,oBAEGG,cAAAA,EACHG,UAHL,SAAAC,GAIHJ,EAAAC,cAAAI,KAAAD,GARLJ,EAAAH,MAAAS,MAAAC,WAAAH,IAAAI,QAAA,IAUOC,KAAP,WAjCwDT,EAAAC,cAAAI,KAAAL,EAAAH,MAAAa,SAAA,oBAsCxDhB,MAIIiB,UAAA,WACA,IAAAJ,EAAAb,KAAAG,MAAAe,IACIC,cAGX,OAED,yBAAA9B,EAAA,cAAA,WAEI,2BAnDwD8B,EAAAC,OAAAP,GA6CpD,UASRQ,KAAA,KAII9B,YAAAA,WACH,OA3D2DS,KAAAsB,IAAAC,KAAA,gBA8DrCC,OAAA,WAAgExB,KAAAO,YAAAkB,MAhE3FzB,KAAA0B,cAAA1B,KAAAG,OAkEAZ,SAAAC,KAAAmC,UAAAH,OAAAI,KAAA5B,OA1EA6B,SAAA,WAAA,OAAA,oBAAA7B,KAAAG,MAAA,GAAA,KAAAkB,KAAA","file":"../../scripts/mvc/annotation.js","sourcesContent":["define([\n \"mvc/base-mvc\",\n \"utils/localization\",\n \"ui/editable-text\",\n], function( baseMVC, _l ){\n// =============================================================================\n/** A view on any model that has a 'annotation' attribute\n */\nvar AnnotationEditor = Backbone.View\n .extend( baseMVC.LoggableMixin )\n .extend( baseMVC.HiddenUntilActivatedViewMixin ).extend({\n\n tagName : 'div',\n className : 'annotation-display',\n\n /** Set up listeners, parse options */\n initialize : function( options ){\n options = options || {};\n this.tooltipConfig = options.tooltipConfig || { placement: 'bottom' };\n //console.debug( this, options );\n // only listen to the model only for changes to annotations\n this.listenTo( this.model, 'change:annotation', function(){\n this.render();\n });\n this.hiddenUntilActivated( options.$activator, options );\n },\n\n /** Build the DOM elements, call select to on the created input, and set up behaviors */\n render : function(){\n var view = this;\n this.$el.html( this._template() );\n\n //TODO: handle empties better\n this.$annotation().make_text_editable({\n use_textarea: true,\n on_finish: function( newAnnotation ){\n view.$annotation().text( newAnnotation );\n view.model.save({ annotation: newAnnotation }, { silent: true })\n .fail( function(){\n view.$annotation().text( view.model.previous( 'annotation' ) );\n });\n }\n });\n return this;\n },\n\n /** @returns {String} the html text used to build the view's DOM */\n _template : function(){\n var annotation = this.model.get( 'annotation' );\n return [\n //TODO: make prompt optional\n '<label class=\"prompt\">', _l( 'Annotation' ), '</label>',\n // set up initial tags by adding as CSV to input vals (necc. to init select2)\n '<div class=\"annotation\">',\n _.escape( annotation ),\n '</div>'\n ].join( '' );\n },\n\n /** @returns {jQuery} the main element for this view */\n $annotation : function(){\n return this.$el.find( '.annotation' );\n },\n\n /** shut down event listeners and remove this view's DOM */\n remove : function(){\n this.$annotation.off();\n this.stopListening( this.model );\n Backbone.View.prototype.remove.call( this );\n },\n\n /** string rep */\n toString : function(){ return [ 'AnnotationEditor(', this.model + '', ')' ].join(''); }\n});\n// =============================================================================\nreturn {\n AnnotationEditor : AnnotationEditor\n};\n});\n"]}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user