galaxy-dev
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
August 2008
- 8 participants
- 31 discussions
I had to smile when I saw the "Noodly Appendages". :-)
-Cathy
2
1
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/ed448639d90e
changeset: 1481:ed448639d90e
user: Nate Coraor <nate(a)bx.psu.edu>
date: Tue Aug 26 10:39:47 2008 -0400
description:
Upgraded twill to 0.9.
1 file(s) affected in this change:
eggs.ini
diffs (21 lines):
diff -r 6de3006c62b3 -r ed448639d90e eggs.ini
--- a/eggs.ini Mon Aug 25 15:28:57 2008 -0400
+++ b/eggs.ini Tue Aug 26 10:39:47 2008 -0400
@@ -41,7 +41,7 @@
simplejson = 1.5
SQLAlchemy = 0.3.11
Tempita = 0.1
-twill = 0.8.3
+twill = 0.9
WebError = 0.8a
WebHelpers = 0.2
WebOb = 0.8.5
@@ -86,7 +86,7 @@
simplejson = http://cheeseshop.python.org/packages/source/s/simplejson/simplejson-1.5.ta…
SQLAlchemy = http://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-0.3.11.tar.gz
Tempita = http://pypi.python.org/packages/source/T/Tempita/Tempita-0.1.tar.gz
-twill = http://darcs.idyll.org/~t/projects/twill-0.8.3.tar.gz
+twill = http://darcs.idyll.org/~t/projects/twill-0.9.tar.gz
WebError = http://pypi.python.org/packages/source/W/WebError/WebError-0.8a.tar.gz
WebHelpers = http://pypi.python.org/packages/source/W/WebHelpers/WebHelpers-0.2.tar.gz
WebOb = http://pypi.python.org/packages/source/W/WebOb/WebOb-0.8.5.tar.gz
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/c77dea3e745a
changeset: 1482:c77dea3e745a
user: Greg Von Kuster <greg(a)bx.psu.edu>
date: Tue Aug 26 17:07:44 2008 -0400
description:
Fix for new twill version 0.9.
1 file(s) affected in this change:
test/base/twilltestcase.py
diffs (36 lines):
diff -r ed448639d90e -r c77dea3e745a test/base/twilltestcase.py
--- a/test/base/twilltestcase.py Tue Aug 26 10:39:47 2008 -0400
+++ b/test/base/twilltestcase.py Tue Aug 26 17:07:44 2008 -0400
@@ -7,7 +7,7 @@
import twill
import twill.commands as tc
-from twill.other_packages import ClientForm
+from twill.other_packages._mechanize_dist import ClientForm
from elementtree import ElementTree
buffer = StringIO.StringIO()
@@ -410,7 +410,10 @@
def submit_form( self, form=1, button="runtool_btn", **kwd ):
"""Populates and submits a form from the keyword arguments"""
#Check for onchange attribute, submit a change if required
- for i, control in enumerate(tc.showforms()[form-1].controls):
+ for i, f in enumerate( tc.showforms() ):
+ if i == form - 1:
+ break
+ for i, control in enumerate( f.controls ):
try:
if 'refresh_on_change' in control.attrs.keys():
changed = False
@@ -456,7 +459,10 @@
if not isinstance(value, list):
value = [ value ]
- for i, control in enumerate(tc.showforms()[form-1].controls):
+ for i, f in enumerate( tc.showforms() ):
+ if i == form - 1:
+ break
+ for i, control in enumerate( f.controls ):
if control.name == key:
control.clear()
if control.is_of_kind("text"):
1
0
[hg] galaxy 1478: Add excanvas javascript (emulates <canvas> in ...
by greg@scofield.bx.psu.edu 27 Aug '08
by greg@scofield.bx.psu.edu 27 Aug '08
27 Aug '08
details: http://www.bx.psu.edu/hg/galaxy/rev/6eac08f7edcf
changeset: 1478:6eac08f7edcf
user: James Taylor <james(a)jamestaylor.org>
date: Fri Aug 22 17:44:32 2008 -0400
description:
Add excanvas javascript (emulates <canvas> in IE using silverlight)
2 file(s) affected in this change:
static/scripts/excanvas.js
static/scripts/packed/excanvas.js
diffs (780 lines):
diff -r 99e223f6a132 -r 6eac08f7edcf static/scripts/excanvas.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/static/scripts/excanvas.js Fri Aug 22 17:44:32 2008 -0400
@@ -0,0 +1,770 @@
+// Copyright 2006 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+
+// Known Issues: (From VML version)
+//
+// * Patterns are not implemented.
+// * Radial gradient are not implemented. The VML version of these look very
+// different from the canvas one.
+// * Clipping paths are not implemented.
+// * Coordsize. The width and height attribute have higher priority than the
+// width and height style values which isn't correct.
+// * Painting mode isn't implemented.
+// * Canvas width/height should is using content-box by default. IE in
+// Quirks mode will draw the canvas using border-box. Either change your
+// doctype to HTML5
+// (http://www.whatwg.org/specs/web-apps/current-work/#the-doctype)
+// or use Box Sizing Behavior from WebFX
+// (http://webfx.eae.net/dhtml/boxsizing/boxsizing.html)
+// * Optimize. There is always room for speed improvements.
+
+//Known Issues: Silverlight version
+//
+// * Doing a transformation during a path (ie lineTo, transform, lineTo) will
+// not work corerctly because the transform is done to the whole path (ie
+// transform, lineTo, lineTo)
+// * Patterns are not yet implemented.
+
+
+// only add this code if we do not already have a canvas implementation
+if (!window.CanvasRenderingContext2D) {
+
+(function () {
+
+ var xamlId;
+
+ var G_vmlCanvasManager_ = {
+ init: function (opt_doc) {
+ var doc = opt_doc || document;
+ // Create a dummy element so that IE will allow canvas elements to be
+ // recognized.
+ doc.createElement('canvas');
+ if (/MSIE/.test(navigator.userAgent) && !window.opera) {
+ var self = this;
+
+ createXamlScriptTag();
+
+ doc.attachEvent('onreadystatechange', function () {
+ self.init_(doc);
+ });
+ }
+ },
+
+ init_: function (doc) {
+ // setup default css
+ var ss = doc.createStyleSheet();
+ ss.cssText = 'canvas{display:inline-block;overflow:hidden;' +
+ // default size is 300x150 in Gecko and Opera
+ 'text-align:left;width:300px;height:150px}' +
+ 'canvas object{width:100%;height:100%;border:0;' +
+ 'background:transparen;margin:0}';
+
+ // find all canvas elements
+ var els = doc.getElementsByTagName('canvas');
+ for (var i = 0; i < els.length; i++) {
+ if (!els[i].getContext) {
+ this.initElement(els[i]);
+ }
+ }
+ },
+
+
+ /**
+ * Public initializes a canvas element so that it can be used as canvas
+ * element from now on. This is called automatically before the page is
+ * loaded but if you are creating elements using createElement you need to
+ * make sure this is called on the element.
+ * @param {HTMLElement} el The canvas element to initialize.
+ * @return {HTMLElement} the element that was created.
+ */
+ initElement: function (el) {
+ el.getContext = function () {
+ if (this.context_) {
+ return this.context_;
+ }
+ return this.context_ = new CanvasRenderingContext2D_(this);
+ };
+
+ var attrs = el.attributes;
+ if (attrs.width && attrs.width.specified) {
+ // TODO: use runtimeStyle and coordsize
+ // el.getContext().setWidth_(attrs.width.nodeValue);
+ el.style.width = attrs.width.nodeValue + 'px';
+ } else {
+ el.width = el.clientWidth;
+ }
+ if (attrs.height && attrs.height.specified) {
+ // TODO: use runtimeStyle and coordsize
+ // el.getContext().setHeight_(attrs.height.nodeValue);
+ el.style.height = attrs.height.nodeValue + 'px';
+ } else {
+ el.height = el.clientHeight;
+ }
+
+ // insert object tag
+ el.innerHTML = getObjectHtml();
+
+ // do not use inline function because that will leak memory
+ el.attachEvent('onpropertychange', onPropertyChange);
+ return el;
+ }
+ };
+
+ function onPropertyChange(e) {
+ var el = e.srcElement;
+
+ switch (e.propertyName) {
+ case 'width':
+ el.style.width = el.attributes.width.nodeValue + 'px';
+ el.getContext().clearRect();
+ break;
+ case 'height':
+ el.style.height = el.attributes.height.nodeValue + 'px';
+ el.getContext().clearRect();
+ break;
+ }
+ }
+
+ G_vmlCanvasManager_.init();
+
+ function createXamlScriptTag() {
+ // This script tag contains the boilerplate XAML.
+ document.write('<script type=text/xaml>' +
+ '<Canvas x:Name="root" ' +
+ 'xmlns="http://schemas.microsoft.com/client/2007" ' +
+ 'xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" ' +
+ 'Width="300" ' +
+ 'Height="150" ' +
+ 'Background="Transparent"> ' +
+ '</Canvas>' +
+ '</script>');
+ // Find the id of the writtenscript file.
+ var scripts = document.scripts;
+ var script = scripts[scripts.length - 1];
+ xamlId = script.uniqueID;
+ script.id = xamlId;
+ }
+
+ function getObjectHtml(fn) {
+ return '<object type="application/x-silverlight" >' +
+ '<param name="windowless" value="true">' +
+ '<param name="background" value="transparent">' +
+ '<param name="source" value="#' + xamlId + '">' +
+ '</object>';
+ }
+
+ function hasSilverlight() {
+ try {
+ new ActiveXObject('AgControl.AgControl');
+ return true;
+ } catch(_) {
+ return false;
+ }
+ }
+
+ // precompute "00" to "FF"
+ var dec2hex = [];
+ for (var i = 0; i < 16; i++) {
+ for (var j = 0; j < 16; j++) {
+ dec2hex[i * 16 + j] = i.toString(16) + j.toString(16);
+ }
+ }
+
+ function createMatrixIdentity() {
+ return [
+ [1, 0, 0],
+ [0, 1, 0],
+ [0, 0, 1]
+ ];
+ }
+
+ function matrixMultiply(m1, m2) {
+ var result = createMatrixIdentity();
+
+ for (var x = 0; x < 3; x++) {
+ for (var y = 0; y < 3; y++) {
+ var sum = 0;
+
+ for (var z = 0; z < 3; z++) {
+ sum += m1[x][z] * m2[z][y];
+ }
+
+ result[x][y] = sum;
+ }
+ }
+ return result;
+ }
+
+ function doTransform(ctx) {
+ transformObject(ctx, getRoot(ctx), ctx.m_);
+ }
+
+ function transformObject(ctx, obj, m) {
+ var transform = obj.renderTransform;
+ var matrix;
+ if (!transform) {
+ transform = create(ctx, '<MatrixTransform/>');
+ matrix = create(ctx, '<Matrix/>');
+ transform.matrix = matrix;
+ obj.renderTransform = transform;
+ } else {
+ matrix = transform.matrix;
+ }
+
+ matrix.m11 = m[0][0];
+ matrix.m12 = m[0][1];
+ matrix.m21 = m[1][0];
+ matrix.m22 = m[1][1];
+ matrix.offsetX = m[2][0];
+ matrix.offsetY = m[2][1];
+ }
+
+ function copyState(o1, o2) {
+ o2.fillStyle = o1.fillStyle;
+ o2.lineCap = o1.lineCap;
+ o2.lineJoin = o1.lineJoin;
+ o2.lineWidth = o1.lineWidth;
+ o2.miterLimit = o1.miterLimit;
+ o2.shadowBlur = o1.shadowBlur;
+ o2.shadowColor = o1.shadowColor;
+ o2.shadowOffsetX = o1.shadowOffsetX;
+ o2.shadowOffsetY = o1.shadowOffsetY;
+ o2.strokeStyle = o1.strokeStyle;
+ o2.globalAlpha = o1.globalAlpha;
+ o2.arcScaleX_ = o1.arcScaleX_;
+ o2.arcScaleY_ = o1.arcScaleY_;
+ }
+
+ function translateColor(s) {
+ var rgbaMatch = /rgba\(([^)]+)\)/gi.exec(s);
+ if (rgbaMatch) {
+ var parts = rgbaMatch[1].split(',');
+ return '#' + dec2hex[Math.floor(Number(parts[3]) * 255)] +
+ dec2hex[Number(parts[0])] +
+ dec2hex[Number(parts[1])] +
+ dec2hex[Number(parts[2])];
+ }
+
+ var rgbMatch = /rgb\(([^)]+)\)/gi.exec(s);
+ if (rgbMatch) {
+ var parts = rgbMatch[1].split(',');
+ return '#FF' + dec2hex[Number(parts[0])] +
+ dec2hex[Number(parts[1])] +
+ dec2hex[Number(parts[2])];
+ }
+
+ return s;
+ }
+
+ function processLineCap(lineCap) {
+ switch (lineCap) {
+ case 'butt':
+ return 'flat';
+ case 'round':
+ return 'round';
+ case 'square':
+ default:
+ return 'square';
+ }
+ }
+
+ function getRoot(ctx) {
+ return ctx.canvas.firstChild.content.findName('root');
+ }
+
+ function create(ctx, s, opt_args) {
+ if (opt_args) {
+ s = s.replace(/\%(\d+)/g, function(match, index) {
+ return opt_args[Number(index) - 1];
+ });
+ }
+
+ try {
+ return ctx.canvas.firstChild.content.createFromXaml(s);
+ } catch (ex) {
+ throw Error('Could not create XAML from: ' + s);
+ }
+ }
+
+ function drawShape(ctx, s, opt_args) {
+ var canvas = ctx.lastCanvas_ || create(ctx, '<Canvas/>');
+ var shape = create(ctx, s, opt_args);
+ canvas.children.add(shape);
+ transformObject(ctx, canvas, ctx.m_);
+ if (!ctx.lastCanvas_) {
+ getRoot(ctx).children.add(canvas);
+ ctx.lastCanvas_ = canvas;
+ }
+ return shape;
+ }
+
+ function createBrushObject(ctx, value) {
+ if (value instanceof CanvasGradient_) {
+ return value.createBrush_(ctx);
+ } else if (value instanceof CanvasPattern_) {
+ throw Error('Not implemented');
+ } else {
+ return create(ctx, '<SolidColorBrush Color="%1"/>',
+ [translateColor(value)]);
+ }
+ }
+
+ /**
+ * This class implements CanvasRenderingContext2D interface as described by
+ * the WHATWG.
+ * @param {HTMLElement} surfaceElement The element that the 2D context should
+ * be associated with
+ */
+ function CanvasRenderingContext2D_(surfaceElement) {
+ this.m_ = createMatrixIdentity();
+ this.lastCanvas_ = null;
+
+ this.mStack_ = [];
+ this.aStack_ = [];
+ this.currentPath_ = [];
+
+ // Canvas context properties
+ this.strokeStyle = '#000';
+ this.fillStyle = '#000';
+
+ this.lineWidth = 1;
+ this.lineJoin = 'miter';
+ this.lineCap = 'butt';
+ this.miterLimit = 10;
+ this.globalAlpha = 1;
+ this.canvas = surfaceElement;
+ };
+
+
+ var contextPrototype = CanvasRenderingContext2D_.prototype;
+
+ contextPrototype.clearRect = function() {
+ var root = getRoot(this);
+ root.children.clear();
+
+ // TODO: Implement
+ this.currentPath_ = [];
+ this.lastCanvas_ = null;
+
+ };
+
+ contextPrototype.beginPath = function() {
+ // TODO: Branch current matrix so that save/restore has no effect
+ // as per safari docs.
+
+ this.currentPath_ = [];
+ };
+
+ contextPrototype.moveTo = function(aX, aY) {
+ this.currentPath_.push('M' + aX + ',' + aY);
+ };
+
+ contextPrototype.lineTo = function(aX, aY) {
+ if (this.currentPath_.length == 0) return;
+ this.currentPath_.push('L' + aX + ',' + aY);
+ };
+
+ contextPrototype.bezierCurveTo = function(aCP1x, aCP1y,
+ aCP2x, aCP2y,
+ aX, aY) {
+ if (this.currentPath_.length == 0) return;
+ this.currentPath_.push('C' + aCP1x + ',' + aCP1y + ' ' +
+ aCP2x + ',' + aCP2y + ' ' +
+ aX + ' ' + aY);
+ };
+
+ contextPrototype.quadraticCurveTo = function(aCPx, aCPy, aX, aY) {
+ if (this.currentPath_.length == 0) return;
+ this.currentPath_.push('Q' + aCPx + ',' + aCPy + ' ' +
+ aX + ',' + aY);
+ };
+
+ contextPrototype.arcTo = function(x1, y1, x2, y2, radius) {
+ if (this.currentPath_.length == 0) return;
+ // TODO: Implement
+ };
+
+ contextPrototype.arc = function(aX, aY, aRadius,
+ aStartAngle, aEndAngle, aClockwise) {
+ var deltaAngle = Math.abs(aStartAngle - aEndAngle);
+ // If start and stop are the same WebKit and Moz does nothing
+ if (aStartAngle == aEndAngle) {
+ // different browsers behave differently here so we do the easiest thing
+ return;
+ }
+
+ var endX = aX + aRadius * Math.cos(aEndAngle);
+ var endY = aY + aRadius * Math.sin(aEndAngle);
+
+ if (deltaAngle >= 2 * Math.PI) {
+ // if larger than 2PI
+ this.arc(aX, aY, aRadius, aStartAngle, aStartAngle + Math.PI, aClockwise);
+ this.arc(aX, aY, aRadius, aStartAngle + Math.PI,
+ aStartAngle + 2 * Math.PI, aClockwise);
+ // now move to end point
+ this.moveTo(endX, endY);
+ return;
+ }
+
+ var startX = aX + aRadius * Math.cos(aStartAngle);
+ var startY = aY + aRadius * Math.sin(aStartAngle);
+ var rotationAngle = deltaAngle * 180 / Math.PI; // sign, abs?
+ var sweepDirection = aClockwise ? 0 : 1;
+ var isLargeArc = rotationAngle >= 180 == Boolean(aClockwise) ? 0 : 1;
+
+ if (this.currentPath_.length != 0) {
+ // add line to start point
+ this.lineTo(startX, startY);
+ } else {
+ this.moveTo(startX, startY);
+ }
+
+ this.currentPath_.push('A' + aRadius + ',' + aRadius + ' ' +
+ rotationAngle + ' ' +
+ isLargeArc + ' ' +
+ sweepDirection + ' ' +
+ endX + ',' + endY);
+ };
+
+ contextPrototype.rect = function(aX, aY, aWidth, aHeight) {
+ this.moveTo(aX, aY);
+ this.lineTo(aX + aWidth, aY);
+ this.lineTo(aX + aWidth, aY + aHeight);
+ this.lineTo(aX, aY + aHeight);
+ this.closePath();
+ };
+
+ contextPrototype.strokeRect = function(aX, aY, aWidth, aHeight) {
+ // Will destroy any existing path (same as FF behaviour)
+ this.beginPath();
+ this.moveTo(aX, aY);
+ this.lineTo(aX + aWidth, aY);
+ this.lineTo(aX + aWidth, aY + aHeight);
+ this.lineTo(aX, aY + aHeight);
+ this.closePath();
+ this.stroke();
+ this.currentPath_ = [];
+ };
+
+ contextPrototype.fillRect = function(aX, aY, aWidth, aHeight) {
+ // Will destroy any existing path (same as FF behaviour)
+ this.beginPath();
+ this.moveTo(aX, aY);
+ this.lineTo(aX + aWidth, aY);
+ this.lineTo(aX + aWidth, aY + aHeight);
+ this.lineTo(aX, aY + aHeight);
+ this.closePath();
+ this.fill();
+ this.currentPath_ = [];
+ };
+
+ contextPrototype.createLinearGradient = function(aX0, aY0, aX1, aY1) {
+ return new LinearCanvasGradient_(aX0, aY0, aX1, aY1);
+ };
+
+ contextPrototype.createRadialGradient = function(x0, y0,
+ r0, x1,
+ y1, r1) {
+ return new RadialCanvasGradient_(x0, y0, r0, x1, y1, r1);
+ };
+
+ contextPrototype.drawImage = function (image, var_args) {
+ var dx, dy, dw, dh, sx, sy, sw, sh;
+
+ // For Silverlight we don't need to get the size of the image since
+ // Silverlight uses the image original dimension if not provided.
+
+ if (arguments.length == 3) {
+ dx = arguments[1];
+ dy = arguments[2];
+ // Keep sx, sy, sw, dw, sh and dh undefined
+ } else if (arguments.length == 5) {
+ dx = arguments[1];
+ dy = arguments[2];
+ dw = arguments[3];
+ dh = arguments[4];
+ // Keep sx, sy, sw and sh undefined
+ } else if (arguments.length == 9) {
+ sx = arguments[1];
+ sy = arguments[2];
+ sw = arguments[3];
+ sh = arguments[4];
+ dx = arguments[5];
+ dy = arguments[6];
+ dw = arguments[7];
+ dh = arguments[8];
+ } else {
+ throw Error('Invalid number of arguments');
+ }
+
+ var slImage;
+
+ // If we have a source rect we need to clip the image.
+ if (arguments.length == 9) {
+ slImage = drawShape(this, '<Image Source="%1"/>', [image.src]);
+
+ var clipRect = create(this,
+ '<RectangleGeometry Rect="%1,%2,%3,%4"/>', [sx, sy, sw, sh]);
+ slImage.clip = clipRect;
+
+ var m = createMatrixIdentity();
+
+ // translate to 0,0
+ m[2][0] = -sx;
+ m[2][1] = -sy;
+
+ // scale
+ var m2 = createMatrixIdentity();
+ m2[0][0] = dw / sw;
+ m2[1][1] = dh / sh;
+
+ m = matrixMultiply(m, m2);
+
+ // translate to destination
+ m[2][0] += dx;
+ m[2][1] += dy;
+
+ transformObject(this, slImage, m);
+
+ } else {
+ slImage = drawShape(this,
+ '<Image Source="%1" Canvas.Left="%2" Canvas.Top="%3"/>',
+ [image.src, dx, dy]);
+ if (dw != undefined || dh != undefined) {
+ slImage.width = dw;
+ slImage.height = dh;
+ slImage.stretch = 'fill';
+ }
+ }
+ };
+
+ contextPrototype.stroke = function() {
+ if (this.currentPath_.length == 0) return;
+ var path = drawShape(this, '<Path Data="%1"/>',
+ [this.currentPath_.join(' ')]);
+ path.stroke = createBrushObject(this, this.strokeStyle);
+ path.opacity = this.globalAlpha;
+ path.strokeThickness = this.lineWidth;
+ path.strokeMiterLimit = this.miterLimit;
+ path.strokeLineJoin = this.lineJoin;
+ // Canvas does not differentiate start from end
+ path.strokeEndLineCap = path.strokeStartLineCap =
+ processLineCap(this.lineCap);
+ };
+
+ contextPrototype.fill = function() {
+ if (this.currentPath_.length == 0) return;
+ var path = drawShape(this, '<Path Data="%1"/>',
+ [this.currentPath_.join(' ')]);
+ // The spec says to use non zero but Silverlight uses EvenOdd by defaul
+ path.data.fillRule = 'NonZero';
+ path.fill = createBrushObject(this, this.fillStyle);
+ // TODO: What about even-odd etc?
+ };
+
+ contextPrototype.closePath = function() {
+ this.currentPath_.push('z');
+ };
+
+ /**
+ * Sets the transformation matrix and marks things as dirty
+ */
+ function setM(self, m) {
+ self.m_ = m;
+ self.lastCanvas_ = null;
+ };
+
+ contextPrototype.save = function() {
+ var o = {};
+ copyState(this, o);
+ this.aStack_.push(o);
+ this.mStack_.push(this.m_);
+ setM(this, matrixMultiply(createMatrixIdentity(), this.m_));
+ };
+
+ contextPrototype.restore = function() {
+ copyState(this.aStack_.pop(), this);
+ setM(this, this.mStack_.pop());
+ };
+
+ contextPrototype.translate = function(aX, aY) {
+ var m1 = [
+ [1, 0, 0],
+ [0, 1, 0],
+ [aX, aY, 1]
+ ];
+
+ setM(this, matrixMultiply(m1, this.m_));
+ };
+
+ contextPrototype.rotate = function(aRot) {
+ var c = Math.cos(aRot);
+ var s = Math.sin(aRot);
+
+ var m1 = [
+ [c, s, 0],
+ [-s, c, 0],
+ [0, 0, 1]
+ ];
+
+ setM(this, matrixMultiply(m1, this.m_));
+ };
+
+ contextPrototype.scale = function(aX, aY) {
+ var m1 = [
+ [aX, 0, 0],
+ [0, aY, 0],
+ [0, 0, 1]
+ ];
+
+ setM(this, matrixMultiply(m1, this.m_));
+ };
+
+ contextPrototype.transform = function(m11, m12, m21, m22, dx, dy) {
+ var m1 = [
+ [m11, m12, 0],
+ [m21, m22, 0],
+ [ dx, dy, 1]
+ ];
+
+ setM(this, matrixMultiply(m1, this.m_));
+ };
+
+ contextPrototype.setTransform = function(m11, m12, m21, m22, dx, dy) {
+ setM(this, [
+ [m11, m12, 0],
+ [m21, m22, 0],
+ [ dx, dy, 1],
+ ]);
+ };
+
+ /******** STUBS ********/
+ contextPrototype.clip = function() {
+ // TODO: Implement
+ };
+
+ contextPrototype.createPattern = function() {
+ return new CanvasPattern_;
+ };
+
+ // Gradient / Pattern Stubs
+ function CanvasGradient_() {
+ this.colors_ = [];
+ }
+
+ CanvasGradient_.prototype.addColorStop = function(aOffset, aColor) {
+ aColor = translateColor(aColor);
+ this.colors_.push({offset: aOffset, color: aColor});
+ };
+
+ CanvasGradient_.prototype.createStops_ = function(ctx, brushObj, colors) {
+ var gradientStopCollection = brushObj.gradientStops;
+ for (var i = 0, c; c = colors[i]; i++) {
+ var color = translateColor(c.color);
+ gradientStopCollection.add(create(ctx,
+ '<GradientStop Color="%1" Offset="%2"/>', [color, c.offset]));
+ }
+ };
+
+ function LinearCanvasGradient_(x0, y0, x1, y1) {
+ CanvasGradient_.call(this);
+ this.x0_ = x0;
+ this.y0_ = y0;
+ this.x1_ = x1;
+ this.y1_ = y1;
+ }
+ LinearCanvasGradient_.prototype = new CanvasGradient_;
+
+ LinearCanvasGradient_.prototype.createBrush_ = function(ctx) {
+ var brushObj = create(ctx, '<LinearGradientBrush MappingMode="Absolute" ' +
+ 'StartPoint="%1,%2" EndPoint="%3,%4"/>',
+ [this.x0_, this.y0_, this.x1_, this.y1_]);
+ this.createStops_(ctx, brushObj, this.colors_);
+ return brushObj;
+ };
+
+ function isNanOrInfinite(v) {
+ return isNaN(v) || !isFinite(v);
+ }
+
+ function RadialCanvasGradient_(x0, y0, r0, x1, y1, r1) {
+ if (r0 < 0 || r1 < 0 || isNanOrInfinite(x0) || isNanOrInfinite(y0) ||
+ isNanOrInfinite(x1) || isNanOrInfinite(y1)) {
+ // IE does not support DOMException so this is as close as we get.
+ var error = Error('DOMException.INDEX_SIZE_ERR');
+ error.code = 1;
+ throw error;
+ }
+
+ CanvasGradient_.call(this);
+ this.x0_ = x0;
+ this.y0_ = y0;
+ this.r0_ = r0;
+ this.x1_ = x1;
+ this.y1_ = y1;
+ this.r1_ = r1;
+ }
+ RadialCanvasGradient_.prototype = new CanvasGradient_;
+
+ CanvasGradient_.prototype.createBrush_ = function(ctx) {
+ if (this.x0_ == this.x1_ && this.y0_ == this.y1_ && this.r0_ == this.r1_) {
+ return null;
+ }
+
+ var radius = Math.max(this.r0_, this.r1_);
+ var minRadius = Math.min(this.r0_, this.r1_);
+ var brushObj = create(ctx, '<RadialGradientBrush MappingMode="Absolute" ' +
+ 'GradientOrigin="%1,%2" Center="%3,%4" ' +
+ 'RadiusX="%5" RadiusY="%5"/>',
+ [this.x0_, this.y0_, this.x1_, this.y1_, radius]);
+
+ var colors = this.colors_.concat();
+
+ if (this.r1_ < this.r0_) {
+ // reverse color stop array
+ colors.reverse();
+ for (var i = 0, c; c = colors[i]; i++) {
+ c.offset = 1 - c.offset;
+ }
+ }
+
+ // sort the color stops
+ colors.sort(function(c1, c2) {
+ return c1.offset - c2.offset;
+ });
+
+ if (minRadius > 0) {
+ // We need to adjust the color stops since SL always have the inner radius
+ // at (0, 0) so we change the stops in case the min radius is not 0.
+ for (var i = 0, c; c = colors[i]; i++) {
+ c.offset = minRadius / radius + (radius - minRadius) / radius * c.offset;
+ }
+ }
+
+ this.createStops_(ctx, brushObj, colors);
+ return brushObj;
+ };
+
+ function CanvasPattern_() {}
+
+ // set up externs
+ G_vmlCanvasManager = G_vmlCanvasManager_;
+ CanvasRenderingContext2D = CanvasRenderingContext2D_;
+ CanvasGradient = CanvasGradient_;
+ CanvasPattern = CanvasPattern_;
+
+})();
+
+} // if
diff -r 99e223f6a132 -r 6eac08f7edcf static/scripts/packed/excanvas.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/static/scripts/packed/excanvas.js Fri Aug 22 17:44:32 2008 -0400
@@ -0,0 +1,1 @@
+if(!window.CanvasRenderingContext2D){(function(){var L;var N={init:function(d){var e=d||document;e.createElement("canvas");if(/MSIE/.test(navigator.userAgent)&&!window.opera){var c=this;a();e.attachEvent("onreadystatechange",function(){c.init_(e)})}},init_:function(f){var e=f.createStyleSheet();e.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}canvas object{width:100%;height:100%;border:0;background:transparen;margin:0}";var d=f.getElementsByTagName("canvas");for(var c=0;c<d.length;c++){if(!d[c].getContext){this.initElement(d[c])}}},initElement:function(d){d.getContext=function(){if(this.context_){return this.context_}return this.context_=new S(this)};var c=d.attributes;if(c.width&&c.width.specified){d.style.width=c.width.nodeValue+"px"}else{d.width=d.clientWidth}if(c.height&&c.height.specified){d.style.height=c.height.nodeValue+"px"}else{d.height=d.clientHeight}d.innerHTML=C();d.attachEvent("onpropertychange",b);return d}};funct
ion b(d){var c=d.srcElement;switch(d.propertyName){case"width":c.style.width=c.attributes.width.nodeValue+"px";c.getContext().clearRect();break;case"height":c.style.height=c.attributes.height.nodeValue+"px";c.getContext().clearRect();break}}N.init();function a(){document.write('<script type=text/xaml><Canvas x:Name="root" xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="300" Height="150" Background="Transparent"> </Canvas><\/script>');var c=document.scripts;var d=c[c.length-1];L=d.uniqueID;d.id=L}function C(c){return'<object type="application/x-silverlight" ><param name="windowless" value="true"><param name="background" value="transparent"><param name="source" value="#'+L+'"></object>'}function H(){try{new ActiveXObject("AgControl.AgControl");return true}catch(c){return false}}var I=[];for(var X=0;X<16;X++){for(var W=0;W<16;W++){I[X*16+W]=X.toString(16)+W.toString(16)}}function T(){return[[1,0,0],[0,1,0],[0,0,1]]}
function K(f,e){var d=T();for(var c=0;c<3;c++){for(var i=0;i<3;i++){var g=0;for(var h=0;h<3;h++){g+=f[c][h]*e[h][i]}d[c][i]=g}}return d}function J(c){Q(c,F(c),c.m_)}function Q(d,g,c){var f=g.renderTransform;var e;if(!f){f=P(d,"<MatrixTransform/>");e=P(d,"<Matrix/>");f.matrix=e;g.renderTransform=f}else{e=f.matrix}e.m11=c[0][0];e.m12=c[0][1];e.m21=c[1][0];e.m22=c[1][1];e.offsetX=c[2][0];e.offsetY=c[2][1]}function V(d,c){c.fillStyle=d.fillStyle;c.lineCap=d.lineCap;c.lineJoin=d.lineJoin;c.lineWidth=d.lineWidth;c.miterLimit=d.miterLimit;c.shadowBlur=d.shadowBlur;c.shadowColor=d.shadowColor;c.shadowOffsetX=d.shadowOffsetX;c.shadowOffsetY=d.shadowOffsetY;c.strokeStyle=d.strokeStyle;c.globalAlpha=d.globalAlpha;c.arcScaleX_=d.arcScaleX_;c.arcScaleY_=d.arcScaleY_}function R(c){var f=/rgba\(([^)]+)\)/gi.exec(c);if(f){var e=f[1].split(",");return"#"+I[Math.floor(Number(e[3])*255)]+I[Number(e[0])]+I[Number(e[1])]+I[Number(e[2])]}var d=/rgb\(([^)]+)\)/gi.exec(c);if(d){var e=d[1].split(","
);return"#FF"+I[Number(e[0])]+I[Number(e[1])]+I[Number(e[2])]}return c}function U(c){switch(c){case"butt":return"flat";case"round":return"round";case"square":default:return"square"}}function F(c){return c.canvas.firstChild.content.findName("root")}function P(c,e,f){if(f){e=e.replace(/\%(\d+)/g,function(h,g){return f[Number(g)-1]})}try{return c.canvas.firstChild.content.createFromXaml(e)}catch(d){throw Error("Could not create XAML from: "+e)}}function E(c,f,g){var e=c.lastCanvas_||P(c,"<Canvas/>");var d=P(c,f,g);e.children.add(d);Q(c,e,c.m_);if(!c.lastCanvas_){F(c).children.add(e);c.lastCanvas_=e}return d}function A(c,d){if(d instanceof Y){return d.createBrush_(c)}else{if(d instanceof M){throw Error("Not implemented")}else{return P(c,'<SolidColorBrush Color="%1"/>',[R(d)])}}}function S(c){this.m_=T();this.lastCanvas_=null;this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.strokeStyle="#000";this.fillStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt
";this.miterLimit=10;this.globalAlpha=1;this.canvas=c}var O=S.prototype;O.clearRect=function(){var c=F(this);c.children.clear();this.currentPath_=[];this.lastCanvas_=null};O.beginPath=function(){this.currentPath_=[]};O.moveTo=function(d,c){this.currentPath_.push("M"+d+","+c)};O.lineTo=function(d,c){if(this.currentPath_.length==0){return }this.currentPath_.push("L"+d+","+c)};O.bezierCurveTo=function(e,c,h,g,f,d){if(this.currentPath_.length==0){return }this.currentPath_.push("C"+e+","+c+" "+h+","+g+" "+f+" "+d)};O.quadraticCurveTo=function(f,e,d,c){if(this.currentPath_.length==0){return }this.currentPath_.push("Q"+f+","+e+" "+d+","+c)};O.arcTo=function(e,g,d,f,c){if(this.currentPath_.length==0){return }};O.arc=function(j,g,i,f,d,e){var c=Math.abs(f-d);if(f==d){return }var p=j+i*Math.cos(d);var o=g+i*Math.sin(d);if(c>=2*Math.PI){this.arc(j,g,i,f,f+Math.PI,e);this.arc(j,g,i,f+Math.PI,f+2*Math.PI,e);this.moveTo(p,o);return }var k=j+i*Math.cos(f);var h=g+i*Math.sin(f);var n=c*180/
Math.PI;var l=e?0:1;var m=n>=180==Boolean(e)?0:1;if(this.currentPath_.length!=0){this.lineTo(k,h)}else{this.moveTo(k,h)}this.currentPath_.push("A"+i+","+i+" "+n+" "+m+" "+l+" "+p+","+o)};O.rect=function(e,d,c,f){this.moveTo(e,d);this.lineTo(e+c,d);this.lineTo(e+c,d+f);this.lineTo(e,d+f);this.closePath()};O.strokeRect=function(e,d,c,f){this.beginPath();this.moveTo(e,d);this.lineTo(e+c,d);this.lineTo(e+c,d+f);this.lineTo(e,d+f);this.closePath();this.stroke();this.currentPath_=[]};O.fillRect=function(e,d,c,f){this.beginPath();this.moveTo(e,d);this.lineTo(e+c,d);this.lineTo(e+c,d+f);this.lineTo(e,d+f);this.closePath();this.fill();this.currentPath_=[]};O.createLinearGradient=function(d,f,c,e){return new D(d,f,c,e)};O.createRadialGradient=function(f,h,e,d,g,c){return new G(f,h,e,d,g,c)};O.drawImage=function(e,n){var q,p,c,i,k,j,l,h;if(arguments.length==3){q=arguments[1];p=arguments[2]}else{if(arguments.length==5){q=arguments[1];p=arguments[2];c=arguments[3];i=arguments[4]}else{if(
arguments.length==9){k=arguments[1];j=arguments[2];l=arguments[3];h=arguments[4];q=arguments[5];p=arguments[6];c=arguments[7];i=arguments[8]}else{throw Error("Invalid number of arguments")}}}var g;if(arguments.length==9){g=E(this,'<Image Source="%1"/>',[e.src]);var f=P(this,'<RectangleGeometry Rect="%1,%2,%3,%4"/>',[k,j,l,h]);g.clip=f;var d=T();d[2][0]=-k;d[2][1]=-j;var o=T();o[0][0]=c/l;o[1][1]=i/h;d=K(d,o);d[2][0]+=q;d[2][1]+=p;Q(this,g,d)}else{g=E(this,'<Image Source="%1" Canvas.Left="%2" Canvas.Top="%3"/>',[e.src,q,p]);if(c!=undefined||i!=undefined){g.width=c;g.height=i;g.stretch="fill"}}};O.stroke=function(){if(this.currentPath_.length==0){return }var c=E(this,'<Path Data="%1"/>',[this.currentPath_.join(" ")]);c.stroke=A(this,this.strokeStyle);c.opacity=this.globalAlpha;c.strokeThickness=this.lineWidth;c.strokeMiterLimit=this.miterLimit;c.strokeLineJoin=this.lineJoin;c.strokeEndLineCap=c.strokeStartLineCap=U(this.lineCap)};O.fill=function(){if(this.currentPath_.length==
0){return }var c=E(this,'<Path Data="%1"/>',[this.currentPath_.join(" ")]);c.data.fillRule="NonZero";c.fill=A(this,this.fillStyle)};O.closePath=function(){this.currentPath_.push("z")};function Z(d,c){d.m_=c;d.lastCanvas_=null}O.save=function(){var c={};V(this,c);this.aStack_.push(c);this.mStack_.push(this.m_);Z(this,K(T(),this.m_))};O.restore=function(){V(this.aStack_.pop(),this);Z(this,this.mStack_.pop())};O.translate=function(e,d){var c=[[1,0,0],[0,1,0],[e,d,1]];Z(this,K(c,this.m_))};O.rotate=function(e){var g=Math.cos(e);var f=Math.sin(e);var d=[[g,f,0],[-f,g,0],[0,0,1]];Z(this,K(d,this.m_))};O.scale=function(e,d){var c=[[e,0,0],[0,d,0],[0,0,1]];Z(this,K(c,this.m_))};O.transform=function(g,f,i,h,d,c){var e=[[g,f,0],[i,h,0],[d,c,1]];Z(this,K(e,this.m_))};O.setTransform=function(f,e,h,g,d,c){Z(this,[[f,e,0],[h,g,0],[d,c,1],])};O.clip=function(){};O.createPattern=function(){return new M};function Y(){this.colors_=[]}Y.prototype.addColorStop=function(d,c){c=R(c);this.colors_.
push({offset:d,color:c})};Y.prototype.createStops_=function(e,g,d){var j=g.gradientStops;for(var h=0,k;k=d[h];h++){var f=R(k.color);j.add(P(e,'<GradientStop Color="%1" Offset="%2"/>',[f,k.offset]))}};function D(d,f,c,e){Y.call(this);this.x0_=d;this.y0_=f;this.x1_=c;this.y1_=e}D.prototype=new Y;D.prototype.createBrush_=function(c){var d=P(c,'<LinearGradientBrush MappingMode="Absolute" StartPoint="%1,%2" EndPoint="%3,%4"/>',[this.x0_,this.y0_,this.x1_,this.y1_]);this.createStops_(c,d,this.colors_);return d};function B(c){return isNaN(c)||!isFinite(c)}function G(g,i,f,e,h,c){if(f<0||c<0||B(g)||B(i)||B(e)||B(h)){var d=Error("DOMException.INDEX_SIZE_ERR");d.code=1;throw d}Y.call(this);this.x0_=g;this.y0_=i;this.r0_=f;this.x1_=e;this.y1_=h;this.r1_=c}G.prototype=new Y;Y.prototype.createBrush_=function(f){if(this.x0_==this.x1_&&this.y0_==this.y1_&&this.r0_==this.r1_){return null}var d=Math.max(this.r0_,this.r1_);var j=Math.min(this.r0_,this.r1_);var g=P(f,'<RadialGradientBrush Mapp
ingMode="Absolute" GradientOrigin="%1,%2" Center="%3,%4" RadiusX="%5" RadiusY="%5"/>',[this.x0_,this.y0_,this.x1_,this.y1_,d]);var e=this.colors_.concat();if(this.r1_<this.r0_){e.reverse();for(var h=0,k;k=e[h];h++){k.offset=1-k.offset}}e.sort(function(i,c){return i.offset-c.offset});if(j>0){for(var h=0,k;k=e[h];h++){k.offset=j/d+(d-j)/d*k.offset}}this.createStops_(f,g,e);return g};function M(){}G_vmlCanvasManager=N;CanvasRenderingContext2D=S;CanvasGradient=Y;CanvasPattern=M})()};
\ No newline at end of file
1
0
[hg] galaxy 1479: Internet explorer fixes and support -- popup m...
by greg@scofield.bx.psu.edu 27 Aug '08
by greg@scofield.bx.psu.edu 27 Aug '08
27 Aug '08
details: http://www.bx.psu.edu/hg/galaxy/rev/b671c301674a
changeset: 1479:b671c301674a
user: James Taylor <james(a)jamestaylor.org>
date: Fri Aug 22 17:47:43 2008 -0400
description:
Internet explorer fixes and support -- popup menus and dialogs work better on IE6+,
workflow editor works on IE7 (using excanvas). It actually *nearly* works on IE6 but
there are some layout problems that are probably not worth wasting time on. If any IE
users can test this that would be great!
13 file(s) affected in this change:
static/june_2007_style/base.css.tmpl
static/june_2007_style/blue/base.css
static/june_2007_style/blue/panel_layout.css
static/june_2007_style/panel_layout.css.tmpl
static/scripts/galaxy.base.js
static/scripts/galaxy.panels.js
static/scripts/galaxy.ui.scrollPanel.js
static/scripts/galaxy.workflow_editor.canvas.js
static/scripts/packed/galaxy.base.js
static/scripts/packed/galaxy.panels.js
static/scripts/packed/galaxy.workflow_editor.canvas.js
templates/workflow/editor.mako
templates/workflow/index.mako
diffs (648 lines):
diff -r 6eac08f7edcf -r b671c301674a static/june_2007_style/base.css.tmpl
--- a/static/june_2007_style/base.css.tmpl Fri Aug 22 17:44:32 2008 -0400
+++ b/static/june_2007_style/base.css.tmpl Fri Aug 22 17:47:43 2008 -0400
@@ -358,7 +358,7 @@
font-weight: bold;
display: inline-block;
cursor: pointer;
- margin: -1px; padding: 2px;
+ padding: 2px;
border: solid #aaaaaa 1px;
padding-right: 0.5em;
padding-left: 0.5em;
diff -r 6eac08f7edcf -r b671c301674a static/june_2007_style/blue/base.css
--- a/static/june_2007_style/blue/base.css Fri Aug 22 17:44:32 2008 -0400
+++ b/static/june_2007_style/blue/base.css Fri Aug 22 17:47:43 2008 -0400
@@ -356,7 +356,7 @@
font-weight: bold;
display: inline-block;
cursor: pointer;
- margin: -1px; padding: 2px;
+ padding: 2px;
border: solid #aaaaaa 1px;
padding-right: 0.5em;
padding-left: 0.5em;
diff -r 6eac08f7edcf -r b671c301674a static/june_2007_style/blue/panel_layout.css
--- a/static/june_2007_style/blue/panel_layout.css Fri Aug 22 17:44:32 2008 -0400
+++ b/static/june_2007_style/blue/panel_layout.css Fri Aug 22 17:47:43 2008 -0400
@@ -244,14 +244,6 @@
top: 0; left: 0; width: 100%; height: 100%;
z-index: 20000;
}
-#overlay-inner {
- width: 100%; height: 100%;
- background-color:#FFF;
- filter:alpha(opacity=75);
- -moz-opacity: 0.75;
- opacity: 0.75;
- z-index: 20000;
-}
.dialog-box-container {
position: relative;
@@ -259,15 +251,11 @@
margin-right: auto;
margin-left: auto;
}
-.dialog-box-underlay {
- position: absolute;
- left: -1em;
- right: -1em;
- top: -1em;
- bottom: -1em;
- opacity: 0.5;
- background: black;
- z-index: -1;
+
+.dialog-box-wrapper {
+ position: relative;
+ padding: 1em;
+ background-color: rgba(0,0,0,0.5);
-moz-border-radius: 1em;
-webkit-border-radius: 1em;
}
diff -r 6eac08f7edcf -r b671c301674a static/june_2007_style/panel_layout.css.tmpl
--- a/static/june_2007_style/panel_layout.css.tmpl Fri Aug 22 17:44:32 2008 -0400
+++ b/static/june_2007_style/panel_layout.css.tmpl Fri Aug 22 17:47:43 2008 -0400
@@ -244,30 +244,17 @@
z-index: 20000;
}
-#overlay-inner {
- width: 100%; height: 100%;
- background-color:#FFF;
- filter:alpha(opacity=75);
- -moz-opacity: 0.75;
- opacity: 0.75;
- z-index: 20000;
-}
-
.dialog-box-container {
position: relative;
margin-top: 80px;
margin-right: auto;
margin-left: auto;
}
-.dialog-box-underlay {
- position: absolute;
- left: -1em;
- right: -1em;
- top: -1em;
- bottom: -1em;
- opacity: 0.5;
- background: black;
- z-index: -1;
+
+.dialog-box-wrapper {
+ position: relative;
+ padding: 1em;
+ background-color: rgba(0,0,0,0.5);
-moz-border-radius: 1em;
-webkit-border-radius: 1em;
}
diff -r 6eac08f7edcf -r b671c301674a static/scripts/galaxy.base.js
--- a/static/scripts/galaxy.base.js Fri Aug 22 17:44:32 2008 -0400
+++ b/static/scripts/galaxy.base.js Fri Aug 22 17:47:43 2008 -0400
@@ -29,13 +29,10 @@
function ensure_popup_helper() {
// And the helper below the popup menus
if ( $( "#popup-helper" ).length == 0 ) {
- var e = $("<div id='popup-helper' style='background: white; opacity: 0.00; top: 0; left: 0; width: 100%; height: 100%; position: absolute; z-index: 15000;'></div>");
- if ( $.browser.ie ) {
- // Element will not capture drags in ie without nonzero opacity,
- // but causes flashing in firefox with nonzero opacity
- e.css( "opacity", "0.01" );
- }
- e.appendTo("body").hide();
+ $( "<div id='popup-helper'/>" ).css( {
+ background: 'white', opacity: 0, zIndex: 15000,
+ position: 'absolute', top: 0, left: 0, width: '100%', height: '100%'
+ } ).appendTo( "body" ).hide();
}
}
diff -r 6eac08f7edcf -r b671c301674a static/scripts/galaxy.panels.js
--- a/static/scripts/galaxy.panels.js Fri Aug 22 17:44:32 2008 -0400
+++ b/static/scripts/galaxy.panels.js Fri Aug 22 17:47:43 2008 -0400
@@ -6,13 +6,10 @@
function ensure_dd_helper() {
// Insert div that covers everything when dragging the borders
if ( jq( "#DD-helper" ).length == 0 ) {
- var e = jq("<div id='DD-helper' style='background: white; opacity: 0.00; top: 0; left: 0; width: 100%; height: 100%; position: absolute; z-index: 9000;'></div>");
- if ( jq.browser.ie ) {
- // Element will not capture drags in ie without nonzero opacity,
- // but causes flashing in firefox with nonzero opacity
- e.css( "opacity", "0.01" );
- }
- e.appendTo("body").hide();
+ $( "<div id='DD-helper'/>" ).css( {
+ background: 'white', opacity: 0, zIndex: 9000,
+ position: 'absolute', top: 0, left: 0, width: '100%', height: '100%'
+ } ).appendTo( "body" ).hide();
}
}
@@ -179,6 +176,46 @@
return { handle_minwidth_hint: handle_minwidth_hint };
};
+// Modal dialog boxes
+
+function hide_modal() {
+ $(".dialog-box-container" ).fadeOut( function() { $("#overlay").hide(); } );
+};
+
+function show_modal( title, body, buttons, extra_buttons ) {
+ $( ".dialog-box" ).find( ".title" ).html( title );
+ var b = $( ".dialog-box" ).find( ".buttons" ).html( "" );
+ if ( buttons ) {
+ $.each( buttons, function( name, value ) {
+ b.append( $( '<button/>' ).text( name ).click( value ) );
+ b.append( " " );
+ });
+ b.show();
+ } else {
+ b.hide();
+ }
+ var b = $( ".dialog-box" ).find( ".extra_buttons" ).html( "" );
+ if ( extra_buttons ) {
+ $.each( extra_buttons, function( name, value ) {
+ b.append( $( '<button/>' ).text( name ).click( value ) );
+ b.append( " " );
+ });
+ b.show();
+ } else {
+ b.hide();
+ }
+ if ( body == "progress" ) {
+ body = $( "<img src='../images/yui/rel_interstitial_loading.gif')' />" );
+ }
+ $( ".dialog-box" ).find( ".body" ).html( body );
+ if ( ! $(".dialog-box-container").is( ":visible" ) ) {
+ $("#overlay").show();
+ $(".dialog-box-container").fadeIn()
+ }
+};
+
+// Popup -- is this up to date?
+
function make_popupmenu( button_element, options ) {
var menu_element = $( "<div class='popupmenu'><div class='popupmenu-top'><div class='popupmenu-top-inner'/></div></div>" ).appendTo( "body" );
$.each( options, function( k, v ) {
diff -r 6eac08f7edcf -r b671c301674a static/scripts/galaxy.ui.scrollPanel.js
--- a/static/scripts/galaxy.ui.scrollPanel.js Fri Aug 22 17:44:32 2008 -0400
+++ b/static/scripts/galaxy.ui.scrollPanel.js Fri Aug 22 17:47:43 2008 -0400
@@ -18,7 +18,7 @@
element_w = element.width(),
element_h = element.height(),
moved = false,
- close = 5,
+ close_dist = 5,
nudge = 23,
// Legal panel range
p_min_x = - ( panel_w - viewport_w ),
@@ -34,21 +34,21 @@
mouse_x = ui.position.left + instance.offset.click.left;
mouse_y = ui.position.top + instance.offset.click.top;
// Move it
- if ( ( panel_pos.left < p_max_x ) && ( mouse_x - close < min_vis_x ) ) {
+ if ( ( panel_pos.left < p_max_x ) && ( mouse_x - close_dist < min_vis_x ) ) {
var t = Math.min( nudge, p_max_x - panel_pos.left );
panel.css( "left", panel_pos.left + t );
moved = true;
instance.offset.parent.left += t;
ui.position.left -= t
}
- if ( ( ! moved ) && ( panel_pos.left > p_min_x ) && ( mouse_x + close > max_vis_x ) ) {
+ if ( ( ! moved ) && ( panel_pos.left > p_min_x ) && ( mouse_x + close_dist > max_vis_x ) ) {
var t = Math.min( nudge, panel_pos.left - p_min_x );
panel.css( "left", panel_pos.left - t );
moved = true;
instance.offset.parent.left -= t;
ui.position.left += t;
}
- if ( ( ! moved ) && ( panel_pos.top < p_max_y ) && ( mouse_y - close < min_vis_y ) ) {
+ if ( ( ! moved ) && ( panel_pos.top < p_max_y ) && ( mouse_y - close_dist < min_vis_y ) ) {
var t = Math.min( nudge, p_max_y - panel_pos.top );
panel.css( "top", panel_pos.top + t );
// Firefox sometimes moves by less, so we need to check. Yuck.
@@ -57,7 +57,7 @@
ui.position.top -= amount_moved;
moved = true;
}
- if ( ( ! moved ) && ( panel_pos.top > p_min_y ) && ( mouse_y + close > max_vis_y ) ) {
+ if ( ( ! moved ) && ( panel_pos.top > p_min_y ) && ( mouse_y + close_dist > max_vis_y ) ) {
var t = Math.min( nudge, panel_pos.top - p_min_x );
panel.css( "top", ( panel_pos.top - t ) + "px" );
// Firefox sometimes moves by less, so we need to check. Yuck.
diff -r 6eac08f7edcf -r b671c301674a static/scripts/galaxy.workflow_editor.canvas.js
--- a/static/scripts/galaxy.workflow_editor.canvas.js Fri Aug 22 17:44:32 2008 -0400
+++ b/static/scripts/galaxy.workflow_editor.canvas.js Fri Aug 22 17:47:43 2008 -0400
@@ -32,15 +32,16 @@
this.datatype = datatype;
}
-OutputTerminal.prototype.__proto__ = Terminal.prototype;
+OutputTerminal.prototype = new Terminal;
function InputTerminal( element, datatypes ) {
Terminal.call( this, element );
this.datatypes = datatypes;
}
-InputTerminal.prototype = {
- __proto__: Terminal.prototype,
+InputTerminal.prototype = new Terminal;
+
+$.extend( InputTerminal.prototype, {
can_accept: function ( other ) {
if ( this.connectors.length < 1 ) {
for ( t in this.datatypes ) {
@@ -53,7 +54,7 @@
}
return false;
}
-}
+});
function Connector( handle1, handle2 ) {
this.canvas = null;
@@ -81,6 +82,10 @@
var canvas_container = $("#canvas-container");
if ( ! this.canvas ) {
this.canvas = document.createElement( "canvas" );
+ // excanvas specific hack
+ if ( window.G_vmlCanvasManager ) {
+ G_vmlCanvasManager.initElement( this.canvas );
+ }
canvas_container.append( $(this.canvas) );
if ( this.dragging ) { this.canvas.style.zIndex = "300" }
}
@@ -182,14 +187,14 @@
t.remove();
})))
.bind( "mouseleave", function() {
- $(this).fadeOut( "fast", function() { $(this).remove() } )
+ $(this).remove();
});
// Position it and show
t.css( {
top: $(this).offset().top - 2,
left: $(this).offset().left - t.width(),
'padding-right': $(this).width() }
- ).fadeIn( "fast" );
+ ).show();
}
},
function() {}
@@ -272,12 +277,12 @@
var node = this;
var b = f.find( ".toolFormBody" );
b.find( "div" ).remove();
- var ibox = $("<div class='inputs'/>").appendTo( b );
+ var ibox = $("<div class='inputs'></div>").appendTo( b );
$.each( data.data_inputs, function( i, input ) {
- t = $("<div class='terminal input-terminal'></div>")
+ var t = $("<div class='terminal input-terminal'></div>");
node.enable_input_terminal( t, input.name, input.extensions );
- ibox.append( $("<div class='form-row dataRow input-data-row' name='" + input.name + "'>" + input.label + "</div></div>" ).prepend( t ) );
- });
+ ibox.append( $("<div class='form-row dataRow input-data-row' name='" + input.name + "'>" + input.label + "</div>" ).prepend( t ) );
+ });
if ( ( data.data_inputs.length > 0 ) && ( data.data_outputs.length > 0 ) ) {
b.append( $( "<div class='rule'></div>" ) );
}
@@ -305,8 +310,8 @@
}
// Update input rows
var old_body = el.find( "div.inputs" );
- var new_body = $("<div class='inputs'/>");
- old = old_body.find( "div.input-data-row")
+ var new_body = $("<div class='inputs'></div>");
+ var old = old_body.find( "div.input-data-row")
$.each( data.data_inputs, function( i, input ) {
var t = $("<div class='terminal input-terminal'></div>");
node.enable_input_terminal( t, input.name, input.extensions );
@@ -322,7 +327,7 @@
$(this).remove();
});
// Append to new body
- new_body.append( $("<div class='form-row dataRow input-data-row' name='" + input.name + "'>" + input.label + "</div></div>" ).prepend( t ) );
+ new_body.append( $("<div class='form-row dataRow input-data-row' name='" + input.name + "'>" + input.label + "</div>" ).prepend( t ) );
});
old_body.replaceWith( new_body );
// Cleanup any leftover terminals
@@ -468,13 +473,21 @@
f.append( b )
// Fix width to computed width
// Now add floats
- var buttons = $("<div class='buttons' style='float: right'></div>");
- buttons.append( $("<img src='../images/delete_icon.png' />").click( function() {
+ var buttons = $("<div class='buttons' style='float: right;'></div>");
+ buttons.append( $("<img src='../images/delete_icon.png' />").click( function( e ) {
node.destroy();
} ).hover(
function() { $(this).attr( 'src', "../images/delete_icon_dark.png" ) },
function() { $(this).attr( 'src', "../images/delete_icon.png" ) }
) );
+ // zIndex tracking for bring to front
+ zmax = $("#canvas-container").data( "zmax" )
+ if ( ! zmax ) {
+ zmax = 0;
+ }
+ f.css( "zIndex", zmax + 1 );
+ $("#canvas-container").data( "zmax", zmax + 1 );
+ // Place inside container
f.appendTo( "#canvas-container" );
// Position in container
var o = $("#canvas-container").position();
@@ -494,13 +507,16 @@
// containment: $("#shim"),
// grow: true,
click: function( e, ui ) {
- var element = $(this).data("draggable").element.get(0);
- (function(p) { p.removeChild( element ); p.appendChild( element ) })(element.parentNode)
+ // Bring to front
+ zmax = $("#canvas-container").data( "zmax" )
+ $(this).css( "zIndex", zmax + 1 );
+ $("#canvas-container").data( "zmax", zmax + 1 );
+ // Make active
workflow.activate_node( node );
},
start: function( e, ui ) {
workflow.activate_node( node );
- $(this).css( 'z-index', '1000' );
+ $(this).css( 'z-index', $("#canvas-container").data( "zmax" ) + 1000 );
},
drag: function( e, ui ) {
$(this).find( ".terminal" ).each( function() {
@@ -508,9 +524,11 @@
})
},
stop: function( e, ui ) {
- var element = $(this).data("draggable").element.get(0);
- (function(p) { p.removeChild( element ); p.appendChild( element ) })(element.parentNode)
- $(this).css( 'z-index', '100' );
+ // Bring to front
+ zmax = $("#canvas-container").data( "zmax" )
+ $(this).css( "zIndex", zmax + 1 );
+ $("#canvas-container").data( "zmax", zmax + 1 );
+ // Redraw
$(this).find( ".terminal" ).each( function() {
this.terminal.redraw();
});
diff -r 6eac08f7edcf -r b671c301674a static/scripts/packed/galaxy.base.js
--- a/static/scripts/packed/galaxy.base.js Fri Aug 22 17:44:32 2008 -0400
+++ b/static/scripts/packed/galaxy.base.js Fri Aug 22 17:47:43 2008 -0400
@@ -1,1 +1,1 @@
-jQuery(document).ready(function(){jQuery("a[@confirm]").click(function(){return confirm(jQuery(this).attr("confirm"))});jQuery("div[@popupmenu]").each(function(){var B={};$(this).find("a").each(function(){var C=$(this).attr("confirm"),D=$(this).attr("href"),E=$(this).attr("target");B[$(this).text()]=function(){if(!C||confirm(C)){var F=window;if(E=="_parent"){F=window.parent}F.location=D}}});var A=$("#"+$(this).attr("popupmenu"));make_popupmenu(A,B);$(this).remove();A.show()})});function ensure_popup_helper(){if($("#popup-helper").length==0){var A=$("<div id='popup-helper' style='background: white; opacity: 0.00; top: 0; left: 0; width: 100%; height: 100%; position: absolute; z-index: 15000;'></div>");if($.browser.ie){A.css("opacity","0.01")}A.appendTo("body").hide()}}function make_popupmenu(D,B){ensure_popup_helper();var A=$("<div class='popupmenu'></div>").appendTo("body");$.each(B,function(G,F){$("<div class='popupmenu-item' />").html(G).click(F).appendTo(A)});var C=functi
on(){$(A).unbind().hide();$("#popup-helper").unbind().hide()};var E=function(F){var G=$(D).offset();$("#popup-helper").mousedown(C).show();$(A).click(C).css({top:-1000}).show().css({top:F.pageY-2,left:F.pageX-2});return false};$(D).click(E)};
\ No newline at end of file
+jQuery(document).ready(function(){jQuery("a[@confirm]").click(function(){return confirm(jQuery(this).attr("confirm"))});jQuery("div[@popupmenu]").each(function(){var B={};$(this).find("a").each(function(){var C=$(this).attr("confirm"),D=$(this).attr("href"),E=$(this).attr("target");B[$(this).text()]=function(){if(!C||confirm(C)){var F=window;if(E=="_parent"){F=window.parent}F.location=D}}});var A=$("#"+$(this).attr("popupmenu"));make_popupmenu(A,B);$(this).remove();A.show()})});function ensure_popup_helper(){if($("#popup-helper").length==0){$("<div id='popup-helper'/>").css({background:"white",opacity:0,zIndex:15000,position:"absolute",top:0,left:0,width:"100%",height:"100%"}).appendTo("body").hide()}}function make_popupmenu(D,B){ensure_popup_helper();var A=$("<div class='popupmenu'></div>").appendTo("body");$.each(B,function(G,F){$("<div class='popupmenu-item' />").html(G).click(F).appendTo(A)});var C=function(){$(A).unbind().hide();$("#popup-helper").unbind().hide()};var E
=function(F){var G=$(D).offset();$("#popup-helper").mousedown(C).show();$(A).click(C).css({top:-1000}).show().css({top:F.pageY-2,left:F.pageX-2});return false};$(D).click(E)};
\ No newline at end of file
diff -r 6eac08f7edcf -r b671c301674a static/scripts/packed/galaxy.panels.js
--- a/static/scripts/packed/galaxy.panels.js Fri Aug 22 17:44:32 2008 -0400
+++ b/static/scripts/packed/galaxy.panels.js Fri Aug 22 17:47:43 2008 -0400
@@ -1,1 +1,1 @@
-var hidden_width=7;var border_tweak=9;var jq=jQuery;function ensure_dd_helper(){if(jq("#DD-helper").length==0){var A=jq("<div id='DD-helper' style='background: white; opacity: 0.00; top: 0; left: 0; width: 100%; height: 100%; position: absolute; z-index: 9000;'></div>");if(jq.browser.ie){A.css("opacity","0.01")}A.appendTo("body").hide()}}function make_left_panel(E,A,B){var D=false;var C=null;resize=function(F){var G=F;if(F<0){F=0}jq(E).css("width",F);jq(B).css("left",G);jq(A).css("left",F+7);if(document.recalc){document.recalc()}};toggle=function(){if(D){jq(B).removeClass("hover");jq(B).animate({left:C},"fast");jq(E).css("left",-C).show().animate({left:0},"fast",function(){resize(C);jq(B).removeClass("hidden")});D=false}else{C=jq(B).position().left;jq(A).css("left",hidden_width);if(document.recalc){document.recalc()}jq(B).removeClass("hover");jq(E).animate({left:-C},"fast");jq(B).animate({left:-1},"fast",function(){jq(this).addClass("hidden")});D=true}};jq(B).hover(function(
){jq(this).addClass("hover")},function(){jq(this).removeClass("hover")}).draggable({start:function(F,G){jq("#DD-helper").show()},stop:function(F,G){jq("#DD-helper").hide();return false},drag:function(F,G){x=G.position.left;x=Math.min(400,Math.max(100,x));if(D){jq(E).css("left",0);jq(B).removeClass("hidden");D=false}resize(x);G.position.left=x;G.position.top=$(this).data("draggable").originalPosition.top},click:function(){toggle()}}).find("div").show()}function make_right_panel(A,E,G){var I=false;var F=false;var C=null;var D=function(J){jq(A).css("width",J);jq(E).css("right",J+9);jq(G).css("right",J).css("left","");if(document.recalc){document.recalc()}};var H=function(){if(I){jq(G).removeClass("hover");jq(G).animate({right:C},"fast");jq(A).css("right",-C).show().animate({right:0},"fast",function(){D(C);jq(G).removeClass("hidden")});I=false}else{C=jq(document).width()-jq(G).position().left-border_tweak;jq(E).css("right",hidden_width+1);if(document.recalc){document.recalc()}jq
(G).removeClass("hover");jq(A).animate({right:-C},"fast");jq(G).animate({right:-1},"fast",function(){jq(this).addClass("hidden")});I=true}F=false};var B=function(J){var K=jq(E).width()-(I?C:0);if(K<J){if(!I){H();F=true}}else{if(F){H();F=false}}};jq(G).hover(function(){jq(this).addClass("hover")},function(){jq(this).removeClass("hover")}).draggable({start:function(J,K){jq("#DD-helper").show()},stop:function(J,K){x=K.position.left;w=jq(window).width();x=Math.min(w-100,x);x=Math.max(w-400,x);D(w-x-border_tweak);jq("#DD-helper").hide();return false},click:function(){H()},drag:function(J,K){x=K.position.left;w=jq(window).width();x=Math.min(w-100,x);x=Math.max(w-400,x);if(I){jq(A).css("right",0);jq(G).removeClass("hidden");I=false}D(w-x-border_tweak);K.position.left=x;K.position.top=$(this).data("draggable").originalPosition.top}}).find("div").show();return{handle_minwidth_hint:B}}function make_popupmenu(D,B){var A=$("<div class='popupmenu'><div class='popupmenu-top'><div class='p
opupmenu-top-inner'/></div></div>").appendTo("body");$.each(B,function(G,F){$("<div class='popupmenu-item' />").html(G).click(F).appendTo(A)});var C=function(){$(A).unbind().hide();$("#popup-helper").unbind().hide()};var E=function(){var F=$(D).offset();$("#popup-helper").mousedown(C).show();$(A).click(C).css({top:-1000}).show().css({top:F.top+$(D).height()+9,left:F.left+$(D).width()-$(A).width()})};$(D).click(E)};
\ No newline at end of file
+var hidden_width=7;var border_tweak=9;var jq=jQuery;function ensure_dd_helper(){if(jq("#DD-helper").length==0){$("<div id='DD-helper'/>").css({background:"white",opacity:0,zIndex:9000,position:"absolute",top:0,left:0,width:"100%",height:"100%"}).appendTo("body").hide()}}function make_left_panel(E,A,B){var D=false;var C=null;resize=function(F){var G=F;if(F<0){F=0}jq(E).css("width",F);jq(B).css("left",G);jq(A).css("left",F+7);if(document.recalc){document.recalc()}};toggle=function(){if(D){jq(B).removeClass("hover");jq(B).animate({left:C},"fast");jq(E).css("left",-C).show().animate({left:0},"fast",function(){resize(C);jq(B).removeClass("hidden")});D=false}else{C=jq(B).position().left;jq(A).css("left",hidden_width);if(document.recalc){document.recalc()}jq(B).removeClass("hover");jq(E).animate({left:-C},"fast");jq(B).animate({left:-1},"fast",function(){jq(this).addClass("hidden")});D=true}};jq(B).hover(function(){jq(this).addClass("hover")},function(){jq(this).removeClass("hover"
)}).draggable({start:function(F,G){jq("#DD-helper").show()},stop:function(F,G){jq("#DD-helper").hide();return false},drag:function(F,G){x=G.position.left;x=Math.min(400,Math.max(100,x));if(D){jq(E).css("left",0);jq(B).removeClass("hidden");D=false}resize(x);G.position.left=x;G.position.top=$(this).data("draggable").originalPosition.top},click:function(){toggle()}}).find("div").show()}function make_right_panel(A,E,G){var I=false;var F=false;var C=null;var D=function(J){jq(A).css("width",J);jq(E).css("right",J+9);jq(G).css("right",J).css("left","");if(document.recalc){document.recalc()}};var H=function(){if(I){jq(G).removeClass("hover");jq(G).animate({right:C},"fast");jq(A).css("right",-C).show().animate({right:0},"fast",function(){D(C);jq(G).removeClass("hidden")});I=false}else{C=jq(document).width()-jq(G).position().left-border_tweak;jq(E).css("right",hidden_width+1);if(document.recalc){document.recalc()}jq(G).removeClass("hover");jq(A).animate({right:-C},"fast");jq(G).anima
te({right:-1},"fast",function(){jq(this).addClass("hidden")});I=true}F=false};var B=function(J){var K=jq(E).width()-(I?C:0);if(K<J){if(!I){H();F=true}}else{if(F){H();F=false}}};jq(G).hover(function(){jq(this).addClass("hover")},function(){jq(this).removeClass("hover")}).draggable({start:function(J,K){jq("#DD-helper").show()},stop:function(J,K){x=K.position.left;w=jq(window).width();x=Math.min(w-100,x);x=Math.max(w-400,x);D(w-x-border_tweak);jq("#DD-helper").hide();return false},click:function(){H()},drag:function(J,K){x=K.position.left;w=jq(window).width();x=Math.min(w-100,x);x=Math.max(w-400,x);if(I){jq(A).css("right",0);jq(G).removeClass("hidden");I=false}D(w-x-border_tweak);K.position.left=x;K.position.top=$(this).data("draggable").originalPosition.top}}).find("div").show();return{handle_minwidth_hint:B}}function hide_modal(){$(".dialog-box-container").fadeOut(function(){$("#overlay").hide()})}function show_modal(E,B,D,C){$(".dialog-box").find(".title").html(E);var A=$(".
dialog-box").find(".buttons").html("");if(D){$.each(D,function(F,G){A.append($("<button/>").text(F).click(G));A.append(" ")});A.show()}else{A.hide()}var A=$(".dialog-box").find(".extra_buttons").html("");if(C){$.each(C,function(F,G){A.append($("<button/>").text(F).click(G));A.append(" ")});A.show()}else{A.hide()}if(B=="progress"){B=$("<img src='../images/yui/rel_interstitial_loading.gif')' />")}$(".dialog-box").find(".body").html(B);if(!$(".dialog-box-container").is(":visible")){$("#overlay").show();$(".dialog-box-container").fadeIn()}}function make_popupmenu(D,B){var A=$("<div class='popupmenu'><div class='popupmenu-top'><div class='popupmenu-top-inner'/></div></div>").appendTo("body");$.each(B,function(G,F){$("<div class='popupmenu-item' />").html(G).click(F).appendTo(A)});var C=function(){$(A).unbind().hide();$("#popup-helper").unbind().hide()};var E=function(){var F=$(D).offset();$("#popup-helper").mousedown(C).show();$(A).click(C).css({top:-1000}).show().css({top:F.top+
$(D).height()+9,left:F.left+$(D).width()-$(A).width()})};$(D).click(E)};
\ No newline at end of file
diff -r 6eac08f7edcf -r b671c301674a static/scripts/packed/galaxy.workflow_editor.canvas.js
--- a/static/scripts/packed/galaxy.workflow_editor.canvas.js Fri Aug 22 17:44:32 2008 -0400
+++ b/static/scripts/packed/galaxy.workflow_editor.canvas.js Fri Aug 22 17:47:43 2008 -0400
@@ -1,1 +1,1 @@
-function Terminal(A){this.element=A;this.connectors=[]}Terminal.prototype={connect:function(A){this.connectors.push(A);if(this.node){this.node.changed()}},disconnect:function(A){this.connectors.splice($.inArray(A,this.connectors),1);if(this.node){this.node.changed()}},redraw:function(){$.each(this.connectors,function(A,B){B.redraw()})},destroy:function(){$.each(this.connectors.slice(),function(A,B){B.destroy()})}};function OutputTerminal(A,B){Terminal.call(this,A);this.datatype=B}OutputTerminal.prototype.__proto__=Terminal.prototype;function InputTerminal(A,B){Terminal.call(this,A);this.datatypes=B}InputTerminal.prototype={__proto__:Terminal.prototype,can_accept:function(A){if(this.connectors.length<1){for(t in this.datatypes){if(A.datatype=="input"){return true}if(issubtype(A.datatype,this.datatypes[t])){return true}}}return false}};function Connector(B,A){this.canvas=null;this.dragging=false;this.inner_color="#FFFFFF";this.outer_color="#D8B365"}$.extend(Connector.prototype
,{connect:function(B,A){this.handle1=B;this.handle1.connect(this);this.handle2=A;this.handle2.connect(this)},destroy:function(){if(this.handle1){this.handle1.disconnect(this)}if(this.handle2){this.handle2.disconnect(this)}$(this.canvas).remove()},redraw:function(){var C=$("#canvas-container");if(!this.canvas){this.canvas=document.createElement("canvas");C.append($(this.canvas));if(this.dragging){this.canvas.style.zIndex="300"}}var L=function(S){return $(S).offset().left-C.offset().left};var G=function(S){return $(S).offset().top-C.offset().top};var F=L(this.handle1.element)+5;var E=G(this.handle1.element)+5;var N=L(this.handle2.element)+5;var K=G(this.handle2.element)+5;var D=100;var I=Math.min(F,N);var A=Math.max(F,N);var H=Math.min(E,K);var R=Math.max(E,K);var B=Math.min(Math.max(Math.abs(R-H)/2,100),300);var M=I-D;var Q=H-D;var O=A-I+2*D;var J=R-H+2*D;this.canvas.style.left=M+"px";this.canvas.style.top=Q+"px";this.canvas.setAttribute("width",O);this.canvas.setAttribute("h
eight",J);F-=M;E-=Q;N-=M;K-=Q;var P=this.canvas.getContext("2d");P.lineCap="round";P.strokeStyle=this.outer_color;P.lineWidth=7;P.beginPath();P.moveTo(F,E);P.bezierCurveTo(F+B,E,N-B,K,N,K);P.stroke();P.strokeStyle=this.inner_color;P.lineWidth=5;P.beginPath();P.moveTo(F,E);P.bezierCurveTo(F+B,E,N-B,K,N,K);P.stroke()}});function Node(A){this.element=A;this.input_terminals={};this.output_terminals={};this.tool_errors={}}$.extend(Node.prototype,{enable_input_terminal:function(C,A,B){node=this;$(C).each(function(){var D=this.terminal=new InputTerminal(this,B);D.node=node;D.name=A;$(this).droppable({tolerance:"intersect",accept:function(E){E=E.get(0);return(E.terminal)&&(D.can_accept(E.terminal))},activeClass:"input-terminal-active",over:function(F,E){E.helper.get(0).terminal.connectors[0].inner_color="#BBFFBB"},out:function(F,E){E.helper.get(0).terminal.connectors[0].inner_color="#FFFFFF"},drop:function(I,G){var E=$(this).data("droppable");var F=G.draggable.get(0).terminal;var H=
E.element.get(0).terminal;var J=new Connector();J.connect(F,H);J.redraw()}});$(this).hoverIntent(function(){if(D.connectors.length>0){var E=$("<div class='callout'></div>").css({display:"none"}).appendTo("body").append($("<div class='buttons'></div>").append($("<img src='../images/delete_icon.png' />").click(function(){$.each(D.connectors,function(G,F){F.destroy()});E.remove()}))).bind("mouseleave",function(){$(this).fadeOut("fast",function(){$(this).remove()})});E.css({top:$(this).offset().top-2,left:$(this).offset().left-E.width(),"padding-right":$(this).width()}).fadeIn("fast")}},function(){});node.input_terminals[A]=D})},enable_output_terminal:function(C,A,B){node=this;$(C).each(function(){var D=this.terminal=new OutputTerminal(this,B);D.node=node;D.name=A;$(this).draggable({scrollPanel:true,panel:$("#canvas-container"),helper:function(){var E=$('<div class="drag-terminal" style="position: absolute;"></div>').appendTo("#canvas-container").get(0);E.terminal=new OutputTerm
inal(E);var F=new Connector();this.drag_temp_connector=F;F.dragging=true;F.connect(this.terminal,E.terminal);return E},drag:function(F,E){h=E.helper.get(0);h.terminal.redraw()},stop:function(F,E){this.drag_temp_connector.destroy()}});node.output_terminals[A]=D})},redraw:function(){$.each(this.input_terminals,function(A,B){B.redraw()});$.each(this.output_terminals,function(A,B){B.redraw()})},destroy:function(){$.each(this.input_terminals,function(A,B){B.destroy();$(B.element).droppable("destroy")});$.each(this.output_terminals,function(A,B){B.destroy();$(B.element).draggable("destroy")});$(this.element).draggable("destroy").remove();workflow.remove_node(this)},make_active:function(){$(this.element).addClass("toolForm-active")},make_inactive:function(){$(this.element).removeClass("toolForm-active")},init_field_data:function(D){var C=this.element;if(D.type){this.type=D.type}this.form_html=D.form_html;this.tool_state=D.tool_state;this.tool_errors=D.tool_errors;if(this.tool_error
s){C.addClass("tool-node-error")}else{C.removeClass("tool-node-error")}var B=this;var A=C.find(".toolFormBody");A.find("div").remove();var E=$("<div class='inputs'/>").appendTo(A);$.each(D.data_inputs,function(G,F){t=$("<div class='terminal input-terminal'></div>");B.enable_input_terminal(t,F.name,F.extensions);E.append($("<div class='form-row dataRow input-data-row' name='"+F.name+"'>"+F.label+"</div></div>").prepend(t))});if((D.data_inputs.length>0)&&(D.data_outputs.length>0)){A.append($("<div class='rule'></div>"))}$.each(D.data_outputs,function(I,F){var H=$("<div class='terminal output-terminal'></div>");B.enable_output_terminal(H,F.name,F.extension);var G=F.name;if(F.extension!="input"){G=G+" ("+F.extension+")"}A.append($("<div class='form-row dataRow'>"+G+"</div>").append(H))});workflow.node_changed(this)},update_field_data:function(D){var B=$(this.element),C=this;this.tool_state=D.tool_state;this.form_html=D.form_html;this.tool_errors=D.tool_errors;if(this.tool_errors
){B.addClass("tool-node-error")}else{B.removeClass("tool-node-error")}var E=B.find("div.inputs");var A=$("<div class='inputs'/>");old=E.find("div.input-data-row");$.each(D.data_inputs,function(H,F){var G=$("<div class='terminal input-terminal'></div>");C.enable_input_terminal(G,F.name,F.extensions);E.find("div[name="+F.name+"]").each(function(){$(this).find(".input-terminal").each(function(){var I=this.terminal.connectors[0];if(I){G[0].terminal.connectors[0]=I;I.handle2=G[0].terminal}});$(this).remove()});A.append($("<div class='form-row dataRow input-data-row' name='"+F.name+"'>"+F.label+"</div></div>").prepend(G))});E.replaceWith(A);E.find("div.input-data-row > .terminal").each(function(){this.terminal.destroy()});this.changed();this.redraw()},error:function(C){var A=$(this.element).find(".toolFormBody");A.find("div").remove();var B="<div style='color: red; text-style: italic;'>"+C+"</div>";this.form_html=B;A.html(B);workflow.node_changed(this)},changed:function(){workflow
.node_changed(this)}});function Workflow(){this.id_counter=0;this.nodes={};this.name=null;this.has_changes=false}$.extend(Workflow.prototype,{add_node:function(A){A.id=this.id_counter;this.id_counter++;this.nodes[A.id]=A;this.has_changes=true;A.workflow=this},remove_node:function(A){if(this.active_node==A){this.clear_active_node()}delete this.nodes[A.id];this.has_changes=true},remove_all:function(){wf=this;$.each(this.nodes,function(B,A){A.destroy();wf.remove_node(A)})},to_simple:function(){var A={};$.each(this.nodes,function(B,D){var E={};$.each(D.input_terminals,function(F,G){E[G.name]=null;$.each(G.connectors,function(H,I){E[G.name]={id:I.handle1.node.id,output_name:I.handle1.name}})});var C={id:D.id,type:D.type,tool_id:D.tool_id,tool_state:D.tool_state,tool_errors:D.tool_errors,input_connections:E,position:$(D.element).position()};A[D.id]=C});return{steps:A}},from_simple:function(A){wf=this;var B=0;wf.name=A.name;$.each(A.steps,function(E,D){var C=prebuild_node("tool",D.
name,D.tool_id);C.init_field_data(D);if(D.position){C.element.css({top:D.position.top,left:D.position.left})}C.id=D.id;wf.nodes[C.id]=C;B=Math.max(B,parseInt(E))});wf.id_counter=B+1;$.each(A.steps,function(E,D){var C=wf.nodes[E];$.each(D.input_connections,function(G,F){if(F){var H=wf.nodes[F.id];var I=new Connector();I.connect(H.output_terminals[F.output_name],C.input_terminals[G]);I.redraw()}})})},clear_active_node:function(){if(this.active_node){this.active_node.make_inactive()}parent.show_form_for_tool("<div>No node selected</div>")},activate_node:function(A){this.clear_active_node();parent.show_form_for_tool(A.form_html,A);A.make_active();this.active_node=A},node_changed:function(A){this.has_changes=true;if(this.active_node==A){this.activate_node(A)}}});function prebuild_node(H,F,K){var E=$("<div class='toolForm toolFormInCanvas'></div>");var C=new Node(E);C.type=H;if(H=="tool"){C.tool_id=K}var J=$("<div class='toolFormTitle unselectable'>"+F+"</div>");E.append(J);E.css(
"left",$(window).scrollLeft()+20);E.css("top",$(window).scrollTop()+20);var I=$("<div class='toolFormBody'></div>");var D="<div><img height='16' align='middle' src='../images/loading_small_white_bg.gif'/> loading tool info...</div>";I.append(D);C.form_html=D;E.append(I);var G=$("<div class='buttons' style='float: right'></div>");G.append($("<img src='../images/delete_icon.png' />").click(function(){C.destroy()}).hover(function(){$(this).attr("src","../images/delete_icon_dark.png")},function(){$(this).attr("src","../images/delete_icon.png")}));E.appendTo("#canvas-container");var B=$("#canvas-container").position();E.css({left:(-B.left)+10,top:(-B.top)+10});var A=E.width();G.prependTo(J);A+=(G.width()+10);E.css("width",A);$(E).draggable({cursor:"move",scrollPanel:true,panel:$("#canvas-container"),scrollSensitivity:10,scrollSpeed:20,click:function(N,M){var L=$(this).data("draggable").element.get(0);(function(O){O.removeChild(L);O.appendChild(L)})(L.parentNode);workflow.activate
_node(C)},start:function(M,L){workflow.activate_node(C);$(this).css("z-index","1000")},drag:function(M,L){$(this).find(".terminal").each(function(){this.terminal.redraw()})},stop:function(N,M){var L=$(this).data("draggable").element.get(0);(function(O){O.removeChild(L);O.appendChild(L)})(L.parentNode);$(this).css("z-index","100");$(this).find(".terminal").each(function(){this.terminal.redraw()});workflow.node_changed(this)}});return C}var ext_to_type=null;var type_to_type=null;function issubtype(B,A){B=ext_to_type[B];A=ext_to_type[A];return(A in type_to_type[B])}function populate_datatype_info(A){ext_to_type=A.ext_to_class_name;type_to_type=A.class_to_classes};
\ No newline at end of file
+function Terminal(A){this.element=A;this.connectors=[]}Terminal.prototype={connect:function(A){this.connectors.push(A);if(this.node){this.node.changed()}},disconnect:function(A){this.connectors.splice($.inArray(A,this.connectors),1);if(this.node){this.node.changed()}},redraw:function(){$.each(this.connectors,function(A,B){B.redraw()})},destroy:function(){$.each(this.connectors.slice(),function(A,B){B.destroy()})}};function OutputTerminal(A,B){Terminal.call(this,A);this.datatype=B}OutputTerminal.prototype=new Terminal;function InputTerminal(A,B){Terminal.call(this,A);this.datatypes=B}InputTerminal.prototype=new Terminal;$.extend(InputTerminal.prototype,{can_accept:function(A){if(this.connectors.length<1){for(t in this.datatypes){if(A.datatype=="input"){return true}if(issubtype(A.datatype,this.datatypes[t])){return true}}}return false}});function Connector(B,A){this.canvas=null;this.dragging=false;this.inner_color="#FFFFFF";this.outer_color="#D8B365"}$.extend(Connector.prototy
pe,{connect:function(B,A){this.handle1=B;this.handle1.connect(this);this.handle2=A;this.handle2.connect(this)},destroy:function(){if(this.handle1){this.handle1.disconnect(this)}if(this.handle2){this.handle2.disconnect(this)}$(this.canvas).remove()},redraw:function(){var C=$("#canvas-container");if(!this.canvas){this.canvas=document.createElement("canvas");if(window.G_vmlCanvasManager){G_vmlCanvasManager.initElement(this.canvas)}C.append($(this.canvas));if(this.dragging){this.canvas.style.zIndex="300"}}var L=function(S){return $(S).offset().left-C.offset().left};var G=function(S){return $(S).offset().top-C.offset().top};var F=L(this.handle1.element)+5;var E=G(this.handle1.element)+5;var N=L(this.handle2.element)+5;var K=G(this.handle2.element)+5;var D=100;var I=Math.min(F,N);var A=Math.max(F,N);var H=Math.min(E,K);var R=Math.max(E,K);var B=Math.min(Math.max(Math.abs(R-H)/2,100),300);var M=I-D;var Q=H-D;var O=A-I+2*D;var J=R-H+2*D;this.canvas.style.left=M+"px";this.canvas.styl
e.top=Q+"px";this.canvas.setAttribute("width",O);this.canvas.setAttribute("height",J);F-=M;E-=Q;N-=M;K-=Q;var P=this.canvas.getContext("2d");P.lineCap="round";P.strokeStyle=this.outer_color;P.lineWidth=7;P.beginPath();P.moveTo(F,E);P.bezierCurveTo(F+B,E,N-B,K,N,K);P.stroke();P.strokeStyle=this.inner_color;P.lineWidth=5;P.beginPath();P.moveTo(F,E);P.bezierCurveTo(F+B,E,N-B,K,N,K);P.stroke()}});function Node(A){this.element=A;this.input_terminals={};this.output_terminals={};this.tool_errors={}}$.extend(Node.prototype,{enable_input_terminal:function(C,A,B){node=this;$(C).each(function(){var D=this.terminal=new InputTerminal(this,B);D.node=node;D.name=A;$(this).droppable({tolerance:"intersect",accept:function(E){E=E.get(0);return(E.terminal)&&(D.can_accept(E.terminal))},activeClass:"input-terminal-active",over:function(F,E){E.helper.get(0).terminal.connectors[0].inner_color="#BBFFBB"},out:function(F,E){E.helper.get(0).terminal.connectors[0].inner_color="#FFFFFF"},drop:function(I
,G){var E=$(this).data("droppable");var F=G.draggable.get(0).terminal;var H=E.element.get(0).terminal;var J=new Connector();J.connect(F,H);J.redraw()}});$(this).hoverIntent(function(){if(D.connectors.length>0){var E=$("<div class='callout'></div>").css({display:"none"}).appendTo("body").append($("<div class='buttons'></div>").append($("<img src='../images/delete_icon.png' />").click(function(){$.each(D.connectors,function(G,F){F.destroy()});E.remove()}))).bind("mouseleave",function(){$(this).remove()});E.css({top:$(this).offset().top-2,left:$(this).offset().left-E.width(),"padding-right":$(this).width()}).show()}},function(){});node.input_terminals[A]=D})},enable_output_terminal:function(C,A,B){node=this;$(C).each(function(){var D=this.terminal=new OutputTerminal(this,B);D.node=node;D.name=A;$(this).draggable({scrollPanel:true,panel:$("#canvas-container"),helper:function(){var E=$('<div class="drag-terminal" style="position: absolute;"></div>').appendTo("#canvas-container").
get(0);E.terminal=new OutputTerminal(E);var F=new Connector();this.drag_temp_connector=F;F.dragging=true;F.connect(this.terminal,E.terminal);return E},drag:function(F,E){h=E.helper.get(0);h.terminal.redraw()},stop:function(F,E){this.drag_temp_connector.destroy()}});node.output_terminals[A]=D})},redraw:function(){$.each(this.input_terminals,function(A,B){B.redraw()});$.each(this.output_terminals,function(A,B){B.redraw()})},destroy:function(){$.each(this.input_terminals,function(A,B){B.destroy();$(B.element).droppable("destroy")});$.each(this.output_terminals,function(A,B){B.destroy();$(B.element).draggable("destroy")});$(this.element).draggable("destroy").remove();workflow.remove_node(this)},make_active:function(){$(this.element).addClass("toolForm-active")},make_inactive:function(){$(this.element).removeClass("toolForm-active")},init_field_data:function(D){var C=this.element;if(D.type){this.type=D.type}this.form_html=D.form_html;this.tool_state=D.tool_state;this.tool_errors=
D.tool_errors;if(this.tool_errors){C.addClass("tool-node-error")}else{C.removeClass("tool-node-error")}var B=this;var A=C.find(".toolFormBody");A.find("div").remove();var E=$("<div class='inputs'></div>").appendTo(A);$.each(D.data_inputs,function(H,F){var G=$("<div class='terminal input-terminal'></div>");B.enable_input_terminal(G,F.name,F.extensions);E.append($("<div class='form-row dataRow input-data-row' name='"+F.name+"'>"+F.label+"</div>").prepend(G))});if((D.data_inputs.length>0)&&(D.data_outputs.length>0)){A.append($("<div class='rule'></div>"))}$.each(D.data_outputs,function(I,F){var H=$("<div class='terminal output-terminal'></div>");B.enable_output_terminal(H,F.name,F.extension);var G=F.name;if(F.extension!="input"){G=G+" ("+F.extension+")"}A.append($("<div class='form-row dataRow'>"+G+"</div>").append(H))});workflow.node_changed(this)},update_field_data:function(E){var C=$(this.element),D=this;this.tool_state=E.tool_state;this.form_html=E.form_html;this.tool_error
s=E.tool_errors;if(this.tool_errors){C.addClass("tool-node-error")}else{C.removeClass("tool-node-error")}var F=C.find("div.inputs");var B=$("<div class='inputs'></div>");var A=F.find("div.input-data-row");$.each(E.data_inputs,function(I,G){var H=$("<div class='terminal input-terminal'></div>");D.enable_input_terminal(H,G.name,G.extensions);F.find("div[name="+G.name+"]").each(function(){$(this).find(".input-terminal").each(function(){var J=this.terminal.connectors[0];if(J){H[0].terminal.connectors[0]=J;J.handle2=H[0].terminal}});$(this).remove()});B.append($("<div class='form-row dataRow input-data-row' name='"+G.name+"'>"+G.label+"</div>").prepend(H))});F.replaceWith(B);F.find("div.input-data-row > .terminal").each(function(){this.terminal.destroy()});this.changed();this.redraw()},error:function(C){var A=$(this.element).find(".toolFormBody");A.find("div").remove();var B="<div style='color: red; text-style: italic;'>"+C+"</div>";this.form_html=B;A.html(B);workflow.node_change
d(this)},changed:function(){workflow.node_changed(this)}});function Workflow(){this.id_counter=0;this.nodes={};this.name=null;this.has_changes=false}$.extend(Workflow.prototype,{add_node:function(A){A.id=this.id_counter;this.id_counter++;this.nodes[A.id]=A;this.has_changes=true;A.workflow=this},remove_node:function(A){if(this.active_node==A){this.clear_active_node()}delete this.nodes[A.id];this.has_changes=true},remove_all:function(){wf=this;$.each(this.nodes,function(B,A){A.destroy();wf.remove_node(A)})},to_simple:function(){var A={};$.each(this.nodes,function(B,D){var E={};$.each(D.input_terminals,function(F,G){E[G.name]=null;$.each(G.connectors,function(H,I){E[G.name]={id:I.handle1.node.id,output_name:I.handle1.name}})});var C={id:D.id,type:D.type,tool_id:D.tool_id,tool_state:D.tool_state,tool_errors:D.tool_errors,input_connections:E,position:$(D.element).position()};A[D.id]=C});return{steps:A}},from_simple:function(A){wf=this;var B=0;wf.name=A.name;$.each(A.steps,functio
n(E,D){var C=prebuild_node("tool",D.name,D.tool_id);C.init_field_data(D);if(D.position){C.element.css({top:D.position.top,left:D.position.left})}C.id=D.id;wf.nodes[C.id]=C;B=Math.max(B,parseInt(E))});wf.id_counter=B+1;$.each(A.steps,function(E,D){var C=wf.nodes[E];$.each(D.input_connections,function(G,F){if(F){var H=wf.nodes[F.id];var I=new Connector();I.connect(H.output_terminals[F.output_name],C.input_terminals[G]);I.redraw()}})})},clear_active_node:function(){if(this.active_node){this.active_node.make_inactive()}parent.show_form_for_tool("<div>No node selected</div>")},activate_node:function(A){this.clear_active_node();parent.show_form_for_tool(A.form_html,A);A.make_active();this.active_node=A},node_changed:function(A){this.has_changes=true;if(this.active_node==A){this.activate_node(A)}}});function prebuild_node(H,F,K){var E=$("<div class='toolForm toolFormInCanvas'></div>");var C=new Node(E);C.type=H;if(H=="tool"){C.tool_id=K}var J=$("<div class='toolFormTitle unselectab
le'>"+F+"</div>");E.append(J);E.css("left",$(window).scrollLeft()+20);E.css("top",$(window).scrollTop()+20);var I=$("<div class='toolFormBody'></div>");var D="<div><img height='16' align='middle' src='../images/loading_small_white_bg.gif'/> loading tool info...</div>";I.append(D);C.form_html=D;E.append(I);var G=$("<div class='buttons' style='float: right;'></div>");G.append($("<img src='../images/delete_icon.png' />").click(function(L){C.destroy()}).hover(function(){$(this).attr("src","../images/delete_icon_dark.png")},function(){$(this).attr("src","../images/delete_icon.png")}));zmax=$("#canvas-container").data("zmax");if(!zmax){zmax=0}E.css("zIndex",zmax+1);$("#canvas-container").data("zmax",zmax+1);E.appendTo("#canvas-container");var B=$("#canvas-container").position();E.css({left:(-B.left)+10,top:(-B.top)+10});var A=E.width();G.prependTo(J);A+=(G.width()+10);E.css("width",A);$(E).draggable({cursor:"move",scrollPanel:true,panel:$("#canvas-container"),scrollSensitivity:10,
scrollSpeed:20,click:function(M,L){zmax=$("#canvas-container").data("zmax");$(this).css("zIndex",zmax+1);$("#canvas-container").data("zmax",zmax+1);workflow.activate_node(C)},start:function(M,L){workflow.activate_node(C);$(this).css("z-index",$("#canvas-container").data("zmax")+1000)},drag:function(M,L){$(this).find(".terminal").each(function(){this.terminal.redraw()})},stop:function(M,L){zmax=$("#canvas-container").data("zmax");$(this).css("zIndex",zmax+1);$("#canvas-container").data("zmax",zmax+1);$(this).find(".terminal").each(function(){this.terminal.redraw()});workflow.node_changed(this)}});return C}var ext_to_type=null;var type_to_type=null;function issubtype(B,A){B=ext_to_type[B];A=ext_to_type[A];return(A in type_to_type[B])}function populate_datatype_info(A){ext_to_type=A.ext_to_class_name;type_to_type=A.class_to_classes};
\ No newline at end of file
diff -r 6eac08f7edcf -r b671c301674a templates/workflow/editor.mako
--- a/templates/workflow/editor.mako Fri Aug 22 17:44:32 2008 -0400
+++ b/templates/workflow/editor.mako Fri Aug 22 17:47:43 2008 -0400
@@ -14,8 +14,11 @@
<%def name="javascripts()">
- ## ${parent.javascripts()}
-
+ ${parent.javascripts()}
+
+ <!--[if IE]>
+ <script type='text/javascript' src="/static/scripts/excanvas.js"> </script>
+ <![endif]-->
<script type='text/javascript' src="/static/scripts/jquery.js"> </script>
<script type='text/javascript' src="/static/scripts/jquery.ui.js"> </script>
<script type='text/javascript' src="/static/scripts/galaxy.ui.scrollPanel.js"> </script>
@@ -23,46 +26,6 @@
<script type='text/javascript' src="/static/scripts/jquery.form.js"> </script>
<script type='text/javascript' src="/static/scripts/jquery.json.js"> </script>
- <script type='text/javascript'>
- /* Dialog and menu handling tools to be moved to galaxy.layout.js */
-
- function hide_modal() {
- $(".dialog-box-container" ).fadeOut( function() { $("#overlay").hide(); } );
- };
-
- function show_modal( title, body, buttons, extra_buttons ) {
- $( ".dialog-box" ).find( ".title" ).html( title );
- var b = $( ".dialog-box" ).find( ".buttons" ).html( "" );
- if ( buttons ) {
- $.each( buttons, function( name, value ) {
- b.append( $( '<button/>' ).text( name ).click( value ) );
- b.append( " " );
- });
- b.show();
- } else {
- b.hide();
- }
- var b = $( ".dialog-box" ).find( ".extra_buttons" ).html( "" );
- if ( extra_buttons ) {
- $.each( extra_buttons, function( name, value ) {
- b.append( $( '<button/>' ).text( name ).click( value ) );
- b.append( " " );
- });
- b.show();
- } else {
- b.hide();
- }
- if ( body == "progress" ) {
- body = $( "<img src='${h.url_for('/static/images/yui/rel_interstitial_loading.gif')}'/>" );
- }
- $( ".dialog-box" ).find( ".body" ).html( body );
- if ( ! $(".dialog-box-container").is( ":visible" ) ) {
- $("#overlay").show();
- $(".dialog-box-container").fadeIn()
- }
- };
- </script>
-
<script type='text/javascript' src="/static/scripts/galaxy.workflow_editor.canvas.js"> </script>
<script type='text/javascript'>
@@ -70,38 +33,34 @@
$( function() {
// Initialize workflow state
reset();
- // Shim (the background of the editor area) causes loss of focus
- // $("#shim").click( workflow.clear_active_node ).hoverIntent( {
- // over: function () { $("div.toolForm").fadeTo( "fast", 0.7 ) },
- // out: function () { $("div.toolForm").fadeTo( "fast", 1.0 ) },
- // interval: 300
- // });
// Load the datatype info
- $.getJSON( "${h.url_for( action='get_datatypes' )}", function( data ) {
- populate_datatype_info( data );
- // Load workflow definition
- $.ajax( {
- url: "${h.url_for( action='load_workflow' )}",
- data: { id: "${trans.security.encode_id( workflow_id )}", "_": "true" },
- dataType: 'json',
- success: function( data ) {
- reset();
- workflow.from_simple( data );
- workflow.has_changes = false;
- scroll_to_nodes();
- hide_modal();
- },
- beforeSubmit: function( data ) {
- show_modal( "Loading workflow", "progress" );
- }
- });
+ $.ajax( {
+ url: "${h.url_for( action='get_datatypes' )}",
+ dataType: "json",
+ cache: false,
+ success: function( data ) {
+ populate_datatype_info( data );
+ // Load workflow definition
+ $.ajax( {
+ url: "${h.url_for( action='load_workflow' )}",
+ data: { id: "${trans.security.encode_id( workflow_id )}", "_": "true" },
+ dataType: 'json',
+ cache: false,
+ success: function( data ) {
+ reset();
+ workflow.from_simple( data );
+ workflow.has_changes = false;
+ scroll_to_nodes();
+ hide_modal();
+ },
+ beforeSubmit: function( data ) {
+ show_modal( "Loading workflow", "progress" );
+ }
+ });
+ }
});
$(document).ajaxError( function ( e, x ) {
- // $("#error-display").empty()
- // .append( $("<div/>").html( x.responseText ) )
- // .append( $("<div><a>close</a></div>" ).click( function() { $("#error-display").hide(); } ) )
- // .show();
show_modal( "Server error", x.responseText, { "Ignore error" : hide_modal } );
return false;
});
@@ -272,7 +231,7 @@
save_current_workflow( do_close );
}
}, {
- "Don't Save": do_close,
+ "Don't Save": do_close
} );
} else {
window.document.location = "${next_url}"
@@ -410,20 +369,10 @@
margin: 5px;
}
- #error-display {
- display: none;
- position: fixed;
- top: 5%; left: 5%; width: 90%; height: 90%;
- border: solid red 10px;
- background: #FFDDDD;
- z-index: 50000;
- overflow: auto;
- }
-
canvas { position: absolute; z-index: 10; }
canvas.dragging { position: absolute; z-index: 1000; }
- .input-terminal { width: 12px; height: 12px; background: url(${h.url_for('/static/style/workflow_circle_open.png')}); position: absolute; bottom: 0; left: -16px; z-index: 1500; }
- .output-terminal { width: 12px; height: 12px; background: url(${h.url_for('/static/style/workflow_circle_open.png')}); position: absolute; bottom: 0; right: -16px; z-index: 1500; }
+ .input-terminal { width: 12px; height: 12px; background: url(${h.url_for('/static/style/workflow_circle_open.png')}); position: absolute; top: 0; left: -16px; z-index: 1500; }
+ .output-terminal { width: 12px; height: 12px; background: url(${h.url_for('/static/style/workflow_circle_open.png')}); position: absolute; top: 0; right: -16px; z-index: 1500; }
.drag-terminal { width: 12px; height: 12px; background: url(${h.url_for('/static/style/workflow_circle_drag.png')}); position: absolute; z-index: 1500; }
.input-terminal-active { background: url(${h.url_for('/static/style/workflow_circle_green.png')}); }
## .input-terminal-hover { background: yellow; border: solid black 1px; }
@@ -504,13 +453,11 @@
</style>
</%def>
-
-<div id="error-display"></div>
<div id="overlay">
## Need a table here for centering in IE6
<table class="dialog-box-container" border="0" cellpadding="0" cellspacing="0"><tr><td>
- <div style="position: relative;">
+ <div class="dialog-box-wrapper">
<div class="dialog-box">
<div class="unified-panel-header">
<div class="unified-panel-header-inner"><span class='title'>Loading workflow editor...</span></div>
@@ -522,7 +469,6 @@
<div style="clear: both;"></div>
</div>
</div>
- <div class="dialog-box-underlay"></div>
</div>
</td></tr></table>
</div>
@@ -558,9 +504,9 @@
%if "[[" in tool.description and "]]" in tool.description:
${tool.description.replace( '[[', '<a id="link-${tool.id}" href="javascript:add_node_for_tool( ${tool.id} )">' % tool.id ).replace( "]]", "</a>" )}
%elif tool.name:
- <a id="link-${tool.id}" href="javascript:add_node_for_tool( '${tool.id}', '${tool.name}' )">${tool.name}</a> ${tool.description}
+ <a id="link-${tool.id}" href="#" onclick="add_node_for_tool( '${tool.id}', '${tool.name}' )">${tool.name}</a> ${tool.description}
%else:
- <a id="link-${tool.id}" href="javascript:add_node_for_tool( '${tool.id}', '${tool.name}' )">${tool.description}</a>
+ <a id="link-${tool.id}" href="#" onclick="add_node_for_tool( '${tool.id}', '${tool.name}' )">${tool.description}</a>
%endif
</div>
%else:
@@ -588,7 +534,7 @@
<div id="__workflow__input__" class="toolSectionBody">
<div class="toolSectionBg">
<div class="toolTitle">
- <a href="javascript:add_node_for_module( 'data_input', 'Input Dataset' )">Input dataset</a>
+ <a href="#" onclick="add_node_for_module( 'data_input', 'Input Dataset' )">Input dataset</a>
</div>
</div>
</div>
diff -r 6eac08f7edcf -r b671c301674a templates/workflow/index.mako
--- a/templates/workflow/index.mako Fri Aug 22 17:44:32 2008 -0400
+++ b/templates/workflow/index.mako Fri Aug 22 17:47:43 2008 -0400
@@ -21,16 +21,15 @@
</div>
%endif
-<div>
- <div style="float: right;">
- <a class="action-button" href="${h.url_for( action='create' )}">
- <img src="${h.url_for('/static/images/silk/add.png')}" />
- <span>Add a new workflow</span>
- </a>
- </div>
- <h2>Your workflows</h2>
+<h2>Your workflows</h2>
+
+<div style="float: right; margin-top: -2.5em;">
+ <a class="action-button" href="${h.url_for( action='create' )}">
+ <img src="${h.url_for('/static/images/silk/add.png')}" />
+ <span>Add a new workflow</span>
+ </a>
</div>
-
+
%if workflows:
<table class="colored" border="0" cellspacing="0" cellpadding="0" width="100%">
<tr class="header">
1
0
[hg] galaxy 1480: dbkey must be set after _metadata column is in...
by greg@scofield.bx.psu.edu 27 Aug '08
by greg@scofield.bx.psu.edu 27 Aug '08
27 Aug '08
details: http://www.bx.psu.edu/hg/galaxy/rev/6de3006c62b3
changeset: 1480:6de3006c62b3
user: Dan Blankenberg <dan(a)bx.psu.edu>
date: Mon Aug 25 15:28:57 2008 -0400
description:
dbkey must be set after _metadata column is initialized in the init of HDA, or else the dbkey is clobered.
1 file(s) affected in this change:
lib/galaxy/model/__init__.py
diffs (14 lines):
diff -r b671c301674a -r 6de3006c62b3 lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py Fri Aug 22 17:47:43 2008 -0400
+++ b/lib/galaxy/model/__init__.py Mon Aug 25 15:28:57 2008 -0400
@@ -112,9 +112,9 @@
self.blurb = blurb
self.peek = peek
self.extension = extension
- self.dbkey = dbkey
self.designation = designation
self._metadata = metadata or dict()
+ self.dbkey = dbkey
self.deleted = deleted
self.visible = visible
# Relationships
1
0
1
0
1
0
Thanks, Nate!
1
0