Merge remote-tracking branch 'origin' into bitbucket.dataset-choice

This commit is contained in:
Carl Eberhard
2015-05-19 11:57:36 -04:00
164 changed files with 8414 additions and 3382 deletions
@@ -5,8 +5,9 @@ define(['utils/utils',
'mvc/ui/ui-misc',
'mvc/form/form-select-content',
'mvc/ui/ui-select-library',
'mvc/ui/ui-select-ftp',
'mvc/ui/ui-color-picker'],
function(Utils, Ui, SelectContent, SelectLibrary, ColorPicker) {
function(Utils, Ui, SelectContent, SelectLibrary, SelectFtp, ColorPicker) {
// create form view
return Backbone.Model.extend({
@@ -26,9 +27,10 @@ define(['utils/utils',
'hidden' : '_fieldHidden',
'hidden_data' : '_fieldHidden',
'baseurl' : '_fieldHidden',
'library_data' : '_fieldLibrary'
'library_data' : '_fieldLibrary',
'ftpfile' : '_fieldFtp'
},
// initialize
initialize: function(app, options) {
this.app = app;
@@ -53,7 +55,7 @@ define(['utils/utils',
if (fieldClass && typeof(this[fieldClass]) === 'function') {
field = this[fieldClass].call(this, input_def);
}
// identify field type
if (!field) {
// flag
@@ -172,7 +174,7 @@ define(['utils/utils',
}
});
},
/** Text input field
*/
_fieldText: function(input_def) {
@@ -272,6 +274,20 @@ define(['utils/utils',
self.app.trigger('change');
}
});
},
/** FTP file field
*/
_fieldFtp: function(input_def) {
var self = this;
return new SelectFtp.View({
id : 'field-' + input_def.id,
optional : input_def.optional,
multiple : input_def.multiple,
onchange : function() {
self.app.trigger('change');
}
});
}
});
@@ -285,6 +285,11 @@ define(['utils/utils',
}
});
// add expansion event handler
this.app.on('expand', function(input_id) {
(portlet.$el.find('#' + input_id).length > 0) && !visible && portlet.$header.trigger('click');
});
// show sub section if requested
if (input_def.expanded) {
portlet.$header.trigger('click');
@@ -111,6 +111,9 @@ define(['utils/utils', 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc',
// mark error
input_element.error(message || 'Please verify this parameter.');
// trigger expand event for parent containers
this.trigger('expand', input_id);
// scroll to first input element
if (!silent) {
$('html, body').animate({
+157
View File
@@ -0,0 +1,157 @@
// dependencies
define(['utils/utils', 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc'], function(Utils, Portlet, Ui) {
// ui list element
var View = Backbone.View.extend({
// create portlet to keep track of selected list elements
initialize : function(options) {
// link this
var self = this;
// initialize options
this.options = options;
this.name = options.name || 'element';
this.multiple = options.multiple || false;
// create message handler
this.message = new Ui.Message({ cls: 'ui-margin-top' });
// create portlet
this.portlet = new Portlet.View({ cls: 'ui-portlet-section' });
// create select field containing the options which can be inserted into the list
this.select = new Ui.Select.View({ optional : options.optional });
// create insert new list element button
this.button = new Ui.ButtonIcon({
icon : 'fa fa-sign-in',
floating : 'left',
tooltip : 'Insert new ' + this.name,
onclick : function() {
self.add({
id : self.select.value(),
name : self.select.text()
});
}
});
// build main element
this.setElement(this._template(options));
this.$('.ui-list-message').append(this.message.$el);
this.$('.ui-list-portlet').append(this.portlet.$el);
this.$('.ui-list-button').append(this.button.$el);
this.$('.ui-list-select').append(this.select.$el);
},
/** Return/Set currently selected list elements */
value: function(val) {
// set new value
if (val !== undefined) {
this.portlet.empty();
if ($.isArray(val)) {
for (var i in val) {
var v = val[i];
var v_id = null;
var v_name = null;
if ($.type(v) != 'string') {
v_id = v.id;
v_name = v.name;
} else {
v_id = v_name = v;
}
if (v_id != null) {
this.add({
id : v_id,
name : v_name
});
}
}
}
this._refresh();
}
// get current value
var lst = [];
this.$('.ui-list-id').each(function() {
lst.push({
id : $(this).prop('id'),
name : $(this).find('.ui-list-name').html()
});
});
if (lst.length == 0) {
return null;
}
return lst;
},
/** Add row */
add: function(options) {
var self = this;
if (this.$('[id="' + options.id + '"]').length === 0) {
if (Utils.validate(options.id)) {
var $el = $(this._templateRow({
id : options.id,
name : options.name
}));
$el.on('click', function() {
$el.remove();
self._refresh();
});
$el.on('mouseover', function() {
$el.addClass('portlet-highlight');
});
$el.on('mouseout', function() {
$el.removeClass('portlet-highlight');
});
this.portlet.append($el);
this._refresh();
} else {
this.message.update({ message: 'Please select a valid ' + this.name + '.', status: 'danger' });
}
} else {
this.message.update({ message: 'This ' + this.name + ' is already in the list.' });
}
},
/** Update available options */
update: function(options) {
this.select.update(options);
},
/** Refresh view */
_refresh: function() {
if (this.$('.ui-list-id').length > 0) {
!this.multiple && this.button.disable();
this.$('.ui-list-portlet').show();
} else {
this.button.enable();
this.$('.ui-list-portlet').hide();
}
this.options.onchange && this.options.onchange();
},
/** Main Template */
_template: function(options) {
return '<div class="ui-list">' +
'<div class="ui-margin-top">' +
'<span class="ui-list-button"/>' +
'<span class="ui-list-select"/>' +
'</div>' +
'<div class="ui-list-message"/>' +
'<div class="ui-list-portlet"/>' +
'</div>';
},
/** Row Template */
_templateRow: function(options) {
return '<div id="' + options.id + '" class="ui-list-id">' +
'<span class="ui-list-delete fa fa-trash"/>' +
'<span class="ui-list-name">' + options.name + '</span>' +
'</div>';
}
});
return {
View: View
}
});
+10 -11
View File
@@ -199,7 +199,7 @@ var ButtonIcon = Backbone.View.extend({
});
// add tooltip
$(this.el).tooltip({title: options.tooltip, placement: 'bottom'});
this.$button.tooltip({title: options.tooltip, placement: 'bottom'});
},
// disable
@@ -229,18 +229,16 @@ var ButtonIcon = Backbone.View.extend({
}
// string
var str = '<div id="' + options.id + '" style="float: ' + options.floating + '; ' + width + '" class="' + options.cls + '">';
// title
var str = '<div id="' + options.id + '" style="float: ' + options.floating + '; ' + width + '" class="' + options.cls + '">' +
'<div class="button">';
if (options.title) {
str += '<div class="button">' +
'<i class="icon fa ' + options.icon + '"/>&nbsp;' +
'<span class="title">' + options.title + '</span>' +
'</div>';
str += '<i class="icon fa ' + options.icon + '"/>&nbsp;' +
'<span class="title">' + options.title + '</span>';
} else {
str += '<i class="icon fa ' + options.icon + '"/>';
str += '<i class="icon fa ' + options.icon + '"/>';
}
str += '</div>';
str += '</div>' +
'</div>';
return str;
}
});
@@ -277,6 +275,7 @@ var Message = Backbone.View.extend({
optionsDefault: {
message : null,
status : 'info',
cls : '',
persistent : false
},
@@ -286,7 +285,7 @@ var Message = Backbone.View.extend({
this.options = Utils.merge(options, this.optionsDefault);
// create new element
this.setElement('<div></div>');
this.setElement('<div class="' + this.options.cls + '"/>');
// show initial message
if (this.options.message) {
+6 -1
View File
@@ -88,7 +88,12 @@ var View = Backbone.View.extend({
append: function($el) {
this.$content.append($el);
},
// remove all content
empty: function() {
this.$content.empty();
},
// content
content: function() {
return this.$content;
@@ -0,0 +1,53 @@
// dependencies
define(['utils/utils', 'mvc/ui/ui-list'],
function(Utils, List) {
/**
* FTP file selector
*/
var View = Backbone.View.extend({
// initialize
initialize : function(options) {
// link this
var self = this;
// create ui-list view to keep track of selected ftp files
this.ftpfile_list = new List.View({
name : 'file',
optional : options.optional,
multiple : options.multiple,
onchange : function() {
options.onchange && options.onchange(self.value());
}
});
// create elements
this.setElement(this.ftpfile_list.$el);
// initial fetch of ftps
Utils.get({
url : galaxy_config.root + 'api/remote_files',
success : function(response) {
var data = [];
for (var i in response) {
data.push({
value : response[i]['path'],
label : response[i]['path']
});
}
self.ftpfile_list.update(data);
}
});
},
/** Return/Set currently selected ftp datasets */
value: function(val) {
return this.ftpfile_list.value(val);
}
});
return {
View: View
}
});
@@ -1,6 +1,6 @@
// dependencies
define(['utils/utils', 'mvc/ui/ui-misc', 'mvc/ui/ui-tabs', 'mvc/tools/tools-template'],
function(Utils, Ui, Tabs, ToolTemplate) {
define(['utils/utils', 'mvc/ui/ui-misc', 'mvc/ui/ui-table', 'mvc/ui/ui-list'],
function(Utils, Ui, Table, List) {
// collection of libraries
var Libraries = Backbone.Collection.extend({
@@ -13,7 +13,7 @@ var LibraryDatasets = Backbone.Collection.extend({
var self = this;
this.config = new Backbone.Model({ library_id: null });
this.config.on('change', function() {
self.fetch({reset: true});
self.fetch({ reset: true });
});
},
url: function() {
@@ -36,15 +36,16 @@ var View = Backbone.View.extend({
this.options = options;
// select field for the library
// TODO: Remove this once the library API supports searching for library datasets
this.library_select = new Ui.Select.View({
optional : options.optional,
onchange : function(value) {
self.datasets.config.set('library_id', value);
}
});
// select field for the library dataset
this.dataset_select = new Ui.Select.View({
// create ui-list view to keep track of selected data libraries
this.dataset_list = new List.View({
name : 'dataset',
optional : options.optional,
multiple : options.multiple,
onchange : function() {
@@ -62,7 +63,6 @@ var View = Backbone.View.extend({
});
});
self.library_select.update(data);
self.trigger('change');
});
// add reset handler for fetched library datasets
@@ -74,13 +74,12 @@ var View = Backbone.View.extend({
if (model.get('type') === 'file') {
data.push({
value : model.id,
label : library_current + model.get('name')
label : model.get('name')
});
}
});
}
self.dataset_select.update(data);
self.trigger('change');
self.dataset_list.update(data);
});
// add change event. fires on trigger
@@ -88,10 +87,10 @@ var View = Backbone.View.extend({
options.onchange && options.onchange(self.value());
});
// create element
// create elements
this.setElement(this._template());
this.$('.library-select').append(this.library_select.$el);
this.$('.dataset-select').append(this.dataset_select.$el);
this.$el.append(this.dataset_list.$el);
// initial fetch of libraries
this.libraries.fetch({
@@ -106,8 +105,8 @@ var View = Backbone.View.extend({
},
/** Return/Set currently selected library datasets */
value: function(new_val) {
return this.dataset_select.value();
value: function(val) {
return this.dataset_list.value(val);
},
/** Template */
@@ -117,10 +116,6 @@ var View = Backbone.View.extend({
'<span class="library-title">Select Library</span>' +
'<span class="library-select"/>' +
'</div>' +
'<div class="dataset">' +
'<span class="dataset-title">Select Dataset</span>' +
'<span class="dataset-select"/>' +
'</div>' +
'</div>';
}
});
+1 -1
View File
@@ -39,7 +39,7 @@ function validate (value) {
return false;
}
for (var i in value) {
if (['__null__', '__undefined__', 'None', null, undefined].indexOf(value[i]) > -1) {
if (['__null__', '__undefined__', null, undefined].indexOf(value[i]) > -1) {
return false;
}
}
+27
View File
@@ -278,6 +278,9 @@
background: @side-panel-bg;
border-bottom: solid darken(@side-panel-bg, 10%) 1px;
}
.portlet-highlight {
text-decoration: underline;
}
}
.ui-portlet-narrow {
@@ -501,6 +504,30 @@
}
}
.ui-list {
.ui-list-select {
float: left;
width: ~'calc(100% - 27px)';
}
.ui-list-button {
.ui-button-icon {
margin-top: 3px;
margin-right: 5px;
}
}
.ui-list-message, .ui-list-portlet {
clear: both;
}
.ui-list-id {
cursor: pointer;
margin-top: 5px;
.ui-list-delete {
font-size: 1.2em;
margin-right: 5px;
}
}
}
.ui-select {
position: relative;
.button {
+1
View File
@@ -119,6 +119,7 @@
<display file="ensembl/ensembl_interval_as_bed.xml" inherit="True"/>
<display file="gbrowse/gbrowse_interval_as_bed.xml" inherit="True"/>
<display file="rviewer/bed.xml" inherit="True"/>
<display file="igv/interval_as_bed.xml" inherit="True"/>
</datatype>
<datatype extension="picard_interval_list" type="galaxy.datatypes.tabular:Tabular" subclass="True" display_in_upload="True">
<converter file="picard_interval_list_to_bed6_converter.xml" target_datatype="bed6"/>
@@ -5,7 +5,7 @@
// does not use these.
ie_password_auth = ${ ie_request.javascript_boolean(ie_request.attr.PASSWORD_AUTH) };
ie_apache_urls = ${ ie_request.javascript_boolean(ie_request.attr.APACHE_URLS) };
ie_password = '${ ie_request.attr.notebook_pw }';
ie_password = '${ ie_request.notebook_pw }';
var galaxy_root = '${ ie_request.attr.root }';
@@ -12,10 +12,10 @@
command = docker
# The docker image name that should be started.
image = bgruening/docker-ipython-notebook:0.2
image = bgruening/docker-ipython-notebook:dev
# Additional arguments that are passed to the `docker run` command.
command_inject = --sig-proxy=true
command_inject = --sig-proxy=true -e DEBUG=false
# URL to access the Galaxy API with from the spawn Docker containter, if empty
# this falls back to galaxy.ini's galaxy_infrastructure_url and finally to the
@@ -3,16 +3,20 @@
<%
import os
import shutil
import tempfile
import subprocess
import hashlib
# Sets ID and sets up a lot of other variables
ie_request.load_deploy_config()
ie_request.attr.docker_port = 6789
# Create tempdir in galaxy
temp_dir = os.path.abspath( tempfile.mkdtemp() )
# Write out conf file...needs work
ie_request.write_conf_file(temp_dir)
temp_dir = ie_request.temp_dir
if ie_request.attr.PASSWORD_AUTH:
m = hashlib.sha1()
m.update( ie_request.notebook_pw + ie_request.notebook_pw_salt )
PASSWORD = 'sha1:%s:%s' % (ie_request.notebook_pw_salt, m.hexdigest())
else:
PASSWORD = "none"
## IPython Specific
# Prepare an empty notebook
@@ -34,9 +38,12 @@ else:
notebook_access_url = ie_request.url_template('${PROXY_URL}/ipython/${PORT}/notebooks/ipython_galaxy_notebook.ipynb')
notebook_login_url = ie_request.url_template('${PROXY_URL}/ipython/${PORT}/login?next=%2Fipython%2F${PORT}%2Ftree')
docker_cmd = ie_request.docker_cmd(temp_dir)
ie_request.log.info("Starting IPython docker container with command [%s]" % docker_cmd)
subprocess.call(docker_cmd, shell=True)
# Add all environment variables collected from Galaxy's IE infrastructure
ie_request.launch(env_override={
'notebook_password': PASSWORD,
})
%>
<html>
<head>
@@ -20,7 +20,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"You can access your data via the dataset number. For example, ``handle = get(42)``.",
"You can access your data via the dataset number. For example, ``handle = open(get(42), 'r')``.",
"To save data, write your data to a file, and then call ``put('filename.txt')``. The dataset will then be available in your galaxy history.",
"Notebooks can be saved to Galaxy by clicking the large green button at the top right of the IPython interface.<br>",
"More help and informations can be found on the project [website](https://github.com/bgruening/galaxy-ipython)."
@@ -0,0 +1,19 @@
[main]
# This cannot be changed
password_auth = True
# Other
apache_urls = False
ssl = False
[docker]
command = docker
image = erasche/docker-rstudio-notebook:dev
# Additional arguments that are passed to the `docker run` command. `-u`
# settings are completely ignored.
command_inject = --sig-proxy=true -e DEBUG=false
# URL to access the Galaxy API with from the spawned Docker container, if empty
# this falls back to galaxy.ini's galaxy_infrastructure_url and finally to the
# Docker host of the spawned container, if that is also not set.
#galaxy_url=
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE interactive_environment SYSTEM "../../interactive_environments.dtd">
<interactive_environment name="RStudio">
<data_sources>
<data_source>
<model_class>HistoryDatasetAssociation</model_class>
<test type="isinstance" test_attr="datatype" result_type="datatype">tabular.Tabular</test>
<test type="isinstance" test_attr="datatype" result_type="datatype">data.Text</test>
<test type="isinstance" test_attr="datatype" result_type="datatype">binary.RData</test>
<to_param param_attr="id">dataset_id</to_param>
</data_source>
</data_sources>
<params>
<param type="dataset" var_name_in_template="hda" required="true">dataset_id</param>
</params>
<template>rstudio.mako</template>
</interactive_environment>
@@ -0,0 +1,73 @@
// ==== File: base64.js
var b64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var b64pad="=";
function hex2b64(h) {
var i;
var c;
var ret = "";
for(i = 0; i+3 <= h.length; i+=3) {
c = parseInt(h.substring(i,i+3),16);
ret += b64map.charAt(c >> 6) + b64map.charAt(c & 63);
}
if(i+1 == h.length) {
c = parseInt(h.substring(i,i+1),16);
ret += b64map.charAt(c << 2);
}
else if(i+2 == h.length) {
c = parseInt(h.substring(i,i+2),16);
ret += b64map.charAt(c >> 2) + b64map.charAt((c & 3) << 4);
}
while((ret.length & 3) > 0) ret += b64pad;
return ret;
}
// convert a base64 string to hex
function b64tohex(s) {
var ret = ""
var i;
var k = 0; // b64 state, 0-3
var slop;
for(i = 0; i < s.length; ++i) {
if(s.charAt(i) == b64pad) break;
v = b64map.indexOf(s.charAt(i));
if(v < 0) continue;
if(k == 0) {
ret += int2char(v >> 2);
slop = v & 3;
k = 1;
}
else if(k == 1) {
ret += int2char((slop << 2) | (v >> 4));
slop = v & 0xf;
k = 2;
}
else if(k == 2) {
ret += int2char(slop);
ret += int2char(v >> 2);
slop = v & 3;
k = 3;
}
else {
ret += int2char((slop << 2) | (v >> 4));
ret += int2char(v & 0xf);
k = 0;
}
}
if(k == 1)
ret += int2char(slop << 2);
return ret;
}
// convert a base64 string to a byte/number array
function b64toBA(s) {
//piggyback on b64tohex for now, optimize later
var h = b64tohex(s);
var i;
var a = new Array();
for(i = 0; 2*i < h.length; ++i) {
a[i] = parseInt(h.substring(2*i,2*i+2),16);
}
return a;
}
@@ -0,0 +1,562 @@
// Downloaded from http://www-cs-students.stanford.edu/~tjw/ at Tue Nov 30 00:42:57 PST 2010
// ==== File: jsbn.js
// Copyright (c) 2005 Tom Wu
// All Rights Reserved.
// See "LICENSE" for details.
// Basic JavaScript BN library - subset useful for RSA encryption.
// Bits per digit
var dbits;
// JavaScript engine analysis
var canary = 0xdeadbeefcafe;
var j_lm = ((canary&0xffffff)==0xefcafe);
// (public) Constructor
function BigInteger(a,b,c) {
if(a != null)
if("number" == typeof a) this.fromNumber(a,b,c);
else if(b == null && "string" != typeof a) this.fromString(a,256);
else this.fromString(a,b);
}
// return new, unset BigInteger
function nbi() { return new BigInteger(null); }
// am: Compute w_j += (x*this_i), propagate carries,
// c is initial carry, returns final carry.
// c < 3*dvalue, x < 2*dvalue, this_i < dvalue
// We need to select the fastest one that works in this environment.
// am1: use a single mult and divide to get the high bits,
// max digit bits should be 26 because
// max internal value = 2*dvalue^2-2*dvalue (< 2^53)
function am1(i,x,w,j,c,n) {
while(--n >= 0) {
var v = x*this[i++]+w[j]+c;
c = Math.floor(v/0x4000000);
w[j++] = v&0x3ffffff;
}
return c;
}
// am2 avoids a big mult-and-extract completely.
// Max digit bits should be <= 30 because we do bitwise ops
// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)
function am2(i,x,w,j,c,n) {
var xl = x&0x7fff, xh = x>>15;
while(--n >= 0) {
var l = this[i]&0x7fff;
var h = this[i++]>>15;
var m = xh*l+h*xl;
l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);
c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);
w[j++] = l&0x3fffffff;
}
return c;
}
// Alternately, set max digit bits to 28 since some
// browsers slow down when dealing with 32-bit numbers.
function am3(i,x,w,j,c,n) {
var xl = x&0x3fff, xh = x>>14;
while(--n >= 0) {
var l = this[i]&0x3fff;
var h = this[i++]>>14;
var m = xh*l+h*xl;
l = xl*l+((m&0x3fff)<<14)+w[j]+c;
c = (l>>28)+(m>>14)+xh*h;
w[j++] = l&0xfffffff;
}
return c;
}
if(j_lm && (navigator.appName == "Microsoft Internet Explorer")) {
BigInteger.prototype.am = am2;
dbits = 30;
}
else if(j_lm && (navigator.appName != "Netscape")) {
BigInteger.prototype.am = am1;
dbits = 26;
}
else { // Mozilla/Netscape seems to prefer am3
BigInteger.prototype.am = am3;
dbits = 28;
}
BigInteger.prototype.DB = dbits;
BigInteger.prototype.DM = ((1<<dbits)-1);
BigInteger.prototype.DV = (1<<dbits);
var BI_FP = 52;
BigInteger.prototype.FV = Math.pow(2,BI_FP);
BigInteger.prototype.F1 = BI_FP-dbits;
BigInteger.prototype.F2 = 2*dbits-BI_FP;
// Digit conversions
var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz";
var BI_RC = new Array();
var rr,vv;
rr = "0".charCodeAt(0);
for(vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;
rr = "a".charCodeAt(0);
for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
rr = "A".charCodeAt(0);
for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
function int2char(n) { return BI_RM.charAt(n); }
function intAt(s,i) {
var c = BI_RC[s.charCodeAt(i)];
return (c==null)?-1:c;
}
// (protected) copy this to r
function bnpCopyTo(r) {
for(var i = this.t-1; i >= 0; --i) r[i] = this[i];
r.t = this.t;
r.s = this.s;
}
// (protected) set from integer value x, -DV <= x < DV
function bnpFromInt(x) {
this.t = 1;
this.s = (x<0)?-1:0;
if(x > 0) this[0] = x;
else if(x < -1) this[0] = x+DV;
else this.t = 0;
}
// return bigint initialized to value
function nbv(i) { var r = nbi(); r.fromInt(i); return r; }
// (protected) set from string and radix
function bnpFromString(s,b) {
var k;
if(b == 16) k = 4;
else if(b == 8) k = 3;
else if(b == 256) k = 8; // byte array
else if(b == 2) k = 1;
else if(b == 32) k = 5;
else if(b == 4) k = 2;
else { this.fromRadix(s,b); return; }
this.t = 0;
this.s = 0;
var i = s.length, mi = false, sh = 0;
while(--i >= 0) {
var x = (k==8)?s[i]&0xff:intAt(s,i);
if(x < 0) {
if(s.charAt(i) == "-") mi = true;
continue;
}
mi = false;
if(sh == 0)
this[this.t++] = x;
else if(sh+k > this.DB) {
this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<<sh;
this[this.t++] = (x>>(this.DB-sh));
}
else
this[this.t-1] |= x<<sh;
sh += k;
if(sh >= this.DB) sh -= this.DB;
}
if(k == 8 && (s[0]&0x80) != 0) {
this.s = -1;
if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)<<sh;
}
this.clamp();
if(mi) BigInteger.ZERO.subTo(this,this);
}
// (protected) clamp off excess high words
function bnpClamp() {
var c = this.s&this.DM;
while(this.t > 0 && this[this.t-1] == c) --this.t;
}
// (public) return string representation in given radix
function bnToString(b) {
if(this.s < 0) return "-"+this.negate().toString(b);
var k;
if(b == 16) k = 4;
else if(b == 8) k = 3;
else if(b == 2) k = 1;
else if(b == 32) k = 5;
else if(b == 4) k = 2;
else return this.toRadix(b);
var km = (1<<k)-1, d, m = false, r = "", i = this.t;
var p = this.DB-(i*this.DB)%k;
if(i-- > 0) {
if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }
while(i >= 0) {
if(p < k) {
d = (this[i]&((1<<p)-1))<<(k-p);
d |= this[--i]>>(p+=this.DB-k);
}
else {
d = (this[i]>>(p-=k))&km;
if(p <= 0) { p += this.DB; --i; }
}
if(d > 0) m = true;
if(m) r += int2char(d);
}
}
return m?r:"0";
}
// (public) -this
function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }
// (public) |this|
function bnAbs() { return (this.s<0)?this.negate():this; }
// (public) return + if this > a, - if this < a, 0 if equal
function bnCompareTo(a) {
var r = this.s-a.s;
if(r != 0) return r;
var i = this.t;
r = i-a.t;
if(r != 0) return r;
while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;
return 0;
}
// returns bit length of the integer x
function nbits(x) {
var r = 1, t;
if((t=x>>>16) != 0) { x = t; r += 16; }
if((t=x>>8) != 0) { x = t; r += 8; }
if((t=x>>4) != 0) { x = t; r += 4; }
if((t=x>>2) != 0) { x = t; r += 2; }
if((t=x>>1) != 0) { x = t; r += 1; }
return r;
}
// (public) return the number of bits in "this"
function bnBitLength() {
if(this.t <= 0) return 0;
return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));
}
// (protected) r = this << n*DB
function bnpDLShiftTo(n,r) {
var i;
for(i = this.t-1; i >= 0; --i) r[i+n] = this[i];
for(i = n-1; i >= 0; --i) r[i] = 0;
r.t = this.t+n;
r.s = this.s;
}
// (protected) r = this >> n*DB
function bnpDRShiftTo(n,r) {
for(var i = n; i < this.t; ++i) r[i-n] = this[i];
r.t = Math.max(this.t-n,0);
r.s = this.s;
}
// (protected) r = this << n
function bnpLShiftTo(n,r) {
var bs = n%this.DB;
var cbs = this.DB-bs;
var bm = (1<<cbs)-1;
var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;
for(i = this.t-1; i >= 0; --i) {
r[i+ds+1] = (this[i]>>cbs)|c;
c = (this[i]&bm)<<bs;
}
for(i = ds-1; i >= 0; --i) r[i] = 0;
r[ds] = c;
r.t = this.t+ds+1;
r.s = this.s;
r.clamp();
}
// (protected) r = this >> n
function bnpRShiftTo(n,r) {
r.s = this.s;
var ds = Math.floor(n/this.DB);
if(ds >= this.t) { r.t = 0; return; }
var bs = n%this.DB;
var cbs = this.DB-bs;
var bm = (1<<bs)-1;
r[0] = this[ds]>>bs;
for(var i = ds+1; i < this.t; ++i) {
r[i-ds-1] |= (this[i]&bm)<<cbs;
r[i-ds] = this[i]>>bs;
}
if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;
r.t = this.t-ds;
r.clamp();
}
// (protected) r = this - a
function bnpSubTo(a,r) {
var i = 0, c = 0, m = Math.min(a.t,this.t);
while(i < m) {
c += this[i]-a[i];
r[i++] = c&this.DM;
c >>= this.DB;
}
if(a.t < this.t) {
c -= a.s;
while(i < this.t) {
c += this[i];
r[i++] = c&this.DM;
c >>= this.DB;
}
c += this.s;
}
else {
c += this.s;
while(i < a.t) {
c -= a[i];
r[i++] = c&this.DM;
c >>= this.DB;
}
c -= a.s;
}
r.s = (c<0)?-1:0;
if(c < -1) r[i++] = this.DV+c;
else if(c > 0) r[i++] = c;
r.t = i;
r.clamp();
}
// (protected) r = this * a, r != this,a (HAC 14.12)
// "this" should be the larger one if appropriate.
function bnpMultiplyTo(a,r) {
var x = this.abs(), y = a.abs();
var i = x.t;
r.t = i+y.t;
while(--i >= 0) r[i] = 0;
for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t);
r.s = 0;
r.clamp();
if(this.s != a.s) BigInteger.ZERO.subTo(r,r);
}
// (protected) r = this^2, r != this (HAC 14.16)
function bnpSquareTo(r) {
var x = this.abs();
var i = r.t = 2*x.t;
while(--i >= 0) r[i] = 0;
for(i = 0; i < x.t-1; ++i) {
var c = x.am(i,x[i],r,2*i,0,1);
if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {
r[i+x.t] -= x.DV;
r[i+x.t+1] = 1;
}
}
if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1);
r.s = 0;
r.clamp();
}
// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)
// r != q, this != m. q or r may be null.
function bnpDivRemTo(m,q,r) {
var pm = m.abs();
if(pm.t <= 0) return;
var pt = this.abs();
if(pt.t < pm.t) {
if(q != null) q.fromInt(0);
if(r != null) this.copyTo(r);
return;
}
if(r == null) r = nbi();
var y = nbi(), ts = this.s, ms = m.s;
var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus
if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }
else { pm.copyTo(y); pt.copyTo(r); }
var ys = y.t;
var y0 = y[ys-1];
if(y0 == 0) return;
var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);
var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;
var i = r.t, j = i-ys, t = (q==null)?nbi():q;
y.dlShiftTo(j,t);
if(r.compareTo(t) >= 0) {
r[r.t++] = 1;
r.subTo(t,r);
}
BigInteger.ONE.dlShiftTo(ys,t);
t.subTo(y,y); // "negative" y so we can replace sub with am later
while(y.t < ys) y[y.t++] = 0;
while(--j >= 0) {
// Estimate quotient digit
var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);
if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out
y.dlShiftTo(j,t);
r.subTo(t,r);
while(r[i] < --qd) r.subTo(t,r);
}
}
if(q != null) {
r.drShiftTo(ys,q);
if(ts != ms) BigInteger.ZERO.subTo(q,q);
}
r.t = ys;
r.clamp();
if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder
if(ts < 0) BigInteger.ZERO.subTo(r,r);
}
// (public) this mod a
function bnMod(a) {
var r = nbi();
this.abs().divRemTo(a,null,r);
if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);
return r;
}
// Modular reduction using "classic" algorithm
function Classic(m) { this.m = m; }
function cConvert(x) {
if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);
else return x;
}
function cRevert(x) { return x; }
function cReduce(x) { x.divRemTo(this.m,null,x); }
function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
Classic.prototype.convert = cConvert;
Classic.prototype.revert = cRevert;
Classic.prototype.reduce = cReduce;
Classic.prototype.mulTo = cMulTo;
Classic.prototype.sqrTo = cSqrTo;
// (protected) return "-1/this % 2^DB"; useful for Mont. reduction
// justification:
// xy == 1 (mod m)
// xy = 1+km
// xy(2-xy) = (1+km)(1-km)
// x[y(2-xy)] = 1-k^2m^2
// x[y(2-xy)] == 1 (mod m^2)
// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
// JS multiply "overflows" differently from C/C++, so care is needed here.
function bnpInvDigit() {
if(this.t < 1) return 0;
var x = this[0];
if((x&1) == 0) return 0;
var y = x&3; // y == 1/x mod 2^2
y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4
y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8
y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16
// last step - calculate inverse mod DV directly;
// assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints
y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits
// we really want the negative inverse, and -DV < y < DV
return (y>0)?this.DV-y:-y;
}
// Montgomery reduction
function Montgomery(m) {
this.m = m;
this.mp = m.invDigit();
this.mpl = this.mp&0x7fff;
this.mph = this.mp>>15;
this.um = (1<<(m.DB-15))-1;
this.mt2 = 2*m.t;
}
// xR mod m
function montConvert(x) {
var r = nbi();
x.abs().dlShiftTo(this.m.t,r);
r.divRemTo(this.m,null,r);
if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);
return r;
}
// x/R mod m
function montRevert(x) {
var r = nbi();
x.copyTo(r);
this.reduce(r);
return r;
}
// x = x/R mod m (HAC 14.32)
function montReduce(x) {
while(x.t <= this.mt2) // pad x so am has enough room later
x[x.t++] = 0;
for(var i = 0; i < this.m.t; ++i) {
// faster way of calculating u0 = x[i]*mp mod DV
var j = x[i]&0x7fff;
var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;
// use am to combine the multiply-shift-add into one call
j = i+this.m.t;
x[j] += this.m.am(0,u0,x,i,0,this.m.t);
// propagate carry
while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }
}
x.clamp();
x.drShiftTo(this.m.t,x);
if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
}
// r = "x^2/R mod m"; x != r
function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
// r = "xy/R mod m"; x,y != r
function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
Montgomery.prototype.convert = montConvert;
Montgomery.prototype.revert = montRevert;
Montgomery.prototype.reduce = montReduce;
Montgomery.prototype.mulTo = montMulTo;
Montgomery.prototype.sqrTo = montSqrTo;
// (protected) true iff this is even
function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }
// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)
function bnpExp(e,z) {
if(e > 0xffffffff || e < 1) return BigInteger.ONE;
var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;
g.copyTo(r);
while(--i >= 0) {
z.sqrTo(r,r2);
if((e&(1<<i)) > 0) z.mulTo(r2,g,r);
else { var t = r; r = r2; r2 = t; }
}
return z.revert(r);
}
// (public) this^e % m, 0 <= e < 2^32
function bnModPowInt(e,m) {
var z;
if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);
return this.exp(e,z);
}
// protected
BigInteger.prototype.copyTo = bnpCopyTo;
BigInteger.prototype.fromInt = bnpFromInt;
BigInteger.prototype.fromString = bnpFromString;
BigInteger.prototype.clamp = bnpClamp;
BigInteger.prototype.dlShiftTo = bnpDLShiftTo;
BigInteger.prototype.drShiftTo = bnpDRShiftTo;
BigInteger.prototype.lShiftTo = bnpLShiftTo;
BigInteger.prototype.rShiftTo = bnpRShiftTo;
BigInteger.prototype.subTo = bnpSubTo;
BigInteger.prototype.multiplyTo = bnpMultiplyTo;
BigInteger.prototype.squareTo = bnpSquareTo;
BigInteger.prototype.divRemTo = bnpDivRemTo;
BigInteger.prototype.invDigit = bnpInvDigit;
BigInteger.prototype.isEven = bnpIsEven;
BigInteger.prototype.exp = bnpExp;
// public
BigInteger.prototype.toString = bnToString;
BigInteger.prototype.negate = bnNegate;
BigInteger.prototype.abs = bnAbs;
BigInteger.prototype.compareTo = bnCompareTo;
BigInteger.prototype.bitLength = bnBitLength;
BigInteger.prototype.mod = bnMod;
BigInteger.prototype.modPowInt = bnModPowInt;
// "constants"
BigInteger.ZERO = nbv(0);
BigInteger.ONE = nbv(1);
@@ -0,0 +1,47 @@
// ==== File: prng4.js
// prng4.js - uses Arcfour as a PRNG
function Arcfour() {
this.i = 0;
this.j = 0;
this.S = new Array();
}
// Initialize arcfour context from key, an array of ints, each from [0..255]
function ARC4init(key) {
var i, j, t;
for(i = 0; i < 256; ++i)
this.S[i] = i;
j = 0;
for(i = 0; i < 256; ++i) {
j = (j + this.S[i] + key[i % key.length]) & 255;
t = this.S[i];
this.S[i] = this.S[j];
this.S[j] = t;
}
this.i = 0;
this.j = 0;
}
function ARC4next() {
var t;
this.i = (this.i + 1) & 255;
this.j = (this.j + this.S[this.i]) & 255;
t = this.S[this.i];
this.S[this.i] = this.S[this.j];
this.S[this.j] = t;
return this.S[(t + this.S[this.i]) & 255];
}
Arcfour.prototype.init = ARC4init;
Arcfour.prototype.next = ARC4next;
// Plug in your RNG constructor here
function prng_newstate() {
return new Arcfour();
}
// Pool size must be a multiple of 4 and greater than 32.
// An array of bytes the size of the pool will be passed to init()
var rng_psize = 256;
@@ -0,0 +1,70 @@
// ==== File: rng.js
// Random number generator - requires a PRNG backend, e.g. prng4.js
// For best results, put code like
// <body onClick='rng_seed_time();' onKeyPress='rng_seed_time();'>
// in your main HTML document.
var rng_state;
var rng_pool;
var rng_pptr;
// Mix in a 32-bit integer into the pool
function rng_seed_int(x) {
rng_pool[rng_pptr++] ^= x & 255;
rng_pool[rng_pptr++] ^= (x >> 8) & 255;
rng_pool[rng_pptr++] ^= (x >> 16) & 255;
rng_pool[rng_pptr++] ^= (x >> 24) & 255;
if(rng_pptr >= rng_psize) rng_pptr -= rng_psize;
}
// Mix in the current time (w/milliseconds) into the pool
function rng_seed_time() {
rng_seed_int(new Date().getTime());
}
// Initialize the pool with junk if needed.
if(rng_pool == null) {
rng_pool = new Array();
rng_pptr = 0;
var t;
if(navigator.appName == "Netscape" && navigator.appVersion < "5" && window.crypto) {
// Extract entropy (256 bits) from NS4 RNG if available
var z = window.crypto.random(32);
for(t = 0; t < z.length; ++t)
rng_pool[rng_pptr++] = z.charCodeAt(t) & 255;
}
while(rng_pptr < rng_psize) { // extract some randomness from Math.random()
t = Math.floor(65536 * Math.random());
rng_pool[rng_pptr++] = t >>> 8;
rng_pool[rng_pptr++] = t & 255;
}
rng_pptr = 0;
rng_seed_time();
//rng_seed_int(window.screenX);
//rng_seed_int(window.screenY);
}
function rng_get_byte() {
if(rng_state == null) {
rng_seed_time();
rng_state = prng_newstate();
rng_state.init(rng_pool);
for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)
rng_pool[rng_pptr] = 0;
rng_pptr = 0;
//rng_pool = null;
}
// TODO: allow reseeding after first request
return rng_state.next();
}
function rng_get_bytes(ba) {
var i;
for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte();
}
function SecureRandom() {}
SecureRandom.prototype.nextBytes = rng_get_bytes;
@@ -0,0 +1,114 @@
// ==== File: rsa.js
// Depends on jsbn.js and rng.js
// Version 1.1: support utf-8 encoding in pkcs1pad2
// convert a (hex) string to a bignum object
function parseBigInt(str,r) {
return new BigInteger(str,r);
}
function linebrk(s,n) {
var ret = "";
var i = 0;
while(i + n < s.length) {
ret += s.substring(i,i+n) + "\n";
i += n;
}
return ret + s.substring(i,s.length);
}
function byte2Hex(b) {
if(b < 0x10)
return "0" + b.toString(16);
else
return b.toString(16);
}
// PKCS#1 (type 2, random) pad input string s to n bytes, and return a bigint
function pkcs1pad2(s,n) {
if(n < s.length + 11) { // TODO: fix for utf-8
alert("Message too long for RSA");
return null;
}
var ba = new Array();
var i = s.length - 1;
while(i >= 0 && n > 0) {
var c = s.charCodeAt(i--);
if(c < 128) { // encode using utf-8
ba[--n] = c;
}
else if((c > 127) && (c < 2048)) {
ba[--n] = (c & 63) | 128;
ba[--n] = (c >> 6) | 192;
}
else {
ba[--n] = (c & 63) | 128;
ba[--n] = ((c >> 6) & 63) | 128;
ba[--n] = (c >> 12) | 224;
}
}
ba[--n] = 0;
var rng = new SecureRandom();
var x = new Array();
while(n > 2) { // random non-zero pad
x[0] = 0;
while(x[0] == 0) rng.nextBytes(x);
ba[--n] = x[0];
}
ba[--n] = 2;
ba[--n] = 0;
return new BigInteger(ba);
}
// "empty" RSA key constructor
function RSAKey() {
this.n = null;
this.e = 0;
this.d = null;
this.p = null;
this.q = null;
this.dmp1 = null;
this.dmq1 = null;
this.coeff = null;
}
// Set the public key fields N and e from hex strings
function RSASetPublic(N,E) {
if(N != null && E != null && N.length > 0 && E.length > 0) {
this.n = parseBigInt(N,16);
this.e = parseInt(E,16);
}
else
alert("Invalid RSA public key");
}
// Perform raw public operation on "x": return x^e (mod n)
function RSADoPublic(x) {
return x.modPowInt(this.e, this.n);
}
// Return the PKCS#1 RSA encryption of "text" as an even-length hex string
function RSAEncrypt(text) {
var m = pkcs1pad2(text,(this.n.bitLength()+7)>>3);
if(m == null) return null;
var c = this.doPublic(m);
if(c == null) return null;
var h = c.toString(16);
if((h.length & 1) == 0) return h; else return "0" + h;
}
// Return the PKCS#1 RSA encryption of "text" as a Base64-encoded string
//function RSAEncryptB64(text) {
// var h = this.encrypt(text);
// if(h) return hex2b64(h); else return null;
//}
// protected
RSAKey.prototype.doPublic = RSADoPublic;
// public
RSAKey.prototype.setPublic = RSASetPublic;
RSAKey.prototype.encrypt = RSAEncrypt;
//RSAKey.prototype.encrypt_b64 = RSAEncryptB64;
@@ -0,0 +1,861 @@
// Downloaded from http://www-cs-students.stanford.edu/~tjw/ at Tue Nov 30 00:42:57 PST 2010
// ==== File: jsbn.js
// Copyright (c) 2005 Tom Wu
// All Rights Reserved.
// See "LICENSE" for details.
// Basic JavaScript BN library - subset useful for RSA encryption.
// Bits per digit
var dbits;
// JavaScript engine analysis
var canary = 0xdeadbeefcafe;
var j_lm = ((canary&0xffffff)==0xefcafe);
// (public) Constructor
function BigInteger(a,b,c) {
if(a != null)
if("number" == typeof a) this.fromNumber(a,b,c);
else if(b == null && "string" != typeof a) this.fromString(a,256);
else this.fromString(a,b);
}
// return new, unset BigInteger
function nbi() { return new BigInteger(null); }
// am: Compute w_j += (x*this_i), propagate carries,
// c is initial carry, returns final carry.
// c < 3*dvalue, x < 2*dvalue, this_i < dvalue
// We need to select the fastest one that works in this environment.
// am1: use a single mult and divide to get the high bits,
// max digit bits should be 26 because
// max internal value = 2*dvalue^2-2*dvalue (< 2^53)
function am1(i,x,w,j,c,n) {
while(--n >= 0) {
var v = x*this[i++]+w[j]+c;
c = Math.floor(v/0x4000000);
w[j++] = v&0x3ffffff;
}
return c;
}
// am2 avoids a big mult-and-extract completely.
// Max digit bits should be <= 30 because we do bitwise ops
// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)
function am2(i,x,w,j,c,n) {
var xl = x&0x7fff, xh = x>>15;
while(--n >= 0) {
var l = this[i]&0x7fff;
var h = this[i++]>>15;
var m = xh*l+h*xl;
l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);
c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);
w[j++] = l&0x3fffffff;
}
return c;
}
// Alternately, set max digit bits to 28 since some
// browsers slow down when dealing with 32-bit numbers.
function am3(i,x,w,j,c,n) {
var xl = x&0x3fff, xh = x>>14;
while(--n >= 0) {
var l = this[i]&0x3fff;
var h = this[i++]>>14;
var m = xh*l+h*xl;
l = xl*l+((m&0x3fff)<<14)+w[j]+c;
c = (l>>28)+(m>>14)+xh*h;
w[j++] = l&0xfffffff;
}
return c;
}
if(j_lm && (navigator.appName == "Microsoft Internet Explorer")) {
BigInteger.prototype.am = am2;
dbits = 30;
}
else if(j_lm && (navigator.appName != "Netscape")) {
BigInteger.prototype.am = am1;
dbits = 26;
}
else { // Mozilla/Netscape seems to prefer am3
BigInteger.prototype.am = am3;
dbits = 28;
}
BigInteger.prototype.DB = dbits;
BigInteger.prototype.DM = ((1<<dbits)-1);
BigInteger.prototype.DV = (1<<dbits);
var BI_FP = 52;
BigInteger.prototype.FV = Math.pow(2,BI_FP);
BigInteger.prototype.F1 = BI_FP-dbits;
BigInteger.prototype.F2 = 2*dbits-BI_FP;
// Digit conversions
var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz";
var BI_RC = new Array();
var rr,vv;
rr = "0".charCodeAt(0);
for(vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;
rr = "a".charCodeAt(0);
for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
rr = "A".charCodeAt(0);
for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
function int2char(n) { return BI_RM.charAt(n); }
function intAt(s,i) {
var c = BI_RC[s.charCodeAt(i)];
return (c==null)?-1:c;
}
// (protected) copy this to r
function bnpCopyTo(r) {
for(var i = this.t-1; i >= 0; --i) r[i] = this[i];
r.t = this.t;
r.s = this.s;
}
// (protected) set from integer value x, -DV <= x < DV
function bnpFromInt(x) {
this.t = 1;
this.s = (x<0)?-1:0;
if(x > 0) this[0] = x;
else if(x < -1) this[0] = x+DV;
else this.t = 0;
}
// return bigint initialized to value
function nbv(i) { var r = nbi(); r.fromInt(i); return r; }
// (protected) set from string and radix
function bnpFromString(s,b) {
var k;
if(b == 16) k = 4;
else if(b == 8) k = 3;
else if(b == 256) k = 8; // byte array
else if(b == 2) k = 1;
else if(b == 32) k = 5;
else if(b == 4) k = 2;
else { this.fromRadix(s,b); return; }
this.t = 0;
this.s = 0;
var i = s.length, mi = false, sh = 0;
while(--i >= 0) {
var x = (k==8)?s[i]&0xff:intAt(s,i);
if(x < 0) {
if(s.charAt(i) == "-") mi = true;
continue;
}
mi = false;
if(sh == 0)
this[this.t++] = x;
else if(sh+k > this.DB) {
this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<<sh;
this[this.t++] = (x>>(this.DB-sh));
}
else
this[this.t-1] |= x<<sh;
sh += k;
if(sh >= this.DB) sh -= this.DB;
}
if(k == 8 && (s[0]&0x80) != 0) {
this.s = -1;
if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)<<sh;
}
this.clamp();
if(mi) BigInteger.ZERO.subTo(this,this);
}
// (protected) clamp off excess high words
function bnpClamp() {
var c = this.s&this.DM;
while(this.t > 0 && this[this.t-1] == c) --this.t;
}
// (public) return string representation in given radix
function bnToString(b) {
if(this.s < 0) return "-"+this.negate().toString(b);
var k;
if(b == 16) k = 4;
else if(b == 8) k = 3;
else if(b == 2) k = 1;
else if(b == 32) k = 5;
else if(b == 4) k = 2;
else return this.toRadix(b);
var km = (1<<k)-1, d, m = false, r = "", i = this.t;
var p = this.DB-(i*this.DB)%k;
if(i-- > 0) {
if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }
while(i >= 0) {
if(p < k) {
d = (this[i]&((1<<p)-1))<<(k-p);
d |= this[--i]>>(p+=this.DB-k);
}
else {
d = (this[i]>>(p-=k))&km;
if(p <= 0) { p += this.DB; --i; }
}
if(d > 0) m = true;
if(m) r += int2char(d);
}
}
return m?r:"0";
}
// (public) -this
function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }
// (public) |this|
function bnAbs() { return (this.s<0)?this.negate():this; }
// (public) return + if this > a, - if this < a, 0 if equal
function bnCompareTo(a) {
var r = this.s-a.s;
if(r != 0) return r;
var i = this.t;
r = i-a.t;
if(r != 0) return r;
while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;
return 0;
}
// returns bit length of the integer x
function nbits(x) {
var r = 1, t;
if((t=x>>>16) != 0) { x = t; r += 16; }
if((t=x>>8) != 0) { x = t; r += 8; }
if((t=x>>4) != 0) { x = t; r += 4; }
if((t=x>>2) != 0) { x = t; r += 2; }
if((t=x>>1) != 0) { x = t; r += 1; }
return r;
}
// (public) return the number of bits in "this"
function bnBitLength() {
if(this.t <= 0) return 0;
return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));
}
// (protected) r = this << n*DB
function bnpDLShiftTo(n,r) {
var i;
for(i = this.t-1; i >= 0; --i) r[i+n] = this[i];
for(i = n-1; i >= 0; --i) r[i] = 0;
r.t = this.t+n;
r.s = this.s;
}
// (protected) r = this >> n*DB
function bnpDRShiftTo(n,r) {
for(var i = n; i < this.t; ++i) r[i-n] = this[i];
r.t = Math.max(this.t-n,0);
r.s = this.s;
}
// (protected) r = this << n
function bnpLShiftTo(n,r) {
var bs = n%this.DB;
var cbs = this.DB-bs;
var bm = (1<<cbs)-1;
var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;
for(i = this.t-1; i >= 0; --i) {
r[i+ds+1] = (this[i]>>cbs)|c;
c = (this[i]&bm)<<bs;
}
for(i = ds-1; i >= 0; --i) r[i] = 0;
r[ds] = c;
r.t = this.t+ds+1;
r.s = this.s;
r.clamp();
}
// (protected) r = this >> n
function bnpRShiftTo(n,r) {
r.s = this.s;
var ds = Math.floor(n/this.DB);
if(ds >= this.t) { r.t = 0; return; }
var bs = n%this.DB;
var cbs = this.DB-bs;
var bm = (1<<bs)-1;
r[0] = this[ds]>>bs;
for(var i = ds+1; i < this.t; ++i) {
r[i-ds-1] |= (this[i]&bm)<<cbs;
r[i-ds] = this[i]>>bs;
}
if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;
r.t = this.t-ds;
r.clamp();
}
// (protected) r = this - a
function bnpSubTo(a,r) {
var i = 0, c = 0, m = Math.min(a.t,this.t);
while(i < m) {
c += this[i]-a[i];
r[i++] = c&this.DM;
c >>= this.DB;
}
if(a.t < this.t) {
c -= a.s;
while(i < this.t) {
c += this[i];
r[i++] = c&this.DM;
c >>= this.DB;
}
c += this.s;
}
else {
c += this.s;
while(i < a.t) {
c -= a[i];
r[i++] = c&this.DM;
c >>= this.DB;
}
c -= a.s;
}
r.s = (c<0)?-1:0;
if(c < -1) r[i++] = this.DV+c;
else if(c > 0) r[i++] = c;
r.t = i;
r.clamp();
}
// (protected) r = this * a, r != this,a (HAC 14.12)
// "this" should be the larger one if appropriate.
function bnpMultiplyTo(a,r) {
var x = this.abs(), y = a.abs();
var i = x.t;
r.t = i+y.t;
while(--i >= 0) r[i] = 0;
for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t);
r.s = 0;
r.clamp();
if(this.s != a.s) BigInteger.ZERO.subTo(r,r);
}
// (protected) r = this^2, r != this (HAC 14.16)
function bnpSquareTo(r) {
var x = this.abs();
var i = r.t = 2*x.t;
while(--i >= 0) r[i] = 0;
for(i = 0; i < x.t-1; ++i) {
var c = x.am(i,x[i],r,2*i,0,1);
if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {
r[i+x.t] -= x.DV;
r[i+x.t+1] = 1;
}
}
if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1);
r.s = 0;
r.clamp();
}
// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)
// r != q, this != m. q or r may be null.
function bnpDivRemTo(m,q,r) {
var pm = m.abs();
if(pm.t <= 0) return;
var pt = this.abs();
if(pt.t < pm.t) {
if(q != null) q.fromInt(0);
if(r != null) this.copyTo(r);
return;
}
if(r == null) r = nbi();
var y = nbi(), ts = this.s, ms = m.s;
var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus
if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }
else { pm.copyTo(y); pt.copyTo(r); }
var ys = y.t;
var y0 = y[ys-1];
if(y0 == 0) return;
var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);
var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;
var i = r.t, j = i-ys, t = (q==null)?nbi():q;
y.dlShiftTo(j,t);
if(r.compareTo(t) >= 0) {
r[r.t++] = 1;
r.subTo(t,r);
}
BigInteger.ONE.dlShiftTo(ys,t);
t.subTo(y,y); // "negative" y so we can replace sub with am later
while(y.t < ys) y[y.t++] = 0;
while(--j >= 0) {
// Estimate quotient digit
var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);
if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out
y.dlShiftTo(j,t);
r.subTo(t,r);
while(r[i] < --qd) r.subTo(t,r);
}
}
if(q != null) {
r.drShiftTo(ys,q);
if(ts != ms) BigInteger.ZERO.subTo(q,q);
}
r.t = ys;
r.clamp();
if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder
if(ts < 0) BigInteger.ZERO.subTo(r,r);
}
// (public) this mod a
function bnMod(a) {
var r = nbi();
this.abs().divRemTo(a,null,r);
if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);
return r;
}
// Modular reduction using "classic" algorithm
function Classic(m) { this.m = m; }
function cConvert(x) {
if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);
else return x;
}
function cRevert(x) { return x; }
function cReduce(x) { x.divRemTo(this.m,null,x); }
function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
Classic.prototype.convert = cConvert;
Classic.prototype.revert = cRevert;
Classic.prototype.reduce = cReduce;
Classic.prototype.mulTo = cMulTo;
Classic.prototype.sqrTo = cSqrTo;
// (protected) return "-1/this % 2^DB"; useful for Mont. reduction
// justification:
// xy == 1 (mod m)
// xy = 1+km
// xy(2-xy) = (1+km)(1-km)
// x[y(2-xy)] = 1-k^2m^2
// x[y(2-xy)] == 1 (mod m^2)
// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
// JS multiply "overflows" differently from C/C++, so care is needed here.
function bnpInvDigit() {
if(this.t < 1) return 0;
var x = this[0];
if((x&1) == 0) return 0;
var y = x&3; // y == 1/x mod 2^2
y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4
y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8
y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16
// last step - calculate inverse mod DV directly;
// assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints
y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits
// we really want the negative inverse, and -DV < y < DV
return (y>0)?this.DV-y:-y;
}
// Montgomery reduction
function Montgomery(m) {
this.m = m;
this.mp = m.invDigit();
this.mpl = this.mp&0x7fff;
this.mph = this.mp>>15;
this.um = (1<<(m.DB-15))-1;
this.mt2 = 2*m.t;
}
// xR mod m
function montConvert(x) {
var r = nbi();
x.abs().dlShiftTo(this.m.t,r);
r.divRemTo(this.m,null,r);
if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);
return r;
}
// x/R mod m
function montRevert(x) {
var r = nbi();
x.copyTo(r);
this.reduce(r);
return r;
}
// x = x/R mod m (HAC 14.32)
function montReduce(x) {
while(x.t <= this.mt2) // pad x so am has enough room later
x[x.t++] = 0;
for(var i = 0; i < this.m.t; ++i) {
// faster way of calculating u0 = x[i]*mp mod DV
var j = x[i]&0x7fff;
var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;
// use am to combine the multiply-shift-add into one call
j = i+this.m.t;
x[j] += this.m.am(0,u0,x,i,0,this.m.t);
// propagate carry
while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }
}
x.clamp();
x.drShiftTo(this.m.t,x);
if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
}
// r = "x^2/R mod m"; x != r
function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
// r = "xy/R mod m"; x,y != r
function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
Montgomery.prototype.convert = montConvert;
Montgomery.prototype.revert = montRevert;
Montgomery.prototype.reduce = montReduce;
Montgomery.prototype.mulTo = montMulTo;
Montgomery.prototype.sqrTo = montSqrTo;
// (protected) true iff this is even
function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }
// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)
function bnpExp(e,z) {
if(e > 0xffffffff || e < 1) return BigInteger.ONE;
var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;
g.copyTo(r);
while(--i >= 0) {
z.sqrTo(r,r2);
if((e&(1<<i)) > 0) z.mulTo(r2,g,r);
else { var t = r; r = r2; r2 = t; }
}
return z.revert(r);
}
// (public) this^e % m, 0 <= e < 2^32
function bnModPowInt(e,m) {
var z;
if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);
return this.exp(e,z);
}
// protected
BigInteger.prototype.copyTo = bnpCopyTo;
BigInteger.prototype.fromInt = bnpFromInt;
BigInteger.prototype.fromString = bnpFromString;
BigInteger.prototype.clamp = bnpClamp;
BigInteger.prototype.dlShiftTo = bnpDLShiftTo;
BigInteger.prototype.drShiftTo = bnpDRShiftTo;
BigInteger.prototype.lShiftTo = bnpLShiftTo;
BigInteger.prototype.rShiftTo = bnpRShiftTo;
BigInteger.prototype.subTo = bnpSubTo;
BigInteger.prototype.multiplyTo = bnpMultiplyTo;
BigInteger.prototype.squareTo = bnpSquareTo;
BigInteger.prototype.divRemTo = bnpDivRemTo;
BigInteger.prototype.invDigit = bnpInvDigit;
BigInteger.prototype.isEven = bnpIsEven;
BigInteger.prototype.exp = bnpExp;
// public
BigInteger.prototype.toString = bnToString;
BigInteger.prototype.negate = bnNegate;
BigInteger.prototype.abs = bnAbs;
BigInteger.prototype.compareTo = bnCompareTo;
BigInteger.prototype.bitLength = bnBitLength;
BigInteger.prototype.mod = bnMod;
BigInteger.prototype.modPowInt = bnModPowInt;
// "constants"
BigInteger.ZERO = nbv(0);
BigInteger.ONE = nbv(1);
// ==== File: prng4.js
// prng4.js - uses Arcfour as a PRNG
function Arcfour() {
this.i = 0;
this.j = 0;
this.S = new Array();
}
// Initialize arcfour context from key, an array of ints, each from [0..255]
function ARC4init(key) {
var i, j, t;
for(i = 0; i < 256; ++i)
this.S[i] = i;
j = 0;
for(i = 0; i < 256; ++i) {
j = (j + this.S[i] + key[i % key.length]) & 255;
t = this.S[i];
this.S[i] = this.S[j];
this.S[j] = t;
}
this.i = 0;
this.j = 0;
}
function ARC4next() {
var t;
this.i = (this.i + 1) & 255;
this.j = (this.j + this.S[this.i]) & 255;
t = this.S[this.i];
this.S[this.i] = this.S[this.j];
this.S[this.j] = t;
return this.S[(t + this.S[this.i]) & 255];
}
Arcfour.prototype.init = ARC4init;
Arcfour.prototype.next = ARC4next;
// Plug in your RNG constructor here
function prng_newstate() {
return new Arcfour();
}
// Pool size must be a multiple of 4 and greater than 32.
// An array of bytes the size of the pool will be passed to init()
var rng_psize = 256;
// ==== File: rng.js
// Random number generator - requires a PRNG backend, e.g. prng4.js
// For best results, put code like
// <body onClick='rng_seed_time();' onKeyPress='rng_seed_time();'>
// in your main HTML document.
var rng_state;
var rng_pool;
var rng_pptr;
// Mix in a 32-bit integer into the pool
function rng_seed_int(x) {
rng_pool[rng_pptr++] ^= x & 255;
rng_pool[rng_pptr++] ^= (x >> 8) & 255;
rng_pool[rng_pptr++] ^= (x >> 16) & 255;
rng_pool[rng_pptr++] ^= (x >> 24) & 255;
if(rng_pptr >= rng_psize) rng_pptr -= rng_psize;
}
// Mix in the current time (w/milliseconds) into the pool
function rng_seed_time() {
rng_seed_int(new Date().getTime());
}
// Initialize the pool with junk if needed.
if(rng_pool == null) {
rng_pool = new Array();
rng_pptr = 0;
var t;
if(navigator.appName == "Netscape" && navigator.appVersion < "5" && window.crypto) {
// Extract entropy (256 bits) from NS4 RNG if available
var z = window.crypto.random(32);
for(t = 0; t < z.length; ++t)
rng_pool[rng_pptr++] = z.charCodeAt(t) & 255;
}
while(rng_pptr < rng_psize) { // extract some randomness from Math.random()
t = Math.floor(65536 * Math.random());
rng_pool[rng_pptr++] = t >>> 8;
rng_pool[rng_pptr++] = t & 255;
}
rng_pptr = 0;
rng_seed_time();
//rng_seed_int(window.screenX);
//rng_seed_int(window.screenY);
}
function rng_get_byte() {
if(rng_state == null) {
rng_seed_time();
rng_state = prng_newstate();
rng_state.init(rng_pool);
for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)
rng_pool[rng_pptr] = 0;
rng_pptr = 0;
//rng_pool = null;
}
// TODO: allow reseeding after first request
return rng_state.next();
}
function rng_get_bytes(ba) {
var i;
for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte();
}
function SecureRandom() {}
SecureRandom.prototype.nextBytes = rng_get_bytes;
// ==== File: rsa.js
// Depends on jsbn.js and rng.js
// Version 1.1: support utf-8 encoding in pkcs1pad2
// convert a (hex) string to a bignum object
function parseBigInt(str,r) {
return new BigInteger(str,r);
}
function linebrk(s,n) {
var ret = "";
var i = 0;
while(i + n < s.length) {
ret += s.substring(i,i+n) + "\n";
i += n;
}
return ret + s.substring(i,s.length);
}
function byte2Hex(b) {
if(b < 0x10)
return "0" + b.toString(16);
else
return b.toString(16);
}
// PKCS#1 (type 2, random) pad input string s to n bytes, and return a bigint
function pkcs1pad2(s,n) {
if(n < s.length + 11) { // TODO: fix for utf-8
alert("Message too long for RSA");
return null;
}
var ba = new Array();
var i = s.length - 1;
while(i >= 0 && n > 0) {
var c = s.charCodeAt(i--);
if(c < 128) { // encode using utf-8
ba[--n] = c;
}
else if((c > 127) && (c < 2048)) {
ba[--n] = (c & 63) | 128;
ba[--n] = (c >> 6) | 192;
}
else {
ba[--n] = (c & 63) | 128;
ba[--n] = ((c >> 6) & 63) | 128;
ba[--n] = (c >> 12) | 224;
}
}
ba[--n] = 0;
var rng = new SecureRandom();
var x = new Array();
while(n > 2) { // random non-zero pad
x[0] = 0;
while(x[0] == 0) rng.nextBytes(x);
ba[--n] = x[0];
}
ba[--n] = 2;
ba[--n] = 0;
return new BigInteger(ba);
}
// "empty" RSA key constructor
function RSAKey() {
this.n = null;
this.e = 0;
this.d = null;
this.p = null;
this.q = null;
this.dmp1 = null;
this.dmq1 = null;
this.coeff = null;
}
// Set the public key fields N and e from hex strings
function RSASetPublic(N,E) {
if(N != null && E != null && N.length > 0 && E.length > 0) {
this.n = parseBigInt(N,16);
this.e = parseInt(E,16);
}
else
alert("Invalid RSA public key");
}
// Perform raw public operation on "x": return x^e (mod n)
function RSADoPublic(x) {
return x.modPowInt(this.e, this.n);
}
// Return the PKCS#1 RSA encryption of "text" as an even-length hex string
function RSAEncrypt(text) {
var m = pkcs1pad2(text,(this.n.bitLength()+7)>>3);
if(m == null) return null;
var c = this.doPublic(m);
if(c == null) return null;
var h = c.toString(16);
if((h.length & 1) == 0) return h; else return "0" + h;
}
// Return the PKCS#1 RSA encryption of "text" as a Base64-encoded string
//function RSAEncryptB64(text) {
// var h = this.encrypt(text);
// if(h) return hex2b64(h); else return null;
//}
// protected
RSAKey.prototype.doPublic = RSADoPublic;
// public
RSAKey.prototype.setPublic = RSASetPublic;
RSAKey.prototype.encrypt = RSAEncrypt;
//RSAKey.prototype.encrypt_b64 = RSAEncryptB64;
// ==== File: base64.js
var b64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var b64pad="=";
function hex2b64(h) {
var i;
var c;
var ret = "";
for(i = 0; i+3 <= h.length; i+=3) {
c = parseInt(h.substring(i,i+3),16);
ret += b64map.charAt(c >> 6) + b64map.charAt(c & 63);
}
if(i+1 == h.length) {
c = parseInt(h.substring(i,i+1),16);
ret += b64map.charAt(c << 2);
}
else if(i+2 == h.length) {
c = parseInt(h.substring(i,i+2),16);
ret += b64map.charAt(c >> 2) + b64map.charAt((c & 3) << 4);
}
while((ret.length & 3) > 0) ret += b64pad;
return ret;
}
// convert a base64 string to hex
function b64tohex(s) {
var ret = ""
var i;
var k = 0; // b64 state, 0-3
var slop;
for(i = 0; i < s.length; ++i) {
if(s.charAt(i) == b64pad) break;
v = b64map.indexOf(s.charAt(i));
if(v < 0) continue;
if(k == 0) {
ret += int2char(v >> 2);
slop = v & 3;
k = 1;
}
else if(k == 1) {
ret += int2char((slop << 2) | (v >> 4));
slop = v & 0xf;
k = 2;
}
else if(k == 2) {
ret += int2char(slop);
ret += int2char(v >> 2);
slop = v & 3;
k = 3;
}
else {
ret += int2char((slop << 2) | (v >> 4));
ret += int2char(v & 0xf);
k = 0;
}
}
if(k == 1)
ret += int2char(slop << 2);
return ret;
}
// convert a base64 string to a byte/number array
function b64toBA(s) {
//piggyback on b64tohex for now, optimize later
var h = b64tohex(s);
var i;
var a = new Array();
for(i = 0; 2*i < h.length; ++i) {
a[i] = parseInt(h.substring(2*i,2*i+2),16);
}
return a;
}
@@ -0,0 +1,24 @@
var g,j,k=(244837814094590&16777215)==15715070;function l(b,a,c){if(b!=null)if("number"==typeof b)this.ca(b,a,c);else a==null&&"string"!=typeof b?this.z(b,256):this.z(b,a)}function m(){return new l(null)}function o(b,a,c,d,e,f){for(;--f>=0;){var h=a*this[b++]+c[d]+e;e=Math.floor(h/67108864);c[d++]=h&67108863}return e}
function p(b,a,c,d,e,f){var h=a&32767;for(a=a>>15;--f>=0;){var i=this[b]&32767,n=this[b++]>>15,r=a*i+n*h;i=h*i+((r&32767)<<15)+c[d]+(e&1073741823);e=(i>>>30)+(r>>>15)+a*n+(e>>>30);c[d++]=i&1073741823}return e}function s(b,a,c,d,e,f){var h=a&16383;for(a=a>>14;--f>=0;){var i=this[b]&16383,n=this[b++]>>14,r=a*i+n*h;i=h*i+((r&16383)<<14)+c[d]+e;e=(i>>28)+(r>>14)+a*n;c[d++]=i&268435455}return e}
if(k&&navigator.appName=="Microsoft Internet Explorer"){l.prototype.i=p;j=30}else if(k&&navigator.appName!="Netscape"){l.prototype.i=o;j=26}else{l.prototype.i=s;j=28}g=l.prototype;g.c=j;g.g=(1<<j)-1;g.h=1<<j;g.K=Math.pow(2,52);g.r=52-j;g.s=2*j-52;var t="0123456789abcdefghijklmnopqrstuvwxyz",u=[],x,z;x="0".charCodeAt(0);for(z=0;z<=9;++z)u[x++]=z;x="a".charCodeAt(0);for(z=10;z<36;++z)u[x++]=z;x="A".charCodeAt(0);for(z=10;z<36;++z)u[x++]=z;function A(b,a){b=u[b.charCodeAt(a)];return b==null?-1:b}
function B(b){for(var a=this.a-1;a>=0;--a)b[a]=this[a];b.a=this.a;b.b=this.b}function D(b){this.a=1;this.b=b<0?-1:0;if(b>0)this[0]=b;else if(b<-1)this[0]=b+DV;else this.a=0}function E(b){var a=m();a.w(b);return a}
function F(b,a){if(a==16)a=4;else if(a==8)a=3;else if(a==256)a=8;else if(a==2)a=1;else if(a==32)a=5;else if(a==4)a=2;else{this.da(b,a);return}this.b=this.a=0;for(var c=b.length,d=false,e=0;--c>=0;){var f=a==8?b[c]&255:A(b,c);if(f<0){if(b.charAt(c)=="-")d=true}else{d=false;if(e==0)this[this.a++]=f;else if(e+a>this.c){this[this.a-1]|=(f&(1<<this.c-e)-1)<<e;this[this.a++]=f>>this.c-e}else this[this.a-1]|=f<<e;e+=a;if(e>=this.c)e-=this.c}}if(a==8&&(b[0]&128)!=0){this.b=-1;if(e>0)this[this.a-1]|=(1<<this.c-
e)-1<<e}this.j();d&&G.f(this,this)}function H(){for(var b=this.b&this.g;this.a>0&&this[this.a-1]==b;)--this.a}
function I(b){if(this.b<0)return"-"+this.G().toString(b);if(b==16)b=4;else if(b==8)b=3;else if(b==2)b=1;else if(b==32)b=5;else if(b==4)b=2;else return this.ga(b);var a=(1<<b)-1,c,d=false,e="",f=this.a,h=this.c-f*this.c%b;if(f-- >0){if(h<this.c&&(c=this[f]>>h)>0){d=true;e=t.charAt(c)}for(;f>=0;){if(h<b){c=(this[f]&(1<<h)-1)<<b-h;c|=this[--f]>>(h+=this.c-b)}else{c=this[f]>>(h-=b)&a;if(h<=0){h+=this.c;--f}}if(c>0)d=true;if(d)e+=t.charAt(c)}}return d?e:"0"}
function J(){var b=m();G.f(this,b);return b}function K(){return this.b<0?this.G():this}function L(b){var a=this.b-b.b;if(a!=0)return a;var c=this.a;a=c-b.a;if(a!=0)return a;for(;--c>=0;)if((a=this[c]-b[c])!=0)return a;return 0}function M(b){var a=1,c;if((c=b>>>16)!=0){b=c;a+=16}if((c=b>>8)!=0){b=c;a+=8}if((c=b>>4)!=0){b=c;a+=4}if((c=b>>2)!=0){b=c;a+=2}if(b>>1!=0)a+=1;return a}function N(){if(this.a<=0)return 0;return this.c*(this.a-1)+M(this[this.a-1]^this.b&this.g)}
function aa(b,a){var c;for(c=this.a-1;c>=0;--c)a[c+b]=this[c];for(c=b-1;c>=0;--c)a[c]=0;a.a=this.a+b;a.b=this.b}function ba(b,a){for(var c=b;c<this.a;++c)a[c-b]=this[c];a.a=Math.max(this.a-b,0);a.b=this.b}function ca(b,a){var c=b%this.c,d=this.c-c,e=(1<<d)-1;b=Math.floor(b/this.c);var f=this.b<<c&this.g,h;for(h=this.a-1;h>=0;--h){a[h+b+1]=this[h]>>d|f;f=(this[h]&e)<<c}for(h=b-1;h>=0;--h)a[h]=0;a[b]=f;a.a=this.a+b+1;a.b=this.b;a.j()}
function da(b,a){a.b=this.b;var c=Math.floor(b/this.c);if(c>=this.a)a.a=0;else{b=b%this.c;var d=this.c-b,e=(1<<b)-1;a[0]=this[c]>>b;for(var f=c+1;f<this.a;++f){a[f-c-1]|=(this[f]&e)<<d;a[f-c]=this[f]>>b}if(b>0)a[this.a-c-1]|=(this.b&e)<<d;a.a=this.a-c;a.j()}}
function ea(b,a){for(var c=0,d=0,e=Math.min(b.a,this.a);c<e;){d+=this[c]-b[c];a[c++]=d&this.g;d>>=this.c}if(b.a<this.a){for(d-=b.b;c<this.a;){d+=this[c];a[c++]=d&this.g;d>>=this.c}d+=this.b}else{for(d+=this.b;c<b.a;){d-=b[c];a[c++]=d&this.g;d>>=this.c}d-=b.b}a.b=d<0?-1:0;if(d<-1)a[c++]=this.h+d;else if(d>0)a[c++]=d;a.a=c;a.j()}function fa(b,a){var c=this.abs(),d=b.abs(),e=c.a;for(a.a=e+d.a;--e>=0;)a[e]=0;for(e=0;e<d.a;++e)a[e+c.a]=c.i(0,d[e],a,e,0,c.a);a.b=0;a.j();this.b!=b.b&&G.f(a,a)}
function ga(b){for(var a=this.abs(),c=b.a=2*a.a;--c>=0;)b[c]=0;for(c=0;c<a.a-1;++c){var d=a.i(c,a[c],b,2*c,0,1);if((b[c+a.a]+=a.i(c+1,2*a[c],b,2*c+1,d,a.a-c-1))>=a.h){b[c+a.a]-=a.h;b[c+a.a+1]=1}}if(b.a>0)b[b.a-1]+=a.i(c,a[c],b,2*c,0,1);b.b=0;b.j()}
function ha(b,a,c){var d=b.abs();if(!(d.a<=0)){var e=this.abs();if(e.a<d.a){a!=null&&a.w(0);c!=null&&this.m(c)}else{if(c==null)c=m();var f=m(),h=this.b;b=b.b;var i=this.c-M(d[d.a-1]);if(i>0){d.A(i,f);e.A(i,c)}else{d.m(f);e.m(c)}d=f.a;e=f[d-1];if(e!=0){var n=e*(1<<this.r)+(d>1?f[d-2]>>this.s:0),r=this.K/n;n=(1<<this.r)/n;var ia=1<<this.s,w=c.a,y=w-d,q=a==null?m():a;f.o(y,q);if(c.l(q)>=0){c[c.a++]=1;c.f(q,c)}O.o(d,q);for(q.f(f,f);f.a<d;)f[f.a++]=0;for(;--y>=0;){var C=c[--w]==e?this.g:Math.floor(c[w]*
r+(c[w-1]+ia)*n);if((c[w]+=f.i(0,C,c,y,0,d))<C){f.o(y,q);for(c.f(q,c);c[w]<--C;)c.f(q,c)}}if(a!=null){c.u(d,a);h!=b&&G.f(a,a)}c.a=d;c.j();i>0&&c.W(i,c);h<0&&G.f(c,c)}}}}function ja(b){var a=m();this.abs().p(b,null,a);this.b<0&&a.l(G)>0&&b.f(a,a);return a}function P(b){this.d=b}function ka(b){return b.b<0||b.l(this.d)>=0?b.R(this.d):b}function la(b){return b}function ma(b){b.p(this.d,null,b)}function na(b,a,c){b.F(a,c);this.reduce(c)}function oa(b,a){b.J(a);this.reduce(a)}g=P.prototype;g.t=ka;
g.H=la;g.reduce=ma;g.D=na;g.I=oa;function pa(){if(this.a<1)return 0;var b=this[0];if((b&1)==0)return 0;var a=b&3;a=a*(2-(b&15)*a)&15;a=a*(2-(b&255)*a)&255;a=a*(2-((b&65535)*a&65535))&65535;a=a*(2-b*a%this.h)%this.h;return a>0?this.h-a:-a}function Q(b){this.d=b;this.B=b.P();this.C=this.B&32767;this.T=this.B>>15;this.Y=(1<<b.c-15)-1;this.U=2*b.a}function qa(b){var a=m();b.abs().o(this.d.a,a);a.p(this.d,null,a);b.b<0&&a.l(G)>0&&this.d.f(a,a);return a}
function ra(b){var a=m();b.m(a);this.reduce(a);return a}function sa(b){for(;b.a<=this.U;)b[b.a++]=0;for(var a=0;a<this.d.a;++a){var c=b[a]&32767,d=c*this.C+((c*this.T+(b[a]>>15)*this.C&this.Y)<<15)&b.g;c=a+this.d.a;for(b[c]+=this.d.i(0,d,b,a,0,this.d.a);b[c]>=b.h;){b[c]-=b.h;b[++c]++}}b.j();b.u(this.d.a,b);b.l(this.d)>=0&&b.f(this.d,b)}function ta(b,a){b.J(a);this.reduce(a)}function ua(b,a,c){b.F(a,c);this.reduce(c)}g=Q.prototype;g.t=qa;g.H=ra;g.reduce=sa;g.D=ua;g.I=ta;
function va(){return(this.a>0?this[0]&1:this.b)==0}function wa(b,a){if(b>4294967295||b<1)return O;var c=m(),d=m(),e=a.t(this),f=M(b)-1;for(e.m(c);--f>=0;){a.I(c,d);if((b&1<<f)>0)a.D(d,e,c);else{var h=c;c=d;d=h}}return a.H(c)}function xa(b,a){a=b<256||a.Q()?new P(a):new Q(a);return this.exp(b,a)}g=l.prototype;g.m=B;g.w=D;g.z=F;g.j=H;g.o=aa;g.u=ba;g.A=ca;g.W=da;g.f=ea;g.F=fa;g.J=ga;g.p=ha;g.P=pa;g.Q=va;g.exp=wa;g.toString=I;g.G=J;g.abs=K;g.l=L;g.L=N;g.R=ja;g.S=xa;var G=E(0),O=E(1);
function R(){this.n=this.k=0;this.e=[]}function ya(b){var a,c,d;for(a=0;a<256;++a)this.e[a]=a;for(a=c=0;a<256;++a){c=c+this.e[a]+b[a%b.length]&255;d=this.e[a];this.e[a]=this.e[c];this.e[c]=d}this.n=this.k=0}function za(){var b;this.k=this.k+1&255;this.n=this.n+this.e[this.k]&255;b=this.e[this.k];this.e[this.k]=this.e[this.n];this.e[this.n]=b;return this.e[b+this.e[this.k]&255]}R.prototype.O=ya;R.prototype.next=za;var S=256,T,U,V;
function W(b){U[V++]^=b&255;U[V++]^=b>>8&255;U[V++]^=b>>16&255;U[V++]^=b>>24&255;if(V>=S)V-=S}if(U==null){U=[];V=0;var X;if(navigator.appName=="Netscape"&&navigator.appVersion<"5"&&window.crypto){var Y=window.crypto.random(32);for(X=0;X<Y.length;++X)U[V++]=Y.charCodeAt(X)&255}for(;V<S;){X=Math.floor(65536*Math.random());U[V++]=X>>>8;U[V++]=X&255}V=0;W((new Date).getTime())}function Aa(){if(T==null){W((new Date).getTime());T=new R;T.O(U);for(V=0;V<U.length;++V)U[V]=0;V=0}return T.next()}
function Ba(b){var a;for(a=0;a<b.length;++a)b[a]=Aa()}function Z(){}Z.prototype.V=Ba;function ZZZ(){this.q=null;this.v=0;this.Z=this.ba=this.aa=this.fa=this.ea=this.ZZZ=null}function Ca(b,a){if(b!=null&&a!=null&&b.length>0&&a.length>0){this.q=new l(b,16);this.v=parseInt(a,16)}else alert("Invalid RSA public key")}function Da(b){return b.S(this.v,this.q)}
function Ea(b){var a;a=this.q.L()+7>>3;if(a<b.length+11){alert("Message too long for RSA");a=null}else{for(var c=[],d=b.length-1;d>=0&&a>0;){var e=b.charCodeAt(d--);if(e<128)c[--a]=e;else if(e>127&&e<2048){c[--a]=e&63|128;c[--a]=e>>6|192}else{c[--a]=e&63|128;c[--a]=e>>6&63|128;c[--a]=e>>12|224}}c[--a]=0;b=new Z;for(d=[];a>2;){for(d[0]=0;d[0]==0;)b.V(d);c[--a]=d[0]}c[--a]=2;c[--a]=0;a=new l(c)}if(a==null)return null;a=this.M(a);if(a==null)return null;a=a.toString(16);return(a.length&1)==0?a:"0"+a}
ZZZ.prototype.M=Da;ZZZ.prototype.X=Ca;ZZZ.prototype.N=Ea;window.encrypt=function(b,a,c){var d=new ZZZ;d.X(c,a);b=d.N(b);d="";for(a=0;a+3<=b.length;a+=3){c=parseInt(b.substring(a,a+3),16);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c>>6)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c&63)}if(a+1==b.length){c=parseInt(b.substring(a,a+1),16);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c<<2)}else if(a+2==b.length){c=parseInt(b.substring(a,a+2),16);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c>>
2)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c&3)<<4)}for(;(d.length&3)>0;)d+="=";return d};
@@ -0,0 +1,73 @@
// ==== File: base64.js
var b64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var b64pad="=";
function hex2b64(h) {
var i;
var c;
var ret = "";
for(i = 0; i+3 <= h.length; i+=3) {
c = parseInt(h.substring(i,i+3),16);
ret += b64map.charAt(c >> 6) + b64map.charAt(c & 63);
}
if(i+1 == h.length) {
c = parseInt(h.substring(i,i+1),16);
ret += b64map.charAt(c << 2);
}
else if(i+2 == h.length) {
c = parseInt(h.substring(i,i+2),16);
ret += b64map.charAt(c >> 2) + b64map.charAt((c & 3) << 4);
}
while((ret.length & 3) > 0) ret += b64pad;
return ret;
}
// convert a base64 string to hex
function b64tohex(s) {
var ret = ""
var i;
var k = 0; // b64 state, 0-3
var slop;
for(i = 0; i < s.length; ++i) {
if(s.charAt(i) == b64pad) break;
v = b64map.indexOf(s.charAt(i));
if(v < 0) continue;
if(k == 0) {
ret += int2char(v >> 2);
slop = v & 3;
k = 1;
}
else if(k == 1) {
ret += int2char((slop << 2) | (v >> 4));
slop = v & 0xf;
k = 2;
}
else if(k == 2) {
ret += int2char(slop);
ret += int2char(v >> 2);
slop = v & 3;
k = 3;
}
else {
ret += int2char((slop << 2) | (v >> 4));
ret += int2char(v & 0xf);
k = 0;
}
}
if(k == 1)
ret += int2char(slop << 2);
return ret;
}
// convert a base64 string to a byte/number array
function b64toBA(s) {
//piggyback on b64tohex for now, optimize later
var h = b64tohex(s);
var i;
var a = new Array();
for(i = 0; 2*i < h.length; ++i) {
a[i] = parseInt(h.substring(2*i,2*i+2),16);
}
return a;
}
@@ -0,0 +1,562 @@
// Downloaded from http://www-cs-students.stanford.edu/~tjw/ at Tue Nov 30 00:42:57 PST 2010
// ==== File: jsbn.js
// Copyright (c) 2005 Tom Wu
// All Rights Reserved.
// See "LICENSE" for details.
// Basic JavaScript BN library - subset useful for RSA encryption.
// Bits per digit
var dbits;
// JavaScript engine analysis
var canary = 0xdeadbeefcafe;
var j_lm = ((canary&0xffffff)==0xefcafe);
// (public) Constructor
function BigInteger(a,b,c) {
if(a != null)
if("number" == typeof a) this.fromNumber(a,b,c);
else if(b == null && "string" != typeof a) this.fromString(a,256);
else this.fromString(a,b);
}
// return new, unset BigInteger
function nbi() { return new BigInteger(null); }
// am: Compute w_j += (x*this_i), propagate carries,
// c is initial carry, returns final carry.
// c < 3*dvalue, x < 2*dvalue, this_i < dvalue
// We need to select the fastest one that works in this environment.
// am1: use a single mult and divide to get the high bits,
// max digit bits should be 26 because
// max internal value = 2*dvalue^2-2*dvalue (< 2^53)
function am1(i,x,w,j,c,n) {
while(--n >= 0) {
var v = x*this[i++]+w[j]+c;
c = Math.floor(v/0x4000000);
w[j++] = v&0x3ffffff;
}
return c;
}
// am2 avoids a big mult-and-extract completely.
// Max digit bits should be <= 30 because we do bitwise ops
// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)
function am2(i,x,w,j,c,n) {
var xl = x&0x7fff, xh = x>>15;
while(--n >= 0) {
var l = this[i]&0x7fff;
var h = this[i++]>>15;
var m = xh*l+h*xl;
l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);
c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);
w[j++] = l&0x3fffffff;
}
return c;
}
// Alternately, set max digit bits to 28 since some
// browsers slow down when dealing with 32-bit numbers.
function am3(i,x,w,j,c,n) {
var xl = x&0x3fff, xh = x>>14;
while(--n >= 0) {
var l = this[i]&0x3fff;
var h = this[i++]>>14;
var m = xh*l+h*xl;
l = xl*l+((m&0x3fff)<<14)+w[j]+c;
c = (l>>28)+(m>>14)+xh*h;
w[j++] = l&0xfffffff;
}
return c;
}
if(j_lm && (navigator.appName == "Microsoft Internet Explorer")) {
BigInteger.prototype.am = am2;
dbits = 30;
}
else if(j_lm && (navigator.appName != "Netscape")) {
BigInteger.prototype.am = am1;
dbits = 26;
}
else { // Mozilla/Netscape seems to prefer am3
BigInteger.prototype.am = am3;
dbits = 28;
}
BigInteger.prototype.DB = dbits;
BigInteger.prototype.DM = ((1<<dbits)-1);
BigInteger.prototype.DV = (1<<dbits);
var BI_FP = 52;
BigInteger.prototype.FV = Math.pow(2,BI_FP);
BigInteger.prototype.F1 = BI_FP-dbits;
BigInteger.prototype.F2 = 2*dbits-BI_FP;
// Digit conversions
var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz";
var BI_RC = new Array();
var rr,vv;
rr = "0".charCodeAt(0);
for(vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;
rr = "a".charCodeAt(0);
for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
rr = "A".charCodeAt(0);
for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
function int2char(n) { return BI_RM.charAt(n); }
function intAt(s,i) {
var c = BI_RC[s.charCodeAt(i)];
return (c==null)?-1:c;
}
// (protected) copy this to r
function bnpCopyTo(r) {
for(var i = this.t-1; i >= 0; --i) r[i] = this[i];
r.t = this.t;
r.s = this.s;
}
// (protected) set from integer value x, -DV <= x < DV
function bnpFromInt(x) {
this.t = 1;
this.s = (x<0)?-1:0;
if(x > 0) this[0] = x;
else if(x < -1) this[0] = x+DV;
else this.t = 0;
}
// return bigint initialized to value
function nbv(i) { var r = nbi(); r.fromInt(i); return r; }
// (protected) set from string and radix
function bnpFromString(s,b) {
var k;
if(b == 16) k = 4;
else if(b == 8) k = 3;
else if(b == 256) k = 8; // byte array
else if(b == 2) k = 1;
else if(b == 32) k = 5;
else if(b == 4) k = 2;
else { this.fromRadix(s,b); return; }
this.t = 0;
this.s = 0;
var i = s.length, mi = false, sh = 0;
while(--i >= 0) {
var x = (k==8)?s[i]&0xff:intAt(s,i);
if(x < 0) {
if(s.charAt(i) == "-") mi = true;
continue;
}
mi = false;
if(sh == 0)
this[this.t++] = x;
else if(sh+k > this.DB) {
this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<<sh;
this[this.t++] = (x>>(this.DB-sh));
}
else
this[this.t-1] |= x<<sh;
sh += k;
if(sh >= this.DB) sh -= this.DB;
}
if(k == 8 && (s[0]&0x80) != 0) {
this.s = -1;
if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)<<sh;
}
this.clamp();
if(mi) BigInteger.ZERO.subTo(this,this);
}
// (protected) clamp off excess high words
function bnpClamp() {
var c = this.s&this.DM;
while(this.t > 0 && this[this.t-1] == c) --this.t;
}
// (public) return string representation in given radix
function bnToString(b) {
if(this.s < 0) return "-"+this.negate().toString(b);
var k;
if(b == 16) k = 4;
else if(b == 8) k = 3;
else if(b == 2) k = 1;
else if(b == 32) k = 5;
else if(b == 4) k = 2;
else return this.toRadix(b);
var km = (1<<k)-1, d, m = false, r = "", i = this.t;
var p = this.DB-(i*this.DB)%k;
if(i-- > 0) {
if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }
while(i >= 0) {
if(p < k) {
d = (this[i]&((1<<p)-1))<<(k-p);
d |= this[--i]>>(p+=this.DB-k);
}
else {
d = (this[i]>>(p-=k))&km;
if(p <= 0) { p += this.DB; --i; }
}
if(d > 0) m = true;
if(m) r += int2char(d);
}
}
return m?r:"0";
}
// (public) -this
function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }
// (public) |this|
function bnAbs() { return (this.s<0)?this.negate():this; }
// (public) return + if this > a, - if this < a, 0 if equal
function bnCompareTo(a) {
var r = this.s-a.s;
if(r != 0) return r;
var i = this.t;
r = i-a.t;
if(r != 0) return r;
while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;
return 0;
}
// returns bit length of the integer x
function nbits(x) {
var r = 1, t;
if((t=x>>>16) != 0) { x = t; r += 16; }
if((t=x>>8) != 0) { x = t; r += 8; }
if((t=x>>4) != 0) { x = t; r += 4; }
if((t=x>>2) != 0) { x = t; r += 2; }
if((t=x>>1) != 0) { x = t; r += 1; }
return r;
}
// (public) return the number of bits in "this"
function bnBitLength() {
if(this.t <= 0) return 0;
return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));
}
// (protected) r = this << n*DB
function bnpDLShiftTo(n,r) {
var i;
for(i = this.t-1; i >= 0; --i) r[i+n] = this[i];
for(i = n-1; i >= 0; --i) r[i] = 0;
r.t = this.t+n;
r.s = this.s;
}
// (protected) r = this >> n*DB
function bnpDRShiftTo(n,r) {
for(var i = n; i < this.t; ++i) r[i-n] = this[i];
r.t = Math.max(this.t-n,0);
r.s = this.s;
}
// (protected) r = this << n
function bnpLShiftTo(n,r) {
var bs = n%this.DB;
var cbs = this.DB-bs;
var bm = (1<<cbs)-1;
var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;
for(i = this.t-1; i >= 0; --i) {
r[i+ds+1] = (this[i]>>cbs)|c;
c = (this[i]&bm)<<bs;
}
for(i = ds-1; i >= 0; --i) r[i] = 0;
r[ds] = c;
r.t = this.t+ds+1;
r.s = this.s;
r.clamp();
}
// (protected) r = this >> n
function bnpRShiftTo(n,r) {
r.s = this.s;
var ds = Math.floor(n/this.DB);
if(ds >= this.t) { r.t = 0; return; }
var bs = n%this.DB;
var cbs = this.DB-bs;
var bm = (1<<bs)-1;
r[0] = this[ds]>>bs;
for(var i = ds+1; i < this.t; ++i) {
r[i-ds-1] |= (this[i]&bm)<<cbs;
r[i-ds] = this[i]>>bs;
}
if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;
r.t = this.t-ds;
r.clamp();
}
// (protected) r = this - a
function bnpSubTo(a,r) {
var i = 0, c = 0, m = Math.min(a.t,this.t);
while(i < m) {
c += this[i]-a[i];
r[i++] = c&this.DM;
c >>= this.DB;
}
if(a.t < this.t) {
c -= a.s;
while(i < this.t) {
c += this[i];
r[i++] = c&this.DM;
c >>= this.DB;
}
c += this.s;
}
else {
c += this.s;
while(i < a.t) {
c -= a[i];
r[i++] = c&this.DM;
c >>= this.DB;
}
c -= a.s;
}
r.s = (c<0)?-1:0;
if(c < -1) r[i++] = this.DV+c;
else if(c > 0) r[i++] = c;
r.t = i;
r.clamp();
}
// (protected) r = this * a, r != this,a (HAC 14.12)
// "this" should be the larger one if appropriate.
function bnpMultiplyTo(a,r) {
var x = this.abs(), y = a.abs();
var i = x.t;
r.t = i+y.t;
while(--i >= 0) r[i] = 0;
for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t);
r.s = 0;
r.clamp();
if(this.s != a.s) BigInteger.ZERO.subTo(r,r);
}
// (protected) r = this^2, r != this (HAC 14.16)
function bnpSquareTo(r) {
var x = this.abs();
var i = r.t = 2*x.t;
while(--i >= 0) r[i] = 0;
for(i = 0; i < x.t-1; ++i) {
var c = x.am(i,x[i],r,2*i,0,1);
if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {
r[i+x.t] -= x.DV;
r[i+x.t+1] = 1;
}
}
if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1);
r.s = 0;
r.clamp();
}
// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)
// r != q, this != m. q or r may be null.
function bnpDivRemTo(m,q,r) {
var pm = m.abs();
if(pm.t <= 0) return;
var pt = this.abs();
if(pt.t < pm.t) {
if(q != null) q.fromInt(0);
if(r != null) this.copyTo(r);
return;
}
if(r == null) r = nbi();
var y = nbi(), ts = this.s, ms = m.s;
var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus
if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }
else { pm.copyTo(y); pt.copyTo(r); }
var ys = y.t;
var y0 = y[ys-1];
if(y0 == 0) return;
var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);
var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;
var i = r.t, j = i-ys, t = (q==null)?nbi():q;
y.dlShiftTo(j,t);
if(r.compareTo(t) >= 0) {
r[r.t++] = 1;
r.subTo(t,r);
}
BigInteger.ONE.dlShiftTo(ys,t);
t.subTo(y,y); // "negative" y so we can replace sub with am later
while(y.t < ys) y[y.t++] = 0;
while(--j >= 0) {
// Estimate quotient digit
var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);
if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out
y.dlShiftTo(j,t);
r.subTo(t,r);
while(r[i] < --qd) r.subTo(t,r);
}
}
if(q != null) {
r.drShiftTo(ys,q);
if(ts != ms) BigInteger.ZERO.subTo(q,q);
}
r.t = ys;
r.clamp();
if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder
if(ts < 0) BigInteger.ZERO.subTo(r,r);
}
// (public) this mod a
function bnMod(a) {
var r = nbi();
this.abs().divRemTo(a,null,r);
if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);
return r;
}
// Modular reduction using "classic" algorithm
function Classic(m) { this.m = m; }
function cConvert(x) {
if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);
else return x;
}
function cRevert(x) { return x; }
function cReduce(x) { x.divRemTo(this.m,null,x); }
function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
Classic.prototype.convert = cConvert;
Classic.prototype.revert = cRevert;
Classic.prototype.reduce = cReduce;
Classic.prototype.mulTo = cMulTo;
Classic.prototype.sqrTo = cSqrTo;
// (protected) return "-1/this % 2^DB"; useful for Mont. reduction
// justification:
// xy == 1 (mod m)
// xy = 1+km
// xy(2-xy) = (1+km)(1-km)
// x[y(2-xy)] = 1-k^2m^2
// x[y(2-xy)] == 1 (mod m^2)
// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
// JS multiply "overflows" differently from C/C++, so care is needed here.
function bnpInvDigit() {
if(this.t < 1) return 0;
var x = this[0];
if((x&1) == 0) return 0;
var y = x&3; // y == 1/x mod 2^2
y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4
y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8
y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16
// last step - calculate inverse mod DV directly;
// assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints
y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits
// we really want the negative inverse, and -DV < y < DV
return (y>0)?this.DV-y:-y;
}
// Montgomery reduction
function Montgomery(m) {
this.m = m;
this.mp = m.invDigit();
this.mpl = this.mp&0x7fff;
this.mph = this.mp>>15;
this.um = (1<<(m.DB-15))-1;
this.mt2 = 2*m.t;
}
// xR mod m
function montConvert(x) {
var r = nbi();
x.abs().dlShiftTo(this.m.t,r);
r.divRemTo(this.m,null,r);
if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);
return r;
}
// x/R mod m
function montRevert(x) {
var r = nbi();
x.copyTo(r);
this.reduce(r);
return r;
}
// x = x/R mod m (HAC 14.32)
function montReduce(x) {
while(x.t <= this.mt2) // pad x so am has enough room later
x[x.t++] = 0;
for(var i = 0; i < this.m.t; ++i) {
// faster way of calculating u0 = x[i]*mp mod DV
var j = x[i]&0x7fff;
var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;
// use am to combine the multiply-shift-add into one call
j = i+this.m.t;
x[j] += this.m.am(0,u0,x,i,0,this.m.t);
// propagate carry
while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }
}
x.clamp();
x.drShiftTo(this.m.t,x);
if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
}
// r = "x^2/R mod m"; x != r
function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
// r = "xy/R mod m"; x,y != r
function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
Montgomery.prototype.convert = montConvert;
Montgomery.prototype.revert = montRevert;
Montgomery.prototype.reduce = montReduce;
Montgomery.prototype.mulTo = montMulTo;
Montgomery.prototype.sqrTo = montSqrTo;
// (protected) true iff this is even
function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }
// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)
function bnpExp(e,z) {
if(e > 0xffffffff || e < 1) return BigInteger.ONE;
var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;
g.copyTo(r);
while(--i >= 0) {
z.sqrTo(r,r2);
if((e&(1<<i)) > 0) z.mulTo(r2,g,r);
else { var t = r; r = r2; r2 = t; }
}
return z.revert(r);
}
// (public) this^e % m, 0 <= e < 2^32
function bnModPowInt(e,m) {
var z;
if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);
return this.exp(e,z);
}
// protected
BigInteger.prototype.copyTo = bnpCopyTo;
BigInteger.prototype.fromInt = bnpFromInt;
BigInteger.prototype.fromString = bnpFromString;
BigInteger.prototype.clamp = bnpClamp;
BigInteger.prototype.dlShiftTo = bnpDLShiftTo;
BigInteger.prototype.drShiftTo = bnpDRShiftTo;
BigInteger.prototype.lShiftTo = bnpLShiftTo;
BigInteger.prototype.rShiftTo = bnpRShiftTo;
BigInteger.prototype.subTo = bnpSubTo;
BigInteger.prototype.multiplyTo = bnpMultiplyTo;
BigInteger.prototype.squareTo = bnpSquareTo;
BigInteger.prototype.divRemTo = bnpDivRemTo;
BigInteger.prototype.invDigit = bnpInvDigit;
BigInteger.prototype.isEven = bnpIsEven;
BigInteger.prototype.exp = bnpExp;
// public
BigInteger.prototype.toString = bnToString;
BigInteger.prototype.negate = bnNegate;
BigInteger.prototype.abs = bnAbs;
BigInteger.prototype.compareTo = bnCompareTo;
BigInteger.prototype.bitLength = bnBitLength;
BigInteger.prototype.mod = bnMod;
BigInteger.prototype.modPowInt = bnModPowInt;
// "constants"
BigInteger.ZERO = nbv(0);
BigInteger.ONE = nbv(1);
@@ -0,0 +1,47 @@
// ==== File: prng4.js
// prng4.js - uses Arcfour as a PRNG
function Arcfour() {
this.i = 0;
this.j = 0;
this.S = new Array();
}
// Initialize arcfour context from key, an array of ints, each from [0..255]
function ARC4init(key) {
var i, j, t;
for(i = 0; i < 256; ++i)
this.S[i] = i;
j = 0;
for(i = 0; i < 256; ++i) {
j = (j + this.S[i] + key[i % key.length]) & 255;
t = this.S[i];
this.S[i] = this.S[j];
this.S[j] = t;
}
this.i = 0;
this.j = 0;
}
function ARC4next() {
var t;
this.i = (this.i + 1) & 255;
this.j = (this.j + this.S[this.i]) & 255;
t = this.S[this.i];
this.S[this.i] = this.S[this.j];
this.S[this.j] = t;
return this.S[(t + this.S[this.i]) & 255];
}
Arcfour.prototype.init = ARC4init;
Arcfour.prototype.next = ARC4next;
// Plug in your RNG constructor here
function prng_newstate() {
return new Arcfour();
}
// Pool size must be a multiple of 4 and greater than 32.
// An array of bytes the size of the pool will be passed to init()
var rng_psize = 256;
@@ -0,0 +1,70 @@
// ==== File: rng.js
// Random number generator - requires a PRNG backend, e.g. prng4.js
// For best results, put code like
// <body onClick='rng_seed_time();' onKeyPress='rng_seed_time();'>
// in your main HTML document.
var rng_state;
var rng_pool;
var rng_pptr;
// Mix in a 32-bit integer into the pool
function rng_seed_int(x) {
rng_pool[rng_pptr++] ^= x & 255;
rng_pool[rng_pptr++] ^= (x >> 8) & 255;
rng_pool[rng_pptr++] ^= (x >> 16) & 255;
rng_pool[rng_pptr++] ^= (x >> 24) & 255;
if(rng_pptr >= rng_psize) rng_pptr -= rng_psize;
}
// Mix in the current time (w/milliseconds) into the pool
function rng_seed_time() {
rng_seed_int(new Date().getTime());
}
// Initialize the pool with junk if needed.
if(rng_pool == null) {
rng_pool = new Array();
rng_pptr = 0;
var t;
if(navigator.appName == "Netscape" && navigator.appVersion < "5" && window.crypto) {
// Extract entropy (256 bits) from NS4 RNG if available
var z = window.crypto.random(32);
for(t = 0; t < z.length; ++t)
rng_pool[rng_pptr++] = z.charCodeAt(t) & 255;
}
while(rng_pptr < rng_psize) { // extract some randomness from Math.random()
t = Math.floor(65536 * Math.random());
rng_pool[rng_pptr++] = t >>> 8;
rng_pool[rng_pptr++] = t & 255;
}
rng_pptr = 0;
rng_seed_time();
//rng_seed_int(window.screenX);
//rng_seed_int(window.screenY);
}
function rng_get_byte() {
if(rng_state == null) {
rng_seed_time();
rng_state = prng_newstate();
rng_state.init(rng_pool);
for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)
rng_pool[rng_pptr] = 0;
rng_pptr = 0;
//rng_pool = null;
}
// TODO: allow reseeding after first request
return rng_state.next();
}
function rng_get_bytes(ba) {
var i;
for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte();
}
function SecureRandom() {}
SecureRandom.prototype.nextBytes = rng_get_bytes;
@@ -0,0 +1,114 @@
// ==== File: rsa.js
// Depends on jsbn.js and rng.js
// Version 1.1: support utf-8 encoding in pkcs1pad2
// convert a (hex) string to a bignum object
function parseBigInt(str,r) {
return new BigInteger(str,r);
}
function linebrk(s,n) {
var ret = "";
var i = 0;
while(i + n < s.length) {
ret += s.substring(i,i+n) + "\n";
i += n;
}
return ret + s.substring(i,s.length);
}
function byte2Hex(b) {
if(b < 0x10)
return "0" + b.toString(16);
else
return b.toString(16);
}
// PKCS#1 (type 2, random) pad input string s to n bytes, and return a bigint
function pkcs1pad2(s,n) {
if(n < s.length + 11) { // TODO: fix for utf-8
alert("Message too long for RSA");
return null;
}
var ba = new Array();
var i = s.length - 1;
while(i >= 0 && n > 0) {
var c = s.charCodeAt(i--);
if(c < 128) { // encode using utf-8
ba[--n] = c;
}
else if((c > 127) && (c < 2048)) {
ba[--n] = (c & 63) | 128;
ba[--n] = (c >> 6) | 192;
}
else {
ba[--n] = (c & 63) | 128;
ba[--n] = ((c >> 6) & 63) | 128;
ba[--n] = (c >> 12) | 224;
}
}
ba[--n] = 0;
var rng = new SecureRandom();
var x = new Array();
while(n > 2) { // random non-zero pad
x[0] = 0;
while(x[0] == 0) rng.nextBytes(x);
ba[--n] = x[0];
}
ba[--n] = 2;
ba[--n] = 0;
return new BigInteger(ba);
}
// "empty" RSA key constructor
function RSAKey() {
this.n = null;
this.e = 0;
this.d = null;
this.p = null;
this.q = null;
this.dmp1 = null;
this.dmq1 = null;
this.coeff = null;
}
// Set the public key fields N and e from hex strings
function RSASetPublic(N,E) {
if(N != null && E != null && N.length > 0 && E.length > 0) {
this.n = parseBigInt(N,16);
this.e = parseInt(E,16);
}
else
alert("Invalid RSA public key");
}
// Perform raw public operation on "x": return x^e (mod n)
function RSADoPublic(x) {
return x.modPowInt(this.e, this.n);
}
// Return the PKCS#1 RSA encryption of "text" as an even-length hex string
function RSAEncrypt(text) {
var m = pkcs1pad2(text,(this.n.bitLength()+7)>>3);
if(m == null) return null;
var c = this.doPublic(m);
if(c == null) return null;
var h = c.toString(16);
if((h.length & 1) == 0) return h; else return "0" + h;
}
// Return the PKCS#1 RSA encryption of "text" as a Base64-encoded string
//function RSAEncryptB64(text) {
// var h = this.encrypt(text);
// if(h) return hex2b64(h); else return null;
//}
// protected
RSAKey.prototype.doPublic = RSADoPublic;
// public
RSAKey.prototype.setPublic = RSASetPublic;
RSAKey.prototype.encrypt = RSAEncrypt;
//RSAKey.prototype.encrypt_b64 = RSAEncryptB64;
@@ -0,0 +1,71 @@
var b64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var b64padchar="=";
function hex2b64(h) {
var i;
var c;
var ret = "";
for(i = 0; i+3 <= h.length; i+=3) {
c = parseInt(h.substring(i,i+3),16);
ret += b64map.charAt(c >> 6) + b64map.charAt(c & 63);
}
if(i+1 == h.length) {
c = parseInt(h.substring(i,i+1),16);
ret += b64map.charAt(c << 2);
}
else if(i+2 == h.length) {
c = parseInt(h.substring(i,i+2),16);
ret += b64map.charAt(c >> 2) + b64map.charAt((c & 3) << 4);
}
while((ret.length & 3) > 0) ret += b64padchar;
return ret;
}
// convert a base64 string to hex
function b64tohex(s) {
var ret = ""
var i;
var k = 0; // b64 state, 0-3
var slop;
for(i = 0; i < s.length; ++i) {
if(s.charAt(i) == b64padchar) break;
v = b64map.indexOf(s.charAt(i));
if(v < 0) continue;
if(k == 0) {
ret += int2char(v >> 2);
slop = v & 3;
k = 1;
}
else if(k == 1) {
ret += int2char((slop << 2) | (v >> 4));
slop = v & 0xf;
k = 2;
}
else if(k == 2) {
ret += int2char(slop);
ret += int2char(v >> 2);
slop = v & 3;
k = 3;
}
else {
ret += int2char((slop << 2) | (v >> 4));
ret += int2char(v & 0xf);
k = 0;
}
}
if(k == 1)
ret += int2char(slop << 2);
return ret;
}
// convert a base64 string to a byte/number array
function b64toBA(s) {
//piggyback on b64tohex for now, optimize later
var h = b64tohex(s);
var i;
var a = new Array();
for(i = 0; 2*i < h.length; ++i) {
a[i] = parseInt(h.substring(2*i,2*i+2),16);
}
return a;
}
@@ -0,0 +1,559 @@
// Copyright (c) 2005 Tom Wu
// All Rights Reserved.
// See "LICENSE" for details.
// Basic JavaScript BN library - subset useful for RSA encryption.
// Bits per digit
var dbits;
// JavaScript engine analysis
var canary = 0xdeadbeefcafe;
var j_lm = ((canary&0xffffff)==0xefcafe);
// (public) Constructor
function BigInteger(a,b,c) {
if(a != null)
if("number" == typeof a) this.fromNumber(a,b,c);
else if(b == null && "string" != typeof a) this.fromString(a,256);
else this.fromString(a,b);
}
// return new, unset BigInteger
function nbi() { return new BigInteger(null); }
// am: Compute w_j += (x*this_i), propagate carries,
// c is initial carry, returns final carry.
// c < 3*dvalue, x < 2*dvalue, this_i < dvalue
// We need to select the fastest one that works in this environment.
// am1: use a single mult and divide to get the high bits,
// max digit bits should be 26 because
// max internal value = 2*dvalue^2-2*dvalue (< 2^53)
function am1(i,x,w,j,c,n) {
while(--n >= 0) {
var v = x*this[i++]+w[j]+c;
c = Math.floor(v/0x4000000);
w[j++] = v&0x3ffffff;
}
return c;
}
// am2 avoids a big mult-and-extract completely.
// Max digit bits should be <= 30 because we do bitwise ops
// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)
function am2(i,x,w,j,c,n) {
var xl = x&0x7fff, xh = x>>15;
while(--n >= 0) {
var l = this[i]&0x7fff;
var h = this[i++]>>15;
var m = xh*l+h*xl;
l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);
c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);
w[j++] = l&0x3fffffff;
}
return c;
}
// Alternately, set max digit bits to 28 since some
// browsers slow down when dealing with 32-bit numbers.
function am3(i,x,w,j,c,n) {
var xl = x&0x3fff, xh = x>>14;
while(--n >= 0) {
var l = this[i]&0x3fff;
var h = this[i++]>>14;
var m = xh*l+h*xl;
l = xl*l+((m&0x3fff)<<14)+w[j]+c;
c = (l>>28)+(m>>14)+xh*h;
w[j++] = l&0xfffffff;
}
return c;
}
if(j_lm && (navigator.appName == "Microsoft Internet Explorer")) {
BigInteger.prototype.am = am2;
dbits = 30;
}
else if(j_lm && (navigator.appName != "Netscape")) {
BigInteger.prototype.am = am1;
dbits = 26;
}
else { // Mozilla/Netscape seems to prefer am3
BigInteger.prototype.am = am3;
dbits = 28;
}
BigInteger.prototype.DB = dbits;
BigInteger.prototype.DM = ((1<<dbits)-1);
BigInteger.prototype.DV = (1<<dbits);
var BI_FP = 52;
BigInteger.prototype.FV = Math.pow(2,BI_FP);
BigInteger.prototype.F1 = BI_FP-dbits;
BigInteger.prototype.F2 = 2*dbits-BI_FP;
// Digit conversions
var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz";
var BI_RC = new Array();
var rr,vv;
rr = "0".charCodeAt(0);
for(vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;
rr = "a".charCodeAt(0);
for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
rr = "A".charCodeAt(0);
for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
function int2char(n) { return BI_RM.charAt(n); }
function intAt(s,i) {
var c = BI_RC[s.charCodeAt(i)];
return (c==null)?-1:c;
}
// (protected) copy this to r
function bnpCopyTo(r) {
for(var i = this.t-1; i >= 0; --i) r[i] = this[i];
r.t = this.t;
r.s = this.s;
}
// (protected) set from integer value x, -DV <= x < DV
function bnpFromInt(x) {
this.t = 1;
this.s = (x<0)?-1:0;
if(x > 0) this[0] = x;
else if(x < -1) this[0] = x+this.DV;
else this.t = 0;
}
// return bigint initialized to value
function nbv(i) { var r = nbi(); r.fromInt(i); return r; }
// (protected) set from string and radix
function bnpFromString(s,b) {
var k;
if(b == 16) k = 4;
else if(b == 8) k = 3;
else if(b == 256) k = 8; // byte array
else if(b == 2) k = 1;
else if(b == 32) k = 5;
else if(b == 4) k = 2;
else { this.fromRadix(s,b); return; }
this.t = 0;
this.s = 0;
var i = s.length, mi = false, sh = 0;
while(--i >= 0) {
var x = (k==8)?s[i]&0xff:intAt(s,i);
if(x < 0) {
if(s.charAt(i) == "-") mi = true;
continue;
}
mi = false;
if(sh == 0)
this[this.t++] = x;
else if(sh+k > this.DB) {
this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<<sh;
this[this.t++] = (x>>(this.DB-sh));
}
else
this[this.t-1] |= x<<sh;
sh += k;
if(sh >= this.DB) sh -= this.DB;
}
if(k == 8 && (s[0]&0x80) != 0) {
this.s = -1;
if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)<<sh;
}
this.clamp();
if(mi) BigInteger.ZERO.subTo(this,this);
}
// (protected) clamp off excess high words
function bnpClamp() {
var c = this.s&this.DM;
while(this.t > 0 && this[this.t-1] == c) --this.t;
}
// (public) return string representation in given radix
function bnToString(b) {
if(this.s < 0) return "-"+this.negate().toString(b);
var k;
if(b == 16) k = 4;
else if(b == 8) k = 3;
else if(b == 2) k = 1;
else if(b == 32) k = 5;
else if(b == 4) k = 2;
else return this.toRadix(b);
var km = (1<<k)-1, d, m = false, r = "", i = this.t;
var p = this.DB-(i*this.DB)%k;
if(i-- > 0) {
if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }
while(i >= 0) {
if(p < k) {
d = (this[i]&((1<<p)-1))<<(k-p);
d |= this[--i]>>(p+=this.DB-k);
}
else {
d = (this[i]>>(p-=k))&km;
if(p <= 0) { p += this.DB; --i; }
}
if(d > 0) m = true;
if(m) r += int2char(d);
}
}
return m?r:"0";
}
// (public) -this
function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }
// (public) |this|
function bnAbs() { return (this.s<0)?this.negate():this; }
// (public) return + if this > a, - if this < a, 0 if equal
function bnCompareTo(a) {
var r = this.s-a.s;
if(r != 0) return r;
var i = this.t;
r = i-a.t;
if(r != 0) return (this.s<0)?-r:r;
while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;
return 0;
}
// returns bit length of the integer x
function nbits(x) {
var r = 1, t;
if((t=x>>>16) != 0) { x = t; r += 16; }
if((t=x>>8) != 0) { x = t; r += 8; }
if((t=x>>4) != 0) { x = t; r += 4; }
if((t=x>>2) != 0) { x = t; r += 2; }
if((t=x>>1) != 0) { x = t; r += 1; }
return r;
}
// (public) return the number of bits in "this"
function bnBitLength() {
if(this.t <= 0) return 0;
return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));
}
// (protected) r = this << n*DB
function bnpDLShiftTo(n,r) {
var i;
for(i = this.t-1; i >= 0; --i) r[i+n] = this[i];
for(i = n-1; i >= 0; --i) r[i] = 0;
r.t = this.t+n;
r.s = this.s;
}
// (protected) r = this >> n*DB
function bnpDRShiftTo(n,r) {
for(var i = n; i < this.t; ++i) r[i-n] = this[i];
r.t = Math.max(this.t-n,0);
r.s = this.s;
}
// (protected) r = this << n
function bnpLShiftTo(n,r) {
var bs = n%this.DB;
var cbs = this.DB-bs;
var bm = (1<<cbs)-1;
var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;
for(i = this.t-1; i >= 0; --i) {
r[i+ds+1] = (this[i]>>cbs)|c;
c = (this[i]&bm)<<bs;
}
for(i = ds-1; i >= 0; --i) r[i] = 0;
r[ds] = c;
r.t = this.t+ds+1;
r.s = this.s;
r.clamp();
}
// (protected) r = this >> n
function bnpRShiftTo(n,r) {
r.s = this.s;
var ds = Math.floor(n/this.DB);
if(ds >= this.t) { r.t = 0; return; }
var bs = n%this.DB;
var cbs = this.DB-bs;
var bm = (1<<bs)-1;
r[0] = this[ds]>>bs;
for(var i = ds+1; i < this.t; ++i) {
r[i-ds-1] |= (this[i]&bm)<<cbs;
r[i-ds] = this[i]>>bs;
}
if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;
r.t = this.t-ds;
r.clamp();
}
// (protected) r = this - a
function bnpSubTo(a,r) {
var i = 0, c = 0, m = Math.min(a.t,this.t);
while(i < m) {
c += this[i]-a[i];
r[i++] = c&this.DM;
c >>= this.DB;
}
if(a.t < this.t) {
c -= a.s;
while(i < this.t) {
c += this[i];
r[i++] = c&this.DM;
c >>= this.DB;
}
c += this.s;
}
else {
c += this.s;
while(i < a.t) {
c -= a[i];
r[i++] = c&this.DM;
c >>= this.DB;
}
c -= a.s;
}
r.s = (c<0)?-1:0;
if(c < -1) r[i++] = this.DV+c;
else if(c > 0) r[i++] = c;
r.t = i;
r.clamp();
}
// (protected) r = this * a, r != this,a (HAC 14.12)
// "this" should be the larger one if appropriate.
function bnpMultiplyTo(a,r) {
var x = this.abs(), y = a.abs();
var i = x.t;
r.t = i+y.t;
while(--i >= 0) r[i] = 0;
for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t);
r.s = 0;
r.clamp();
if(this.s != a.s) BigInteger.ZERO.subTo(r,r);
}
// (protected) r = this^2, r != this (HAC 14.16)
function bnpSquareTo(r) {
var x = this.abs();
var i = r.t = 2*x.t;
while(--i >= 0) r[i] = 0;
for(i = 0; i < x.t-1; ++i) {
var c = x.am(i,x[i],r,2*i,0,1);
if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {
r[i+x.t] -= x.DV;
r[i+x.t+1] = 1;
}
}
if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1);
r.s = 0;
r.clamp();
}
// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)
// r != q, this != m. q or r may be null.
function bnpDivRemTo(m,q,r) {
var pm = m.abs();
if(pm.t <= 0) return;
var pt = this.abs();
if(pt.t < pm.t) {
if(q != null) q.fromInt(0);
if(r != null) this.copyTo(r);
return;
}
if(r == null) r = nbi();
var y = nbi(), ts = this.s, ms = m.s;
var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus
if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }
else { pm.copyTo(y); pt.copyTo(r); }
var ys = y.t;
var y0 = y[ys-1];
if(y0 == 0) return;
var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);
var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;
var i = r.t, j = i-ys, t = (q==null)?nbi():q;
y.dlShiftTo(j,t);
if(r.compareTo(t) >= 0) {
r[r.t++] = 1;
r.subTo(t,r);
}
BigInteger.ONE.dlShiftTo(ys,t);
t.subTo(y,y); // "negative" y so we can replace sub with am later
while(y.t < ys) y[y.t++] = 0;
while(--j >= 0) {
// Estimate quotient digit
var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);
if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out
y.dlShiftTo(j,t);
r.subTo(t,r);
while(r[i] < --qd) r.subTo(t,r);
}
}
if(q != null) {
r.drShiftTo(ys,q);
if(ts != ms) BigInteger.ZERO.subTo(q,q);
}
r.t = ys;
r.clamp();
if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder
if(ts < 0) BigInteger.ZERO.subTo(r,r);
}
// (public) this mod a
function bnMod(a) {
var r = nbi();
this.abs().divRemTo(a,null,r);
if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);
return r;
}
// Modular reduction using "classic" algorithm
function Classic(m) { this.m = m; }
function cConvert(x) {
if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);
else return x;
}
function cRevert(x) { return x; }
function cReduce(x) { x.divRemTo(this.m,null,x); }
function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
Classic.prototype.convert = cConvert;
Classic.prototype.revert = cRevert;
Classic.prototype.reduce = cReduce;
Classic.prototype.mulTo = cMulTo;
Classic.prototype.sqrTo = cSqrTo;
// (protected) return "-1/this % 2^DB"; useful for Mont. reduction
// justification:
// xy == 1 (mod m)
// xy = 1+km
// xy(2-xy) = (1+km)(1-km)
// x[y(2-xy)] = 1-k^2m^2
// x[y(2-xy)] == 1 (mod m^2)
// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
// JS multiply "overflows" differently from C/C++, so care is needed here.
function bnpInvDigit() {
if(this.t < 1) return 0;
var x = this[0];
if((x&1) == 0) return 0;
var y = x&3; // y == 1/x mod 2^2
y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4
y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8
y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16
// last step - calculate inverse mod DV directly;
// assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints
y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits
// we really want the negative inverse, and -DV < y < DV
return (y>0)?this.DV-y:-y;
}
// Montgomery reduction
function Montgomery(m) {
this.m = m;
this.mp = m.invDigit();
this.mpl = this.mp&0x7fff;
this.mph = this.mp>>15;
this.um = (1<<(m.DB-15))-1;
this.mt2 = 2*m.t;
}
// xR mod m
function montConvert(x) {
var r = nbi();
x.abs().dlShiftTo(this.m.t,r);
r.divRemTo(this.m,null,r);
if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);
return r;
}
// x/R mod m
function montRevert(x) {
var r = nbi();
x.copyTo(r);
this.reduce(r);
return r;
}
// x = x/R mod m (HAC 14.32)
function montReduce(x) {
while(x.t <= this.mt2) // pad x so am has enough room later
x[x.t++] = 0;
for(var i = 0; i < this.m.t; ++i) {
// faster way of calculating u0 = x[i]*mp mod DV
var j = x[i]&0x7fff;
var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;
// use am to combine the multiply-shift-add into one call
j = i+this.m.t;
x[j] += this.m.am(0,u0,x,i,0,this.m.t);
// propagate carry
while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }
}
x.clamp();
x.drShiftTo(this.m.t,x);
if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
}
// r = "x^2/R mod m"; x != r
function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
// r = "xy/R mod m"; x,y != r
function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
Montgomery.prototype.convert = montConvert;
Montgomery.prototype.revert = montRevert;
Montgomery.prototype.reduce = montReduce;
Montgomery.prototype.mulTo = montMulTo;
Montgomery.prototype.sqrTo = montSqrTo;
// (protected) true iff this is even
function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }
// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)
function bnpExp(e,z) {
if(e > 0xffffffff || e < 1) return BigInteger.ONE;
var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;
g.copyTo(r);
while(--i >= 0) {
z.sqrTo(r,r2);
if((e&(1<<i)) > 0) z.mulTo(r2,g,r);
else { var t = r; r = r2; r2 = t; }
}
return z.revert(r);
}
// (public) this^e % m, 0 <= e < 2^32
function bnModPowInt(e,m) {
var z;
if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);
return this.exp(e,z);
}
// protected
BigInteger.prototype.copyTo = bnpCopyTo;
BigInteger.prototype.fromInt = bnpFromInt;
BigInteger.prototype.fromString = bnpFromString;
BigInteger.prototype.clamp = bnpClamp;
BigInteger.prototype.dlShiftTo = bnpDLShiftTo;
BigInteger.prototype.drShiftTo = bnpDRShiftTo;
BigInteger.prototype.lShiftTo = bnpLShiftTo;
BigInteger.prototype.rShiftTo = bnpRShiftTo;
BigInteger.prototype.subTo = bnpSubTo;
BigInteger.prototype.multiplyTo = bnpMultiplyTo;
BigInteger.prototype.squareTo = bnpSquareTo;
BigInteger.prototype.divRemTo = bnpDivRemTo;
BigInteger.prototype.invDigit = bnpInvDigit;
BigInteger.prototype.isEven = bnpIsEven;
BigInteger.prototype.exp = bnpExp;
// public
BigInteger.prototype.toString = bnToString;
BigInteger.prototype.negate = bnNegate;
BigInteger.prototype.abs = bnAbs;
BigInteger.prototype.compareTo = bnCompareTo;
BigInteger.prototype.bitLength = bnBitLength;
BigInteger.prototype.mod = bnMod;
BigInteger.prototype.modPowInt = bnModPowInt;
// "constants"
BigInteger.ZERO = nbv(0);
BigInteger.ONE = nbv(1);
@@ -0,0 +1,45 @@
// prng4.js - uses Arcfour as a PRNG
function Arcfour() {
this.i = 0;
this.j = 0;
this.S = new Array();
}
// Initialize arcfour context from key, an array of ints, each from [0..255]
function ARC4init(key) {
var i, j, t;
for(i = 0; i < 256; ++i)
this.S[i] = i;
j = 0;
for(i = 0; i < 256; ++i) {
j = (j + this.S[i] + key[i % key.length]) & 255;
t = this.S[i];
this.S[i] = this.S[j];
this.S[j] = t;
}
this.i = 0;
this.j = 0;
}
function ARC4next() {
var t;
this.i = (this.i + 1) & 255;
this.j = (this.j + this.S[this.i]) & 255;
t = this.S[this.i];
this.S[this.i] = this.S[this.j];
this.S[this.j] = t;
return this.S[(t + this.S[this.i]) & 255];
}
Arcfour.prototype.init = ARC4init;
Arcfour.prototype.next = ARC4next;
// Plug in your RNG constructor here
function prng_newstate() {
return new Arcfour();
}
// Pool size must be a multiple of 4 and greater than 32.
// An array of bytes the size of the pool will be passed to init()
var rng_psize = 256;
@@ -0,0 +1,75 @@
// Random number generator - requires a PRNG backend, e.g. prng4.js
// For best results, put code like
// <body onClick='rng_seed_time();' onKeyPress='rng_seed_time();'>
// in your main HTML document.
var rng_state;
var rng_pool;
var rng_pptr;
// Mix in a 32-bit integer into the pool
function rng_seed_int(x) {
rng_pool[rng_pptr++] ^= x & 255;
rng_pool[rng_pptr++] ^= (x >> 8) & 255;
rng_pool[rng_pptr++] ^= (x >> 16) & 255;
rng_pool[rng_pptr++] ^= (x >> 24) & 255;
if(rng_pptr >= rng_psize) rng_pptr -= rng_psize;
}
// Mix in the current time (w/milliseconds) into the pool
function rng_seed_time() {
rng_seed_int(new Date().getTime());
}
// Initialize the pool with junk if needed.
if(rng_pool == null) {
rng_pool = new Array();
rng_pptr = 0;
var t;
if(window.crypto && window.crypto.getRandomValues) {
// Use webcrypto if available
var ua = new Uint8Array(32);
window.crypto.getRandomValues(ua);
for(t = 0; t < 32; ++t)
rng_pool[rng_pptr++] = ua[t];
}
if(navigator.appName == "Netscape" && navigator.appVersion < "5" && window.crypto) {
// Extract entropy (256 bits) from NS4 RNG if available
var z = window.crypto.random(32);
for(t = 0; t < z.length; ++t)
rng_pool[rng_pptr++] = z.charCodeAt(t) & 255;
}
while(rng_pptr < rng_psize) { // extract some randomness from Math.random()
t = Math.floor(65536 * Math.random());
rng_pool[rng_pptr++] = t >>> 8;
rng_pool[rng_pptr++] = t & 255;
}
rng_pptr = 0;
rng_seed_time();
//rng_seed_int(window.screenX);
//rng_seed_int(window.screenY);
}
function rng_get_byte() {
if(rng_state == null) {
rng_seed_time();
rng_state = prng_newstate();
rng_state.init(rng_pool);
for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)
rng_pool[rng_pptr] = 0;
rng_pptr = 0;
//rng_pool = null;
}
// TODO: allow reseeding after first request
return rng_state.next();
}
function rng_get_bytes(ba) {
var i;
for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte();
}
function SecureRandom() {}
SecureRandom.prototype.nextBytes = rng_get_bytes;
@@ -0,0 +1,112 @@
// Depends on jsbn.js and rng.js
// Version 1.1: support utf-8 encoding in pkcs1pad2
// convert a (hex) string to a bignum object
function parseBigInt(str,r) {
return new BigInteger(str,r);
}
function linebrk(s,n) {
var ret = "";
var i = 0;
while(i + n < s.length) {
ret += s.substring(i,i+n) + "\n";
i += n;
}
return ret + s.substring(i,s.length);
}
function byte2Hex(b) {
if(b < 0x10)
return "0" + b.toString(16);
else
return b.toString(16);
}
// PKCS#1 (type 2, random) pad input string s to n bytes, and return a bigint
function pkcs1pad2(s,n) {
if(n < s.length + 11) { // TODO: fix for utf-8
alert("Message too long for RSA");
return null;
}
var ba = new Array();
var i = s.length - 1;
while(i >= 0 && n > 0) {
var c = s.charCodeAt(i--);
if(c < 128) { // encode using utf-8
ba[--n] = c;
}
else if((c > 127) && (c < 2048)) {
ba[--n] = (c & 63) | 128;
ba[--n] = (c >> 6) | 192;
}
else {
ba[--n] = (c & 63) | 128;
ba[--n] = ((c >> 6) & 63) | 128;
ba[--n] = (c >> 12) | 224;
}
}
ba[--n] = 0;
var rng = new SecureRandom();
var x = new Array();
while(n > 2) { // random non-zero pad
x[0] = 0;
while(x[0] == 0) rng.nextBytes(x);
ba[--n] = x[0];
}
ba[--n] = 2;
ba[--n] = 0;
return new BigInteger(ba);
}
// "empty" RSA key constructor
function RSAKey() {
this.n = null;
this.e = 0;
this.d = null;
this.p = null;
this.q = null;
this.dmp1 = null;
this.dmq1 = null;
this.coeff = null;
}
// Set the public key fields N and e from hex strings
function RSASetPublic(N,E) {
if(N != null && E != null && N.length > 0 && E.length > 0) {
this.n = parseBigInt(N,16);
this.e = parseInt(E,16);
}
else
alert("Invalid RSA public key");
}
// Perform raw public operation on "x": return x^e (mod n)
function RSADoPublic(x) {
return x.modPowInt(this.e, this.n);
}
// Return the PKCS#1 RSA encryption of "text" as an even-length hex string
function RSAEncrypt(text) {
var m = pkcs1pad2(text,(this.n.bitLength()+7)>>3);
if(m == null) return null;
var c = this.doPublic(m);
if(c == null) return null;
var h = c.toString(16);
if((h.length & 1) == 0) return h; else return "0" + h;
}
// Return the PKCS#1 RSA encryption of "text" as a Base64-encoded string
//function RSAEncryptB64(text) {
// var h = this.encrypt(text);
// if(h) return hex2b64(h); else return null;
//}
// protected
RSAKey.prototype.doPublic = RSADoPublic;
// public
RSAKey.prototype.setPublic = RSASetPublic;
RSAKey.prototype.encrypt = RSAEncrypt;
//RSAKey.prototype.encrypt_b64 = RSAEncryptB64;
@@ -0,0 +1,106 @@
function message_failed_auth(password){
toastr.info(
"Automatic authorization failed. You can manually login with:<br>" + password + "<br> <a href='https://github.com/bgruening/galaxy-ipython/wiki/Automatic-Authorization-Failed' target='_blank'>More details ...</a>",
"Please login manually",
{'closeButton': true, 'timeOut': 100000, 'tapToDismiss': false}
);
}
function message_failed_connection(){
toastr.error(
"Could not connect to IPython Notebook. Please contact your administrator. <a href='https://github.com/bgruening/galaxy-ipython/wiki/Could-not-connect-to-IPython-Notebook' target='_blank'>More details ...</a>",
"Security warning",
{'closeButton': true, 'timeOut': 20000, 'tapToDismiss': true}
);
}
/**
* Load an interactive environment (IE) from a remote URL
* @param {String} password: password used to authenticate to the remote resource
* @param {String} notebook_login_url: URL that should be POSTed to for login
* @param {String} notebook_access_url: the URL embeded in the page and loaded
*
*/
function load_notebook(notebook_login_url, notebook_access_url, notebook_pubkey_url, username){
$( document ).ready(function() {
// Test notebook_login_url for accessibility, executing the login+load function whenever
// we've successfully connected to the IE.
test_ie_availability(notebook_pubkey_url, function(){
var payload = username + "\n" + ie_password;
$.ajax({
type: 'GET',
url: notebook_pubkey_url,
xhrFields: {
withCredentials: true
},
success: function(response_text){
var chunks = response_text.split(':', 2);
var exp = chunks[0];
var mod = chunks[1];
console.log("Found " + exp +" and " + mod);
var rsa = new RSAKey();
rsa.setPublic(mod, exp);
console.log("Encrypting '" + username + "', '" + ie_password + "'");
var enc_hex = rsa.encrypt(payload);
var encrypted = hex2b64(enc_hex);
console.log("E: " + encrypted);
_handle_notebook_loading(encrypted, notebook_login_url, notebook_access_url);
}
});
});
});
}
/**
* Must be implemented by IEs
*/
function _handle_notebook_loading(password, notebook_login_url, notebook_access_url){
if ( ie_password_auth ) {
$.ajax({
type: "POST",
// to the Login URL
url: notebook_login_url,
// With our password
data: {
'v': password,
'persist': 1,
'clientPath': '/rstudio/auth-sign-in',
'appUri': '',
},
contentType: "application/x-www-form-urlencoded",
xhrFields: {
withCredentials: true
},
// If that is successful, load the notebook
success: function(){
append_notebook(notebook_access_url);
},
error: function(jqxhr, status, error){
if(ie_password_auth && !ie_apache_urls){
// Failure now happens because the redirect that RStudio gives us includes the
// port internal to nginx. (E.g. localhost:NNNN/rstudio/NNNN/)
// so disabling the message here makes sense as long as it's working correctly
//
// Additionally:
// XMLHttpRequest cannot load http://localhost:46725/rstudio/46725/. The
// 'Access-Control-Allow-Origin' header has a value 'http://localhost:8081' that
// is not equal to the supplied origin. Origin 'null' is therefore not allowed
// access.
// message_failed_auth(ie_password);
append_notebook(notebook_access_url);
}else{
message_failed_connection();
// Do we want to try and load the notebook anyway? Just in case?
append_notebook(notebook_access_url);
}
}
});
}
else {
// Not using password auth, just embed it to avoid content-origin issues.
message_no_auth();
append_notebook(notebook_access_url);
}
}
@@ -0,0 +1,67 @@
<%namespace file="ie.mako" name="ie"/>
<%
import os
import shutil
import time
# Sets ID and sets up a lot of other variables
ie_request.load_deploy_config()
ie_request.attr.docker_port = 80
# Create tempdir in galaxy
temp_dir = ie_request.temp_dir
PASSWORD = ie_request.notebook_pw
USERNAME = "galaxy"
## General IE specific
# Access URLs for the notebook from within galaxy.
# TODO: Make this work without pointing directly to IE. Currently does not work
# through proxy.
notebook_pubkey_url = ie_request.url_template('${PROXY_URL}/rstudio/${PORT}/auth-public-key')
notebook_access_url = ie_request.url_template('${PROXY_URL}/rstudio/${PORT}/')
notebook_login_url = ie_request.url_template('${PROXY_URL}/rstudio/${PORT}/auth-do-sign-in')
# Did the user give us an RData file?
if hda.datatype.__class__.__name__ == "RData":
shutil.copy( hda.file_name, os.path.join(temp_dir, '.RData') )
ie_request.launch(env_override={
'notebook_username': USERNAME,
'notebook_password': PASSWORD,
'cors_origin': ie_request.attr.proxy_url,
})
%>
<html>
<head>
${ ie.load_default_js() }
</head>
<body style="margin:0px">
<script type="text/javascript">
${ ie.default_javascript_variables() }
var notebook_login_url = '${ notebook_login_url }';
var notebook_access_url = '${ notebook_access_url }';
var notebook_pubkey_url = '${ notebook_pubkey_url }';
var notebook_username = '${ USERNAME }';
require.config({
baseUrl: app_root,
paths: {
"interactive_environments": "${h.url_for('/static/scripts/galaxy.interactive_environments')}",
"plugin" : app_root + "js/",
"crypto" : app_root + "js/crypto/",
},
});
requirejs([
'interactive_environments',
'crypto/prng4',
'crypto/rng',
'crypto/rsa',
'crypto/jsbn',
'crypto/base64',
'plugin/rstudio'
], function(){
load_notebook(notebook_login_url, notebook_access_url, notebook_pubkey_url, "${ USERNAME }");
});
</script>
<div id="main">
</div>
</body>
</html>
-3
View File
@@ -8,9 +8,6 @@ Properly configured and written visualizations will be accessible to
the user when they click the 'visualizations' icon for a dataset
in their history panel.
The framework must be enabled in your 'galaxy.ini' file by uncommenting (and
having a valid path for) the 'visualizations_plugin_directory' entry.
For more information, see http://wiki.galaxyproject.org/VisualizationsRegistry
+3 -3
View File
@@ -85,9 +85,9 @@
</param>
<param type="template" name="redirect_url" strip="True" >
#if $site_id.startswith( 'local_' )
${site_link}?file=${bam_file.qp}&amp;genome=${site_organism}&amp;merge=true&amp;name=${qp( $bam_file.name )}
${site_link}?file=${bam_file.qp}&amp;genome=${site_organism}&amp;merge=true&amp;name=${qp( ( $bam_file.name or $DATASET_HASH ).replace( ',', ';' ) )}
#elif $site_id.startswith( 'web_link_' ):
${site_link}?sessionURL=${bam_file.qp}&amp;genome=${site_organism}&amp;merge=true&amp;name=${qp( $bam_file.name )}
${site_link}?sessionURL=${bam_file.qp}&amp;genome=${site_organism}&amp;merge=true&amp;name=${qp( ( $bam_file.name or $DATASET_HASH ).replace( ',', ';' ) )}
#else:
${jnlp.url}
#end if
@@ -101,7 +101,7 @@
<filter>${ $dataset.dbkey == $value }</filter>
<!-- We define url and params as normal, but values defined in dynamic_param are available by specified name -->
<url>http://www.broadinstitute.org/igv/projects/current/igv.php?sessionURL=${bam_file.qp}&amp;genome=${bam_file.dbkey}&amp;merge=true&amp;name=${qp( $bam_file.name )}</url>
<url>http://www.broadinstitute.org/igv/projects/current/igv.php?sessionURL=${bam_file.qp}&amp;genome=${bam_file.dbkey}&amp;merge=true&amp;name=${qp( ( $bam_file.name or $DATASET_HASH ).replace( ',', ';' ) )}</url>
<param type="data" name="bam_file" url="galaxy_${DATASET_HASH}.bam" />
<param type="data" name="bai_file" url="galaxy_${DATASET_HASH}.bam.bai" metadata="bam_index" />
+3 -3
View File
@@ -84,9 +84,9 @@
</param>
<param type="template" name="redirect_url" strip="True" >
#if $site_id.startswith( 'local_' )
${site_link}?file=${gff_file.qp}&amp;genome=${site_organism}&amp;merge=true&amp;name=${qp( $gff_file.name )}
${site_link}?file=${gff_file.qp}&amp;genome=${site_organism}&amp;merge=true&amp;name=${qp( ( $gff_file.name or $DATASET_HASH ).replace( ',', ';' ) )}
#elif $site_id.startswith( 'web_link_' ):
${site_link}?sessionURL=${gff_file.qp}&amp;genome=${site_organism}&amp;merge=true&amp;name=${qp( $gff_file.name )}
${site_link}?sessionURL=${gff_file.qp}&amp;genome=${site_organism}&amp;merge=true&amp;name=${qp( ( $gff_file.name or $DATASET_HASH ).replace( ',', ';' ) )}
#else:
${jnlp.url}
#end if
@@ -100,7 +100,7 @@
<filter>${ $dataset.dbkey == $value }</filter>
<!-- We define url and params as normal, but values defined in dynamic_param are available by specified name -->
<url>http://www.broadinstitute.org/igv/projects/current/igv.php?sessionURL=${gff_file.qp}&amp;genome=${gff_file.dbkey}&amp;merge=true&amp;name=${qp( $gff_file.name )}</url>
<url>http://www.broadinstitute.org/igv/projects/current/igv.php?sessionURL=${gff_file.qp}&amp;genome=${gff_file.dbkey}&amp;merge=true&amp;name=${qp( ( $gff_file.name or $DATASET_HASH ).replace( ',', ';' ) )}</url>
<param type="data" name="gff_file" url="galaxy_${DATASET_HASH}.${dataset.ext}" />
@@ -0,0 +1,110 @@
<?xml version="1.0"?>
<display id="igv_interval_as_bed" version="1.0.0" name="display with IGV">
<!-- Load links from file: one line to one link -->
<dynamic_links site_type="igv" skip_startswith="#" id="0" name="1">
<!-- Define parameters by column from file, allow splitting on builds -->
<dynamic_param name="site_id" value="0"/>
<dynamic_param name="site_name" value="1"/>
<dynamic_param name="site_link" value="2"/>
<dynamic_param name="site_dbkeys" value="3" split="True" separator="," />
<dynamic_param name="site_organisms" value="4" split="True" separator="," />
<!-- Filter out some of the links based upon matching site_dbkeys to dataset dbkey -->
<filter>${$site_id.startswith( 'local_' ) or $dataset.dbkey in $site_dbkeys}</filter>
<!-- We define url and params as normal, but values defined in dynamic_param are available by specified name -->
<url>${redirect_url}</url>
<param type="data" name="bed_file" url="galaxy_${DATASET_HASH}.bed" format="bedstrict" />
<param type="template" name="site_organism" strip="True" >
#if ($dataset.dbkey in $site_dbkeys)
$site_organisms[ $site_dbkeys.index( $bed_file.dbkey ) ]
#else:
$bed_file.dbkey
#end if
</param>
<param type="template" name="jnlp" url="galaxy_${DATASET_HASH}.jnlp" viewable="True" mimetype="application/x-java-jnlp-file">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;jnlp
spec=&quot;1.0+&quot;
codebase=&quot;${site_link}&quot;&gt;
&lt;information&gt;
&lt;title&gt;IGV 1.5&lt;/title&gt;
&lt;vendor&gt;The Broad Institute&lt;/vendor&gt;
&lt;homepage href=&quot;http://www.broadinstitute.org/igv&quot;/&gt;
&lt;description&gt;IGV Software&lt;/description&gt;
&lt;description kind=&quot;short&quot;&gt;IGV&lt;/description&gt;
&lt;/information&gt;
&lt;security&gt;
&lt;all-permissions/&gt;
&lt;/security&gt;
&lt;resources&gt;
&lt;j2se version=&quot;1.5+&quot; initial-heap-size=&quot;256m&quot; max-heap-size=&quot;1100m&quot;/&gt;
&lt;jar href=&quot;igv.jar&quot; download=&quot;eager&quot; main=&quot;true&quot;/&gt;
&lt;jar href=&quot;batik-codec.jar&quot; download=&quot;eager&quot;/&gt;
&lt;property name=&quot;apple.laf.useScreenMenuBar&quot; value=&quot;true&quot;/&gt;
&lt;property name=&quot;com.apple.mrj.application.growbox.intrudes&quot; value=&quot;false&quot;/&gt;
&lt;property name=&quot;com.apple.mrj.application.live-resize&quot; value=&quot;true&quot;/&gt;
&lt;property name=&quot;com.apple.macos.smallTabs&quot; value=&quot;true&quot;/&gt;
&lt;/resources&gt;
&lt;resources os=&quot;Mac&quot; arch=&quot;i386&quot;&gt;
&lt;property name=&quot;apple.awt.graphics.UseQuartz&quot; value=&quot;false&quot;/&gt;
&lt;nativelib href=&quot;hdfnative-macintel.jar&quot;/&gt;
&lt;/resources&gt;
&lt;resources os=&quot;Mac&quot; arch=&quot;ppc&quot;&gt;
&lt;property name=&quot;apple.awt.graphics.UseQuartz&quot; value=&quot;false&quot;/&gt;
&lt;nativelib href=&quot;hdfnative-macppc.jar&quot;/&gt;
&lt;/resources&gt;
&lt;resources os=&quot;Mac&quot; arch=&quot;PowerPC&quot;&gt;
&lt;property name=&quot;apple.awt.graphics.UseQuartz&quot; value=&quot;false&quot;/&gt;
&lt;nativelib href=&quot;hdfnative-macppc.jar&quot;/&gt;
&lt;/resources&gt;
&lt;resources os=&quot;Windows&quot;&gt;
&lt;property name=&quot;sun.java2d.noddraw&quot; value=&quot;true&quot;/&gt;
&lt;nativelib href=&quot;hdfnative-win.jar&quot;/&gt;
&lt;/resources&gt;
&lt;resources os=&quot;Linux&quot;&gt;
&lt;nativelib href=&quot;hdfnative-linux64.jar&quot;/&gt;
&lt;/resources&gt;
&lt;application-desc main-class=&quot;org.broad.igv.ui.IGVMainFrame&quot;&gt;
&lt;argument&gt;-g&lt;/argument&gt;
&lt;argument&gt;${site_organism}&lt;/argument&gt;
&lt;argument&gt;${bed_file.url}&lt;/argument&gt;
&lt;/application-desc&gt;
&lt;/jnlp&gt;
</param>
<param type="template" name="redirect_url" strip="True" >
#if $site_id.startswith( 'local_' )
${site_link}?file=${bed_file.qp}&amp;genome=${site_organism}&amp;merge=true&amp;name=${qp( ( $bed_file.name or $DATASET_HASH ).replace( ',', ';' ) )}
#elif $site_id.startswith( 'web_link_' ):
${site_link}?sessionURL=${bed_file.qp}&amp;genome=${site_organism}&amp;merge=true&amp;name=${qp( ( $bed_file.name or $DATASET_HASH ).replace( ',', ';' ) )}
#else:
${jnlp.url}
#end if
</param>
</dynamic_links>
<dynamic_links from_data_table="igv_broad_genomes" skip_startswith="#" id="value" name="name">
<!-- Our input data table is one line per dbkey -->
<filter>${ $dataset.dbkey == $value }</filter>
<!-- We define url and params as normal, but values defined in dynamic_param are available by specified name -->
<url>http://www.broadinstitute.org/igv/projects/current/igv.php?sessionURL=${bed_file.qp}&amp;genome=${bed_file.dbkey}&amp;merge=true&amp;name=${qp( ( $bed_file.name or $DATASET_HASH ).replace( ',', ';' ) )}</url>
<param type="data" name="bed_file" url="galaxy_${DATASET_HASH}.bed" format="bedstrict" />
</dynamic_links>
</display>
<!-- Dan Blankenberg -->
+3 -3
View File
@@ -85,9 +85,9 @@
</param>
<param type="template" name="redirect_url" strip="True" >
#if $site_id.startswith( 'local_' )
${site_link}?file=${bgzip_file.qp}&amp;genome=${site_organism}&amp;merge=true&amp;name=${qp( $bgzip_file.name )}
${site_link}?file=${bgzip_file.qp}&amp;genome=${site_organism}&amp;merge=true&amp;name=${qp( ( $bgzip_file.name or $DATASET_HASH ).replace( ',', ';' ) )}
#elif $site_id.startswith( 'web_link_' ):
${site_link}?sessionURL=${bgzip_file.qp}&amp;genome=${site_organism}&amp;merge=true&amp;name=${qp( $bgzip_file.name )}
${site_link}?sessionURL=${bgzip_file.qp}&amp;genome=${site_organism}&amp;merge=true&amp;name=${qp( ( $bgzip_file.name or $DATASET_HASH ).replace( ',', ';' ) )}
#else:
${jnlp.url}
#end if
@@ -101,7 +101,7 @@
<filter>${ $dataset.dbkey == $value }</filter>
<!-- We define url and params as normal, but values defined in dynamic_param are available by specified name -->
<url>http://www.broadinstitute.org/igv/projects/current/igv.php?sessionURL=${bgzip_file.qp}&amp;genome=$bgzip_file.dbkey&amp;merge=true&amp;name=${qp( $bgzip_file.name )}</url>
<url>http://www.broadinstitute.org/igv/projects/current/igv.php?sessionURL=${bgzip_file.qp}&amp;genome=$bgzip_file.dbkey&amp;merge=true&amp;name=${qp( ( $bgzip_file.name or $DATASET_HASH ).replace( ',', ';' ) )}</url>
<param type="data" name="bgzip_file" url="galaxy_${DATASET_HASH}.vcf.gz" format="vcf_bgzip" />
<param type="data" name="tabix_file" dataset="bgzip_file" url="galaxy_${DATASET_HASH}.vcf.gz.tbi" format="tabix" />
+3
View File
@@ -0,0 +1,3 @@
div.floatright {
float: right;
}
+5
View File
@@ -0,0 +1,5 @@
{# layout.html #}
{# Import the theme's layout. #}
{% extends "!layout.html" %}
{% set css_files = css_files + ['_static/style.css'] %}
+2
View File
@@ -46,6 +46,8 @@ Contents
Application Documentation <lib/modules>
Releases <releases/index>
Indices and tables
==================
+11
View File
@@ -0,0 +1,11 @@
===========================================================
January 2013 Galaxy Release (v 13.01)
===========================================================
.. include:: _header.rst
Please see the `Galaxy wiki`_ for announcement and release notes.
.. _Galaxy wiki: https://wiki.galaxyproject.org/News/2013_01_11_DistributionNewsBrief
.. include:: _thanks.rst
+11
View File
@@ -0,0 +1,11 @@
===========================================================
February 2013 Galaxy Release (v 13.02)
===========================================================
.. include:: _header.rst
Please see the `Galaxy wiki`_ for announcement and release notes.
.. _Galaxy wiki: https://wiki.galaxyproject.org/News/2013_02_08_GalaxyNewsBrief
.. include:: _thanks.rst
+11
View File
@@ -0,0 +1,11 @@
===========================================================
April 2013 Galaxy Release (v 13.04)
===========================================================
.. include:: _header.rst
Please see the `Galaxy wiki`_ for announcement and release notes.
.. _Galaxy wiki: https://wiki.galaxyproject.org/News/2013_04_01_Galaxy_Distribution
.. include:: _thanks.rst
+11
View File
@@ -0,0 +1,11 @@
===========================================================
June 2013 Galaxy Release (v 13.06)
===========================================================
.. include:: _header.rst
Please see the `Galaxy wiki`_ for announcement and release notes.
.. _Galaxy wiki: https://wiki.galaxyproject.org/News/2013_06_03_Galaxy_Distribution
.. include:: _thanks.rst
+11
View File
@@ -0,0 +1,11 @@
===========================================================
August 2013 Galaxy Release (v 13.08)
===========================================================
.. include:: _header.rst
Please see the `Galaxy wiki`_ for announcement and release notes.
.. _Galaxy wiki: https://wiki.galaxyproject.org/News/2013_08_12_Galaxy_Distribution
.. include:: _thanks.rst
+11
View File
@@ -0,0 +1,11 @@
===========================================================
November 2013 Galaxy Release (v 13.11)
===========================================================
.. include:: _header.rst
Please see the `Galaxy wiki`_ for announcement and release notes.
.. _Galaxy wiki: https://wiki.galaxyproject.org/News/2013_11_04_Galaxy_Distribution
.. include:: _thanks.rst
+11
View File
@@ -0,0 +1,11 @@
===========================================================
February 2014 Galaxy Release (v 14.02)
===========================================================
.. include:: _header.rst
Please see the `Galaxy wiki`_ for announcement and release notes.
.. _Galaxy wiki: https://wiki.galaxyproject.org/News/2014_02_10_Galaxy_Distribution
.. include:: _thanks.rst
+11
View File
@@ -0,0 +1,11 @@
===========================================================
April 2014 Galaxy Release (v 14.04)
===========================================================
.. include:: _header.rst
Please see the `Galaxy wiki`_ for announcement and release notes.
.. _Galaxy wiki: https://wiki.galaxyproject.org/News/2014_04_14_Galaxy_Distribution
.. include:: _thanks.rst
+11
View File
@@ -0,0 +1,11 @@
===========================================================
June 2014 Galaxy Release (v 14.06)
===========================================================
.. include:: _header.rst
Please see the `Galaxy wiki`_ for announcement and release notes.
.. _Galaxy wiki: https://wiki.galaxyproject.org/News/2014_06_02_Galaxy_Distribution
.. include:: _thanks.rst
+11
View File
@@ -0,0 +1,11 @@
===========================================================
August 2014 Galaxy Release (v 14.08)
===========================================================
.. include:: _header.rst
Please see the `Galaxy wiki`_ for announcement and release notes.
.. _Galaxy wiki: https://wiki.galaxyproject.org/News/2014_08_11_Galaxy_Distribution
.. include:: _thanks.rst
+11
View File
@@ -0,0 +1,11 @@
===========================================================
October 2014 Galaxy Release (v 14.10)
===========================================================
.. include:: _header.rst
Please see the `Galaxy wiki`_ for announcement and release notes.
.. _Galaxy wiki: https://wiki.galaxyproject.org/News/2014_10_06_Galaxy_Distribution
.. include:: _thanks.rst
+11
View File
@@ -0,0 +1,11 @@
===========================================================
January 2015 Galaxy Release (v 15.01)
===========================================================
.. include:: _header.rst
Please see the `Galaxy wiki`_ for announcement and release notes.
.. _Galaxy wiki: https://wiki.galaxyproject.org/News/2015_01_13_Galaxy_Distribution
.. include:: _thanks.rst
+11
View File
@@ -0,0 +1,11 @@
===========================================================
March 2015 Galaxy Release (v 15.03)
===========================================================
.. include:: _header.rst
Please see the `Galaxy wiki`_ for announcement and release notes.
.. _Galaxy wiki: https://wiki.galaxyproject.org/News/2015_03_GalaxyRelease
.. include:: _thanks.rst
+358
View File
@@ -0,0 +1,358 @@
.. to_doc
-------------------------------
15.05
-------------------------------
.. enhancements
Enhancements
-------------------------------
.. starthighlight
* Pluggable framework to custom authentication (including new LDAP/Active
Directory integration). Thanks to many including Andrew Robinson,
Nicola Soranzo, and David Trudgian. `Pull Request 1`_, `Pull Request 33`_,
`Pull Request 51`_, `Pull Request 75`_, `Pull Request 98`_,
`Pull Request 216`_
* Implement a new ``section`` tag for tool parameters. `Pull Request 35`_,
`Trello <https://trello.com/c/KxlQK0FB>`__
* New UI widgets allowing much more flexibility when creating simple dataset
pair and list collections. `Pull Request 134`_,
`Trello <https://trello.com/c/xCdFQPBW>`__
.. endhighlight
* Improved JavaScript build system for client code and libraries (now
using uglify_ and featuring `Source Maps`_). 72c876c_, 9a7f5fc_, 648a623_,
22f280f_, `Trello <https://trello.com/c/7midE7Bx>`__
* Add an `External Display Application`_ for viewing GFF/GTF files with IGV_.
`Pull Request 70`_, `Trello <https://trello.com/c/Hfg3gYsL>`__
* Use TravisCI_ and Tox_ for continuous integration testing.
`Pull Request 40`_, `Pull Request 62`_, `Pull Request 97`_,
`Pull Request 99`_, `Pull Request 123`_, `Pull Request 222`_,
`Pull Request 235`_,
* Infrastructure for improved toolbox and Tool Shed searching.
`Pull Request 9`_, `Pull Request 116`_, `Pull Request 142`_,
`Pull Request 226`_, c2eb74c_, 2bf52fe_, ec549db_,
`Trello <https://trello.com/c/YJW1dCkB>`__, `Trello <https://trello.com/c/AG3qYRZe>`__
* Enhance UI to allow renaming dataset collections. 21d1d6b_
* Improve highlighting of current/active content history panel.
`Pull Request 126`_
* Improvements to UI and API for histories and collections. e36e51e_,
1e55206_, 0c79680_
* Update history dataset API to account for job re-submission. b4cf49a_
* Allow recalculating user disk usage from the admin interface. 964e081_
* Collect significantly more metadata for BAM files. `Pull Request 107`_,
`Pull Request 108`_
* Implement ``detect_errors`` attribute on command of tool XML.
`Pull Request 117`_
* Allow setting ``auto_format="True"`` on tool ``output`` tags.
`Pull Request 130`_
* Allow testing tool outputs based on MD5 hashes. `Pull Request 125`_
* Improved Cheetah type casting for int/float values. `Pull Request 121`_
* Add option to pass arbitrary parameters to gem install as part of
the tool shed ``setup_ruby_environment`` Tool Shed install action -
thanks to Björn Grüning. `Pull Request 118`_
* Add ``argument`` attribute to tool parameters. `Pull Request 8`_
* Improve link and message that appears after workflows are run.
`Pull Request 143`_
* Add NCBI SRA datatype - thanks to Matt Shirley. `Pull Request 87`_
* Stronger toolbox filtering. `Pull Request 119`_
* Allow updating Tool Shed repositories via the API - thanks to Eric Rasche.
`Pull Request 30`_
* Expose category list in show call for Tool Shed repositories - thanks to
Eric Rasche. `Pull Request 29`_
* Add API endpoint to create Tool Shed repositories. `Pull Request 2`_
* Do not configure Galaxy to use the test Tool Shed by default.
`Pull Request 38`_
* Add fields and improve display of Tool Shed repositories.
a24e206_, d6d61bc_, `Trello <https://trello.com/c/g1dt8WhA>`__
* Enhance multi-selection widgets to allow key combinations ``Ctrl-A``
and ``Ctrl-X``. e8564d7_, `Trello <https://trello.com/c/3QhD5l5h>`__
* New, consistent button for displaying citation BibTeX. `Pull Request 19`_
* Improved ``README`` reflecting move to Github - thanks in part to Eric
Rasche. `PR #2 (old repo)
<https://github.com/galaxyproject/galaxy-beta1/pull/2>`__,
226e826_, 2650d09_, 7d5dde8_
* Update application to use new logo. 2748f9d_, `Pull Request 187`_,
`Pull Request 206`_
* Update many documentation links to use https sites - thanks to
Nicola Soranzo. 8254cab_
* Sync report options config with ``galaxy.ini`` - thanks to Björn Grüning.
`Pull Request 12`_
* Eliminate need to use API key to list tools via API. cd7abe8_
* Restore function necessary for splitting sequence datatypes - thanks to
Roberto Alonso. `Pull Request 5`_
* Suppress filenames in SAM merge using ``egrep`` - thanks to Peter Cock
and Roberto Alonso. `Pull Request 4`_
* Option to sort counts in ``Count1`` tool (``tools/filters/uniq.xml``) -
thanks to Peter Cock. `Pull Request 16`_
* Preserve spaces in ``Count1`` tool (``tools/filters/uniq.xml``) - thanks to
Peter Cock. `Pull Request 13`_
* `Interactive Environments`_ improvements and fixes from multiple
developers including Eric Rasche and Björn Grüning. `Pull Request 69`_,
`Pull Request 73`_, `Pull Request 131`_, `Pull Request 135`_,
`Pull Request 152`_, `Pull Request 197`_
* Enable multi-part upload for exporting files with the GenomeSpace export
tool. `Pull Request 74`_, `Trello <https://trello.com/c/28O46iln>`__
* Large refactoring, expansion, and increase in test coverage for "managers".
`Pull Request 76`_
* Improved display of headers in tool help. 157eba6_,
`Biostar <https://biostar.usegalaxy.org/p/11211/>`__
* Uniform configuration of "From" field for sent emails - thanks to Nicola
Soranzo. `Pull Request 23`_
* Allow setting ``job_conf.xml`` params via environment variables &
``galaxy.ini``. dde2fc9_
* Allow a tool data table to declare that duplicate entries are not
allowed. `Pull Request 245`_
* Add verbose test error flag option in run_tests.sh. 62f0495_
* Update ``.gitignore`` to include ``run_api_tests.html``. b52cc98_
* Add experimental options to run tests in Docker. e99adb5_
* Improve ``run_test.sh --help`` documentation to detail running specific
tests. `Pull Request 86`_
* Remove older, redundant history tests. `Pull Request 120`_,
`Trello <https://trello.com/c/p6oOVhGp>`__
* Add test tool demonstrating citing a Github repository. 65def71_
* Add option to track all automated changes to the integrated tool panel.
10bb492_
* Make tool version explicit in all distribution tool - thanks to Peter Cock.
`Pull Request 14`_.
* Relocate the external metadata setting script. `Pull Request 7`_
* Parameterize script used to pull new builds from the UCSC Browser.
e4e5df0_
* Enhance jobs and workflow logging to report timings. 06346a4_
* Add debug message for dynamic options exceptions. `Pull Request 91`_
* Remove demo sequencer app. 3af3bf5_
* Tweaks to the Pulsar's handling of async messages. `Pull Request 109`_
* Return more specific API authentication errors. 71a64ca_
* Upgrade Python dependency sqlalchemy to 1.0.0. d725aab_, `Pull Request 129`_
* Upgrade Python dependency amqp to 1.4.6. `Pull Request 128`_
* Upgrade Python dependency kombu to 3.0.24. `Pull Request 128`_
* Upgrade JavaScript dependency raven.js to 1.1.17. bcd1701_
.. fixes
Fixes
-------------------------------
* During the 15.05 development cycle dozens of fixes were pushed to the
``release_15.03`` branch of Galaxy. These are all included in 15.05 and
summarized `here
<https://github.com/galaxyproject/galaxy/compare/v15.03...release_15.03>`__
(with special thanks to Björn Grüning and Marius van den Beek).
* Fix race condition that would occasionally prevent Galaxy from starting
properly. `Pull Request 198`_, `Trello <https://trello.com/c/WVlaLsOh>`__
* Fix scatter plot API communications for certain proxied Galaxy instances -
thanks to @yhoogstrate. `Pull Request 89`_
* Fix bug in collectl_ job metrics plugin - thanks to Carrie Ganote.
`Pull Request 231`_
* Fix late validation of tool parameters. `Pull Request 115`_
* Fix ``fasta_to_tabular_converter.py`` (for implicit conversion) - thanks to
Peter Cock. `Pull Request 11`_
* Fix to eliminate race condition by collecting extra files before declaring
dataset's OK. `Pull Request 48`_
* Fix setting current history for certain proxied Galaxy instances - thanks
to @wezen. 6946e46_.
* Fix typo in tool failure testing example - thanks to Peter Cock.
`Pull Request 18`_.
* Fix Galaxy to default to using SSL for communicating with Tool Sheds.
0b037a2_
* Fix data source tools to open in ``_top`` window.
`Pull Request 17`_
* Fix to fallback to name for tool parameters without labels.
`Pull Request 189`_, `Trello <https://trello.com/c/Y2xbXqzZ>`__
* Fix to remove redundant version ids in tool version selector.
`Pull Request 244`_
* Fix for downloading metadata files. `Pull Request 234`_
* Fix for history failing to render if it contains more exotic dataset
collection types. `Pull Request 196`_
* Fixes for BaseURLToolParameter. `Pull Request 247`_
* Fix to suppress pysam binary incompatibility warning when using datatypes
in ``binary.py``. `Pull Request 252`_
* Fix for library UI duplication bug. `Pull Request 179`_
* Fix for `Backbone.js`_ loading as AMD_. 4e5218f_
* Other small Tool Shed fixes. 815f86f_, 76e0915_
* Fix file closing in ``lped_to_pbed_converter``. 182b67f_
* Fix undefined variables in Tool Shed ``add_repository_entry`` API script.
47e6f08_
* Fix user registration to respect use_panels when in the Galaxy app.
7ac8631_, `Trello <https://trello.com/c/lA1mdDrP>`__
* Fix bug in scramble exception, incorrect reference to source_path 79d50d8_
* Fix error handling in ``pbed_to_lped``. 7aecd7a_
* Fix error handling in Tool Shed step handler for ``chmod`` action. 1454396_
* Fix ``__safe_string_wrapper`` in tool evaluation object_wrapper. ab6f13e_
* Fixes for data types and data providers. c1d2d1f_, 8da70bb_, 0b83b1e_
* Fixes for Tool Shed commit and mercurial handling modules. 6102edf_,
b639bc0_, debea9d_
* Fix to clean working directory during job re-submission. `Pull Request 236`_
* Fix bug when task splitting jobs fail. `Pull Request 214`_
* Fix some minor typos in comment docs in ``config/galaxy.ini.sample``.
`Pull Request 210`_
* Fix admin disk usage message. `Pull Request 205`_,
`Trello <https://trello.com/c/2pdw2dK8>`__
* Fix to sessionStorage Model to suppress QUOTA DOMExceptions when Safari
users are in private browsing mode. 0c94f04_
.. _IGV: https://www.broadinstitute.org/igv/
.. _External Display Application: https://wiki.galaxyproject.org/Admin/Tools/External%20Display%20Applications%20Tutorial
.. _Interactive Environments: https://wiki.galaxyproject.org/Admin/IEs
.. _TravisCI: https://travis-ci.org/
.. _Tox: https://testrun.org/tox/latest/
.. _Source Maps: https://developer.chrome.com/devtools/docs/javascript-debugging#source-maps
.. _uglify: https://developer.chrome.com/devtools/docs/javascript-debugging#source-maps
.. _collectl: http://collectl.sourceforge.net/
.. _Backbone.js: http://backbonejs.org/
.. _AMD: http://requirejs.org/docs/whyamd.html
.. github_links
.. _Pull Request 129: https://github.com/galaxyproject/galaxy/pull/129
.. _Pull Request 128: https://github.com/galaxyproject/galaxy/pull/128
.. _Pull Request 2: https://github.com/galaxyproject/galaxy/pull/2
.. _Pull Request 247: https://github.com/galaxyproject/galaxy/pull/247
.. _Pull Request 252: https://github.com/galaxyproject/galaxy/pull/252
.. _Pull Request 245: https://github.com/galaxyproject/galaxy/pull/245
.. _Pull Request 244: https://github.com/galaxyproject/galaxy/pull/244
.. _Pull Request 236: https://github.com/galaxyproject/galaxy/pull/236
.. _Pull Request 235: https://github.com/galaxyproject/galaxy/pull/235
.. _Pull Request 222: https://github.com/galaxyproject/galaxy/pull/222
.. _Pull Request 234: https://github.com/galaxyproject/galaxy/pull/234
.. _Pull Request 231: https://github.com/galaxyproject/galaxy/pull/231
.. _Pull Request 226: https://github.com/galaxyproject/galaxy/pull/226
.. _Pull Request 216: https://github.com/galaxyproject/galaxy/pull/216
.. _Pull Request 215: https://github.com/galaxyproject/galaxy/pull/215
.. _Pull Request 214: https://github.com/galaxyproject/galaxy/pull/214
.. _Pull Request 198: https://github.com/galaxyproject/galaxy/pull/198
.. _Pull Request 210: https://github.com/galaxyproject/galaxy/pull/210
.. _Pull Request 206: https://github.com/galaxyproject/galaxy/pull/206
.. _Pull Request 205: https://github.com/galaxyproject/galaxy/pull/205
.. _Pull Request 197: https://github.com/galaxyproject/galaxy/pull/197
.. _Pull Request 196: https://github.com/galaxyproject/galaxy/pull/196
.. _Pull Request 189: https://github.com/galaxyproject/galaxy/pull/189
.. _Pull Request 187: https://github.com/galaxyproject/galaxy/pull/187
.. _Pull Request 179: https://github.com/galaxyproject/galaxy/pull/179
.. _Pull Request 153: https://github.com/galaxyproject/galaxy/pull/153
.. _Pull Request 152: https://github.com/galaxyproject/galaxy/pull/152
.. _5abb8ad: https://github.com/galaxyproject/galaxy/commit/5abb8ad
.. _Pull Request 130: https://github.com/galaxyproject/galaxy/pull/130
.. _Pull Request 146: https://github.com/galaxyproject/galaxy/pull/146
.. _Pull Request 135: https://github.com/galaxyproject/galaxy/pull/135
.. _Pull Request 143: https://github.com/galaxyproject/galaxy/pull/143
.. _Pull Request 142: https://github.com/galaxyproject/galaxy/pull/142
.. _Pull Request 131: https://github.com/galaxyproject/galaxy/pull/131
.. _d725aab: https://github.com/galaxyproject/galaxy/commit/d725aab
.. _Pull Request 126: https://github.com/galaxyproject/galaxy/pull/126
.. _e09761e: https://github.com/galaxyproject/galaxy/commit/e09761e
.. _8d3c531: https://github.com/galaxyproject/galaxy/commit/8d3c531
.. _Pull Request 125: https://github.com/galaxyproject/galaxy/pull/125
.. _Pull Request 123: https://github.com/galaxyproject/galaxy/pull/123
.. _Pull Request 121: https://github.com/galaxyproject/galaxy/pull/121
.. _Pull Request 120: https://github.com/galaxyproject/galaxy/pull/120
.. _Pull Request 119: https://github.com/galaxyproject/galaxy/pull/119
.. _Pull Request 117: https://github.com/galaxyproject/galaxy/pull/117
.. _Pull Request 118: https://github.com/galaxyproject/galaxy/pull/118
.. _Pull Request 134: https://github.com/galaxyproject/galaxy/pull/134
.. _Pull Request 116: https://github.com/galaxyproject/galaxy/pull/116
.. _Pull Request 109: https://github.com/galaxyproject/galaxy/pull/109
.. _647cf55: https://github.com/galaxyproject/galaxy/commit/647cf55
.. _Pull Request 108: https://github.com/galaxyproject/galaxy/pull/108
.. _Pull Request 107: https://github.com/galaxyproject/galaxy/pull/107
.. _8254cab: https://github.com/galaxyproject/galaxy/commit/8254cab
.. _Pull Request 99: https://github.com/galaxyproject/galaxy/pull/99
.. _Pull Request 98: https://github.com/galaxyproject/galaxy/pull/98
.. _Pull Request 115: https://github.com/galaxyproject/galaxy/pull/115
.. _Pull Request 97: https://github.com/galaxyproject/galaxy/pull/97
.. _Pull Request 91: https://github.com/galaxyproject/galaxy/pull/91
.. _Pull Request 89: https://github.com/galaxyproject/galaxy/pull/89
.. _Pull Request 86: https://github.com/galaxyproject/galaxy/pull/86
.. _Pull Request 87: https://github.com/galaxyproject/galaxy/pull/87
.. _Pull Request 73: https://github.com/galaxyproject/galaxy/pull/73
.. _Pull Request 74: https://github.com/galaxyproject/galaxy/pull/74
.. _Pull Request 75: https://github.com/galaxyproject/galaxy/pull/75
.. _Pull Request 70: https://github.com/galaxyproject/galaxy/pull/70
.. _Pull Request 69: https://github.com/galaxyproject/galaxy/pull/69
.. _Pull Request 62: https://github.com/galaxyproject/galaxy/pull/62
.. _Pull Request 51: https://github.com/galaxyproject/galaxy/pull/51
.. _Pull Request 76: https://github.com/galaxyproject/galaxy/pull/76
.. _2650d09: https://github.com/galaxyproject/galaxy/commit/2650d09
.. _7d5dde8: https://github.com/galaxyproject/galaxy/commit/7d5dde8
.. _2748f9d: https://github.com/galaxyproject/galaxy/commit/2748f9d
.. _d6d61bc: https://github.com/galaxyproject/galaxy/commit/d6d61bc
.. _815f86f: https://github.com/galaxyproject/galaxy/commit/815f86f
.. _76e0915: https://github.com/galaxyproject/galaxy/commit/76e0915
.. _bce8171: https://github.com/galaxyproject/galaxy/commit/bce8171
.. _06346a4: https://github.com/galaxyproject/galaxy/commit/06346a4
.. _b4cf49a: https://github.com/galaxyproject/galaxy/commit/b4cf49a
.. _Pull Request 40: https://github.com/galaxyproject/galaxy/pull/40
.. _Pull Request 38: https://github.com/galaxyproject/galaxy/pull/38
.. _a24e206: https://github.com/galaxyproject/galaxy/commit/a24e206
.. _Pull Request 35: https://github.com/galaxyproject/galaxy/pull/35
.. _e36e51e: https://github.com/galaxyproject/galaxy/commit/e36e51e
.. _1e55206: https://github.com/galaxyproject/galaxy/commit/1e55206
.. _0c79680: https://github.com/galaxyproject/galaxy/commit/0c79680
.. _Pull Request 1: https://github.com/galaxyproject/galaxy/pull/1
.. _Pull Request 33: https://github.com/galaxyproject/galaxy/pull/33
.. _Pull Request 48: https://github.com/galaxyproject/galaxy/pull/48
.. _21d1d6b: https://github.com/galaxyproject/galaxy/commit/21d1d6b
.. _Pull Request 30: https://github.com/galaxyproject/galaxy/pull/30
.. _Pull Request 29: https://github.com/galaxyproject/galaxy/pull/29
.. _c0e5509: https://github.com/galaxyproject/galaxy/commit/c0e5509
.. _157eba6: https://github.com/galaxyproject/galaxy/commit/157eba6
.. _72c876c: https://github.com/galaxyproject/galaxy/commit/72c876c
.. _9a7f5fc: https://github.com/galaxyproject/galaxy/commit/9a7f5fc
.. _648a623: https://github.com/galaxyproject/galaxy/commit/648a623
.. _59028c0: https://github.com/galaxyproject/galaxy/commit/59028c0
.. _bcd1701: https://github.com/galaxyproject/galaxy/commit/bcd1701
.. _22f280f: https://github.com/galaxyproject/galaxy/commit/22f280f
.. _6946e46: https://github.com/galaxyproject/galaxy/commit/6946e46
.. _65def71: https://github.com/galaxyproject/galaxy/commit/65def71
.. _4e5218f: https://github.com/galaxyproject/galaxy/commit/4e5218f
.. _Pull Request 16: https://github.com/galaxyproject/galaxy/pull/16
.. _Pull Request 13: https://github.com/galaxyproject/galaxy/pull/13
.. _e8564d7: https://github.com/galaxyproject/galaxy/commit/e8564d7
.. _Pull Request 23: https://github.com/galaxyproject/galaxy/pull/23
.. _Pull Request 22: https://github.com/galaxyproject/galaxy/pull/22
.. _10bb492: https://github.com/galaxyproject/galaxy/commit/10bb492
.. _Pull Request 19: https://github.com/galaxyproject/galaxy/pull/19
.. _Pull Request 18: https://github.com/galaxyproject/galaxy/pull/18
.. _0b037a2: https://github.com/galaxyproject/galaxy/commit/0b037a2
.. _Pull Request 17: https://github.com/galaxyproject/galaxy/pull/17
.. _b29a5e9: https://github.com/galaxyproject/galaxy/commit/b29a5e9
.. _Pull Request 14: https://github.com/galaxyproject/galaxy/pull/14
.. _7aecd7a: https://github.com/galaxyproject/galaxy/commit/7aecd7a
.. _Pull Request 12: https://github.com/galaxyproject/galaxy/pull/12
.. _cd7abe8: https://github.com/galaxyproject/galaxy/commit/cd7abe8
.. _62f0495: https://github.com/galaxyproject/galaxy/commit/62f0495
.. _Pull Request 11: https://github.com/galaxyproject/galaxy/pull/11
.. _Pull Request 9: https://github.com/galaxyproject/galaxy/pull/9
.. _632ec4e: https://github.com/galaxyproject/galaxy/commit/632ec4e
.. _Pull Request 8: https://github.com/galaxyproject/galaxy/pull/8
.. _Pull Request 7: https://github.com/galaxyproject/galaxy/pull/7
.. _b52cc98: https://github.com/galaxyproject/galaxy/commit/b52cc98
.. _1454396: https://github.com/galaxyproject/galaxy/commit/1454396
.. _8da70bb: https://github.com/galaxyproject/galaxy/commit/8da70bb
.. _b639bc0: https://github.com/galaxyproject/galaxy/commit/b639bc0
.. _ab6f13e: https://github.com/galaxyproject/galaxy/commit/ab6f13e
.. _debea9d: https://github.com/galaxyproject/galaxy/commit/debea9d
.. _6102edf: https://github.com/galaxyproject/galaxy/commit/6102edf
.. _c1d2d1f: https://github.com/galaxyproject/galaxy/commit/c1d2d1f
.. _0b83b1e: https://github.com/galaxyproject/galaxy/commit/0b83b1e
.. _216fb95: https://github.com/galaxyproject/galaxy/commit/216fb95
.. _182b67f: https://github.com/galaxyproject/galaxy/commit/182b67f
.. _47e6f08: https://github.com/galaxyproject/galaxy/commit/47e6f08
.. _7ac8631: https://github.com/galaxyproject/galaxy/commit/7ac8631
.. _2bf52fe: https://github.com/galaxyproject/galaxy/commit/2bf52fe
.. _e4e5df0: https://github.com/galaxyproject/galaxy/commit/e4e5df0
.. _6e17bf4: https://github.com/galaxyproject/galaxy/commit/6e17bf4
.. _0c94f04: https://github.com/galaxyproject/galaxy/commit/0c94f04
.. _Pull Request 1: https://github.com/galaxyproject/galaxy/pull/1
.. _ec549db: https://github.com/galaxyproject/galaxy/commit/ec549db
.. _226e826: https://github.com/galaxyproject/galaxy/commit/226e826
.. _79d50d8: https://github.com/galaxyproject/galaxy/commit/79d50d8
.. _964e081: https://github.com/galaxyproject/galaxy/commit/964e081
.. _Pull Request 5: https://github.com/galaxyproject/galaxy/pull/5
.. _1f1bb29: https://github.com/galaxyproject/galaxy/commit/1f1bb29
.. _Pull Request 4: https://github.com/galaxyproject/galaxy/pull/4
.. _dde2fc9: https://github.com/galaxyproject/galaxy/commit/dde2fc9
.. _c2eb74c: https://github.com/galaxyproject/galaxy/commit/c2eb74c
.. _71a64ca: https://github.com/galaxyproject/galaxy/commit/71a64ca
.. _3af3bf5: https://github.com/galaxyproject/galaxy/commit/3af3bf5
.. _e99adb5: https://github.com/galaxyproject/galaxy/commit/e99adb5
+58
View File
@@ -0,0 +1,58 @@
===========================================================
May 2015 Galaxy Release (v 15.05)
===========================================================
.. include:: _header.rst
Highlights
===========================================================
**Authentication Plugins**
Galaxy now has native support for LDAP and Active Directory via a new
community developed authentication plugin system.
**Tool Sections**
Tool parameters may now be groupped into collapsable sections.
**Collection Creators**
New widgets have been added that allow much more flexibility when creating
simple dataset pair and list collections.
`Github <https://github.com/galaxyproject/galaxy>`__
===========================================================
New
.. code-block:: shell
% git clone -b master https://github.com/galaxyproject/galaxy.git
Update to latest stable release
.. code-block:: shell
% git checkout master && pull --ff-only origin master
Update to exact version
.. code-block:: shell
% git checkout v15.05
`BitBucket <https://bitbucket.org/galaxy/galaxy-dist>`__
===========================================================
Upgrade
.. code-block:: shell
% hg pull
% hg update latest_15.05
See `our wiki <https://wiki.galaxyproject.org/Develop/SourceCode>`__ for additional details regarding the source code locations.
Release Notes
===========================================================
.. include:: 15.05.rst
:start-after: enhancements
.. include:: _thanks.rst
+3
View File
@@ -0,0 +1,3 @@
.. image:: https://wiki.galaxyproject.org/Images/GalaxyLogo?action=AttachFile&do=get&target=galaxy_logo_25percent_transparent.png
:alt: Get the Galaxy Release Your Way
:target: http://getgalaxy.org
+7
View File
@@ -0,0 +1,7 @@
To stay up to date with Galaxy's progress watch our `screencasts <https://vimeo.com/galaxyproject>`__,
read our `wiki <https://wiki.galaxyproject.org/>`__, and follow
`@galaxyproject <https://twitter.com/galaxyproject>`__ on Twitter.
*Thanks for using Galaxy!*
`The Galaxy Team <https://wiki.galaxyproject.org/GalaxyTeam>`__
+21
View File
@@ -0,0 +1,21 @@
Releases
========
.. toctree::
:maxdepth: 1
15.05_announce
15.03_announce
15.01_announce
14.10_announce
14.08_announce
14.06_announce
14.04_announce
14.02_announce
13.11_announce
13.08_announce
13.06_announce
13.04_announce
13.02_announce
13.01_announce
older_releases
+11
View File
@@ -0,0 +1,11 @@
===========================================================
Galaxy Releases older than v 13.01
===========================================================
.. include:: _header.rst
Please see the `Galaxy wiki`_ for announcement and release notes.
.. _Galaxy wiki: https://wiki.galaxyproject.org/DevNewsBriefs
.. include:: _thanks.rst
+6 -2
View File
@@ -12,6 +12,7 @@ import struct
import subprocess
import tempfile
import re
import warnings
import zipfile
from galaxy import eggs
@@ -24,8 +25,11 @@ from galaxy.datatypes.metadata import MetadataElement, MetadataParameter, ListPa
from galaxy.datatypes import metadata
import dataproviders
eggs.require( "pysam" )
from pysam import csamtools
with warnings.catch_warnings():
warnings.simplefilter( "ignore" )
eggs.require( "pysam" )
from pysam import csamtools
log = logging.getLogger(__name__)
+13 -7
View File
@@ -8,6 +8,9 @@ import logging
import socket
from galaxy.util import send_mail
from galaxy.util.json import dumps
from galaxy import eggs
eggs.require( "MarkupSafe" )
from markupsafe import escape
log = logging.getLogger( __name__ )
@@ -50,7 +53,7 @@ class DefaultJobAction(object):
@classmethod
def get_short_str(cls, pja):
if pja.action_arguments:
return "%s -> %s" % (pja.action_type, pja.action_arguments)
return "%s -> %s" % (pja.action_type, escape(pja.action_arguments))
else:
return "%s" % pja.action_type
@@ -91,7 +94,7 @@ class EmailAction(DefaultJobAction):
@classmethod
def get_short_str(cls, pja):
if pja.action_arguments and 'host' in pja.action_arguments:
return "Email the current user from server %s when this job is complete." % pja.action_arguments['host']
return "Email the current user from server %s when this job is complete." % escape(pja.action_arguments['host'])
else:
return "Email the current user when this job is complete."
@@ -127,7 +130,8 @@ class ChangeDatatypeAction(DefaultJobAction):
@classmethod
def get_short_str(cls, pja):
return "Set the datatype of output '%s' to '%s'" % (pja.output_name, pja.action_arguments['newtype'])
return "Set the datatype of output '%s' to '%s'" % (escape(pja.output_name),
escape(pja.action_arguments['newtype']))
class RenameDatasetAction(DefaultJobAction):
@@ -235,7 +239,8 @@ class RenameDatasetAction(DefaultJobAction):
def get_short_str(cls, pja):
# Prevent renaming a dataset to the empty string.
if pja.action_arguments and pja.action_arguments.get('newname', ''):
return "Rename output '%s' to '%s'." % (pja.output_name, pja.action_arguments['newname'])
return "Rename output '%s' to '%s'." % (escape(pja.output_name),
escape(pja.action_arguments['newname']))
else:
return "Rename action used without a new name specified. Output name will be unchanged."
@@ -260,7 +265,7 @@ class HideDatasetAction(DefaultJobAction):
@classmethod
def get_short_str(cls, pja):
return "Hide output '%s'." % pja.output_name
return "Hide output '%s'." % escape(pja.output_name)
class DeleteDatasetAction(DefaultJobAction):
@@ -336,7 +341,7 @@ class ColumnSetAction(DefaultJobAction):
@classmethod
def get_short_str(cls, pja):
return "Set the following metadata values:<br/>" + "<br/>".join(['%s : %s' % (k, v) for k, v in pja.action_arguments.iteritems()])
return "Set the following metadata values:<br/>" + "<br/>".join(['%s : %s' % (escape(k), escape(v)) for k, v in pja.action_arguments.iteritems()])
class SetMetadataAction(DefaultJobAction):
@@ -455,7 +460,8 @@ class TagDatasetAction(DefaultJobAction):
@classmethod
def get_short_str(cls, pja):
if pja.action_arguments and pja.action_arguments.get('tags', ''):
return "Add tag(s) '%s' to '%s'." % (pja.action_arguments['tags'], pja.output_name)
return "Add tag(s) '%s' to '%s'." % (escape(pja.action_arguments['tags']),
escape(pja.output_name))
else:
return "Tag addition action used without a tag specified. No tag will be added."
+3 -1
View File
@@ -73,7 +73,9 @@ class DatasetCollectionManager( object ):
for input_name, input_collection in implicit_collection_info[ "implicit_inputs" ]:
dataset_collection_instance.add_implicit_input_collection( input_name, input_collection )
for output_dataset in implicit_collection_info.get( "outputs" ):
if isinstance( output_dataset, model.HistoryDatasetCollectionAssociation ):
if isinstance( output_dataset, model.HistoryDatasetAssociation ):
output_dataset.hidden_beneath_collection_instance = dataset_collection_instance
elif isinstance( output_dataset, model.HistoryDatasetCollectionAssociation ):
dataset_collection_instance.add_implicit_input_collection( input_name, input_collection )
else:
# dataset collection, don't need to do anything...
+5 -1
View File
@@ -139,7 +139,11 @@ class ProvidesUserContext( object ):
@property
def user_ftp_dir( self ):
identifier = self.app.config.ftp_upload_dir_identifier
return os.path.join( self.app.config.ftp_upload_dir, getattr( self.user, identifier ) )
base_dir = self.app.config.ftp_upload_dir
if base_dir is None:
return None
else:
return os.path.join( base_dir, getattr( self.user, identifier ) )
class ProvidesHistoryContext( object ):
+4 -4
View File
@@ -282,21 +282,21 @@ class HistorySerializer( sharable.SharableModelSerializer, deletable.PurgableSer
state = states.ERROR
# TODO: history_state and state_counts are classically calc'd at the same time
# so this is rel. ineff. - if we keep this...
hda_state_counts = self.serialize_state_counts( history, 'counts', exclude_deleted=False, **context )
hda_state_counts = self.serialize_state_counts( history, 'counts', exclude_deleted=True, **context )
num_hdas = sum( hda_state_counts.values() )
if num_hdas == 0:
state = states.NEW
else:
if ( hda_state_counts[ states.RUNNING ] > 0
or hda_state_counts[ states.SETTING_METADATA ] > 0
or hda_state_counts[ states.UPLOAD ] > 0 ):
or hda_state_counts[ states.SETTING_METADATA ] > 0
or hda_state_counts[ states.UPLOAD ] > 0 ):
state = states.RUNNING
# TODO: this method may be more useful if we *also* polled the histories jobs here too
elif hda_state_counts[ states.QUEUED ] > 0:
state = states.QUEUED
elif ( hda_state_counts[ states.ERROR ] > 0
or hda_state_counts[ states.FAILED_METADATA ] > 0 ):
or hda_state_counts[ states.FAILED_METADATA ] > 0 ):
state = states.ERROR
elif hda_state_counts[ states.OK ] == num_hdas:
state = states.OK
+13 -14
View File
@@ -60,16 +60,6 @@ from galaxy.model.item_attrs import Dictifiable
from tool_shed.util import shed_util_common as suc
from .loader import template_macro_params, raw_tool_xml_tree, imported_macro_paths
from .execute import execute as execute_job
from .wrappers import (
ToolParameterValueWrapper,
RawObjectWrapper,
LibraryDatasetValueWrapper,
InputValueWrapper,
SelectToolParameterWrapper,
DatasetFilenameWrapper,
DatasetListWrapper,
DatasetCollectionWrapper,
)
import galaxy.jobs
@@ -1890,10 +1880,12 @@ class Tool( object, Dictifiable ):
"""
args = dict()
for key, param in self.inputs.iteritems():
if isinstance( param, HiddenToolParameter ):
# BaseURLToolParameter is now a subclass of HiddenToolParameter, so
# we must check if param is a BaseURLToolParameter first
if isinstance( param, BaseURLToolParameter ):
args[key] = param.get_initial_value( trans, None )
elif isinstance( param, HiddenToolParameter ):
args[key] = model.User.expand_user_properties( trans.user, param.value )
elif isinstance( param, BaseURLToolParameter ):
args[key] = param.get_value( trans )
else:
raise Exception( "Unexpected parameter type" )
return args
@@ -2332,6 +2324,12 @@ class Tool( object, Dictifiable ):
'id' : trans.security.encode_id(v.id),
'src' : 'hdca'
}
elif isinstance(v, trans.app.model.LibraryDatasetDatasetAssociation):
return {
'id' : trans.security.encode_id(v.id),
'name': v.name,
'src' : 'ldda'
}
elif isinstance(v, bool):
if v is True:
return 'true'
@@ -2550,7 +2548,8 @@ class Tool( object, Dictifiable ):
tool_versions = []
tools = self.app.toolbox.get_loaded_tools_by_lineage(self.id)
for t in tools:
tool_versions.append(t.version)
if not t.version in tool_versions:
tool_versions.append(t.version)
# add information with underlying requirements and their versions
tool_requirements = []
+23 -1
View File
@@ -185,6 +185,7 @@ class ToolDataTable( object ):
self.comment_char = config_element.get( 'comment_char' )
self.empty_field_value = config_element.get( 'empty_field_value', '' )
self.empty_field_values = {}
self.allow_duplicate_entries = util.asbool( config_element.get( 'allow_duplicate_entries', True ) )
self.here = filename and os.path.dirname(filename)
self.filenames = odict()
self.tool_data_path = tool_data_path
@@ -354,6 +355,11 @@ class TabularToolDataTable( ToolDataTable, Dictifiable ):
self.filenames[ filename ] = info
#save info about table
self._merged_load_info.append( ( other_table.__class__, other_table._load_info ) )
# If we are merging in a data table that does not allow duplicates, enforce that upon the data table
if self.allow_duplicate_entries and not other_table.allow_duplicate_entries:
log.debug( 'While attempting to merge tool data table "%s", the other instance of the table specified that duplicate entries are not allowed, now deduplicating all previous entries.', self.name )
self.allow_duplicate_entries = False
self._deduplicate_data()
#add data entries and return current data table version
return self.add_entries( other_table.data, allow_duplicates=allow_duplicates, persist=persist, persist_on_error=persist_on_error, entry_source=entry_source, **kwd )
@@ -426,6 +432,8 @@ class TabularToolDataTable( ToolDataTable, Dictifiable ):
def extend_data_with( self, filename, errors=None ):
here = os.path.dirname(os.path.abspath(filename))
self.data.extend( self.parse_file_fields( open( filename ), errors=errors, here=here ) )
if not self.allow_duplicate_entries:
self._deduplicate_data()
def parse_file_fields( self, reader, errors=None, here="__HERE__" ):
"""
@@ -536,7 +544,7 @@ class TabularToolDataTable( ToolDataTable, Dictifiable ):
is_error = False
if self.largest_index < len( fields ):
fields = self._replace_field_separators( fields )
if fields not in self.get_fields() or allow_duplicates:
if fields not in self.get_fields() or ( allow_duplicates and self.allow_duplicate_entries ):
self.data.append( fields )
else:
log.debug( "Attempted to add fields (%s) to data table '%s', but this entry already exists and allow_duplicates is False.", fields, self.name )
@@ -624,6 +632,20 @@ class TabularToolDataTable( ToolDataTable, Dictifiable ):
replace = " "
return map( lambda x: x.replace( separator, replace ), fields )
def _deduplicate_data( self ):
# Remove duplicate entries, without recreating self.data object
dup_lines = []
hash_list = []
for i, fields in enumerate( self.data ):
fields_hash = hash( self.separator.join( fields ) )
if fields_hash in hash_list:
dup_lines.append( i )
log.debug( 'Found duplicate entry in tool data table "%s", but duplicates are not allowed, removing additional entry for: "%s"', self.name, fields )
else:
hash_list.append( fields_hash )
for i in reversed( dup_lines ):
self.data.pop( i )
@property
def xml_string( self ):
return util.xml_to_string( self.config_element )
-6
View File
@@ -11,7 +11,6 @@ from galaxy.tools.wrappers import (
DatasetFilenameWrapper,
DatasetListWrapper,
DatasetCollectionWrapper,
LibraryDatasetValueWrapper,
SelectToolParameterWrapper,
InputValueWrapper,
RawObjectWrapper
@@ -19,7 +18,6 @@ from galaxy.tools.wrappers import (
from galaxy.tools.parameters.basic import (
DataToolParameter,
DataCollectionToolParameter,
LibraryDatasetToolParameter,
SelectToolParameter,
)
from galaxy.tools.parameters.grouping import Conditional, Repeat, Section
@@ -228,10 +226,6 @@ class ToolEvaluator( object ):
elif isinstance( input, SelectToolParameter ):
input_values[ input.name ] = SelectToolParameterWrapper(
input, input_values[ input.name ], self.app, other_values=param_dict, path_rewriter=self.unstructured_path_rewriter )
elif isinstance( input, LibraryDatasetToolParameter ):
# TODO: Handle input rewrites in here? How to test LibraryDatasetToolParameters?
input_values[ input.name ] = LibraryDatasetValueWrapper(
input, input_values[ input.name ], param_dict )
else:
input_values[ input.name ] = InputValueWrapper(
input, input_values[ input.name ], param_dict )
+2 -1
View File
@@ -113,12 +113,13 @@ class ToolExecutionTracker( object ):
outputs=outputs
)
try:
output_collection_name = self.tool_action.get_output_name(
output_collection_name = self.tool.tool_action.get_output_name(
output,
dataset=None,
tool=self.tool,
on_text=on_text,
trans=trans,
history=history,
params=params,
incoming=None,
job_params=None,
+134 -38
View File
@@ -587,6 +587,14 @@ class FTPFileToolParameter( ToolParameter ):
"""
input_source = ensure_input_source(input_source)
ToolParameter.__init__( self, tool, input_source )
self.multiple = input_source.get_bool( 'multiple', True )
self.user_ftp_dir = ''
def get_initial_value( self, trans, context, history=None ):
if not trans is None:
if not trans.user is None:
self.user_ftp_dir = "%s/" % trans.user_ftp_dir
return None
@property
def visible( self ):
@@ -601,28 +609,45 @@ class FTPFileToolParameter( ToolParameter ):
user_ftp_dir = trans.user_ftp_dir
return form_builder.FTPFileField( self.name, user_ftp_dir, trans.app.config.ftp_upload_site, value=value )
def to_param_dict_string( self, value, other_values={} ):
if value is '':
return 'None'
lst = [ '%s%s' % (self.user_ftp_dir, dataset) for dataset in value ]
if self.multiple:
return lst
else:
return lst[ 0 ]
def from_html( self, value, trans=None, other_values={} ):
try:
assert type( value ) is list
except:
value = [ value ]
return value
return self.to_python( value, trans.app, validate=True )
def to_string( self, value, app ):
if value in [ None, '' ]:
return None
elif isinstance( value, unicode ) or isinstance( value, str ) or isinstance( value, list ):
return value
return self.to_python( value, app )
def to_python( self, value, app ):
if value is None:
return None
elif isinstance( value, unicode ) or isinstance( value, str ) or isinstance( value, list ):
return value
def get_initial_value( self, trans, context, history=None ):
return None
def to_python( self, value, app, validate=False ):
if validate and self.tool.app.config.ftp_upload_dir is None:
raise ValueError( "The FTP directory is not configured." )
if not isinstance( value, list ):
value = [ value ]
lst = []
for val in value:
if val is None:
lst = []
break
if isinstance( val, dict ):
lst.append( val[ 'name' ] )
else:
lst.append( val )
if len( lst ) == 0:
if not self.optional and validate:
raise ValueError( "Please select a valid FTP file." )
return ''
return lst
def to_dict( self, trans, view='collection', value_mapper=None, other_values=None ):
d = super( FTPFileToolParameter, self ).to_dict( trans )
d['multiple'] = self.multiple
return d
class HiddenToolParameter( ToolParameter ):
"""
@@ -652,6 +677,7 @@ class HiddenToolParameter( ToolParameter ):
def get_label( self ):
return None
class ColorToolParameter( ToolParameter ):
"""
Parameter that stores a color.
@@ -682,9 +708,23 @@ class BaseURLToolParameter( HiddenToolParameter ):
super( BaseURLToolParameter, self ).__init__( tool, input_source )
self.value = input_source.get( 'value', '' )
def get_initial_value( self, trans, context, history=None ):
return self._get_value()
def get_html_field( self, trans=None, value=None, other_values={} ):
return form_builder.HiddenField( self.name, self._get_value() )
def from_html( self, value=None, trans=None, context={} ):
return self._get_value()
def _get_value( self ):
return url_for( self.value, qualified=True )
def to_dict( self, trans, view='collection', value_mapper=None, other_values={} ):
d = super( BaseURLToolParameter, self ).to_dict( trans )
d[ 'value' ] = self._get_value()
return d
DEFAULT_VALUE_MAP = lambda x: x
@@ -1638,7 +1678,7 @@ class BaseDataToolParameter( ToolParameter ):
class_name = self.__class__.__name__
assert trans is not None, "%s requires a trans" % class_name
if history is None:
history = trans.get_history( create=True )
history = trans.get_history()
assert history is not None, "%s requires a history" % class_name
return history
@@ -2360,8 +2400,10 @@ class LibraryDatasetToolParameter( ToolParameter ):
Parameter that lets users select a LDDA from a modal window, then use it within the wrapper.
"""
def __init__( self, tool, elem ):
ToolParameter.__init__( self, tool, elem )
def __init__( self, tool, input_source, context=None ):
input_source = ensure_input_source( input_source )
ToolParameter.__init__( self, tool, input_source )
self.multiple = input_source.get_bool( 'multiple', True )
def get_html_field( self, trans=None, value=None, other_values={} ):
return form_builder.LibraryField( self.name, value=value, trans=trans )
@@ -2370,28 +2412,82 @@ class LibraryDatasetToolParameter( ToolParameter ):
return None
def from_html( self, value, trans, other_values={} ):
if not value:
return None
elif isinstance( value, list ):
return value
return self.to_python( value, trans.app, other_values=other_values, validate=True )
def to_param_dict_string( self, value, other_values={} ):
if value is None:
return 'None'
elif self.multiple:
return [ dataset.get_file_name() for dataset in value ]
else:
decoded_lst = []
for encoded_id in value.split("||"):
decoded_lst.append( trans.sa_session.query( trans.app.model.LibraryDatasetDatasetAssociation ).get( trans.security.decode_id( encoded_id ) ) )
return decoded_lst
return value[ 0 ].get_file_name()
# converts values to json representation:
# { id: LibraryDatasetDatasetAssociation.id, name: LibraryDatasetDatasetAssociation.name, src: 'lda' }
def to_string( self, value, app ):
if not value:
return value
return [ldda.id for ldda in value]
if not isinstance( value, list ):
value = [value]
lst = []
for item in value:
encoded_id = encoded_name = None
if isinstance (item, app.model.LibraryDatasetDatasetAssociation):
encoded_id = app.security.encode_id( item.id )
encoded_name = item.name
elif isinstance (item, dict):
encoded_id = item.get('id')
encoded_name = item.get('name')
else:
lst = []
break
if encoded_id is not None:
lst.append( {
'id' : encoded_id,
'name' : encoded_name,
'src' : 'ldda'
} )
if len( lst ) == 0:
return None
else:
return lst
def to_python( self, value, app ):
if not value:
return value
lddas = []
for ldda_id in value:
lddas.append( app.model.context.query( app.model.LibraryDatasetDatasetAssociation ).get( ldda_id ) )
return lddas
# converts values into python representation:
# LibraryDatasetDatasetAssociation
# valid input values (incl. arrays of mixed sets) are:
# 1. LibraryDatasetDatasetAssociation
# 2. LibraryDatasetDatasetAssociation.id
# 3. { id: LibraryDatasetDatasetAssociation.id, ... }
def to_python( self, value, app, other_values={}, validate=False ):
if not isinstance( value, list ):
value = [value]
lst = []
for item in value:
if isinstance (item, app.model.LibraryDatasetDatasetAssociation):
lst.append(item)
else:
encoded_id = None
if isinstance (item, dict):
encoded_id = item.get('id')
elif isinstance (item, basestring):
encoded_id = item
else:
lst = []
break
lda = app.model.context.query( app.model.LibraryDatasetDatasetAssociation ).get( app.security.decode_id( encoded_id ) )
if lda is not None:
lst.append( lda )
elif validate:
raise ValueError( "One of the selected library datasets is invalid or not available anymore." )
if len( lst ) == 0:
if not self.optional and validate:
raise ValueError( "Please select a valid library dataset." )
return None
else:
return lst
def to_dict( self, trans, view='collection', value_mapper=None, other_values=None ):
d = super( LibraryDatasetToolParameter, self ).to_dict( trans )
d['multiple'] = self.multiple
return d
# class RawToolParameter( ToolParameter ):
# """
@@ -116,7 +116,7 @@ class DataMetaFilter( Filter ):
return file_value == dataset_value
assert self.ref_name in other_values or ( trans is not None and trans.workflow_building_mode), "Required dependency '%s' not found in incoming values" % self.ref_name
ref = other_values.get( self.ref_name, None )
if not isinstance( ref, self.dynamic_option.tool_param.tool.app.model.HistoryDatasetAssociation ) and not ( isinstance( ref, galaxy.tools.DatasetFilenameWrapper ) ):
if not isinstance( ref, self.dynamic_option.tool_param.tool.app.model.HistoryDatasetAssociation ) and not ( isinstance( ref, galaxy.tools.wrappers.DatasetFilenameWrapper ) ):
return [] #not a valid dataset
meta_value = ref.metadata.get( self.key, None )
if meta_value is None: #assert meta_value is not None, "Required metadata value '%s' not found in referenced dataset" % self.key
@@ -358,7 +358,7 @@ class RemoveValueFilter( Filter ):
value = other_values.get( self.ref_name )
else:
data_ref = other_values.get( self.meta_ref )
if not isinstance( data_ref, self.dynamic_option.tool_param.tool.app.model.HistoryDatasetAssociation ) and not ( isinstance( data_ref, galaxy.tools.DatasetFilenameWrapper ) ):
if not isinstance( data_ref, self.dynamic_option.tool_param.tool.app.model.HistoryDatasetAssociation ) and not ( isinstance( data_ref, galaxy.tools.wrappers.DatasetFilenameWrapper ) ):
return options #cannot modify options
value = data_ref.metadata.get( self.metadata_key, None )
return [ ( disp_name, optval, selected ) for disp_name, optval, selected in options if not compare_value( optval, value ) ]
+14 -6
View File
@@ -3,7 +3,14 @@ import galaxy.tools
from galaxy.tools.parameters.basic import (
DataToolParameter,
DataCollectionToolParameter,
SelectToolParameter,
SelectToolParameter
)
from galaxy.tools.wrappers import (
InputValueWrapper,
SelectToolParameterWrapper,
DatasetFilenameWrapper,
DatasetListWrapper,
DatasetCollectionWrapper
)
from galaxy.tools.parameters.grouping import (
Repeat,
@@ -38,6 +45,7 @@ class WrappedParameters( object ):
for input in inputs.itervalues():
if input.name not in input_values and skip_missing_values:
continue
value = input_values[ input.name ]
if isinstance( input, Repeat ):
for d in input_values[ input.name ]:
self.wrap_values( input.inputs, d, skip_missing_values=skip_missing_values )
@@ -50,27 +58,27 @@ class WrappedParameters( object ):
self.wrap_values( input.inputs, values, skip_missing_values=skip_missing_values )
elif isinstance( input, DataToolParameter ) and input.multiple:
input_values[ input.name ] = \
galaxy.tools.DatasetListWrapper( input_values[ input.name ],
DatasetListWrapper( input_values[ input.name ],
datatypes_registry=trans.app.datatypes_registry,
tool=tool,
name=input.name )
elif isinstance( input, DataToolParameter ):
input_values[ input.name ] = \
galaxy.tools.DatasetFilenameWrapper( input_values[ input.name ],
DatasetFilenameWrapper( input_values[ input.name ],
datatypes_registry=trans.app.datatypes_registry,
tool=tool,
name=input.name )
elif isinstance( input, SelectToolParameter ):
input_values[ input.name ] = galaxy.tools.SelectToolParameterWrapper( input, input_values[ input.name ], tool.app, other_values=incoming )
input_values[ input.name ] = SelectToolParameterWrapper( input, input_values[ input.name ], tool.app, other_values=incoming )
elif isinstance( input, DataCollectionToolParameter ):
input_values[ input.name ] = galaxy.tools.DatasetCollectionWrapper(
input_values[ input.name ] = DatasetCollectionWrapper(
input_values[ input.name ],
datatypes_registry=trans.app.datatypes_registry,
tool=tool,
name=input.name,
)
else:
input_values[ input.name ] = galaxy.tools.InputValueWrapper( input, input_values[ input.name ], incoming )
input_values[ input.name ] = InputValueWrapper( input, value, incoming )
def make_dict_copy( from_dict ):
+2
View File
@@ -158,6 +158,7 @@ class XmlToolSource(ToolSource):
for collection_elem in out_elem.findall("collection"):
name = collection_elem.get( "name" )
label = xml_text( collection_elem, "label" )
default_format = collection_elem.get( "format", "data" )
collection_type = collection_elem.get( "type", None )
structured_like = collection_elem.get( "structured_like", None )
@@ -180,6 +181,7 @@ class XmlToolSource(ToolSource):
output_collection = galaxy.tools.ToolOutputCollection(
name,
structure,
label=label,
default_format=default_format,
inherit_format=inherit_format,
inherit_metadata=inherit_metadata,
+12 -27
View File
@@ -57,32 +57,6 @@ class RawObjectWrapper( ToolParameterValueWrapper ):
return getattr( self.obj, key )
class LibraryDatasetValueWrapper( ToolParameterValueWrapper ):
"""
Wraps an input so that __str__ gives the "param_dict" representation.
"""
def __init__( self, input, value, other_values={} ):
self.input = input
self.value = value
self._other_values = other_values
self.counter = 0
def __str__( self ):
return self.value
def __iter__( self ):
return self
def next( self ):
if self.counter >= len(self.value):
raise StopIteration
self.counter += 1
return self.value[ self.counter - 1 ]
def __getattr__( self, key ):
return getattr( self.value, key )
class InputValueWrapper( ToolParameterValueWrapper ):
"""
Wraps an input so that __str__ gives the "param_dict" representation.
@@ -93,7 +67,18 @@ class InputValueWrapper( ToolParameterValueWrapper ):
self._other_values = other_values
def __str__( self ):
return self.input.to_param_dict_string( self.value, self._other_values )
to_param_dict_string = self.input.to_param_dict_string( self.value, self._other_values )
if isinstance( to_param_dict_string, list ):
return ','.join( to_param_dict_string )
else:
return to_param_dict_string
def __iter__( self ):
to_param_dict_string = self.input.to_param_dict_string( self.value, self._other_values )
if not isinstance( to_param_dict_string, list ):
return iter( [ to_param_dict_string ] )
else:
return iter( to_param_dict_string )
def __getattr__( self, key ):
return getattr( self.value, key )
+31 -28
View File
@@ -1,14 +1,12 @@
import ConfigParser
import hashlib
import os
import random
import tempfile
import subprocess
from galaxy.util.bunch import Bunch
from galaxy import web
from galaxy import eggs
eggs.require("PyYAML")
import yaml
from galaxy.managers import api_keys
import logging
@@ -42,6 +40,13 @@ class InteractiveEnviornmentRequest(object):
self.attr.HOST = trans.request.host.rsplit(':', 1)[0]
self.attr.PORT = self.attr.proxy_request[ 'proxied_port' ]
# Generate per-request passwords the IE plugin can use to configure
# the destination container.
self.notebook_pw_salt = self.generate_password(length=12)
self.notebook_pw = self.generate_password(length=24)
self.temp_dir = os.path.abspath( tempfile.mkdtemp() )
def load_deploy_config(self, default_dict={}):
# For backwards compat, any new variables added to the base .ini file
# will need to be recorded here. The ConfigParser doesn't provide a
@@ -68,9 +73,9 @@ class InteractiveEnviornmentRequest(object):
self.attr.APACHE_URLS = _boolean_option("apache_urls")
self.attr.SSL_URLS = _boolean_option("ssl")
def write_conf_file(self, output_directory, extra={}):
def get_conf_dict(self):
"""
Build up a configuration file that is standard for ALL IEs.
Build up a configuration dictionary that is standard for ALL IEs.
TODO: replace hashed password with plaintext.
"""
@@ -92,27 +97,11 @@ class InteractiveEnviornmentRequest(object):
else:
conf_file['galaxy_url'] = request.application_url.rstrip('/') + '/'
web_port = self.attr.galaxy_config.galaxy_infrastructure_web_port
conf_file['galaxy_paster_port'] = web_port or self.attr.galaxy_config.guess_galaxy_port()
conf_file['galaxy_web_port'] = web_port or self.attr.galaxy_config.guess_galaxy_port()
# Galaxy paster port is deprecated
conf_file['galaxy_paster_port'] = conf_file['galaxy_web_port']
if self.attr.PASSWORD_AUTH:
# Generate a random password + salt
notebook_pw_salt = self.generate_password(length=12)
notebook_pw = self.generate_password(length=24)
m = hashlib.sha1()
m.update( notebook_pw + notebook_pw_salt )
conf_file['notebook_password'] = 'sha1:%s:%s' % (notebook_pw_salt, m.hexdigest())
# Should we use password based connection or "default" connection style in galaxy
else:
notebook_pw = "None"
# Some will need to pass extra data
for extra_key in extra:
conf_file[extra_key] = extra[extra_key]
self.attr.notebook_pw = notebook_pw
# Write conf
with open( os.path.join( output_directory, 'conf.yaml' ), 'wb' ) as handle:
handle.write( yaml.dump(conf_file, default_flow_style=False) )
return conf_file
def generate_hex(self, length):
return ''.join(random.choice('0123456789abcdef') for _ in range(length))
@@ -165,12 +154,26 @@ class InteractiveEnviornmentRequest(object):
.replace('${PORT}', str(self.attr.PORT))
return url
def docker_cmd(self, temp_dir):
def docker_cmd(self, env_override={}):
"""
Generate and return the docker command to execute
"""
return '%s run -d %s -p %s:%s -v "%s:/import/" %s' % \
temp_dir = self.temp_dir
conf = self.get_conf_dict()
conf.update(env_override)
env_str = ' '.join(['-e "%s=%s"' % (key.upper(), item) for key, item in conf.items()])
return '%s run %s -d %s -p %s:%s -v "%s:/import/" %s' % \
(self.attr.viz_config.get("docker", "command"),
env_str,
self.attr.viz_config.get("docker", "command_inject"),
self.attr.PORT, self.attr.docker_port,
temp_dir, self.attr.viz_config.get("docker", "image"))
def launch(self, raw_cmd=None, env_override={}):
if raw_cmd is None:
raw_cmd = self.docker_cmd(env_override=env_override)
log.info("Starting docker container for IE {0} with command [{1}]".format(
self.attr.viz_id,
raw_cmd
))
subprocess.call(raw_cmd, shell=True)
+17
View File
@@ -36,6 +36,23 @@ var DynamicProxy = function(options) {
};
DynamicProxy.prototype.rewriteRequest = function(request) {
if(request.url.indexOf('rstudio') != -1){
var remap = {
'content-type': 'Content-Type',
'content-length': 'Content-Length',
}
// RStudio isn't spec compliant and pitches a fit on NodeJS's http module's lowercase HTTP headers
for(var i = 0; i<Object.keys(remap).length; i++){
var key = Object.keys(remap)[i];
if(key in request.headers){
request.headers[remap[key]] = request.headers[key];
delete request.headers[key];
}
}
if('Content-Type' in request.headers && request.headers['Content-Type'] == 'application/x-www-form-urlencoded; charset=UTF-8'){
request.headers['Content-Type'] = 'application/x-www-form-urlencoded';
}
}
}
DynamicProxy.prototype.targetForRequest = function(request) {
@@ -899,7 +899,7 @@ class HistoryController( BaseUIController, SharableMixin, UsesAnnotations, UsesI
for history_id in ids:
history_id = self.decode_id( history_id )
history = self.history_manager.get_owned( history_id, trans.user, current_history=trans.history )
histories.append( )
histories.append( history )
return histories
def _get_users( self, trans, user, emails_or_ids ):
+90
View File
@@ -0,0 +1,90 @@
#!/usr/bin/env python
# Little script to make HISTORY.rst more easy to format properly, lots TODO
# pull message down and embed, use arg parse, handle multiple, etc...
import os
import sys
try:
import requests
except ImportError:
requests = None
import urlparse
import textwrap
PROJECT_DIRECTORY = os.path.join(os.path.dirname(__file__), "..")
PROJECT_OWNER = "galaxyproject"
PROJECT_NAME = "galaxy"
PROJECT_URL = "https://github.com/%s/%s" % (PROJECT_OWNER, PROJECT_NAME)
PROJECT_API = "https://api.github.com/repos/%s/%s/" % (PROJECT_OWNER, PROJECT_NAME)
def main(argv):
releases_path = os.path.join(PROJECT_DIRECTORY, "doc", "source", "releases")
newest_release = sorted(os.listdir(releases_path))[-1]
history_path = os.path.join(releases_path, newest_release)
history = open(history_path, "r").read().decode("utf-8")
def extend(from_str, line):
from_str += "\n"
return history.replace(from_str, from_str + line + "\n" )
ident = argv[1]
message = ""
if len(argv) > 2:
message = argv[2]
elif not (ident.startswith("pr") or ident.startswith("issue")):
api_url = urlparse.urljoin(PROJECT_API, "commits/%s" % ident)
req = requests.get(api_url).json()
commit = req["commit"]
message = commit["message"]
message = get_first_sentence(message)
elif requests is not None and ident.startswith("pr"):
pull_request = ident[len("pr"):]
api_url = urlparse.urljoin(PROJECT_API, "pulls/%s" % pull_request)
req = requests.get(api_url).json()
message = req["title"]
elif requests is not None and ident.startswith("issue"):
issue = ident[len("issue"):]
api_url = urlparse.urljoin(PROJECT_API, "issues/%s" % pull_request)
req = requests.get(api_url).json()
message = req["title"]
else:
message = ""
to_doc = message + " "
if ident.startswith("pr"):
pull_request = ident[len("pr"):]
text = ".. _Pull Request {0}: {1}/pull/{0}".format(pull_request, PROJECT_URL)
history = extend(".. github_links", text)
to_doc += "`Pull Request {0}`_".format(pull_request)
elif ident.startswith("issue"):
issue = ident[len("issue"):]
text = ".. _Issue {0}: {1}/issues/{0}".format(issue, PROJECT_URL)
history = extend(".. github_links", text)
to_doc += "`Issue {0}`_".format(issue)
else:
short_rev = ident[:7]
text = ".. _{0}: {1}/commit/{0}".format(short_rev, PROJECT_URL)
history = extend(".. github_links", text)
to_doc += "{0}_".format(short_rev)
to_doc = wrap(to_doc)
history = extend(".. to_doc", to_doc)
open(history_path, "w").write(history.encode("utf-8"))
def get_first_sentence(message):
first_line = message.split("\n")[0]
return first_line
def wrap(message):
wrapper = textwrap.TextWrapper(initial_indent="* ")
wrapper.subsequent_indent = ' '
wrapper.width = 78
return "\n".join(wrapper.wrap(message))
if __name__ == "__main__":
main(sys.argv)
+4 -1
View File
@@ -74,7 +74,10 @@ default_galaxy_test_port_max = 9999
default_galaxy_locales = 'en'
default_galaxy_test_file_dir = "test-data,https://github.com/galaxyproject/galaxy-test-data.git"
migrated_tool_panel_config = 'config/migrated_tools_conf.xml'
installed_tool_panel_configs = [ 'config/shed_tool_conf.xml' ]
installed_tool_panel_configs = [
os.environ.get('GALAXY_TEST_SHED_TOOL_CONF', 'config/shed_tool_conf.xml')
]
# should this serve static resources (scripts, images, styles, etc.)
STATIC_ENABLED = True
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"form-parameters.js","sources":["../../../src/mvc/form/form-parameters.js"],"names":["define","Utils","Ui","SelectContent","SelectLibrary","ColorPicker","Backbone","Model","extend","types","text","select","data_column","genomebuild","data","data_collection","integer","float","boolean","drill_down","color","hidden","hidden_data","baseurl","library_data","initialize","app","this","create","input_def","undefined","value","default_value","field","fieldClass","type","call","incompatible","options","_fieldSelect","_fieldText","console","debug","_fieldData","is_workflow","info","name","textify","extensions","toString","_fieldHidden","self","View","id","optional","multiple","onchange","trigger","length","error_text","i","option","push","label","SelectClass","Select","display","Checkbox","Radio","searchable","_fieldDrilldown","Drilldown","area","validate","$","isArray","str_value","String","Input","_fieldSlider","Slider","precise","min","max","Hidden","_fieldBoolean","RadioButton","_fieldColor","_fieldLibrary"],"mappings":"AAGAA,QAAQ,cACA,iBACA,+BACA,2BACA,0BACJ,SAASC,EAAOC,EAAIC,EAAeC,EAAeC,GAGlD,MAAOC,UAASC,MAAMC,QAElBC,OACIC,KAAsB,aACtBC,OAAsB,eACtBC,YAAsB,eACtBC,YAAsB,eACtBC,KAAsB,aACtBC,gBAAsB,aACtBC,QAAsB,eACtBC,QAAsB,eACtBC,UAAsB,gBACtBC,WAAsB,kBACtBC,MAAsB,cACtBC,OAAsB,eACtBC,YAAsB,eACtBC,QAAsB,eACtBC,aAAsB,iBAI1BC,WAAY,SAASC,GACjBC,KAAKD,IAAMA,GAKfE,OAAQ,SAASC,GAEWC,SAApBD,EAAUE,QACVF,EAAUE,MAAQ,MAEUD,SAA5BD,EAAUG,gBACVH,EAAUG,cAAgBH,EAAUE,MAIxC,IAAIE,GAAQ,KAGRC,EAAaP,KAAKlB,MAAMoB,EAAUM,KA6BtC,OA5BID,IAA2C,kBAAtBP,MAAKO,KAC1BD,EAAQN,KAAKO,GAAYE,KAAKT,KAAME,IAInCI,IAEDN,KAAKD,IAAIW,cAAe,EAKpBJ,EAFAJ,EAAUS,QAEFX,KAAKY,aA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,GACnCR,KAAchB,EAAUgB,QAMhCwC,cAAe,SAASxD,GACpB,GAAIsB,GAAOxB,IACX,OAAO,IAAIzB,GAAGoF,YAAYlC,MACtBC,GAAc,SAAWxB,EAAUwB,GACnCvC,OAAkBiD,MAAQ,MAAOhC,MAAQ,SACvBgC,MAAQ,KAAOhC,MAAQ,UACzCyB,SAAc,WACVL,EAAKzB,IAAI+B,QAAQ,cAO7B8B,YAAa,SAAS1D,GAClB,GAAIsB,GAAOxB,IACX,OAAO,IAAItB,IACPgD,GAAc,SAAWxB,EAAUwB,GACnCG,SAAc,WACVL,EAAKzB,IAAI+B,QAAQ,cAO7B+B,cAAe,SAAS3D,GACpB,GAAIsB,GAAOxB,IACX,OAAO,IAAIvB,GAAcgD,MACrBC,GAAc,SAAWxB,EAAUwB,GACnCC,SAAczB,EAAUyB,SACxBC,SAAc1B,EAAU0B,SACxBC,SAAc,WACVL,EAAKzB,IAAI+B,QAAQ"}
{"version":3,"file":"form-parameters.js","sources":["../../../src/mvc/form/form-parameters.js"],"names":["define","Utils","Ui","SelectContent","SelectLibrary","SelectFtp","ColorPicker","Backbone","Model","extend","types","text","select","data_column","genomebuild","data","data_collection","integer","float","boolean","drill_down","color","hidden","hidden_data","baseurl","library_data","ftpfile","initialize","app","this","create","input_def","undefined","value","default_value","field","fieldClass","type","call","incompatible","options","_fieldSelect","_fieldText","console","debug","_fieldData","is_workflow","info","name","textify","extensions","toString","_fieldHidden","self","View","id","optional","multiple","onchange","trigger","length","error_text","i","option","push","label","SelectClass","Select","display","Checkbox","Radio","searchable","_fieldDrilldown","Drilldown","area","validate","$","isArray","str_value","String","Input","_fieldSlider","Slider","precise","min","max","Hidden","_fieldBoolean","RadioButton","_fieldColor","_fieldLibrary","_fieldFtp"],"mappings":"AAGAA,QAAQ,cACA,iBACA,+BACA,2BACA,uBACA,0BACJ,SAASC,EAAOC,EAAIC,EAAeC,EAAeC,EAAWC,GAG7D,MAAOC,UAASC,MAAMC,QAElBC,OACIC,KAA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AOxB,IACX,OAAO,IAAIxB,GAAUiD,MACjBC,GAAc,SAAWxB,EAAUwB,GACnCC,SAAczB,EAAUyB,SACxBC,SAAc1B,EAAU0B,SACxBC,SAAc,WACVL,EAAKzB,IAAI+B,QAAQ"}
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"form-section.js","sources":["../../../src/mvc/form/form-section.js"],"names":["define","Utils","Table","Ui","Portlet","Repeat","InputElement","Parameters","View","Backbone","extend","initialize","app","options","this","inputs","cls","cls_tr","table","parameters","setElement","$el","render","delAll","i","add","input","input_def","jQuery","id","uid","input_list","type","_addConditional","_addRepeat","_addSection","_addRow","self","test_param","field","onchange","value","selectedCase","data","matchCase","cases","case_def","section_id","section_row","get","nonhidden","j","hidden","fadeIn","hide","trigger","sub_section_id","sub_section","addClass","append","create","block_index","repeat","ondel","del","title","title_new","min","max","onnew","n_min","n_cache","_","size","cache","Math","input_element","label","help","button_visible","ButtonIcon","icon","tooltip","portlet","operations","$","html","visible","$content","$header","css","on","setIcon","expanded","field_list","name","default_value","collapsible","element_list"],"mappings":"AAGAA,QAAQ,cACA,kBACA,iBACA,oBACA,uBACA,sBACA,4BACJ,SAASC,EAAOC,EAAOC,EAAIC,EAASC,EAAQC,EAAcC,GAG1D,GAAIC,GAAOC,SAASD,KAAKE,QAErBC,WAAY,SAASC,EAAKC,GAEtBC,KAAKF,IAAMA,EAGXE,KAAKC,OAASF,EAAQE,OAGtBF,EAAQG,IAAM,iBAIdH,EAAQI,OAAS,cAGjBH,KAAKI,MAAQ,GAAIhB,GAAMM,KAAKK,GAG5BC,KAAKK,WAAa,GAAIZ,GAAWK,EAAKC,GAGtCC,KAAKM,WAAWN,KAAKI,MAAMG,KAG3BP,KAAKQ,UAKTA,OAAQ,WAEJR,KAAKI,MAAMK,QAGX,KAAK,GAAIC,KAAKV,MAAKC,OACfD,KAAKW,IAAIX,KAAKC,OAAOS,KAM7BC,IAAK,SAASC,GAEV,GAGIC,GAAYC,OAAOlB,QAAO,KAAU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E,UAAU3B,SAAS,sBAAsB4B,KAAK3D,EAAUmD,MAGzE,IAAIS,IAAU,CACdJ,GAAQK,SAASlC,OACjB6B,EAAQM,QAAQC,IAAI,SAAU,WAC9BP,EAAQM,QAAQE,GAAG,QAAS,WACpBJ,GACAA,GAAU,EACVJ,EAAQK,SAASlC,OACjByB,EAAea,QAAQ,kBAEvBL,GAAU,EACVJ,EAAQK,SAASnC,OAAO,QACxB0B,EAAea,QAAQ,aAK3BjE,EAAUkE,UACVV,EAAQM,QAAQlC,QAAQ,SAI5BzC,KAAKI,MAAMO,IAAI0D,EAAQ9D,KAGvBP,KAAKI,MAAMyC,OAAOhC,EAAUE,KAKhCO,QAAS,SAAST,GAEd,GAAIE,GAAKF,EAAUE,GAGfU,EAAQzB,KAAKK,WAAWyC,OAAOjC,EAGnCb,MAAKF,IAAIkF,WAAWjE,GAAMU,CAG1B,IAAIqC,GAAgB,GAAItE,GAAaQ,KAAKF,KACtCiE,MAAkBlD,EAAUkD,OAASlD,EAAUoE,KAC/CC,cAAkBrE,EAAUqE,cAC5BC,YAAkBtE,EAAUsE,YAC5BnB,KAAkBnD,EAAUmD,KAC5BvC,MAAkBA,GAkBtB,OAdAzB,MAAKF,IAAIsF,aAAarE,GAAM+C,EAG5B9D,KAAKI,MAAMO,IAAImD,EAAcvD,KAG7BP,KAAKI,MAAMyC,OAAO9B,GAGdF,EAAUyB,QACVtC,KAAKI,MAAM+B,IAAIpB,GAAIyB,OAIhBf,IAIf,QACI/B,KAAMA"}
{"version":3,"file":"form-section.js","sources":["../../../src/mvc/form/form-section.js"],"names":["define","Utils","Table","Ui","Portlet","Repeat","InputElement","Parameters","View","Backbone","extend","initialize","app","options","this","inputs","cls","cls_tr","table","parameters","setElement","$el","render","delAll","i","add","input","input_def","jQuery","id","uid","input_list","type","_addConditional","_addRepeat","_addSection","_addRow","self","test_param","field","onchange","value","selectedCase","data","matchCase","cases","case_def","section_id","section_row","get","nonhidden","j","hidden","fadeIn","hide","trigger","sub_section_id","sub_section","addClass","append","create","block_index","repeat","ondel","del","title","title_new","min","max","onnew","n_min","n_cache","_","size","cache","Math","input_element","label","help","button_visible","ButtonIcon","icon","tooltip","portlet","operations","$","html","visible","$content","$header","css","on","setIcon","input_id","find","length","expanded","field_list","name","default_value","collapsible","element_list"],"mappings":"AAGAA,QAAQ,cACA,kBACA,iBACA,oBACA,uBACA,sBACA,4BACJ,SAASC,EAAOC,EAAOC,EAAIC,EAASC,EAAQC,EAAcC,GAG1D,GAAIC,GAAOC,SAASD,KAAKE,QAErBC,WAAY,SAASC,EAAKC,GAEtBC,KAAKF,IAAMA,EAGXE,KAAKC,OAASF,EAAQE,OAGtBF,EAAQG,IAAM,iBAIdH,EAAQI,OAAS,cAGjBH,KAAKI,MAAQ,GAAIhB,GAAMM,KAAKK,GAG5BC,KAAKK,WAAa,GAAIZ,GAAWK,EAAKC,GAGtCC,KAAKM,WAAWN,KAAKI,MAAMG,KAG3BP,KAAKQ,UAKTA,OAAQ,WAEJR,KAAKI,MAAMK,QAGX,KAAK,GAAIC,KAAKV,MAAKC,OACfD,KAAKW,IAAIX,KAAKC,OAAOS,KAM7BC,IAAK,SAASC,GAEV,GAGIC,GAAYC,OAAOlB,QAAO,KAAUgB,EAGxCC,GAAUE,GAAKH,EAAMG,GAAK5B,EAAM6B,MAGhChB,KAAKF,IAAImB,WAAWJ,EAAUE,IAAMF,CAGpC,IAAIK,GAAOL,EAAUK,IACrB,QAAOA,GAEH,IAAK,cACDlB,KAAKmB,gBAAgBN,EACrB,MAEJ,KAAK,SACDb,KAAKoB,WAAWP,EAChB,MAEJ,KAAK,UACDb,KAAKqB,YAAYR,EACjB,MAEJ,SACIb,KAAKsB,QAAQT,KAMzBM,gBAAiB,SAASN,GAEtB,GAAIU,GAAOvB,IAGXa,GAAUW,WAAWT,GAAKF,EAAUE,EAGpC,IAAIU,GAAQzB,KAAKsB,QAAQT,EAAUW,WAGnCC,GAAM1B,QAAQ2B,SAAW,SAASC,GAE9B,GAAI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BzC,KAAKI,MAAMO,IAAI0D,EAAQ9D,KAGvBP,KAAKI,MAAMyC,OAAOhC,EAAUE,KAKhCO,QAAS,SAAST,GAEd,GAAIE,GAAKF,EAAUE,GAGfU,EAAQzB,KAAKK,WAAWyC,OAAOjC,EAGnCb,MAAKF,IAAIqF,WAAWpE,GAAMU,CAG1B,IAAIqC,GAAgB,GAAItE,GAAaQ,KAAKF,KACtCiE,MAAkBlD,EAAUkD,OAASlD,EAAUuE,KAC/CC,cAAkBxE,EAAUwE,cAC5BC,YAAkBzE,EAAUyE,YAC5BtB,KAAkBnD,EAAUmD,KAC5BvC,MAAkBA,GAkBtB,OAdAzB,MAAKF,IAAIyF,aAAaxE,GAAM+C,EAG5B9D,KAAKI,MAAMO,IAAImD,EAAcvD,KAG7BP,KAAKI,MAAMyC,OAAO9B,GAGdF,EAAUyB,QACVtC,KAAKI,MAAM+B,IAAIpB,GAAIyB,OAIhBf,IAIf,QACI/B,KAAMA"}
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"form-view.js","sources":["../../../src/mvc/form/form-view.js"],"names":["define","Utils","Portlet","Ui","FormSection","FormData","Backbone","View","extend","initialize","options","this","optionsDefault","is_workflow","narrow","initial_errors","cls","merge","console","debug","galaxy","parent","Galaxy","modal","Modal","setElement","_build","update","new_model","self","data","matchModel","input_id","node","input","input_list","_","isEqual","field","field_list","new_options","indexOf","type","i","opt","length","push","label","value","trigger","wait","active","is_dynamic","unwait","reciept","$el","empty","append","highlight","message","silent","input_element","element_list","error","$","animate","scrollTop","offset","top","errors","error_messages","matchResponse","off","_renderForm","create","current_check","checksum","on","new_check","onchange","reset","Message","section","inputs","incompatible","hide","show","portlet","icon","title","operations","buttons","addClass","persistent","status"],"mappings":"AAGAA,QAAQ,cAAe,oBAAqB,iBACpC,wBAAyB,sBAC7B,SAASC,EAAOC,EAASC,EAAIC,EAAaC,GAG1C,MAAOC,UAASC,KAAKC,QAEjBC,WAAY,SAASC,GAEjBC,KAAKC,gBAEDC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QK,MACvBiF,KAAc,YACdC,MAAc9E,KAAKD,QAAQ+E,MAC3BzE,IAAcL,KAAKD,QAAQM,IAC3B0E,WAAc/E,KAAKD,QAAQgF,WAC3BC,QAAchF,KAAKD,QAAQiF,UAI/BhF,KAAK4E,QAAQ9B,OAAO9C,KAAKgD,QAAQJ,IAAIqC,SAAS,kBAG9CjF,KAAK4E,QAAQ9B,OAAO9C,KAAKuE,QAAQ3B,KAGjC5C,KAAK4C,IAAIC,QACT7C,KAAK4C,IAAIE,OAAO9C,KAAK4E,QAAQhC,KAGzB5C,KAAKD,QAAQiD,SACbhD,KAAKgD,QAAQhC,QACTkE,YAAc,EACdC,OAAc,UACdnC,QAAchD,KAAKD,QAAQiD,cAKnCzC,SAAQC,MAAM"}
{"version":3,"file":"form-view.js","sources":["../../../src/mvc/form/form-view.js"],"names":["define","Utils","Portlet","Ui","FormSection","FormData","Backbone","View","extend","initialize","options","this","optionsDefault","is_workflow","narrow","initial_errors","cls","merge","console","debug","galaxy","parent","Galaxy","modal","Modal","setElement","_build","update","new_model","self","data","matchModel","input_id","node","input","input_list","_","isEqual","field","field_list","new_options","indexOf","type","i","opt","length","push","label","value","trigger","wait","active","is_dynamic","unwait","reciept","$el","empty","append","highlight","message","silent","input_element","element_list","error","$","animate","scrollTop","offset","top","errors","error_messages","matchResponse","off","_renderForm","create","current_check","checksum","on","new_check","onchange","reset","Message","section","inputs","incompatible","hide","show","portlet","icon","title","operations","buttons","addClass","persistent","status"],"mappings":"AAGAA,QAAQ,cAAe,oBAAqB,iBACpC,wBAAyB,sBAC7B,SAASC,EAAOC,EAASC,EAAIC,EAAaC,GAG1C,MAAOC,UAASC,KAAKC,QAEjBC,WAAY,SAASC,GAEjBC,KAAKC,gBAEDC,aAAkB,EAElBC,QAAkB,EAElBC,gBAAkB,EAElBC,IAAkB,sBAItBL,KAAKD,QAAUT,EAAMgB,MAAMP,EAASC,KAAKC,gBAGzCM,QAAQC,MAAMR,KAAKD,QAGnB,IAAIU,GA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3BC,QAAchF,KAAKD,QAAQiF,UAI/BhF,KAAK4E,QAAQ9B,OAAO9C,KAAKgD,QAAQJ,IAAIqC,SAAS,kBAG9CjF,KAAK4E,QAAQ9B,OAAO9C,KAAKuE,QAAQ3B,KAGjC5C,KAAK4C,IAAIC,QACT7C,KAAK4C,IAAIE,OAAO9C,KAAK4E,QAAQhC,KAGzB5C,KAAKD,QAAQiD,SACbhD,KAAKgD,QAAQhC,QACTkE,YAAc,EACdC,OAAc,UACdnC,QAAchD,KAAKD,QAAQiD,cAKnCzC,SAAQC,MAAM"}
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"ui-list.js","sources":["../../../src/mvc/ui/ui-list.js"],"names":["define","Utils","Portlet","Ui","View","Backbone","extend","initialize","options","self","this","name","multiple","message","Message","cls","portlet","select","Select","optional","button","ButtonIcon","icon","floating","tooltip","onclick","add","id","value","text","setElement","_template","$","append","$el","val","undefined","empty","isArray","i","v","v_id","v_name","type","_refresh","lst","each","push","prop","find","html","length","validate","_templateRow","on","remove","addClass","removeClass","update","status","disable","show","enable","hide","onchange"],"mappings":"AACAA,QAAQ,cAAe,oBAAqB,kBAAmB,SAASC,EAAOC,EAASC,GAGxF,GAAIC,GAAOC,SAASD,KAAKE,QAErBC,WAAa,SAASC,GAElB,GAAIC,GAAOC,IAGXA,MAAKF,QAAUA,EACfE,KAAKC,KAAOH,EAAQG,MAAQ,UAC5BD,KAAKE,SAAWJ,EAAQI,WAAY,EAGpCF,KAAKG,QAAU,GAAIV,GAAGW,SAAUC,IAAK,kBAGrCL,KAAKM,QAAU,GAAId,GAAQE,MAAOW,IAAK,uBAGvCL,KAAKO,OAAS,GAAId,GAAGe,OAAOd,MAAOe,SAAWX,EAAQW,WAGtDT,KAAKU,OAAS,GAAIjB,GAAGkB,YACjBC,KAAc,gBACdC,SAAc,OACdC,QAAc,cAAgBd,KAAKC,KACnCc,QAAc,WACVhB,EAAKiB,KACDC,GAAUlB,EAAKQ,OAAOW,QACtBjB,KAAUF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KAAKM,QAAQiB,OAAOC,GACpBxB,KAAKkC,eAELlC,MAAKG,QAAQ6C,QAAS7C,QAAS,yBAA2BH,KAAKC,KAAO,IAAKgD,OAAQ,eAGvFjD,MAAKG,QAAQ6C,QAAS7C,QAAS,QAAUH,KAAKC,KAAO,8BAK7D+C,OAAQ,SAASlD,GACbE,KAAKO,OAAOyC,OAAOlD,IAIvBoC,SAAU,WACFlC,KAAKsB,EAAE,eAAemB,OAAS,IAC9BzC,KAAKE,UAAYF,KAAKU,OAAOwC,UAC9BlD,KAAKsB,EAAE,oBAAoB6B,SAE3BnD,KAAKU,OAAO0C,SACZpD,KAAKsB,EAAE,oBAAoB+B,QAE/BrD,KAAKF,QAAQwD,UAAYtD,KAAKF,QAAQwD,YAI1CjC,UAAW,WACP,MAAQ,wLAWZsB,aAAc,SAAS7C,GACnB,MAAQ,YAAcA,EAAQmB,GAAK,6FAESnB,EAAQG,KAAO,kBAKnE,QACIP,KAAMA"}
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"ui-portlet.js","sources":["../../../src/mvc/ui/ui-portlet.js"],"names":["define","Utils","View","Backbone","extend","visible","optionsDefault","id","uid","title","icon","buttons","body","scrollable","nopadding","operations","placement","cls","operations_flt","$title","$content","$buttons","$operations","$header","initialize","options","this","merge","setElement","_template","$el","find","$portlet_content","css","$","el","self","each","name","item","prop","append","remove","content","show","fadeIn","hide","fadeOut","enableButton","disableButton","hideOperation","showOperation","setOperation","callback","off","on","new_title","html","disable","enable","tmpl"],"mappings":"AACAA,QAAQ,eAAgB,SAASC,GAGjC,GAAIC,GAAOC,SAASD,KAAKE,QAErBC,SAAS,EAGTC,gBACIC,GAAkBN,EAAMO,MACxBC,MAAkB,GAClBC,KAAkB,GAClBC,QAAkB,KAClBC,KAAkB,KAClBC,YAAkB,EAClBC,WAAkB,EAClBC,WAAkB,KAClBC,UAAkB,SAClBC,IAAkB,aAClBC,eAAkB,SAItBC,OAAS,KACTC,SAAW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AKL,SAASU,KAAK,IAAMxB,GAAIiC,KAAK,YAAY,IAIlDS,cAAe,SAAS1C,GACpBmB,KAAKL,SAASU,KAAK,IAAMxB,GAAIiC,KAAK,YAAY,IAIlDU,cAAe,SAAS3C,GACpBmB,KAAKJ,YAAYS,KAAK,IAAMxB,GAAIuC,QAIpCK,cAAe,SAAS5C,GACpBmB,KAAKJ,YAAYS,KAAK,IAAMxB,GAAIqC,QAIpCQ,aAAc,SAAS7C,EAAI8C,GACvB,GAAIvB,GAAMJ,KAAKJ,YAAYS,KAAK,IAAMxB,EACtCuB,GAAIwB,IAAI,SACRxB,EAAIyB,GAAG,QAASF,IAIpB5C,MAAO,SAAS+C,GACZ,GAAI1B,GAAMJ,KAAKP,MAIf,OAHIqC,IACA1B,EAAI2B,KAAKD,GAEN1B,EAAI2B,QAIfC,QAAS,WACLhC,KAAKQ,EAAE,qBAAqBU,QAIhCe,OAAQ,WACJjC,KAAKQ,EAAE,qBAAqBY,QAIhCjB,UAAW,SAASJ,GAChB,GAAImC,GAAQ,YAAcnC,EAAQlB,GAAK,YAAckB,EAAQR,IAAM,IA6BnE,OA3BIQ,GAAQhB,QACRmD,GAAY,6EACuDnC,EAAQP,eAAiB,uCAGxFO,EAAQf,OACRkD,GAAgB,qBAAuBnC,EAAQf,KAAO,gBAE1DkD,GAAoB,oCAAsCnC,EAAQhB,MAAQ,uBAI9EmD,GAAgB,gCAES,OAArBnC,EAAQT,YACR4C,GAAgB,+BAGpBA,GAAoB,8BAEK,UAArBnC,EAAQT,YACR4C,GAAgB,+BAGpBA,GAAgB,gDAOxB,QACI1D,KAAOA"}
{"version":3,"file":"ui-portlet.js","sources":["../../../src/mvc/ui/ui-portlet.js"],"names":["define","Utils","View","Backbone","extend","visible","optionsDefault","id","uid","title","icon","buttons","body","scrollable","nopadding","operations","placement","cls","operations_flt","$title","$content","$buttons","$operations","$header","initialize","options","this","merge","setElement","_template","$el","find","$portlet_content","css","$","el","self","each","name","item","prop","append","remove","empty","content","show","fadeIn","hide","fadeOut","enableButton","disableButton","hideOperation","showOperation","setOperation","callback","off","on","new_title","html","disable","enable","tmpl"],"mappings":"AACAA,QAAQ,eAAgB,SAASC,GAGjC,GAAIC,GAAOC,SAASD,KAAKE,QAErBC,SAAS,EAGTC,gBACIC,GAAkBN,EAAMO,MACxBC,MAAkB,GAClBC,KAAkB,GAClBC,QAAkB,KAClBC,KAAkB,KAClBC,YAAkB,EAClBC,WAAkB,EAClBC,WAAkB,KAClBC,UAAkB,SAClBC,IAAkB,aAClBC,eAAkB,SAItBC,OAAS,KACTC,SAAW,KACXC,SAAW,KACXC,YAAc,KACdC,QAAU,KAGVC,WAAa,SAASC,GAElBC,KAAKD,QAAUxB,EAAM0B,MAAMF,EAASC,KAAKpB,gBAGzCoB,KAAKE,WAAWF,KAAKG,UAAUH,KAAKD,UAGpCC,KAAKN,SAAWM,KAAKI,IAAIC,KAAK,YAG9BL,KAAKP,OAASO,KAAKI,IAAIC,KAAK,uBAG5BL,KAAKH,QAAUG,KAAKI,IAAIC,KAAK,kBAG7B,IAAIC,GAAmBN,KAAKI,IAAIC,KAAK,mBAUrC,IAPIL,KAAKD,QAAQX,YACbkB,EAAiBC,IAAI,UAAW,OAChCP,KAAKN,SAASa,IAAI,UAAW,QAIjCP,KAAKL,SAAWa,EAAER,KAAKS,IAAIJ,KAAK,YAC5BL,KAAKD,QAAQd,QAAS,CAEtB,GAAIyB,GAAOV,IACXQ,GAAEG,KAAKX,KAAKD,QAAQd,QAAS,SAAS2B,EAAMC,GACxCA,EAAKT,IAAIU,KAAK,KAAMF,GACpBF,EAAKf,SAASoB,OAAOF,EAAKT,WAG9BJ,MAAKL,SAASqB,QAKlB,IADAhB,KAAKJ,YAAcY,EAAER,KAAKS,IAAIJ,KAAK,uBAC/BL,KAAKD,QAAQV,WAAY,CAEzB,GAAIqB,GAAOV,IACXQ,GAAEG,KAAKX,KAAKD,QAAQV,WAAY,SAASuB,EAAMC,GAC3CA,EAAKT,IAAIU,KAAK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,EAAQhB,MAAQ,uBAI9EoD,GAAgB,gCAES,OAArBpC,EAAQT,YACR6C,GAAgB,+BAGpBA,GAAoB,8BAEK,UAArBpC,EAAQT,YACR6C,GAAgB,+BAGpBA,GAAgB,gDAOxB,QACI3D,KAAOA"}
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"ui-select-ftp.js","sources":["../../../src/mvc/ui/ui-select-ftp.js"],"names":["define","Utils","List","View","Backbone","extend","initialize","options","self","this","ftpfile_list","name","optional","multiple","onchange","value","setElement","$el","get","url","galaxy_config","root","success","response","data","i","push","label","update","val"],"mappings":"AACAA,QAAQ,cAAe,kBACf,SAASC,EAAOC,GAKxB,GAAIC,GAAOC,SAASD,KAAKE,QAErBC,WAAa,SAASC,GAElB,GAAIC,GAAOC,IAGXA,MAAKC,aAAe,GAAIR,GAAKC,MACzBQ,KAAc,OACdC,SAAcL,EAAQK,SACtBC,SAAcN,EAAQM,SACtBC,SAAc,WACVP,EAAQO,UAAYP,EAAQO,SAASN,EAAKO,YAKlDN,KAAKO,WAAWP,KAAKC,aAAaO,KAGlChB,EAAMiB,KACFC,IAAUC,cAAcC,KAAO,mBAC/BC,QAAU,SAASC,GACf,GAAIC,KACJ,KAAK,GAAIC,KAAKF,GACVC,EAAKE,MACDX,MAAUQ,EAASE,GAAS,KAC5BE,MAAUJ,EAASE,GAAS,MAGpCjB,GAAKE,aAAakB,OAAOJ,OAMrCT,MAAO,SAASc,GACZ,MAAOpB,MAAKC,aAAaK,MAAMc,KAIvC,QACI1B,KAAMA"}
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"ui-select-library.js","sources":["../../../src/mvc/ui/ui-select-library.js"],"names":["define","Utils","Ui","Libraries","Backbone","Collection","extend","url","galaxy_config","root","LibraryDatasets","initialize","self","this","config","Model","library_id","on","fetch","reset","get","View","options","libraries","datasets","library_select","Select","optional","onchange","value","set","dataset_select","multiple","trigger","data","each","model","push","id","label","update","library_current","text","setElement","_template","$","append","$el","success","undefined"],"mappings":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,GAC3BtB,EAAKqB,QAAQ,YAIjBpB,KAAKI,GAAG,SAAU,WACdK,EAAQM,UAAYN,EAAQM,SAAShB,EAAKiB,WAI9ChB,KAAK8B,WAAW9B,KAAK+B,aACrB/B,KAAKgC,EAAE,mBAAmBC,OAAOjC,KAAKY,eAAesB,KACrDlC,KAAKgC,EAAE,mBAAmBC,OAAOjC,KAAKkB,eAAegB,KAGrDlC,KAAKU,UAAUL,OACXC,OAAO,EACP6B,QAAS,WACLpC,EAAKa,eAAeQ,QAAQ,UACDgB,SAAvBrC,EAAKU,QAAQO,OACbjB,EAAKiB,MAAMjB,EAAKU,QAAQO,WAOxCA,MAAO,WACH,MAAOhB,MAAKkB,eAAeF,SAI/Be,UAAW,WACP,MAAQ,+QAahB,QACIvB,KAAMA"}
{"version":3,"file":"ui-select-library.js","sources":["../../../src/mvc/ui/ui-select-library.js"],"names":["define","Utils","Ui","Table","List","Libraries","Backbone","Collection","extend","url","galaxy_config","root","LibraryDatasets","initialize","self","this","config","Model","library_id","on","fetch","reset","get","View","options","libraries","datasets","library_select","Select","onchange","value","set","dataset_list","name","optional","multiple","trigger","data","each","model","push","id","label","update","library_current","text","setElement","_template","$","append","$el","success","undefined","val"],"mappings":"AACAA,QAAQ,cAAe,iBAAkB,kBAAmB,kBACpD,SAASC,EAAOC,EAAIC,EAAOC,GAGnC,GAAIC,GAAYC,SAASC,WAAWC,QAChCC,IAAKC,cAAcC,KAAO,kBAI1BC,EAAkBN,SAASC,WAAWC,QACtCK,WAAY,WACR,GAAIC,GAAOC,IACXA,MAAKC,OAAS,GAAIV,UAASW,OAAQC,WAAY,OAC/CH,KAAKC,OAAOG,GAAG,SAAU,WACrBL,EAAKM,OAAQC,OAAO,OAG5BZ,IAAK,WACD,MAAOC,eAAcC,KAAO,iBAAmBI,KAAKC,OAAOM,IAAI,cAAgB,eAKnFC,EAAOjB,SAASiB,KAAKf,QAErBK,WAAa,SAASW,GAElB,GAAIV,GAAOC,IAGXA,MAAKU,UAAa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../../src/utils/utils.js"],"names":["define","_","deepeach","dict","callback","i","d","sanitize","content","$","text","html","validate","value","Array","length","undefined","indexOf","textify","lst","toString","replace","pos","lastIndexOf","substr","get","options","top","__utils__get__","cache","url","success","console","debug","request","data","response","error","ajaxConfig","contentType","type","param","dataType","JSON","stringify","ajax","done","jQuery","parseJSON","e","fail","response_text","responseText","cssGetAttribute","classname","name","el","appendTo","css","remove","cssLoadFile","galaxy_config","root","merge","optionsDefault","defaults","bytesToString","size","normal_font","unit","rounded","Math","round","uid","__utils__uid__","time","Date","hours","getHours","minutes","getMinutes","datetime","getDate","getMonth","getFullYear"],"mappings":"AAMAA,QAAQ,mBAAoB,SAASC,GAIrC,QAASC,GAASC,EAAMC,GACpB,IAAK,GAAIC,KAAKF,GAAM,CAChB,GAAIG,GAAIH,EAAKE,EACTC,IAAkB,gBAAP,KACXF,EAASE,GACTJ,EAASI,EAAGF,KASxB,QAASG,GAASC,GACd,MAAOC,GAAE,UAAUC,KAAKF,GAASG,OAQrC,QAASC,GAAUC,GAIf,GAHMA,YAAiBC,SACnBD,GAASA,IAEQ,IAAjBA,EAAME,OACN,OAAO,CAEX,KAAK,GAAIV,KAAKQ,GACV,IAAK,WAAY,gBAAiB,OAAQ,KAAMG,QAAWC,QAAQJ,EAAMR,IAAM,GAC3E,OAAO,CAGf,QAAO,EAOX,QAASa,GAAQC,GACb,GAAIA,GAAMA,EAAIC,UACd,IAAID,EAAK,CACLA,EAAMA,EAAIE,QAAQ,KAAM,KACxB,IAAIC,GAAMH,EAAII,YAAY,KAI1B,OAHW,IAAPD,IACAH,EAAMA,EAAIK,OAAO,EAAGF,GAAO,OAASH,EAAIK,OAAOF,EAAI,IAEhDH,EAEX,MAAO,GAUX,QAASM,GAAKC,GACVC,IAAIC,eAAiBD,IAAIC,mBACrBF,EAAQG,OAASF,IAAIC,eAAeF,EAAQI,MAC5CJ,EAAQK,SAAWL,EAAQK,QAAQJ,IAAIC,eAAeF,EAAQI,MAC9DE,QAAQC,M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,MAAMf,QAChCN,EAAE,eAAiBoD,cAAcC,KAAOhC,EAAM,uBAAuB2B,SAAS,QAQtF,QAASM,GAAOrC,EAASsC,GACrB,MAAItC,GACOzB,EAAEgE,SAASvC,EAASsC,GAEpBA,EAQf,QAASE,GAAeC,EAAMC,GAE1B,GAAIC,GAAO,EACX,IAAIF,GAAQ,KAAkBA,GAAc,KAAcE,EAAO,SACjE,IAAIF,GAAQ,IAAkBA,GAAc,IAAWE,EAAO,SAC9D,IAAIF,GAAQ,IAAkBA,GAAc,IAAQE,EAAO,SAC3D,IAAIF,GAAQ,IAAkBA,GAAc,IAAKE,EAAO,SACxD,CAAA,KAAIF,EAAQ,GACR,MAAO,oBADmBA,GAAc,GAAPA,EAAWE,EAAO,IAIvD,GAAIC,GAAWC,KAAKC,MAAML,GAAQ,EAClC,OAAIC,GACOE,EAAU,IAAMD,EAEhB,WAAaC,EAAU,aAAeD,EAOrD,QAASI,KAEL,MADA9C,KAAI+C,eAAiB/C,IAAI+C,gBAAkB,EACpC,OAAS/C,IAAI+C,iBAMxB,QAASC,KAEL,GAAIrE,GAAI,GAAIsE,MAGRC,GAASvE,EAAEwE,WAAa,GAAK,IAAM,IAAMxE,EAAEwE,WAC3CC,GAAWzE,EAAE0E,aAAe,GAAK,IAAM,IAAM1E,EAAE0E,aAG/CC,EAAW3E,EAAE4E,UAAY,KACd5E,EAAE6E,WAAa,GAAM,IACtB7E,EAAE8E,cAAgB,KAClBP,EAAQ,IACRE,CACd,OAAOE,GAGX,OACIrB,YAAgBA,EAChBP,gBAAkBA,EAClB5B,IAAMA,EACNsC,MAAQA,EACRG,cAAeA,EACfO,IAAKA,EACLE,KAAMA,EACNzC,QAASA,EACT3B,SAAUA,EACVW,QAASA,EACTN,SAAUA,EACVV,SAAUA"}
{"version":3,"file":"utils.js","sources":["../../src/utils/utils.js"],"names":["define","_","deepeach","dict","callback","i","d","sanitize","content","$","text","html","validate","value","Array","length","undefined","indexOf","textify","lst","toString","replace","pos","lastIndexOf","substr","get","options","top","__utils__get__","cache","url","success","console","debug","request","data","response","error","ajaxConfig","contentType","type","param","dataType","JSON","stringify","ajax","done","jQuery","parseJSON","e","fail","response_text","responseText","cssGetAttribute","classname","name","el","appendTo","css","remove","cssLoadFile","galaxy_config","root","merge","optionsDefault","defaults","bytesToString","size","normal_font","unit","rounded","Math","round","uid","__utils__uid__","time","Date","hours","getHours","minutes","getMinutes","datetime","getDate","getMonth","getFullYear"],"mappings":"AAMAA,QAAQ,mBAAoB,SAASC,GAIrC,QAASC,GAASC,EAAMC,GACpB,IAAK,GAAIC,KAAKF,GAAM,CAChB,GAAIG,GAAIH,EAAKE,EACTC,IAAkB,gBAAP,KACXF,EAASE,GACTJ,EAASI,EAAGF,KASxB,QAASG,GAASC,GACd,MAAOC,GAAE,UAAUC,KAAKF,GAASG,OAQrC,QAASC,GAAUC,GAIf,GAHMA,YAAiBC,SACnBD,GAASA,IAEQ,IAAjBA,EAAME,OACN,OAAO,CAEX,KAAK,GAAIV,KAAKQ,GACV,IAAK,WAAY,gBAAiB,KAAMG,QAAWC,QAAQJ,EAAMR,IAAM,GACnE,OAAO,CAGf,QAAO,EAOX,QAASa,GAAQC,GACb,GAAIA,GAAMA,EAAIC,UACd,IAAID,EAAK,CACLA,EAAMA,EAAIE,QAAQ,KAAM,KACxB,IAAIC,GAAMH,EAAII,YAAY,KAI1B,OAHW,IAAPD,IACAH,EAAMA,EAAIK,OAAO,EAAGF,GAAO,OAASH,EAAIK,OAAOF,EAAI,IAEhDH,EAEX,MAAO,GAUX,QAASM,GAAKC,GACVC,IAAIC,eAAiBD,IAAIC,mBACrBF,EAAQG,OAASF,IAAIC,eAAeF,EAAQI,MAC5CJ,EAAQK,SAAWL,EAAQK,QAAQJ,IAAIC,eAAeF,EAAQI,MAC9DE,QAAQC,MAAM,0CAA4CP,EAAQI,IAAM,OAExEI,GACIJ,IAAUJ,EAAQI,IAClBK,KAAUT,EAAQS,KAClBJ,QAAU,SAASK,GACfT,IAAIC,e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OzB,EAAEgE,SAASvC,EAASsC,GAEpBA,EAQf,QAASE,GAAeC,EAAMC,GAE1B,GAAIC,GAAO,EACX,IAAIF,GAAQ,KAAkBA,GAAc,KAAcE,EAAO,SACjE,IAAIF,GAAQ,IAAkBA,GAAc,IAAWE,EAAO,SAC9D,IAAIF,GAAQ,IAAkBA,GAAc,IAAQE,EAAO,SAC3D,IAAIF,GAAQ,IAAkBA,GAAc,IAAKE,EAAO,SACxD,CAAA,KAAIF,EAAQ,GACR,MAAO,oBADmBA,GAAc,GAAPA,EAAWE,EAAO,IAIvD,GAAIC,GAAWC,KAAKC,MAAML,GAAQ,EAClC,OAAIC,GACOE,EAAU,IAAMD,EAEhB,WAAaC,EAAU,aAAeD,EAOrD,QAASI,KAEL,MADA9C,KAAI+C,eAAiB/C,IAAI+C,gBAAkB,EACpC,OAAS/C,IAAI+C,iBAMxB,QAASC,KAEL,GAAIrE,GAAI,GAAIsE,MAGRC,GAASvE,EAAEwE,WAAa,GAAK,IAAM,IAAMxE,EAAEwE,WAC3CC,GAAWzE,EAAE0E,aAAe,GAAK,IAAM,IAAM1E,EAAE0E,aAG/CC,EAAW3E,EAAE4E,UAAY,KACd5E,EAAE6E,WAAa,GAAM,IACtB7E,EAAE8E,cAAgB,KAClBP,EAAQ,IACRE,CACd,OAAOE,GAGX,OACIrB,YAAgBA,EAChBP,gBAAkBA,EAClB5B,IAAMA,EACNsC,MAAQA,EACRG,cAAeA,EACfO,IAAKA,EACLE,KAAMA,EACNzC,QAASA,EACT3B,SAAUA,EACVW,QAASA,EACTN,SAAUA,EACVV,SAAUA"}
+1 -1
View File
@@ -1,2 +1,2 @@
define(["utils/utils","mvc/ui/ui-misc","mvc/form/form-select-content","mvc/ui/ui-select-library","mvc/ui/ui-color-picker"],function(a,b,c,d,e){return Backbone.Model.extend({types:{text:"_fieldText",select:"_fieldSelect",data_column:"_fieldSelect",genomebuild:"_fieldSelect",data:"_fieldData",data_collection:"_fieldData",integer:"_fieldSlider","float":"_fieldSlider","boolean":"_fieldBoolean",drill_down:"_fieldDrilldown",color:"_fieldColor",hidden:"_fieldHidden",hidden_data:"_fieldHidden",baseurl:"_fieldHidden",library_data:"_fieldLibrary"},initialize:function(a){this.app=a},create:function(a){void 0===a.value&&(a.value=null),void 0===a.default_value&&(a.default_value=a.value);var b=null,c=this.types[a.type];return c&&"function"==typeof this[c]&&(b=this[c].call(this,a)),b||(this.app.incompatible=!0,b=a.options?this._fieldSelect(a):this._fieldText(a),console.debug("tools-form::_addRow() : Auto matched field type ("+a.type+").")),void 0!==a.value&&b.value(a.value),b},_fieldData:function(b){if(this.app.options.is_workflow)return b.info="Data input '"+b.name+"' ("+a.textify(b.extensions.toString())+")",b.value=null,this._fieldHidden(b);var d=this;return new c.View(this.app,{id:"field-"+b.id,extensions:b.extensions,optional:b.optional,multiple:b.multiple,type:b.type,data:b.options,onchange:function(){d.app.trigger("change")}})},_fieldSelect:function(a){if(0==a.options.length&&this.app.options.is_workflow)return this._fieldText(a);"data_column"==a.type&&(a.error_text="Missing columns in referenced dataset.");var c=[];for(var d in a.options){var e=a.options[d];c.push({label:e[0],value:e[1]})}var f=b.Select;switch(a.display){case"checkboxes":f=b.Checkbox;break;case"radio":f=b.Radio}var g=this;return new f.View({id:"field-"+a.id,data:c,error_text:a.error_text||"No options available",optional:a.optional&&null===a.default_value,multiple:a.multiple,optional:a.optional,searchable:a.searchable,onchange:function(){g.app.trigger("change")}})},_fieldDrilldown:function(a){if(0==a.options.length&&this.app.options.is_workflow)return this._fieldText(a);var c=this;return new b.Drilldown.View({id:"field-"+a.id,data:a.options,display:a.display,onchange:function(){c.app.trigger("change")}})},_fieldText:function(c){if(c.options)if(c.area=c.multiple,a.validate(c.value)){if($.isArray(c.value)){var d="";for(var e in c.value){if(d+=String(c.value[e]),!c.multiple)break;d+="\n"}c.value=d}}else c.value="";var f=this;return new b.Input({id:"field-"+c.id,area:c.area,onchange:function(){f.app.trigger("change")}})},_fieldSlider:function(a){var c=this;return new b.Slider.View({id:"field-"+a.id,precise:"float"==a.type,min:a.min,max:a.max,onchange:function(){c.app.trigger("change")}})},_fieldHidden:function(a){return new b.Hidden({id:"field-"+a.id,info:a.info})},_fieldBoolean:function(a){var c=this;return new b.RadioButton.View({id:"field-"+a.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}],onchange:function(){c.app.trigger("change")}})},_fieldColor:function(a){var b=this;return new e({id:"field-"+a.id,onchange:function(){b.app.trigger("change")}})},_fieldLibrary:function(a){var b=this;return new d.View({id:"field-"+a.id,optional:a.optional,multiple:a.multiple,onchange:function(){b.app.trigger("change")}})}})});
define(["utils/utils","mvc/ui/ui-misc","mvc/form/form-select-content","mvc/ui/ui-select-library","mvc/ui/ui-select-ftp","mvc/ui/ui-color-picker"],function(a,b,c,d,e,f){return Backbone.Model.extend({types:{text:"_fieldText",select:"_fieldSelect",data_column:"_fieldSelect",genomebuild:"_fieldSelect",data:"_fieldData",data_collection:"_fieldData",integer:"_fieldSlider","float":"_fieldSlider","boolean":"_fieldBoolean",drill_down:"_fieldDrilldown",color:"_fieldColor",hidden:"_fieldHidden",hidden_data:"_fieldHidden",baseurl:"_fieldHidden",library_data:"_fieldLibrary",ftpfile:"_fieldFtp"},initialize:function(a){this.app=a},create:function(a){void 0===a.value&&(a.value=null),void 0===a.default_value&&(a.default_value=a.value);var b=null,c=this.types[a.type];return c&&"function"==typeof this[c]&&(b=this[c].call(this,a)),b||(this.app.incompatible=!0,b=a.options?this._fieldSelect(a):this._fieldText(a),console.debug("tools-form::_addRow() : Auto matched field type ("+a.type+").")),void 0!==a.value&&b.value(a.value),b},_fieldData:function(b){if(this.app.options.is_workflow)return b.info="Data input '"+b.name+"' ("+a.textify(b.extensions.toString())+")",b.value=null,this._fieldHidden(b);var d=this;return new c.View(this.app,{id:"field-"+b.id,extensions:b.extensions,optional:b.optional,multiple:b.multiple,type:b.type,data:b.options,onchange:function(){d.app.trigger("change")}})},_fieldSelect:function(a){if(0==a.options.length&&this.app.options.is_workflow)return this._fieldText(a);"data_column"==a.type&&(a.error_text="Missing columns in referenced dataset.");var c=[];for(var d in a.options){var e=a.options[d];c.push({label:e[0],value:e[1]})}var f=b.Select;switch(a.display){case"checkboxes":f=b.Checkbox;break;case"radio":f=b.Radio}var g=this;return new f.View({id:"field-"+a.id,data:c,error_text:a.error_text||"No options available",optional:a.optional&&null===a.default_value,multiple:a.multiple,optional:a.optional,searchable:a.searchable,onchange:function(){g.app.trigger("change")}})},_fieldDrilldown:function(a){if(0==a.options.length&&this.app.options.is_workflow)return this._fieldText(a);var c=this;return new b.Drilldown.View({id:"field-"+a.id,data:a.options,display:a.display,onchange:function(){c.app.trigger("change")}})},_fieldText:function(c){if(c.options)if(c.area=c.multiple,a.validate(c.value)){if($.isArray(c.value)){var d="";for(var e in c.value){if(d+=String(c.value[e]),!c.multiple)break;d+="\n"}c.value=d}}else c.value="";var f=this;return new b.Input({id:"field-"+c.id,area:c.area,onchange:function(){f.app.trigger("change")}})},_fieldSlider:function(a){var c=this;return new b.Slider.View({id:"field-"+a.id,precise:"float"==a.type,min:a.min,max:a.max,onchange:function(){c.app.trigger("change")}})},_fieldHidden:function(a){return new b.Hidden({id:"field-"+a.id,info:a.info})},_fieldBoolean:function(a){var c=this;return new b.RadioButton.View({id:"field-"+a.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}],onchange:function(){c.app.trigger("change")}})},_fieldColor:function(a){var b=this;return new f({id:"field-"+a.id,onchange:function(){b.app.trigger("change")}})},_fieldLibrary:function(a){var b=this;return new d.View({id:"field-"+a.id,optional:a.optional,multiple:a.multiple,onchange:function(){b.app.trigger("change")}})},_fieldFtp:function(a){var b=this;return new e.View({id:"field-"+a.id,optional:a.optional,multiple:a.multiple,onchange:function(){b.app.trigger("change")}})}})});
//# sourceMappingURL=../../../maps/mvc/form/form-parameters.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/ui/ui-portlet","mvc/form/form-repeat","mvc/form/form-input","mvc/form/form-parameters"],function(a,b,c,d,e,f,g){var h=Backbone.View.extend({initialize:function(a,c){this.app=a,this.inputs=c.inputs,c.cls="ui-table-plain",c.cls_tr="section-row",this.table=new b.View(c),this.parameters=new g(a,c),this.setElement(this.table.$el),this.render()},render:function(){this.table.delAll();for(var a in this.inputs)this.add(this.inputs[a])},add:function(b){var c=jQuery.extend(!0,{},b);c.id=b.id=a.uid(),this.app.input_list[c.id]=c;var d=c.type;switch(d){case"conditional":this._addConditional(c);break;case"repeat":this._addRepeat(c);break;case"section":this._addSection(c);break;default:this._addRow(c)}},_addConditional:function(a){var b=this;a.test_param.id=a.id;var c=this._addRow(a.test_param);c.options.onchange=function(c){var d=b.app.data.matchCase(a,c);for(var e in a.cases){var f=a.cases[e],g=a.id+"-section-"+e,h=b.table.get(g),i=!1;for(var j in f.inputs)if(!f.inputs[j].hidden){i=!0;break}e==d&&i?h.fadeIn("fast"):h.hide()}b.app.trigger("change")};for(var d in a.cases){var e=a.id+"-section-"+d,f=new h(this.app,{inputs:a.cases[d].inputs});f.$el.addClass("ui-table-section"),this.table.add(f.$el),this.table.append(e)}c.trigger("change")},_addRepeat:function(a){function b(b){var e=a.id+"-section-"+d++,f=new h(c.app,{inputs:b});g.add({id:e,$el:f.$el,ondel:function(){g.del(e),c.app.trigger("change")}})}for(var c=this,d=0,g=new e.View({title:a.title,title_new:a.title,min:a.min,max:a.max,onnew:function(){b(a.inputs),c.app.trigger("change")}}),i=a.min,j=_.size(a.cache),k=0;k<Math.max(j,i);k++){var l=null;l=j>k?a.cache[k]:a.inputs,b(l)}var m=new f(this.app,{label:a.title,help:a.help,field:g});this.table.add(m.$el),this.table.append(a.id)},_addSection:function(a){var b=this,e=new h(b.app,{inputs:a.inputs}),f=new c.ButtonIcon({icon:"fa-eye-slash",tooltip:"Show/hide section",cls:"ui-button-icon-plain"}),g=new d.View({title:a.title,cls:"ui-portlet-section",operations:{button_visible:f}});g.append(e.$el),g.append($("<div/>").addClass("ui-table-form-info").html(a.help));var i=!1;g.$content.hide(),g.$header.css("cursor","pointer"),g.$header.on("click",function(){i?(i=!1,g.$content.hide(),f.setIcon("fa-eye-slash")):(i=!0,g.$content.fadeIn("fast"),f.setIcon("fa-eye"))}),a.expanded&&g.$header.trigger("click"),this.table.add(g.$el),this.table.append(a.id)},_addRow:function(a){var b=a.id,c=this.parameters.create(a);this.app.field_list[b]=c;var d=new f(this.app,{label:a.label||a.name,default_value:a.default_value,collapsible:a.collapsible,help:a.help,field:c});return this.app.element_list[b]=d,this.table.add(d.$el),this.table.append(b),a.hidden&&this.table.get(b).hide(),c}});return{View:h}});
define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/ui/ui-portlet","mvc/form/form-repeat","mvc/form/form-input","mvc/form/form-parameters"],function(a,b,c,d,e,f,g){var h=Backbone.View.extend({initialize:function(a,c){this.app=a,this.inputs=c.inputs,c.cls="ui-table-plain",c.cls_tr="section-row",this.table=new b.View(c),this.parameters=new g(a,c),this.setElement(this.table.$el),this.render()},render:function(){this.table.delAll();for(var a in this.inputs)this.add(this.inputs[a])},add:function(b){var c=jQuery.extend(!0,{},b);c.id=b.id=a.uid(),this.app.input_list[c.id]=c;var d=c.type;switch(d){case"conditional":this._addConditional(c);break;case"repeat":this._addRepeat(c);break;case"section":this._addSection(c);break;default:this._addRow(c)}},_addConditional:function(a){var b=this;a.test_param.id=a.id;var c=this._addRow(a.test_param);c.options.onchange=function(c){var d=b.app.data.matchCase(a,c);for(var e in a.cases){var f=a.cases[e],g=a.id+"-section-"+e,h=b.table.get(g),i=!1;for(var j in f.inputs)if(!f.inputs[j].hidden){i=!0;break}e==d&&i?h.fadeIn("fast"):h.hide()}b.app.trigger("change")};for(var d in a.cases){var e=a.id+"-section-"+d,f=new h(this.app,{inputs:a.cases[d].inputs});f.$el.addClass("ui-table-section"),this.table.add(f.$el),this.table.append(e)}c.trigger("change")},_addRepeat:function(a){function b(b){var e=a.id+"-section-"+d++,f=new h(c.app,{inputs:b});g.add({id:e,$el:f.$el,ondel:function(){g.del(e),c.app.trigger("change")}})}for(var c=this,d=0,g=new e.View({title:a.title,title_new:a.title,min:a.min,max:a.max,onnew:function(){b(a.inputs),c.app.trigger("change")}}),i=a.min,j=_.size(a.cache),k=0;k<Math.max(j,i);k++){var l=null;l=j>k?a.cache[k]:a.inputs,b(l)}var m=new f(this.app,{label:a.title,help:a.help,field:g});this.table.add(m.$el),this.table.append(a.id)},_addSection:function(a){var b=this,e=new h(b.app,{inputs:a.inputs}),f=new c.ButtonIcon({icon:"fa-eye-slash",tooltip:"Show/hide section",cls:"ui-button-icon-plain"}),g=new d.View({title:a.title,cls:"ui-portlet-section",operations:{button_visible:f}});g.append(e.$el),g.append($("<div/>").addClass("ui-table-form-info").html(a.help));var i=!1;g.$content.hide(),g.$header.css("cursor","pointer"),g.$header.on("click",function(){i?(i=!1,g.$content.hide(),f.setIcon("fa-eye-slash")):(i=!0,g.$content.fadeIn("fast"),f.setIcon("fa-eye"))}),this.app.on("expand",function(a){g.$el.find("#"+a).length>0&&!i&&g.$header.trigger("click")}),a.expanded&&g.$header.trigger("click"),this.table.add(g.$el),this.table.append(a.id)},_addRow:function(a){var b=a.id,c=this.parameters.create(a);this.app.field_list[b]=c;var d=new f(this.app,{label:a.label||a.name,default_value:a.default_value,collapsible:a.collapsible,help:a.help,field:c});return this.app.element_list[b]=d,this.table.add(d.$el),this.table.append(b),a.hidden&&this.table.get(b).hide(),c}});return{View:h}});
//# sourceMappingURL=../../../maps/mvc/form/form-section.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
define(["utils/utils","mvc/ui/ui-portlet","mvc/ui/ui-misc","mvc/form/form-section","mvc/form/form-data"],function(a,b,c,d,e){return Backbone.View.extend({initialize:function(b){this.optionsDefault={is_workflow:!1,narrow:!1,initial_errors:!1,cls:"ui-portlet-limited"},this.options=a.merge(b,this.optionsDefault),console.debug(this.options);var d=parent.Galaxy;this.modal=d&&d.modal?d.modal:new c.Modal.View,this.setElement("<div/>"),this._build()},update:function(a){var b=this;this.data.matchModel(a,function(a,c){var d=b.input_list[a];if(d&&d.options&&!_.isEqual(d.options,c.options)){d.options=c.options;var e=b.field_list[a];if(e.update){var f=[];if(-1!=["data","data_collection","drill_down"].indexOf(d.type))f=d.options;else for(var g in c.options){var h=c.options[g];h.length>2&&f.push({label:h[0],value:h[1]})}e.update(f),e.trigger("change"),console.debug("Updating options for "+a)}}})},wait:function(a){for(var b in this.input_list){var c=this.field_list[b],d=this.input_list[b];d.is_dynamic&&c.wait&&c.unwait&&(a?c.wait():c.unwait())}},reciept:function(a){this.$el.empty(),this.$el.append(a)},highlight:function(a,b,c){var d=this.element_list[a];d&&(d.error(b||"Please verify this parameter."),c||$("html, body").animate({scrollTop:d.$el.offset().top-20},500))},errors:function(a){if(this.trigger("reset"),a&&a.errors){var b=this.data.matchResponse(a.errors);for(var c in this.element_list){{this.element_list[c]}b[c]&&this.highlight(c,b[c],!0)}}},_build:function(){var a=this;this.off("change"),this.off("reset"),this.field_list={},this.input_list={},this.element_list={},this.data=new e(this),this._renderForm(),this.data.create(),this.options.initial_errors&&this.errors(this.options);var b=this.data.checksum();this.on("change",function(){var c=a.data.checksum();c!=b&&(b=c,a.options.onchange&&a.options.onchange())}),this.on("reset",function(){for(var a in this.element_list)this.element_list[a].reset()})},_renderForm:function(){return this.message=new c.Message,this.section=new d.View(this,{inputs:this.options.inputs}),this.incompatible?(this.$el.hide(),void $("#tool-form-classic").show()):(this.portlet=new b.View({icon:"fa-wrench",title:this.options.title,cls:this.options.cls,operations:this.options.operations,buttons:this.options.buttons}),this.portlet.append(this.message.$el.addClass("ui-margin-top")),this.portlet.append(this.section.$el),this.$el.empty(),this.$el.append(this.portlet.$el),this.options.message&&this.message.update({persistent:!0,status:"warning",message:this.options.message}),void console.debug("tools-form-base::initialize() - Completed."))}})});
define(["utils/utils","mvc/ui/ui-portlet","mvc/ui/ui-misc","mvc/form/form-section","mvc/form/form-data"],function(a,b,c,d,e){return Backbone.View.extend({initialize:function(b){this.optionsDefault={is_workflow:!1,narrow:!1,initial_errors:!1,cls:"ui-portlet-limited"},this.options=a.merge(b,this.optionsDefault),console.debug(this.options);var d=parent.Galaxy;this.modal=d&&d.modal?d.modal:new c.Modal.View,this.setElement("<div/>"),this._build()},update:function(a){var b=this;this.data.matchModel(a,function(a,c){var d=b.input_list[a];if(d&&d.options&&!_.isEqual(d.options,c.options)){d.options=c.options;var e=b.field_list[a];if(e.update){var f=[];if(-1!=["data","data_collection","drill_down"].indexOf(d.type))f=d.options;else for(var g in c.options){var h=c.options[g];h.length>2&&f.push({label:h[0],value:h[1]})}e.update(f),e.trigger("change"),console.debug("Updating options for "+a)}}})},wait:function(a){for(var b in this.input_list){var c=this.field_list[b],d=this.input_list[b];d.is_dynamic&&c.wait&&c.unwait&&(a?c.wait():c.unwait())}},reciept:function(a){this.$el.empty(),this.$el.append(a)},highlight:function(a,b,c){var d=this.element_list[a];d&&(d.error(b||"Please verify this parameter."),this.trigger("expand",a),c||$("html, body").animate({scrollTop:d.$el.offset().top-20},500))},errors:function(a){if(this.trigger("reset"),a&&a.errors){var b=this.data.matchResponse(a.errors);for(var c in this.element_list){{this.element_list[c]}b[c]&&this.highlight(c,b[c],!0)}}},_build:function(){var a=this;this.off("change"),this.off("reset"),this.field_list={},this.input_list={},this.element_list={},this.data=new e(this),this._renderForm(),this.data.create(),this.options.initial_errors&&this.errors(this.options);var b=this.data.checksum();this.on("change",function(){var c=a.data.checksum();c!=b&&(b=c,a.options.onchange&&a.options.onchange())}),this.on("reset",function(){for(var a in this.element_list)this.element_list[a].reset()})},_renderForm:function(){return this.message=new c.Message,this.section=new d.View(this,{inputs:this.options.inputs}),this.incompatible?(this.$el.hide(),void $("#tool-form-classic").show()):(this.portlet=new b.View({icon:"fa-wrench",title:this.options.title,cls:this.options.cls,operations:this.options.operations,buttons:this.options.buttons}),this.portlet.append(this.message.$el.addClass("ui-margin-top")),this.portlet.append(this.section.$el),this.$el.empty(),this.$el.append(this.portlet.$el),this.options.message&&this.message.update({persistent:!0,status:"warning",message:this.options.message}),void console.debug("tools-form-base::initialize() - Completed."))}})});
//# sourceMappingURL=../../../maps/mvc/form/form-view.js.map
+2
View File
@@ -0,0 +1,2 @@
define(["utils/utils","mvc/ui/ui-portlet","mvc/ui/ui-misc"],function(a,b,c){var d=Backbone.View.extend({initialize:function(a){var d=this;this.options=a,this.name=a.name||"element",this.multiple=a.multiple||!1,this.message=new c.Message({cls:"ui-margin-top"}),this.portlet=new b.View({cls:"ui-portlet-section"}),this.select=new c.Select.View({optional:a.optional}),this.button=new c.ButtonIcon({icon:"fa fa-sign-in",floating:"left",tooltip:"Insert new "+this.name,onclick:function(){d.add({id:d.select.value(),name:d.select.text()})}}),this.setElement(this._template(a)),this.$(".ui-list-message").append(this.message.$el),this.$(".ui-list-portlet").append(this.portlet.$el),this.$(".ui-list-button").append(this.button.$el),this.$(".ui-list-select").append(this.select.$el)},value:function(a){if(void 0!==a){if(this.portlet.empty(),$.isArray(a))for(var b in a){var c=a[b],d=null,e=null;"string"!=$.type(c)?(d=c.id,e=c.name):d=e=c,null!=d&&this.add({id:d,name:e})}this._refresh()}var f=[];return this.$(".ui-list-id").each(function(){f.push({id:$(this).prop("id"),name:$(this).find(".ui-list-name").html()})}),0==f.length?null:f},add:function(b){var c=this;if(0===this.$('[id="'+b.id+'"]').length)if(a.validate(b.id)){var d=$(this._templateRow({id:b.id,name:b.name}));d.on("click",function(){d.remove(),c._refresh()}),d.on("mouseover",function(){d.addClass("portlet-highlight")}),d.on("mouseout",function(){d.removeClass("portlet-highlight")}),this.portlet.append(d),this._refresh()}else this.message.update({message:"Please select a valid "+this.name+".",status:"danger"});else this.message.update({message:"This "+this.name+" is already in the list."})},update:function(a){this.select.update(a)},_refresh:function(){this.$(".ui-list-id").length>0?(!this.multiple&&this.button.disable(),this.$(".ui-list-portlet").show()):(this.button.enable(),this.$(".ui-list-portlet").hide()),this.options.onchange&&this.options.onchange()},_template:function(){return'<div class="ui-list"><div class="ui-margin-top"><span class="ui-list-button"/><span class="ui-list-select"/></div><div class="ui-list-message"/><div class="ui-list-portlet"/></div>'},_templateRow:function(a){return'<div id="'+a.id+'" class="ui-list-id"><span class="ui-list-delete fa fa-trash"/><span class="ui-list-name">'+a.name+"</span></div>"}});return{View:d}});
//# sourceMappingURL=../../../maps/mvc/ui/ui-list.js.map
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,2 +1,2 @@
define(["utils/utils"],function(a){var b=Backbone.View.extend({visible:!1,optionsDefault:{id:a.uid(),title:"",icon:"",buttons:null,body:null,scrollable:!0,nopadding:!1,operations:null,placement:"bottom",cls:"ui-portlet",operations_flt:"right"},$title:null,$content:null,$buttons:null,$operations:null,$header:null,initialize:function(b){this.options=a.merge(b,this.optionsDefault),this.setElement(this._template(this.options)),this.$content=this.$el.find(".content"),this.$title=this.$el.find(".portlet-title-text"),this.$header=this.$el.find(".portlet-header");var c=this.$el.find(".portlet-content");if(this.options.nopadding&&(c.css("padding","0px"),this.$content.css("padding","0px")),this.$buttons=$(this.el).find(".buttons"),this.options.buttons){var d=this;$.each(this.options.buttons,function(a,b){b.$el.prop("id",a),d.$buttons.append(b.$el)})}else this.$buttons.remove();if(this.$operations=$(this.el).find(".portlet-operations"),this.options.operations){var d=this;$.each(this.options.operations,function(a,b){b.$el.prop("id",a),d.$operations.append(b.$el)})}this.options.body&&this.append(this.options.body)},append:function(a){this.$content.append(a)},content:function(){return this.$content},show:function(){this.$el.fadeIn("fast"),this.visible=!0},hide:function(){this.$el.fadeOut("fast"),this.visible=!1},enableButton:function(a){this.$buttons.find("#"+a).prop("disabled",!1)},disableButton:function(a){this.$buttons.find("#"+a).prop("disabled",!0)},hideOperation:function(a){this.$operations.find("#"+a).hide()},showOperation:function(a){this.$operations.find("#"+a).show()},setOperation:function(a,b){var c=this.$operations.find("#"+a);c.off("click"),c.on("click",b)},title:function(a){var b=this.$title;return a&&b.html(a),b.html()},disable:function(){this.$(".portlet-backdrop").show()},enable:function(){this.$(".portlet-backdrop").hide()},_template:function(a){var b='<div id="'+a.id+'" class="'+a.cls+'">';return a.title&&(b+='<div class="portlet-header"><div class="portlet-operations" style="float: '+a.operations_flt+';"></div><div class="portlet-title">',a.icon&&(b+='<i class="icon fa '+a.icon+'">&nbsp;</i>'),b+='<span class="portlet-title-text">'+a.title+"</span></div></div>"),b+='<div class="portlet-content">',"top"==a.placement&&(b+='<div class="buttons"></div>'),b+='<div class="content"></div>',"bottom"==a.placement&&(b+='<div class="buttons"></div>'),b+='</div><div class="portlet-backdrop"/></div>'}});return{View:b}});
define(["utils/utils"],function(a){var b=Backbone.View.extend({visible:!1,optionsDefault:{id:a.uid(),title:"",icon:"",buttons:null,body:null,scrollable:!0,nopadding:!1,operations:null,placement:"bottom",cls:"ui-portlet",operations_flt:"right"},$title:null,$content:null,$buttons:null,$operations:null,$header:null,initialize:function(b){this.options=a.merge(b,this.optionsDefault),this.setElement(this._template(this.options)),this.$content=this.$el.find(".content"),this.$title=this.$el.find(".portlet-title-text"),this.$header=this.$el.find(".portlet-header");var c=this.$el.find(".portlet-content");if(this.options.nopadding&&(c.css("padding","0px"),this.$content.css("padding","0px")),this.$buttons=$(this.el).find(".buttons"),this.options.buttons){var d=this;$.each(this.options.buttons,function(a,b){b.$el.prop("id",a),d.$buttons.append(b.$el)})}else this.$buttons.remove();if(this.$operations=$(this.el).find(".portlet-operations"),this.options.operations){var d=this;$.each(this.options.operations,function(a,b){b.$el.prop("id",a),d.$operations.append(b.$el)})}this.options.body&&this.append(this.options.body)},append:function(a){this.$content.append(a)},empty:function(){this.$content.empty()},content:function(){return this.$content},show:function(){this.$el.fadeIn("fast"),this.visible=!0},hide:function(){this.$el.fadeOut("fast"),this.visible=!1},enableButton:function(a){this.$buttons.find("#"+a).prop("disabled",!1)},disableButton:function(a){this.$buttons.find("#"+a).prop("disabled",!0)},hideOperation:function(a){this.$operations.find("#"+a).hide()},showOperation:function(a){this.$operations.find("#"+a).show()},setOperation:function(a,b){var c=this.$operations.find("#"+a);c.off("click"),c.on("click",b)},title:function(a){var b=this.$title;return a&&b.html(a),b.html()},disable:function(){this.$(".portlet-backdrop").show()},enable:function(){this.$(".portlet-backdrop").hide()},_template:function(a){var b='<div id="'+a.id+'" class="'+a.cls+'">';return a.title&&(b+='<div class="portlet-header"><div class="portlet-operations" style="float: '+a.operations_flt+';"></div><div class="portlet-title">',a.icon&&(b+='<i class="icon fa '+a.icon+'">&nbsp;</i>'),b+='<span class="portlet-title-text">'+a.title+"</span></div></div>"),b+='<div class="portlet-content">',"top"==a.placement&&(b+='<div class="buttons"></div>'),b+='<div class="content"></div>',"bottom"==a.placement&&(b+='<div class="buttons"></div>'),b+='</div><div class="portlet-backdrop"/></div>'}});return{View:b}});
//# sourceMappingURL=../../../maps/mvc/ui/ui-portlet.js.map
+2
View File
@@ -0,0 +1,2 @@
define(["utils/utils","mvc/ui/ui-list"],function(a,b){var c=Backbone.View.extend({initialize:function(c){var d=this;this.ftpfile_list=new b.View({name:"file",optional:c.optional,multiple:c.multiple,onchange:function(){c.onchange&&c.onchange(d.value())}}),this.setElement(this.ftpfile_list.$el),a.get({url:galaxy_config.root+"api/remote_files",success:function(a){var b=[];for(var c in a)b.push({value:a[c].path,label:a[c].path});d.ftpfile_list.update(b)}})},value:function(a){return this.ftpfile_list.value(a)}});return{View:c}});
//# sourceMappingURL=../../../maps/mvc/ui/ui-select-ftp.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
define(["utils/utils","mvc/ui/ui-misc","mvc/ui/ui-tabs","mvc/tools/tools-template"],function(a,b){var c=Backbone.Collection.extend({url:galaxy_config.root+"api/libraries"}),d=Backbone.Collection.extend({initialize:function(){var a=this;this.config=new Backbone.Model({library_id:null}),this.config.on("change",function(){a.fetch({reset:!0})})},url:function(){return galaxy_config.root+"api/libraries/"+this.config.get("library_id")+"/contents"}}),e=Backbone.View.extend({initialize:function(a){var e=this;this.libraries=new c,this.datasets=new d,this.options=a,this.library_select=new b.Select.View({optional:a.optional,onchange:function(a){e.datasets.config.set("library_id",a)}}),this.dataset_select=new b.Select.View({optional:a.optional,multiple:a.multiple,onchange:function(){e.trigger("change")}}),this.libraries.on("reset",function(){var a=[];e.libraries.each(function(b){a.push({value:b.id,label:b.get("name")})}),e.library_select.update(a),e.trigger("change")}),this.datasets.on("reset",function(){var a=[],b=e.library_select.text();null!==b&&e.datasets.each(function(c){"file"===c.get("type")&&a.push({value:c.id,label:b+c.get("name")})}),e.dataset_select.update(a),e.trigger("change")}),this.on("change",function(){a.onchange&&a.onchange(e.value())}),this.setElement(this._template()),this.$(".library-select").append(this.library_select.$el),this.$(".dataset-select").append(this.dataset_select.$el),this.libraries.fetch({reset:!0,success:function(){e.library_select.trigger("change"),void 0!==e.options.value&&e.value(e.options.value)}})},value:function(){return this.dataset_select.value()},_template:function(){return'<div class="ui-select-library"><div class="library ui-margin-bottom"><span class="library-title">Select Library</span><span class="library-select"/></div><div class="dataset"><span class="dataset-title">Select Dataset</span><span class="dataset-select"/></div></div>'}});return{View:e}});
define(["utils/utils","mvc/ui/ui-misc","mvc/ui/ui-table","mvc/ui/ui-list"],function(a,b,c,d){var e=Backbone.Collection.extend({url:galaxy_config.root+"api/libraries"}),f=Backbone.Collection.extend({initialize:function(){var a=this;this.config=new Backbone.Model({library_id:null}),this.config.on("change",function(){a.fetch({reset:!0})})},url:function(){return galaxy_config.root+"api/libraries/"+this.config.get("library_id")+"/contents"}}),g=Backbone.View.extend({initialize:function(a){var c=this;this.libraries=new e,this.datasets=new f,this.options=a,this.library_select=new b.Select.View({onchange:function(a){c.datasets.config.set("library_id",a)}}),this.dataset_list=new d.View({name:"dataset",optional:a.optional,multiple:a.multiple,onchange:function(){c.trigger("change")}}),this.libraries.on("reset",function(){var a=[];c.libraries.each(function(b){a.push({value:b.id,label:b.get("name")})}),c.library_select.update(a)}),this.datasets.on("reset",function(){var a=[],b=c.library_select.text();null!==b&&c.datasets.each(function(b){"file"===b.get("type")&&a.push({value:b.id,label:b.get("name")})}),c.dataset_list.update(a)}),this.on("change",function(){a.onchange&&a.onchange(c.value())}),this.setElement(this._template()),this.$(".library-select").append(this.library_select.$el),this.$el.append(this.dataset_list.$el),this.libraries.fetch({reset:!0,success:function(){c.library_select.trigger("change"),void 0!==c.options.value&&c.value(c.options.value)}})},value:function(a){return this.dataset_list.value(a)},_template:function(){return'<div class="ui-select-library"><div class="library ui-margin-bottom"><span class="library-title">Select Library</span><span class="library-select"/></div></div>'}});return{View:g}});
//# sourceMappingURL=../../../maps/mvc/ui/ui-select-library.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
define(["libs/underscore"],function(a){function b(a,c){for(var d in a){var e=a[d];e&&"object"==typeof e&&(c(e),b(e,c))}}function c(a){return $("<div/>").text(a).html()}function d(a){if(a instanceof Array||(a=[a]),0===a.length)return!1;for(var b in a)if(["__null__","__undefined__","None",null,void 0].indexOf(a[b])>-1)return!1;return!0}function e(a){var a=a.toString();if(a){a=a.replace(/,/g,", ");var b=a.lastIndexOf(", ");return-1!=b&&(a=a.substr(0,b)+" or "+a.substr(b+1)),a}return""}function f(a){top.__utils__get__=top.__utils__get__||{},a.cache&&top.__utils__get__[a.url]?(a.success&&a.success(top.__utils__get__[a.url]),console.debug("utils.js::get() - Fetching from cache ["+a.url+"].")):g({url:a.url,data:a.data,success:function(b){top.__utils__get__[a.url]=b,a.success&&a.success(b)},error:function(b){a.error&&a.error(b)}})}function g(a){var b={contentType:"application/json",type:a.type||"GET",data:a.data||{},url:a.url};"GET"==b.type||"DELETE"==b.type?(b.url+=-1==b.url.indexOf("?")?"?":"&",b.url=b.url+$.param(b.data,!0),b.data=null):(b.dataType="json",b.url=b.url,b.data=JSON.stringify(b.data)),$.ajax(b).done(function(b){if("string"==typeof b)try{b=b.replace("Infinity,",'"Infinity",'),b=jQuery.parseJSON(b)}catch(c){console.debug(c)}a.success&&a.success(b)}).fail(function(b){var c=null;try{c=jQuery.parseJSON(b.responseText)}catch(d){c=b.responseText}a.error&&a.error(c,b)})}function h(a,b){var c=$('<div class="'+a+'"></div>');c.appendTo(":eq(0)");var d=c.css(b);return c.remove(),d}function i(a){$('link[href^="'+a+'"]').length||$('<link href="'+galaxy_config.root+a+'" rel="stylesheet">').appendTo("head")}function j(b,c){return b?a.defaults(b,c):c}function k(a,b){var c="";if(a>=1e11)a/=1e11,c="TB";else if(a>=1e8)a/=1e8,c="GB";else if(a>=1e5)a/=1e5,c="MB";else if(a>=100)a/=100,c="KB";else{if(!(a>0))return"<strong>-</strong>";a=10*a,c="b"}var d=Math.round(a)/10;return b?d+" "+c:"<strong>"+d+"</strong> "+c}function l(){return top.__utils__uid__=top.__utils__uid__||0,"uid-"+top.__utils__uid__++}function m(){var a=new Date,b=(a.getHours()<10?"0":"")+a.getHours(),c=(a.getMinutes()<10?"0":"")+a.getMinutes(),d=a.getDate()+"/"+(a.getMonth()+1)+"/"+a.getFullYear()+", "+b+":"+c;return d}return{cssLoadFile:i,cssGetAttribute:h,get:f,merge:j,bytesToString:k,uid:l,time:m,request:g,sanitize:c,textify:e,validate:d,deepeach:b}});
define(["libs/underscore"],function(a){function b(a,c){for(var d in a){var e=a[d];e&&"object"==typeof e&&(c(e),b(e,c))}}function c(a){return $("<div/>").text(a).html()}function d(a){if(a instanceof Array||(a=[a]),0===a.length)return!1;for(var b in a)if(["__null__","__undefined__",null,void 0].indexOf(a[b])>-1)return!1;return!0}function e(a){var a=a.toString();if(a){a=a.replace(/,/g,", ");var b=a.lastIndexOf(", ");return-1!=b&&(a=a.substr(0,b)+" or "+a.substr(b+1)),a}return""}function f(a){top.__utils__get__=top.__utils__get__||{},a.cache&&top.__utils__get__[a.url]?(a.success&&a.success(top.__utils__get__[a.url]),console.debug("utils.js::get() - Fetching from cache ["+a.url+"].")):g({url:a.url,data:a.data,success:function(b){top.__utils__get__[a.url]=b,a.success&&a.success(b)},error:function(b){a.error&&a.error(b)}})}function g(a){var b={contentType:"application/json",type:a.type||"GET",data:a.data||{},url:a.url};"GET"==b.type||"DELETE"==b.type?(b.url+=-1==b.url.indexOf("?")?"?":"&",b.url=b.url+$.param(b.data,!0),b.data=null):(b.dataType="json",b.url=b.url,b.data=JSON.stringify(b.data)),$.ajax(b).done(function(b){if("string"==typeof b)try{b=b.replace("Infinity,",'"Infinity",'),b=jQuery.parseJSON(b)}catch(c){console.debug(c)}a.success&&a.success(b)}).fail(function(b){var c=null;try{c=jQuery.parseJSON(b.responseText)}catch(d){c=b.responseText}a.error&&a.error(c,b)})}function h(a,b){var c=$('<div class="'+a+'"></div>');c.appendTo(":eq(0)");var d=c.css(b);return c.remove(),d}function i(a){$('link[href^="'+a+'"]').length||$('<link href="'+galaxy_config.root+a+'" rel="stylesheet">').appendTo("head")}function j(b,c){return b?a.defaults(b,c):c}function k(a,b){var c="";if(a>=1e11)a/=1e11,c="TB";else if(a>=1e8)a/=1e8,c="GB";else if(a>=1e5)a/=1e5,c="MB";else if(a>=100)a/=100,c="KB";else{if(!(a>0))return"<strong>-</strong>";a=10*a,c="b"}var d=Math.round(a)/10;return b?d+" "+c:"<strong>"+d+"</strong> "+c}function l(){return top.__utils__uid__=top.__utils__uid__||0,"uid-"+top.__utils__uid__++}function m(){var a=new Date,b=(a.getHours()<10?"0":"")+a.getHours(),c=(a.getMinutes()<10?"0":"")+a.getMinutes(),d=a.getDate()+"/"+(a.getMonth()+1)+"/"+a.getFullYear()+", "+b+":"+c;return d}return{cssLoadFile:i,cssGetAttribute:h,get:f,merge:j,bytesToString:k,uid:l,time:m,request:g,sanitize:c,textify:e,validate:d,deepeach:b}});
//# sourceMappingURL=../../maps/utils/utils.js.map

Some files were not shown because too many files have changed in this diff Show More