rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
+ '. Previous analysis results for this experiment will be deleted.',
+ '. If there is an existing analysis on the same factor(s), it will be deleted.',
doDifferential : function(id) { /* * Do an analysis interactively. */ var customize = function(analysisInfo) { var factors = analysisInfo.factors; var proposedAnalysis = analysisInfo.type; var canDoInteractions = (proposedAnalysis == 'TWIA') || factors.length > 2; /* * DifferentialExpressionAnalysisSetupWindow - to be refactored. */ var deasw = new Ext.Window({ modal : true, stateful : false, resizable : false, autoHeight : true, width : 300, plain : true, title : "Differential analysis settings", items : [{ xtype : 'form', autoHeight : true, items : [{ xtype : 'fieldset', title : "Select factor(s) to use", autoHeight : true, labelWidth : 200, id : 'diff-ex-analysis-customize-factors' }, { xtype : 'fieldset', labelWidth : 200, autoHeight : true, hidden : !canDoInteractions, items : [{ xtype : 'checkbox', id : 'diff-ex-analysis-customize-include-interactions-checkbox', fieldLabel : 'Include interactions if possible' }] }] }], buttons : [{ text : 'Proceed', id : 'diff-ex-customize-proceed-button', disabled : false, scope : this, handler : function(btn, text) { var includeInteractions = Ext .getCmp('diff-ex-analysis-customize-include-interactions-checkbox').getValue(); /* * Get the factors the user checked. See checkbox creation code below. */ var factorsToUseIds = []; if (factors) { for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } var checked = Ext.getCmp(f.id + '-factor-checkbox').getValue(); if (checked) { factorsToUseIds.push(f.id); } } } if (factorsToUseIds.length < 1) { Ext.Msg.alert("Invalid selection", "Please pick at least one factor."); return; } /* * Pass back the factors to be used, and the choice of whether interactions are to be * used. */ var callParams = []; callParams.push(id); callParams.push(factorsToUseIds); callParams.push(includeInteractions); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); deasw.relayEvents(k, ['done']); Ext.getBody().unmask(); k.on('done', function(payload) { this.fireEvent('differential', payload) }); }.createDelegate(this), errorHandler : function(error) { Ext.Msg.alert("Diff. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.runCustom.apply(this, callParams); deasw.close(); } }, { text : 'Cancel', handler : function() { deasw.close(); } }] }); deasw.doLayout(); /* * Create the checkboxes for user choice of factors. */ if (factors) { for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } Ext.getCmp('diff-ex-analysis-customize-factors').add(new Ext.form.Checkbox({ fieldLabel : f.name, labelWidth : 180, id : f.id + '-factor-checkbox', tooltip : f.name })); } } deasw.doLayout(); deasw.show(); }; /* * Callback for analysis type determination. This gets the type of analysis, if it can be determined. If the * type is non-null, then just ask the user for confirmation. If they say no, or the type is null, show them the * DifferentialExpressionAnalysisSetupWindow. */ var cb = function(analysisInfo) { if (analysisInfo.type) { var customizable = true; var analysisType = ''; if (analysisInfo.type === 'TWIA') { analysisType = 'Two-way ANOVA with interactions'; customizable = true; } else if (analysisInfo.type === 'TWA') { analysisType = 'Two-way ANOVA without interactions'; customizable = true; } else if (analysisInfo.type === 'TTEST') { analysisType = 'T-test (two-sample)'; } else if (analysisInfo.type === 'OSTTEST') { analysisType = 'T-test (one-sample)'; } else if (analysisInfo.type === 'OWA') { analysisType = 'One-way ANOVA'; } else { analysisType = 'Generic ANOVA/ANCOVA'; // TODO: allow choice of the factors customizable = true; } // ask for confirmation. var w = new Ext.Window({ autoCreate : true, resizable : false, constrain : true, constrainHeader : true, minimizable : false, maximizable : false, stateful : false, modal : true, shim : true, buttonAlign : "center", width : 400, height : 100, minHeight : 80, plain : true, footer : true, closable : true, title : 'Differential expression analysis', html : 'Please confirm. The analysis performed will be a ' + analysisType + '. Previous analysis results for this experiment will be deleted.', buttons : [{ text : 'Proceed', handler : function(btn, text) { var callParams = []; callParams.push(id); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); this.relayEvents(k, ['done']); Ext.getBody().unmask(); k.on('done', function(payload) { this.fireEvent('differential', payload); }); }.createDelegate(this), errorHandler : function(error) { Ext.Msg.alert("Diff. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.run.apply(this, callParams); w.close(); } }, { text : 'Cancel', handler : function() { w.close(); } }, { disabled : !customizable, hidden : !customizable, text : 'Customize', handler : function() { w.close(); customize(analysisInfo); } }], iconCls : Ext.MessageBox.QUESTION }); w.show(); } else { /* * System couldn't guess the analysis type, so force user to customize. */ customize(analysisInfo); } }; /* * Get the analysis type. */ var eh = function(error) { Ext.Msg.alert("There was an error", error); }; DifferentialExpressionAnalysisController.determineAnalysisType(id, { callback : cb, errorhandler : eh }); },
deasw.relayEvents(k, ['done']);
this.relayEvents(k, ['done']);
doDifferential : function(id) { /* * Do an analysis interactively. */ var customize = function(analysisInfo) { var factors = analysisInfo.factors; var proposedAnalysis = analysisInfo.type; var canDoInteractions = (proposedAnalysis == 'TWIA') || factors.length > 2; /* * DifferentialExpressionAnalysisSetupWindow - to be refactored. */ var deasw = new Ext.Window({ modal : true, stateful : false, resizable : false, autoHeight : true, width : 300, plain : true, title : "Differential analysis settings", items : [{ xtype : 'form', autoHeight : true, items : [{ xtype : 'fieldset', title : "Select factor(s) to use", autoHeight : true, labelWidth : 200, id : 'diff-ex-analysis-customize-factors' }, { xtype : 'fieldset', labelWidth : 200, autoHeight : true, hidden : !canDoInteractions, /* * FIXME hide this if we have more than 2 factors -- basically where * we're not going to bother supporting interactions. */ items : [{ xtype : 'checkbox', id : 'diff-ex-analysis-customize-include-interactions-checkbox', fieldLabel : 'Include interactions if possible' }] }] }], buttons : [{ text : 'Proceed', id : 'diff-ex-customize-proceed-button', disabled : false, scope : this, handler : function(btn, text) { var includeInteractions = Ext .getCmp('diff-ex-analysis-customize-include-interactions-checkbox').getValue(); /* * Get the factors the user checked. See checkbox creation code below. */ var factorsToUseIds = []; if (factors) { for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } var checked = Ext.getCmp(f.id + '-factor-checkbox').getValue(); if (checked) { factorsToUseIds.push(f.id); } } } if (factorsToUseIds.length < 1) { Ext.Msg.alert("Invalid selection", "Please pick at least one factor."); return; } /* * Pass back the factors to be used, and the choice of whether interactions are to be * used. */ var callParams = []; callParams.push(id); callParams.push(factorsToUseIds); callParams.push(includeInteractions); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); deasw.relayEvents(k, ['done']); Ext.getBody().unmask(); k.on('done', function(payload) { this.fireEvent('differential', payload) }); }.createDelegate(this), errorHandler : function(error) { Ext.Msg.alert("Differential exp. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.runCustom.apply(this, callParams); deasw.close(); } }, { text : 'Cancel', handler : function() { deasw.close(); } }] }); deasw.doLayout(); /* * Create the checkboxes for user choice of factors. */ if (factors) { var onlyOne = factors.length == 1; for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } Ext.getCmp('diff-ex-analysis-customize-factors').add(new Ext.form.Checkbox({ fieldLabel : f.name, labelWidth : 180, id : f.id + '-factor-checkbox', tooltip : f.name, checked : onlyOne })); } } /* * TODO: add radiobutton for subset, if there are more than one factor */ deasw.doLayout(); deasw.show(); }; /* * Callback for analysis type determination. This gets the type of analysis, if it can be determined. If the * type is non-null, then just ask the user for confirmation. If they say no, or the type is null, show them the * DifferentialExpressionAnalysisSetupWindow. */ var cb = function(analysisInfo) { if (analysisInfo.type) { var customizable = false; var analysisType = ''; if (analysisInfo.type === 'TWIA') { analysisType = 'Two-way ANOVA with interactions'; customizable = true; } else if (analysisInfo.type === 'TWA') { analysisType = 'Two-way ANOVA without interactions'; customizable = true; } else if (analysisInfo.type === 'TTEST') { analysisType = 'T-test (two-sample)'; } else if (analysisInfo.type === 'OSTTEST') { analysisType = 'T-test (one-sample)'; } else if (analysisInfo.type === 'OWA') { analysisType = 'One-way ANOVA'; } else { analysisType = 'Generic ANOVA/ANCOVA'; customizable = true; } // ask for confirmation. var w = new Ext.Window({ autoCreate : true, resizable : false, constrain : true, constrainHeader : true, minimizable : false, maximizable : false, stateful : false, modal : true, shim : true, buttonAlign : "center", width : 400, height : 130, minHeight : 80, plain : true, footer : true, closable : true, title : 'Differential expression analysis', html : 'Please confirm. The analysis performed will be a ' + analysisType + '. If there is an existing analysis on the same factor(s), it will be deleted.', buttons : [{ text : 'Proceed', handler : function(btn, text) { var callParams = []; callParams.push(id); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); this.relayEvents(k, ['done']); Ext.getBody().unmask(); k.on('done', function(payload) { this.fireEvent('differential', payload); }); }.createDelegate(this), errorHandler : function(error) { Ext.Msg.alert("Diff. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.run.apply(this, callParams); w.close(); } }, { text : 'Cancel', handler : function() { w.close(); } }, { disabled : !customizable, hidden : !customizable, text : 'Customize', handler : function() { w.close(); customize(analysisInfo); } }], iconCls : Ext.MessageBox.QUESTION }); w.show(); } else { /* * System couldn't guess the analysis type, so force user to customize. */ customize(analysisInfo); } }; /* * Get the analysis type. */ var eh = function(error) { Ext.Msg.alert("There was an error", error); }; DifferentialExpressionAnalysisController.determineAnalysisType(id, { callback : cb, errorhandler : eh }); },
var canDoInteractions = (proposedAnalysis == 'TWIA') || factors.length > 2; /* * DifferentialExpressionAnalysisSetupWindow - to be refactored.
var subsetRadios = []; subsetRadios.push(new Ext.form.Radio({ boxLabel : 'None', name : 'diff-ex-analyze-subset', id : 'no-factor-subset-radio', checked : true, listeners : { check : validateFactorsChosen.createDelegate(this, [factors]) } })); for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } subsetRadios.push(new Ext.form.Radio({ boxLabel : f.name, name : 'diff-ex-analyze-subset', id : f.id + '-factor-subset-radio', checked : false })); } /* * DifferentialExpressionAnalysisCustomization - only available if there is more than one factor. We should * refactor this code.
doDifferential : function(id) { var m = this; /* * Do an analysis interactively. */ var customize = function(analysisInfo) { var factors = analysisInfo.factors; var proposedAnalysis = analysisInfo.type; var canDoInteractions = (proposedAnalysis == 'TWIA') || factors.length > 2; /* * DifferentialExpressionAnalysisSetupWindow - to be refactored. */ var deasw = new Ext.Window({ modal : true, stateful : false, resizable : false, autoHeight : true, width : 300, plain : true, title : "Differential analysis settings", items : [{ xtype : 'form', autoHeight : true, items : [{ xtype : 'fieldset', title : "Select factor(s) to use", autoHeight : true, labelWidth : 200, id : 'diff-ex-analysis-customize-factors' }, { xtype : 'fieldset', labelWidth : 200, autoHeight : true, hidden : !canDoInteractions, /* * FIXME hide this if we have more than 2 factors -- basically where * we're not going to bother supporting interactions. */ items : [{ xtype : 'checkbox', id : 'diff-ex-analysis-customize-include-interactions-checkbox', fieldLabel : 'Include interactions if possible' }] }] }], buttons : [{ text : 'Proceed', id : 'diff-ex-customize-proceed-button', disabled : false, scope : this, handler : function(btn, text) { var includeInteractions = Ext .getCmp('diff-ex-analysis-customize-include-interactions-checkbox').getValue(); /* * Get the factors the user checked. See checkbox creation code below. */ var factorsToUseIds = []; if (factors) { for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } var checked = Ext.getCmp(f.id + '-factor-checkbox').getValue(); if (checked) { factorsToUseIds.push(f.id); } } } if (factorsToUseIds.length < 1) { Ext.Msg.alert("Invalid selection", "Please pick at least one factor."); return; } /* * Pass back the factors to be used, and the choice of whether interactions are to be * used. */ var callParams = []; callParams.push(id); callParams.push(factorsToUseIds); callParams.push(includeInteractions); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); m.relayEvents(k, ['done', 'fail']); Ext.getBody().unmask(); k.on('done', function(payload) { m.fireEvent('differential', payload) }); }.createDelegate(m), errorHandler : function(error) { Ext.Msg.alert("Differential exp. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.runCustom.apply(this, callParams); deasw.close(); } }, { text : 'Cancel', handler : function() { deasw.close(); } }] }); deasw.doLayout(); /* * Create the checkboxes for user choice of factors. */ if (factors) { var onlyOne = factors.length == 1; for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } Ext.getCmp('diff-ex-analysis-customize-factors').add(new Ext.form.Checkbox({ fieldLabel : f.name, labelWidth : 180, id : f.id + '-factor-checkbox', tooltip : f.name, checked : onlyOne })); } } /* * TODO: add radiobutton for subset, if there are more than one factor */ deasw.doLayout(); deasw.show(); }; /* * Callback for analysis type determination. This gets the type of analysis, if it can be determined. If the * type is non-null, then just ask the user for confirmation. If they say no, or the type is null, show them the * DifferentialExpressionAnalysisSetupWindow. */ var cb = function(analysisInfo) { if (analysisInfo.type) { var customizable = false; var analysisType = ''; if (analysisInfo.type === 'TWIA') { analysisType = 'Two-way ANOVA with interactions'; customizable = true; } else if (analysisInfo.type === 'TWA') { analysisType = 'Two-way ANOVA without interactions'; customizable = true; } else if (analysisInfo.type === 'TTEST') { analysisType = 'T-test (two-sample)'; } else if (analysisInfo.type === 'OSTTEST') { analysisType = 'T-test (one-sample)'; } else if (analysisInfo.type === 'OWA') { analysisType = 'One-way ANOVA'; } else { analysisType = 'Generic ANOVA/ANCOVA'; customizable = true; } // ask for confirmation. var w = new Ext.Window({ autoCreate : true, resizable : false, constrain : true, constrainHeader : true, minimizable : false, maximizable : false, stateful : false, modal : true, shim : true, buttonAlign : "center", width : 400, height : 130, minHeight : 80, plain : true, footer : true, closable : true, title : 'Differential expression analysis', html : 'Please confirm. The analysis performed will be a ' + analysisType + '. If there is an existing analysis on the same factor(s), it will be deleted.', buttons : [{ text : 'Proceed', handler : function(btn, text) { var callParams = []; callParams.push(id); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); this.relayEvents(k, ['done', 'fail']); Ext.getBody().unmask(); k.on('done', function(payload) { this.fireEvent('differential', payload); }); }.createDelegate(this), errorHandler : function(error) { Ext.Msg.alert("Diff. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.run.apply(this, callParams); w.close(); } }, { text : 'Cancel', handler : function() { w.close(); } }, { disabled : !customizable, hidden : !customizable, text : 'Customize', handler : function() { w.close(); customize(analysisInfo); } }], iconCls : Ext.MessageBox.QUESTION }); w.show(); } else { /* * System couldn't guess the analysis type, so force user to customize. */ customize(analysisInfo); } }; /* * Get the analysis type. */ var eh = function(error) { Ext.Msg.alert("There was an error", error); }; DifferentialExpressionAnalysisController.determineAnalysisType(id, { callback : cb, errorhandler : eh }); },
modal : true, stateful : false, resizable : false, autoHeight : true, width : 300, plain : true, title : "Differential analysis settings", items : [{ xtype : 'form', autoHeight : true, items : [{ xtype : 'fieldset', title : "Select factor(s) to use", autoHeight : true, labelWidth : 200, id : 'diff-ex-analysis-customize-factors' }, { xtype : 'fieldset', labelWidth : 200, autoHeight : true, hidden : !canDoInteractions, items : [{ xtype : 'checkbox', id : 'diff-ex-analysis-customize-include-interactions-checkbox', fieldLabel : 'Include interactions if possible' }] }] }], buttons : [{ text : 'Proceed', id : 'diff-ex-customize-proceed-button', disabled : false, scope : this, handler : function(btn, text) { var includeInteractions = Ext .getCmp('diff-ex-analysis-customize-include-interactions-checkbox').getValue(); var factorsToUseIds = []; if (factors) { for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } var checked = Ext.getCmp(f.id + '-factor-checkbox').getValue(); if (checked) { factorsToUseIds.push(f.id); } } } if (factorsToUseIds.length < 1) { Ext.Msg.alert("Invalid selection", "Please pick at least one factor."); return; } var callParams = []; callParams.push(id); callParams.push(factorsToUseIds); callParams.push(includeInteractions); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); m.relayEvents(k, ['done', 'fail']); Ext.getBody().unmask(); k.on('done', function(payload) { m.fireEvent('differential', payload) }); }.createDelegate(m), errorHandler : function(error) { Ext.Msg.alert("Differential exp. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.runCustom.apply(this, callParams); deasw.close(); } }, { text : 'Cancel', handler : function() { deasw.close(); } }] });
name : 'diff-customization-window', modal : true, stateful : false, resizable : false, autoHeight : true, width : 300, plain : true, title : "Differential analysis settings", items : [{ xtype : 'form', bodyBorder : false, autoHeight : true, items : [{ xtype : 'fieldset', title : "Select factor(s) to use", autoHeight : true, labelWidth : 200, id : 'diff-ex-analysis-customize-factors' }, { xtype : 'fieldset', title : "Optional: Select a subset factor", items : [{ xtype : 'radiogroup', columns : 1, allowBlank : true, autoHeight : true, id : 'diff-ex-analysis-subset-factors', items : subsetRadios, listeners : { change : validateFactorsChosen.createDelegate(this, [factors]) } }] }, { xtype : 'fieldset', labelWidth : 200, autoHeight : true, hidden : false, items : [{ xtype : 'checkbox', id : 'diff-ex-analysis-customize-include-interactions-checkbox', fieldLabel : 'Include interactions if possible' }] }] }], buttons : [{ text : "Help", id : 'diff-ex-customize-help-button', disabled : false, scope : this, handler : function() { Ext.Msg.show({ title : 'Processed vector analysis', msg : 'Choose which factors to include in the model. If you choose only one, the analysis will be a t-test or one-way-anova. If you choose two factors, you might be able to include interactions. If you choose three or more, ' + 'interactions will not be estimated.' + 'You can also choose to analyze different parts of the data sets separately, by splitting it up according to the factors listed. The analysis is then done independently on each subset.', buttons : Ext.Msg.OK, icon : Ext.MessageBox.INFO }); } }, { text : 'Proceed', id : 'diff-ex-customize-proceed-button', disabled : false, scope : this, handler : function(btn, text) { var includeInteractions = Ext .getCmp('diff-ex-analysis-customize-include-interactions-checkbox').getValue(); var factorsToUseIds = getFactorsToUseIds(factors); var subsetFactor = getSubsetFactorId(factors); if (factorsToUseIds.length < 1) { Ext.Msg.alert("Invalid selection", "Please pick at least one factor."); return; } if (subsetFactor !== null && factorsToUseIds.indexOf(subsetFactor) >= 0) { Ext.Msg.alert("Invalid selection", "You cannot subset on a factor included in the model."); return; } var callParams = []; callParams.push(id); callParams.push(factorsToUseIds); callParams.push(includeInteractions); callParams.push(subsetFactor) Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); m.relayEvents(k, ['done', 'fail']); Ext.getBody().unmask(); k.on('done', function(payload) { m.fireEvent('differential', payload) }); }.createDelegate(m), errorHandler : function(error) { Ext.Msg.alert("Differential exp. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.runCustom.apply(this, callParams); deasw.close(); } }, { text : 'Cancel', handler : function() { deasw.close(); } }] });
doDifferential : function(id) { var m = this; /* * Do an analysis interactively. */ var customize = function(analysisInfo) { var factors = analysisInfo.factors; var proposedAnalysis = analysisInfo.type; var canDoInteractions = (proposedAnalysis == 'TWIA') || factors.length > 2; /* * DifferentialExpressionAnalysisSetupWindow - to be refactored. */ var deasw = new Ext.Window({ modal : true, stateful : false, resizable : false, autoHeight : true, width : 300, plain : true, title : "Differential analysis settings", items : [{ xtype : 'form', autoHeight : true, items : [{ xtype : 'fieldset', title : "Select factor(s) to use", autoHeight : true, labelWidth : 200, id : 'diff-ex-analysis-customize-factors' }, { xtype : 'fieldset', labelWidth : 200, autoHeight : true, hidden : !canDoInteractions, /* * FIXME hide this if we have more than 2 factors -- basically where * we're not going to bother supporting interactions. */ items : [{ xtype : 'checkbox', id : 'diff-ex-analysis-customize-include-interactions-checkbox', fieldLabel : 'Include interactions if possible' }] }] }], buttons : [{ text : 'Proceed', id : 'diff-ex-customize-proceed-button', disabled : false, scope : this, handler : function(btn, text) { var includeInteractions = Ext .getCmp('diff-ex-analysis-customize-include-interactions-checkbox').getValue(); /* * Get the factors the user checked. See checkbox creation code below. */ var factorsToUseIds = []; if (factors) { for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } var checked = Ext.getCmp(f.id + '-factor-checkbox').getValue(); if (checked) { factorsToUseIds.push(f.id); } } } if (factorsToUseIds.length < 1) { Ext.Msg.alert("Invalid selection", "Please pick at least one factor."); return; } /* * Pass back the factors to be used, and the choice of whether interactions are to be * used. */ var callParams = []; callParams.push(id); callParams.push(factorsToUseIds); callParams.push(includeInteractions); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); m.relayEvents(k, ['done', 'fail']); Ext.getBody().unmask(); k.on('done', function(payload) { m.fireEvent('differential', payload) }); }.createDelegate(m), errorHandler : function(error) { Ext.Msg.alert("Differential exp. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.runCustom.apply(this, callParams); deasw.close(); } }, { text : 'Cancel', handler : function() { deasw.close(); } }] }); deasw.doLayout(); /* * Create the checkboxes for user choice of factors. */ if (factors) { var onlyOne = factors.length == 1; for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } Ext.getCmp('diff-ex-analysis-customize-factors').add(new Ext.form.Checkbox({ fieldLabel : f.name, labelWidth : 180, id : f.id + '-factor-checkbox', tooltip : f.name, checked : onlyOne })); } } /* * TODO: add radiobutton for subset, if there are more than one factor */ deasw.doLayout(); deasw.show(); }; /* * Callback for analysis type determination. This gets the type of analysis, if it can be determined. If the * type is non-null, then just ask the user for confirmation. If they say no, or the type is null, show them the * DifferentialExpressionAnalysisSetupWindow. */ var cb = function(analysisInfo) { if (analysisInfo.type) { var customizable = false; var analysisType = ''; if (analysisInfo.type === 'TWIA') { analysisType = 'Two-way ANOVA with interactions'; customizable = true; } else if (analysisInfo.type === 'TWA') { analysisType = 'Two-way ANOVA without interactions'; customizable = true; } else if (analysisInfo.type === 'TTEST') { analysisType = 'T-test (two-sample)'; } else if (analysisInfo.type === 'OSTTEST') { analysisType = 'T-test (one-sample)'; } else if (analysisInfo.type === 'OWA') { analysisType = 'One-way ANOVA'; } else { analysisType = 'Generic ANOVA/ANCOVA'; customizable = true; } // ask for confirmation. var w = new Ext.Window({ autoCreate : true, resizable : false, constrain : true, constrainHeader : true, minimizable : false, maximizable : false, stateful : false, modal : true, shim : true, buttonAlign : "center", width : 400, height : 130, minHeight : 80, plain : true, footer : true, closable : true, title : 'Differential expression analysis', html : 'Please confirm. The analysis performed will be a ' + analysisType + '. If there is an existing analysis on the same factor(s), it will be deleted.', buttons : [{ text : 'Proceed', handler : function(btn, text) { var callParams = []; callParams.push(id); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); this.relayEvents(k, ['done', 'fail']); Ext.getBody().unmask(); k.on('done', function(payload) { this.fireEvent('differential', payload); }); }.createDelegate(this), errorHandler : function(error) { Ext.Msg.alert("Diff. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.run.apply(this, callParams); w.close(); } }, { text : 'Cancel', handler : function() { w.close(); } }, { disabled : !customizable, hidden : !customizable, text : 'Customize', handler : function() { w.close(); customize(analysisInfo); } }], iconCls : Ext.MessageBox.QUESTION }); w.show(); } else { /* * System couldn't guess the analysis type, so force user to customize. */ customize(analysisInfo); } }; /* * Get the analysis type. */ var eh = function(error) { Ext.Msg.alert("There was an error", error); }; DifferentialExpressionAnalysisController.determineAnalysisType(id, { callback : cb, errorhandler : eh }); },
* Create the checkboxes for user choice of factors.
* Create the checkboxes for user choice of factors. We assume there is more than one.
doDifferential : function(id) { var m = this; /* * Do an analysis interactively. */ var customize = function(analysisInfo) { var factors = analysisInfo.factors; var proposedAnalysis = analysisInfo.type; var canDoInteractions = (proposedAnalysis == 'TWIA') || factors.length > 2; /* * DifferentialExpressionAnalysisSetupWindow - to be refactored. */ var deasw = new Ext.Window({ modal : true, stateful : false, resizable : false, autoHeight : true, width : 300, plain : true, title : "Differential analysis settings", items : [{ xtype : 'form', autoHeight : true, items : [{ xtype : 'fieldset', title : "Select factor(s) to use", autoHeight : true, labelWidth : 200, id : 'diff-ex-analysis-customize-factors' }, { xtype : 'fieldset', labelWidth : 200, autoHeight : true, hidden : !canDoInteractions, /* * FIXME hide this if we have more than 2 factors -- basically where * we're not going to bother supporting interactions. */ items : [{ xtype : 'checkbox', id : 'diff-ex-analysis-customize-include-interactions-checkbox', fieldLabel : 'Include interactions if possible' }] }] }], buttons : [{ text : 'Proceed', id : 'diff-ex-customize-proceed-button', disabled : false, scope : this, handler : function(btn, text) { var includeInteractions = Ext .getCmp('diff-ex-analysis-customize-include-interactions-checkbox').getValue(); /* * Get the factors the user checked. See checkbox creation code below. */ var factorsToUseIds = []; if (factors) { for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } var checked = Ext.getCmp(f.id + '-factor-checkbox').getValue(); if (checked) { factorsToUseIds.push(f.id); } } } if (factorsToUseIds.length < 1) { Ext.Msg.alert("Invalid selection", "Please pick at least one factor."); return; } /* * Pass back the factors to be used, and the choice of whether interactions are to be * used. */ var callParams = []; callParams.push(id); callParams.push(factorsToUseIds); callParams.push(includeInteractions); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); m.relayEvents(k, ['done', 'fail']); Ext.getBody().unmask(); k.on('done', function(payload) { m.fireEvent('differential', payload) }); }.createDelegate(m), errorHandler : function(error) { Ext.Msg.alert("Differential exp. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.runCustom.apply(this, callParams); deasw.close(); } }, { text : 'Cancel', handler : function() { deasw.close(); } }] }); deasw.doLayout(); /* * Create the checkboxes for user choice of factors. */ if (factors) { var onlyOne = factors.length == 1; for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } Ext.getCmp('diff-ex-analysis-customize-factors').add(new Ext.form.Checkbox({ fieldLabel : f.name, labelWidth : 180, id : f.id + '-factor-checkbox', tooltip : f.name, checked : onlyOne })); } } /* * TODO: add radiobutton for subset, if there are more than one factor */ deasw.doLayout(); deasw.show(); }; /* * Callback for analysis type determination. This gets the type of analysis, if it can be determined. If the * type is non-null, then just ask the user for confirmation. If they say no, or the type is null, show them the * DifferentialExpressionAnalysisSetupWindow. */ var cb = function(analysisInfo) { if (analysisInfo.type) { var customizable = false; var analysisType = ''; if (analysisInfo.type === 'TWIA') { analysisType = 'Two-way ANOVA with interactions'; customizable = true; } else if (analysisInfo.type === 'TWA') { analysisType = 'Two-way ANOVA without interactions'; customizable = true; } else if (analysisInfo.type === 'TTEST') { analysisType = 'T-test (two-sample)'; } else if (analysisInfo.type === 'OSTTEST') { analysisType = 'T-test (one-sample)'; } else if (analysisInfo.type === 'OWA') { analysisType = 'One-way ANOVA'; } else { analysisType = 'Generic ANOVA/ANCOVA'; customizable = true; } // ask for confirmation. var w = new Ext.Window({ autoCreate : true, resizable : false, constrain : true, constrainHeader : true, minimizable : false, maximizable : false, stateful : false, modal : true, shim : true, buttonAlign : "center", width : 400, height : 130, minHeight : 80, plain : true, footer : true, closable : true, title : 'Differential expression analysis', html : 'Please confirm. The analysis performed will be a ' + analysisType + '. If there is an existing analysis on the same factor(s), it will be deleted.', buttons : [{ text : 'Proceed', handler : function(btn, text) { var callParams = []; callParams.push(id); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); this.relayEvents(k, ['done', 'fail']); Ext.getBody().unmask(); k.on('done', function(payload) { this.fireEvent('differential', payload); }); }.createDelegate(this), errorHandler : function(error) { Ext.Msg.alert("Diff. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.run.apply(this, callParams); w.close(); } }, { text : 'Cancel', handler : function() { w.close(); } }, { disabled : !customizable, hidden : !customizable, text : 'Customize', handler : function() { w.close(); customize(analysisInfo); } }], iconCls : Ext.MessageBox.QUESTION }); w.show(); } else { /* * System couldn't guess the analysis type, so force user to customize. */ customize(analysisInfo); } }; /* * Get the analysis type. */ var eh = function(error) { Ext.Msg.alert("There was an error", error); }; DifferentialExpressionAnalysisController.determineAnalysisType(id, { callback : cb, errorhandler : eh }); },
var onlyOne = factors.length == 1;
doDifferential : function(id) { var m = this; /* * Do an analysis interactively. */ var customize = function(analysisInfo) { var factors = analysisInfo.factors; var proposedAnalysis = analysisInfo.type; var canDoInteractions = (proposedAnalysis == 'TWIA') || factors.length > 2; /* * DifferentialExpressionAnalysisSetupWindow - to be refactored. */ var deasw = new Ext.Window({ modal : true, stateful : false, resizable : false, autoHeight : true, width : 300, plain : true, title : "Differential analysis settings", items : [{ xtype : 'form', autoHeight : true, items : [{ xtype : 'fieldset', title : "Select factor(s) to use", autoHeight : true, labelWidth : 200, id : 'diff-ex-analysis-customize-factors' }, { xtype : 'fieldset', labelWidth : 200, autoHeight : true, hidden : !canDoInteractions, /* * FIXME hide this if we have more than 2 factors -- basically where * we're not going to bother supporting interactions. */ items : [{ xtype : 'checkbox', id : 'diff-ex-analysis-customize-include-interactions-checkbox', fieldLabel : 'Include interactions if possible' }] }] }], buttons : [{ text : 'Proceed', id : 'diff-ex-customize-proceed-button', disabled : false, scope : this, handler : function(btn, text) { var includeInteractions = Ext .getCmp('diff-ex-analysis-customize-include-interactions-checkbox').getValue(); /* * Get the factors the user checked. See checkbox creation code below. */ var factorsToUseIds = []; if (factors) { for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } var checked = Ext.getCmp(f.id + '-factor-checkbox').getValue(); if (checked) { factorsToUseIds.push(f.id); } } } if (factorsToUseIds.length < 1) { Ext.Msg.alert("Invalid selection", "Please pick at least one factor."); return; } /* * Pass back the factors to be used, and the choice of whether interactions are to be * used. */ var callParams = []; callParams.push(id); callParams.push(factorsToUseIds); callParams.push(includeInteractions); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); m.relayEvents(k, ['done', 'fail']); Ext.getBody().unmask(); k.on('done', function(payload) { m.fireEvent('differential', payload) }); }.createDelegate(m), errorHandler : function(error) { Ext.Msg.alert("Differential exp. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.runCustom.apply(this, callParams); deasw.close(); } }, { text : 'Cancel', handler : function() { deasw.close(); } }] }); deasw.doLayout(); /* * Create the checkboxes for user choice of factors. */ if (factors) { var onlyOne = factors.length == 1; for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } Ext.getCmp('diff-ex-analysis-customize-factors').add(new Ext.form.Checkbox({ fieldLabel : f.name, labelWidth : 180, id : f.id + '-factor-checkbox', tooltip : f.name, checked : onlyOne })); } } /* * TODO: add radiobutton for subset, if there are more than one factor */ deasw.doLayout(); deasw.show(); }; /* * Callback for analysis type determination. This gets the type of analysis, if it can be determined. If the * type is non-null, then just ask the user for confirmation. If they say no, or the type is null, show them the * DifferentialExpressionAnalysisSetupWindow. */ var cb = function(analysisInfo) { if (analysisInfo.type) { var customizable = false; var analysisType = ''; if (analysisInfo.type === 'TWIA') { analysisType = 'Two-way ANOVA with interactions'; customizable = true; } else if (analysisInfo.type === 'TWA') { analysisType = 'Two-way ANOVA without interactions'; customizable = true; } else if (analysisInfo.type === 'TTEST') { analysisType = 'T-test (two-sample)'; } else if (analysisInfo.type === 'OSTTEST') { analysisType = 'T-test (one-sample)'; } else if (analysisInfo.type === 'OWA') { analysisType = 'One-way ANOVA'; } else { analysisType = 'Generic ANOVA/ANCOVA'; customizable = true; } // ask for confirmation. var w = new Ext.Window({ autoCreate : true, resizable : false, constrain : true, constrainHeader : true, minimizable : false, maximizable : false, stateful : false, modal : true, shim : true, buttonAlign : "center", width : 400, height : 130, minHeight : 80, plain : true, footer : true, closable : true, title : 'Differential expression analysis', html : 'Please confirm. The analysis performed will be a ' + analysisType + '. If there is an existing analysis on the same factor(s), it will be deleted.', buttons : [{ text : 'Proceed', handler : function(btn, text) { var callParams = []; callParams.push(id); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); this.relayEvents(k, ['done', 'fail']); Ext.getBody().unmask(); k.on('done', function(payload) { this.fireEvent('differential', payload); }); }.createDelegate(this), errorHandler : function(error) { Ext.Msg.alert("Diff. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.run.apply(this, callParams); w.close(); } }, { text : 'Cancel', handler : function() { w.close(); } }, { disabled : !customizable, hidden : !customizable, text : 'Customize', handler : function() { w.close(); customize(analysisInfo); } }], iconCls : Ext.MessageBox.QUESTION }); w.show(); } else { /* * System couldn't guess the analysis type, so force user to customize. */ customize(analysisInfo); } }; /* * Get the analysis type. */ var eh = function(error) { Ext.Msg.alert("There was an error", error); }; DifferentialExpressionAnalysisController.determineAnalysisType(id, { callback : cb, errorhandler : eh }); },
checked : onlyOne
checked : false, listeners : { check : validateFactorsChosen.createDelegate(this, [factors]) }
doDifferential : function(id) { var m = this; /* * Do an analysis interactively. */ var customize = function(analysisInfo) { var factors = analysisInfo.factors; var proposedAnalysis = analysisInfo.type; var canDoInteractions = (proposedAnalysis == 'TWIA') || factors.length > 2; /* * DifferentialExpressionAnalysisSetupWindow - to be refactored. */ var deasw = new Ext.Window({ modal : true, stateful : false, resizable : false, autoHeight : true, width : 300, plain : true, title : "Differential analysis settings", items : [{ xtype : 'form', autoHeight : true, items : [{ xtype : 'fieldset', title : "Select factor(s) to use", autoHeight : true, labelWidth : 200, id : 'diff-ex-analysis-customize-factors' }, { xtype : 'fieldset', labelWidth : 200, autoHeight : true, hidden : !canDoInteractions, /* * FIXME hide this if we have more than 2 factors -- basically where * we're not going to bother supporting interactions. */ items : [{ xtype : 'checkbox', id : 'diff-ex-analysis-customize-include-interactions-checkbox', fieldLabel : 'Include interactions if possible' }] }] }], buttons : [{ text : 'Proceed', id : 'diff-ex-customize-proceed-button', disabled : false, scope : this, handler : function(btn, text) { var includeInteractions = Ext .getCmp('diff-ex-analysis-customize-include-interactions-checkbox').getValue(); /* * Get the factors the user checked. See checkbox creation code below. */ var factorsToUseIds = []; if (factors) { for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } var checked = Ext.getCmp(f.id + '-factor-checkbox').getValue(); if (checked) { factorsToUseIds.push(f.id); } } } if (factorsToUseIds.length < 1) { Ext.Msg.alert("Invalid selection", "Please pick at least one factor."); return; } /* * Pass back the factors to be used, and the choice of whether interactions are to be * used. */ var callParams = []; callParams.push(id); callParams.push(factorsToUseIds); callParams.push(includeInteractions); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); m.relayEvents(k, ['done', 'fail']); Ext.getBody().unmask(); k.on('done', function(payload) { m.fireEvent('differential', payload) }); }.createDelegate(m), errorHandler : function(error) { Ext.Msg.alert("Differential exp. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.runCustom.apply(this, callParams); deasw.close(); } }, { text : 'Cancel', handler : function() { deasw.close(); } }] }); deasw.doLayout(); /* * Create the checkboxes for user choice of factors. */ if (factors) { var onlyOne = factors.length == 1; for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } Ext.getCmp('diff-ex-analysis-customize-factors').add(new Ext.form.Checkbox({ fieldLabel : f.name, labelWidth : 180, id : f.id + '-factor-checkbox', tooltip : f.name, checked : onlyOne })); } } /* * TODO: add radiobutton for subset, if there are more than one factor */ deasw.doLayout(); deasw.show(); }; /* * Callback for analysis type determination. This gets the type of analysis, if it can be determined. If the * type is non-null, then just ask the user for confirmation. If they say no, or the type is null, show them the * DifferentialExpressionAnalysisSetupWindow. */ var cb = function(analysisInfo) { if (analysisInfo.type) { var customizable = false; var analysisType = ''; if (analysisInfo.type === 'TWIA') { analysisType = 'Two-way ANOVA with interactions'; customizable = true; } else if (analysisInfo.type === 'TWA') { analysisType = 'Two-way ANOVA without interactions'; customizable = true; } else if (analysisInfo.type === 'TTEST') { analysisType = 'T-test (two-sample)'; } else if (analysisInfo.type === 'OSTTEST') { analysisType = 'T-test (one-sample)'; } else if (analysisInfo.type === 'OWA') { analysisType = 'One-way ANOVA'; } else { analysisType = 'Generic ANOVA/ANCOVA'; customizable = true; } // ask for confirmation. var w = new Ext.Window({ autoCreate : true, resizable : false, constrain : true, constrainHeader : true, minimizable : false, maximizable : false, stateful : false, modal : true, shim : true, buttonAlign : "center", width : 400, height : 130, minHeight : 80, plain : true, footer : true, closable : true, title : 'Differential expression analysis', html : 'Please confirm. The analysis performed will be a ' + analysisType + '. If there is an existing analysis on the same factor(s), it will be deleted.', buttons : [{ text : 'Proceed', handler : function(btn, text) { var callParams = []; callParams.push(id); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); this.relayEvents(k, ['done', 'fail']); Ext.getBody().unmask(); k.on('done', function(payload) { this.fireEvent('differential', payload); }); }.createDelegate(this), errorHandler : function(error) { Ext.Msg.alert("Diff. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.run.apply(this, callParams); w.close(); } }, { text : 'Cancel', handler : function() { w.close(); } }, { disabled : !customizable, hidden : !customizable, text : 'Customize', handler : function() { w.close(); customize(analysisInfo); } }], iconCls : Ext.MessageBox.QUESTION }); w.show(); } else { /* * System couldn't guess the analysis type, so force user to customize. */ customize(analysisInfo); } }; /* * Get the analysis type. */ var eh = function(error) { Ext.Msg.alert("There was an error", error); }; DifferentialExpressionAnalysisController.determineAnalysisType(id, { callback : cb, errorhandler : eh }); },
/*
var getFactorsToUseIds = function(factors) { var factorsToUseIds = []; for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } var checked = Ext.getCmp(f.id + '-factor-checkbox').getValue(); if (checked) { factorsToUseIds.push(f.id); } } return factorsToUseIds; }; var getSubsetFactorId = function(factors) { var subsetFactor = null; for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } var checked = Ext.getCmp(f.id + '-factor-subset-radio').getValue(); if (checked) { subsetFactor = f.id; break; } } return subsetFactor; }; /**
doDifferential : function(id) { var m = this; /* * Do an analysis interactively. */ var customize = function(analysisInfo) { var factors = analysisInfo.factors; var proposedAnalysis = analysisInfo.type; var canDoInteractions = (proposedAnalysis == 'TWIA') || factors.length > 2; /* * DifferentialExpressionAnalysisSetupWindow - to be refactored. */ var deasw = new Ext.Window({ modal : true, stateful : false, resizable : false, autoHeight : true, width : 300, plain : true, title : "Differential analysis settings", items : [{ xtype : 'form', autoHeight : true, items : [{ xtype : 'fieldset', title : "Select factor(s) to use", autoHeight : true, labelWidth : 200, id : 'diff-ex-analysis-customize-factors' }, { xtype : 'fieldset', labelWidth : 200, autoHeight : true, hidden : !canDoInteractions, /* * FIXME hide this if we have more than 2 factors -- basically where * we're not going to bother supporting interactions. */ items : [{ xtype : 'checkbox', id : 'diff-ex-analysis-customize-include-interactions-checkbox', fieldLabel : 'Include interactions if possible' }] }] }], buttons : [{ text : 'Proceed', id : 'diff-ex-customize-proceed-button', disabled : false, scope : this, handler : function(btn, text) { var includeInteractions = Ext .getCmp('diff-ex-analysis-customize-include-interactions-checkbox').getValue(); /* * Get the factors the user checked. See checkbox creation code below. */ var factorsToUseIds = []; if (factors) { for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } var checked = Ext.getCmp(f.id + '-factor-checkbox').getValue(); if (checked) { factorsToUseIds.push(f.id); } } } if (factorsToUseIds.length < 1) { Ext.Msg.alert("Invalid selection", "Please pick at least one factor."); return; } /* * Pass back the factors to be used, and the choice of whether interactions are to be * used. */ var callParams = []; callParams.push(id); callParams.push(factorsToUseIds); callParams.push(includeInteractions); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); m.relayEvents(k, ['done', 'fail']); Ext.getBody().unmask(); k.on('done', function(payload) { m.fireEvent('differential', payload) }); }.createDelegate(m), errorHandler : function(error) { Ext.Msg.alert("Differential exp. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.runCustom.apply(this, callParams); deasw.close(); } }, { text : 'Cancel', handler : function() { deasw.close(); } }] }); deasw.doLayout(); /* * Create the checkboxes for user choice of factors. */ if (factors) { var onlyOne = factors.length == 1; for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } Ext.getCmp('diff-ex-analysis-customize-factors').add(new Ext.form.Checkbox({ fieldLabel : f.name, labelWidth : 180, id : f.id + '-factor-checkbox', tooltip : f.name, checked : onlyOne })); } } /* * TODO: add radiobutton for subset, if there are more than one factor */ deasw.doLayout(); deasw.show(); }; /* * Callback for analysis type determination. This gets the type of analysis, if it can be determined. If the * type is non-null, then just ask the user for confirmation. If they say no, or the type is null, show them the * DifferentialExpressionAnalysisSetupWindow. */ var cb = function(analysisInfo) { if (analysisInfo.type) { var customizable = false; var analysisType = ''; if (analysisInfo.type === 'TWIA') { analysisType = 'Two-way ANOVA with interactions'; customizable = true; } else if (analysisInfo.type === 'TWA') { analysisType = 'Two-way ANOVA without interactions'; customizable = true; } else if (analysisInfo.type === 'TTEST') { analysisType = 'T-test (two-sample)'; } else if (analysisInfo.type === 'OSTTEST') { analysisType = 'T-test (one-sample)'; } else if (analysisInfo.type === 'OWA') { analysisType = 'One-way ANOVA'; } else { analysisType = 'Generic ANOVA/ANCOVA'; customizable = true; } // ask for confirmation. var w = new Ext.Window({ autoCreate : true, resizable : false, constrain : true, constrainHeader : true, minimizable : false, maximizable : false, stateful : false, modal : true, shim : true, buttonAlign : "center", width : 400, height : 130, minHeight : 80, plain : true, footer : true, closable : true, title : 'Differential expression analysis', html : 'Please confirm. The analysis performed will be a ' + analysisType + '. If there is an existing analysis on the same factor(s), it will be deleted.', buttons : [{ text : 'Proceed', handler : function(btn, text) { var callParams = []; callParams.push(id); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); this.relayEvents(k, ['done', 'fail']); Ext.getBody().unmask(); k.on('done', function(payload) { this.fireEvent('differential', payload); }); }.createDelegate(this), errorHandler : function(error) { Ext.Msg.alert("Diff. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.run.apply(this, callParams); w.close(); } }, { text : 'Cancel', handler : function() { w.close(); } }, { disabled : !customizable, hidden : !customizable, text : 'Customize', handler : function() { w.close(); customize(analysisInfo); } }], iconCls : Ext.MessageBox.QUESTION }); w.show(); } else { /* * System couldn't guess the analysis type, so force user to customize. */ customize(analysisInfo); } }; /* * Get the analysis type. */ var eh = function(error) { Ext.Msg.alert("There was an error", error); }; DifferentialExpressionAnalysisController.determineAnalysisType(id, { callback : cb, errorhandler : eh }); },
analysisType = 'T-test';
analysisType = 'T-test (two-sample)'; } else if (analysisInfo.type === 'OSTTEST') { analysisType = 'T-test (one-sample)';
doDifferential : function(id) { /* * Do an analysis interactively. */ var customize = function(analysisInfo) { var factors = analysisInfo.factors; var proposedAnalysis = analysisInfo.type; var canDoInteractions = (proposedAnalysis == 'TWIA') || factors.length > 2; /* * DifferentialExpressionAnalysisSetupWindow - to be refactored. */ var deasw = new Ext.Window({ modal : true, stateful : false, resizable : false, autoHeight : true, width : 300, plain : true, title : "Differential analysis settings", items : [{ xtype : 'form', autoHeight : true, items : [{ xtype : 'fieldset', title : "Select up to 2 factor(s) to use", autoHeight : true, labelWidth : 200, id : 'diff-ex-analysis-customize-factors' }, { xtype : 'fieldset', labelWidth : 200, autoHeight : true, hidden : !canDoInteractions, items : [{ xtype : 'checkbox', id : 'diff-ex-analysis-customize-include-interactions-checkbox', fieldLabel : 'Include interactions if possible' }] }] }], buttons : [{ text : 'Proceed', id : 'diff-ex-customize-proceed-button', disabled : false, scope : this, handler : function(btn, text) { var includeInteractions = Ext .getCmp('diff-ex-analysis-customize-include-interactions-checkbox').getValue(); /* * Get the factors the user checked. See checkbox creation code below. */ var factorsToUseIds = []; if (factors) { for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } var checked = Ext.getCmp(f.id + '-factor-checkbox').getValue(); if (checked) { factorsToUseIds.push(f.id); } } } if (factorsToUseIds.length < 1 || factorsToUseIds.length > 2) { Ext.Msg.alert("Invalid selection", "Please pick 1 or 2 factors."); return; } /* * Pass back the factors to be used, and the choice of whether interactions are to be * used. */ var callParams = []; callParams.push(id); callParams.push(factorsToUseIds); callParams.push(includeInteractions); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); deasw.relayEvents(k, ['done']); Ext.getBody().unmask(); k.on('done', function(payload) { this.fireEvent('differential', payload) }); }.createDelegate(this), errorHandler : function(error) { Ext.Msg.alert("Diff. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.runCustom.apply(this, callParams); deasw.close(); } }, { text : 'Cancel', handler : function() { deasw.close(); } }] }); deasw.doLayout(); /* * Create the checkboxes for user choice of factors. */ if (factors) { for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } Ext.getCmp('diff-ex-analysis-customize-factors').add(new Ext.form.Checkbox({ fieldLabel : f.name, labelWidth : 180, id : f.id + '-factor-checkbox', tooltip : f.name })); } } deasw.doLayout(); deasw.show(); }; /* * Callback for analysis type determination. This gets the type of analysis, if it can be determined. If the * type is non-null, then just ask the user for confirmation. If they say no, or the type is null, show them the * DifferentialExpressionAnalysisSetupWindow. */ var cb = function(analysisInfo) { if (analysisInfo.type) { var customizable = false; var analysisType = ''; if (analysisInfo.type === 'TWIA') { analysisType = 'Two-way ANOVA with interactions'; customizable = true; } else if (analysisInfo.type === 'TWA') { analysisType = 'Two-way ANOVA without interactions'; customizable = true; } else if (analysisInfo.type === 'TTEST') { analysisType = 'T-test'; } else if (analysisInfo.type === 'OWA') { analysisType = 'One-way ANOVA'; } // ask for confirmation. var w = new Ext.Window({ autoCreate : true, resizable : false, constrain : true, constrainHeader : true, minimizable : false, maximizable : false, stateful : false, modal : true, shim : true, buttonAlign : "center", width : 400, height : 100, minHeight : 80, plain : true, footer : true, closable : true, title : 'Differential expression analysis', html : 'Please confirm. The analysis performed will be a ' + analysisType + '. Previous analysis results for this experiment will be deleted.', buttons : [{ text : 'Proceed', handler : function(btn, text) { var callParams = []; callParams.push(id); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); this.relayEvents(k, ['done']); Ext.getBody().unmask(); k.on('done', function(payload) { this.fireEvent('differential', payload); }); }.createDelegate(this), errorHandler : function(error) { Ext.Msg.alert("Diff. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.run.apply(this, callParams); w.close(); } }, { text : 'Cancel', handler : function() { w.close(); } }, { disabled : !customizable, hidden : !customizable, text : 'Customize', handler : function() { w.close(); customize(analysisInfo); } }], iconCls : Ext.MessageBox.QUESTION }); w.show(); } else { /* * System couldn't guess the analysis type, so force user to customize. */ customize(analysisInfo); } }; /* * Get the analysis type. */ var eh = function(error) { Ext.Msg.alert("There was an error", error); }; DifferentialExpressionAnalysisController.determineAnalysisType(id, { callback : cb, errorhandler : eh }); },
this.relayEvents(k, ['done']);
m.relayEvents(k, ['done', 'fail']);
doDifferential : function(id) { /* * Do an analysis interactively. */ var customize = function(analysisInfo) { var factors = analysisInfo.factors; var proposedAnalysis = analysisInfo.type; var canDoInteractions = (proposedAnalysis == 'TWIA') || factors.length > 2; /* * DifferentialExpressionAnalysisSetupWindow - to be refactored. */ var deasw = new Ext.Window({ modal : true, stateful : false, resizable : false, autoHeight : true, width : 300, plain : true, title : "Differential analysis settings", items : [{ xtype : 'form', autoHeight : true, items : [{ xtype : 'fieldset', title : "Select factor(s) to use", autoHeight : true, labelWidth : 200, id : 'diff-ex-analysis-customize-factors' }, { xtype : 'fieldset', labelWidth : 200, autoHeight : true, hidden : !canDoInteractions, /* * FIXME hide this if we have more than 2 factors -- basically where * we're not going to bother supporting interactions. */ items : [{ xtype : 'checkbox', id : 'diff-ex-analysis-customize-include-interactions-checkbox', fieldLabel : 'Include interactions if possible' }] }] }], buttons : [{ text : 'Proceed', id : 'diff-ex-customize-proceed-button', disabled : false, scope : this, handler : function(btn, text) { var includeInteractions = Ext .getCmp('diff-ex-analysis-customize-include-interactions-checkbox').getValue(); /* * Get the factors the user checked. See checkbox creation code below. */ var factorsToUseIds = []; if (factors) { for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } var checked = Ext.getCmp(f.id + '-factor-checkbox').getValue(); if (checked) { factorsToUseIds.push(f.id); } } } if (factorsToUseIds.length < 1) { Ext.Msg.alert("Invalid selection", "Please pick at least one factor."); return; } /* * Pass back the factors to be used, and the choice of whether interactions are to be * used. */ var callParams = []; callParams.push(id); callParams.push(factorsToUseIds); callParams.push(includeInteractions); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); this.relayEvents(k, ['done']); Ext.getBody().unmask(); k.on('done', function(payload) { this.fireEvent('differential', payload) }); }.createDelegate(this), errorHandler : function(error) { Ext.Msg.alert("Differential exp. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.runCustom.apply(this, callParams); deasw.close(); } }, { text : 'Cancel', handler : function() { deasw.close(); } }] }); deasw.doLayout(); /* * Create the checkboxes for user choice of factors. */ if (factors) { var onlyOne = factors.length == 1; for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } Ext.getCmp('diff-ex-analysis-customize-factors').add(new Ext.form.Checkbox({ fieldLabel : f.name, labelWidth : 180, id : f.id + '-factor-checkbox', tooltip : f.name, checked : onlyOne })); } } /* * TODO: add radiobutton for subset, if there are more than one factor */ deasw.doLayout(); deasw.show(); }; /* * Callback for analysis type determination. This gets the type of analysis, if it can be determined. If the * type is non-null, then just ask the user for confirmation. If they say no, or the type is null, show them the * DifferentialExpressionAnalysisSetupWindow. */ var cb = function(analysisInfo) { if (analysisInfo.type) { var customizable = false; var analysisType = ''; if (analysisInfo.type === 'TWIA') { analysisType = 'Two-way ANOVA with interactions'; customizable = true; } else if (analysisInfo.type === 'TWA') { analysisType = 'Two-way ANOVA without interactions'; customizable = true; } else if (analysisInfo.type === 'TTEST') { analysisType = 'T-test (two-sample)'; } else if (analysisInfo.type === 'OSTTEST') { analysisType = 'T-test (one-sample)'; } else if (analysisInfo.type === 'OWA') { analysisType = 'One-way ANOVA'; } else { analysisType = 'Generic ANOVA/ANCOVA'; customizable = true; } // ask for confirmation. var w = new Ext.Window({ autoCreate : true, resizable : false, constrain : true, constrainHeader : true, minimizable : false, maximizable : false, stateful : false, modal : true, shim : true, buttonAlign : "center", width : 400, height : 130, minHeight : 80, plain : true, footer : true, closable : true, title : 'Differential expression analysis', html : 'Please confirm. The analysis performed will be a ' + analysisType + '. If there is an existing analysis on the same factor(s), it will be deleted.', buttons : [{ text : 'Proceed', handler : function(btn, text) { var callParams = []; callParams.push(id); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); this.relayEvents(k, ['done']); Ext.getBody().unmask(); k.on('done', function(payload) { this.fireEvent('differential', payload); }); }.createDelegate(this), errorHandler : function(error) { Ext.Msg.alert("Diff. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.run.apply(this, callParams); w.close(); } }, { text : 'Cancel', handler : function() { w.close(); } }, { disabled : !customizable, hidden : !customizable, text : 'Customize', handler : function() { w.close(); customize(analysisInfo); } }], iconCls : Ext.MessageBox.QUESTION }); w.show(); } else { /* * System couldn't guess the analysis type, so force user to customize. */ customize(analysisInfo); } }; /* * Get the analysis type. */ var eh = function(error) { Ext.Msg.alert("There was an error", error); }; DifferentialExpressionAnalysisController.determineAnalysisType(id, { callback : cb, errorhandler : eh }); },
this.fireEvent('differential', payload)
m.fireEvent('differential', payload)
doDifferential : function(id) { /* * Do an analysis interactively. */ var customize = function(analysisInfo) { var factors = analysisInfo.factors; var proposedAnalysis = analysisInfo.type; var canDoInteractions = (proposedAnalysis == 'TWIA') || factors.length > 2; /* * DifferentialExpressionAnalysisSetupWindow - to be refactored. */ var deasw = new Ext.Window({ modal : true, stateful : false, resizable : false, autoHeight : true, width : 300, plain : true, title : "Differential analysis settings", items : [{ xtype : 'form', autoHeight : true, items : [{ xtype : 'fieldset', title : "Select factor(s) to use", autoHeight : true, labelWidth : 200, id : 'diff-ex-analysis-customize-factors' }, { xtype : 'fieldset', labelWidth : 200, autoHeight : true, hidden : !canDoInteractions, /* * FIXME hide this if we have more than 2 factors -- basically where * we're not going to bother supporting interactions. */ items : [{ xtype : 'checkbox', id : 'diff-ex-analysis-customize-include-interactions-checkbox', fieldLabel : 'Include interactions if possible' }] }] }], buttons : [{ text : 'Proceed', id : 'diff-ex-customize-proceed-button', disabled : false, scope : this, handler : function(btn, text) { var includeInteractions = Ext .getCmp('diff-ex-analysis-customize-include-interactions-checkbox').getValue(); /* * Get the factors the user checked. See checkbox creation code below. */ var factorsToUseIds = []; if (factors) { for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } var checked = Ext.getCmp(f.id + '-factor-checkbox').getValue(); if (checked) { factorsToUseIds.push(f.id); } } } if (factorsToUseIds.length < 1) { Ext.Msg.alert("Invalid selection", "Please pick at least one factor."); return; } /* * Pass back the factors to be used, and the choice of whether interactions are to be * used. */ var callParams = []; callParams.push(id); callParams.push(factorsToUseIds); callParams.push(includeInteractions); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); this.relayEvents(k, ['done']); Ext.getBody().unmask(); k.on('done', function(payload) { this.fireEvent('differential', payload) }); }.createDelegate(this), errorHandler : function(error) { Ext.Msg.alert("Differential exp. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.runCustom.apply(this, callParams); deasw.close(); } }, { text : 'Cancel', handler : function() { deasw.close(); } }] }); deasw.doLayout(); /* * Create the checkboxes for user choice of factors. */ if (factors) { var onlyOne = factors.length == 1; for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } Ext.getCmp('diff-ex-analysis-customize-factors').add(new Ext.form.Checkbox({ fieldLabel : f.name, labelWidth : 180, id : f.id + '-factor-checkbox', tooltip : f.name, checked : onlyOne })); } } /* * TODO: add radiobutton for subset, if there are more than one factor */ deasw.doLayout(); deasw.show(); }; /* * Callback for analysis type determination. This gets the type of analysis, if it can be determined. If the * type is non-null, then just ask the user for confirmation. If they say no, or the type is null, show them the * DifferentialExpressionAnalysisSetupWindow. */ var cb = function(analysisInfo) { if (analysisInfo.type) { var customizable = false; var analysisType = ''; if (analysisInfo.type === 'TWIA') { analysisType = 'Two-way ANOVA with interactions'; customizable = true; } else if (analysisInfo.type === 'TWA') { analysisType = 'Two-way ANOVA without interactions'; customizable = true; } else if (analysisInfo.type === 'TTEST') { analysisType = 'T-test (two-sample)'; } else if (analysisInfo.type === 'OSTTEST') { analysisType = 'T-test (one-sample)'; } else if (analysisInfo.type === 'OWA') { analysisType = 'One-way ANOVA'; } else { analysisType = 'Generic ANOVA/ANCOVA'; customizable = true; } // ask for confirmation. var w = new Ext.Window({ autoCreate : true, resizable : false, constrain : true, constrainHeader : true, minimizable : false, maximizable : false, stateful : false, modal : true, shim : true, buttonAlign : "center", width : 400, height : 130, minHeight : 80, plain : true, footer : true, closable : true, title : 'Differential expression analysis', html : 'Please confirm. The analysis performed will be a ' + analysisType + '. If there is an existing analysis on the same factor(s), it will be deleted.', buttons : [{ text : 'Proceed', handler : function(btn, text) { var callParams = []; callParams.push(id); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); this.relayEvents(k, ['done']); Ext.getBody().unmask(); k.on('done', function(payload) { this.fireEvent('differential', payload); }); }.createDelegate(this), errorHandler : function(error) { Ext.Msg.alert("Diff. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.run.apply(this, callParams); w.close(); } }, { text : 'Cancel', handler : function() { w.close(); } }, { disabled : !customizable, hidden : !customizable, text : 'Customize', handler : function() { w.close(); customize(analysisInfo); } }], iconCls : Ext.MessageBox.QUESTION }); w.show(); } else { /* * System couldn't guess the analysis type, so force user to customize. */ customize(analysisInfo); } }; /* * Get the analysis type. */ var eh = function(error) { Ext.Msg.alert("There was an error", error); }; DifferentialExpressionAnalysisController.determineAnalysisType(id, { callback : cb, errorhandler : eh }); },
}.createDelegate(this),
}.createDelegate(m),
doDifferential : function(id) { /* * Do an analysis interactively. */ var customize = function(analysisInfo) { var factors = analysisInfo.factors; var proposedAnalysis = analysisInfo.type; var canDoInteractions = (proposedAnalysis == 'TWIA') || factors.length > 2; /* * DifferentialExpressionAnalysisSetupWindow - to be refactored. */ var deasw = new Ext.Window({ modal : true, stateful : false, resizable : false, autoHeight : true, width : 300, plain : true, title : "Differential analysis settings", items : [{ xtype : 'form', autoHeight : true, items : [{ xtype : 'fieldset', title : "Select factor(s) to use", autoHeight : true, labelWidth : 200, id : 'diff-ex-analysis-customize-factors' }, { xtype : 'fieldset', labelWidth : 200, autoHeight : true, hidden : !canDoInteractions, /* * FIXME hide this if we have more than 2 factors -- basically where * we're not going to bother supporting interactions. */ items : [{ xtype : 'checkbox', id : 'diff-ex-analysis-customize-include-interactions-checkbox', fieldLabel : 'Include interactions if possible' }] }] }], buttons : [{ text : 'Proceed', id : 'diff-ex-customize-proceed-button', disabled : false, scope : this, handler : function(btn, text) { var includeInteractions = Ext .getCmp('diff-ex-analysis-customize-include-interactions-checkbox').getValue(); /* * Get the factors the user checked. See checkbox creation code below. */ var factorsToUseIds = []; if (factors) { for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } var checked = Ext.getCmp(f.id + '-factor-checkbox').getValue(); if (checked) { factorsToUseIds.push(f.id); } } } if (factorsToUseIds.length < 1) { Ext.Msg.alert("Invalid selection", "Please pick at least one factor."); return; } /* * Pass back the factors to be used, and the choice of whether interactions are to be * used. */ var callParams = []; callParams.push(id); callParams.push(factorsToUseIds); callParams.push(includeInteractions); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); this.relayEvents(k, ['done']); Ext.getBody().unmask(); k.on('done', function(payload) { this.fireEvent('differential', payload) }); }.createDelegate(this), errorHandler : function(error) { Ext.Msg.alert("Differential exp. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.runCustom.apply(this, callParams); deasw.close(); } }, { text : 'Cancel', handler : function() { deasw.close(); } }] }); deasw.doLayout(); /* * Create the checkboxes for user choice of factors. */ if (factors) { var onlyOne = factors.length == 1; for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } Ext.getCmp('diff-ex-analysis-customize-factors').add(new Ext.form.Checkbox({ fieldLabel : f.name, labelWidth : 180, id : f.id + '-factor-checkbox', tooltip : f.name, checked : onlyOne })); } } /* * TODO: add radiobutton for subset, if there are more than one factor */ deasw.doLayout(); deasw.show(); }; /* * Callback for analysis type determination. This gets the type of analysis, if it can be determined. If the * type is non-null, then just ask the user for confirmation. If they say no, or the type is null, show them the * DifferentialExpressionAnalysisSetupWindow. */ var cb = function(analysisInfo) { if (analysisInfo.type) { var customizable = false; var analysisType = ''; if (analysisInfo.type === 'TWIA') { analysisType = 'Two-way ANOVA with interactions'; customizable = true; } else if (analysisInfo.type === 'TWA') { analysisType = 'Two-way ANOVA without interactions'; customizable = true; } else if (analysisInfo.type === 'TTEST') { analysisType = 'T-test (two-sample)'; } else if (analysisInfo.type === 'OSTTEST') { analysisType = 'T-test (one-sample)'; } else if (analysisInfo.type === 'OWA') { analysisType = 'One-way ANOVA'; } else { analysisType = 'Generic ANOVA/ANCOVA'; customizable = true; } // ask for confirmation. var w = new Ext.Window({ autoCreate : true, resizable : false, constrain : true, constrainHeader : true, minimizable : false, maximizable : false, stateful : false, modal : true, shim : true, buttonAlign : "center", width : 400, height : 130, minHeight : 80, plain : true, footer : true, closable : true, title : 'Differential expression analysis', html : 'Please confirm. The analysis performed will be a ' + analysisType + '. If there is an existing analysis on the same factor(s), it will be deleted.', buttons : [{ text : 'Proceed', handler : function(btn, text) { var callParams = []; callParams.push(id); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); this.relayEvents(k, ['done']); Ext.getBody().unmask(); k.on('done', function(payload) { this.fireEvent('differential', payload); }); }.createDelegate(this), errorHandler : function(error) { Ext.Msg.alert("Diff. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.run.apply(this, callParams); w.close(); } }, { text : 'Cancel', handler : function() { w.close(); } }, { disabled : !customizable, hidden : !customizable, text : 'Customize', handler : function() { w.close(); customize(analysisInfo); } }], iconCls : Ext.MessageBox.QUESTION }); w.show(); } else { /* * System couldn't guess the analysis type, so force user to customize. */ customize(analysisInfo); } }; /* * Get the analysis type. */ var eh = function(error) { Ext.Msg.alert("There was an error", error); }; DifferentialExpressionAnalysisController.determineAnalysisType(id, { callback : cb, errorhandler : eh }); },
this.relayEvents(k, ['done']);
this.relayEvents(k, ['done', 'fail']);
doDifferential : function(id) { /* * Do an analysis interactively. */ var customize = function(analysisInfo) { var factors = analysisInfo.factors; var proposedAnalysis = analysisInfo.type; var canDoInteractions = (proposedAnalysis == 'TWIA') || factors.length > 2; /* * DifferentialExpressionAnalysisSetupWindow - to be refactored. */ var deasw = new Ext.Window({ modal : true, stateful : false, resizable : false, autoHeight : true, width : 300, plain : true, title : "Differential analysis settings", items : [{ xtype : 'form', autoHeight : true, items : [{ xtype : 'fieldset', title : "Select factor(s) to use", autoHeight : true, labelWidth : 200, id : 'diff-ex-analysis-customize-factors' }, { xtype : 'fieldset', labelWidth : 200, autoHeight : true, hidden : !canDoInteractions, /* * FIXME hide this if we have more than 2 factors -- basically where * we're not going to bother supporting interactions. */ items : [{ xtype : 'checkbox', id : 'diff-ex-analysis-customize-include-interactions-checkbox', fieldLabel : 'Include interactions if possible' }] }] }], buttons : [{ text : 'Proceed', id : 'diff-ex-customize-proceed-button', disabled : false, scope : this, handler : function(btn, text) { var includeInteractions = Ext .getCmp('diff-ex-analysis-customize-include-interactions-checkbox').getValue(); /* * Get the factors the user checked. See checkbox creation code below. */ var factorsToUseIds = []; if (factors) { for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } var checked = Ext.getCmp(f.id + '-factor-checkbox').getValue(); if (checked) { factorsToUseIds.push(f.id); } } } if (factorsToUseIds.length < 1) { Ext.Msg.alert("Invalid selection", "Please pick at least one factor."); return; } /* * Pass back the factors to be used, and the choice of whether interactions are to be * used. */ var callParams = []; callParams.push(id); callParams.push(factorsToUseIds); callParams.push(includeInteractions); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); this.relayEvents(k, ['done']); Ext.getBody().unmask(); k.on('done', function(payload) { this.fireEvent('differential', payload) }); }.createDelegate(this), errorHandler : function(error) { Ext.Msg.alert("Differential exp. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.runCustom.apply(this, callParams); deasw.close(); } }, { text : 'Cancel', handler : function() { deasw.close(); } }] }); deasw.doLayout(); /* * Create the checkboxes for user choice of factors. */ if (factors) { var onlyOne = factors.length == 1; for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } Ext.getCmp('diff-ex-analysis-customize-factors').add(new Ext.form.Checkbox({ fieldLabel : f.name, labelWidth : 180, id : f.id + '-factor-checkbox', tooltip : f.name, checked : onlyOne })); } } /* * TODO: add radiobutton for subset, if there are more than one factor */ deasw.doLayout(); deasw.show(); }; /* * Callback for analysis type determination. This gets the type of analysis, if it can be determined. If the * type is non-null, then just ask the user for confirmation. If they say no, or the type is null, show them the * DifferentialExpressionAnalysisSetupWindow. */ var cb = function(analysisInfo) { if (analysisInfo.type) { var customizable = false; var analysisType = ''; if (analysisInfo.type === 'TWIA') { analysisType = 'Two-way ANOVA with interactions'; customizable = true; } else if (analysisInfo.type === 'TWA') { analysisType = 'Two-way ANOVA without interactions'; customizable = true; } else if (analysisInfo.type === 'TTEST') { analysisType = 'T-test (two-sample)'; } else if (analysisInfo.type === 'OSTTEST') { analysisType = 'T-test (one-sample)'; } else if (analysisInfo.type === 'OWA') { analysisType = 'One-way ANOVA'; } else { analysisType = 'Generic ANOVA/ANCOVA'; customizable = true; } // ask for confirmation. var w = new Ext.Window({ autoCreate : true, resizable : false, constrain : true, constrainHeader : true, minimizable : false, maximizable : false, stateful : false, modal : true, shim : true, buttonAlign : "center", width : 400, height : 130, minHeight : 80, plain : true, footer : true, closable : true, title : 'Differential expression analysis', html : 'Please confirm. The analysis performed will be a ' + analysisType + '. If there is an existing analysis on the same factor(s), it will be deleted.', buttons : [{ text : 'Proceed', handler : function(btn, text) { var callParams = []; callParams.push(id); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); this.relayEvents(k, ['done']); Ext.getBody().unmask(); k.on('done', function(payload) { this.fireEvent('differential', payload); }); }.createDelegate(this), errorHandler : function(error) { Ext.Msg.alert("Diff. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.run.apply(this, callParams); w.close(); } }, { text : 'Cancel', handler : function() { w.close(); } }, { disabled : !customizable, hidden : !customizable, text : 'Customize', handler : function() { w.close(); customize(analysisInfo); } }], iconCls : Ext.MessageBox.QUESTION }); w.show(); } else { /* * System couldn't guess the analysis type, so force user to customize. */ customize(analysisInfo); } }; /* * Get the analysis type. */ var eh = function(error) { Ext.Msg.alert("There was an error", error); }; DifferentialExpressionAnalysisController.determineAnalysisType(id, { callback : cb, errorhandler : eh }); },
Ext.Msg.alert("Please pick 1 or 2 factors.");
Ext.Msg.alert("Invalid selection", "Please pick 1 or 2 factors.");
doDifferential : function(id) { /* * Do an analysis interactively. */ var customize = function(analysisInfo) { var factors = analysisInfo.factors; var proposedAnalysis = analysisInfo.type; var canDoInteractions = (proposedAnalysis == 'TWIA') || factors.length > 2; /* * DifferentialExpressionAnalysisSetupWindow - to be refactored. */ var deasw = new Ext.Window({ modal : true, stateful : false, resizable : false, autoHeight : true, width : 300, plain : true, title : "Differential analysis settings", items : [{ xtype : 'form', autoHeight : true, items : [{ xtype : 'fieldset', title : "Select up to 2 factor(s) to use", autoHeight : true, labelWidth : 200, id : 'diff-ex-analysis-customize-factors' }, { xtype : 'fieldset', labelWidth : 200, autoHeight : true, hidden : !canDoInteractions, items : [{ xtype : 'checkbox', id : 'diff-ex-analysis-customize-include-interactions-checkbox', fieldLabel : 'Include interactions if possible' }] }] }], buttons : [{ text : 'Proceed', id : 'diff-ex-customize-proceed-button', disabled : false, scope : this, handler : function(btn, text) { var includeInteractions = Ext .getCmp('diff-ex-analysis-customize-include-interactions-checkbox').getValue(); /* * Get the factors the user checked. See checkbox creation code below. */ var factorsToUseIds = []; if (factors) { for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } var checked = Ext.getCmp(f.id + '-factor-checkbox').getValue(); if (checked) { factorsToUseIds.push(f.id); } } } if (factorsToUseIds.length < 1 || factorsToUseIds.length > 2) { Ext.Msg.alert("Please pick 1 or 2 factors."); return; } /* * Pass back the factors to be used, and the choice of whether interactions are to be * used. */ var callParams = []; callParams.push(id); callParams.push(factorsToUseIds); callParams.push(includeInteractions); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); deasw.relayEvents(k, ['done']); Ext.getBody().unmask(); k.on('done', function(payload) { this.fireEvent('differential', payload) }); }.createDelegate(this), errorHandler : function(error) { Ext.Msg.alert("Diff. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.runCustom.apply(this, callParams); deasw.close(); } }, { text : 'Cancel', handler : function() { deasw.close(); } }] }); deasw.doLayout(); /* * Create the checkboxes for user choice of factors. */ if (factors) { for (var i = 0; i < factors.length; i++) { var f = factors[i]; if (!f.name) { continue; } Ext.getCmp('diff-ex-analysis-customize-factors').add(new Ext.form.Checkbox({ fieldLabel : f.name, labelWidth : 180, id : f.id + '-factor-checkbox', tooltip : f.name })); } } deasw.doLayout(); deasw.show(); }; /* * Callback for analysis type determination. This gets the type of analysis, if it can be determined. If the * type is non-null, then just ask the user for confirmation. If they say no, or the type is null, show them the * DifferentialExpressionAnalysisSetupWindow. */ var cb = function(analysisInfo) { if (analysisInfo.type) { var customizable = false; var analysisType = ''; if (analysisInfo.type === 'TWIA') { analysisType = 'Two-way ANOVA with interactions'; customizable = true; } else if (analysisInfo.type === 'TWA') { analysisType = 'Two-way ANOVA without interactions'; customizable = true; } else if (analysisInfo.type === 'TTEST') { analysisType = 'T-test'; } else if (analysisInfo.type === 'OWA') { analysisType = 'One-way ANOVA'; } // ask for confirmation. var w = new Ext.Window({ autoCreate : true, resizable : false, constrain : true, constrainHeader : true, minimizable : false, maximizable : false, stateful : false, modal : true, shim : true, buttonAlign : "center", width : 400, height : 100, minHeight : 80, plain : true, footer : true, closable : true, title : 'Differential expression analysis', html : 'Please confirm. The analysis performed will be a ' + analysisType + '. Previous analysis results for this experiment will be deleted.', buttons : [{ text : 'Proceed', handler : function(btn, text) { var callParams = [] callParams.push(id); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); this.relayEvents(k, ['done']); Ext.getBody().unmask(); k.on('done', function(payload) { this.fireEvent('differential', payload) }); }.createDelegate(this), errorHandler : function(error) { Ext.Msg.alert("Diff. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); DifferentialExpressionAnalysisController.run.apply(this, callParams); w.close(); } }, { text : 'Cancel', handler : function() { w.close(); } }, { disabled : !customizable, hidden : !customizable, text : 'Customize', handler : function() { w.close(); customize(analysisInfo); } }], iconCls : Ext.MessageBox.QUESTION }); w.show(); } else { /* * System couldn't guess the analysis type, so force user to customize. */ customize(analysisInfo); } }; /* * Get the analysis type. */ var eh = function(error) { Ext.Msg.alert("There was an error", error); }; DifferentialExpressionAnalysisController.determineAnalysisType(id, { callback : cb, errorhandler : eh }); },
cfg.url = "http:
function dodo_getConfig() { var cfg = new Object(); cfg.url = "https://secure.dodo.com.au/externalwebservices/MembersPageUsage.asmx/ProvideUsage?un={USERNAME}&pw={PASSWORD}"; cfg.url = "http://localhost/~charles/dodo.spec.xml"; cfg.requestType = "GET"; cfg.requestParams = null; return cfg;}
this.relayEvents(k, ['done']);
this.relayEvents(k, ['done', 'fail']);
doLinks : function(id) { Ext.Msg.show({ title : 'Link analysis', msg : 'Please confirm. Previous analysis results will be deleted.', buttons : Ext.Msg.YESNO, fn : function(btn, text) { if (btn == 'yes') { var callParams = []; callParams.push(id); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); this.relayEvents(k, ['done']); Ext.getBody().unmask(); k.on('done', function(payload) { this.fireEvent('link', payload); }); }.createDelegate(this), errorHandler : function(error) { Ext.Msg.alert("Link analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); LinkAnalysisController.run.apply(this, callParams); } }, scope : this, animEl : 'elId', icon : Ext.MessageBox.WARNING }); },
this.relayEvents(k, ['done']);
this.relayEvents(k, ['done', 'fail']);
doMissingValues : function(id) { Ext.Msg.show({ title : 'Missing value analysis', msg : 'Please confirm. Previous analysis results will be deleted.', buttons : Ext.Msg.YESNO, fn : function(btn, text) { if (btn == 'yes') { var callParams = [] callParams.push(id); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); this.relayEvents(k, ['done']); Ext.getBody().unmask(); k.on('done', function(payload) { this.fireEvent('missingValue', payload) }); }.createDelegate(this), errorHandler : function(error) { Ext.Msg.alert("Missing value analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this) }); TwoChannelMissingValueController.run.apply(this, callParams); } }, scope : this, animEl : 'elId', icon : Ext.MessageBox.WARNING }); },
this.relayEvents(k, ['done']);
this.relayEvents(k, ['done', 'fail']);
doProcessedVectors : function(id) { Ext.Msg.show({ title : 'Processed vector analysis', msg : 'Please confirm. Any existing processed vectors will be deleted.', buttons : Ext.Msg.YESNO, fn : function(btn, text) { if (btn == 'yes') { var callParams = []; callParams.push(id); Ext.getBody().mask(); callParams.push({ callback : function(data) { var k = new Gemma.WaitHandler(); k.handleWait(data, true); this.relayEvents(k, ['done']); Ext.getBody().unmask(); k.on('done', function(payload) { this.fireEvent('processedVector', payload); }); }.createDelegate(this) }); ProcessedExpressionDataVectorCreateController.run.apply(this, callParams); } }, scope : this, animEl : 'elId', icon : Ext.MessageBox.WARNING }); },
uploader.upload({albumName:albumName});
uploader.upload({albumName:albumName, albumDescription:albumDescription});
doUpload = function(){ console.log("doUpload"); displayProgress(); var selectAlbum = dojo.byId("selectAlbum"); var selected = selectAlbum.value; console.log("selected:"+selected); if(selected == null || (selected != null && selected == "" && selected.length == 0)) { alert("Photo Upload can not be started.Select Album before upload"); } else if(selected == "New Album") { var albumName = dojo.byId("newAlbumName").value; if( albumName == null || (albumName != null && albumName == "" && albumName.length == 0)) { alert("Photo Upload can not be started.Enter the new album name"); } else { //add new album to list of albums selectAlbum.options[selectAlbum.options.length] = new Option(albumName, albumName, false, false); //upload the files setProgressbar(0,1); uploader.upload({albumName:albumName}); } } else { //upload files to existent album setProgressbar(0,1); uploader.upload({albumName:selected}); } //dojo.byId("newAlbumName").value =""; }
uploader.upload({albumName:selected});
uploader.upload({albumName:selected,albumDescription:albumDescription});
doUpload = function(){ console.log("doUpload"); displayProgress(); var selectAlbum = dojo.byId("selectAlbum"); var selected = selectAlbum.value; console.log("selected:"+selected); if(selected == null || (selected != null && selected == "" && selected.length == 0)) { alert("Photo Upload can not be started.Select Album before upload"); } else if(selected == "New Album") { var albumName = dojo.byId("newAlbumName").value; if( albumName == null || (albumName != null && albumName == "" && albumName.length == 0)) { alert("Photo Upload can not be started.Enter the new album name"); } else { //add new album to list of albums selectAlbum.options[selectAlbum.options.length] = new Option(albumName, albumName, false, false); //upload the files setProgressbar(0,1); uploader.upload({albumName:albumName}); } } else { //upload files to existent album setProgressbar(0,1); uploader.upload({albumName:selected}); } //dojo.byId("newAlbumName").value =""; }
uploader.upload({albumName:albumName, albumDescription:albumDescription});
uploader.upload({albumName:albumName, albumDescription:albumDescription, securityToken:securityToken});
doUpload = function(){ console.log("doUpload"); displayProgress(); var files= dojo.byId("files").childElementCount; var selectAlbum = dojo.byId("selectAlbum"); var selected = selectAlbum.value; albumName=selected; var albumDescription= dojo.byId("albumDescription").value; console.log("selected:"+selected); if(files == 0) {//to stop upload when on files are selected alert("Photo Upload can not be started. Select picture(s) before upload"); dojo.byId("progressBar").style.display="none"; } else if(selected == null || (selected != null && selected == "" && selected.length == 0)) { alert("Photo Upload can not be started.Select Album before upload"); dojo.byId("progressBar").style.display="none"; } else if(selected == "New Album") { albumName = dojo.byId("newAlbumName").value; if( albumName == null || (albumName != null && albumName == "" && albumName.length == 0)) { alert("Photo Upload can not be started.Enter the new album name"); dojo.byId("progressBar").style.display="none"; } else { //add new album to list of albums selectAlbum.options[selectAlbum.options.length] = new Option(albumName, albumName, false, false); //upload the files setProgressbar(0,1); uploader.upload({albumName:albumName, albumDescription:albumDescription}); } } else { //upload files to existent album setProgressbar(0,1); uploader.upload({albumName:selected,albumDescription:albumDescription}); } //dojo.byId("newAlbumName").value =""; }
uploader.upload({albumName:selected,albumDescription:albumDescription});
uploader.upload({albumName:selected,albumDescription:albumDescription, securityToken:securityToken});
doUpload = function(){ console.log("doUpload"); displayProgress(); var files= dojo.byId("files").childElementCount; var selectAlbum = dojo.byId("selectAlbum"); var selected = selectAlbum.value; albumName=selected; var albumDescription= dojo.byId("albumDescription").value; console.log("selected:"+selected); if(files == 0) {//to stop upload when on files are selected alert("Photo Upload can not be started. Select picture(s) before upload"); dojo.byId("progressBar").style.display="none"; } else if(selected == null || (selected != null && selected == "" && selected.length == 0)) { alert("Photo Upload can not be started.Select Album before upload"); dojo.byId("progressBar").style.display="none"; } else if(selected == "New Album") { albumName = dojo.byId("newAlbumName").value; if( albumName == null || (albumName != null && albumName == "" && albumName.length == 0)) { alert("Photo Upload can not be started.Enter the new album name"); dojo.byId("progressBar").style.display="none"; } else { //add new album to list of albums selectAlbum.options[selectAlbum.options.length] = new Option(albumName, albumName, false, false); //upload the files setProgressbar(0,1); uploader.upload({albumName:albumName, albumDescription:albumDescription}); } } else { //upload files to existent album setProgressbar(0,1); uploader.upload({albumName:selected,albumDescription:albumDescription}); } //dojo.byId("newAlbumName").value =""; }
if(selected == null || (selected != null && selected == "" && selected.length == 0)) {
if(files == 0) { alert("Photo Upload can not be started. Select picture(s) before upload"); dojo.byId("progressBar").style.display="none"; } else if(selected == null || (selected != null && selected == "" && selected.length == 0)) {
doUpload = function(){ console.log("doUpload"); displayProgress(); var selectAlbum = dojo.byId("selectAlbum"); var selected = selectAlbum.value; var albumDescription= dojo.byId("albumDescription").value; console.log("selected:"+selected); if(selected == null || (selected != null && selected == "" && selected.length == 0)) { alert("Photo Upload can not be started.Select Album before upload"); } else if(selected == "New Album") { var albumName = dojo.byId("newAlbumName").value; if( albumName == null || (albumName != null && albumName == "" && albumName.length == 0)) { alert("Photo Upload can not be started.Enter the new album name"); } else { //add new album to list of albums selectAlbum.options[selectAlbum.options.length] = new Option(albumName, albumName, false, false); //upload the files setProgressbar(0,1); uploader.upload({albumName:albumName, albumDescription:albumDescription}); } } else { //upload files to existent album setProgressbar(0,1); uploader.upload({albumName:selected,albumDescription:albumDescription}); } //dojo.byId("newAlbumName").value =""; }
var albumName = dojo.byId("newAlbumName").value;
albumName = dojo.byId("newAlbumName").value;
doUpload = function(){ console.log("doUpload"); displayProgress(); var selectAlbum = dojo.byId("selectAlbum"); var selected = selectAlbum.value; var albumDescription= dojo.byId("albumDescription").value; console.log("selected:"+selected); if(selected == null || (selected != null && selected == "" && selected.length == 0)) { alert("Photo Upload can not be started.Select Album before upload"); } else if(selected == "New Album") { var albumName = dojo.byId("newAlbumName").value; if( albumName == null || (albumName != null && albumName == "" && albumName.length == 0)) { alert("Photo Upload can not be started.Enter the new album name"); } else { //add new album to list of albums selectAlbum.options[selectAlbum.options.length] = new Option(albumName, albumName, false, false); //upload the files setProgressbar(0,1); uploader.upload({albumName:albumName, albumDescription:albumDescription}); } } else { //upload files to existent album setProgressbar(0,1); uploader.upload({albumName:selected,albumDescription:albumDescription}); } //dojo.byId("newAlbumName").value =""; }
dojo.byId("progressBar").style.display="none";
doUpload = function(){ console.log("doUpload"); displayProgress(); var selectAlbum = dojo.byId("selectAlbum"); var selected = selectAlbum.value; var albumDescription= dojo.byId("albumDescription").value; console.log("selected:"+selected); if(selected == null || (selected != null && selected == "" && selected.length == 0)) { alert("Photo Upload can not be started.Select Album before upload"); } else if(selected == "New Album") { var albumName = dojo.byId("newAlbumName").value; if( albumName == null || (albumName != null && albumName == "" && albumName.length == 0)) { alert("Photo Upload can not be started.Enter the new album name"); } else { //add new album to list of albums selectAlbum.options[selectAlbum.options.length] = new Option(albumName, albumName, false, false); //upload the files setProgressbar(0,1); uploader.upload({albumName:albumName, albumDescription:albumDescription}); } } else { //upload files to existent album setProgressbar(0,1); uploader.upload({albumName:selected,albumDescription:albumDescription}); } //dojo.byId("newAlbumName").value =""; }
var auth = "Basic " + Base64.encode(networkUsername + ':' + networkPassword);
var auth = "Basic " + info_webtoolkit_Base64.encode(networkUsername + ':' + networkPassword);
download: function(callback, url, feed, networkUsername, networkPassword) { var request = new XMLHttpRequest(); request.open("GET", url, true); if (networkUsername !== null && networkUsername !== '') { var auth = "Basic " + Base64.encode(networkUsername + ':' + networkPassword); request.setRequestHeader("Authorization", auth); } request.onreadystatechange = function () { if (request.readyState == 4) { if (request.status == 200) { callback.process(request.responseText, feed); } else { callback.setStatusDownloadError(feed); } } }; request.onerror = function () { callback.setStatusDownloadError(feed); }; callback.setStatusDownloading(feed); request.send(null); }
var newleft = ui.position.left % photo_width; if (newleft > 0) { newleft -= photo_width; } ui.position.left = newleft;
var newleft = ui.position.left % photo_width; if (newleft > 0) { newleft -= photo_width;
drag: function(e, ui) { var newleft = ui.position.left % photo_width; if (newleft > 0) { newleft -= photo_width; } ui.position.left = newleft; }
ui.position.left = newleft; }
drag: function(e, ui) { var newleft = ui.position.left % photo_width; if (newleft > 0) { newleft -= photo_width; } ui.position.left = newleft; }
drawGrid(); for (var i = 0; i < series.length; ++i) { var s = series[i]; if (s.subseries) for (var j = 0; j < s.subseries.length; ++j) drawSeries(s.subseries[j]); else drawSeries(s); }
ctx.clearRect(0, 0, canvasWidth, canvasHeight); var grid = options.grid; if (grid.show && !grid.aboveData) drawGrid(); for (var i = 0; i < series.length; ++i) drawSeries(series[i]); executeHooks(hooks.draw, [ctx]); if (grid.show && grid.aboveData) drawGrid();
function draw() { drawGrid(); for (var i = 0; i < series.length; ++i) { var s = series[i]; if (s.subseries) for (var j = 0; j < s.subseries.length; ++j) drawSeries(s.subseries[j]); else drawSeries(s); } }
octx.strokeStyle = parseColor(series.color).scale(1, 1, 1, 0.5).toString();
octx.strokeStyle = $.color.parse(series.color).scale('a', 0.5).toString();
function drawPointHighlight(series, point) { var x = point[0], y = point[1], axisx = series.xaxis, axisy = series.yaxis; if (x < axisx.min || x > axisx.max || y < axisy.min || y > axisy.max) return; var pointRadius = series.points.radius + series.points.lineWidth / 2; octx.lineWidth = pointRadius; octx.strokeStyle = parseColor(series.color).scale(1, 1, 1, 0.5).toString(); var radius = 1.5 * pointRadius; octx.beginPath(); octx.arc(axisx.p2c(x), axisy.p2c(y), radius, 0, 2 * Math.PI, true); octx.stroke(); }
store = this.store,
drawRow: function(record, index, position) { var columns = this.columns, body = this.gridTableBody, row = this.row, rowHeaders = row.useHeaders(), autoRowHeight = row.options.rowHeight == 'auto', rowBody = this.rowTableBody, rowHeaderColumn, rowHeaderColumnIndex, renderer, formatter, getData, tr, th, text = index + 1, rh; if (!$defined(position) || !['top','bottom','replace'].contains(position)) { position = 'bottom'; } tr = row.getGridRowElement(index, ''); columns.getRow(tr, record); if (position == 'replace' && index < body.childNodes.length) { tr.inject(body.childNodes[index], 'after'); body.childNodes[index].dispose(); } else { tr.inject(body, position); } if (rowHeaders) { if (row.options.headerColumn) { rowHeaderColumn = columns.getByName(row.options.headerColumn); renderer = rowHeaderColumn.options.renderer; if (!renderer.domInsert) { formatter = rowHeaderColumn.options.formatter; rowHeaderColumnIndex = columns.columns.indexOf(rowHeaderColumn); getData = function(record) { var data = {}, text = ''; if (renderer.options.textTemplate) { text = store.fillTemplate(null, renderer.options.textTemplate, renderer.columnsNeeded); } else { text = record.data.get(rowHeaderColumn.name); } data['col'+rowHeaderColumnIndex] = text; return data; }; text = rowHeaderColumn.getTemplate(rowHeaderColumnIndex).substitute(getData(record)); } else { text = ''; } } th = row.getRowHeaderCell(text); if (row.options.headerColumn && renderer.domInsert) { th.adopt(rowHeaderColumn.getHTML()); } if (autoRowHeight) { th.setStyle('height', tr.childNodes[0].getContentBoxSize().height); } rh = new Element('tr').adopt(th); if (position == 'replace' && index < rowBody.childNodes.length) { rh.inject(rowBody.childNodes[index], 'after'); rowBody.childNodes[index].dispose(); } else { rh.inject(rowBody, position); } } },
if (autoRowHeight) { th.setStyle('height', tr.childNodes[0].getContentBoxSize().height); }
drawRow: function(record, index, position) { var columns = this.columns, body = this.gridTableBody, row = this.row, store = this.store, rowHeaders = row.useHeaders(), autoRowHeight = row.options.rowHeight == 'auto', rowBody = this.rowTableBody, rowHeaderColumn, rowHeaderColumnIndex, renderer, formatter, getData, tr, th, text = index + 1, rh; if (!$defined(position) || !['top','bottom','replace'].contains(position)) { position = 'bottom'; } tr = row.getGridRowElement(index, ''); if (position == 'replace' && index < body.childNodes.length) { tr.inject(body.childNodes[index], 'after'); body.childNodes[index].dispose(); } else { tr.inject(body, position); } columns.getRow(tr, record); if (rowHeaders) { if (row.options.headerColumn) { rowHeaderColumn = columns.getByName(row.options.headerColumn); renderer = rowHeaderColumn.options.renderer; if (!renderer.domInsert) { formatter = rowHeaderColumn.options.formatter; rowHeaderColumnIndex = columns.columns.indexOf(rowHeaderColumn); getData = function(record) { var data = {}, text = ''; if (renderer.options.textTemplate) { text = store.fillTemplate(null, renderer.options.textTemplate, renderer.columnsNeeded); } else { text = record.data.get(rowHeaderColumn.name); } data['col'+rowHeaderColumnIndex] = text; return data; }; text = rowHeaderColumn.getTemplate(rowHeaderColumnIndex).substitute(getData(record)); } else { text = ''; } } th = row.getRowHeaderCell(text); if (row.options.headerColumn && renderer.domInsert) { th.adopt(rowHeaderColumn.getHTML()); } if (autoRowHeight) { th.setStyle('height', tr.childNodes[0].getContentBoxSize().height); } rh = new Element('tr').adopt(th); if (position == 'replace' && index < rowBody.childNodes.length) { rh.inject(rowBody.childNodes[index], 'after'); rowBody.childNodes[index].dispose(); } else { rh.inject(rowBody, position); } } },
if (autoRowHeight) { rh.setBorderBoxSize({height: tr.getBorderBoxSize().height}); }
drawRow: function(record, index, position) { var columns = this.columns, body = this.gridTableBody, row = this.row, store = this.store, rowHeaders = row.useHeaders(), autoRowHeight = row.options.rowHeight == 'auto', rowBody = this.rowTableBody, rowHeaderColumn, rowHeaderColumnIndex, renderer, formatter, getData, tr, th, text = index + 1, rh; if (!$defined(position) || !['top','bottom','replace'].contains(position)) { position = 'bottom'; } tr = row.getGridRowElement(index, ''); if (position == 'replace' && index < body.childNodes.length) { tr.inject(body.childNodes[index], 'after'); body.childNodes[index].dispose(); } else { tr.inject(body, position); } columns.getRow(tr, record); if (rowHeaders) { if (row.options.headerColumn) { rowHeaderColumn = columns.getByName(row.options.headerColumn); renderer = rowHeaderColumn.options.renderer; if (!renderer.domInsert) { formatter = rowHeaderColumn.options.formatter; rowHeaderColumnIndex = columns.columns.indexOf(rowHeaderColumn); getData = function(record) { var data = {}, text = ''; if (renderer.options.textTemplate) { text = store.fillTemplate(null, renderer.options.textTemplate, renderer.columnsNeeded); } else { text = record.data.get(rowHeaderColumn.name); } data['col'+rowHeaderColumnIndex] = text; return data; }; text = rowHeaderColumn.getTemplate(rowHeaderColumnIndex).substitute(getData(record)); } else { text = ''; } } th = row.getRowHeaderCell(text); if (row.options.headerColumn && renderer.domInsert) { th.adopt(rowHeaderColumn.getHTML()); } if (autoRowHeight) { th.setStyle('height', tr.childNodes[0].getContentBoxSize().height); } rh = new Element('tr').adopt(th); if (position == 'replace' && index < rowBody.childNodes.length) { rh.inject(rowBody.childNodes[index], 'after'); rowBody.childNodes[index].dispose(); } else { rh.inject(rowBody, position); } } },
if (isNaN(y1) || isNaN(y2)) { if (isNaN(y2) && i == 0) { ctx.lineTo(prevx + 2, prevy); }
if (isNaN(y2)) { ctx.lineTo(prevx + 5, prevy); continue; } if (isNaN(y1)) { prevx = tHoz(x2); prevy = tVert(y2) + offset; ctx.moveTo(prevx, prevy); ctx.lineTo(prevx + 5, prevy);
function drawSeriesLines(series) { function plotLine(data, offset) { if (data.length < 2) return; var i = 0; // Find the first non-missing value. while (i < data.length) { var y = data[i][1]; if (isNaN(y)) { i++; continue; } var x = data[i][0]; var prevx = tHoz(x), prevy = tVert(y) + offset; break; } ctx.beginPath(); ctx.moveTo(prevx, prevy); for (; i < data.length - 1; ++i) { var x1 = data[i][0], y1 = data[i][1], x2 = data[i + 1][0], y2 = data[i + 1][1]; if (isNaN(y1) || isNaN(y2)) { /* * If the second point is missing, the first point ends up with nothing shown. Example: GSE867. * (Id=392) FIXME: probably a similar problem happens whenever there is an isolated 'present' * value. See bug 1720. */ if (isNaN(y2) && i == 0) { // Draw a short line to mark the spot. Possible better solution: draw dashed line to the // next present point? ctx.lineTo(prevx + 2, prevy); } continue; } /** * Clip with ymin. */ if (y1 <= y2 && y1 < yaxis.min) { /** * Line segment is outside the drawing area. */ if (y2 < yaxis.min) continue; /** * Compute new intersection point. */ x1 = (yaxis.min - y1) / (y2 - y1) * (x2 - x1) + x1; y1 = yaxis.min; } else if (y2 <= y1 && y2 < yaxis.min) { if (y1 < yaxis.min) continue; x2 = (yaxis.min - y1) / (y2 - y1) * (x2 - x1) + x1; y2 = yaxis.min; } /** * Clip with ymax. */ if (y1 >= y2 && y1 > yaxis.max) { if (y2 > yaxis.max) continue; x1 = (yaxis.max - y1) / (y2 - y1) * (x2 - x1) + x1; y1 = yaxis.max; } else if (y2 >= y1 && y2 > yaxis.max) { if (y1 > yaxis.max) continue; x2 = (yaxis.max - y1) / (y2 - y1) * (x2 - x1) + x1; y2 = yaxis.max; } /** * Clip with xmin. */ if (x1 <= x2 && x1 < xaxis.min) { if (x2 < xaxis.min) continue; y1 = (xaxis.min - x1) / (x2 - x1) * (y2 - y1) + y1; x1 = xaxis.min; } else if (x2 <= x1 && x2 < xaxis.min) { if (x1 < xaxis.min) continue; y2 = (xaxis.min - x1) / (x2 - x1) * (y2 - y1) + y1; x2 = xaxis.min; } /** * Clip with xmax. */ if (x1 >= x2 && x1 > xaxis.max) { if (x2 > xaxis.max) continue; y1 = (xaxis.max - x1) / (x2 - x1) * (y2 - y1) + y1; x1 = xaxis.max; } else if (x2 >= x1 && x2 > xaxis.max) { if (x1 > xaxis.max) continue; y2 = (xaxis.max - x1) / (x2 - x1) * (y2 - y1) + y1; x2 = xaxis.max; } if (prevx != tHoz(x1) || prevy != tVert(y1) + offset) ctx.moveTo(tHoz(x1), tVert(y1) + offset); prevx = tHoz(x2); prevy = tVert(y2) + offset; ctx.lineTo(prevx, prevy); } ctx.stroke(); } /** * Function used to fill * * @param {Object} * data */ function plotLineArea(data) { if (data.length < 2) return; var bottom = Math.min(Math.max(0, yaxis.min), yaxis.max); var top, lastX = 0; var first = true; ctx.beginPath(); for (var i = 0; i < data.length - 1; ++i) { var x1 = data[i][0], y1 = data[i][1], x2 = data[i + 1][0], y2 = data[i + 1][1]; if (x1 <= x2 && x1 < xaxis.min) { if (x2 < xaxis.min) continue; y1 = (xaxis.min - x1) / (x2 - x1) * (y2 - y1) + y1; x1 = xaxis.min; } else if (x2 <= x1 && x2 < xaxis.min) { if (x1 < xaxis.min) continue; y2 = (xaxis.min - x1) / (x2 - x1) * (y2 - y1) + y1; x2 = xaxis.min; } if (x1 >= x2 && x1 > xaxis.max) { if (x2 > xaxis.max) continue; y1 = (xaxis.max - x1) / (x2 - x1) * (y2 - y1) + y1; x1 = xaxis.max; } else if (x2 >= x1 && x2 > xaxis.max) { if (x1 > xaxis.max) continue; y2 = (xaxis.max - x1) / (x2 - x1) * (y2 - y1) + y1; x2 = xaxis.max; } if (first) { ctx.moveTo(tHoz(x1), tVert(bottom)); first = false; } /** * Now check the case where both is outside. */ if (y1 >= yaxis.max && y2 >= yaxis.max) { ctx.lineTo(tHoz(x1), tVert(yaxis.max)); ctx.lineTo(tHoz(x2), tVert(yaxis.max)); continue; } else if (y1 <= yaxis.min && y2 <= yaxis.min) { ctx.lineTo(tHoz(x1), tVert(yaxis.min)); ctx.lineTo(tHoz(x2), tVert(yaxis.min)); continue; } /** * Else it's a bit more complicated, there might be two rectangles and two triangles we need to fill * in; to find these keep track of the current x values. */ var x1old = x1, x2old = x2; /** * And clip the y values, without shortcutting. Clip with ymin. */ if (y1 <= y2 && y1 < yaxis.min && y2 >= yaxis.min) { x1 = (yaxis.min - y1) / (y2 - y1) * (x2 - x1) + x1; y1 = yaxis.min; } else if (y2 <= y1 && y2 < yaxis.min && y1 >= yaxis.min) { x2 = (yaxis.min - y1) / (y2 - y1) * (x2 - x1) + x1; y2 = yaxis.min; } /** * Clip with ymax. */ if (y1 >= y2 && y1 > yaxis.max && y2 <= yaxis.max) { x1 = (yaxis.max - y1) / (y2 - y1) * (x2 - x1) + x1; y1 = yaxis.max; } else if (y2 >= y1 && y2 > yaxis.max && y1 <= yaxis.max) { x2 = (yaxis.max - y1) / (y2 - y1) * (x2 - x1) + x1; y2 = yaxis.max; } /** * If the x value was changed we got a rectangle to fill. */ if (x1 != x1old) { top = (y1 <= yaxis.min) ? top = yaxis.min : yaxis.max; ctx.lineTo(tHoz(x1old), tVert(top)); ctx.lineTo(tHoz(x1), tVert(top)); } /** * Fill the triangles. */ ctx.lineTo(tHoz(x1), tVert(y1)); ctx.lineTo(tHoz(x2), tVert(y2)); /** * Fill the other rectangle if it's there. */ if (x2 != x2old) { top = (y2 <= yaxis.min) ? yaxis.min : yaxis.max; ctx.lineTo(tHoz(x2old), tVert(top)); ctx.lineTo(tHoz(x2), tVert(top)); } lastX = Math.max(x2, x2old); } /* * ctx.beginPath(); ctx.moveTo(tHoz(data[0][0]), tVert(0)); for (var i = 0; i < data.length; i++) { * ctx.lineTo(tHoz(data[i][0]), tVert(data[i][1])); } ctx.lineTo(tHoz(data[data.length - 1][0]), * tVert(0)); */ ctx.lineTo(tHoz(lastX), tVert(bottom)); ctx.closePath(); ctx.fill(); } ctx.save(); ctx.translate(plotOffset.left, plotOffset.top); ctx.lineJoin = 'round'; var lw = series.lines.lineWidth; var sw = series.shadowSize; /** * @todo: consider another form of shadow when filling is turned on */ if (sw > 0) { ctx.lineWidth = sw / 2; ctx.strokeStyle = "rgba(0,0,0,0.1)"; plotLine(series.data, lw / 2 + sw / 2 + ctx.lineWidth / 2); ctx.lineWidth = sw / 2; ctx.strokeStyle = "rgba(0,0,0,0.2)"; plotLine(series.data, lw / 2 + ctx.lineWidth / 2); } ctx.lineWidth = lw; ctx.strokeStyle = series.color; if (series.lines.fill) { ctx.fillStyle = series.lines.fillColor != null ? series.lines.fillColor : parseColor(series.color) .scale(null, null, null, 0.4).toString(); plotLineArea(series.data, 0); } plotLine(series.data, 0); ctx.restore(); }
ctx.arc(axisx.p2c(x), axisy.p2c(y) + offset, radius, 0, circumference, true);
ctx.arc(axisx.p2c(x), axisy.p2c(y) + offset, radius, 0, circumference, false);
function drawSeriesPoints(series) { function plotPoints(datapoints, radius, fillStyle, offset, circumference, axisx, axisy) { var points = datapoints.points, incr = datapoints.incr; for (var i = 0; i < points.length; i += incr) { var x = points[i], y = points[i + 1]; if (x == null || x < axisx.min || x > axisx.max || y < axisy.min || y > axisy.max) continue; ctx.beginPath(); ctx.arc(axisx.p2c(x), axisy.p2c(y) + offset, radius, 0, circumference, true); if (fillStyle) { ctx.fillStyle = fillStyle; ctx.fill(); } ctx.stroke(); } } ctx.save(); ctx.translate(plotOffset.left, plotOffset.top); var lw = series.lines.lineWidth, sw = series.shadowSize, radius = series.points.radius; if (lw > 0 && sw > 0) { // draw shadow in two steps var w = sw / 2; ctx.lineWidth = w; ctx.strokeStyle = "rgba(0,0,0,0.1)"; plotPoints(series.datapoints, radius, null, w + w/2, 2 * Math.PI, series.xaxis, series.yaxis); ctx.strokeStyle = "rgba(0,0,0,0.2)"; plotPoints(series.datapoints, radius, null, w/2, 2 * Math.PI, series.xaxis, series.yaxis); } ctx.lineWidth = lw; ctx.strokeStyle = series.color; plotPoints(series.datapoints, radius, getFillStyle(series.points, series.color), 0, 2 * Math.PI, series.xaxis, series.yaxis); ctx.restore(); }
plotPoints(series.datapoints, radius, null, w + w/2, 2 * Math.PI,
plotPoints(series.datapoints, radius, null, w + w/2, Math.PI,
function drawSeriesPoints(series) { function plotPoints(datapoints, radius, fillStyle, offset, circumference, axisx, axisy) { var points = datapoints.points, incr = datapoints.incr; for (var i = 0; i < points.length; i += incr) { var x = points[i], y = points[i + 1]; if (x == null || x < axisx.min || x > axisx.max || y < axisy.min || y > axisy.max) continue; ctx.beginPath(); ctx.arc(axisx.p2c(x), axisy.p2c(y) + offset, radius, 0, circumference, true); if (fillStyle) { ctx.fillStyle = fillStyle; ctx.fill(); } ctx.stroke(); } } ctx.save(); ctx.translate(plotOffset.left, plotOffset.top); var lw = series.lines.lineWidth, sw = series.shadowSize, radius = series.points.radius; if (lw > 0 && sw > 0) { // draw shadow in two steps var w = sw / 2; ctx.lineWidth = w; ctx.strokeStyle = "rgba(0,0,0,0.1)"; plotPoints(series.datapoints, radius, null, w + w/2, 2 * Math.PI, series.xaxis, series.yaxis); ctx.strokeStyle = "rgba(0,0,0,0.2)"; plotPoints(series.datapoints, radius, null, w/2, 2 * Math.PI, series.xaxis, series.yaxis); } ctx.lineWidth = lw; ctx.strokeStyle = series.color; plotPoints(series.datapoints, radius, getFillStyle(series.points, series.color), 0, 2 * Math.PI, series.xaxis, series.yaxis); ctx.restore(); }
plotPoints(series.datapoints, radius, null, w/2, 2 * Math.PI,
plotPoints(series.datapoints, radius, null, w/2, Math.PI,
function drawSeriesPoints(series) { function plotPoints(datapoints, radius, fillStyle, offset, circumference, axisx, axisy) { var points = datapoints.points, incr = datapoints.incr; for (var i = 0; i < points.length; i += incr) { var x = points[i], y = points[i + 1]; if (x == null || x < axisx.min || x > axisx.max || y < axisy.min || y > axisy.max) continue; ctx.beginPath(); ctx.arc(axisx.p2c(x), axisy.p2c(y) + offset, radius, 0, circumference, true); if (fillStyle) { ctx.fillStyle = fillStyle; ctx.fill(); } ctx.stroke(); } } ctx.save(); ctx.translate(plotOffset.left, plotOffset.top); var lw = series.lines.lineWidth, sw = series.shadowSize, radius = series.points.radius; if (lw > 0 && sw > 0) { // draw shadow in two steps var w = sw / 2; ctx.lineWidth = w; ctx.strokeStyle = "rgba(0,0,0,0.1)"; plotPoints(series.datapoints, radius, null, w + w/2, 2 * Math.PI, series.xaxis, series.yaxis); ctx.strokeStyle = "rgba(0,0,0,0.2)"; plotPoints(series.datapoints, radius, null, w/2, 2 * Math.PI, series.xaxis, series.yaxis); } ctx.lineWidth = lw; ctx.strokeStyle = series.color; plotPoints(series.datapoints, radius, getFillStyle(series.points, series.color), 0, 2 * Math.PI, series.xaxis, series.yaxis); ctx.restore(); }
console.profile();
drawStore: function() { console.profile(); this.domObj.resize(); this.gridTableBody.empty(); if (this.row.useHeaders()) { this.rowTableBody.empty(); } this.store.each(function(record,index) { this.drawRow(record, index); }, this); console.profileEnd(); },
console.profileEnd();
drawStore: function() { console.profile(); this.domObj.resize(); this.gridTableBody.empty(); if (this.row.useHeaders()) { this.rowTableBody.empty(); } this.store.each(function(record,index) { this.drawRow(record, index); }, this); console.profileEnd(); },
if (this.row.useHeaders()) {
if (useHeaders) {
drawStore: function() { this.domObj.resize(); this.gridTableBody.empty(); if (this.row.useHeaders()) { this.rowTableBody.empty(); } this.store.each(function(record,index) { this.store.index = index; this.drawRow(record, index); }, this); },
if (useHeaders) { blank = new Element('tr', { styles: { height: 1000 } }); blank.adopt(new Element('th', { 'class':'jxGridRowHead', html: '&nbsp' })); this.rowTableBody.adopt(blank); }
drawStore: function() { this.domObj.resize(); this.gridTableBody.empty(); if (this.row.useHeaders()) { this.rowTableBody.empty(); } this.store.each(function(record,index) { this.store.index = index; this.drawRow(record, index); }, this); },
e: function(event, dx, dy) { return { width: this.originalSize.width + dx }; },
d(this);c.html(c.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function e(g,f){g.css({display:""});!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}this.list=this.element.find("ol,ul").eq(0);this.lis=d("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);var a=this,b=this.options,h=/^#.+/;this.anchors.each(function(g,f){var j=d(f).attr("href"),l=j.split("#")[0],p;if(l&&(l===location.toString().split("#")[0]||
e: function(event, dx, dy) { return { width: this.originalSize.width + dx }; },
for (var i = 0, l = data.length; i < l; i++) { fn.call(bind, data[i], i, data); }
data.each(fn, bind);
each: function (fn, bind, ignoreDeleted) { var data; if (ignoreDeleted) { data = this.data.filter(function (record) { return record.state !== Jx.Record.DELETE; }, this); } else { data = this.data; } for (var i = 0, l = data.length; i < l; i++) { fn.call(bind, data[i], i, data); } },
debug("invalid selection"); return;
selection = document.documentRange(); } else { selection.start.column = 0; selection.end.column = document.lineLength(selection.end.line);
function each(func){ if ( typeof(func) != "function" ) { debug("parameter is not a function: " + typeof(func)); return; } var selection = view.selection(); if (!selection.isValid()) { debug("invalid selection"); return; } selection.start.column = 0; selection.end.column = document.lineLength(selection.end.line); var text = document.text(selection); var lines = text.split("\n"); lines = func(lines); text = lines.join("\n"); view.clearSelection(); document.editBegin(); document.removeText(selection); document.insertText(selection.start, text); document.editEnd();}
selection.start.column = 0; selection.end.column = document.lineLength(selection.end.line);
function each(func){ if ( typeof(func) != "function" ) { debug("parameter is not a function: " + typeof(func)); return; } var selection = view.selection(); if (!selection.isValid()) { debug("invalid selection"); return; } selection.start.column = 0; selection.end.column = document.lineLength(selection.end.line); var text = document.text(selection); var lines = text.split("\n"); lines = func(lines); text = lines.join("\n"); view.clearSelection(); document.editBegin(); document.removeText(selection); document.insertText(selection.start, text); document.editEnd();}
function EAL(){this.version="0.7.2.3";date=new Date();this.start_time=date.getTime();this.win="loading";this.error=false;this.baseURL="";this.template="";this.lang=new Object();this.load_syntax=new Object();this.syntax=new Object();this.loadedFiles=new Array();this.waiting_loading=new Object();this.scripts_to_load=new Array();this.sub_scripts_to_load=new Array();this.resize=new Array();this.hidden=new Object();this.default_settings={debug:false ,smooth_selection:true ,font_size:"10" ,font_family:"monospace" ,start_highlight:false ,autocompletion:false ,toolbar:"search,go_to_line,fullscreen,|,undo,redo,|,select_font,|,change_smooth_selection,highlight,reset_highlight,|,help" ,begin_toolbar:"" ,end_toolbar:"" ,is_multi_files:false ,allow_resize:"both" ,show_line_colors:false ,min_width:400 ,min_height:125 ,replace_tab_by_spaces:false ,allow_toggle:true ,language:"en" ,syntax:"" ,syntax_selection_allow:"basic,brainfuck,c,coldfusion,cpp,css,html,js,pas,perl,php,python,ruby,robotstxt,sql,tsql,vb,xml" ,display:"onload" ,max_undo:30 ,browsers:"known" ,plugins:"" ,gecko_spellcheck:false ,fullscreen:false ,is_editable:true ,wrap_text:false ,load_callback:"" ,save_callback:"" ,change_callback:"" ,submit_callback:"" ,EA_init_callback:"" ,EA_delete_callback:"" ,EA_load_callback:"" ,EA_unload_callback:"" ,EA_toggle_on_callback:"" ,EA_toggle_off_callback:"" ,EA_file_switch_on_callback:"" ,EA_file_switch_off_callback:"" ,EA_file_close_callback:"" };this.advanced_buttons=[ ['new_document','newdocument.gif','new_document',false],['search','search.gif','show_search',false],['go_to_line','go_to_line.gif','go_to_line',false],['undo','undo.gif','undo',true],['redo','redo.gif','redo',true],['change_smooth_selection','smooth_selection.gif','change_smooth_selection_mode',true],['reset_highlight','reset_highlight.gif','resync_highlight',true],['highlight','highlight.gif','change_highlight',true],['help','help.gif','show_help',false],['save','save.gif','save',false],['load','load.gif','load',false],['fullscreen','fullscreen.gif','toggle_full_screen',false],['autocompletion','autocompletion.gif','toggle_autocompletion',true] ];ua=navigator.userAgent;this.nav=new Object();this.nav['isMacOS']=(ua.indexOf('Mac OS')!=-1);this.nav['isIE']=(navigator.appName=="Microsoft Internet Explorer");if(this.nav['isIE']){this.nav['isIE']=ua.replace(/^.*?MSIE ([0-9\.]*).*$/,"$1");if(this.nav['isIE']<6)this.has_error();}if(this.nav['isNS']=ua.indexOf('Netscape/')!=-1){this.nav['isNS']=ua.substr(ua.indexOf('Netscape/')+9);if(this.nav['isNS']<8||!this.nav['isIE'])this.has_error();}if(this.nav['isOpera']=(ua.indexOf('Opera')!=-1)){this.nav['isOpera']=ua.replace(/^.*?Opera.*?([0-9\.]+).*$/i,"$1");if(this.nav['isOpera']<9)this.has_error();this.nav['isIE']=false;}this.nav['isGecko']=(ua.indexOf('Gecko')!=-1);if(this.nav['isFirefox'] =(ua.indexOf('Firefox')!=-1))this.nav['isFirefox']=ua.replace(/^.*?Firefox.*?([0-9\.]+).*$/i,"$1");if(this.nav['isIceweasel'] =(ua.indexOf('Iceweasel')!=-1))this.nav['isFirefox']=this.nav['isIceweasel']=ua.replace(/^.*?Iceweasel.*?([0-9\.]+).*$/i,"$1");if(this.nav['GranParadiso'] =(ua.indexOf('GranParadiso')!=-1))this.nav['isFirefox']=this.nav['isGranParadiso']=ua.replace(/^.*?GranParadiso.*?([0-9\.]+).*$/i,"$1");if(this.nav['BonEcho'] =(ua.indexOf('BonEcho')!=-1))this.nav['isFirefox']=this.nav['isBonEcho']=ua.replace(/^.*?BonEcho.*?([0-9\.]+).*$/i,"$1");if(this.nav['isCamino'] =(ua.indexOf('Camino')!=-1))this.nav['isCamino']=ua.replace(/^.*?Camino.*?([0-9\.]+).*$/i,"$1");if(this.nav['isChrome'] =(ua.indexOf('Chrome')!=-1))this.nav['isChrome']=ua.replace(/^.*?Chrome.*?([0-9\.]+).*$/i,"$1");if(this.nav['isSafari'] =(ua.indexOf('Safari')!=-1))this.nav['isSafari']=ua.replace(/^.*?Version\/([0-9]+\.[0-9]+).*$/i,"$1");if(this.nav['isIE']>=6||this.nav['isOpera']>=9||this.nav['isFirefox']||this.nav['isChrome']||this.nav['isCamino']||this.nav['isSafari']>=3)this.nav['isValidBrowser']=true; else this.nav['isValidBrowser']=false;this.set_base_url();for(var i=0;i<this.scripts_to_load.length;i++){setTimeout("eAL.load_script('"+this.baseURL+this.scripts_to_load[i]+".js');",1);this.waiting_loading[this.scripts_to_load[i]+".js"]=false;}this.add_event(window,"load",EAL.prototype.window_loaded);};EAL.prototype ={has_error:function(){this.error=true;for(var i in EAL.prototype){EAL.prototype[i]=function(){};}},window_loaded:function(){eAL.win="loaded";if (document.forms){for (var i=0;i<document.forms.length;i++){var form=document.forms[i];form.edit_area_replaced_submit=null;try{form.edit_area_replaced_submit=form.onsubmit;form.onsubmit="";}catch (e){}eAL.add_event(form,"submit",EAL.prototype.submit);eAL.add_event(form,"reset",EAL.prototype.reset);}}eAL.add_event(window,"unload",function(){for(var i in eAs){eAL.delete_instance(i);}});},init_ie_textarea:function(id){var t=document.getElementById(id);try{if(t&&typeof(t.focused)=="undefined"){t.focus();t.focused=true;t.selectionStart=t.selectionEnd=0;get_IE_selection(t);eAL.add_event(t,"focus",IE_textarea_focus);eAL.add_event(t,"blur",IE_textarea_blur);}}catch(ex){}},init:function(settings){if(!settings["id"])this.has_error();if(this.error)return;if(eAs[settings["id"]])eAL.delete_instance(settings["id"]);for(var i in this.default_settings){if(typeof(settings[i])=="undefined")settings[i]=this.default_settings[i];}if(settings["browsers"]=="known"&&this.nav['isValidBrowser']==false){return;}if(settings["begin_toolbar"].length>0)settings["toolbar"]=settings["begin_toolbar"] +","+settings["toolbar"];if(settings["end_toolbar"].length>0)settings["toolbar"]=settings["toolbar"] +","+settings["end_toolbar"];settings["tab_toolbar"]=settings["toolbar"].replace(/ /g,"").split(",");settings["plugins"]=settings["plugins"].replace(/ /g,"").split(",");for(var i=0;i<settings["plugins"].length;i++){if(settings["plugins"][i].length==0)settings["plugins"].splice(i,1);}this.get_template();this.load_script(this.baseURL+"langs/"+settings["language"]+".js");if(settings["syntax"].length>0){settings["syntax"]=settings["syntax"].toLowerCase();this.load_script(this.baseURL+"reg_syntax/"+settings["syntax"]+".js");}eAs[settings["id"]]={"settings":settings};eAs[settings["id"]]["displayed"]=false;eAs[settings["id"]]["hidden"]=false;eAL.start(settings["id"]);},delete_instance:function(id){eAL.execCommand(id,"EA_delete");if(window.frames["frame_"+id]&&window.frames["frame_"+id].editArea){if(eAs[id]["displayed"])eAL.toggle(id,"off");window.frames["frame_"+id].editArea.execCommand("EA_unload");}var span=document.getElementById("EditAreaArroundInfos_"+id);if(span)span.parentNode.removeChild(span);var iframe=document.getElementById("frame_"+id);if(iframe){iframe.parentNode.removeChild(iframe);try{delete window.frames["frame_"+id];}catch (e){}}delete eAs[id];},start:function(id){if(this.win!="loaded"){setTimeout("eAL.start('"+id+"');",50);return;}for(var i in eAL.waiting_loading){if(eAL.waiting_loading[i]!="loaded"&&typeof(eAL.waiting_loading[i])!="function"){setTimeout("eAL.start('"+id+"');",50);return;}}if(!eAL.lang[eAs[id]["settings"]["language"]]||(eAs[id]["settings"]["syntax"].length>0&&!eAL.load_syntax[eAs[id]["settings"]["syntax"]])){setTimeout("eAL.start('"+id+"');",50);return;}if(eAs[id]["settings"]["syntax"].length>0)eAL.init_syntax_regexp();if(!document.getElementById("EditAreaArroundInfos_"+id)&&(eAs[id]["settings"]["debug"]||eAs[id]["settings"]["allow_toggle"])){var span=document.createElement("span");span.id="EditAreaArroundInfos_"+id;var html="";if(eAs[id]["settings"]["allow_toggle"]){checked=(eAs[id]["settings"]["display"]=="onload")?"checked":"";html+="<div id='edit_area_toggle_"+i+"'>";html+="<input id='edit_area_toggle_checkbox_"+id +"' class='toggle_"+id +"' type='checkbox' onclick='eAL.toggle(\""+id +"\");' accesskey='e' "+checked+" />";html+="<label for='edit_area_toggle_checkbox_"+id +"'>{$toggle}</label></div>";}if(eAs[id]["settings"]["debug"])html+="<textarea id='edit_area_debug_"+id +"' style='z-index:20;width:100%;height:120px;overflow:auto;border:solid black 1px;'></textarea><br />";html=eAL.translate(html,eAs[id]["settings"]["language"]);span.innerHTML=html;var father=document.getElementById(id).parentNode;var next=document.getElementById(id).nextSibling;if(next==null)father.appendChild(span);
function EAL(){var t=this;t.version="0.8.2";date=new Date();t.start_time=date.getTime();t.win="loading";t.error=false;t.baseURL="";t.template="";t.lang={};t.load_syntax={};t.syntax={};t.loadedFiles=[];t.waiting_loading={};t.scripts_to_load=[];t.sub_scripts_to_load=[];t.syntax_display_name={'basic':'Basic','brainfuck':'Brainfuck','c':'C','coldfusion':'Coldfusion','cpp':'CPP','css':'CSS','html':'HTML','java':'Java','js':'Javascript','pas':'Pascal','perl':'Perl','php':'Php','python':'Python','robotstxt':'Robots txt','ruby':'Ruby','sql':'SQL','tsql':'T-SQL','vb':'Visual Basic','xml':'XML'};t.resize=[];t.hidden={};t.default_settings={debug:false,smooth_selection:true,font_size:"10",font_family:"monospace",start_highlight:false,toolbar:"search,go_to_line,fullscreen,|,undo,redo,|,select_font,|,change_smooth_selection,highlight,reset_highlight,word_wrap,|,help",begin_toolbar:"",end_toolbar:"",is_multi_files:false,allow_resize:"both",show_line_colors:false,min_width:400,min_height:125,replace_tab_by_spaces:false,allow_toggle:true,language:"en",syntax:"",syntax_selection_allow:"basic,brainfuck,c,coldfusion,cpp,css,html,java,js,pas,perl,php,python,ruby,robotstxt,sql,tsql,vb,xml",display:"onload",max_undo:30,browsers:"known",plugins:"",gecko_spellcheck:false,fullscreen:false,is_editable:true,cursor_position:"begin",word_wrap:false,autocompletion:false,load_callback:"",save_callback:"",change_callback:"",submit_callback:"",EA_init_callback:"",EA_delete_callback:"",EA_load_callback:"",EA_unload_callback:"",EA_toggle_on_callback:"",EA_toggle_off_callback:"",EA_file_switch_on_callback:"",EA_file_switch_off_callback:"",EA_file_close_callback:""};t.advanced_buttons=[ ['new_document','newdocument.gif','new_document',false],['search','search.gif','show_search',false],['go_to_line','go_to_line.gif','go_to_line',false],['undo','undo.gif','undo',true],['redo','redo.gif','redo',true],['change_smooth_selection','smooth_selection.gif','change_smooth_selection_mode',true],['reset_highlight','reset_highlight.gif','resync_highlight',true],['highlight','highlight.gif','change_highlight',true],['help','help.gif','show_help',false],['save','save.gif','save',false],['load','load.gif','load',false],['fullscreen','fullscreen.gif','toggle_full_screen',false],['word_wrap','word_wrap.gif','toggle_word_wrap',true],['autocompletion','autocompletion.gif','toggle_autocompletion',true] ];t.set_browser_infos(t);if(t.isIE>=6||t.isGecko||(t.isWebKit&&!t.isSafari<3)||t.isOpera>=9||t.isCamino)t.isValidBrowser=true; else t.isValidBrowser=false;t.set_base_url();for(var i=0;i<t.scripts_to_load.length;i++){setTimeout("eAL.load_script('"+t.baseURL+t.scripts_to_load[i]+".js');",1);t.waiting_loading[t.scripts_to_load[i]+".js"]=false;}t.add_event(window,"load",EAL.prototype.window_loaded);};EAL.prototype={has_error:function(){this.error=true;for(var i in EAL.prototype){EAL.prototype[i]=function(){};}},set_browser_infos:function(o){ua=navigator.userAgent;o.isWebKit=/WebKit/.test(ua);o.isGecko=!o.isWebKit&&/Gecko/.test(ua);o.isMac=/Mac/.test(ua);o.isIE=(navigator.appName=="Microsoft Internet Explorer");if(o.isIE){o.isIE=ua.replace(/^.*?MSIE\s+([0-9\.]+).*$/,"$1");if(o.isIE<6)o.has_error();}if(o.isOpera=(ua.indexOf('Opera')!=-1)){o.isOpera=ua.replace(/^.*?Opera.*?([0-9\.]+).*$/i,"$1");if(o.isOpera<9)o.has_error();o.isIE=false;}if(o.isFirefox=(ua.indexOf('Firefox')!=-1))o.isFirefox=ua.replace(/^.*?Firefox.*?([0-9\.]+).*$/i,"$1");if(ua.indexOf('Iceweasel')!=-1)o.isFirefox=ua.replace(/^.*?Iceweasel.*?([0-9\.]+).*$/i,"$1");if(ua.indexOf('GranParadiso')!=-1)o.isFirefox=ua.replace(/^.*?GranParadiso.*?([0-9\.]+).*$/i,"$1");if(ua.indexOf('BonEcho')!=-1)o.isFirefox=ua.replace(/^.*?BonEcho.*?([0-9\.]+).*$/i,"$1");if(ua.indexOf('SeaMonkey')!=-1)o.isFirefox=(ua.replace(/^.*?SeaMonkey.*?([0-9\.]+).*$/i,"$1"))+1;if(o.isCamino=(ua.indexOf('Camino')!=-1))o.isCamino=ua.replace(/^.*?Camino.*?([0-9\.]+).*$/i,"$1");if(o.isSafari=(ua.indexOf('Safari')!=-1))o.isSafari=ua.replace(/^.*?Version\/([0-9]+\.[0-9]+).*$/i,"$1");if(o.isChrome=(ua.indexOf('Chrome')!=-1)){o.isChrome=ua.replace(/^.*?Chrome.*?([0-9\.]+).*$/i,"$1");o.isSafari=false;}},window_loaded:function(){eAL.win="loaded";if(document.forms){for(var i=0;i<document.forms.length;i++){var form=document.forms[i];form.edit_area_replaced_submit=null;try{form.edit_area_replaced_submit=form.onsubmit;form.onsubmit="";}catch(e){}eAL.add_event(form,"submit",EAL.prototype.submit);eAL.add_event(form,"reset",EAL.prototype.reset);}}eAL.add_event(window,"unload",function(){for(var i in eAs){eAL.delete_instance(i);}});},init_ie_textarea:function(id){var a=document.getElementById(id);try{if(a&&typeof(a.focused)=="undefined"){a.focus();a.focused=true;a.selectionStart=a.selectionEnd=0;get_IE_selection(a);eAL.add_event(a,"focus",IE_textarea_focus);eAL.add_event(a,"blur",IE_textarea_blur);}}catch(ex){}},init:function(settings){var t=this,s=settings,i;if(!s["id"])t.has_error();if(t.error)return;if(eAs[s["id"]])t.delete_instance(s["id"]);for(i in t.default_settings){if(typeof(s[i])=="undefined")s[i]=t.default_settings[i];}if(s["browsers"]=="known"&&t.isValidBrowser==false){return;}if(s["begin_toolbar"].length>0)s["toolbar"]=s["begin_toolbar"]+","+s["toolbar"];if(s["end_toolbar"].length>0)s["toolbar"]=s["toolbar"]+","+s["end_toolbar"];s["tab_toolbar"]=s["toolbar"].replace(/ /g,"").split(",");s["plugins"]=s["plugins"].replace(/ /g,"").split(",");for(i=0;i<s["plugins"].length;i++){if(s["plugins"][i].length==0)s["plugins"].splice(i,1);}t.get_template();t.load_script(t.baseURL+"langs/"+s["language"]+".js");if(s["syntax"].length>0){s["syntax"]=s["syntax"].toLowerCase();t.load_script(t.baseURL+"reg_syntax/"+s["syntax"]+".js");}eAs[s["id"]]={"settings":s};eAs[s["id"]]["displayed"]=false;eAs[s["id"]]["hidden"]=false;t.start(s["id"]);},delete_instance:function(id){var d=document,fs=window.frames,span,iframe;eAL.execCommand(id,"EA_delete");if(fs["frame_"+id]&&fs["frame_"+id].editArea){if(eAs[id]["displayed"])eAL.toggle(id,"off");fs["frame_"+id].editArea.execCommand("EA_unload");}span=d.getElementById("EditAreaArroundInfos_"+id);if(span)span.parentNode.removeChild(span);iframe=d.getElementById("frame_"+id);if(iframe){iframe.parentNode.removeChild(iframe);try{delete fs["frame_"+id];}catch(e){}}delete eAs[id];},start:function(id){var t=this,d=document,f,span,father,next,html='',html_toolbar_content='',template,content,i;if(t.win!="loaded"){setTimeout("eAL.start('"+id+"');",50);return;}for(i in t.waiting_loading){if(t.waiting_loading[i]!="loaded"&&typeof(t.waiting_loading[i])!="function"){setTimeout("eAL.start('"+id+"');",50);return;}}if(!t.lang[eAs[id]["settings"]["language"]]||(eAs[id]["settings"]["syntax"].length>0&&!t.load_syntax[eAs[id]["settings"]["syntax"]])){setTimeout("eAL.start('"+id+"');",50);return;}if(eAs[id]["settings"]["syntax"].length>0)t.init_syntax_regexp();if(!d.getElementById("EditAreaArroundInfos_"+id)&&(eAs[id]["settings"]["debug"]||eAs[id]["settings"]["allow_toggle"])){span=d.createElement("span");span.id="EditAreaArroundInfos_"+id;if(eAs[id]["settings"]["allow_toggle"]){checked=(eAs[id]["settings"]["display"]=="onload")?"checked='checked'":"";html+="<div id='edit_area_toggle_"+i+"'>";html+="<input id='edit_area_toggle_checkbox_"+id+"' class='toggle_"+id+"' type='checkbox' onclick='eAL.toggle(\""+id+"\");' accesskey='e' "+checked+" />";html+="<label for='edit_area_toggle_checkbox_"+id+"'>{$toggle}</label></div>";}if(eAs[id]["settings"]["debug"])html+="<textarea id='edit_area_debug_"+id+"' spellcheck='off' style='z-index:20;width:100%;height:120px;overflow:auto;border:solid black 1px;'></textarea><br />";html=t.translate(html,eAs[id]["settings"]["language"]);span.innerHTML=html;father=d.getElementById(id).parentNode;next=d.getElementById(id).nextSibling;if(next==null)father.appendChild(span);
function EAL(){this.version="0.7.2.3";date=new Date();this.start_time=date.getTime();this.win="loading";this.error=false;this.baseURL="";this.template="";this.lang=new Object();this.load_syntax=new Object();this.syntax=new Object();this.loadedFiles=new Array();this.waiting_loading=new Object();this.scripts_to_load=new Array();this.sub_scripts_to_load=new Array();this.resize=new Array();this.hidden=new Object();this.default_settings={debug:false ,smooth_selection:true ,font_size:"10" ,font_family:"monospace" ,start_highlight:false ,autocompletion:false ,toolbar:"search,go_to_line,fullscreen,|,undo,redo,|,select_font,|,change_smooth_selection,highlight,reset_highlight,|,help" ,begin_toolbar:"" ,end_toolbar:"" ,is_multi_files:false ,allow_resize:"both" ,show_line_colors:false ,min_width:400 ,min_height:125 ,replace_tab_by_spaces:false ,allow_toggle:true ,language:"en" ,syntax:"" ,syntax_selection_allow:"basic,brainfuck,c,coldfusion,cpp,css,html,js,pas,perl,php,python,ruby,robotstxt,sql,tsql,vb,xml" ,display:"onload" ,max_undo:30 ,browsers:"known" ,plugins:"" ,gecko_spellcheck:false ,fullscreen:false ,is_editable:true ,wrap_text:false ,load_callback:"" ,save_callback:"" ,change_callback:"" ,submit_callback:"" ,EA_init_callback:"" ,EA_delete_callback:"" ,EA_load_callback:"" ,EA_unload_callback:"" ,EA_toggle_on_callback:"" ,EA_toggle_off_callback:"" ,EA_file_switch_on_callback:"" ,EA_file_switch_off_callback:"" ,EA_file_close_callback:"" };this.advanced_buttons=[ ['new_document','newdocument.gif','new_document',false],['search','search.gif','show_search',false],['go_to_line','go_to_line.gif','go_to_line',false],['undo','undo.gif','undo',true],['redo','redo.gif','redo',true],['change_smooth_selection','smooth_selection.gif','change_smooth_selection_mode',true],['reset_highlight','reset_highlight.gif','resync_highlight',true],['highlight','highlight.gif','change_highlight',true],['help','help.gif','show_help',false],['save','save.gif','save',false],['load','load.gif','load',false],['fullscreen','fullscreen.gif','toggle_full_screen',false],['autocompletion','autocompletion.gif','toggle_autocompletion',true] ];ua=navigator.userAgent;this.nav=new Object();this.nav['isMacOS']=(ua.indexOf('Mac OS')!=-1);this.nav['isIE']=(navigator.appName=="Microsoft Internet Explorer");if(this.nav['isIE']){this.nav['isIE']=ua.replace(/^.*?MSIE ([0-9\.]*).*$/,"$1");if(this.nav['isIE']<6)this.has_error();}if(this.nav['isNS']=ua.indexOf('Netscape/')!=-1){this.nav['isNS']=ua.substr(ua.indexOf('Netscape/')+9);if(this.nav['isNS']<8||!this.nav['isIE'])this.has_error();}if(this.nav['isOpera']=(ua.indexOf('Opera')!=-1)){this.nav['isOpera']=ua.replace(/^.*?Opera.*?([0-9\.]+).*$/i,"$1");if(this.nav['isOpera']<9)this.has_error();this.nav['isIE']=false;}this.nav['isGecko']=(ua.indexOf('Gecko')!=-1);if(this.nav['isFirefox'] =(ua.indexOf('Firefox')!=-1))this.nav['isFirefox']=ua.replace(/^.*?Firefox.*?([0-9\.]+).*$/i,"$1");if(this.nav['isIceweasel'] =(ua.indexOf('Iceweasel')!=-1))this.nav['isFirefox']=this.nav['isIceweasel']=ua.replace(/^.*?Iceweasel.*?([0-9\.]+).*$/i,"$1");if(this.nav['GranParadiso'] =(ua.indexOf('GranParadiso')!=-1))this.nav['isFirefox']=this.nav['isGranParadiso']=ua.replace(/^.*?GranParadiso.*?([0-9\.]+).*$/i,"$1");if(this.nav['BonEcho'] =(ua.indexOf('BonEcho')!=-1))this.nav['isFirefox']=this.nav['isBonEcho']=ua.replace(/^.*?BonEcho.*?([0-9\.]+).*$/i,"$1");if(this.nav['isCamino'] =(ua.indexOf('Camino')!=-1))this.nav['isCamino']=ua.replace(/^.*?Camino.*?([0-9\.]+).*$/i,"$1");if(this.nav['isChrome'] =(ua.indexOf('Chrome')!=-1))this.nav['isChrome']=ua.replace(/^.*?Chrome.*?([0-9\.]+).*$/i,"$1");if(this.nav['isSafari'] =(ua.indexOf('Safari')!=-1))this.nav['isSafari']=ua.replace(/^.*?Version\/([0-9]+\.[0-9]+).*$/i,"$1");if(this.nav['isIE']>=6||this.nav['isOpera']>=9||this.nav['isFirefox']||this.nav['isChrome']||this.nav['isCamino']||this.nav['isSafari']>=3)this.nav['isValidBrowser']=true;else this.nav['isValidBrowser']=false;this.set_base_url();for(var i=0;i<this.scripts_to_load.length;i++){setTimeout("eAL.load_script('"+this.baseURL+this.scripts_to_load[i]+".js');",1);this.waiting_loading[this.scripts_to_load[i]+".js"]=false;}this.add_event(window,"load",EAL.prototype.window_loaded);};EAL.prototype ={has_error:function(){this.error=true;for(var i in EAL.prototype){EAL.prototype[i]=function(){};}},window_loaded:function(){eAL.win="loaded";if (document.forms){for (var i=0;i<document.forms.length;i++){var form=document.forms[i];form.edit_area_replaced_submit=null;try{form.edit_area_replaced_submit=form.onsubmit;form.onsubmit="";}catch (e){}eAL.add_event(form,"submit",EAL.prototype.submit);eAL.add_event(form,"reset",EAL.prototype.reset);}}eAL.add_event(window,"unload",function(){for(var i in eAs){eAL.delete_instance(i);}});},init_ie_textarea:function(id){var t=document.getElementById(id);try{if(t&&typeof(t.focused)=="undefined"){t.focus();t.focused=true;t.selectionStart=t.selectionEnd=0;get_IE_selection(t);eAL.add_event(t,"focus",IE_textarea_focus);eAL.add_event(t,"blur",IE_textarea_blur);}}catch(ex){}},init:function(settings){if(!settings["id"])this.has_error();if(this.error)return;if(eAs[settings["id"]])eAL.delete_instance(settings["id"]);for(var i in this.default_settings){if(typeof(settings[i])=="undefined")settings[i]=this.default_settings[i];}if(settings["browsers"]=="known"&&this.nav['isValidBrowser']==false){return;}if(settings["begin_toolbar"].length>0)settings["toolbar"]=settings["begin_toolbar"] +","+settings["toolbar"];if(settings["end_toolbar"].length>0)settings["toolbar"]=settings["toolbar"] +","+settings["end_toolbar"];settings["tab_toolbar"]=settings["toolbar"].replace(/ /g,"").split(",");settings["plugins"]=settings["plugins"].replace(/ /g,"").split(",");for(var i=0;i<settings["plugins"].length;i++){if(settings["plugins"][i].length==0)settings["plugins"].splice(i,1);}this.get_template();this.load_script(this.baseURL+"langs/"+settings["language"]+".js");if(settings["syntax"].length>0){settings["syntax"]=settings["syntax"].toLowerCase();this.load_script(this.baseURL+"reg_syntax/"+settings["syntax"]+".js");}eAs[settings["id"]]={"settings":settings};eAs[settings["id"]]["displayed"]=false;eAs[settings["id"]]["hidden"]=false;eAL.start(settings["id"]);},delete_instance:function(id){eAL.execCommand(id,"EA_delete");if(window.frames["frame_"+id]&&window.frames["frame_"+id].editArea){if(eAs[id]["displayed"])eAL.toggle(id,"off");window.frames["frame_"+id].editArea.execCommand("EA_unload");}var span=document.getElementById("EditAreaArroundInfos_"+id);if(span)span.parentNode.removeChild(span);var iframe=document.getElementById("frame_"+id);if(iframe){iframe.parentNode.removeChild(iframe);try{delete window.frames["frame_"+id];}catch (e){}}delete eAs[id];},start:function(id){if(this.win!="loaded"){setTimeout("eAL.start('"+id+"');",50);return;}for(var i in eAL.waiting_loading){if(eAL.waiting_loading[i]!="loaded"&&typeof(eAL.waiting_loading[i])!="function"){setTimeout("eAL.start('"+id+"');",50);return;}}if(!eAL.lang[eAs[id]["settings"]["language"]]||(eAs[id]["settings"]["syntax"].length>0&&!eAL.load_syntax[eAs[id]["settings"]["syntax"]])){setTimeout("eAL.start('"+id+"');",50);return;}if(eAs[id]["settings"]["syntax"].length>0)eAL.init_syntax_regexp();if(!document.getElementById("EditAreaArroundInfos_"+id)&&(eAs[id]["settings"]["debug"]||eAs[id]["settings"]["allow_toggle"])){var span=document.createElement("span");span.id="EditAreaArroundInfos_"+id;var html="";if(eAs[id]["settings"]["allow_toggle"]){checked=(eAs[id]["settings"]["display"]=="onload")?"checked":"";html+="<div id='edit_area_toggle_"+i+"'>";html+="<input id='edit_area_toggle_checkbox_"+id +"' class='toggle_"+id +"' type='checkbox' onclick='eAL.toggle(\""+id +"\");' accesskey='e' "+checked+" />";html+="<label for='edit_area_toggle_checkbox_"+id +"'>{$toggle}</label></div>";}if(eAs[id]["settings"]["debug"])html+="<textarea id='edit_area_debug_"+id +"' style='z-index:20;width:100%;height:120px;overflow:auto;border:solid black 1px;'></textarea><br />";html=eAL.translate(html,eAs[id]["settings"]["language"]);span.innerHTML=html;var father=document.getElementById(id).parentNode;var next=document.getElementById(id).nextSibling;if(next==null)father.appendChild(span);
if (value[ref.i] == '"' && (ref.i + 1 >= valueLength || value[ref.i + 1] == findChar))
if (value[ref.i] == '"')
JSV.eatUntilCharFound_ = function(value, ref, findChar){ var tokenStartPos = ref.i; var valueLength = value.length; if (value[tokenStartPos] != '"') { ref.i = value.indexOf(findChar, tokenStartPos); if (ref.i == -1) ref.i = valueLength; return value.substr(tokenStartPos, ref.i - tokenStartPos); } while (++ref.i < valueLength) { if (value[ref.i] == '"' && (ref.i + 1 >= valueLength || value[ref.i + 1] == findChar)) { ref.i++; return value.substr(tokenStartPos, ref.i - tokenStartPos); } } throw "Could not find ending quote";}
ref.i++; return value.substr(tokenStartPos, ref.i - tokenStartPos);
if (ref.i + 1 >= valueLength) { return value.substr(tokenStartPos, ++ref.i - tokenStartPos); } if (value[ref.i + 1] == '"') { ref.i++; } else if (value[ref.i + 1] == findChar) { return value.substr(tokenStartPos, ++ref.i - tokenStartPos); }
JSV.eatUntilCharFound_ = function(value, ref, findChar){ var tokenStartPos = ref.i; var valueLength = value.length; if (value[tokenStartPos] != '"') { ref.i = value.indexOf(findChar, tokenStartPos); if (ref.i == -1) ref.i = valueLength; return value.substr(tokenStartPos, ref.i - tokenStartPos); } while (++ref.i < valueLength) { if (value[ref.i] == '"' && (ref.i + 1 >= valueLength || value[ref.i + 1] == findChar)) { ref.i++; return value.substr(tokenStartPos, ref.i - tokenStartPos); } } throw "Could not find ending quote";}
if (onSuccessFn) onSuccessFn(r.getResult().Text);
if (onSuccessFn) onSuccessFn(r.Text);
echo: function(text, onSuccessFn, onErrorFn) { this.gateway.getFromService('Echo', { Text: text || null }, function(r) { if (onSuccessFn) onSuccessFn(r.getResult().Text); }, onErrorFn || RedisClient.errorFn); },
this.log("add emphasis? " + isAddEmphasis);
emphasis: function(array, isAddEmphasis, searchText ) { var searchTextLength = searchText.length || 0; var options = this.selectbox.get(0).options; var tritem, index, indexB, li, text, stPattern, escapedST; isAddEmphasis = (isAddEmphasis && searchTextLength > 0); // don't add emphasis to 0-length if(isAddEmphasis) { escapedST = searchText.replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1"); // http://xkr.us/js/regexregex stPattern = new RegExp("(" + escapedST + ")", "gi"); // $1 } this.log("add emphasis? " + isAddEmphasis); // console.time("em"); index = array.length; while(index--) { tritem = array[index]; indexB = tritem.length; while(indexB--) { // duplicate match array li = tritem[indexB]; text = $.trim(options[li.getAttribute("name")].text); if (isAddEmphasis) { li.innerHTML = text.replace(stPattern, "<em>$1</em>"); } else { li.innerHTML = text; } } } // console.timeEnd("em"); },
var options = this.selectbox.get(0).options;
var wrappedSearchText = "<em>" + searchText + "</em>"; var stPattern = new RegExp( searchText.replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1"), "gi");
emphasis: function(array, isAddEmphasis, searchText ) { //console.time("em"); var searchTextLength = searchText.length || 0; var tritem, index, indexB, li, text; var options = this.selectbox.get(0).options; isAddEmphasis = (isAddEmphasis && searchTextLength); // don't add emphasis to 0-length index = array.length; while(index--) { tritem = array[index]; indexB = tritem.length; while(indexB--) { // duplicate match array li = tritem[indexB]; text = $.trim(options[li.getAttribute("name")].text); if (isAddEmphasis) { //TODO regex is faster? li.innerHTML = '<em>' + text.slice(0, searchTextLength) + '</em>' + text.slice(searchTextLength) ; } else { li.innerHTML = text; } } } //console.timeEnd("em"); },
li.innerHTML = '<em>' + text.slice(0, searchTextLength) + '</em>' + text.slice(searchTextLength) ;
li.innerHTML = text.replace(stPattern, wrappedSearchText);
emphasis: function(array, isAddEmphasis, searchText ) { //console.time("em"); var searchTextLength = searchText.length || 0; var tritem, index, indexB, li, text; var options = this.selectbox.get(0).options; isAddEmphasis = (isAddEmphasis && searchTextLength); // don't add emphasis to 0-length index = array.length; while(index--) { tritem = array[index]; indexB = tritem.length; while(indexB--) { // duplicate match array li = tritem[indexB]; text = $.trim(options[li.getAttribute("name")].text); if (isAddEmphasis) { //TODO regex is faster? li.innerHTML = '<em>' + text.slice(0, searchTextLength) + '</em>' + text.slice(searchTextLength) ; } else { li.innerHTML = text; } } } //console.timeEnd("em"); },
li.innerHTML = text.replace(stPattern, "<em>$1</em>");
li.innerHTML = text.replace(stPattern, "<em>$1</em>").replace("&", "&amp;");
emphasis: function(array, isAddEmphasis, searchText ) { var searchTextLength = searchText.length || 0; var options = this.selectbox.get(0).options; var tritem, index, indexB, li, text, stPattern, escapedST; index = array.length; isAddEmphasis = (isAddEmphasis && searchTextLength > 0 && index > 1); // don't add emphasis to 0-length or single item if(isAddEmphasis) { escapedST = searchText.replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1"); // http://xkr.us/js/regexregex stPattern = new RegExp("(" + escapedST + ")", "gi"); // $1 this.hasEmphasis = true; } // this.log("add emphasis? " + isAddEmphasis); // console.time("em"); while(index--) { tritem = array[index]; indexB = tritem.length; while(indexB--) { // duplicate match array li = tritem[indexB]; text = $.trim(options[li.getAttribute("name")].text); if (isAddEmphasis) { li.innerHTML = text.replace(stPattern, "<em>$1</em>"); } else { li.innerHTML = text; } } } // console.timeEnd("em"); },
li.innerHTML = text;
li.innerHTML = text.replace("&", "&amp;");
emphasis: function(array, isAddEmphasis, searchText ) { var searchTextLength = searchText.length || 0; var options = this.selectbox.get(0).options; var tritem, index, indexB, li, text, stPattern, escapedST; index = array.length; isAddEmphasis = (isAddEmphasis && searchTextLength > 0 && index > 1); // don't add emphasis to 0-length or single item if(isAddEmphasis) { escapedST = searchText.replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1"); // http://xkr.us/js/regexregex stPattern = new RegExp("(" + escapedST + ")", "gi"); // $1 this.hasEmphasis = true; } // this.log("add emphasis? " + isAddEmphasis); // console.time("em"); while(index--) { tritem = array[index]; indexB = tritem.length; while(indexB--) { // duplicate match array li = tritem[indexB]; text = $.trim(options[li.getAttribute("name")].text); if (isAddEmphasis) { li.innerHTML = text.replace(stPattern, "<em>$1</em>"); } else { li.innerHTML = text; } } } // console.timeEnd("em"); },
var tritem, index, indexB, li, text;
var tritem, index, indexB, li, text, stPattern, escapedST; isAddEmphasis = (isAddEmphasis && searchTextLength > 0);
emphasis: function(array, isAddEmphasis, searchText ) { //console.time("em"); var searchTextLength = searchText.length || 0; var options = this.selectbox.get(0).options; var tritem, index, indexB, li, text; var wrappedSearchText = "<em>" + searchText + "</em>"; var stPattern = new RegExp( searchText.replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1"), // http://xkr.us/js/regexregex "gi"); isAddEmphasis = (isAddEmphasis && searchTextLength); // don't add emphasis to 0-length index = array.length; while(index--) { tritem = array[index]; indexB = tritem.length; while(indexB--) { // duplicate match array li = tritem[indexB]; text = $.trim(options[li.getAttribute("name")].text); if (isAddEmphasis) { li.innerHTML = text.replace(stPattern, wrappedSearchText); } else { li.innerHTML = text; } } } //console.timeEnd("em"); },
var wrappedSearchText = "<em>" + searchText + "</em>"; var stPattern = new RegExp( searchText.replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1"), "gi");
if(isAddEmphasis) { escapedST = searchText.replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1"); stPattern = new RegExp("(" + escapedST + ")", "gi"); }
emphasis: function(array, isAddEmphasis, searchText ) { //console.time("em"); var searchTextLength = searchText.length || 0; var options = this.selectbox.get(0).options; var tritem, index, indexB, li, text; var wrappedSearchText = "<em>" + searchText + "</em>"; var stPattern = new RegExp( searchText.replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1"), // http://xkr.us/js/regexregex "gi"); isAddEmphasis = (isAddEmphasis && searchTextLength); // don't add emphasis to 0-length index = array.length; while(index--) { tritem = array[index]; indexB = tritem.length; while(indexB--) { // duplicate match array li = tritem[indexB]; text = $.trim(options[li.getAttribute("name")].text); if (isAddEmphasis) { li.innerHTML = text.replace(stPattern, wrappedSearchText); } else { li.innerHTML = text; } } } //console.timeEnd("em"); },
isAddEmphasis = (isAddEmphasis && searchTextLength);
emphasis: function(array, isAddEmphasis, searchText ) { //console.time("em"); var searchTextLength = searchText.length || 0; var options = this.selectbox.get(0).options; var tritem, index, indexB, li, text; var wrappedSearchText = "<em>" + searchText + "</em>"; var stPattern = new RegExp( searchText.replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1"), // http://xkr.us/js/regexregex "gi"); isAddEmphasis = (isAddEmphasis && searchTextLength); // don't add emphasis to 0-length index = array.length; while(index--) { tritem = array[index]; indexB = tritem.length; while(indexB--) { // duplicate match array li = tritem[indexB]; text = $.trim(options[li.getAttribute("name")].text); if (isAddEmphasis) { li.innerHTML = text.replace(stPattern, wrappedSearchText); } else { li.innerHTML = text; } } } //console.timeEnd("em"); },
li.innerHTML = text.replace(stPattern, wrappedSearchText);
li.innerHTML = text.replace(stPattern, "<em>$1</em>");
emphasis: function(array, isAddEmphasis, searchText ) { //console.time("em"); var searchTextLength = searchText.length || 0; var options = this.selectbox.get(0).options; var tritem, index, indexB, li, text; var wrappedSearchText = "<em>" + searchText + "</em>"; var stPattern = new RegExp( searchText.replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1"), // http://xkr.us/js/regexregex "gi"); isAddEmphasis = (isAddEmphasis && searchTextLength); // don't add emphasis to 0-length index = array.length; while(index--) { tritem = array[index]; indexB = tritem.length; while(indexB--) { // duplicate match array li = tritem[indexB]; text = $.trim(options[li.getAttribute("name")].text); if (isAddEmphasis) { li.innerHTML = text.replace(stPattern, wrappedSearchText); } else { li.innerHTML = text; } } } //console.timeEnd("em"); },
var tritem, index, indexB, li, text, stPattern, escapedST;
emphasis: function(array, isAddEmphasis, searchText ) { var searchTextLength = searchText.length || 0; var options = this.selectbox.get(0).options; var tritem, index, indexB, li, text, stPattern, escapedST; index = array.length; isAddEmphasis = (isAddEmphasis && searchTextLength > 0 && index > 1); // don't add emphasis to 0-length or single item if(isAddEmphasis) { escapedST = searchText.replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1"); // http://xkr.us/js/regexregex stPattern = new RegExp("(" + escapedST + ")", "gi"); // $1 this.hasEmphasis = true; } // this.log("add emphasis? " + isAddEmphasis); // console.time("em"); while(index--) { tritem = array[index]; indexB = tritem.length; while(indexB--) { // duplicate match array li = tritem[indexB]; text = $.trim(options[li.getAttribute("name")].text); if (isAddEmphasis) { li.innerHTML = text.replace(stPattern, "<em>$1</em>").replace("&", "&amp;"); } else { li.innerHTML = text.replace("&", "&amp;"); } } } // console.timeEnd("em"); },
isAddEmphasis = (isAddEmphasis && searchTextLength > 0 && index > 1);
isAddEmphasis = (isAddEmphasis && searchTextLength > 0);
emphasis: function(array, isAddEmphasis, searchText ) { var searchTextLength = searchText.length || 0; var options = this.selectbox.get(0).options; var tritem, index, indexB, li, text, stPattern, escapedST; index = array.length; isAddEmphasis = (isAddEmphasis && searchTextLength > 0 && index > 1); // don't add emphasis to 0-length or single item if(isAddEmphasis) { escapedST = searchText.replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1"); // http://xkr.us/js/regexregex stPattern = new RegExp("(" + escapedST + ")", "gi"); // $1 this.hasEmphasis = true; } // this.log("add emphasis? " + isAddEmphasis); // console.time("em"); while(index--) { tritem = array[index]; indexB = tritem.length; while(indexB--) { // duplicate match array li = tritem[indexB]; text = $.trim(options[li.getAttribute("name")].text); if (isAddEmphasis) { li.innerHTML = text.replace(stPattern, "<em>$1</em>").replace("&", "&amp;"); } else { li.innerHTML = text.replace("&", "&amp;"); } } } // console.timeEnd("em"); },
escapedST = searchText.replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1");
escapedST = this._encodeString(searchText).replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1");
emphasis: function(array, isAddEmphasis, searchText ) { var searchTextLength = searchText.length || 0; var options = this.selectbox.get(0).options; var tritem, index, indexB, li, text, stPattern, escapedST; index = array.length; isAddEmphasis = (isAddEmphasis && searchTextLength > 0 && index > 1); // don't add emphasis to 0-length or single item if(isAddEmphasis) { escapedST = searchText.replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1"); // http://xkr.us/js/regexregex stPattern = new RegExp("(" + escapedST + ")", "gi"); // $1 this.hasEmphasis = true; } // this.log("add emphasis? " + isAddEmphasis); // console.time("em"); while(index--) { tritem = array[index]; indexB = tritem.length; while(indexB--) { // duplicate match array li = tritem[indexB]; text = $.trim(options[li.getAttribute("name")].text); if (isAddEmphasis) { li.innerHTML = text.replace(stPattern, "<em>$1</em>").replace("&", "&amp;"); } else { li.innerHTML = text.replace("&", "&amp;"); } } } // console.timeEnd("em"); },
text = $.trim(options[li.getAttribute("name")].text); if (isAddEmphasis) { li.innerHTML = text.replace(stPattern, "<em>$1</em>").replace("&", "&amp;"); } else { li.innerHTML = text.replace("&", "&amp;"); }
text = $.trim(options[li.getAttribute("name")].innerHTML); li.innerHTML = isAddEmphasis ? text.replace(stPattern, "<em>$1</em>") : text;
emphasis: function(array, isAddEmphasis, searchText ) { var searchTextLength = searchText.length || 0; var options = this.selectbox.get(0).options; var tritem, index, indexB, li, text, stPattern, escapedST; index = array.length; isAddEmphasis = (isAddEmphasis && searchTextLength > 0 && index > 1); // don't add emphasis to 0-length or single item if(isAddEmphasis) { escapedST = searchText.replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1"); // http://xkr.us/js/regexregex stPattern = new RegExp("(" + escapedST + ")", "gi"); // $1 this.hasEmphasis = true; } // this.log("add emphasis? " + isAddEmphasis); // console.time("em"); while(index--) { tritem = array[index]; indexB = tritem.length; while(indexB--) { // duplicate match array li = tritem[indexB]; text = $.trim(options[li.getAttribute("name")].text); if (isAddEmphasis) { li.innerHTML = text.replace(stPattern, "<em>$1</em>").replace("&", "&amp;"); } else { li.innerHTML = text.replace("&", "&amp;"); } } } // console.timeEnd("em"); },
this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null;
true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===
this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null;
this.log("enable");
enable: function() { this.log("enable"); this.isDisabled = false; this.button.removeClass(this.css.buttonDisabled); this.input.removeClass(this.css.inputDisabled); this.input.removeAttr("disabled"); },
this.selectbox.removeAttr("disabled");
enable: function() { // this.log("enable"); this.isDisabled = false; this.button.removeClass(this.css.buttonDisabled); this.input.removeClass(this.css.inputDisabled); this.input.removeAttr("disabled"); },
input = Base64._utf8_encode(input);
input = info_webtoolkit_Base64._utf8_encode(input);
encode : function (input) { var output = ""; var chr1, chr2, chr3, enc1, enc2, enc3, enc4; var i = 0; input = Base64._utf8_encode(input); while (i < input.length) { chr1 = input.charCodeAt(i++); chr2 = input.charCodeAt(i++); chr3 = input.charCodeAt(i++); enc1 = chr1 >> 2; enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); enc4 = chr3 & 63; if (isNaN(chr2)) { enc3 = enc4 = 64; } else if (isNaN(chr3)) { enc4 = 64; } output = output + this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4); } return output; },
else return null;}var move_current_element;function start_move_element(e,id,frame){var elem_id=(e.target||e.srcElement).id;if(id)elem_id=id;if(!frame)frame=window;if(frame.event)e=frame.event;move_current_element=frame.document.getElementById(elem_id);move_current_element.frame=frame;frame.document.onmousemove=move_element;frame.document.onmouseup=end_move_element;mouse_x=getMouseX(e);mouse_y=getMouseY(e);move_current_element.start_pos_x=mouse_x-(move_current_element.style.left.replace("px","")||calculeOffsetLeft(move_current_element));move_current_element.start_pos_y=mouse_y-(move_current_element.style.top.replace("px","")||calculeOffsetTop(move_current_element));return false;};function end_move_element(e){move_current_element.frame.document.onmousemove="";move_current_element.frame.document.onmouseup="";move_current_element=null;};function move_element(e){if(move_current_element.frame&&move_current_element.frame.event)e=move_current_element.frame.event;var mouse_x=getMouseX(e);var mouse_y=getMouseY(e);var new_top=mouse_y-move_current_element.start_pos_y;var new_left=mouse_x-move_current_element.start_pos_x;var max_left=move_current_element.frame.document.body.offsetWidth-move_current_element.offsetWidth;max_top=move_current_element.frame.document.body.offsetHeight-move_current_element.offsetHeight;new_top=Math.min(Math.max(0,new_top),max_top);new_left=Math.min(Math.max(0,new_left),max_left);move_current_element.style.top=new_top+"px";move_current_element.style.left=new_left+"px";return false;};var nav=eAL.nav;function getSelectionRange(textarea){return {"start":textarea.selectionStart,"end":textarea.selectionEnd};};function setSelectionRange(textarea,start,end){textarea.focus();start=Math.max(0,Math.min(textarea.value.length,start));end=Math.max(start,Math.min(textarea.value.length,end));if(nav['isOpera']){textarea.selectionEnd=1;textarea.selectionStart=0;textarea.selectionEnd=1;textarea.selectionStart=0;}textarea.selectionStart=start;textarea.selectionEnd=end;if(nav['isIE'])set_IE_selection(textarea);};function get_IE_selection(textarea){if(textarea&&textarea.focused){if(!textarea.ea_line_height){var div=document.createElement("div");div.style.fontFamily=get_css_property(textarea,"font-family");div.style.fontSize=get_css_property(textarea,"font-size");div.style.visibility="hidden";div.innerHTML="0";document.body.appendChild(div);textarea.ea_line_height=div.offsetHeight;document.body.removeChild(div);}var range=document.selection.createRange();var stored_range=range.duplicate();stored_range.moveToElementText(textarea );stored_range.setEndPoint('EndToEnd',range );if(stored_range.parentElement()==textarea){var elem=textarea;var scrollTop=0;while(elem.parentNode){scrollTop+=elem.scrollTop;elem=elem.parentNode;}var relative_top=range.offsetTop-calculeOffsetTop(textarea)+scrollTop;var line_start=Math.round((relative_top / textarea.ea_line_height)+1);var line_nb=Math.round(range.boundingHeight / textarea.ea_line_height);var range_start=stored_range.text.length-range.text.length;var tab=textarea.value.substr(0,range_start).split("\n");range_start+=(line_start-tab.length)*2;textarea.selectionStart=range_start;var range_end=textarea.selectionStart+range.text.length;tab=textarea.value.substr(0,range_start+range.text.length).split("\n");range_end+=(line_start+line_nb-1-tab.length)*2;textarea.selectionEnd=range_end;}}setTimeout("get_IE_selection(document.getElementById('"+textarea.id +"'));",50);};function IE_textarea_focus(){event.srcElement.focused=true;}function IE_textarea_blur(){event.srcElement.focused=false;}function set_IE_selection(textarea){if(!window.closed){var nbLineStart=textarea.value.substr(0,textarea.selectionStart).split("\n").length-1;var nbLineEnd=textarea.value.substr(0,textarea.selectionEnd).split("\n").length-1;var range=document.selection.createRange();range.moveToElementText(textarea );range.setEndPoint('EndToStart',range );range.moveStart('character',textarea.selectionStart-nbLineStart);range.moveEnd('character',textarea.selectionEnd-nbLineEnd-(textarea.selectionStart-nbLineStart));range.select();}};eAL.waiting_loading["elements_functions.js"]="loaded";
else return null;}var _mCE;function start_move_element(e,id,frame){var elem_id=(e.target||e.srcElement).id;if(id)elem_id=id;if(!frame)frame=window;if(frame.event)e=frame.event;_mCE=frame.document.getElementById(elem_id);_mCE.frame=frame;frame.document.onmousemove=move_element;frame.document.onmouseup=end_move_element;mouse_x=getMouseX(e);mouse_y=getMouseY(e);_mCE.start_pos_x=mouse_x-(_mCE.style.left.replace("px","")||calculeOffsetLeft(_mCE));_mCE.start_pos_y=mouse_y-(_mCE.style.top.replace("px","")||calculeOffsetTop(_mCE));return false;};function end_move_element(e){_mCE.frame.document.onmousemove="";_mCE.frame.document.onmouseup="";_mCE=null;};function move_element(e){var newTop,newLeft,maxLeft;if(_mCE.frame&&_mCE.frame.event)e=_mCE.frame.event;newTop=getMouseY(e)-_mCE.start_pos_y;newLeft=getMouseX(e)-_mCE.start_pos_x;maxLeft=_mCE.frame.document.body.offsetWidth-_mCE.offsetWidth;max_top=_mCE.frame.document.body.offsetHeight-_mCE.offsetHeight;newTop=Math.min(Math.max(0,newTop),max_top);newLeft=Math.min(Math.max(0,newLeft),maxLeft);_mCE.style.top=newTop+"px";_mCE.style.left=newLeft+"px";return false;};var nav=eAL.nav;function getSelectionRange(textarea){return{"start":textarea.selectionStart,"end":textarea.selectionEnd};};function setSelectionRange(t,start,end){t.focus();start=Math.max(0,Math.min(t.value.length,start));end=Math.max(start,Math.min(t.value.length,end));if(nav.isOpera&&nav.isOpera < 9.6){t.selectionEnd=1;t.selectionStart=0;t.selectionEnd=1;t.selectionStart=0;}t.selectionStart=start;t.selectionEnd=end;if(nav.isIE)set_IE_selection(t);};function get_IE_selection(t){var d=document,div,range,stored_range,elem,scrollTop,relative_top,line_start,line_nb,range_start,range_end,tab;if(t&&t.focused){if(!t.ea_line_height){div=d.createElement("div");div.style.fontFamily=get_css_property(t,"font-family");div.style.fontSize=get_css_property(t,"font-size");div.style.visibility="hidden";div.innerHTML="0";d.body.appendChild(div);t.ea_line_height=div.offsetHeight;d.body.removeChild(div);}range=d.selection.createRange();try{stored_range=range.duplicate();stored_range.moveToElementText(t);stored_range.setEndPoint('EndToEnd',range);if(stored_range.parentElement()==t){elem=t;scrollTop=0;while(elem.parentNode){scrollTop+=elem.scrollTop;elem=elem.parentNode;}relative_top=range.offsetTop-calculeOffsetTop(t)+scrollTop;line_start=Math.round((relative_top / t.ea_line_height)+1);line_nb=Math.round(range.boundingHeight / t.ea_line_height);range_start=stored_range.text.length-range.text.length;tab=t.value.substr(0,range_start).split("\n");range_start+=(line_start-tab.length)*2;t.selectionStart=range_start;range_end=t.selectionStart+range.text.length;tab=t.value.substr(0,range_start+range.text.length).split("\n");range_end+=(line_start+line_nb-1-tab.length)*2;t.selectionEnd=range_end;}}catch(e){}}if(t&&t.id){setTimeout("get_IE_selection(document.getElementById('"+t.id+"'));",50);}};function IE_textarea_focus(){event.srcElement.focused=true;}function IE_textarea_blur(){event.srcElement.focused=false;}function set_IE_selection(t){var nbLineStart,nbLineStart,nbLineEnd,range;if(!window.closed){nbLineStart=t.value.substr(0,t.selectionStart).split("\n").length-1;nbLineEnd=t.value.substr(0,t.selectionEnd).split("\n").length-1;try{range=document.selection.createRange();range.moveToElementText(t);range.setEndPoint('EndToStart',range);range.moveStart('character',t.selectionStart-nbLineStart);range.moveEnd('character',t.selectionEnd-nbLineEnd-(t.selectionStart-nbLineStart));range.select();}catch(e){}}};eAL.waiting_loading["elements_functions.js"]="loaded";
else return null;}var move_current_element;function start_move_element(e,id,frame){var elem_id=(e.target||e.srcElement).id;if(id)elem_id=id;if(!frame)frame=window;if(frame.event)e=frame.event;move_current_element=frame.document.getElementById(elem_id);move_current_element.frame=frame;frame.document.onmousemove=move_element;frame.document.onmouseup=end_move_element;mouse_x=getMouseX(e);mouse_y=getMouseY(e);move_current_element.start_pos_x=mouse_x-(move_current_element.style.left.replace("px","")||calculeOffsetLeft(move_current_element));move_current_element.start_pos_y=mouse_y-(move_current_element.style.top.replace("px","")||calculeOffsetTop(move_current_element));return false;};function end_move_element(e){move_current_element.frame.document.onmousemove="";move_current_element.frame.document.onmouseup="";move_current_element=null;};function move_element(e){if(move_current_element.frame&&move_current_element.frame.event)e=move_current_element.frame.event;var mouse_x=getMouseX(e);var mouse_y=getMouseY(e);var new_top=mouse_y-move_current_element.start_pos_y;var new_left=mouse_x-move_current_element.start_pos_x;var max_left=move_current_element.frame.document.body.offsetWidth-move_current_element.offsetWidth;max_top=move_current_element.frame.document.body.offsetHeight-move_current_element.offsetHeight;new_top=Math.min(Math.max(0,new_top),max_top);new_left=Math.min(Math.max(0,new_left),max_left);move_current_element.style.top=new_top+"px";move_current_element.style.left=new_left+"px";return false;};var nav=eAL.nav;function getSelectionRange(textarea){return {"start":textarea.selectionStart,"end":textarea.selectionEnd};};function setSelectionRange(textarea,start,end){textarea.focus();start=Math.max(0,Math.min(textarea.value.length,start));end=Math.max(start,Math.min(textarea.value.length,end));if(nav['isOpera']){textarea.selectionEnd=1;textarea.selectionStart=0;textarea.selectionEnd=1;textarea.selectionStart=0;}textarea.selectionStart=start;textarea.selectionEnd=end;if(nav['isIE'])set_IE_selection(textarea);};function get_IE_selection(textarea){if(textarea&&textarea.focused){if(!textarea.ea_line_height){var div=document.createElement("div");div.style.fontFamily=get_css_property(textarea,"font-family");div.style.fontSize=get_css_property(textarea,"font-size");div.style.visibility="hidden";div.innerHTML="0";document.body.appendChild(div);textarea.ea_line_height=div.offsetHeight;document.body.removeChild(div);}var range=document.selection.createRange();var stored_range=range.duplicate();stored_range.moveToElementText(textarea );stored_range.setEndPoint('EndToEnd',range );if(stored_range.parentElement()==textarea){var elem=textarea;var scrollTop=0;while(elem.parentNode){scrollTop+=elem.scrollTop;elem=elem.parentNode;}var relative_top=range.offsetTop-calculeOffsetTop(textarea)+scrollTop;var line_start=Math.round((relative_top / textarea.ea_line_height)+1);var line_nb=Math.round(range.boundingHeight / textarea.ea_line_height);var range_start=stored_range.text.length-range.text.length;var tab=textarea.value.substr(0,range_start).split("\n");range_start+=(line_start-tab.length)*2;textarea.selectionStart=range_start;var range_end=textarea.selectionStart+range.text.length;tab=textarea.value.substr(0,range_start+range.text.length).split("\n");range_end+=(line_start+line_nb-1-tab.length)*2;textarea.selectionEnd=range_end;}}setTimeout("get_IE_selection(document.getElementById('"+textarea.id +"'));",50);};function IE_textarea_focus(){event.srcElement.focused=true;}function IE_textarea_blur(){event.srcElement.focused=false;}function set_IE_selection(textarea){if(!window.closed){var nbLineStart=textarea.value.substr(0,textarea.selectionStart).split("\n").length-1;var nbLineEnd=textarea.value.substr(0,textarea.selectionEnd).split("\n").length-1;var range=document.selection.createRange();range.moveToElementText(textarea );range.setEndPoint('EndToStart',range );range.moveStart('character',textarea.selectionStart-nbLineStart);range.moveEnd('character',textarea.selectionEnd-nbLineEnd-(textarea.selectionStart-nbLineStart));range.select();}};eAL.waiting_loading["elements_functions.js"]="loaded";
toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j=== -1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false;
0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n<m;n++)if(i[n]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+p)},CHILD:function(g,i){var n=i[1],m=g;switch(n){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(n===
toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j===-1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false;
var column = this.resolveCol(column);
if (column === 'primaryKey') { column = this.resolveCol(this.options.primaryKey); } else { column = this.resolveCol(column); }
equals: function (column, value) { var column = this.resolveCol(column); if (!this.data.has(column.name)) { return null; } else { if (!$defined(this.comparator)) { this.comparator = new Jx.Compare({ separator : this.options.separator }); } var fn = this.comparator[column.type].bind(this.comparator); return (fn(this.get(column), value) === 0); } },
statusmessages.error = function(msg){alert(msg)};
statusmessages.error = function(msg){alert(msg);};
statusmessages.error = function(msg){alert(msg)};
adminLogout();
error: function(response, ioArgs) { console.error("Error in deleting file"); }
error: function(){ this.fireEvent('error', arguments); }
error: function(){ this.fireEvent('error', arguments); }.bind(this)
error: function(){ this.fireEvent('error', arguments); }
alert("No metrics found " + error); }
alert("No version found: " + version); }
error : function(xhr, status, error) { alert("No metrics found " + error); }
$this.log.error("Unknown KeyType: " + keyType);
$this.log.severe("RedisClient.errorFn: "); $this.log.severe(JSV.serialize(e));
RedisClient.errorFn = function(e) { $this.log.error("Unknown KeyType: " + keyType); };
errorHandler : function(error) { Ext.Msg.alert("Diff. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this)
errorHandler : function(message, exception) { Ext.Msg.alert("There was an error", message); Ext.getBody().unmask(); }
errorHandler : function(error) { Ext.Msg.alert("Diff. Analysis failed", error); Ext.getBody().unmask(); }.createDelegate(this)
errorHandler : function() { sp.destroy(); alert("There was an error saving the settings."); Gemma.SecurityManager.updateSecurityLink( elid, securityInfo.publiclyReadable, sared); }
errorHandler : function(data) { alert("There was an error getting your group information: " + data); }
errorHandler : function() { sp.destroy(); alert("There was an error saving the settings."); Gemma.SecurityManager.updateSecurityLink( elid, securityInfo.publiclyReadable, sared); }
Ext.Msg.alert('Sorry', e); loadMask.hide(); }
this.getEl().unmask(); Ext.Msg.alert('There was an error', e); }
errorHandler : function(e) { Ext.Msg.alert('Sorry', e); loadMask.hide(); }
this.fireEvent('done', data);
this.fireEvent('fail', data);
errorHandler : function(data) { this.fireEvent('done', data); }.createDelegate(this),
if (span.length == 0) {
if (span.length === 0) {
errorPlacement: function(error, element) { var span = element.next().find("span.form-error"); if (span.length == 0) { span = element.parent().find("span.form-error"); } span.replaceWith(error); },
span = element.parent().find("span.form-error");
var span = element.parent().find("span.form-error"); if (span.length === 0){ var element_id = element.attr('id'); span = $("label[for='" + element_id + "']"); }
errorPlacement: function(error, element) { var span = element.next().find("span.form-error"); if (span.length === 0) { span = element.parent().find("span.form-error"); } span.replaceWith(error); },
return false;
execute: function(statement) { try { this._conn.executeSimpleSQL(statement); } catch (e) { this.log("Failed to execute query: (" + statement + ") " + this._conn.lastErrorString + "\n"); } },
searchService.search(query).addCallback(searchResponse);
searchService.searchToUser(query,SECURITY_TOKEN).addCallback(searchResponse);
function executeSearch(query) { searchService.search(query).addCallback(searchResponse);}
results[i + 1] = new Object();
function exetel_parseXML(text) { var xml = (new DOMParser()).parseFromString(text, "text/xml"); var results = new Array(); var daysLeft = _getDaysLeft(xml); if(daysLeft == null) { return mkError('invalid XML'); } var planDetails = xml.evaluate('/Response/PlanDetails', xml, null, XPathResult.ANY_TYPE, null); var qResults = planDetails.iterateNext(); var usageDetails = xml.evaluate('/Response/CurrentMonthUsage', xml, null, XPathResult.ANY_TYPE, null); var qUsageResults = usageDetails.iterateNext(); var results = new Array(); for(var i = 0; qResults; qResults = planDetails.iterateNext(), qUsageResults = usageDetails.iterateNext(), i += 2){ //exetel has a plan name and then peak + offpeak for each name var mainName = qResults.getElementsByTagName("PlanName")[0].childNodes[0].nodeValue; //peak results[i] = new Object(); results[i]['name'] = mainName + '- peak'; results[i]['limit'] = parseInt(qResults.getElementsByTagName("PeakTimeDownloadInMB")[0].childNodes[0].nodeValue); results[i]['usagemb'] = parseInt(qUsageResults.getElementsByTagName("PeakDownload")[0].childNodes[0].nodeValue); results[i]['daysleft'] = daysLeft; results[i]['custom'] = false; //offpeak //some plans don't have off peak plans, so we check if they do or don't based whether the xml defines an offpeak limit var offpeakNodeLimit = qResults.getElementsByTagName("OffpeakTimeDownloadInMB")[0].childNodes[0]; if(typeof(offpeakNodeLimit) != 'undefined') { results[i + 1]['limit'] = parseInt(offpeakNodeLimit.nodeValue); results[i + 1] = new Object(); results[i + 1]['name'] = mainName + '- offpeak'; results[i + 1]['limit'] = parseInt(qResults.getElementsByTagName("OffpeakTimeDownloadInMB")[0].childNodes[0].nodeValue); results[i + 1]['usagemb'] = parseInt(qUsageResults.getElementsByTagName("OffpeakDownload")[0].childNodes[0].nodeValue); results[i + 1]['daysleft'] = daysLeft; results[i + 1]['custom'] = false; } } return results;}
+ '"><img src="/Gemma/images/icons/pencil.png" alt="view/edit experimental design" title="view/edit experimental design"/></a>';
+ '"><img src="/Gemma/images/icons/pencil.png" alt="view/edit experimental design" ext:qtip="view/edit experimental design"/></a>';
var experimentalDesignEditRenderer = function(value, metadata, record, rowIndex, colIndex, store) { var id = record.get('id'); var url = '<a target="_blank" href="/Gemma/experimentalDesign/showExperimentalDesign.html?eeid=' + id + '"><img src="/Gemma/images/icons/pencil.png" alt="view/edit experimental design" title="view/edit experimental design"/></a>'; return value + '&nbsp;' + url; };
var url = '<span class="link" onClick="return Ext.getCmp(\'eemanager\').tagger(' + id + ',' + taxonId + ',' + record.get("currentUserHasWritePermission") + ')"><img src="/Gemma/images/icons/pencil.png" alt="view tags" ext:qtip="add/view tags"/></span>';
var url = '<span class="link" onClick="return Ext.getCmp(\'eemanager\').tagger(' + id + ',' + taxonId + ',' + record.get("currentUserHasWritePermission") + ',' + (record.get("validatedAnnotations") !== null) + ')"><img src="/Gemma/images/icons/pencil.png" alt="view tags" ext:qtip="add/view tags"/></span>';
var experimentTaggerRenderer = function(value, metadata, record, rowIndex, colIndex, store) { var id = record.get('id'); var taxonId = record.get('taxonId'); var url = '<span class="link" onClick="return Ext.getCmp(\'eemanager\').tagger(' + id + ',' + taxonId + ',' + record.get("currentUserHasWritePermission") + ')"><img src="/Gemma/images/icons/pencil.png" alt="view tags" ext:qtip="add/view tags"/></span>'; value = value + '&nbsp;' + url; if (record.get("currentUserHasWritePermission")) { var turl = '<span class="link" onClick="return Ext.getCmp(\'eemanager\').autoTag(' + id + ')"><img src="/Gemma/images/icons/wand.png" alt="run auto-tagger" ext:qtip="add tags automatically"/></span>'; value = value + '&nbsp;' + turl; } return value; };
var turl = '<span class="link" onClick="return Ext.getCmp(\'eemanager\').autoTag(' + id + ')"><img src="/Gemma/images/icons/wand.png" alt="run auto-tagger" ext:qtip="add tags automatically"/></span>';
var turl; if (record.get('autoTagDate')) { var icon = "/Gemma/images/icons/wand.png"; turl = '<span class="link" onClick="return Ext.getCmp(\'eemanager\').autoTag(' + id + ')"><img src="' + icon + '" alt="run auto-tagger" ext:qtip="tagger was run on ' + Ext.util.Format.date(record.get('autoTagDate'), 'y/M/d') + '; click to re-run"/></span>'; } else { var icon = "/Gemma/images/icons/wand--plus.png"; turl = '<span class="link" onClick="return Ext.getCmp(\'eemanager\').autoTag(' + id + ')"><img src="' + icon + '" alt="run auto-tagger" ext:qtip="add tags automatically"/></span>'; }
var experimentTaggerRenderer = function(value, metadata, record, rowIndex, colIndex, store) { var id = record.get('id'); var taxonId = record.get('taxonId'); var url = '<span class="link" onClick="return Ext.getCmp(\'eemanager\').tagger(' + id + ',' + taxonId + ',' + record.get("currentUserHasWritePermission") + ')"><img src="/Gemma/images/icons/pencil.png" alt="view tags" ext:qtip="add/view tags"/></span>'; value = value + '&nbsp;' + url; if (record.get("currentUserHasWritePermission")) { var turl = '<span class="link" onClick="return Ext.getCmp(\'eemanager\').autoTag(' + id + ')"><img src="/Gemma/images/icons/wand.png" alt="run auto-tagger" ext:qtip="add tags automatically"/></span>'; value = value + '&nbsp;' + turl; } return value; };
+ ')"><img src="/Gemma/images/icons/pencil.png" alt="view tags" title="add tags"/></a>';
+ ',' + taxonId +')"><img src="/Gemma/images/icons/pencil.png" alt="view tags" title="add tags"/></a>';
var experimentTaggerRenderer = function(value, metadata, record, rowIndex, colIndex, store) { var id = record.get('id'); var url = '<a href="#" onClick="return Ext.getCmp(\'eemanager\').tagger(' + id + ')"><img src="/Gemma/images/icons/pencil.png" alt="view tags" title="add tags"/></a>'; value = value + '&nbsp;' + url; var isAdmin = Ext.get("hasAdmin").getValue() == 'true'; if (isAdmin) { var turl = '<a href="#" onClick="return Ext.getCmp(\'eemanager\').autoTag(' + id + ')"><img src="/Gemma/images/icons/database_edit.png" alt="run auto-tagger" title="add tags automatically"/></a>'; value = value + '&nbsp;' + turl; } return value; };
var url = '<a href="#" onClick="return Ext.getCmp(\'eemanager\').tagger(' + id + ',' + taxonId + ')"><img src="/Gemma/images/icons/pencil.png" alt="view tags" title="add tags"/></a>';
var url = '<a href="#" onClick="return Ext.getCmp(\'eemanager\').tagger(' + id + ',' + taxonId + ',' + record.get("currentUserHasWritePermission") + ')"><img src="/Gemma/images/icons/pencil.png" alt="view tags" ext:qtip="add/view tags"/></a>';
var experimentTaggerRenderer = function(value, metadata, record, rowIndex, colIndex, store) { var id = record.get('id'); var taxonId = record.get('taxonId'); var url = '<a href="#" onClick="return Ext.getCmp(\'eemanager\').tagger(' + id + ',' + taxonId + ')"><img src="/Gemma/images/icons/pencil.png" alt="view tags" title="add tags"/></a>'; value = value + '&nbsp;' + url; var isAdmin = Ext.get("hasAdmin").getValue() == 'true'; if (isAdmin) { var turl = '<a href="#" onClick="return Ext.getCmp(\'eemanager\').autoTag(' + id + ')"><img src="/Gemma/images/icons/database_edit.png" alt="run auto-tagger" title="add tags automatically"/></a>'; value = value + '&nbsp;' + turl; } return value; };
var isAdmin = Ext.get("hasAdmin").getValue() == 'true'; if (isAdmin) {
if (record.get("currentUserHasWritePermission")) {
var experimentTaggerRenderer = function(value, metadata, record, rowIndex, colIndex, store) { var id = record.get('id'); var taxonId = record.get('taxonId'); var url = '<a href="#" onClick="return Ext.getCmp(\'eemanager\').tagger(' + id + ',' + taxonId + ')"><img src="/Gemma/images/icons/pencil.png" alt="view tags" title="add tags"/></a>'; value = value + '&nbsp;' + url; var isAdmin = Ext.get("hasAdmin").getValue() == 'true'; if (isAdmin) { var turl = '<a href="#" onClick="return Ext.getCmp(\'eemanager\').autoTag(' + id + ')"><img src="/Gemma/images/icons/database_edit.png" alt="run auto-tagger" title="add tags automatically"/></a>'; value = value + '&nbsp;' + turl; } return value; };
+ ')"><img src="/Gemma/images/icons/database_edit.png" alt="run auto-tagger" title="add tags automatically"/></a>';
+ ')"><img src="/Gemma/images/icons/database_edit.png" alt="run auto-tagger" ext:qtip="add tags automatically"/></a>';
var experimentTaggerRenderer = function(value, metadata, record, rowIndex, colIndex, store) { var id = record.get('id'); var taxonId = record.get('taxonId'); var url = '<a href="#" onClick="return Ext.getCmp(\'eemanager\').tagger(' + id + ',' + taxonId + ')"><img src="/Gemma/images/icons/pencil.png" alt="view tags" title="add tags"/></a>'; value = value + '&nbsp;' + url; var isAdmin = Ext.get("hasAdmin").getValue() == 'true'; if (isAdmin) { var turl = '<a href="#" onClick="return Ext.getCmp(\'eemanager\').autoTag(' + id + ')"><img src="/Gemma/images/icons/database_edit.png" alt="run auto-tagger" title="add tags automatically"/></a>'; value = value + '&nbsp;' + turl; } return value; };
if (onSuccessFn) onSuccessFn(r.getResult().Result);
if (onSuccessFn) onSuccessFn(r.Result);
expireEntryAt: function(key, expireAt, onSuccessFn, onErrorFn) { this.gateway.getFromService('ExpireEntryAt', { Key: key || null, ExpireAt: expireAt || null }, function(r) { if (onSuccessFn) onSuccessFn(r.getResult().Result); }, onErrorFn || RedisClient.errorFn); },
if (onSuccessFn) onSuccessFn(r.getResult().Result);
if (onSuccessFn) onSuccessFn(r.Result);
expireEntryIn: function(key, expireIn, onSuccessFn, onErrorFn) { this.gateway.getFromService('ExpireEntryIn', { Key: key || null, ExpireIn: expireIn || null }, function(r) { if (onSuccessFn) onSuccessFn(r.getResult().Result); }, onErrorFn || RedisClient.errorFn); },
var previous = this.base || Base.prototype.base;
var previous = this.base || name_edwards_dean_Base.prototype.base;
extend: function(source, value) { if (arguments.length > 1) { // extending with a name/value pair var ancestor = this[source]; if (ancestor && (typeof value == "function") && // overriding a method? // the valueOf() comparison is to avoid circular references (!ancestor.valueOf || ancestor.valueOf() != value.valueOf()) && /\bbase\b/.test(value)) { // get the underlying method var method = value.valueOf(); // override value = function() { var previous = this.base || Base.prototype.base; this.base = ancestor; var returnValue = method.apply(this, arguments); this.base = previous; return returnValue; }; // point to the underlying method value.valueOf = function(type) { return (type == "object") ? value : method; }; value.toString = Base.toString; } this[source] = value; } else if (source) { // extending with an object literal var extend = Base.prototype.extend; // if this object has a customised extend method then use it if (!Base._prototyping && typeof this != "function") { extend = this.extend || extend; } var proto = {toSource: null}; // do the "toString" and other methods manually var hidden = ["constructor", "toString", "valueOf"]; // if we are prototyping then include the constructor var i = Base._prototyping ? 0 : 1; while (key = hidden[i++]) { if (source[key] != proto[key]) { extend.call(this, key, source[key]); } } // copy each of the source object's properties to this object for (var key in source) { if (!proto[key]) extend.call(this, key, source[key]); } } return this; },
value.toString = Base.toString;
value.toString = name_edwards_dean_Base.toString;
extend: function(source, value) { if (arguments.length > 1) { // extending with a name/value pair var ancestor = this[source]; if (ancestor && (typeof value == "function") && // overriding a method? // the valueOf() comparison is to avoid circular references (!ancestor.valueOf || ancestor.valueOf() != value.valueOf()) && /\bbase\b/.test(value)) { // get the underlying method var method = value.valueOf(); // override value = function() { var previous = this.base || Base.prototype.base; this.base = ancestor; var returnValue = method.apply(this, arguments); this.base = previous; return returnValue; }; // point to the underlying method value.valueOf = function(type) { return (type == "object") ? value : method; }; value.toString = Base.toString; } this[source] = value; } else if (source) { // extending with an object literal var extend = Base.prototype.extend; // if this object has a customised extend method then use it if (!Base._prototyping && typeof this != "function") { extend = this.extend || extend; } var proto = {toSource: null}; // do the "toString" and other methods manually var hidden = ["constructor", "toString", "valueOf"]; // if we are prototyping then include the constructor var i = Base._prototyping ? 0 : 1; while (key = hidden[i++]) { if (source[key] != proto[key]) { extend.call(this, key, source[key]); } } // copy each of the source object's properties to this object for (var key in source) { if (!proto[key]) extend.call(this, key, source[key]); } } return this; },
var extend = Base.prototype.extend;
var extend = name_edwards_dean_Base.prototype.extend;
extend: function(source, value) { if (arguments.length > 1) { // extending with a name/value pair var ancestor = this[source]; if (ancestor && (typeof value == "function") && // overriding a method? // the valueOf() comparison is to avoid circular references (!ancestor.valueOf || ancestor.valueOf() != value.valueOf()) && /\bbase\b/.test(value)) { // get the underlying method var method = value.valueOf(); // override value = function() { var previous = this.base || Base.prototype.base; this.base = ancestor; var returnValue = method.apply(this, arguments); this.base = previous; return returnValue; }; // point to the underlying method value.valueOf = function(type) { return (type == "object") ? value : method; }; value.toString = Base.toString; } this[source] = value; } else if (source) { // extending with an object literal var extend = Base.prototype.extend; // if this object has a customised extend method then use it if (!Base._prototyping && typeof this != "function") { extend = this.extend || extend; } var proto = {toSource: null}; // do the "toString" and other methods manually var hidden = ["constructor", "toString", "valueOf"]; // if we are prototyping then include the constructor var i = Base._prototyping ? 0 : 1; while (key = hidden[i++]) { if (source[key] != proto[key]) { extend.call(this, key, source[key]); } } // copy each of the source object's properties to this object for (var key in source) { if (!proto[key]) extend.call(this, key, source[key]); } } return this; },
if (!Base._prototyping && typeof this != "function") {
if (!name_edwards_dean_Base._prototyping && typeof this != "function") {
extend: function(source, value) { if (arguments.length > 1) { // extending with a name/value pair var ancestor = this[source]; if (ancestor && (typeof value == "function") && // overriding a method? // the valueOf() comparison is to avoid circular references (!ancestor.valueOf || ancestor.valueOf() != value.valueOf()) && /\bbase\b/.test(value)) { // get the underlying method var method = value.valueOf(); // override value = function() { var previous = this.base || Base.prototype.base; this.base = ancestor; var returnValue = method.apply(this, arguments); this.base = previous; return returnValue; }; // point to the underlying method value.valueOf = function(type) { return (type == "object") ? value : method; }; value.toString = Base.toString; } this[source] = value; } else if (source) { // extending with an object literal var extend = Base.prototype.extend; // if this object has a customised extend method then use it if (!Base._prototyping && typeof this != "function") { extend = this.extend || extend; } var proto = {toSource: null}; // do the "toString" and other methods manually var hidden = ["constructor", "toString", "valueOf"]; // if we are prototyping then include the constructor var i = Base._prototyping ? 0 : 1; while (key = hidden[i++]) { if (source[key] != proto[key]) { extend.call(this, key, source[key]); } } // copy each of the source object's properties to this object for (var key in source) { if (!proto[key]) extend.call(this, key, source[key]); } } return this; },
var i = Base._prototyping ? 0 : 1;
var i = name_edwards_dean_Base._prototyping ? 0 : 1;
extend: function(source, value) { if (arguments.length > 1) { // extending with a name/value pair var ancestor = this[source]; if (ancestor && (typeof value == "function") && // overriding a method? // the valueOf() comparison is to avoid circular references (!ancestor.valueOf || ancestor.valueOf() != value.valueOf()) && /\bbase\b/.test(value)) { // get the underlying method var method = value.valueOf(); // override value = function() { var previous = this.base || Base.prototype.base; this.base = ancestor; var returnValue = method.apply(this, arguments); this.base = previous; return returnValue; }; // point to the underlying method value.valueOf = function(type) { return (type == "object") ? value : method; }; value.toString = Base.toString; } this[source] = value; } else if (source) { // extending with an object literal var extend = Base.prototype.extend; // if this object has a customised extend method then use it if (!Base._prototyping && typeof this != "function") { extend = this.extend || extend; } var proto = {toSource: null}; // do the "toString" and other methods manually var hidden = ["constructor", "toString", "valueOf"]; // if we are prototyping then include the constructor var i = Base._prototyping ? 0 : 1; while (key = hidden[i++]) { if (source[key] != proto[key]) { extend.call(this, key, source[key]); } } // copy each of the source object's properties to this object for (var key in source) { if (!proto[key]) extend.call(this, key, source[key]); } } return this; },
if (factor.type = 'Continuous') { this.getStore().on('load', function(store, records) { var i = this.findExact('description', factor.description); this.getAt(i).set('type', 'Continuous'); this.commitChanges(); }, this.getStore(), { single : true }); }
factorCreated : function(factor) { /* * 'continuous' is a client-side value only. If they reload without adding a factor, this value is lost, * but it's a rare case. See bug 1796. */ if (factor.type = 'Continuous') { this.getStore().on('load', function(store, records) { var i = this.findExact('description', factor.description); this.getAt(i).set('type', 'Continuous'); this.commitChanges(); }, this.getStore(), { single : true }); } this.refresh(); var efs = [factor]; this.fireEvent('experimentalfactorselected', this, efs); },
this.fireEvent('experimentalfactorchange', this, efs);
this.fireEvent('experimentalfactorselected', this, efs);
factorCreated : function(factor) { this.refresh(); var efs = [factor]; this.fireEvent('experimentalfactorchange', this, efs); },
failure: function(form, action) { var username = form.items.get(0); var password = form.items.get(1); username.markInvalid(); password.markInvalid(); username.focus(true); },
failure: function() { newSourceWindow.setError("Error contacting server.\nPlease check the url and try again."); },
failure: function(form, action) { var username = form.items.get(0); var password = form.items.get(1); username.markInvalid(); password.markInvalid(); username.focus(true); },