rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
var result = trie.find("catamarang"); equals( result.matches.length, 0, "Prefix with missing suffix - longer" ); equals( result.misses.length, 4, "Prefix with missing suffix - longer, misses" );
|
test("trie", function() { var dataSource = { "cab": {}, "cat": {}, "car": {}, "catch": {} }; var trie = new $.ui.ufd.getNewTrie(false, true); console.log(trie); for(key in dataSource){ //console.log(key + " : " + dataSource[key]); trie.add(key, dataSource[key]); } //start testing var result = trie.find(""); equals( result.matches.length, 4, "Matches match" ); equals( result.misses.length, 0, "Misses match" ); var result = trie.find("ca"); equals( result.matches.length, 4, "Matches match" ); equals( result.misses.length, 0, "Misses match" ); var result = trie.find("cat"); equals( result.matches.length, 2, "Matches match" ); equals( result.misses.length, 2, "Misses match" ); var result = trie.find("cab"); equals( result.matches.length, 1, "Matches match" ); equals( result.misses.length, 3, "Misses match" ); var result = trie.find("cata"); equals( result.matches.length, 0, "Matches match" ); equals( result.misses.length, 4, "Misses match" ); var result = trie.find("catch"); ok( testResult(result, "catch", dataSource), "double check" ); });
|
|
setTimeout(function(){$('#bsignin').click()},1000);
|
setTimeout(function(){$('#bsignin').click();},1000);
|
setTimeout(function(){$('#bsignin').click()},1000);
|
uploadForm.on('start', function(result) {
|
uploadForm.on('start', function(taskId) {
|
uploadForm.on('start', function(result) { Ext.getCmp('submit-design-button').disable(); }.createDelegate(this));
|
var c = this.columns[this.columns.length - 1 ]; if (c.options.renderMode === 'expand') { this.hasExpandable = true; }
|
this.options.columns.each(function (col) { //check the column to see if it's a Jx.Grid.Column or an object if (col instanceof Jx.Column) { this.columns.push(col); } else if (Jx.type(col) === "object") { this.columns.push(new Jx.Column(col,this.grid)); } }, this);
|
|
geneData.push([genes[i].id, genes[i].taxon.scientificName, genes[i].officialSymbol,
|
geneData.push([genes[i].id, genes[i].taxonScientificName, genes[i].officialSymbol,
|
GenePickerController.getGenes(geneIds, function(genes) { var geneData = []; for (var i = 0; i < genes.length; ++i) { geneData.push([genes[i].id, genes[i].taxon.scientificName, genes[i].officialSymbol, genes[i].officialName]); } /* * FIXME this can result in the same gene listed twice. This is taken care of at the server * side but looks funny. */ this.getStore().loadData(geneData); if (callback) { callback(args); } }.createDelegate(this));
|
return value.match(new RegExp("(\.jpe?g|\.gif|\.png|^$)"));
|
return value.match(new RegExp(/(\.jpe?g|\.gif|\.png|^$)/i));
|
function(value, element, param) { return value.match(new RegExp("(\.jpe?g|\.gif|\.png|^$)")); }
|
if (! ("console" in window) || !("firebug" in window.console)) {
|
if (! ("console" in window)) {
|
function() { if (! ("console" in window) || !("firebug" in window.console)) { var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; window.console = {}; for (var i = 0; i < names.length; ++i) { window.console[names[i]] = function() {}; } }});
|
var s = row.getMarginBoxSize();
|
var s = row.getContentBoxSize();
|
document.id(this.grid.gridTableBody).getChildren().each(function(row){ row = document.id(row); var data = row.retrieve('jxRowData'); var s = row.getMarginBoxSize(); this.heights[data.row] = s.height; },this);
|
alert(exception.msg); return;
|
adminLogout();
|
gallery.getAlbumsToUser(SECURITY_TOKEN).addCallback(function(albums, exception) { // gallery.getAlbums().addCallback( function(albums, exception) { if (exception) { alert(exception.msg); return; } this.albums = albums; var selectAlbum = dojo.byId("selectAlbum"); selectAlbum.options.length = 0; if (permissions.indexOf("|createAlbum|") != -1) { selectAlbum.options[selectAlbum.options.length] = new Option("New Album", "New Album", true, false); } for (var pos = 0; pos < albums.length; pos++) { selectAlbum.options[selectAlbum.options.length] = new Option(albums[pos].name, albums[pos].name, false, false); } dojo.byId("selectAlbum").value = albumName; manageAlbumFields(); });
|
if (permissions.indexOf("|createAlbum|") != -1) {
|
if (userId != "Guest") {
|
gallery.getAlbumsToUser(SECURITY_TOKEN).addCallback(function(albums, exception) { // gallery.getAlbums().addCallback( function(albums, exception) { if (exception) { alert(exception.msg); return; } this.albums = albums; var selectAlbum = dojo.byId("selectAlbum"); selectAlbum.options.length = 0; if (permissions.indexOf("|createAlbum|") != -1) { selectAlbum.options[selectAlbum.options.length] = new Option("New Album", "New Album", true, false); } for (var pos = 0; pos < albums.length; pos++) { selectAlbum.options[selectAlbum.options.length] = new Option(albums[pos].name, albums[pos].name, false, false); } dojo.byId("selectAlbum").value = albumName; manageAlbumFields(); });
|
manageAlbumFields();
|
if (currentView == "AlbumOnload" || currentView == "Album") { manageAlbumFields(); }
|
gallery.getAlbumsToUser(SECURITY_TOKEN).addCallback(function(albums, exception) { // gallery.getAlbums().addCallback( function(albums, exception) { if (exception) { alert(exception.msg); return; } this.albums = albums; var selectAlbum = dojo.byId("selectAlbum"); selectAlbum.options.length = 0; if (permissions.indexOf("|createAlbum|") != -1) { selectAlbum.options[selectAlbum.options.length] = new Option("New Album", "New Album", true, false); } for (var pos = 0; pos < albums.length; pos++) { selectAlbum.options[selectAlbum.options.length] = new Option(albums[pos].name, albums[pos].name, false, false); } dojo.byId("selectAlbum").value = albumName; manageAlbumFields(); });
|
function(e){ if ((e.which && e.which == 13)||(e.keyCode && e.keyCode == 13)){ return handler_function(); }
|
function(index, element){ $(element).unbind('keypress').keypress( function(e){ if ((e.which && e.which == 13)||(e.keyCode && e.keyCode == 13)){ if (handler_function){ return handler_function(); } else { element.click(); return false; } } } );
|
function(e){ if ((e.which && e.which == 13)||(e.keyCode && e.keyCode == 13)){ return handler_function(); } }
|
var bookmarkKeyCode;
|
var localSettings = { bookmarkKeyChar: 'D' };
|
(function() { var bookmarkKeyCode; function getVariableFromLocalStorage(variableName,defaultValue) { this[variableName] = defaultValue; var onResponse = function (response) { if (response != null) { this[variableName] = response; console.log(variableName + ' is set to: ' + response); } else { console.log(variableName + ' not found in localStorage! ' + response); } } chrome.extension.sendRequest({'action': 'getFromLocalStorage', 'variableName': variableName}, onResponse) }; // Listen for key press window.addEventListener( 'keydown', function(e) { // bookmarkKeyCode is always returning "undefined" not sure how to grab it from getVariableFromLocalStorage function getVariableFromLocalStorage('bookmarkKeyCode','D'); console.log(bookmarkKeyCode); if (e.which == bookmarkKeyCode && e.altKey) { console.log('pressed ^d'); addDeliciousFromContentScript(); } }, false ); // Send request to background page (content script not permitted to create new windows) addDeliciousFromContentScript = function() { var url = document.location.toString(), title = document.title, notes = '', notesMaxLength = 1000; if (window && window.getSelection) { notes = window.getSelection().toString(); } else if (document && document.getSelection) { notes = document.getSelection().toString(); } if (notes && notes.length > notesMaxLength) { notes = notes.substring(0, notesMaxLength - 1); } chrome.extension.sendRequest({ type: 'addDelicious', url: url, title: title, notes: notes }); };})();
|
this[variableName] = defaultValue;
|
localSettings[variableName] = defaultValue;
|
(function() { var bookmarkKeyCode; function getVariableFromLocalStorage(variableName,defaultValue) { this[variableName] = defaultValue; var onResponse = function (response) { if (response != null) { this[variableName] = response; console.log(variableName + ' is set to: ' + response); } else { console.log(variableName + ' not found in localStorage! ' + response); } } chrome.extension.sendRequest({'action': 'getFromLocalStorage', 'variableName': variableName}, onResponse) }; // Listen for key press window.addEventListener( 'keydown', function(e) { // bookmarkKeyCode is always returning "undefined" not sure how to grab it from getVariableFromLocalStorage function getVariableFromLocalStorage('bookmarkKeyCode','D'); console.log(bookmarkKeyCode); if (e.which == bookmarkKeyCode && e.altKey) { console.log('pressed ^d'); addDeliciousFromContentScript(); } }, false ); // Send request to background page (content script not permitted to create new windows) addDeliciousFromContentScript = function() { var url = document.location.toString(), title = document.title, notes = '', notesMaxLength = 1000; if (window && window.getSelection) { notes = window.getSelection().toString(); } else if (document && document.getSelection) { notes = document.getSelection().toString(); } if (notes && notes.length > notesMaxLength) { notes = notes.substring(0, notesMaxLength - 1); } chrome.extension.sendRequest({ type: 'addDelicious', url: url, title: title, notes: notes }); };})();
|
this[variableName] = response; console.log(variableName + ' is set to: ' + response);
|
localSettings[variableName] = response; console.log('localSettings.' + variableName + ' is set to: ' + response);
|
(function() { var bookmarkKeyCode; function getVariableFromLocalStorage(variableName,defaultValue) { this[variableName] = defaultValue; var onResponse = function (response) { if (response != null) { this[variableName] = response; console.log(variableName + ' is set to: ' + response); } else { console.log(variableName + ' not found in localStorage! ' + response); } } chrome.extension.sendRequest({'action': 'getFromLocalStorage', 'variableName': variableName}, onResponse) }; // Listen for key press window.addEventListener( 'keydown', function(e) { // bookmarkKeyCode is always returning "undefined" not sure how to grab it from getVariableFromLocalStorage function getVariableFromLocalStorage('bookmarkKeyCode','D'); console.log(bookmarkKeyCode); if (e.which == bookmarkKeyCode && e.altKey) { console.log('pressed ^d'); addDeliciousFromContentScript(); } }, false ); // Send request to background page (content script not permitted to create new windows) addDeliciousFromContentScript = function() { var url = document.location.toString(), title = document.title, notes = '', notesMaxLength = 1000; if (window && window.getSelection) { notes = window.getSelection().toString(); } else if (document && document.getSelection) { notes = document.getSelection().toString(); } if (notes && notes.length > notesMaxLength) { notes = notes.substring(0, notesMaxLength - 1); } chrome.extension.sendRequest({ type: 'addDelicious', url: url, title: title, notes: notes }); };})();
|
console.log(variableName + ' not found in localStorage! ' + response); }
|
console.log('localSettings.' + variableName + ' not found in localStorage! ' + response); }
|
(function() { var bookmarkKeyCode; function getVariableFromLocalStorage(variableName,defaultValue) { this[variableName] = defaultValue; var onResponse = function (response) { if (response != null) { this[variableName] = response; console.log(variableName + ' is set to: ' + response); } else { console.log(variableName + ' not found in localStorage! ' + response); } } chrome.extension.sendRequest({'action': 'getFromLocalStorage', 'variableName': variableName}, onResponse) }; // Listen for key press window.addEventListener( 'keydown', function(e) { // bookmarkKeyCode is always returning "undefined" not sure how to grab it from getVariableFromLocalStorage function getVariableFromLocalStorage('bookmarkKeyCode','D'); console.log(bookmarkKeyCode); if (e.which == bookmarkKeyCode && e.altKey) { console.log('pressed ^d'); addDeliciousFromContentScript(); } }, false ); // Send request to background page (content script not permitted to create new windows) addDeliciousFromContentScript = function() { var url = document.location.toString(), title = document.title, notes = '', notesMaxLength = 1000; if (window && window.getSelection) { notes = window.getSelection().toString(); } else if (document && document.getSelection) { notes = document.getSelection().toString(); } if (notes && notes.length > notesMaxLength) { notes = notes.substring(0, notesMaxLength - 1); } chrome.extension.sendRequest({ type: 'addDelicious', url: url, title: title, notes: notes }); };})();
|
getVariableFromLocalStorage('bookmarkKeyCode','D'); console.log(bookmarkKeyCode); if (e.which == bookmarkKeyCode && e.altKey) { console.log('pressed ^d');
|
if (e.which == localSettings.bookmarkKeyChar.charCodeAt(0) && e.altKey) { console.log('pressed ^d (or whatever key)');
|
(function() { var bookmarkKeyCode; function getVariableFromLocalStorage(variableName,defaultValue) { this[variableName] = defaultValue; var onResponse = function (response) { if (response != null) { this[variableName] = response; console.log(variableName + ' is set to: ' + response); } else { console.log(variableName + ' not found in localStorage! ' + response); } } chrome.extension.sendRequest({'action': 'getFromLocalStorage', 'variableName': variableName}, onResponse) }; // Listen for key press window.addEventListener( 'keydown', function(e) { // bookmarkKeyCode is always returning "undefined" not sure how to grab it from getVariableFromLocalStorage function getVariableFromLocalStorage('bookmarkKeyCode','D'); console.log(bookmarkKeyCode); if (e.which == bookmarkKeyCode && e.altKey) { console.log('pressed ^d'); addDeliciousFromContentScript(); } }, false ); // Send request to background page (content script not permitted to create new windows) addDeliciousFromContentScript = function() { var url = document.location.toString(), title = document.title, notes = '', notesMaxLength = 1000; if (window && window.getSelection) { notes = window.getSelection().toString(); } else if (document && document.getSelection) { notes = document.getSelection().toString(); } if (notes && notes.length > notesMaxLength) { notes = notes.substring(0, notesMaxLength - 1); } chrome.extension.sendRequest({ type: 'addDelicious', url: url, title: title, notes: notes }); };})();
|
renderer : Ext.util.Format.dateRenderer('h:m:s'),
|
renderer : Ext.util.Format.dateRenderer('g:i:s l'),
|
Ext.onReady(function() { var v = new Ext.grid.GridPanel({ renderTo : 'submittedTasks', height : 300, autoScroll : true, width : 800, loadMask : true, viewConfig : { forceFit : true }, columns : [{ header : "TaskId", dataIndex : "taskId", sortable : true, width : 100 }, { header : "Submitted", dataIndex : "submissionTime", renderer : Ext.util.Format.dateRenderer('h:m:s'), width : 120 }, { header : "Started", dataIndex : "startTime", renderer : Ext.util.Format.dateRenderer('h:m:s'), width : 120 }, { header : "Runtime (s)", tooltip : "How long the job has been running", dataIndex : "startTime", renderer : function(value, metaData, record, rowIndex, colIndex, store) { if (record.get("startTime")) { return (new Date() - record.get("startTime")) / 1000; } else { return "Queued for " + (new Date() - record.get("submissionTime")) / 1000; } }, width : 120 }, { header : "Submitter", dataIndex : "submitter" }, { header : "Type", dataIndex : "taskInterface", renderer : function(value, metaData, record, rowIndex, colIndex, store) { return value.replace(/.*\./, '').replace(/Impl$/, ''); } }, { header : "Method", dataIndex : "taskMethod" }, { header : "On grid", dataIndex : "willRunOnGrid" }], store : new Ext.data.Store({ proxy : new Ext.data.DWRProxy({ apiActionToHandlerMap : { read : { dwrFunction : ProgressStatusService.getSubmittedTasks } } }), autoLoad : true, reader : new Ext.data.ListRangeReader({ id : 'taskId', record : Ext.data.Record.create([{ name : "taskId", type : "string" }, { name : "submissionTime", type : "date" }, { name : "startTime", type : "date" }, { name : "submitter", type : "string" }, { name : "taskInterface", type : "string" }, { name : "taskMethod", type : "string" }, { name : "willRunOnGrid", type : "boolean" }]) }) }), buttons : [{ text : "Refresh", handler : function() { v.store.load(); } }] }); });
|
test('String interpolation', function(){ equals(console.log('foo %s buzz', 'bar'), 'foo bar buzz'); equals(console.log('foo %i buzz', 123), 'foo 123 buzz'); equals(console.log('foo %f buzz', 9.8), 'foo 9.8 buzz'); equals(console.log('foo %f buzz %syada', 9.8, 'yada-'), 'foo 9.8 buzz yada-yada'); equals(console.log('foo %o buzz', {a:'foo'}), 'foo [object Object] buzz'); equals(console.log('%s', 'a', 'b', 'c'), 'a\nb\nc');
|
test('Boolean', function(){ equals(console.log(true), 'true'); equals(console.log(false), 'false'); equals(console.log(new Boolean(false)), 'Boolean false'); equals(console.log(new Boolean(true)), 'Boolean true');
|
test('String interpolation', function(){ equals(console.log('foo %s buzz', 'bar'), 'foo bar buzz'); equals(console.log('foo %i buzz', 123), 'foo 123 buzz'); equals(console.log('foo %f buzz', 9.8), 'foo 9.8 buzz'); equals(console.log('foo %f buzz %syada', 9.8, 'yada-'), 'foo 9.8 buzz yada-yada'); equals(console.log('foo %o buzz', {a:'foo'}), 'foo [object Object] buzz'); equals(console.log('%s', 'a', 'b', 'c'), 'a\nb\nc');});
|
if (col instanceof Jx.Column) { this.columns.push(col); } else if (Jx.type(col) === "object") { col.grid = this.grid; this.columns.push(new Jx.Column(col)); }
|
if (col instanceof Jx.Column) { this.columns.push(col); } else if (Jx.type(col) === "object") { this.columns.push(new Jx.Column(col,this.grid)); }
|
this.options.columns.each(function (col) { //check the column to see if it's a Jx.Grid.Column or an object if (col instanceof Jx.Column) { this.columns.push(col); } else if (Jx.type(col) === "object") { col.grid = this.grid; this.columns.push(new Jx.Column(col)); } }, this);
|
query.abort();
|
if (query) query.abort();
|
$(document).ready(function() { var timeid = query = null; var controlLink = $('#control'); var errmsg = $('<p class="errmsg">'+Database.errmsg+'</p>') .insertBefore(controlLink) .hide(); var loading = $('<img class="loading" alt="[loading]" src="'+ Database.load_icon +'" />') .insertAfter(controlLink) .hide(); function refreshTable() { if (Database.ajax_time_refresh > 0) { loading.show(); query = $.ajax({ type: 'GET', dataType: 'html', data: {server: Database.server, database: Database.dbname, action: Database.action}, url: 'database.php', cache: false, contentType: 'application/x-www-form-urlencoded', success: function(html) { $('#data_block').html(html); timeid = window.setTimeout(refreshTable, Database.ajax_time_refresh) }, error: function() { controlLink.click(); errmsg.show(); }, complete: function () { loading.hide(); } }); } } controlLink.toggle( function() { $(errmsg).hide(); timeid = window.setTimeout(refreshTable, Database.ajax_time_refresh); controlLink.html('<img src="'+ Database.str_stop.icon +'" alt="" /> ' + Database.str_stop.text + ' ' ); }, function() { $(errmsg).hide(); $(loading).hide(); window.clearInterval(timeid); query.abort(); controlLink.html('<img src="'+ Database.str_start.icon +'" alt="" /> ' + Database.str_start.text ); } ); /* preload images */ $('#control img').hide() .attr('src', Database.str_start.icon) .attr('src', Database.str_stop.icon) .show(); /* start refreshing */ controlLink.click();});
|
var geneGroupGrid = new Gemma.GeneGroupGrid({ renderTo : "gene-group-grid", geneid : geneid, height : 200, width : 500 })
|
var geneGroupDataView = new Gemma.GeneGroupDataView({ renderTo : "gene-group-grid", readParams : [geneid] });
|
Ext.onReady(function() { Ext.QuickTips.init(); Ext.state.Manager.setProvider(new Ext.state.CookieProvider()); geneid = dwr.util.getValue("gene"); var gpGrid = new Gemma.GeneProductGrid({ geneid : geneid, renderTo : "geneproduct-grid", height : 200, width : 400 }); var gogrid = new Gemma.GeneGOGrid({ renderTo : "go-grid", geneid : geneid, height : 200, width : 500 }); var geneGroupGrid = new Gemma.GeneGroupGrid({ renderTo : "gene-group-grid", geneid : geneid, height : 200, width : 500 }) // Coexpression grid. var coexpressedGeneGrid = new Gemma.CoexpressionGrid({ width : 400, colspan : 2, // user : false, lite : true, renderTo : "coexpression-grid" }); coexpressedGeneGrid.doSearch({ geneIds : [geneid], quick : true, stringency : 2, forceProbeLevelSearch : false }); // diff expression grid var diffExGrid = new Gemma.ProbeLevelDiffExGrid({ width : 725, height : 200, renderTo : "diff-grid" }); // Hide Expression experiment full name // var eeNameColumnIndex = // diffExGrid.getColumnModel().getIndexById('expressionExperimentName'); // diffExGrid.getColumnModel().setHidden(eeNameColumnIndex, true); var visColumnIndex = diffExGrid.getColumnModel() .getIndexById('visualize'); diffExGrid.getColumnModel().setHidden(visColumnIndex, false); diffExGrid.getStore().load({ params : [geneid, Gemma.DIFF_THRESHOLD, Gemma.MAX_DIFF_RESULTS] }); });
|
console.log('Logged from grid.editor validator event');
|
validator.addEvent('fieldValidationFailed', function(field, validator) { console.log(field, validator); });
|
|
return i == len && $.isFunction(obj) ? obj : false;
|
return obj && i == len && typeof obj != 'string' && !obj.nodeName && obj.constructor != Array && /^[\s[]?function/.test(obj + '') ? obj : false;
|
(function($) {var appFields = {}, appWindow = (top.appiFrm||window).opener || parent;//execute when imce loads.imce.hooks.load.push(function(win) { var data = decodeURIComponent(location.href.substr(location.href.lastIndexOf('app=')+4)).split('|'); var func, appName = data.shift(); //extract fields for (var i in data) { var arr = data[i].split('@'); arr.length > 1 && (appFields[arr[0]] = arr[1]); } //run custom onload function if available if (appFields['imceload'] && (func = isFunc(appFields['imceload']))) { func(win); delete appFields['imceload']; } //set custom sendto function. appFinish is the default. var sendtoFunc = appFields['url'] ? appFinish : false; //check sendto@funcName syntax in URL if (appFields['sendto'] && (func = isFunc(appFields['sendto']))) { sendtoFunc = func; delete appFields['sendto']; } //check windowname+ImceFinish. old method else if (win.name && (func = isFunc(win.name +'ImceFinish'))) { sendtoFunc = func; } //highlight file if (appFields['url']) { if (appFields['url'].indexOf(',') > -1) {//support multiple url fields url@field1,field2.. var arr = appFields['url'].split(','); for (var i in arr) { if ($('#'+ arr[i], appWindow.document).size()) { appFields['url'] = arr[i]; break; } } } var filename = $('#'+ appFields['url'], appWindow.document).val(); imce.highlight(filename.substr(filename.lastIndexOf('/')+1)); } //set send to sendtoFunc && imce.setSendTo(Drupal.t('Insert file'), sendtoFunc);});//sendTo functionvar appFinish = function(file, win) { var $doc = $(appWindow.document); for (var i in appFields) { $doc.find('#'+ appFields[i]).val(file[i]); } if (appFields['url']) { try{ $doc.find('#'+ appFields['url']).blur().change().focus(); }catch(e){ try{ $doc.find('#'+ appFields['url']).trigger('onblur').trigger('onchange').trigger('onfocus');//inline events for IE }catch(e){} } } appWindow.focus(); win.close();};//checks if a string is a function name in the given scope. returns function reference. supports x.y.z notation.var isFunc = function(str, scope) { var obj = scope || appWindow; var parts = str.split('.'), len = parts.length; for (var i = 0; i < len && (obj = obj[parts[i]]); i++); return i == len && $.isFunction(obj) ? obj : false;}})(jQuery);
|
(function($){$.fn.tipTip=function(options){var defaults={activation:"hover",keepAlive:false,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:false,enter:function(){},exit:function(){}};var opts=$.extend(defaults,options);if($("#tiptip_holder").length<=0){var tiptip_holder=$('<div id="tiptip_holder" style="max-width:'+opts.maxWidth+';"></div>');var tiptip_content=$('<div id="tiptip_content"></div>');var tiptip_arrow=$('<div id="tiptip_arrow"></div>');$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('<div id="tiptip_arrow_inner"></div>')))}else{var tiptip_holder=$("#tiptip_holder");var tiptip_content=$("#tiptip_content");var tiptip_arrow=$("#tiptip_arrow")}return this.each(function(){var org_elem=$(this);if(opts.content){var org_title=opts.content}else{var org_title=org_elem.attr(opts.attribute)}if(org_title!=""){if(!opts.content){org_elem.removeAttr(opts.attribute)}var timeout=false;if(opts.activation=="hover"){org_elem.hover(function(){active_tiptip()},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}else if(opts.activation=="focus"){org_elem.focus(function(){active_tiptip()}).blur(function(){deactive_tiptip()})}else if(opts.activation=="click"){org_elem.click(function(){active_tiptip();return false}).hover(function(){},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}function active_tiptip(){opts.enter.call(this);tiptip_content.html(org_title);tiptip_holder.hide().removeAttr("class").css("margin","0");tiptip_arrow.removeAttr("style");var top=parseInt(org_elem.offset()['top']);var left=parseInt(org_elem.offset()['left']);var org_width=parseInt(org_elem.outerWidth());var org_height=parseInt(org_elem.outerHeight());var tip_w=tiptip_holder.outerWidth();var tip_h=tiptip_holder.outerHeight();var w_compare=Math.round((org_width-tip_w)/2);var h_compare=Math.round((org_height-tip_h)/2);var marg_left=Math.round(left+w_compare);var marg_top=Math.round(top+org_height+opts.edgeOffset);var t_class="";var arrow_top="";var arrow_left=Math.round(tip_w-12)/2;if(opts.defaultPosition=="bottom"){t_class="_bottom"}else if(opts.defaultPosition=="top"){t_class="_top"}else if(opts.defaultPosition=="left"){t_class="_left"}else if(opts.defaultPosition=="right"){t_class="_right"}var right_compare=(w_compare+left)<parseInt($(window).scrollLeft());var left_compare=(tip_w+left)>parseInt($(window).width());if((right_compare&&w_compare<0)||(t_class=="_right"&&!left_compare)||(t_class=="_left"&&left<(tip_w+opts.edgeOffset+5))){t_class="_right";arrow_top=Math.round(tip_h-13)/2;arrow_left=-12;marg_left=Math.round(left+org_width+opts.edgeOffset);marg_top=Math.round(top+h_compare)}else if((left_compare&&w_compare<0)||(t_class=="_left"&&!right_compare)){t_class="_left";arrow_top=Math.round(tip_h-13)/2;arrow_left=Math.round(tip_w);marg_left=Math.round(left-(tip_w+opts.edgeOffset+5));marg_top=Math.round(top+h_compare)}var top_compare=(top+org_height+opts.edgeOffset+tip_h+8)>parseInt($(window).height()+$(window).scrollTop());var bottom_compare=((top+org_height)-(opts.edgeOffset+tip_h+8))<0;if(top_compare||(t_class=="_bottom"&&top_compare)||(t_class=="_top"&&!bottom_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_top"}else{t_class=t_class+"_top"}arrow_top=tip_h;marg_top=Math.round(top-(tip_h+5+opts.edgeOffset))}else if(bottom_compare|(t_class=="_top"&&bottom_compare)||(t_class=="_bottom"&&!top_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_bottom"}else{t_class=t_class+"_bottom"}arrow_top=-12;marg_top=Math.round(top+org_height+opts.edgeOffset)}if(t_class=="_right_top"||t_class=="_left_top"){marg_top=marg_top+5}else if(t_class=="_right_bottom"||t_class=="_left_bottom"){marg_top=marg_top-5}if(t_class=="_left_top"||t_class=="_left_bottom"){marg_left=marg_left+5}tiptip_arrow.css({"margin-left":arrow_left+"px","margin-top":arrow_top+"px"});tiptip_holder.css({"margin-left":marg_left+"px","margin-top":marg_top+"px"}).attr("class","tip"+t_class);if(timeout){clearTimeout(timeout)}timeout=setTimeout(function(){tiptip_holder.stop(true,true).fadeIn(opts.fadeIn)},opts.delay)}function deactive_tiptip(){opts.exit.call(this);if(timeout){clearTimeout(timeout)}tiptip_holder.fadeOut(opts.fadeOut)}}})}})(jQuery);
|
(function($){$.fn.tipTip=function(options){var defaults={activation:"hover",keepAlive:false,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:false,enter:function(){},exit:function(){}};var opts=$.extend(defaults,options);if($("#tiptip_holder").length<=0){var tiptip_holder=$('<div id="tiptip_holder" style="max-width:'+opts.maxWidth+';"></div>');var tiptip_content=$('<div id="tiptip_content"></div>');var tiptip_arrow=$('<div id="tiptip_arrow"></div>');$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('<div id="tiptip_arrow_inner"></div>')))}else{var tiptip_holder=$("#tiptip_holder");var tiptip_content=$("#tiptip_content");var tiptip_arrow=$("#tiptip_arrow")}return this.each(function(){var org_elem=$(this);if(opts.content){var org_title=opts.content}else{var org_title=org_elem.attr(opts.attribute)}if(org_title!=""){if(!opts.content){org_elem.removeAttr(opts.attribute)}var timeout=false;if(opts.activation=="hover"){org_elem.hover(function(){active_tiptip()},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}else if(opts.activation=="focus"){org_elem.focus(function(){active_tiptip()}).blur(function(){deactive_tiptip()})}else if(opts.activation=="click"){org_elem.click(function(){active_tiptip()}).hover(function(){},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}function active_tiptip(){opts.enter.call(this);tiptip_content.html(org_title);tiptip_holder.hide().removeAttr("class").css("margin","0");tiptip_arrow.removeAttr("style");var top=parseInt(org_elem.offset()['top']);var left=parseInt(org_elem.offset()['left']);var org_width=parseInt(org_elem.outerWidth());var org_height=parseInt(org_elem.outerHeight());var tip_w=tiptip_holder.outerWidth();var tip_h=tiptip_holder.outerHeight();var w_compare=Math.round((org_width-tip_w)/2);var h_compare=Math.round((org_height-tip_h)/2);var marg_left=Math.round(left+w_compare);var marg_top=Math.round(top+org_height+opts.edgeOffset);var t_class="";var arrow_top="";var arrow_left=Math.round(tip_w-12)/2;if(opts.defaultPosition=="bottom"){t_class="_bottom"}else if(opts.defaultPosition=="top"){t_class="_top"}else if(opts.defaultPosition=="left"){t_class="_left"}else if(opts.defaultPosition=="right"){t_class="_right"}var right_compare=(w_compare+left)<parseInt($(window).scrollLeft());var left_compare=(tip_w+left)>parseInt($(window).width());if((right_compare&&w_compare<0)||(t_class=="_right"&&!left_compare)||(t_class=="_left"&&left<(tip_w+opts.edgeOffset+5))){t_class="_right";arrow_top=Math.round(tip_h-13)/2;arrow_left=-12;marg_left=Math.round(left+org_width+opts.edgeOffset);marg_top=Math.round(top+h_compare)}else if((left_compare&&w_compare<0)||(t_class=="_left"&&!right_compare)){t_class="_left";arrow_top=Math.round(tip_h-13)/2;arrow_left=Math.round(tip_w);marg_left=Math.round(left-(tip_w+opts.edgeOffset+5));marg_top=Math.round(top+h_compare)}var top_compare=(top+org_height+opts.edgeOffset+tip_h+8)>parseInt($(window).height()+$(window).scrollTop());var bottom_compare=((top+org_height)-(opts.edgeOffset+tip_h+8))<0;if(top_compare||(t_class=="_bottom"&&top_compare)||(t_class=="_top"&&!bottom_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_top"}else{t_class=t_class+"_top"}arrow_top=tip_h;marg_top=Math.round(top-(tip_h+5+opts.edgeOffset))}else if(bottom_compare|(t_class=="_top"&&bottom_compare)||(t_class=="_bottom"&&!top_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_bottom"}else{t_class=t_class+"_bottom"}arrow_top=-12;marg_top=Math.round(top+org_height+opts.edgeOffset)}if(t_class=="_right_top"||t_class=="_left_top"){marg_top=marg_top+5}else if(t_class=="_right_bottom"||t_class=="_left_bottom"){marg_top=marg_top-5}if(t_class=="_left_top"||t_class=="_left_bottom"){marg_left=marg_left+5}tiptip_arrow.css({"margin-left":arrow_left+"px","margin-top":arrow_top+"px"});tiptip_holder.css({"margin-left":marg_left+"px","margin-top":marg_top+"px"}).attr("class","tip"+t_class);if(timeout){clearTimeout(timeout)}timeout=setTimeout(function(){tiptip_holder.stop(true,true).fadeIn(opts.fadeIn)},opts.delay)}function deactive_tiptip(){opts.exit.call(this);if(timeout){clearTimeout(timeout)}tiptip_holder.fadeOut(opts.fadeOut)}}})}})(jQuery);
|
(function($){$.fn.tipTip=function(options){var defaults={activation:"hover",keepAlive:false,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:false,enter:function(){},exit:function(){}};var opts=$.extend(defaults,options);if($("#tiptip_holder").length<=0){var tiptip_holder=$('<div id="tiptip_holder" style="max-width:'+opts.maxWidth+';"></div>');var tiptip_content=$('<div id="tiptip_content"></div>');var tiptip_arrow=$('<div id="tiptip_arrow"></div>');$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('<div id="tiptip_arrow_inner"></div>')))}else{var tiptip_holder=$("#tiptip_holder");var tiptip_content=$("#tiptip_content");var tiptip_arrow=$("#tiptip_arrow")}return this.each(function(){var org_elem=$(this);if(opts.content){var org_title=opts.content}else{var org_title=org_elem.attr(opts.attribute)}if(org_title!=""){if(!opts.content){org_elem.removeAttr(opts.attribute)}var timeout=false;if(opts.activation=="hover"){org_elem.hover(function(){active_tiptip()},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}else if(opts.activation=="focus"){org_elem.focus(function(){active_tiptip()}).blur(function(){deactive_tiptip()})}else if(opts.activation=="click"){org_elem.click(function(){active_tiptip();return false}).hover(function(){},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}function active_tiptip(){opts.enter.call(this);tiptip_content.html(org_title);tiptip_holder.hide().removeAttr("class").css("margin","0");tiptip_arrow.removeAttr("style");var top=parseInt(org_elem.offset()['top']);var left=parseInt(org_elem.offset()['left']);var org_width=parseInt(org_elem.outerWidth());var org_height=parseInt(org_elem.outerHeight());var tip_w=tiptip_holder.outerWidth();var tip_h=tiptip_holder.outerHeight();var w_compare=Math.round((org_width-tip_w)/2);var h_compare=Math.round((org_height-tip_h)/2);var marg_left=Math.round(left+w_compare);var marg_top=Math.round(top+org_height+opts.edgeOffset);var t_class="";var arrow_top="";var arrow_left=Math.round(tip_w-12)/2;if(opts.defaultPosition=="bottom"){t_class="_bottom"}else if(opts.defaultPosition=="top"){t_class="_top"}else if(opts.defaultPosition=="left"){t_class="_left"}else if(opts.defaultPosition=="right"){t_class="_right"}var right_compare=(w_compare+left)<parseInt($(window).scrollLeft());var left_compare=(tip_w+left)>parseInt($(window).width());if((right_compare&&w_compare<0)||(t_class=="_right"&&!left_compare)||(t_class=="_left"&&left<(tip_w+opts.edgeOffset+5))){t_class="_right";arrow_top=Math.round(tip_h-13)/2;arrow_left=-12;marg_left=Math.round(left+org_width+opts.edgeOffset);marg_top=Math.round(top+h_compare)}else if((left_compare&&w_compare<0)||(t_class=="_left"&&!right_compare)){t_class="_left";arrow_top=Math.round(tip_h-13)/2;arrow_left=Math.round(tip_w);marg_left=Math.round(left-(tip_w+opts.edgeOffset+5));marg_top=Math.round(top+h_compare)}var top_compare=(top+org_height+opts.edgeOffset+tip_h+8)>parseInt($(window).height()+$(window).scrollTop());var bottom_compare=((top+org_height)-(opts.edgeOffset+tip_h+8))<0;if(top_compare||(t_class=="_bottom"&&top_compare)||(t_class=="_top"&&!bottom_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_top"}else{t_class=t_class+"_top"}arrow_top=tip_h;marg_top=Math.round(top-(tip_h+5+opts.edgeOffset))}else if(bottom_compare|(t_class=="_top"&&bottom_compare)||(t_class=="_bottom"&&!top_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_bottom"}else{t_class=t_class+"_bottom"}arrow_top=-12;marg_top=Math.round(top+org_height+opts.edgeOffset)}if(t_class=="_right_top"||t_class=="_left_top"){marg_top=marg_top+5}else if(t_class=="_right_bottom"||t_class=="_left_bottom"){marg_top=marg_top-5}if(t_class=="_left_top"||t_class=="_left_bottom"){marg_left=marg_left+5}tiptip_arrow.css({"margin-left":arrow_left+"px","margin-top":arrow_top+"px"});tiptip_holder.css({"margin-left":marg_left+"px","margin-top":marg_top+"px"}).attr("class","tip"+t_class);if(timeout){clearTimeout(timeout)}timeout=setTimeout(function(){tiptip_holder.stop(true,true).fadeIn(opts.fadeIn)},opts.delay)}function deactive_tiptip(){opts.exit.call(this);if(timeout){clearTimeout(timeout)}tiptip_holder.fadeOut(opts.fadeOut)}}})}})(jQuery);
|
$('select[name ^= operator]', this).each(function () { $(this).css('display', '');
|
$(function() { $('#keyword-form').submit(function () { loadIndexTerms(); return false;
|
$('select[name ^= operator]', this).each(function () { $(this).css('display', ''); });
|
});
|
$('select[name ^= operator]', this).each(function () { $(this).css('display', ''); });
|
|
function task() { SystemMonitorController.getHibernateStatus(handleSuccess); if (!pauseBx.getValue()) { SystemMonitorController.getCacheStatus(handleCacheData); } SystemMonitorController.getSpaceStatus(handleSpaceStatus); } function handleSuccess(data) { Ext.DomHelper.overwrite("hibernateStats", data); } function handleCacheData(data) { Ext.DomHelper.overwrite("cacheStats", data); } function handleSpaceStatus(data) { Ext.DomHelper.overwrite("spaceStats", data); } function flushAllCaches() { Ext.Msg.show({ title : 'Are you sure?', msg : 'Flush all caches?', buttons : Ext.Msg.YESNO, fn : processFlushAllCachesResult, animEl : 'cacheStats', icon : Ext.MessageBox.QUESTION }); } function flushCache(name) { Ext.Msg.show({ title : 'Are you sure?', msg : 'Flush ' + name + ' cache?', buttons : Ext.Msg.YESNO, fn : processFlushCacheResult, animEl : 'cacheStats', icon : Ext.MessageBox.QUESTION, cacheName : name }); } function resetHibernateStats() { Ext.Msg.show({ title : 'Are you sure?', msg : 'Reset Hibernate stats?', buttons : Ext.Msg.YESNO, fn : processResetHibernateStats, animEl : 'hibstat-reset-button', icon : Ext.MessageBox.QUESTION, cacheName : name }); } function processFlushCacheResult(btn, text, opt) { if (btn == 'yes') { SystemMonitorController.flushCache(opt.cacheName); } } function processFlushAllCachesResult(btn, text, opt) { if (btn == 'yes') { SystemMonitorController.flushAllCaches(); } } function processResetHibernateStats(btn, text, opt) { if (btn == 'yes') { SystemMonitorController.resetHibernateStatus(); SystemMonitorController.getHibernateStatus(handleSuccess); } }
|
Ext.onReady(function() { // fire once immediately. task(); window.setInterval(task, 10000); });
|
|
pause:settings.pause==1,
|
pause:false,
|
$('.views_slideshow_singleframe_main:not(.viewsSlideshowSingleFrame-processed)', context).addClass('viewsSlideshowSingleFrame-processed').each(function() { var fullId = '#' + $(this).attr('id'); var settings = Drupal.settings.viewsSlideshowSingleFrame[fullId]; settings.targetId = '#' + $(fullId + " :first").attr('id'); settings.opts = { speed:settings.speed, timeout:parseInt(settings.timeout), delay:parseInt(settings.delay), sync:settings.sync==1, random:settings.random==1, pause:settings.pause==1, prev:(settings.controls > 0)?'#views_slideshow_singleframe_prev_' + settings.id:null, next:(settings.controls > 0)?'#views_slideshow_singleframe_next_' + settings.id:null, pager:(settings.pager > 0)?'#views_slideshow_singleframe_pager_' + settings.id:null, pagerAnchorBuilder: function(idx, slide) { var classes = 'pager-item pager-num-' + (idx+1); if (idx % 2) { classes += ' odd'; } else { classes += ' even'; } return Drupal.theme('viewsSlideshowPager' + settings.pager_type, classes, idx, slide); }, after:function(curr, next, opts) { // Used for Image Counter. if (settings.image_count) { $('#views_slideshow_singleframe_image_count_' + settings.id + ' span.num').html(opts.currSlide + 1); $('#views_slideshow_singleframe_image_count_' + settings.id + ' span.total').html(opts.slideCount); } }, cleartype:(settings.ie.cleartype), cleartypeNoBg:(settings.ie.cleartypenobg) } if (settings.pager_hover == 1) { settings.opts.pagerEvent = 'mouseover'; settings.opts.pauseOnPagerHover = true; } if (settings.effect == 'none') { settings.opts.speed = 1; } else { settings.opts.fx = settings.effect; } // Add additional settings. var advanced = settings.advanced.split("\n"); for (i=0; i<advanced.length; i++) { var prop = ''; var value = ''; var property = advanced[i].split(":"); for (j=0; j<property.length; j++) { if (j == 0) { prop = property[j]; } else if (j == 1) { value = property[j]; } else { value += ":" + property[j]; } } // Need to evaluate so true and false isn't a string. if (value == 'true' || value == 'false') { value = eval(value); } settings.opts[prop] = value; } $(settings.targetId).cycle(settings.opts); // Show image count for people who have js enabled. $('#views_slideshow_singleframe_image_count_' + settings.id).show(); if (settings.controls > 0) { // Show controls for people who have js enabled browsers. $('#views_slideshow_singleframe_controls_' + settings.id).show(); $('#views_slideshow_singleframe_playpause_' + settings.id).click(function(e) { if (settings.paused) { $(settings.targetId).cycle('resume'); $('#views_slideshow_singleframe_playpause_' + settings.id) .addClass('views_slideshow_singleframe_pause') .addClass('views_slideshow_pause') .removeClass('views_slideshow_singleframe_play') .removeClass('views_slideshow_play') .text('Pause'); settings.paused = false; } else { $(settings.targetId).cycle('pause'); $('#views_slideshow_singleframe_playpause_' + settings.id) .addClass('views_slideshow_singleframe_play') .addClass('views_slideshow_play') .removeClass('views_slideshow_singleframe_pause') .removeClass('views_slideshow_pause') .text('Resume'); settings.paused = true; } e.preventDefault(); }); } });
|
if (settings.pause == 1) { $('#views_slideshow_singleframe_teaser_section_' + settings.id).hover(function() { $(settings.targetId).cycle('pause'); }, function() { if (settings.paused == false) { $(settings.targetId).cycle('resume'); } }); } if (settings.pause_on_click == 1) { $('#views_slideshow_singleframe_teaser_section_' + settings.id).click(function() { viewsSlideshowPause(settings); }); }
|
$('.views_slideshow_singleframe_main:not(.viewsSlideshowSingleFrame-processed)', context).addClass('viewsSlideshowSingleFrame-processed').each(function() { var fullId = '#' + $(this).attr('id'); var settings = Drupal.settings.viewsSlideshowSingleFrame[fullId]; settings.targetId = '#' + $(fullId + " :first").attr('id'); settings.opts = { speed:settings.speed, timeout:parseInt(settings.timeout), delay:parseInt(settings.delay), sync:settings.sync==1, random:settings.random==1, pause:settings.pause==1, prev:(settings.controls > 0)?'#views_slideshow_singleframe_prev_' + settings.id:null, next:(settings.controls > 0)?'#views_slideshow_singleframe_next_' + settings.id:null, pager:(settings.pager > 0)?'#views_slideshow_singleframe_pager_' + settings.id:null, pagerAnchorBuilder: function(idx, slide) { var classes = 'pager-item pager-num-' + (idx+1); if (idx % 2) { classes += ' odd'; } else { classes += ' even'; } return Drupal.theme('viewsSlideshowPager' + settings.pager_type, classes, idx, slide); }, after:function(curr, next, opts) { // Used for Image Counter. if (settings.image_count) { $('#views_slideshow_singleframe_image_count_' + settings.id + ' span.num').html(opts.currSlide + 1); $('#views_slideshow_singleframe_image_count_' + settings.id + ' span.total').html(opts.slideCount); } }, cleartype:(settings.ie.cleartype), cleartypeNoBg:(settings.ie.cleartypenobg) } if (settings.pager_hover == 1) { settings.opts.pagerEvent = 'mouseover'; settings.opts.pauseOnPagerHover = true; } if (settings.effect == 'none') { settings.opts.speed = 1; } else { settings.opts.fx = settings.effect; } // Add additional settings. var advanced = settings.advanced.split("\n"); for (i=0; i<advanced.length; i++) { var prop = ''; var value = ''; var property = advanced[i].split(":"); for (j=0; j<property.length; j++) { if (j == 0) { prop = property[j]; } else if (j == 1) { value = property[j]; } else { value += ":" + property[j]; } } // Need to evaluate so true and false isn't a string. if (value == 'true' || value == 'false') { value = eval(value); } settings.opts[prop] = value; } $(settings.targetId).cycle(settings.opts); // Show image count for people who have js enabled. $('#views_slideshow_singleframe_image_count_' + settings.id).show(); if (settings.controls > 0) { // Show controls for people who have js enabled browsers. $('#views_slideshow_singleframe_controls_' + settings.id).show(); $('#views_slideshow_singleframe_playpause_' + settings.id).click(function(e) { if (settings.paused) { $(settings.targetId).cycle('resume'); $('#views_slideshow_singleframe_playpause_' + settings.id) .addClass('views_slideshow_singleframe_pause') .addClass('views_slideshow_pause') .removeClass('views_slideshow_singleframe_play') .removeClass('views_slideshow_play') .text('Pause'); settings.paused = false; } else { $(settings.targetId).cycle('pause'); $('#views_slideshow_singleframe_playpause_' + settings.id) .addClass('views_slideshow_singleframe_play') .addClass('views_slideshow_play') .removeClass('views_slideshow_singleframe_pause') .removeClass('views_slideshow_pause') .text('Resume'); settings.paused = true; } e.preventDefault(); }); } });
|
|
$(settings.targetId).cycle('resume'); $('#views_slideshow_singleframe_playpause_' + settings.id) .addClass('views_slideshow_singleframe_pause') .addClass('views_slideshow_pause') .removeClass('views_slideshow_singleframe_play') .removeClass('views_slideshow_play') .text('Pause'); settings.paused = false;
|
viewsSlideshowSingleFrameResume(settings);
|
$('.views_slideshow_singleframe_main:not(.viewsSlideshowSingleFrame-processed)', context).addClass('viewsSlideshowSingleFrame-processed').each(function() { var fullId = '#' + $(this).attr('id'); var settings = Drupal.settings.viewsSlideshowSingleFrame[fullId]; settings.targetId = '#' + $(fullId + " :first").attr('id'); settings.opts = { speed:settings.speed, timeout:parseInt(settings.timeout), delay:parseInt(settings.delay), sync:settings.sync==1, random:settings.random==1, pause:settings.pause==1, prev:(settings.controls > 0)?'#views_slideshow_singleframe_prev_' + settings.id:null, next:(settings.controls > 0)?'#views_slideshow_singleframe_next_' + settings.id:null, pager:(settings.pager > 0)?'#views_slideshow_singleframe_pager_' + settings.id:null, pagerAnchorBuilder: function(idx, slide) { var classes = 'pager-item pager-num-' + (idx+1); if (idx % 2) { classes += ' odd'; } else { classes += ' even'; } return Drupal.theme('viewsSlideshowPager' + settings.pager_type, classes, idx, slide); }, after:function(curr, next, opts) { // Used for Image Counter. if (settings.image_count) { $('#views_slideshow_singleframe_image_count_' + settings.id + ' span.num').html(opts.currSlide + 1); $('#views_slideshow_singleframe_image_count_' + settings.id + ' span.total').html(opts.slideCount); } }, cleartype:(settings.ie.cleartype), cleartypeNoBg:(settings.ie.cleartypenobg) } if (settings.pager_hover == 1) { settings.opts.pagerEvent = 'mouseover'; settings.opts.pauseOnPagerHover = true; } if (settings.effect == 'none') { settings.opts.speed = 1; } else { settings.opts.fx = settings.effect; } // Add additional settings. var advanced = settings.advanced.split("\n"); for (i=0; i<advanced.length; i++) { var prop = ''; var value = ''; var property = advanced[i].split(":"); for (j=0; j<property.length; j++) { if (j == 0) { prop = property[j]; } else if (j == 1) { value = property[j]; } else { value += ":" + property[j]; } } // Need to evaluate so true and false isn't a string. if (value == 'true' || value == 'false') { value = eval(value); } settings.opts[prop] = value; } $(settings.targetId).cycle(settings.opts); // Show image count for people who have js enabled. $('#views_slideshow_singleframe_image_count_' + settings.id).show(); if (settings.controls > 0) { // Show controls for people who have js enabled browsers. $('#views_slideshow_singleframe_controls_' + settings.id).show(); $('#views_slideshow_singleframe_playpause_' + settings.id).click(function(e) { if (settings.paused) { $(settings.targetId).cycle('resume'); $('#views_slideshow_singleframe_playpause_' + settings.id) .addClass('views_slideshow_singleframe_pause') .addClass('views_slideshow_pause') .removeClass('views_slideshow_singleframe_play') .removeClass('views_slideshow_play') .text('Pause'); settings.paused = false; } else { $(settings.targetId).cycle('pause'); $('#views_slideshow_singleframe_playpause_' + settings.id) .addClass('views_slideshow_singleframe_play') .addClass('views_slideshow_play') .removeClass('views_slideshow_singleframe_pause') .removeClass('views_slideshow_pause') .text('Resume'); settings.paused = true; } e.preventDefault(); }); } });
|
$(settings.targetId).cycle('pause'); $('#views_slideshow_singleframe_playpause_' + settings.id) .addClass('views_slideshow_singleframe_play') .addClass('views_slideshow_play') .removeClass('views_slideshow_singleframe_pause') .removeClass('views_slideshow_pause') .text('Resume'); settings.paused = true;
|
viewsSlideshowSingleFramePause(settings);
|
$('.views_slideshow_singleframe_main:not(.viewsSlideshowSingleFrame-processed)', context).addClass('viewsSlideshowSingleFrame-processed').each(function() { var fullId = '#' + $(this).attr('id'); var settings = Drupal.settings.viewsSlideshowSingleFrame[fullId]; settings.targetId = '#' + $(fullId + " :first").attr('id'); settings.opts = { speed:settings.speed, timeout:parseInt(settings.timeout), delay:parseInt(settings.delay), sync:settings.sync==1, random:settings.random==1, pause:settings.pause==1, prev:(settings.controls > 0)?'#views_slideshow_singleframe_prev_' + settings.id:null, next:(settings.controls > 0)?'#views_slideshow_singleframe_next_' + settings.id:null, pager:(settings.pager > 0)?'#views_slideshow_singleframe_pager_' + settings.id:null, pagerAnchorBuilder: function(idx, slide) { var classes = 'pager-item pager-num-' + (idx+1); if (idx % 2) { classes += ' odd'; } else { classes += ' even'; } return Drupal.theme('viewsSlideshowPager' + settings.pager_type, classes, idx, slide); }, after:function(curr, next, opts) { // Used for Image Counter. if (settings.image_count) { $('#views_slideshow_singleframe_image_count_' + settings.id + ' span.num').html(opts.currSlide + 1); $('#views_slideshow_singleframe_image_count_' + settings.id + ' span.total').html(opts.slideCount); } }, cleartype:(settings.ie.cleartype), cleartypeNoBg:(settings.ie.cleartypenobg) } if (settings.pager_hover == 1) { settings.opts.pagerEvent = 'mouseover'; settings.opts.pauseOnPagerHover = true; } if (settings.effect == 'none') { settings.opts.speed = 1; } else { settings.opts.fx = settings.effect; } // Add additional settings. var advanced = settings.advanced.split("\n"); for (i=0; i<advanced.length; i++) { var prop = ''; var value = ''; var property = advanced[i].split(":"); for (j=0; j<property.length; j++) { if (j == 0) { prop = property[j]; } else if (j == 1) { value = property[j]; } else { value += ":" + property[j]; } } // Need to evaluate so true and false isn't a string. if (value == 'true' || value == 'false') { value = eval(value); } settings.opts[prop] = value; } $(settings.targetId).cycle(settings.opts); // Show image count for people who have js enabled. $('#views_slideshow_singleframe_image_count_' + settings.id).show(); if (settings.controls > 0) { // Show controls for people who have js enabled browsers. $('#views_slideshow_singleframe_controls_' + settings.id).show(); $('#views_slideshow_singleframe_playpause_' + settings.id).click(function(e) { if (settings.paused) { $(settings.targetId).cycle('resume'); $('#views_slideshow_singleframe_playpause_' + settings.id) .addClass('views_slideshow_singleframe_pause') .addClass('views_slideshow_pause') .removeClass('views_slideshow_singleframe_play') .removeClass('views_slideshow_play') .text('Pause'); settings.paused = false; } else { $(settings.targetId).cycle('pause'); $('#views_slideshow_singleframe_playpause_' + settings.id) .addClass('views_slideshow_singleframe_play') .addClass('views_slideshow_play') .removeClass('views_slideshow_singleframe_pause') .removeClass('views_slideshow_pause') .text('Resume'); settings.paused = true; } e.preventDefault(); }); } });
|
combo.setValue(record.data.value);
|
combo.setValue(record.data.value + ".");
|
this.on("select", function(combo, record, index) { this.characteristic.value = record.data.value; this.characteristic.valueUri = record.data.valueUri; combo.setValue(record.data.value); });
|
scrape: function(data) { return data; }
|
scrape: function(data) { arr = data.split($.pageless.settings.split_string); if (arr.length == 1) { return arr[0]; } else { return arr; } }
|
(function($) { $.pageless = function(settings) { $.isFunction(settings) ? settings.call() : $.pageless.init(settings); }; // available params // loader: loading div // pagination: div selector for the pagination links // loaderMsg: // loaderImage: // loaderHtml: $.pageless.settings = { currentPage: 1, pagination: '.pagination', url: location.href, params: {}, // params of the query you can pass auth_token here distance: 100, // page distance in px to the end when the ajax function is launch loaderImage: "/images/load.gif", scrape: function(data) { return data; } // Don't do anything by default }; $.pageless.loaderHtml = function(){ return $.pageless.settings.loaderHtml || '\<div id="pageless-loader" style="display:none;text-align:center;width:100%;">\ <div class="msg" style="color:#e9e9e9;font-size:2em"></div>\ <img src="' + $.pageless.settings.loaderImage + '" title="load" alt="loading more results" style="margin: 10px auto" />\</div>'; }; // settings params: totalPages $.pageless.init = function(settings) { if ($.pageless.settings.inited) return; $.pageless.settings.inited = true; if (settings) $.extend($.pageless.settings, settings); // for accessibility we can keep pagination links // but since we have javascript enabled we remove pagination links if($.pageless.settings.pagination) $($.pageless.settings.pagination).remove(); // start the listener $.pageless.startListener(); if( $.pageless.settings.progress_id ){ // advance to the previous progress id set the progress element element = $( "#"+$.escape($.pageless.settings.progress_id) ); offset = $.pageless.settings.progress_top ? (element.offset()['top']-(+$.pageless.settings.progress_top)) : element.offset()['top']; $(window).scrollTop( offset ); $.pageless.setProgress( element ); } else if ($.pageless.settings.progress){ // set progress to the first element matching the 'progress' selector $.pageless.setProgress( $( $.pageless.settings.progress ).eq(0) ); } }; // init loader val $.pageless.isLoading = false; $.fn.pageless = function(settings) { $.pageless.init(settings); $.pageless.el = $(this); // loader element if(settings.loader && $(this).find(settings.loader).length){ $.pageless.loader = $(this).find(settings.loader); } else { $.pageless.loader = $($.pageless.loaderHtml()); $(this).append($.pageless.loader); // if we use the default loader, set the message if(!settings.loaderHtml) { $('#pageless-loader .msg').html(settings.loaderMsg) } } }; // $.pageless.loading = function(bool){ if(bool === true){ $.pageless.isLoading = true; if($.pageless.loader) $.pageless.loader.fadeIn('normal'); } else { $.pageless.isLoading = false; if($.pageless.loader) $.pageless.loader.fadeOut('normal'); } }; $.pageless.stopListener = function() { $(window).unbind('.pageless'); }; $.pageless.startListener = function() { $(window).bind('scroll.pageless', $.pageless.scroll); }; // set the progress to current.id $.pageless.setProgress = function(current) { if(current && current.attr('id') ) { // set the cookie and a variable to access the current progress element $.pageless.progress_current = current; document.cookie = "pageless_progress="+current.attr('id')+"; path="+location.pathname; } }; $.pageless.scroll = function() { // listener was stopped or we've run out of pages if($.pageless.settings.totalPages <= $.pageless.settings.currentPage){ $.pageless.stopListener(); // if there is a afterStopListener callback we call it if ($.pageless.settings.afterStopListener) { $.pageless.settings.afterStopListener.call(); } return; } else if( $.pageless.progress_current && ($.pageless.progress_current.offset()['top']-(+$.pageless.settings.progress_top)) < $(window).scrollTop() ) { // find the next element matching the 'progress' selector next_current = $.pageless.progress_current.nextAll( $.pageless.settings.progress+'[id]:first' ); // set the progress to cookie to the next element $.pageless.setProgress( next_current ); // and trigger the scroll event on the new one // (in case we need to move forward more than one element) // (ie user presses 'end' key) $(window).trigger('scroll'); } // distance to end of page var distance = $(document).height()-$(window).scrollTop()-$(window).height(); // if slider past our scroll offset, then fire a request for more data if(!$.pageless.isLoading && (distance < $.pageless.settings.distance)) { $.pageless.loading(true); // move to next page $.pageless.settings.currentPage++; // set up ajax query params $.extend($.pageless.settings.params, {page: $.pageless.settings.currentPage}); // finally ajax query $.get($.pageless.settings.url, $.pageless.settings.params, function(data){ var data = $.pageless.settings.scrape(data); if ($.pageless.loader) { $.pageless.loader.before(data) } else { $.pageless.el.append(data) } $.pageless.loading(false); // if there is a complete callback we call it if ($.pageless.settings.complete) { $.pageless.settings.complete.call(); } }); } };})(jQuery);
|
if( $.pageless.settings.progress_id ){ element = $( "#"+$.escape($.pageless.settings.progress_id) ); offset = $.pageless.settings.progress_top ? (element.offset()['top']-(+$.pageless.settings.progress_top)) : element.offset()['top']; $(window).scrollTop( offset ); $.pageless.setProgress( element ); } else if ($.pageless.settings.progress){ $.pageless.setProgress( $( $.pageless.settings.progress ).eq(0) ); }
|
(function($) { $.pageless = function(settings) { $.isFunction(settings) ? settings.call() : $.pageless.init(settings); }; // available params // loader: loading div // pagination: div selector for the pagination links // loaderMsg: // loaderImage: // loaderHtml: $.pageless.settings = { currentPage: 1, pagination: '.pagination', url: location.href, params: {}, // params of the query you can pass auth_token here distance: 100, // page distance in px to the end when the ajax function is launch loaderImage: "/images/load.gif", scrape: function(data) { return data; } // Don't do anything by default }; $.pageless.loaderHtml = function(){ return $.pageless.settings.loaderHtml || '\<div id="pageless-loader" style="display:none;text-align:center;width:100%;">\ <div class="msg" style="color:#e9e9e9;font-size:2em"></div>\ <img src="' + $.pageless.settings.loaderImage + '" title="load" alt="loading more results" style="margin: 10px auto" />\</div>'; }; // settings params: totalPages $.pageless.init = function(settings) { if ($.pageless.settings.inited) return; $.pageless.settings.inited = true; if (settings) $.extend($.pageless.settings, settings); // for accessibility we can keep pagination links // but since we have javascript enabled we remove pagination links if($.pageless.settings.pagination) $($.pageless.settings.pagination).remove(); // start the listener $.pageless.startListener(); if( $.pageless.settings.progress_id ){ // advance to the previous progress id set the progress element element = $( "#"+$.escape($.pageless.settings.progress_id) ); offset = $.pageless.settings.progress_top ? (element.offset()['top']-(+$.pageless.settings.progress_top)) : element.offset()['top']; $(window).scrollTop( offset ); $.pageless.setProgress( element ); } else if ($.pageless.settings.progress){ // set progress to the first element matching the 'progress' selector $.pageless.setProgress( $( $.pageless.settings.progress ).eq(0) ); } }; // init loader val $.pageless.isLoading = false; $.fn.pageless = function(settings) { $.pageless.init(settings); $.pageless.el = $(this); // loader element if(settings.loader && $(this).find(settings.loader).length){ $.pageless.loader = $(this).find(settings.loader); } else { $.pageless.loader = $($.pageless.loaderHtml()); $(this).append($.pageless.loader); // if we use the default loader, set the message if(!settings.loaderHtml) { $('#pageless-loader .msg').html(settings.loaderMsg) } } }; // $.pageless.loading = function(bool){ if(bool === true){ $.pageless.isLoading = true; if($.pageless.loader) $.pageless.loader.fadeIn('normal'); } else { $.pageless.isLoading = false; if($.pageless.loader) $.pageless.loader.fadeOut('normal'); } }; $.pageless.stopListener = function() { $(window).unbind('.pageless'); }; $.pageless.startListener = function() { $(window).bind('scroll.pageless', $.pageless.scroll); }; // set the progress to current.id $.pageless.setProgress = function(current) { if(current && current.attr('id') ) { // set the cookie and a variable to access the current progress element $.pageless.progress_current = current; document.cookie = "pageless_progress="+current.attr('id')+"; path="+location.pathname; } }; $.pageless.scroll = function() { // listener was stopped or we've run out of pages if($.pageless.settings.totalPages <= $.pageless.settings.currentPage){ $.pageless.stopListener(); // if there is a afterStopListener callback we call it if ($.pageless.settings.afterStopListener) { $.pageless.settings.afterStopListener.call(); } return; } else if( $.pageless.progress_current && ($.pageless.progress_current.offset()['top']-(+$.pageless.settings.progress_top)) < $(window).scrollTop() ) { // find the next element matching the 'progress' selector next_current = $.pageless.progress_current.nextAll( $.pageless.settings.progress+'[id]:first' ); // set the progress to cookie to the next element $.pageless.setProgress( next_current ); // and trigger the scroll event on the new one // (in case we need to move forward more than one element) // (ie user presses 'end' key) $(window).trigger('scroll'); } // distance to end of page var distance = $(document).height()-$(window).scrollTop()-$(window).height(); // if slider past our scroll offset, then fire a request for more data if(!$.pageless.isLoading && (distance < $.pageless.settings.distance)) { $.pageless.loading(true); // move to next page $.pageless.settings.currentPage++; // set up ajax query params $.extend($.pageless.settings.params, {page: $.pageless.settings.currentPage}); // finally ajax query $.get($.pageless.settings.url, $.pageless.settings.params, function(data){ var data = $.pageless.settings.scrape(data); if ($.pageless.loader) { $.pageless.loader.before(data) } else { $.pageless.el.append(data) } $.pageless.loading(false); // if there is a complete callback we call it if ($.pageless.settings.complete) { $.pageless.settings.complete.call(); } }); } };})(jQuery);
|
|
if (settings.div1 && settings.div2 && settings.split_string ) { $.pageless.div1 = $(this).find(settings.div1) $.pageless.div2 = $(this).find(settings.div2) }
|
(function($) { $.pageless = function(settings) { $.isFunction(settings) ? settings.call() : $.pageless.init(settings); }; // available params // loader: loading div // pagination: div selector for the pagination links // loaderMsg: // loaderImage: // loaderHtml: $.pageless.settings = { currentPage: 1, pagination: '.pagination', url: location.href, params: {}, // params of the query you can pass auth_token here distance: 100, // page distance in px to the end when the ajax function is launch loaderImage: "/images/load.gif", scrape: function(data) { return data; } // Don't do anything by default }; $.pageless.loaderHtml = function(){ return $.pageless.settings.loaderHtml || '\<div id="pageless-loader" style="display:none;text-align:center;width:100%;">\ <div class="msg" style="color:#e9e9e9;font-size:2em"></div>\ <img src="' + $.pageless.settings.loaderImage + '" title="load" alt="loading more results" style="margin: 10px auto" />\</div>'; }; // settings params: totalPages $.pageless.init = function(settings) { if ($.pageless.settings.inited) return; $.pageless.settings.inited = true; if (settings) $.extend($.pageless.settings, settings); // for accessibility we can keep pagination links // but since we have javascript enabled we remove pagination links if($.pageless.settings.pagination) $($.pageless.settings.pagination).remove(); // start the listener $.pageless.startListener(); if( $.pageless.settings.progress_id ){ // advance to the previous progress id set the progress element element = $( "#"+$.escape($.pageless.settings.progress_id) ); offset = $.pageless.settings.progress_top ? (element.offset()['top']-(+$.pageless.settings.progress_top)) : element.offset()['top']; $(window).scrollTop( offset ); $.pageless.setProgress( element ); } else if ($.pageless.settings.progress){ // set progress to the first element matching the 'progress' selector $.pageless.setProgress( $( $.pageless.settings.progress ).eq(0) ); } }; // init loader val $.pageless.isLoading = false; $.fn.pageless = function(settings) { $.pageless.init(settings); $.pageless.el = $(this); // loader element if(settings.loader && $(this).find(settings.loader).length){ $.pageless.loader = $(this).find(settings.loader); } else { $.pageless.loader = $($.pageless.loaderHtml()); $(this).append($.pageless.loader); // if we use the default loader, set the message if(!settings.loaderHtml) { $('#pageless-loader .msg').html(settings.loaderMsg) } } }; // $.pageless.loading = function(bool){ if(bool === true){ $.pageless.isLoading = true; if($.pageless.loader) $.pageless.loader.fadeIn('normal'); } else { $.pageless.isLoading = false; if($.pageless.loader) $.pageless.loader.fadeOut('normal'); } }; $.pageless.stopListener = function() { $(window).unbind('.pageless'); }; $.pageless.startListener = function() { $(window).bind('scroll.pageless', $.pageless.scroll); }; // set the progress to current.id $.pageless.setProgress = function(current) { if(current && current.attr('id') ) { // set the cookie and a variable to access the current progress element $.pageless.progress_current = current; document.cookie = "pageless_progress="+current.attr('id')+"; path="+location.pathname; } }; $.pageless.scroll = function() { // listener was stopped or we've run out of pages if($.pageless.settings.totalPages <= $.pageless.settings.currentPage){ $.pageless.stopListener(); // if there is a afterStopListener callback we call it if ($.pageless.settings.afterStopListener) { $.pageless.settings.afterStopListener.call(); } return; } else if( $.pageless.progress_current && ($.pageless.progress_current.offset()['top']-(+$.pageless.settings.progress_top)) < $(window).scrollTop() ) { // find the next element matching the 'progress' selector next_current = $.pageless.progress_current.nextAll( $.pageless.settings.progress+'[id]:first' ); // set the progress to cookie to the next element $.pageless.setProgress( next_current ); // and trigger the scroll event on the new one // (in case we need to move forward more than one element) // (ie user presses 'end' key) $(window).trigger('scroll'); } // distance to end of page var distance = $(document).height()-$(window).scrollTop()-$(window).height(); // if slider past our scroll offset, then fire a request for more data if(!$.pageless.isLoading && (distance < $.pageless.settings.distance)) { $.pageless.loading(true); // move to next page $.pageless.settings.currentPage++; // set up ajax query params $.extend($.pageless.settings.params, {page: $.pageless.settings.currentPage}); // finally ajax query $.get($.pageless.settings.url, $.pageless.settings.params, function(data){ var data = $.pageless.settings.scrape(data); if ($.pageless.loader) { $.pageless.loader.before(data) } else { $.pageless.el.append(data) } $.pageless.loading(false); // if there is a complete callback we call it if ($.pageless.settings.complete) { $.pageless.settings.complete.call(); } }); } };})(jQuery);
|
|
$.pageless.setProgress = function(current) { if(current && current.attr('id') ) { $.pageless.progress_current = current; document.cookie = "pageless_progress="+current.attr('id')+"; path="+location.pathname; } };
|
(function($) { $.pageless = function(settings) { $.isFunction(settings) ? settings.call() : $.pageless.init(settings); }; // available params // loader: loading div // pagination: div selector for the pagination links // loaderMsg: // loaderImage: // loaderHtml: $.pageless.settings = { currentPage: 1, pagination: '.pagination', url: location.href, params: {}, // params of the query you can pass auth_token here distance: 100, // page distance in px to the end when the ajax function is launch loaderImage: "/images/load.gif", scrape: function(data) { return data; } // Don't do anything by default }; $.pageless.loaderHtml = function(){ return $.pageless.settings.loaderHtml || '\<div id="pageless-loader" style="display:none;text-align:center;width:100%;">\ <div class="msg" style="color:#e9e9e9;font-size:2em"></div>\ <img src="' + $.pageless.settings.loaderImage + '" title="load" alt="loading more results" style="margin: 10px auto" />\</div>'; }; // settings params: totalPages $.pageless.init = function(settings) { if ($.pageless.settings.inited) return; $.pageless.settings.inited = true; if (settings) $.extend($.pageless.settings, settings); // for accessibility we can keep pagination links // but since we have javascript enabled we remove pagination links if($.pageless.settings.pagination) $($.pageless.settings.pagination).remove(); // start the listener $.pageless.startListener(); if( $.pageless.settings.progress_id ){ // advance to the previous progress id set the progress element element = $( "#"+$.escape($.pageless.settings.progress_id) ); offset = $.pageless.settings.progress_top ? (element.offset()['top']-(+$.pageless.settings.progress_top)) : element.offset()['top']; $(window).scrollTop( offset ); $.pageless.setProgress( element ); } else if ($.pageless.settings.progress){ // set progress to the first element matching the 'progress' selector $.pageless.setProgress( $( $.pageless.settings.progress ).eq(0) ); } }; // init loader val $.pageless.isLoading = false; $.fn.pageless = function(settings) { $.pageless.init(settings); $.pageless.el = $(this); // loader element if(settings.loader && $(this).find(settings.loader).length){ $.pageless.loader = $(this).find(settings.loader); } else { $.pageless.loader = $($.pageless.loaderHtml()); $(this).append($.pageless.loader); // if we use the default loader, set the message if(!settings.loaderHtml) { $('#pageless-loader .msg').html(settings.loaderMsg) } } }; // $.pageless.loading = function(bool){ if(bool === true){ $.pageless.isLoading = true; if($.pageless.loader) $.pageless.loader.fadeIn('normal'); } else { $.pageless.isLoading = false; if($.pageless.loader) $.pageless.loader.fadeOut('normal'); } }; $.pageless.stopListener = function() { $(window).unbind('.pageless'); }; $.pageless.startListener = function() { $(window).bind('scroll.pageless', $.pageless.scroll); }; // set the progress to current.id $.pageless.setProgress = function(current) { if(current && current.attr('id') ) { // set the cookie and a variable to access the current progress element $.pageless.progress_current = current; document.cookie = "pageless_progress="+current.attr('id')+"; path="+location.pathname; } }; $.pageless.scroll = function() { // listener was stopped or we've run out of pages if($.pageless.settings.totalPages <= $.pageless.settings.currentPage){ $.pageless.stopListener(); // if there is a afterStopListener callback we call it if ($.pageless.settings.afterStopListener) { $.pageless.settings.afterStopListener.call(); } return; } else if( $.pageless.progress_current && ($.pageless.progress_current.offset()['top']-(+$.pageless.settings.progress_top)) < $(window).scrollTop() ) { // find the next element matching the 'progress' selector next_current = $.pageless.progress_current.nextAll( $.pageless.settings.progress+'[id]:first' ); // set the progress to cookie to the next element $.pageless.setProgress( next_current ); // and trigger the scroll event on the new one // (in case we need to move forward more than one element) // (ie user presses 'end' key) $(window).trigger('scroll'); } // distance to end of page var distance = $(document).height()-$(window).scrollTop()-$(window).height(); // if slider past our scroll offset, then fire a request for more data if(!$.pageless.isLoading && (distance < $.pageless.settings.distance)) { $.pageless.loading(true); // move to next page $.pageless.settings.currentPage++; // set up ajax query params $.extend($.pageless.settings.params, {page: $.pageless.settings.currentPage}); // finally ajax query $.get($.pageless.settings.url, $.pageless.settings.params, function(data){ var data = $.pageless.settings.scrape(data); if ($.pageless.loader) { $.pageless.loader.before(data) } else { $.pageless.el.append(data) } $.pageless.loading(false); // if there is a complete callback we call it if ($.pageless.settings.complete) { $.pageless.settings.complete.call(); } }); } };})(jQuery);
|
|
} else if( $.pageless.progress_current && ($.pageless.progress_current.offset()['top']-(+$.pageless.settings.progress_top)) < $(window).scrollTop() ) { next_current = $.pageless.progress_current.nextAll( $.pageless.settings.progress+'[id]:first' ); $.pageless.setProgress( next_current ); $(window).trigger('scroll');
|
(function($) { $.pageless = function(settings) { $.isFunction(settings) ? settings.call() : $.pageless.init(settings); }; // available params // loader: loading div // pagination: div selector for the pagination links // loaderMsg: // loaderImage: // loaderHtml: $.pageless.settings = { currentPage: 1, pagination: '.pagination', url: location.href, params: {}, // params of the query you can pass auth_token here distance: 100, // page distance in px to the end when the ajax function is launch loaderImage: "/images/load.gif", scrape: function(data) { return data; } // Don't do anything by default }; $.pageless.loaderHtml = function(){ return $.pageless.settings.loaderHtml || '\<div id="pageless-loader" style="display:none;text-align:center;width:100%;">\ <div class="msg" style="color:#e9e9e9;font-size:2em"></div>\ <img src="' + $.pageless.settings.loaderImage + '" title="load" alt="loading more results" style="margin: 10px auto" />\</div>'; }; // settings params: totalPages $.pageless.init = function(settings) { if ($.pageless.settings.inited) return; $.pageless.settings.inited = true; if (settings) $.extend($.pageless.settings, settings); // for accessibility we can keep pagination links // but since we have javascript enabled we remove pagination links if($.pageless.settings.pagination) $($.pageless.settings.pagination).remove(); // start the listener $.pageless.startListener(); if( $.pageless.settings.progress_id ){ // advance to the previous progress id set the progress element element = $( "#"+$.escape($.pageless.settings.progress_id) ); offset = $.pageless.settings.progress_top ? (element.offset()['top']-(+$.pageless.settings.progress_top)) : element.offset()['top']; $(window).scrollTop( offset ); $.pageless.setProgress( element ); } else if ($.pageless.settings.progress){ // set progress to the first element matching the 'progress' selector $.pageless.setProgress( $( $.pageless.settings.progress ).eq(0) ); } }; // init loader val $.pageless.isLoading = false; $.fn.pageless = function(settings) { $.pageless.init(settings); $.pageless.el = $(this); // loader element if(settings.loader && $(this).find(settings.loader).length){ $.pageless.loader = $(this).find(settings.loader); } else { $.pageless.loader = $($.pageless.loaderHtml()); $(this).append($.pageless.loader); // if we use the default loader, set the message if(!settings.loaderHtml) { $('#pageless-loader .msg').html(settings.loaderMsg) } } }; // $.pageless.loading = function(bool){ if(bool === true){ $.pageless.isLoading = true; if($.pageless.loader) $.pageless.loader.fadeIn('normal'); } else { $.pageless.isLoading = false; if($.pageless.loader) $.pageless.loader.fadeOut('normal'); } }; $.pageless.stopListener = function() { $(window).unbind('.pageless'); }; $.pageless.startListener = function() { $(window).bind('scroll.pageless', $.pageless.scroll); }; // set the progress to current.id $.pageless.setProgress = function(current) { if(current && current.attr('id') ) { // set the cookie and a variable to access the current progress element $.pageless.progress_current = current; document.cookie = "pageless_progress="+current.attr('id')+"; path="+location.pathname; } }; $.pageless.scroll = function() { // listener was stopped or we've run out of pages if($.pageless.settings.totalPages <= $.pageless.settings.currentPage){ $.pageless.stopListener(); // if there is a afterStopListener callback we call it if ($.pageless.settings.afterStopListener) { $.pageless.settings.afterStopListener.call(); } return; } else if( $.pageless.progress_current && ($.pageless.progress_current.offset()['top']-(+$.pageless.settings.progress_top)) < $(window).scrollTop() ) { // find the next element matching the 'progress' selector next_current = $.pageless.progress_current.nextAll( $.pageless.settings.progress+'[id]:first' ); // set the progress to cookie to the next element $.pageless.setProgress( next_current ); // and trigger the scroll event on the new one // (in case we need to move forward more than one element) // (ie user presses 'end' key) $(window).trigger('scroll'); } // distance to end of page var distance = $(document).height()-$(window).scrollTop()-$(window).height(); // if slider past our scroll offset, then fire a request for more data if(!$.pageless.isLoading && (distance < $.pageless.settings.distance)) { $.pageless.loading(true); // move to next page $.pageless.settings.currentPage++; // set up ajax query params $.extend($.pageless.settings.params, {page: $.pageless.settings.currentPage}); // finally ajax query $.get($.pageless.settings.url, $.pageless.settings.params, function(data){ var data = $.pageless.settings.scrape(data); if ($.pageless.loader) { $.pageless.loader.before(data) } else { $.pageless.el.append(data) } $.pageless.loading(false); // if there is a complete callback we call it if ($.pageless.settings.complete) { $.pageless.settings.complete.call(); } }); } };})(jQuery);
|
|
if ($.pageless.loader) { $.pageless.loader.before(data) } else { $.pageless.el.append(data) }
|
$.pageless.div1.append(data[0]) $.pageless.div2.append(data[1])
|
(function($) { $.pageless = function(settings) { $.isFunction(settings) ? settings.call() : $.pageless.init(settings); }; // available params // loader: loading div // pagination: div selector for the pagination links // loaderMsg: // loaderImage: // loaderHtml: $.pageless.settings = { currentPage: 1, pagination: '.pagination', url: location.href, params: {}, // params of the query you can pass auth_token here distance: 100, // page distance in px to the end when the ajax function is launch loaderImage: "/images/load.gif", scrape: function(data) { return data; } // Don't do anything by default }; $.pageless.loaderHtml = function(){ return $.pageless.settings.loaderHtml || '\<div id="pageless-loader" style="display:none;text-align:center;width:100%;">\ <div class="msg" style="color:#e9e9e9;font-size:2em"></div>\ <img src="' + $.pageless.settings.loaderImage + '" title="load" alt="loading more results" style="margin: 10px auto" />\</div>'; }; // settings params: totalPages $.pageless.init = function(settings) { if ($.pageless.settings.inited) return; $.pageless.settings.inited = true; if (settings) $.extend($.pageless.settings, settings); // for accessibility we can keep pagination links // but since we have javascript enabled we remove pagination links if($.pageless.settings.pagination) $($.pageless.settings.pagination).remove(); // start the listener $.pageless.startListener(); if( $.pageless.settings.progress_id ){ // advance to the previous progress id set the progress element element = $( "#"+$.escape($.pageless.settings.progress_id) ); offset = $.pageless.settings.progress_top ? (element.offset()['top']-(+$.pageless.settings.progress_top)) : element.offset()['top']; $(window).scrollTop( offset ); $.pageless.setProgress( element ); } else if ($.pageless.settings.progress){ // set progress to the first element matching the 'progress' selector $.pageless.setProgress( $( $.pageless.settings.progress ).eq(0) ); } }; // init loader val $.pageless.isLoading = false; $.fn.pageless = function(settings) { $.pageless.init(settings); $.pageless.el = $(this); // loader element if(settings.loader && $(this).find(settings.loader).length){ $.pageless.loader = $(this).find(settings.loader); } else { $.pageless.loader = $($.pageless.loaderHtml()); $(this).append($.pageless.loader); // if we use the default loader, set the message if(!settings.loaderHtml) { $('#pageless-loader .msg').html(settings.loaderMsg) } } }; // $.pageless.loading = function(bool){ if(bool === true){ $.pageless.isLoading = true; if($.pageless.loader) $.pageless.loader.fadeIn('normal'); } else { $.pageless.isLoading = false; if($.pageless.loader) $.pageless.loader.fadeOut('normal'); } }; $.pageless.stopListener = function() { $(window).unbind('.pageless'); }; $.pageless.startListener = function() { $(window).bind('scroll.pageless', $.pageless.scroll); }; // set the progress to current.id $.pageless.setProgress = function(current) { if(current && current.attr('id') ) { // set the cookie and a variable to access the current progress element $.pageless.progress_current = current; document.cookie = "pageless_progress="+current.attr('id')+"; path="+location.pathname; } }; $.pageless.scroll = function() { // listener was stopped or we've run out of pages if($.pageless.settings.totalPages <= $.pageless.settings.currentPage){ $.pageless.stopListener(); // if there is a afterStopListener callback we call it if ($.pageless.settings.afterStopListener) { $.pageless.settings.afterStopListener.call(); } return; } else if( $.pageless.progress_current && ($.pageless.progress_current.offset()['top']-(+$.pageless.settings.progress_top)) < $(window).scrollTop() ) { // find the next element matching the 'progress' selector next_current = $.pageless.progress_current.nextAll( $.pageless.settings.progress+'[id]:first' ); // set the progress to cookie to the next element $.pageless.setProgress( next_current ); // and trigger the scroll event on the new one // (in case we need to move forward more than one element) // (ie user presses 'end' key) $(window).trigger('scroll'); } // distance to end of page var distance = $(document).height()-$(window).scrollTop()-$(window).height(); // if slider past our scroll offset, then fire a request for more data if(!$.pageless.isLoading && (distance < $.pageless.settings.distance)) { $.pageless.loading(true); // move to next page $.pageless.settings.currentPage++; // set up ajax query params $.extend($.pageless.settings.params, {page: $.pageless.settings.currentPage}); // finally ajax query $.get($.pageless.settings.url, $.pageless.settings.params, function(data){ var data = $.pageless.settings.scrape(data); if ($.pageless.loader) { $.pageless.loader.before(data) } else { $.pageless.el.append(data) } $.pageless.loading(false); // if there is a complete callback we call it if ($.pageless.settings.complete) { $.pageless.settings.complete.call(); } }); } };})(jQuery);
|
width: fWidth + 'px', height: (fHeight - 30) + 'px',
|
width: shimWidth + 'px', height: shimHeight + 'px',
|
Ext.ux.Lightbox = (function(){ var els = {}, urls = [], activeUrl, urlIsSet, initialized = false, selectors = [], width = 400, height = 300, closeOnSubmit = false; return { overlayOpacity: 0.5, animate: true, resizeSpeed: 8, borderSize: 10, init: function() { this.resizeDuration = this.animate ? ((11 - this.resizeSpeed) * 0.15) : 0; this.overlayDuration = this.animate ? 0.2 : 0; if(!initialized) { Ext.apply(this, Ext.util.Observable.prototype); Ext.util.Observable.constructor.call(this); this.addEvents('open', 'close'); this.initMarkup(); els.shim.on('load', this.shimLoaded, this); initialized = true; } }, initMarkup: function() { els.overlay = Ext.DomHelper.append(document.body, { id: 'ux-lightbox-overlay' }, true); var lightboxTpl = new Ext.Template(this.getTemplate()); els.lightbox = lightboxTpl.append(document.body, {}, true); els.shim = Ext.DomHelper.append(Ext.fly('ux-lightbox-content'), { tag: 'iframe', id: 'ux-lightbox-shim', name: 'ux-lightbox-shim' }, true); els.loading = Ext.DomHelper.append(Ext.fly('ux-lightbox-content'), { tag: 'div', id: 'ux-lightbox-loading' }, true); els.msg = Ext.DomHelper.append(Ext.fly('ux-lightbox-content'), { tag: 'div', id: 'ux-lightbox-msg' }, true); var ids = ['wrapper', 'content', 'loading', 'header']; Ext.each(ids, function(id){ els[id] = Ext.get('ux-lightbox-' + id); }); Ext.each([els.overlay, els.lightbox, els.shim, els.header, els.loading], function(el){ el.setVisibilityMode(Ext.Element.DISPLAY); el.hide(); }); var size = (this.animate ? 250 : 1) + 'px'; els.wrapper.setStyle({ width: size, height: size }); }, getTemplate : function() { return [ '<div id="ux-lightbox">', '<div id="ux-lightbox-wrapper">', '<div id="ux-lightbox-header" style="display:none;">', '</div>', '<div id="ux-lightbox-content">', '</div>', '</div>', '</div>' ]; }, register: function(sel, group) { if(selectors.indexOf(sel) === -1) { selectors.push(sel); Ext.fly(document).on('click', function(ev){ var target = ev.getTarget(sel); if (target) { ev.preventDefault(); this.open(target, sel, group); } }, this); } }, registerUrl: function(sel, width, height) { if(selectors.indexOf(sel) === -1) { selectors.push(sel); Ext.fly(document).on('click', function(ev){ var target = ev.getTarget(sel); if (target) { ev.preventDefault(); this.openUrl(target, width, height); } }, this); } }, openUrl: function(options, fWidth, fHeight) { els.shim.dom.src = ''; this.setViewSize(); els.overlay.fadeIn({ duration: this.overlayDuration, endOpacity: this.overlayOpacity, callback: function() { urls = []; var index = 0; urls.push([options.href, options.title]); // calculate top and left offset for the lightbox var pageScroll = Ext.fly(document).getScroll(); var lightboxTop = pageScroll.top + (Ext.lib.Dom.getViewportHeight() / 10); var lightboxLeft = pageScroll.left; els.lightbox.setStyle({ top: lightboxTop + 'px', left: lightboxLeft + 'px' }).show(); els.shim.setStyle({ width: fWidth + 'px', height: (fHeight - 30) + 'px', alpha: '(opacity=100)' }); this.setUrl(index, fWidth, fHeight); els.header.update('<h3>' + options.title + '</h3>'); this.fireEvent('open', urls[index]); }, scope: this }); }, openMessage: function(mText, fWidth, fHeight, showLoadingIndicator) { fWidth = fWidth || width; fHeight = fHeight || height; this.setViewSize(); els.overlay.fadeIn({ duration: this.overlayDuration, endOpacity: this.overlayOpacity, callback: function() { // calculate top and left offset for the lightbox var pageScroll = Ext.fly(document).getScroll(); var lightboxTop = pageScroll.top + (Ext.lib.Dom.getViewportHeight() / 10); var lightboxLeft = pageScroll.left; els.lightbox.setStyle({ top: lightboxTop + 'px', left: lightboxLeft + 'px' }).show(); this.setMessage(mText, fWidth, fHeight, showLoadingIndicator); this.fireEvent('open', mText); }, scope: this }); }, setViewSize: function(){ var viewSize = this.getViewSize(); els.overlay.setStyle({ width: viewSize[0] + 'px', height: viewSize[1] + 'px' }); els.shim.setStyle({ width: viewSize[0] + 'px', height: viewSize[1] + 'px' }).show(); }, setMessage: function(mText, fWidth, fHeight, showLoadingIndicator){ els.msg.update(''); if (showLoadingIndicator) { els.loading.show(); } else { els.loading.hide(); } els.shim.hide(); els.msg.hide(); els.header.hide(); els.msg.update(mText); els.msg.show(); this.resizeBox(fWidth, fHeight); }, setUrl: function(index, fWidth, fHeight) { activeUrl = index; els.shim.dom.src = urls[activeUrl][0]; this.urlIsSet = true; this.shimWidth = fWidth; this.shimHeight = fHeight; }, shimLoaded : function() { // iframe load fires on element creation and actual load. Check variable to ensure that we're dealing with the second. if (this.urlIsSet) { response = window.frames['ux-lightbox-shim'].response; if(response) { if (response.error) { this.setMessage(response.error, 200, 100, false); } else { this.close(); } } else { els.msg.hide(); els.loading.hide(); this.resizeBox(this.shimWidth, this.shimHeight); els.shim.fadeIn(); els.header.fadeIn(); els.shim.setStyle({ alpha: '(opacity=100)' }); // @todo Should this code live in feEdit.js? wrapper = window.frames['ux-lightbox-shim'].document.getElementsByClassName('formsOnPageWrapper')[0]; if (Ext.get(wrapper)) { Ext.get(wrapper).setHeight(this.shimHeight - 75); } // @todo Move this code out of the lightbox and into feEdit.js forms = window.frames['ux-lightbox-shim'].document.forms; editForm = Ext.get(forms[0]); if (editForm) { editForm.on('submit', function(evt, el) { this.displayContentUpdateMessage(); }, this); } } } }, displayContentUpdateMessage: function() { if (this.closeOnSubmit) { this.setMessage(TYPO3.LLL.feeditadvanced.updatingContent, 200, 120, true); } }, setCloseOnSubmit: function(value) { this.closeOnSubmit = value; }, resizeBox: function(w,h) { var wCur = els.wrapper.getWidth(); var hCur = els.wrapper.getHeight(); var wNew = w; var hNew = h; var wDiff = wCur - wNew; var hDiff = hCur - hNew; var queueLength = 0; if (hDiff != 0 || wDiff != 0) { els.wrapper.syncFx() .shift({ height: hNew, duration: this.resizeDuration }) .shift({ width: wNew, duration: this.resizeDuration }); queueLength++; } var timeout = 0; if ((hDiff == 0) && (wDiff == 0)) { timeout = (Ext.isIE) ? 250 : 100; } }, close: function(){ els.lightbox.hide(); els.overlay.fadeOut({ duration: this.overlayDuration }); els.shim.hide(); this.fireEvent('close', this); }, getViewSize: function() { return [Ext.lib.Dom.getViewWidth(true), Ext.lib.Dom.getViewHeight(true)]; } }})();
|
this.setUrl(index, fWidth, fHeight);
|
this.setUrl(index, shimWidth, shimHeight);
|
Ext.ux.Lightbox = (function(){ var els = {}, urls = [], activeUrl, urlIsSet, initialized = false, selectors = [], width = 400, height = 300, closeOnSubmit = false; return { overlayOpacity: 0.5, animate: true, resizeSpeed: 8, borderSize: 10, init: function() { this.resizeDuration = this.animate ? ((11 - this.resizeSpeed) * 0.15) : 0; this.overlayDuration = this.animate ? 0.2 : 0; if(!initialized) { Ext.apply(this, Ext.util.Observable.prototype); Ext.util.Observable.constructor.call(this); this.addEvents('open', 'close'); this.initMarkup(); els.shim.on('load', this.shimLoaded, this); initialized = true; } }, initMarkup: function() { els.overlay = Ext.DomHelper.append(document.body, { id: 'ux-lightbox-overlay' }, true); var lightboxTpl = new Ext.Template(this.getTemplate()); els.lightbox = lightboxTpl.append(document.body, {}, true); els.shim = Ext.DomHelper.append(Ext.fly('ux-lightbox-content'), { tag: 'iframe', id: 'ux-lightbox-shim', name: 'ux-lightbox-shim' }, true); els.loading = Ext.DomHelper.append(Ext.fly('ux-lightbox-content'), { tag: 'div', id: 'ux-lightbox-loading' }, true); els.msg = Ext.DomHelper.append(Ext.fly('ux-lightbox-content'), { tag: 'div', id: 'ux-lightbox-msg' }, true); var ids = ['wrapper', 'content', 'loading', 'header']; Ext.each(ids, function(id){ els[id] = Ext.get('ux-lightbox-' + id); }); Ext.each([els.overlay, els.lightbox, els.shim, els.header, els.loading], function(el){ el.setVisibilityMode(Ext.Element.DISPLAY); el.hide(); }); var size = (this.animate ? 250 : 1) + 'px'; els.wrapper.setStyle({ width: size, height: size }); }, getTemplate : function() { return [ '<div id="ux-lightbox">', '<div id="ux-lightbox-wrapper">', '<div id="ux-lightbox-header" style="display:none;">', '</div>', '<div id="ux-lightbox-content">', '</div>', '</div>', '</div>' ]; }, register: function(sel, group) { if(selectors.indexOf(sel) === -1) { selectors.push(sel); Ext.fly(document).on('click', function(ev){ var target = ev.getTarget(sel); if (target) { ev.preventDefault(); this.open(target, sel, group); } }, this); } }, registerUrl: function(sel, width, height) { if(selectors.indexOf(sel) === -1) { selectors.push(sel); Ext.fly(document).on('click', function(ev){ var target = ev.getTarget(sel); if (target) { ev.preventDefault(); this.openUrl(target, width, height); } }, this); } }, openUrl: function(options, fWidth, fHeight) { els.shim.dom.src = ''; this.setViewSize(); els.overlay.fadeIn({ duration: this.overlayDuration, endOpacity: this.overlayOpacity, callback: function() { urls = []; var index = 0; urls.push([options.href, options.title]); // calculate top and left offset for the lightbox var pageScroll = Ext.fly(document).getScroll(); var lightboxTop = pageScroll.top + (Ext.lib.Dom.getViewportHeight() / 10); var lightboxLeft = pageScroll.left; els.lightbox.setStyle({ top: lightboxTop + 'px', left: lightboxLeft + 'px' }).show(); els.shim.setStyle({ width: fWidth + 'px', height: (fHeight - 30) + 'px', alpha: '(opacity=100)' }); this.setUrl(index, fWidth, fHeight); els.header.update('<h3>' + options.title + '</h3>'); this.fireEvent('open', urls[index]); }, scope: this }); }, openMessage: function(mText, fWidth, fHeight, showLoadingIndicator) { fWidth = fWidth || width; fHeight = fHeight || height; this.setViewSize(); els.overlay.fadeIn({ duration: this.overlayDuration, endOpacity: this.overlayOpacity, callback: function() { // calculate top and left offset for the lightbox var pageScroll = Ext.fly(document).getScroll(); var lightboxTop = pageScroll.top + (Ext.lib.Dom.getViewportHeight() / 10); var lightboxLeft = pageScroll.left; els.lightbox.setStyle({ top: lightboxTop + 'px', left: lightboxLeft + 'px' }).show(); this.setMessage(mText, fWidth, fHeight, showLoadingIndicator); this.fireEvent('open', mText); }, scope: this }); }, setViewSize: function(){ var viewSize = this.getViewSize(); els.overlay.setStyle({ width: viewSize[0] + 'px', height: viewSize[1] + 'px' }); els.shim.setStyle({ width: viewSize[0] + 'px', height: viewSize[1] + 'px' }).show(); }, setMessage: function(mText, fWidth, fHeight, showLoadingIndicator){ els.msg.update(''); if (showLoadingIndicator) { els.loading.show(); } else { els.loading.hide(); } els.shim.hide(); els.msg.hide(); els.header.hide(); els.msg.update(mText); els.msg.show(); this.resizeBox(fWidth, fHeight); }, setUrl: function(index, fWidth, fHeight) { activeUrl = index; els.shim.dom.src = urls[activeUrl][0]; this.urlIsSet = true; this.shimWidth = fWidth; this.shimHeight = fHeight; }, shimLoaded : function() { // iframe load fires on element creation and actual load. Check variable to ensure that we're dealing with the second. if (this.urlIsSet) { response = window.frames['ux-lightbox-shim'].response; if(response) { if (response.error) { this.setMessage(response.error, 200, 100, false); } else { this.close(); } } else { els.msg.hide(); els.loading.hide(); this.resizeBox(this.shimWidth, this.shimHeight); els.shim.fadeIn(); els.header.fadeIn(); els.shim.setStyle({ alpha: '(opacity=100)' }); // @todo Should this code live in feEdit.js? wrapper = window.frames['ux-lightbox-shim'].document.getElementsByClassName('formsOnPageWrapper')[0]; if (Ext.get(wrapper)) { Ext.get(wrapper).setHeight(this.shimHeight - 75); } // @todo Move this code out of the lightbox and into feEdit.js forms = window.frames['ux-lightbox-shim'].document.forms; editForm = Ext.get(forms[0]); if (editForm) { editForm.on('submit', function(evt, el) { this.displayContentUpdateMessage(); }, this); } } } }, displayContentUpdateMessage: function() { if (this.closeOnSubmit) { this.setMessage(TYPO3.LLL.feeditadvanced.updatingContent, 200, 120, true); } }, setCloseOnSubmit: function(value) { this.closeOnSubmit = value; }, resizeBox: function(w,h) { var wCur = els.wrapper.getWidth(); var hCur = els.wrapper.getHeight(); var wNew = w; var hNew = h; var wDiff = wCur - wNew; var hDiff = hCur - hNew; var queueLength = 0; if (hDiff != 0 || wDiff != 0) { els.wrapper.syncFx() .shift({ height: hNew, duration: this.resizeDuration }) .shift({ width: wNew, duration: this.resizeDuration }); queueLength++; } var timeout = 0; if ((hDiff == 0) && (wDiff == 0)) { timeout = (Ext.isIE) ? 250 : 100; } }, close: function(){ els.lightbox.hide(); els.overlay.fadeOut({ duration: this.overlayDuration }); els.shim.hide(); this.fireEvent('close', this); }, getViewSize: function() { return [Ext.lib.Dom.getViewWidth(true), Ext.lib.Dom.getViewHeight(true)]; } }})();
|
setUrl: function(index, fWidth, fHeight) {
|
setUrl: function(index, shimWidth, shimHeight) {
|
Ext.ux.Lightbox = (function(){ var els = {}, urls = [], activeUrl, urlIsSet, initialized = false, selectors = [], width = 400, height = 300, closeOnSubmit = false; return { overlayOpacity: 0.5, animate: true, resizeSpeed: 8, borderSize: 10, init: function() { this.resizeDuration = this.animate ? ((11 - this.resizeSpeed) * 0.15) : 0; this.overlayDuration = this.animate ? 0.2 : 0; if(!initialized) { Ext.apply(this, Ext.util.Observable.prototype); Ext.util.Observable.constructor.call(this); this.addEvents('open', 'close'); this.initMarkup(); els.shim.on('load', this.shimLoaded, this); initialized = true; } }, initMarkup: function() { els.overlay = Ext.DomHelper.append(document.body, { id: 'ux-lightbox-overlay' }, true); var lightboxTpl = new Ext.Template(this.getTemplate()); els.lightbox = lightboxTpl.append(document.body, {}, true); els.shim = Ext.DomHelper.append(Ext.fly('ux-lightbox-content'), { tag: 'iframe', id: 'ux-lightbox-shim', name: 'ux-lightbox-shim' }, true); els.loading = Ext.DomHelper.append(Ext.fly('ux-lightbox-content'), { tag: 'div', id: 'ux-lightbox-loading' }, true); els.msg = Ext.DomHelper.append(Ext.fly('ux-lightbox-content'), { tag: 'div', id: 'ux-lightbox-msg' }, true); var ids = ['wrapper', 'content', 'loading', 'header']; Ext.each(ids, function(id){ els[id] = Ext.get('ux-lightbox-' + id); }); Ext.each([els.overlay, els.lightbox, els.shim, els.header, els.loading], function(el){ el.setVisibilityMode(Ext.Element.DISPLAY); el.hide(); }); var size = (this.animate ? 250 : 1) + 'px'; els.wrapper.setStyle({ width: size, height: size }); }, getTemplate : function() { return [ '<div id="ux-lightbox">', '<div id="ux-lightbox-wrapper">', '<div id="ux-lightbox-header" style="display:none;">', '</div>', '<div id="ux-lightbox-content">', '</div>', '</div>', '</div>' ]; }, register: function(sel, group) { if(selectors.indexOf(sel) === -1) { selectors.push(sel); Ext.fly(document).on('click', function(ev){ var target = ev.getTarget(sel); if (target) { ev.preventDefault(); this.open(target, sel, group); } }, this); } }, registerUrl: function(sel, width, height) { if(selectors.indexOf(sel) === -1) { selectors.push(sel); Ext.fly(document).on('click', function(ev){ var target = ev.getTarget(sel); if (target) { ev.preventDefault(); this.openUrl(target, width, height); } }, this); } }, openUrl: function(options, fWidth, fHeight) { els.shim.dom.src = ''; this.setViewSize(); els.overlay.fadeIn({ duration: this.overlayDuration, endOpacity: this.overlayOpacity, callback: function() { urls = []; var index = 0; urls.push([options.href, options.title]); // calculate top and left offset for the lightbox var pageScroll = Ext.fly(document).getScroll(); var lightboxTop = pageScroll.top + (Ext.lib.Dom.getViewportHeight() / 10); var lightboxLeft = pageScroll.left; els.lightbox.setStyle({ top: lightboxTop + 'px', left: lightboxLeft + 'px' }).show(); els.shim.setStyle({ width: fWidth + 'px', height: (fHeight - 30) + 'px', alpha: '(opacity=100)' }); this.setUrl(index, fWidth, fHeight); els.header.update('<h3>' + options.title + '</h3>'); this.fireEvent('open', urls[index]); }, scope: this }); }, openMessage: function(mText, fWidth, fHeight, showLoadingIndicator) { fWidth = fWidth || width; fHeight = fHeight || height; this.setViewSize(); els.overlay.fadeIn({ duration: this.overlayDuration, endOpacity: this.overlayOpacity, callback: function() { // calculate top and left offset for the lightbox var pageScroll = Ext.fly(document).getScroll(); var lightboxTop = pageScroll.top + (Ext.lib.Dom.getViewportHeight() / 10); var lightboxLeft = pageScroll.left; els.lightbox.setStyle({ top: lightboxTop + 'px', left: lightboxLeft + 'px' }).show(); this.setMessage(mText, fWidth, fHeight, showLoadingIndicator); this.fireEvent('open', mText); }, scope: this }); }, setViewSize: function(){ var viewSize = this.getViewSize(); els.overlay.setStyle({ width: viewSize[0] + 'px', height: viewSize[1] + 'px' }); els.shim.setStyle({ width: viewSize[0] + 'px', height: viewSize[1] + 'px' }).show(); }, setMessage: function(mText, fWidth, fHeight, showLoadingIndicator){ els.msg.update(''); if (showLoadingIndicator) { els.loading.show(); } else { els.loading.hide(); } els.shim.hide(); els.msg.hide(); els.header.hide(); els.msg.update(mText); els.msg.show(); this.resizeBox(fWidth, fHeight); }, setUrl: function(index, fWidth, fHeight) { activeUrl = index; els.shim.dom.src = urls[activeUrl][0]; this.urlIsSet = true; this.shimWidth = fWidth; this.shimHeight = fHeight; }, shimLoaded : function() { // iframe load fires on element creation and actual load. Check variable to ensure that we're dealing with the second. if (this.urlIsSet) { response = window.frames['ux-lightbox-shim'].response; if(response) { if (response.error) { this.setMessage(response.error, 200, 100, false); } else { this.close(); } } else { els.msg.hide(); els.loading.hide(); this.resizeBox(this.shimWidth, this.shimHeight); els.shim.fadeIn(); els.header.fadeIn(); els.shim.setStyle({ alpha: '(opacity=100)' }); // @todo Should this code live in feEdit.js? wrapper = window.frames['ux-lightbox-shim'].document.getElementsByClassName('formsOnPageWrapper')[0]; if (Ext.get(wrapper)) { Ext.get(wrapper).setHeight(this.shimHeight - 75); } // @todo Move this code out of the lightbox and into feEdit.js forms = window.frames['ux-lightbox-shim'].document.forms; editForm = Ext.get(forms[0]); if (editForm) { editForm.on('submit', function(evt, el) { this.displayContentUpdateMessage(); }, this); } } } }, displayContentUpdateMessage: function() { if (this.closeOnSubmit) { this.setMessage(TYPO3.LLL.feeditadvanced.updatingContent, 200, 120, true); } }, setCloseOnSubmit: function(value) { this.closeOnSubmit = value; }, resizeBox: function(w,h) { var wCur = els.wrapper.getWidth(); var hCur = els.wrapper.getHeight(); var wNew = w; var hNew = h; var wDiff = wCur - wNew; var hDiff = hCur - hNew; var queueLength = 0; if (hDiff != 0 || wDiff != 0) { els.wrapper.syncFx() .shift({ height: hNew, duration: this.resizeDuration }) .shift({ width: wNew, duration: this.resizeDuration }); queueLength++; } var timeout = 0; if ((hDiff == 0) && (wDiff == 0)) { timeout = (Ext.isIE) ? 250 : 100; } }, close: function(){ els.lightbox.hide(); els.overlay.fadeOut({ duration: this.overlayDuration }); els.shim.hide(); this.fireEvent('close', this); }, getViewSize: function() { return [Ext.lib.Dom.getViewWidth(true), Ext.lib.Dom.getViewHeight(true)]; } }})();
|
this.shimWidth = fWidth; this.shimHeight = fHeight;
|
this.shimWidth = shimWidth; this.shimHeight = shimHeight;
|
Ext.ux.Lightbox = (function(){ var els = {}, urls = [], activeUrl, urlIsSet, initialized = false, selectors = [], width = 400, height = 300, closeOnSubmit = false; return { overlayOpacity: 0.5, animate: true, resizeSpeed: 8, borderSize: 10, init: function() { this.resizeDuration = this.animate ? ((11 - this.resizeSpeed) * 0.15) : 0; this.overlayDuration = this.animate ? 0.2 : 0; if(!initialized) { Ext.apply(this, Ext.util.Observable.prototype); Ext.util.Observable.constructor.call(this); this.addEvents('open', 'close'); this.initMarkup(); els.shim.on('load', this.shimLoaded, this); initialized = true; } }, initMarkup: function() { els.overlay = Ext.DomHelper.append(document.body, { id: 'ux-lightbox-overlay' }, true); var lightboxTpl = new Ext.Template(this.getTemplate()); els.lightbox = lightboxTpl.append(document.body, {}, true); els.shim = Ext.DomHelper.append(Ext.fly('ux-lightbox-content'), { tag: 'iframe', id: 'ux-lightbox-shim', name: 'ux-lightbox-shim' }, true); els.loading = Ext.DomHelper.append(Ext.fly('ux-lightbox-content'), { tag: 'div', id: 'ux-lightbox-loading' }, true); els.msg = Ext.DomHelper.append(Ext.fly('ux-lightbox-content'), { tag: 'div', id: 'ux-lightbox-msg' }, true); var ids = ['wrapper', 'content', 'loading', 'header']; Ext.each(ids, function(id){ els[id] = Ext.get('ux-lightbox-' + id); }); Ext.each([els.overlay, els.lightbox, els.shim, els.header, els.loading], function(el){ el.setVisibilityMode(Ext.Element.DISPLAY); el.hide(); }); var size = (this.animate ? 250 : 1) + 'px'; els.wrapper.setStyle({ width: size, height: size }); }, getTemplate : function() { return [ '<div id="ux-lightbox">', '<div id="ux-lightbox-wrapper">', '<div id="ux-lightbox-header" style="display:none;">', '</div>', '<div id="ux-lightbox-content">', '</div>', '</div>', '</div>' ]; }, register: function(sel, group) { if(selectors.indexOf(sel) === -1) { selectors.push(sel); Ext.fly(document).on('click', function(ev){ var target = ev.getTarget(sel); if (target) { ev.preventDefault(); this.open(target, sel, group); } }, this); } }, registerUrl: function(sel, width, height) { if(selectors.indexOf(sel) === -1) { selectors.push(sel); Ext.fly(document).on('click', function(ev){ var target = ev.getTarget(sel); if (target) { ev.preventDefault(); this.openUrl(target, width, height); } }, this); } }, openUrl: function(options, fWidth, fHeight) { els.shim.dom.src = ''; this.setViewSize(); els.overlay.fadeIn({ duration: this.overlayDuration, endOpacity: this.overlayOpacity, callback: function() { urls = []; var index = 0; urls.push([options.href, options.title]); // calculate top and left offset for the lightbox var pageScroll = Ext.fly(document).getScroll(); var lightboxTop = pageScroll.top + (Ext.lib.Dom.getViewportHeight() / 10); var lightboxLeft = pageScroll.left; els.lightbox.setStyle({ top: lightboxTop + 'px', left: lightboxLeft + 'px' }).show(); els.shim.setStyle({ width: fWidth + 'px', height: (fHeight - 30) + 'px', alpha: '(opacity=100)' }); this.setUrl(index, fWidth, fHeight); els.header.update('<h3>' + options.title + '</h3>'); this.fireEvent('open', urls[index]); }, scope: this }); }, openMessage: function(mText, fWidth, fHeight, showLoadingIndicator) { fWidth = fWidth || width; fHeight = fHeight || height; this.setViewSize(); els.overlay.fadeIn({ duration: this.overlayDuration, endOpacity: this.overlayOpacity, callback: function() { // calculate top and left offset for the lightbox var pageScroll = Ext.fly(document).getScroll(); var lightboxTop = pageScroll.top + (Ext.lib.Dom.getViewportHeight() / 10); var lightboxLeft = pageScroll.left; els.lightbox.setStyle({ top: lightboxTop + 'px', left: lightboxLeft + 'px' }).show(); this.setMessage(mText, fWidth, fHeight, showLoadingIndicator); this.fireEvent('open', mText); }, scope: this }); }, setViewSize: function(){ var viewSize = this.getViewSize(); els.overlay.setStyle({ width: viewSize[0] + 'px', height: viewSize[1] + 'px' }); els.shim.setStyle({ width: viewSize[0] + 'px', height: viewSize[1] + 'px' }).show(); }, setMessage: function(mText, fWidth, fHeight, showLoadingIndicator){ els.msg.update(''); if (showLoadingIndicator) { els.loading.show(); } else { els.loading.hide(); } els.shim.hide(); els.msg.hide(); els.header.hide(); els.msg.update(mText); els.msg.show(); this.resizeBox(fWidth, fHeight); }, setUrl: function(index, fWidth, fHeight) { activeUrl = index; els.shim.dom.src = urls[activeUrl][0]; this.urlIsSet = true; this.shimWidth = fWidth; this.shimHeight = fHeight; }, shimLoaded : function() { // iframe load fires on element creation and actual load. Check variable to ensure that we're dealing with the second. if (this.urlIsSet) { response = window.frames['ux-lightbox-shim'].response; if(response) { if (response.error) { this.setMessage(response.error, 200, 100, false); } else { this.close(); } } else { els.msg.hide(); els.loading.hide(); this.resizeBox(this.shimWidth, this.shimHeight); els.shim.fadeIn(); els.header.fadeIn(); els.shim.setStyle({ alpha: '(opacity=100)' }); // @todo Should this code live in feEdit.js? wrapper = window.frames['ux-lightbox-shim'].document.getElementsByClassName('formsOnPageWrapper')[0]; if (Ext.get(wrapper)) { Ext.get(wrapper).setHeight(this.shimHeight - 75); } // @todo Move this code out of the lightbox and into feEdit.js forms = window.frames['ux-lightbox-shim'].document.forms; editForm = Ext.get(forms[0]); if (editForm) { editForm.on('submit', function(evt, el) { this.displayContentUpdateMessage(); }, this); } } } }, displayContentUpdateMessage: function() { if (this.closeOnSubmit) { this.setMessage(TYPO3.LLL.feeditadvanced.updatingContent, 200, 120, true); } }, setCloseOnSubmit: function(value) { this.closeOnSubmit = value; }, resizeBox: function(w,h) { var wCur = els.wrapper.getWidth(); var hCur = els.wrapper.getHeight(); var wNew = w; var hNew = h; var wDiff = wCur - wNew; var hDiff = hCur - hNew; var queueLength = 0; if (hDiff != 0 || wDiff != 0) { els.wrapper.syncFx() .shift({ height: hNew, duration: this.resizeDuration }) .shift({ width: wNew, duration: this.resizeDuration }); queueLength++; } var timeout = 0; if ((hDiff == 0) && (wDiff == 0)) { timeout = (Ext.isIE) ? 250 : 100; } }, close: function(){ els.lightbox.hide(); els.overlay.fadeOut({ duration: this.overlayDuration }); els.shim.hide(); this.fireEvent('close', this); }, getViewSize: function() { return [Ext.lib.Dom.getViewWidth(true), Ext.lib.Dom.getViewHeight(true)]; } }})();
|
this.resizeBox(this.shimWidth, this.shimHeight);
|
shiftFxCorrection = 20; this.resizeBox(this.shimWidth + shiftFxCorrection, this.shimHeight + 30 + shiftFxCorrection);
|
Ext.ux.Lightbox = (function(){ var els = {}, urls = [], activeUrl, urlIsSet, initialized = false, selectors = [], width = 400, height = 300, closeOnSubmit = false; return { overlayOpacity: 0.5, animate: true, resizeSpeed: 8, borderSize: 10, init: function() { this.resizeDuration = this.animate ? ((11 - this.resizeSpeed) * 0.15) : 0; this.overlayDuration = this.animate ? 0.2 : 0; if(!initialized) { Ext.apply(this, Ext.util.Observable.prototype); Ext.util.Observable.constructor.call(this); this.addEvents('open', 'close'); this.initMarkup(); els.shim.on('load', this.shimLoaded, this); initialized = true; } }, initMarkup: function() { els.overlay = Ext.DomHelper.append(document.body, { id: 'ux-lightbox-overlay' }, true); var lightboxTpl = new Ext.Template(this.getTemplate()); els.lightbox = lightboxTpl.append(document.body, {}, true); els.shim = Ext.DomHelper.append(Ext.fly('ux-lightbox-content'), { tag: 'iframe', id: 'ux-lightbox-shim', name: 'ux-lightbox-shim' }, true); els.loading = Ext.DomHelper.append(Ext.fly('ux-lightbox-content'), { tag: 'div', id: 'ux-lightbox-loading' }, true); els.msg = Ext.DomHelper.append(Ext.fly('ux-lightbox-content'), { tag: 'div', id: 'ux-lightbox-msg' }, true); var ids = ['wrapper', 'content', 'loading', 'header']; Ext.each(ids, function(id){ els[id] = Ext.get('ux-lightbox-' + id); }); Ext.each([els.overlay, els.lightbox, els.shim, els.header, els.loading], function(el){ el.setVisibilityMode(Ext.Element.DISPLAY); el.hide(); }); var size = (this.animate ? 250 : 1) + 'px'; els.wrapper.setStyle({ width: size, height: size }); }, getTemplate : function() { return [ '<div id="ux-lightbox">', '<div id="ux-lightbox-wrapper">', '<div id="ux-lightbox-header" style="display:none;">', '</div>', '<div id="ux-lightbox-content">', '</div>', '</div>', '</div>' ]; }, register: function(sel, group) { if(selectors.indexOf(sel) === -1) { selectors.push(sel); Ext.fly(document).on('click', function(ev){ var target = ev.getTarget(sel); if (target) { ev.preventDefault(); this.open(target, sel, group); } }, this); } }, registerUrl: function(sel, width, height) { if(selectors.indexOf(sel) === -1) { selectors.push(sel); Ext.fly(document).on('click', function(ev){ var target = ev.getTarget(sel); if (target) { ev.preventDefault(); this.openUrl(target, width, height); } }, this); } }, openUrl: function(options, fWidth, fHeight) { els.shim.dom.src = ''; this.setViewSize(); els.overlay.fadeIn({ duration: this.overlayDuration, endOpacity: this.overlayOpacity, callback: function() { urls = []; var index = 0; urls.push([options.href, options.title]); // calculate top and left offset for the lightbox var pageScroll = Ext.fly(document).getScroll(); var lightboxTop = pageScroll.top + (Ext.lib.Dom.getViewportHeight() / 10); var lightboxLeft = pageScroll.left; els.lightbox.setStyle({ top: lightboxTop + 'px', left: lightboxLeft + 'px' }).show(); els.shim.setStyle({ width: fWidth + 'px', height: (fHeight - 30) + 'px', alpha: '(opacity=100)' }); this.setUrl(index, fWidth, fHeight); els.header.update('<h3>' + options.title + '</h3>'); this.fireEvent('open', urls[index]); }, scope: this }); }, openMessage: function(mText, fWidth, fHeight, showLoadingIndicator) { fWidth = fWidth || width; fHeight = fHeight || height; this.setViewSize(); els.overlay.fadeIn({ duration: this.overlayDuration, endOpacity: this.overlayOpacity, callback: function() { // calculate top and left offset for the lightbox var pageScroll = Ext.fly(document).getScroll(); var lightboxTop = pageScroll.top + (Ext.lib.Dom.getViewportHeight() / 10); var lightboxLeft = pageScroll.left; els.lightbox.setStyle({ top: lightboxTop + 'px', left: lightboxLeft + 'px' }).show(); this.setMessage(mText, fWidth, fHeight, showLoadingIndicator); this.fireEvent('open', mText); }, scope: this }); }, setViewSize: function(){ var viewSize = this.getViewSize(); els.overlay.setStyle({ width: viewSize[0] + 'px', height: viewSize[1] + 'px' }); els.shim.setStyle({ width: viewSize[0] + 'px', height: viewSize[1] + 'px' }).show(); }, setMessage: function(mText, fWidth, fHeight, showLoadingIndicator){ els.msg.update(''); if (showLoadingIndicator) { els.loading.show(); } else { els.loading.hide(); } els.shim.hide(); els.msg.hide(); els.header.hide(); els.msg.update(mText); els.msg.show(); this.resizeBox(fWidth, fHeight); }, setUrl: function(index, fWidth, fHeight) { activeUrl = index; els.shim.dom.src = urls[activeUrl][0]; this.urlIsSet = true; this.shimWidth = fWidth; this.shimHeight = fHeight; }, shimLoaded : function() { // iframe load fires on element creation and actual load. Check variable to ensure that we're dealing with the second. if (this.urlIsSet) { response = window.frames['ux-lightbox-shim'].response; if(response) { if (response.error) { this.setMessage(response.error, 200, 100, false); } else { this.close(); } } else { els.msg.hide(); els.loading.hide(); this.resizeBox(this.shimWidth, this.shimHeight); els.shim.fadeIn(); els.header.fadeIn(); els.shim.setStyle({ alpha: '(opacity=100)' }); // @todo Should this code live in feEdit.js? wrapper = window.frames['ux-lightbox-shim'].document.getElementsByClassName('formsOnPageWrapper')[0]; if (Ext.get(wrapper)) { Ext.get(wrapper).setHeight(this.shimHeight - 75); } // @todo Move this code out of the lightbox and into feEdit.js forms = window.frames['ux-lightbox-shim'].document.forms; editForm = Ext.get(forms[0]); if (editForm) { editForm.on('submit', function(evt, el) { this.displayContentUpdateMessage(); }, this); } } } }, displayContentUpdateMessage: function() { if (this.closeOnSubmit) { this.setMessage(TYPO3.LLL.feeditadvanced.updatingContent, 200, 120, true); } }, setCloseOnSubmit: function(value) { this.closeOnSubmit = value; }, resizeBox: function(w,h) { var wCur = els.wrapper.getWidth(); var hCur = els.wrapper.getHeight(); var wNew = w; var hNew = h; var wDiff = wCur - wNew; var hDiff = hCur - hNew; var queueLength = 0; if (hDiff != 0 || wDiff != 0) { els.wrapper.syncFx() .shift({ height: hNew, duration: this.resizeDuration }) .shift({ width: wNew, duration: this.resizeDuration }); queueLength++; } var timeout = 0; if ((hDiff == 0) && (wDiff == 0)) { timeout = (Ext.isIE) ? 250 : 100; } }, close: function(){ els.lightbox.hide(); els.overlay.fadeOut({ duration: this.overlayDuration }); els.shim.hide(); this.fireEvent('close', this); }, getViewSize: function() { return [Ext.lib.Dom.getViewWidth(true), Ext.lib.Dom.getViewHeight(true)]; } }})();
|
Ext.get(wrapper).setHeight(this.shimHeight - 75);
|
Ext.get(wrapper).setHeight(this.shimHeight - 45);
|
Ext.ux.Lightbox = (function(){ var els = {}, urls = [], activeUrl, urlIsSet, initialized = false, selectors = [], width = 400, height = 300, closeOnSubmit = false; return { overlayOpacity: 0.5, animate: true, resizeSpeed: 8, borderSize: 10, init: function() { this.resizeDuration = this.animate ? ((11 - this.resizeSpeed) * 0.15) : 0; this.overlayDuration = this.animate ? 0.2 : 0; if(!initialized) { Ext.apply(this, Ext.util.Observable.prototype); Ext.util.Observable.constructor.call(this); this.addEvents('open', 'close'); this.initMarkup(); els.shim.on('load', this.shimLoaded, this); initialized = true; } }, initMarkup: function() { els.overlay = Ext.DomHelper.append(document.body, { id: 'ux-lightbox-overlay' }, true); var lightboxTpl = new Ext.Template(this.getTemplate()); els.lightbox = lightboxTpl.append(document.body, {}, true); els.shim = Ext.DomHelper.append(Ext.fly('ux-lightbox-content'), { tag: 'iframe', id: 'ux-lightbox-shim', name: 'ux-lightbox-shim' }, true); els.loading = Ext.DomHelper.append(Ext.fly('ux-lightbox-content'), { tag: 'div', id: 'ux-lightbox-loading' }, true); els.msg = Ext.DomHelper.append(Ext.fly('ux-lightbox-content'), { tag: 'div', id: 'ux-lightbox-msg' }, true); var ids = ['wrapper', 'content', 'loading', 'header']; Ext.each(ids, function(id){ els[id] = Ext.get('ux-lightbox-' + id); }); Ext.each([els.overlay, els.lightbox, els.shim, els.header, els.loading], function(el){ el.setVisibilityMode(Ext.Element.DISPLAY); el.hide(); }); var size = (this.animate ? 250 : 1) + 'px'; els.wrapper.setStyle({ width: size, height: size }); }, getTemplate : function() { return [ '<div id="ux-lightbox">', '<div id="ux-lightbox-wrapper">', '<div id="ux-lightbox-header" style="display:none;">', '</div>', '<div id="ux-lightbox-content">', '</div>', '</div>', '</div>' ]; }, register: function(sel, group) { if(selectors.indexOf(sel) === -1) { selectors.push(sel); Ext.fly(document).on('click', function(ev){ var target = ev.getTarget(sel); if (target) { ev.preventDefault(); this.open(target, sel, group); } }, this); } }, registerUrl: function(sel, width, height) { if(selectors.indexOf(sel) === -1) { selectors.push(sel); Ext.fly(document).on('click', function(ev){ var target = ev.getTarget(sel); if (target) { ev.preventDefault(); this.openUrl(target, width, height); } }, this); } }, openUrl: function(options, fWidth, fHeight) { els.shim.dom.src = ''; this.setViewSize(); els.overlay.fadeIn({ duration: this.overlayDuration, endOpacity: this.overlayOpacity, callback: function() { urls = []; var index = 0; urls.push([options.href, options.title]); // calculate top and left offset for the lightbox var pageScroll = Ext.fly(document).getScroll(); var lightboxTop = pageScroll.top + (Ext.lib.Dom.getViewportHeight() / 10); var lightboxLeft = pageScroll.left; els.lightbox.setStyle({ top: lightboxTop + 'px', left: lightboxLeft + 'px' }).show(); els.shim.setStyle({ width: fWidth + 'px', height: (fHeight - 30) + 'px', alpha: '(opacity=100)' }); this.setUrl(index, fWidth, fHeight); els.header.update('<h3>' + options.title + '</h3>'); this.fireEvent('open', urls[index]); }, scope: this }); }, openMessage: function(mText, fWidth, fHeight, showLoadingIndicator) { fWidth = fWidth || width; fHeight = fHeight || height; this.setViewSize(); els.overlay.fadeIn({ duration: this.overlayDuration, endOpacity: this.overlayOpacity, callback: function() { // calculate top and left offset for the lightbox var pageScroll = Ext.fly(document).getScroll(); var lightboxTop = pageScroll.top + (Ext.lib.Dom.getViewportHeight() / 10); var lightboxLeft = pageScroll.left; els.lightbox.setStyle({ top: lightboxTop + 'px', left: lightboxLeft + 'px' }).show(); this.setMessage(mText, fWidth, fHeight, showLoadingIndicator); this.fireEvent('open', mText); }, scope: this }); }, setViewSize: function(){ var viewSize = this.getViewSize(); els.overlay.setStyle({ width: viewSize[0] + 'px', height: viewSize[1] + 'px' }); els.shim.setStyle({ width: viewSize[0] + 'px', height: viewSize[1] + 'px' }).show(); }, setMessage: function(mText, fWidth, fHeight, showLoadingIndicator){ els.msg.update(''); if (showLoadingIndicator) { els.loading.show(); } else { els.loading.hide(); } els.shim.hide(); els.msg.hide(); els.header.hide(); els.msg.update(mText); els.msg.show(); this.resizeBox(fWidth, fHeight); }, setUrl: function(index, fWidth, fHeight) { activeUrl = index; els.shim.dom.src = urls[activeUrl][0]; this.urlIsSet = true; this.shimWidth = fWidth; this.shimHeight = fHeight; }, shimLoaded : function() { // iframe load fires on element creation and actual load. Check variable to ensure that we're dealing with the second. if (this.urlIsSet) { response = window.frames['ux-lightbox-shim'].response; if(response) { if (response.error) { this.setMessage(response.error, 200, 100, false); } else { this.close(); } } else { els.msg.hide(); els.loading.hide(); this.resizeBox(this.shimWidth, this.shimHeight); els.shim.fadeIn(); els.header.fadeIn(); els.shim.setStyle({ alpha: '(opacity=100)' }); // @todo Should this code live in feEdit.js? wrapper = window.frames['ux-lightbox-shim'].document.getElementsByClassName('formsOnPageWrapper')[0]; if (Ext.get(wrapper)) { Ext.get(wrapper).setHeight(this.shimHeight - 75); } // @todo Move this code out of the lightbox and into feEdit.js forms = window.frames['ux-lightbox-shim'].document.forms; editForm = Ext.get(forms[0]); if (editForm) { editForm.on('submit', function(evt, el) { this.displayContentUpdateMessage(); }, this); } } } }, displayContentUpdateMessage: function() { if (this.closeOnSubmit) { this.setMessage(TYPO3.LLL.feeditadvanced.updatingContent, 200, 120, true); } }, setCloseOnSubmit: function(value) { this.closeOnSubmit = value; }, resizeBox: function(w,h) { var wCur = els.wrapper.getWidth(); var hCur = els.wrapper.getHeight(); var wNew = w; var hNew = h; var wDiff = wCur - wNew; var hDiff = hCur - hNew; var queueLength = 0; if (hDiff != 0 || wDiff != 0) { els.wrapper.syncFx() .shift({ height: hNew, duration: this.resizeDuration }) .shift({ width: wNew, duration: this.resizeDuration }); queueLength++; } var timeout = 0; if ((hDiff == 0) && (wDiff == 0)) { timeout = (Ext.isIE) ? 250 : 100; } }, close: function(){ els.lightbox.hide(); els.overlay.fadeOut({ duration: this.overlayDuration }); els.shim.hide(); this.fireEvent('close', this); }, getViewSize: function() { return [Ext.lib.Dom.getViewWidth(true), Ext.lib.Dom.getViewHeight(true)]; } }})();
|
var pointerElementArray = Ext.get(pointerElement.parent()).select('.feEditAdvanced-allWrapper'); if (pointerArray.length > 0 && pointerElementArray.getCount() > 0) {
|
if (pointerElement.prev().hasClass('feEditAdvanced-allWrapper')) { container = pointerElement.parent(); } else { container = pointerElement.prev(); } var elementsInContainer = Ext.get(container.select('.feEditAdvanced-allWrapper')); if (pointerArray.length > 0 && elementsInContainer.getCount() > 0) {
|
Ext.select('input.feEditAdvanced-flexformPointers').each(function(pointerElement) { pointerElement = Ext.get(pointerElement); // will be something like pages:25:sDEF:lDEF:field_content:vDEF var containerName = pointerElement.getAttribute('title'); // pointerArray will be something like [1318,7,4,1313,1315,1317,1316] var pointerArray = pointerElement.getValue().split(','); // all elements in that container var pointerElementArray = Ext.get(pointerElement.parent()).select('.feEditAdvanced-allWrapper'); if (pointerArray.length > 0 && pointerElementArray.getCount() > 0) { Ext.each(pointerArray, function(pointerValue, counter) { counter++; firstElement = Ext.get(pointerElementArray.first()); if (firstElement) { recordElement = Ext.get(firstElement.select('input.feEditAdvanced-tsfeedit-input-record').first()); if (recordElement.getValue() == 'tt_content:' + pointerValue) { // flexformPointer element Ext.DomHelper.insertAfter(recordElement, { 'tag': 'input', 'type': 'hidden', 'name': 'TSFE_EDIT[flexformPointer]', 'cls': 'feEditAdvanced-tsfeedit-input-flexformPointer', 'value': containerName + ':' + counter + '/tt_content:' + pointerValue }); // sourcePointer element Ext.DomHelper.insertAfter(recordElement, { 'tag': 'input', 'type': 'hidden', 'name': 'TSFE_EDIT[sourcePointer]', 'cls': 'feEditAdvanced-tsfeedit-input-sourcePointer', 'value': containerName + ':' + counter }); // destinationPointer element Ext.DomHelper.insertAfter(recordElement, { 'tag': 'input', 'type': 'hidden', 'name': 'TSFE_EDIT[destinationPointer]', 'cls': 'feEditAdvanced-tsfeedit-input-destinationPointer', 'value': containerName + ':' + counter }); // and remove the element which is now not needed anymore pointerElementArray.removeElement(firstElement); } } }); } });
|
firstElement = Ext.get(pointerElementArray.first());
|
firstElement = Ext.get(elementsInContainer.first());
|
Ext.select('input.feEditAdvanced-flexformPointers').each(function(pointerElement) { pointerElement = Ext.get(pointerElement); // will be something like pages:25:sDEF:lDEF:field_content:vDEF var containerName = pointerElement.getAttribute('title'); // pointerArray will be something like [1318,7,4,1313,1315,1317,1316] var pointerArray = pointerElement.getValue().split(','); // all elements in that container var pointerElementArray = Ext.get(pointerElement.parent()).select('.feEditAdvanced-allWrapper'); if (pointerArray.length > 0 && pointerElementArray.getCount() > 0) { Ext.each(pointerArray, function(pointerValue, counter) { counter++; firstElement = Ext.get(pointerElementArray.first()); if (firstElement) { recordElement = Ext.get(firstElement.select('input.feEditAdvanced-tsfeedit-input-record').first()); if (recordElement.getValue() == 'tt_content:' + pointerValue) { // flexformPointer element Ext.DomHelper.insertAfter(recordElement, { 'tag': 'input', 'type': 'hidden', 'name': 'TSFE_EDIT[flexformPointer]', 'cls': 'feEditAdvanced-tsfeedit-input-flexformPointer', 'value': containerName + ':' + counter + '/tt_content:' + pointerValue }); // sourcePointer element Ext.DomHelper.insertAfter(recordElement, { 'tag': 'input', 'type': 'hidden', 'name': 'TSFE_EDIT[sourcePointer]', 'cls': 'feEditAdvanced-tsfeedit-input-sourcePointer', 'value': containerName + ':' + counter }); // destinationPointer element Ext.DomHelper.insertAfter(recordElement, { 'tag': 'input', 'type': 'hidden', 'name': 'TSFE_EDIT[destinationPointer]', 'cls': 'feEditAdvanced-tsfeedit-input-destinationPointer', 'value': containerName + ':' + counter }); // and remove the element which is now not needed anymore pointerElementArray.removeElement(firstElement); } } }); } });
|
pointerElementArray.removeElement(firstElement);
|
elementsInContainer.removeElement(firstElement);
|
Ext.select('input.feEditAdvanced-flexformPointers').each(function(pointerElement) { pointerElement = Ext.get(pointerElement); // will be something like pages:25:sDEF:lDEF:field_content:vDEF var containerName = pointerElement.getAttribute('title'); // pointerArray will be something like [1318,7,4,1313,1315,1317,1316] var pointerArray = pointerElement.getValue().split(','); // all elements in that container var pointerElementArray = Ext.get(pointerElement.parent()).select('.feEditAdvanced-allWrapper'); if (pointerArray.length > 0 && pointerElementArray.getCount() > 0) { Ext.each(pointerArray, function(pointerValue, counter) { counter++; firstElement = Ext.get(pointerElementArray.first()); if (firstElement) { recordElement = Ext.get(firstElement.select('input.feEditAdvanced-tsfeedit-input-record').first()); if (recordElement.getValue() == 'tt_content:' + pointerValue) { // flexformPointer element Ext.DomHelper.insertAfter(recordElement, { 'tag': 'input', 'type': 'hidden', 'name': 'TSFE_EDIT[flexformPointer]', 'cls': 'feEditAdvanced-tsfeedit-input-flexformPointer', 'value': containerName + ':' + counter + '/tt_content:' + pointerValue }); // sourcePointer element Ext.DomHelper.insertAfter(recordElement, { 'tag': 'input', 'type': 'hidden', 'name': 'TSFE_EDIT[sourcePointer]', 'cls': 'feEditAdvanced-tsfeedit-input-sourcePointer', 'value': containerName + ':' + counter }); // destinationPointer element Ext.DomHelper.insertAfter(recordElement, { 'tag': 'input', 'type': 'hidden', 'name': 'TSFE_EDIT[destinationPointer]', 'cls': 'feEditAdvanced-tsfeedit-input-destinationPointer', 'value': containerName + ':' + counter }); // and remove the element which is now not needed anymore pointerElementArray.removeElement(firstElement); } } }); } });
|
var v = new Ext.grid.GridPanel({ renderTo : 'submittedTasks', height : 300, autoScroll : true, width : 800, loadMask : true, viewConfig : { forceFit : true }, columns : [{ header : "TaskId", dataIndex : "taskId", sortable : true, width : 100 }, { header : "Submitted", dataIndex : "submissionTime", renderer : Ext.util.Format.dateRenderer('g:i:s l'), width : 120 }, { header : "Started", dataIndex : "startTime", renderer : Ext.util.Format.dateRenderer('g:i:s l'), width : 120 }, { header : "Runtime (s)", tooltip : "How long the job has been running", dataIndex : "startTime", renderer : function(value, metaData, record, rowIndex, colIndex, store) { if (record.get("startTime")) { return (new Date() - record.get("startTime")) / 1000; } else { return "Queued for " + (new Date() - record.get("submissionTime")) / 1000; } }, width : 120 }, { header : "Submitter", dataIndex : "submitter" }, { header : "Type", dataIndex : "taskInterface", renderer : function(value, metaData, record, rowIndex, colIndex, store) { return value.replace(/.*\./, '').replace(/Impl$/, '');
|
var v = new Ext.grid.GridPanel({ renderTo : 'submittedTasks', id : 'submittedTaskGrid', height : 300, autoScroll : true, width : 800, loadMask : true, viewConfig : { forceFit : true }, columns : [{ header : "TaskId", dataIndex : "taskId", sortable : true, width : 100 }, { header : "Submitted", dataIndex : "submissionTime", renderer : Ext.util.Format.dateRenderer('g:i:s l'), width : 120 }, { header : "Started", dataIndex : "startTime", renderer : Ext.util.Format.dateRenderer('g:i:s l'), width : 120 }, { header : "Runtime (s)", tooltip : "How long the job has been running", dataIndex : "startTime", renderer : function(value, metaData, record, rowIndex, colIndex, store) { if (record.get("startTime")) { return (new Date() - record.get("startTime")) / 1000; } else { return "Queued for " + (new Date() - record.get("submissionTime")) / 1000; } }, width : 120 }, { header : "Submitter", dataIndex : "submitter" }, { header : "Type", dataIndex : "taskInterface", renderer : function(value, metaData, record, rowIndex, colIndex, store) { return value.replace(/.*\./, '').replace(/Impl$/, ''); } }, { header : "Method", dataIndex : "taskMethod" }, { header : "On grid", dataIndex : "willRunOnGrid" }, { header : "Cancel", dataIndex : "taskId", renderer : function(value, metaData, record, rowIndex, colIndex, store) { return '<span class="link" onClick="Ext.getCmp(\'submittedTaskGrid\').cancelTask(\'' + value + '\')"><img src="/Gemma/images/icons/stop.png" /></span>'; } }], cancelTask : function(taskId) { Ext.Msg.show({ title : 'Are you sure?', msg : 'Are you sure you want to cancel this task?', buttons : Ext.Msg.YESNO, fn : function(btn, text) { if (btn == 'yes') { ProgressStatusService.cancelJob(taskId, function(successfullyCancelled) { if (!successfullyCancelled) { Ext.Msg .alert("Couldn't cancel", "Sorry, the job couldn't be cancelled; perhaps it finished or was cancelled already?"); } else { this.store.load(); } }) } }, scope : this }); }, store : new Ext.data.Store({ proxy : new Ext.data.DWRProxy({ apiActionToHandlerMap : { read : { dwrFunction : ProgressStatusService.getSubmittedTasks
|
Ext.onReady(function() { var v = new Ext.grid.GridPanel({ renderTo : 'submittedTasks', height : 300, autoScroll : true, width : 800, loadMask : true, viewConfig : { forceFit : true }, columns : [{ header : "TaskId", dataIndex : "taskId", sortable : true, width : 100 }, { header : "Submitted", dataIndex : "submissionTime", renderer : Ext.util.Format.dateRenderer('g:i:s l'), width : 120 }, { header : "Started", dataIndex : "startTime", renderer : Ext.util.Format.dateRenderer('g:i:s l'), width : 120 }, { header : "Runtime (s)", tooltip : "How long the job has been running", dataIndex : "startTime", renderer : function(value, metaData, record, rowIndex, colIndex, store) { if (record.get("startTime")) { return (new Date() - record.get("startTime")) / 1000; } else { return "Queued for " + (new Date() - record.get("submissionTime")) / 1000; } }, width : 120 }, { header : "Submitter", dataIndex : "submitter" }, { header : "Type", dataIndex : "taskInterface", renderer : function(value, metaData, record, rowIndex, colIndex, store) { return value.replace(/.*\./, '').replace(/Impl$/, ''); } }, { header : "Method", dataIndex : "taskMethod" }, { header : "On grid", dataIndex : "willRunOnGrid" }], store : new Ext.data.Store({ proxy : new Ext.data.DWRProxy({ apiActionToHandlerMap : { read : { dwrFunction : ProgressStatusService.getSubmittedTasks } } }), autoLoad : true, reader : new Ext.data.ListRangeReader({ id : 'taskId', record : Ext.data.Record.create([{ name : "taskId", type : "string" }, { name : "submissionTime", type : "date" }, { name : "startTime", type : "date" }, { name : "submitter", type : "string" }, { name : "taskInterface", type : "string" }, { name : "taskMethod", type : "string" }, { name : "willRunOnGrid", type : "boolean" }]) }) }), buttons : [{ text : "Refresh", handler : function() { v.store.load(); } }] }); });
|
}, { header : "Method", dataIndex : "taskMethod" }, { header : "On grid", dataIndex : "willRunOnGrid" }],
|
} }), autoLoad : true, reader : new Ext.data.ListRangeReader({ id : 'taskId', record : Ext.data.Record.create([{ name : "taskId", type : "string" }, { name : "submissionTime", type : "date" }, { name : "startTime", type : "date" }, { name : "submitter", type : "string" }, { name : "taskInterface", type : "string" }, { name : "taskMethod", type : "string" }, { name : "willRunOnGrid", type : "boolean" }]) }) }), buttons : [{ text : "Refresh", handler : function() { v.store.load(); } }]
|
Ext.onReady(function() { var v = new Ext.grid.GridPanel({ renderTo : 'submittedTasks', height : 300, autoScroll : true, width : 800, loadMask : true, viewConfig : { forceFit : true }, columns : [{ header : "TaskId", dataIndex : "taskId", sortable : true, width : 100 }, { header : "Submitted", dataIndex : "submissionTime", renderer : Ext.util.Format.dateRenderer('g:i:s l'), width : 120 }, { header : "Started", dataIndex : "startTime", renderer : Ext.util.Format.dateRenderer('g:i:s l'), width : 120 }, { header : "Runtime (s)", tooltip : "How long the job has been running", dataIndex : "startTime", renderer : function(value, metaData, record, rowIndex, colIndex, store) { if (record.get("startTime")) { return (new Date() - record.get("startTime")) / 1000; } else { return "Queued for " + (new Date() - record.get("submissionTime")) / 1000; } }, width : 120 }, { header : "Submitter", dataIndex : "submitter" }, { header : "Type", dataIndex : "taskInterface", renderer : function(value, metaData, record, rowIndex, colIndex, store) { return value.replace(/.*\./, '').replace(/Impl$/, ''); } }, { header : "Method", dataIndex : "taskMethod" }, { header : "On grid", dataIndex : "willRunOnGrid" }], store : new Ext.data.Store({ proxy : new Ext.data.DWRProxy({ apiActionToHandlerMap : { read : { dwrFunction : ProgressStatusService.getSubmittedTasks } } }), autoLoad : true, reader : new Ext.data.ListRangeReader({ id : 'taskId', record : Ext.data.Record.create([{ name : "taskId", type : "string" }, { name : "submissionTime", type : "date" }, { name : "startTime", type : "date" }, { name : "submitter", type : "string" }, { name : "taskInterface", type : "string" }, { name : "taskMethod", type : "string" }, { name : "willRunOnGrid", type : "boolean" }]) }) }), buttons : [{ text : "Refresh", handler : function() { v.store.load(); } }] }); });
|
store : new Ext.data.Store({ proxy : new Ext.data.DWRProxy({ apiActionToHandlerMap : { read : { dwrFunction : ProgressStatusService.getSubmittedTasks } } }), autoLoad : true, reader : new Ext.data.ListRangeReader({ id : 'taskId', record : Ext.data.Record.create([{ name : "taskId", type : "string" }, { name : "submissionTime", type : "date" }, { name : "startTime", type : "date" }, { name : "submitter", type : "string" }, { name : "taskInterface", type : "string" }, { name : "taskMethod", type : "string" }, { name : "willRunOnGrid", type : "boolean" }]) }) }), buttons : [{ text : "Refresh", handler : function() { v.store.load(); } }]
|
});
|
Ext.onReady(function() { var v = new Ext.grid.GridPanel({ renderTo : 'submittedTasks', height : 300, autoScroll : true, width : 800, loadMask : true, viewConfig : { forceFit : true }, columns : [{ header : "TaskId", dataIndex : "taskId", sortable : true, width : 100 }, { header : "Submitted", dataIndex : "submissionTime", renderer : Ext.util.Format.dateRenderer('g:i:s l'), width : 120 }, { header : "Started", dataIndex : "startTime", renderer : Ext.util.Format.dateRenderer('g:i:s l'), width : 120 }, { header : "Runtime (s)", tooltip : "How long the job has been running", dataIndex : "startTime", renderer : function(value, metaData, record, rowIndex, colIndex, store) { if (record.get("startTime")) { return (new Date() - record.get("startTime")) / 1000; } else { return "Queued for " + (new Date() - record.get("submissionTime")) / 1000; } }, width : 120 }, { header : "Submitter", dataIndex : "submitter" }, { header : "Type", dataIndex : "taskInterface", renderer : function(value, metaData, record, rowIndex, colIndex, store) { return value.replace(/.*\./, '').replace(/Impl$/, ''); } }, { header : "Method", dataIndex : "taskMethod" }, { header : "On grid", dataIndex : "willRunOnGrid" }], store : new Ext.data.Store({ proxy : new Ext.data.DWRProxy({ apiActionToHandlerMap : { read : { dwrFunction : ProgressStatusService.getSubmittedTasks } } }), autoLoad : true, reader : new Ext.data.ListRangeReader({ id : 'taskId', record : Ext.data.Record.create([{ name : "taskId", type : "string" }, { name : "submissionTime", type : "date" }, { name : "startTime", type : "date" }, { name : "submitter", type : "string" }, { name : "taskInterface", type : "string" }, { name : "taskMethod", type : "string" }, { name : "willRunOnGrid", type : "boolean" }]) }) }), buttons : [{ text : "Refresh", handler : function() { v.store.load(); } }] }); });
|
}); });
|
});
|
Ext.onReady(function() { var v = new Ext.grid.GridPanel({ renderTo : 'submittedTasks', height : 300, autoScroll : true, width : 800, loadMask : true, viewConfig : { forceFit : true }, columns : [{ header : "TaskId", dataIndex : "taskId", sortable : true, width : 100 }, { header : "Submitted", dataIndex : "submissionTime", renderer : Ext.util.Format.dateRenderer('g:i:s l'), width : 120 }, { header : "Started", dataIndex : "startTime", renderer : Ext.util.Format.dateRenderer('g:i:s l'), width : 120 }, { header : "Runtime (s)", tooltip : "How long the job has been running", dataIndex : "startTime", renderer : function(value, metaData, record, rowIndex, colIndex, store) { if (record.get("startTime")) { return (new Date() - record.get("startTime")) / 1000; } else { return "Queued for " + (new Date() - record.get("submissionTime")) / 1000; } }, width : 120 }, { header : "Submitter", dataIndex : "submitter" }, { header : "Type", dataIndex : "taskInterface", renderer : function(value, metaData, record, rowIndex, colIndex, store) { return value.replace(/.*\./, '').replace(/Impl$/, ''); } }, { header : "Method", dataIndex : "taskMethod" }, { header : "On grid", dataIndex : "willRunOnGrid" }], store : new Ext.data.Store({ proxy : new Ext.data.DWRProxy({ apiActionToHandlerMap : { read : { dwrFunction : ProgressStatusService.getSubmittedTasks } } }), autoLoad : true, reader : new Ext.data.ListRangeReader({ id : 'taskId', record : Ext.data.Record.create([{ name : "taskId", type : "string" }, { name : "submissionTime", type : "date" }, { name : "startTime", type : "date" }, { name : "submitter", type : "string" }, { name : "taskInterface", type : "string" }, { name : "taskMethod", type : "string" }, { name : "willRunOnGrid", type : "boolean" }]) }) }), buttons : [{ text : "Refresh", handler : function() { v.store.load(); } }] }); });
|
uploader.upload({albumName:albumName, albumDescription:albumDescription});
|
uploader.upload({albumName:albumName, albumDescription:albumDescription, securityToken:securityToken});
|
dojo.addOnLoad( function(){ var fileUploaderConfig = { isDebug:false, hoverClass:"uploadHover", activeClass:"uploadPress", disabledClass:"uploadDisabled", uploadUrl:"upload", fileMask:[ ["Jpeg File", "*.jpg;*.jpeg"], ["GIF File", "*.gif"], ["PNG File", "*.png"], ["All Images", "*.jpg;*.jpeg;*.gif;*.png"], ["Image Archive Files","*.zip;*.tar"] ] }; if(dojo.byId("btnUploader")){ dojo.byId("files").value = ""; //instantiate uploader passing config properties var uploader = new dojox.form.FileUploader(dojo.mixin({ button:dojo.byId("btnUploader"), fileListId:"files", selectMultipleFiles:true, deferredUploading:false },fileUploaderConfig), "btnUploader"); 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 =""; } dojo.connect(uploader, "onComplete", function(dataArray){ console.log("onComplete"); setProgressbar(1,1); dojo.byId("newAlbumName").value =""; reloadAdminGallery(); }); dojo.connect(uploader, "onProgress", function(dataArray){ var uploadedPercent=0; var totalPercent=0; for(var i=0;i<dataArray.length;i++){ uploadedPercent+=dataArray[i].bytesLoaded; totalPercent+=dataArray[i].bytesTotal; } console.log("onProgress:"+uploadedPercent+"/"+totalPercent); setProgressbar((uploadedPercent/totalPercent),1.01011); //dojo.byId("newAlbumName").value =""; }); dojo.connect(uploader, "onChange", function(dataArray){ //hiding the progress bar dojo.byId("progressBar").style.display="none"; }); dojo.connect(uploader, "onError", function(err){ var uploadedPercent=0; var totalPercent=0; for(var i=0;i<dataArray.length;i++){ uploadedPercent+=dataArray[i].bytesLoaded; totalPercent+=dataArray[i].bytesTotal; } console.log("onProgress:"+uploadedPercent+"/"+totalPercent); setProgressbar((uploadedPercent/totalPercent),1.01011); if(err && err.text) { console.error("Error uploading files:" + err.text); //alert("Error uploading files:" + err.text); } }); }});
|
uploader.upload({albumName:selected,albumDescription:albumDescription});
|
uploader.upload({albumName:selected,albumDescription:albumDescription, securityToken:securityToken});
|
dojo.addOnLoad( function(){ var fileUploaderConfig = { isDebug:false, hoverClass:"uploadHover", activeClass:"uploadPress", disabledClass:"uploadDisabled", uploadUrl:"upload", fileMask:[ ["Jpeg File", "*.jpg;*.jpeg"], ["GIF File", "*.gif"], ["PNG File", "*.png"], ["All Images", "*.jpg;*.jpeg;*.gif;*.png"], ["Image Archive Files","*.zip;*.tar"] ] }; if(dojo.byId("btnUploader")){ dojo.byId("files").value = ""; //instantiate uploader passing config properties var uploader = new dojox.form.FileUploader(dojo.mixin({ button:dojo.byId("btnUploader"), fileListId:"files", selectMultipleFiles:true, deferredUploading:false },fileUploaderConfig), "btnUploader"); 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 =""; } dojo.connect(uploader, "onComplete", function(dataArray){ console.log("onComplete"); setProgressbar(1,1); dojo.byId("newAlbumName").value =""; reloadAdminGallery(); }); dojo.connect(uploader, "onProgress", function(dataArray){ var uploadedPercent=0; var totalPercent=0; for(var i=0;i<dataArray.length;i++){ uploadedPercent+=dataArray[i].bytesLoaded; totalPercent+=dataArray[i].bytesTotal; } console.log("onProgress:"+uploadedPercent+"/"+totalPercent); setProgressbar((uploadedPercent/totalPercent),1.01011); //dojo.byId("newAlbumName").value =""; }); dojo.connect(uploader, "onChange", function(dataArray){ //hiding the progress bar dojo.byId("progressBar").style.display="none"; }); dojo.connect(uploader, "onError", function(err){ var uploadedPercent=0; var totalPercent=0; for(var i=0;i<dataArray.length;i++){ uploadedPercent+=dataArray[i].bytesLoaded; totalPercent+=dataArray[i].bytesTotal; } console.log("onProgress:"+uploadedPercent+"/"+totalPercent); setProgressbar((uploadedPercent/totalPercent),1.01011); if(err && err.text) { console.error("Error uploading files:" + err.text); //alert("Error uploading files:" + err.text); } }); }});
|
} this.getStore().loadData(geneData); if (callback) { callback(args); } }.createDelegate(this));
|
} this.getStore().loadData(geneData); if (callback) { callback(args); } this.fireEvent("addgenes", geneIds); }.createDelegate(this));
|
GenePickerController.getGenes(geneIds, function(genes) { var geneData = []; for (var i = 0; i < genes.length; ++i) { geneData.push([genes[i].id, genes[i].taxon.scientificName, genes[i].officialSymbol, genes[i].officialName]); } /* * FIXME this can result in the same gene listed twice. This is taken care of at the server * side but looks funny. */ this.getStore().loadData(geneData); if (callback) { callback(args); } }.createDelegate(this));
|
'click': (function(e) { if (this.list.count() === 0) { return; } if (!button.options.enabled) { return; } this.contentContainer.setStyle('visibility','hidden'); this.contentContainer.setStyle('display','block'); document.id(document.body).adopt(this.contentContainer); this.contentContainer.setContentBoxSize(this.subDomObj.getMarginBoxSize()); this.showChrome(this.contentContainer); this.position(this.contentContainer, this.button.domObj, { horizontal: ['right right'], vertical: ['bottom top', 'top bottom'], offsets: this.chromeOffsets }); this.contentContainer.setStyle('visibility',''); document.addEvent('mousedown', this.hide); document.addEvent('keyup', this.keypressHandler); this.fireEvent('show', this); }).bindWithEvent(this.menu),
|
(function(c){c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.2",plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")== "hidden")return false;b=b&&b=="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,f,g){return c.ui.isOverAxis(a,d,f)&&c.ui.isOverAxis(b,e,g)},keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108, NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect", "none")},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x", 1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==undefined)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b=="absolute"||b=="relative"||b=="fixed"){b=parseInt(a.css("zIndex"));if(!isNaN(b)&&b!=0)return b}a=a.parent()}}return 0}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");return(/input|select|textarea|button|object/.test(b)? !a.disabled:"a"==b||"area"==b?a.href||!isNaN(d):!isNaN(d))&&!c(a)["area"==b?"parents":"closest"](":hidden").length},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}})}})(jQuery);
|
'click': (function(e) { if (this.list.count() === 0) { return; } if (!button.options.enabled) { return; } this.contentContainer.setStyle('visibility','hidden'); this.contentContainer.setStyle('display','block'); document.id(document.body).adopt(this.contentContainer); /* we have to size the container for IE to render the chrome * correctly but just in the menu/sub menu case - there is * some horrible peekaboo bug in IE related to ULs that we * just couldn't figure out */ this.contentContainer.setContentBoxSize(this.subDomObj.getMarginBoxSize()); this.showChrome(this.contentContainer); this.position(this.contentContainer, this.button.domObj, { horizontal: ['right right'], vertical: ['bottom top', 'top bottom'], offsets: this.chromeOffsets }); this.contentContainer.setStyle('visibility',''); document.addEvent('mousedown', this.hide); document.addEvent('keyup', this.keypressHandler); this.fireEvent('show', this); }).bindWithEvent(this.menu),
|
var ctrlEnter = new YAHOO.util.KeyListener(document, { ctrl:true, keys:13}, execQuery); ctrlEnter.enable();
|
Event.onDOMReady(function () { currentResource = new Resource(); var mainMenu = new YAHOO.widget.MenuBar('mainmenu', { autosubmenudisplay: true, hidedelay: 750, lazyload: true }); mainMenu.render(); // Register event handlers for various elements on the page. Event.addListener('file-open', 'click', loadQuery); Event.addListener('file-save', 'click', function () { doSave(false); }); Event.addListener('file-save-as', 'click', function () { doSave(true); }); Event.addListener('submit', 'click', execQuery); Event.addListener('clear', 'click', function () { newEditor(); }); Event.addListener('saved', 'change', selectStored); Event.addListener('export', 'click', exportData); Event.addListener('next', 'click', browseNext); Event.addListener('previous', 'click', browsePrevious); Event.addListener('file-save-example', 'click', saveQuery); Event.addListener('check', 'click', compileAndCheck); Event.addListener('query', 'change', checkQuery, false); Event.addListener('maximize', 'click', function () { resizeQueryBox(false); }); Event.addListener('error-close', 'click', hideErrorPanel); YAHOO.widget.Logger.enableBrowserConsole(); retrieveStored(); resize(); initSlots();});
|
|
$(this).attr('src', scriptUrl + 'media/images/close-small-hover.png');
|
$(this).attr('src', mediaUrl('media/images/close-small-hover.png'));
|
obj.unbind('mouseover').bind('mouseover', function(){ $(this).attr('src', scriptUrl + 'media/images/close-small-hover.png'); });
|
window.addEventListener("load", function(e) { sipgateffx_previewnumber.onLoad(e); }, false);
|
type.forEach(function(singletype, index) { try { type[index] = sipgateffxstrings.getString('sipgateffxContact' + singletype); } catch(e) { type[index] = singletype; } });
|
window.addEventListener("load", function(e) { sipgateffx_previewnumber.onLoad(e); }, false);
|
dojo.connect(uploader, "onProgress", function(dataArray){ var uploadedPercent=0; var totalPercent=0; for(var i=0;i<dataArray.length;i++){ uploadedPercent+=dataArray[i].bytesLoaded; totalPercent+=dataArray[i].bytesTotal; } console.log("onProgress:"+uploadedPercent+"/"+totalPercent); setProgressbar((uploadedPercent/totalPercent),1.01011); }); dojo.connect(uploader, "onChange", function(dataArray){ dojo.byId("progressBar").style.display="none"; });
|
dojo.addOnLoad( function(){ var fileUploaderConfig = { isDebug:false, hoverClass:"uploadHover", activeClass:"uploadPress", disabledClass:"uploadDisabled", uploadUrl:"upload", fileMask:[ ["Jpeg File", "*.jpg;*.jpeg"], ["GIF File", "*.gif"], ["PNG File", "*.png"], ["All Images", "*.jpg;*.jpeg;*.gif;*.png"], ["Image Archive Files","*.zip;*.tar"] ] }; if(dojo.byId("btnUploader")){ dojo.byId("files").value = ""; //instantiate uploader passing config properties var uploader = new dojox.form.FileUploader(dojo.mixin({ button:dojo.byId("btnUploader"), fileListId:"files", selectMultipleFiles:true, deferredUploading:false },fileUploaderConfig), "btnUploader"); doUpload = function(){ console.log("doUpload"); 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 uploader.upload({albumName:albumName}); } } else { //upload files to existent album uploader.upload({albumName:selected}); } //dojo.byId("newAlbumName").value =""; } dojo.connect(uploader, "onComplete", function(dataArray){ dojo.byId("newAlbumName").value =""; }); dojo.connect(uploader, "onError", function(err){ if(err && err.text) { console.error("Error uploading files:" + err.text); //alert("Error uploading files:" + err.text); } }); }});
|
|
var uploadedPercent=0; var totalPercent=0; for(var i=0;i<dataArray.length;i++){ uploadedPercent+=dataArray[i].bytesLoaded; totalPercent+=dataArray[i].bytesTotal; } console.log("onProgress:"+uploadedPercent+"/"+totalPercent); setProgressbar((uploadedPercent/totalPercent),1.01011);
|
dojo.addOnLoad( function(){ var fileUploaderConfig = { isDebug:false, hoverClass:"uploadHover", activeClass:"uploadPress", disabledClass:"uploadDisabled", uploadUrl:"upload", fileMask:[ ["Jpeg File", "*.jpg;*.jpeg"], ["GIF File", "*.gif"], ["PNG File", "*.png"], ["All Images", "*.jpg;*.jpeg;*.gif;*.png"], ["Image Archive Files","*.zip;*.tar"] ] }; if(dojo.byId("btnUploader")){ dojo.byId("files").value = ""; //instantiate uploader passing config properties var uploader = new dojox.form.FileUploader(dojo.mixin({ button:dojo.byId("btnUploader"), fileListId:"files", selectMultipleFiles:true, deferredUploading:false },fileUploaderConfig), "btnUploader"); doUpload = function(){ console.log("doUpload"); 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 uploader.upload({albumName:albumName}); } } else { //upload files to existent album uploader.upload({albumName:selected}); } //dojo.byId("newAlbumName").value =""; } dojo.connect(uploader, "onComplete", function(dataArray){ dojo.byId("newAlbumName").value =""; }); dojo.connect(uploader, "onError", function(err){ if(err && err.text) { console.error("Error uploading files:" + err.text); //alert("Error uploading files:" + err.text); } }); }});
|
|
p.on('done', function(payload) { w.hide('upload-button'); w.destroy();
|
p.on('done', function(payload) {
|
p.on('done', function(payload) { // this.onDoneLoading(payload); w.hide('upload-button'); w.destroy(); p.destroy(); document.location.reload(true); // user will get a warning, but that's okay. Ext.DomHelper.overwrite("messages", "Successfully loaded."); }.createDelegate(this));
|
getMetricTypes(); $("#metricTypeSelect").change(function(){ getMetrics($("#metricTypeSelect :selected").text()); });
|
getProjects(); $("#projectSelect").change(projectSelected);
|
$(document).ready(function() { getMetricTypes(); $("#metricTypeSelect").change(function(){ getMetrics($("#metricTypeSelect :selected").text()); }); $("#versionrange").slider({ range: true, min: 0, max: 0, values: [0, 0], slide: function(event, ui) { $("#versionlbl").val(ui.values[0] + '-' + ui.values[1]); } }); $("#versionlbl").val("Select a project please");});
|
$("#versionrange").slider({ range: true, min: 0, max: 0, values: [0, 0], slide: function(event, ui) { $("#versionlbl").val(ui.values[0] + '-' + ui.values[1]); } }); $("#versionlbl").val("Select a project please");
|
$.jqplot('verplot1plot', [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]]); $.jqplot('verplot2plot', [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]]);
|
$(document).ready(function() { getMetricTypes(); $("#metricTypeSelect").change(function(){ getMetrics($("#metricTypeSelect :selected").text()); }); $("#versionrange").slider({ range: true, min: 0, max: 0, values: [0, 0], slide: function(event, ui) { $("#versionlbl").val(ui.values[0] + '-' + ui.values[1]); } }); $("#versionlbl").val("Select a project please");});
|
dojo.addOnLoad(populateUserInfo);
|
dojo.addOnLoad(function() { dojo.require("dojo.rpc.JsonService"); dojo.addOnLoad(initServices); dojo.addOnLoad(initGallery); });
|
|
getContainerSize: function() { return this.currentSize; }, error: function(){ this.fireEvent('error', arguments); }
|
getContainerSize: function() { return this.currentSize; }.bind(this), error: function(){ this.fireEvent('error', arguments); }.bind(this)
|
(function(){ this.Behavior = new Class({ Implements: [Options, Events], options: { //default error behavior when a filter cannot be applied onError: function(){ if (window.console && console.warn) console.warn.apply(console, arguments); } //Components that have a Behavior instance (like an ART.Window) //call these events to tell filters that need to know that the state //has changed: // onResize: $empty, //the element's dimensions have changed // onShow: $empty, //the element is displayed // onHide: $empty //the element is hidden }, initialize: function(options){ this.setOptions(options); this.passMethods({ addEvent: this.addEvent.bind(this), removeEvent: this.removeEvent.bind(this), addEvents: this.addEvents.bind(this), removeEvents: this.removeEvents.bind(this), //this doesn't really stand up; the container is variable - one behavior instance //can handle numerous containers... TODO: revisit getContainerSize: function() { return this.currentSize; }, error: function(){ this.fireEvent('error', arguments); } }); }, //pass a method pointer through to a filter //by default the methods for add/remove events are passed to the filter //pointed to this instance of behavior. you could use this to pass along //other methods to your filters. For example, a method to close a popup //for filters presented inside popups. _passedMethods: {}, passMethod: function(method, fn){ var self = this; this._passedMethods[method] = function(){ return fn.apply(this, arguments); }; }, passMethods: function(methods){ for (method in methods) { this.passMethod(method, methods[method]); } }, //These methods don't change the element's state but rather are used //to tell filters that need to adapt to the new element state that //it has changed. show: function(){ return this.fireEvent('show'); }, //the element is hidden hide: function(){ return this.fireEvent('hide'); }, //the element's dimensions are now the specified width and height resize: function(x, y){ this.currentSize = {x: x, y: y}; return this.fireEvent('resize', [x, y]); }, //Applies all the behavior filters for an element. //container - (element) an element to apply the filters registered with this Behavior instance to. //force - (boolean; optional) passed through to applyBehavior (see it for docs) apply: function(container, force){ document.id(container).getElements('[data-filters]').each(function(element){ element.get('data', 'filters').split(',').each(function(name){ var behavior = this.getBehavior(name.trim()); if (!behavior) this.fireEvent('error', ['There is no behavior registered with this name: ', name, element]); else this.applyBehavior(element, behavior, force); }, this); }, this); return this; }, //Applies a specific behavior to a specific element. //element - the element to which to apply the behavior //behavior - (object) a specific behavior filter, typically one registered with this instance or registered globally. //force - (boolean; optional) apply the behavior to each element it matches, even if it was previously applied. Defaults to *false*. applyBehavior: function(element, behavior, force){ element = document.id(element); //get the filters already applied to this element var applied = getApplied(element); //if this filter is not yet applied to the element, or we are forcing the filter if (!applied[behavior.name] || force) { //if it was previously applied, garbage collect it if (applied[behavior.name]) applied[behavior.name].cleanup(element); //apply the filter behavior.attach(element, this._passedMethods); //and mark it as having been previously applied applied[behavior.name] = behavior; //apply all the plugins for this filter var plugins = this.getPlugins(behavior.name); if (plugins) { for (name in plugins) { this.applyBehavior(element, plugins[name], force); } } } return this; }, //given a name, returns a registered behavior getBehavior: function(name){ return this._registered[name] || Behavior._registered[name]; }, getPlugins: function(name){ return this._plugins[name] || Behavior._plugins[name]; }, //Garbage collects all applied filters for an element and its children. //element - (*element*) container to cleanup //ignoreChildren - (*boolean*; optional) if *true* only the element will be cleaned, otherwise the element and all the // children with filters applied will be cleaned. Defaults to *false*. cleanup: function(element, ignoreChildren){ element = document.id(element); var applied = getApplied(element); for (behavior in applied) { applied[behavior].cleanup(element); delete applied[behavior]; } if (!ignoreChildren) element.getElements(':hasBehaviors').each(this.cleanup, this); return this; } }); //Returns the applied behaviors for an element. var getApplied = function(el){ return el.retrieve('_appliedBehaviors', {}); }; //Registers a behavior filter. //name - the name of the filter //fn - a function that applies the filter to the given element //overwrite - (boolean) if true, will overwrite existing filter if one exists; defaults to false. var addFilter = function(name, fn, overwrite){ if (!this._registered[name] || overwrite) this._registered[name] = new Behavior.Filter(name, fn); }; var addFilters = function(obj, overwrite) { for (var name in obj) { addFilter.apply(this, [name, obj[name], overwrite]); } }; //Registers a behavior plugin //filterName - (*string*) the filter (or plugin) this is a plugin for //name - (*string*) the name of this plugin //attacher - a function that applies the filter to the given element var addPlugin = function(filterName, name, attacher, overwrite) { if (!this._plugins[filterName]) this._plugins[filterName] = {}; if (!this._plugins[filterName][name] || overwrite) this._plugins[filterName][name] = new Behavior.Filter(name, attacher); }; var addPlugins = function(obj, overwrite) { for (name in obj) { addPlugin.apply(this, [obj[name].fitlerName, obj[name].name, obj[name].attacher], overwrite); } }; //Add methods to the Behavior namespace for global registration. $extend(Behavior, { _registered: {}, _plugins: {}, addGlobalFilter: addFilter, addGlobalFilters: addFilters, addGlobalPlugin: addPlugin, addGlobalPlugins: addPlugins }); //Add methods to the Behavior class for instance registration. Behavior.implement({ _registered: {}, _plugins: {}, addFilter: addFilter, addFilters: addFilters, addPlugin: addPlugin, addPlugins: addPlugins }); //This class is an actual filter that, given an element, alters it with specific behaviors. Behavior.Filter = new Class({ //Filter implements window tools for filters that integrate with ART.Window. Implements: [ART.WindowTools], //Pass in an object with the following properties: //name - the name of this filter //attacher - a function that applies the filter to the given element initialize: function(name, attacher){ this.name = name; this.attach = attacher; this._marks = new Table(); }, //Stores a garbage collection pointer for a specific element. //Example: if your filter enhances all the inputs in the container //you might have a function that removes that enhancement for garbage collection. //You would mark each input matched with its own cleanup function. //NOTE: this MUST be the element passed to the filter - the element with this filters // name in its data-filter property. I.E.: //<form data-filter="FormValidator"> // <input type="text" name="email"/> //</form> //If this filter is FormValidator, you can mark the form for cleanup, but not, for example //the input. Only elements that match this filter can be marked. markForCleanup: function(element, fn){ var marks = this._marks.get(element); if (!marks) marks = []; marks.include(fn); this._marks.set(element, marks); return this; }, //Garbage collect a specific element. //NOTE: this should be an element that has a data-filter property that matches this filter. cleanup: function(element){ var marks = this._marks.get(element); if (marks) { marks.each(function(fn){ fn(); }); this._marks.erase(element); } return this; } });})();
|
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)) {
|
dojo.addOnLoad( function(){ var fileUploaderConfig = { isDebug:false, hoverClass:"uploadHover", activeClass:"uploadPress", disabledClass:"uploadDisabled", uploadUrl:"upload", fileMask:[ ["Jpeg File", "*.jpg;*.jpeg"], ["GIF File", "*.gif"], ["PNG File", "*.png"], ["All Images", "*.jpg;*.jpeg;*.gif;*.png"], ["Image Archive Files","*.zip;*.tar"] ] }; if(dojo.byId("btnUploader")){ dojo.byId("files").value = ""; //instantiate uploader passing config properties var uploader = new dojox.form.FileUploader(dojo.mixin({ button:dojo.byId("btnUploader"), fileListId:"files", selectMultipleFiles:true, deferredUploading:false },fileUploaderConfig), "btnUploader"); 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.connect(uploader, "onComplete", function(dataArray){ console.log("onComplete"); setProgressbar(1,1); dojo.byId("newAlbumName").value =""; }); dojo.connect(uploader, "onProgress", function(dataArray){ var uploadedPercent=0; var totalPercent=0; for(var i=0;i<dataArray.length;i++){ uploadedPercent+=dataArray[i].bytesLoaded; totalPercent+=dataArray[i].bytesTotal; } console.log("onProgress:"+uploadedPercent+"/"+totalPercent); setProgressbar((uploadedPercent/totalPercent),1.01011); //dojo.byId("newAlbumName").value =""; }); dojo.connect(uploader, "onChange", function(dataArray){ //hiding the progress bar dojo.byId("progressBar").style.display="none"; }); dojo.connect(uploader, "onError", function(err){ var uploadedPercent=0; var totalPercent=0; for(var i=0;i<dataArray.length;i++){ uploadedPercent+=dataArray[i].bytesLoaded; totalPercent+=dataArray[i].bytesTotal; } console.log("onProgress:"+uploadedPercent+"/"+totalPercent); setProgressbar((uploadedPercent/totalPercent),1.01011); if(err && err.text) { console.error("Error uploading files:" + err.text); //alert("Error uploading files:" + err.text); } }); }});
|
var albumName = dojo.byId("newAlbumName").value;
|
albumName = dojo.byId("newAlbumName").value;
|
dojo.addOnLoad( function(){ var fileUploaderConfig = { isDebug:false, hoverClass:"uploadHover", activeClass:"uploadPress", disabledClass:"uploadDisabled", uploadUrl:"upload", fileMask:[ ["Jpeg File", "*.jpg;*.jpeg"], ["GIF File", "*.gif"], ["PNG File", "*.png"], ["All Images", "*.jpg;*.jpeg;*.gif;*.png"], ["Image Archive Files","*.zip;*.tar"] ] }; if(dojo.byId("btnUploader")){ dojo.byId("files").value = ""; //instantiate uploader passing config properties var uploader = new dojox.form.FileUploader(dojo.mixin({ button:dojo.byId("btnUploader"), fileListId:"files", selectMultipleFiles:true, deferredUploading:false },fileUploaderConfig), "btnUploader"); 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.connect(uploader, "onComplete", function(dataArray){ console.log("onComplete"); setProgressbar(1,1); dojo.byId("newAlbumName").value =""; }); dojo.connect(uploader, "onProgress", function(dataArray){ var uploadedPercent=0; var totalPercent=0; for(var i=0;i<dataArray.length;i++){ uploadedPercent+=dataArray[i].bytesLoaded; totalPercent+=dataArray[i].bytesTotal; } console.log("onProgress:"+uploadedPercent+"/"+totalPercent); setProgressbar((uploadedPercent/totalPercent),1.01011); //dojo.byId("newAlbumName").value =""; }); dojo.connect(uploader, "onChange", function(dataArray){ //hiding the progress bar dojo.byId("progressBar").style.display="none"; }); dojo.connect(uploader, "onError", function(err){ var uploadedPercent=0; var totalPercent=0; for(var i=0;i<dataArray.length;i++){ uploadedPercent+=dataArray[i].bytesLoaded; totalPercent+=dataArray[i].bytesTotal; } console.log("onProgress:"+uploadedPercent+"/"+totalPercent); setProgressbar((uploadedPercent/totalPercent),1.01011); if(err && err.text) { console.error("Error uploading files:" + err.text); //alert("Error uploading files:" + err.text); } }); }});
|
reloadAdminGallery();
|
dojo.addOnLoad( function(){ var fileUploaderConfig = { isDebug:false, hoverClass:"uploadHover", activeClass:"uploadPress", disabledClass:"uploadDisabled", uploadUrl:"upload", fileMask:[ ["Jpeg File", "*.jpg;*.jpeg"], ["GIF File", "*.gif"], ["PNG File", "*.png"], ["All Images", "*.jpg;*.jpeg;*.gif;*.png"], ["Image Archive Files","*.zip;*.tar"] ] }; if(dojo.byId("btnUploader")){ dojo.byId("files").value = ""; //instantiate uploader passing config properties var uploader = new dojox.form.FileUploader(dojo.mixin({ button:dojo.byId("btnUploader"), fileListId:"files", selectMultipleFiles:true, deferredUploading:false },fileUploaderConfig), "btnUploader"); 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.connect(uploader, "onComplete", function(dataArray){ console.log("onComplete"); setProgressbar(1,1); dojo.byId("newAlbumName").value =""; }); dojo.connect(uploader, "onProgress", function(dataArray){ var uploadedPercent=0; var totalPercent=0; for(var i=0;i<dataArray.length;i++){ uploadedPercent+=dataArray[i].bytesLoaded; totalPercent+=dataArray[i].bytesTotal; } console.log("onProgress:"+uploadedPercent+"/"+totalPercent); setProgressbar((uploadedPercent/totalPercent),1.01011); //dojo.byId("newAlbumName").value =""; }); dojo.connect(uploader, "onChange", function(dataArray){ //hiding the progress bar dojo.byId("progressBar").style.display="none"; }); dojo.connect(uploader, "onError", function(err){ var uploadedPercent=0; var totalPercent=0; for(var i=0;i<dataArray.length;i++){ uploadedPercent+=dataArray[i].bytesLoaded; totalPercent+=dataArray[i].bytesTotal; } console.log("onProgress:"+uploadedPercent+"/"+totalPercent); setProgressbar((uploadedPercent/totalPercent),1.01011); if(err && err.text) { console.error("Error uploading files:" + err.text); //alert("Error uploading files:" + err.text); } }); }});
|
|
settings.opts[prop] = value;
|
var func = value.match(/function\s*\((.*?)\)\s*\{(.*)\}/i); if (func) { value = new Function(func[1].match(/(\w+)/g), func[2]); } if (typeof(value) == "function" && prop in settings.opts) { var callboth = function(before_func, new_func) { return function() { before_func.apply(null, arguments); new_func.apply(null, arguments); }; }; settings.opts[prop] = callboth(settings.opts[prop], value); } else { settings.opts[prop] = value; }
|
$('.views_slideshow_singleframe_main:not(.viewsSlideshowSingleFrame-processed)', context).addClass('viewsSlideshowSingleFrame-processed').each(function() { var fullId = '#' + $(this).attr('id'); var settings = Drupal.settings.viewsSlideshowSingleFrame[fullId]; settings.targetId = '#' + $(fullId + " :first").attr('id'); settings.paused = false; settings.opts = { speed:settings.speed, timeout:parseInt(settings.timeout), delay:parseInt(settings.delay), sync:settings.sync==1, random:settings.random==1, pause:false, prev:(settings.controls > 0)?'#views_slideshow_singleframe_prev_' + settings.id:null, next:(settings.controls > 0)?'#views_slideshow_singleframe_next_' + settings.id:null, pager:(settings.pager > 0)?'#views_slideshow_singleframe_pager_' + settings.id:null, pagerAnchorBuilder: function(idx, slide) { var classes = 'pager-item pager-num-' + (idx+1); if (idx % 2) { classes += ' odd'; } else { classes += ' even'; } return Drupal.theme('viewsSlideshowPager' + settings.pager_type, classes, idx, slide); }, after:function(curr, next, opts) { // Used for Image Counter. if (settings.image_count) { $('#views_slideshow_singleframe_image_count_' + settings.id + ' span.num').html(opts.currSlide + 1); $('#views_slideshow_singleframe_image_count_' + settings.id + ' span.total').html(opts.slideCount); } }, cleartype:(settings.ie.cleartype), cleartypeNoBg:(settings.ie.cleartypenobg) } if (settings.pager_hover == 1) { settings.opts.pagerEvent = 'mouseover'; settings.opts.pauseOnPagerHover = true; } if (settings.effect == 'none') { settings.opts.speed = 1; } else { settings.opts.fx = settings.effect; } // Pause on hover. if (settings.pause == 1) { $('#views_slideshow_singleframe_teaser_section_' + settings.id).hover(function() { $(settings.targetId).cycle('pause'); }, function() { if (settings.paused == false) { $(settings.targetId).cycle('resume'); } }); } // Pause on clicking of the slide. if (settings.pause_on_click == 1) { $('#views_slideshow_singleframe_teaser_section_' + settings.id).click(function() { viewsSlideshowPause(settings); }); } // Add additional settings. var advanced = settings.advanced.split("\n"); for (i=0; i<advanced.length; i++) { var prop = ''; var value = ''; var property = advanced[i].split(":"); for (j=0; j<property.length; j++) { if (j == 0) { prop = property[j]; } else if (j == 1) { value = property[j]; } else { value += ":" + property[j]; } } // Need to evaluate so true and false isn't a string. if (value == 'true' || value == 'false') { value = eval(value); } settings.opts[prop] = value; } $(settings.targetId).cycle(settings.opts); // Show image count for people who have js enabled. $('#views_slideshow_singleframe_image_count_' + settings.id).show(); if (settings.controls > 0) { // Show controls for people who have js enabled browsers. $('#views_slideshow_singleframe_controls_' + settings.id).show(); $('#views_slideshow_singleframe_playpause_' + settings.id).click(function(e) { if (settings.paused) { viewsSlideshowSingleFrameResume(settings); } else { viewsSlideshowSingleFramePause(settings); } e.preventDefault(); }); } });
|
function flushAllCaches() { Ext.Msg.show({ title : 'Are you sure?', msg : 'Flush all caches?', buttons : Ext.Msg.YESNO, fn : processFlushAllCachesResult, animEl : 'cacheStats', icon : Ext.MessageBox.QUESTION }); } function flushCache(name) { Ext.Msg.show({ title : 'Are you sure?', msg : 'Flush ' + name + ' cache?', buttons : Ext.Msg.YESNO, fn : processFlushCacheResult, animEl : 'cacheStats', icon : Ext.MessageBox.QUESTION, cacheName : name }); } function resetHibernateStats() { Ext.Msg.show({ title : 'Are you sure?', msg : 'Reset Hibernate stats?', buttons : Ext.Msg.YESNO, fn : processResetHibernateStats, animEl : 'hibstat-reset-button', icon : Ext.MessageBox.QUESTION, cacheName : name }); } function processFlushCacheResult(btn, text, opt) { if (btn == 'yes') { SystemMonitorController.flushCache(opt.cacheName); } } function processFlushAllCachesResult(btn, text, opt) { if (btn == 'yes') { SystemMonitorController.flushAllCaches(); } } function processResetHibernateStats(btn, text, opt) { if (btn == 'yes') { SystemMonitorController.resetHibernateStatus(); SystemMonitorController.getHibernateStatus(handleSuccess); } } });
|
});
|
Ext.onReady(function() { var pauseBx = new Ext.form.Checkbox({ id : 'cache-pause-stats-checkbox', renderTo : 'cache-pause-stats-checkbox-div', boxLabel : 'Pause updates' }); // fire once immediately. task(); window.setInterval(task, 10000); function task() { SystemMonitorController.getHibernateStatus(handleSuccess); if (!pauseBx.getValue()) { SystemMonitorController.getCacheStatus(handleCacheData); } SystemMonitorController.getSpaceStatus(handleSpaceStatus); } function handleSuccess(data) { Ext.DomHelper.overwrite("hibernateStats", data); } function handleCacheData(data) { Ext.DomHelper.overwrite("cacheStats", data); } function handleSpaceStatus(data) { Ext.DomHelper.overwrite("spaceStats", data); } function flushAllCaches() { Ext.Msg.show({ title : 'Are you sure?', msg : 'Flush all caches?', buttons : Ext.Msg.YESNO, fn : processFlushAllCachesResult, animEl : 'cacheStats', icon : Ext.MessageBox.QUESTION }); } function flushCache(name) { Ext.Msg.show({ title : 'Are you sure?', msg : 'Flush ' + name + ' cache?', buttons : Ext.Msg.YESNO, fn : processFlushCacheResult, animEl : 'cacheStats', icon : Ext.MessageBox.QUESTION, cacheName : name }); } function resetHibernateStats() { Ext.Msg.show({ title : 'Are you sure?', msg : 'Reset Hibernate stats?', buttons : Ext.Msg.YESNO, fn : processResetHibernateStats, animEl : 'hibstat-reset-button', icon : Ext.MessageBox.QUESTION, cacheName : name }); } function processFlushCacheResult(btn, text, opt) { if (btn == 'yes') { SystemMonitorController.flushCache(opt.cacheName); } } function processFlushAllCachesResult(btn, text, opt) { if (btn == 'yes') { SystemMonitorController.flushAllCaches(); } } function processResetHibernateStats(btn, text, opt) { if (btn == 'yes') { SystemMonitorController.resetHibernateStatus(); SystemMonitorController.getHibernateStatus(handleSuccess); } } });
|
var geneGroupImporter = new Gemma.GeneGroupImporter({ renderTo : 'genesetCreation-div', width : "100%"
|
new Gemma.GeneGroupManager({ renderTo : 'genesetCreation-div'
|
Ext.onReady(function() { Ext.QuickTips.init(); Ext.state.Manager.setProvider(new Ext.state.CookieProvider()); /* * The GUI */ var geneGroupImporter = new Gemma.GeneGroupImporter({ renderTo : 'genesetCreation-div', width : "100%" }); });
|
var data = decodeURIComponent(location.href.substr(location.href.lastIndexOf('app=')+4)).split('|'); var func, appName = data.shift(); for (var i in data) { var arr = data[i].split('@'); arr.length > 1 && (appFields[arr[0]] = arr[1]);
|
var index = location.href.lastIndexOf('app='); if (index == -1) return; var data = decodeURIComponent(location.href.substr(index + 4)).split('|'); var arr, prop, str, func, appName = data.shift(); for (var i = 0, len = data.length; i < len; i++) { str = data[i]; if (!str.length) continue; if (str.indexOf('&') != -1) str = str.split('&')[0]; arr = str.split('@'); if (arr.length > 1) { prop = arr.shift(); appFields[prop] = arr.join('@'); }
|
(function($) {var appFields = {}, appWindow = (top.appiFrm||window).opener || parent;//execute when imce loads.imce.hooks.load.push(function(win) { var data = decodeURIComponent(location.href.substr(location.href.lastIndexOf('app=')+4)).split('|'); var func, appName = data.shift(); //extract fields for (var i in data) { var arr = data[i].split('@'); arr.length > 1 && (appFields[arr[0]] = arr[1]); } //run custom onload function if available if (appFields['imceload'] && (func = isFunc(appFields['imceload']))) { func(win); delete appFields['imceload']; } //set custom sendto function. appFinish is the default. var sendtoFunc = appFields['url'] ? appFinish : false; //check sendto@funcName syntax in URL if (appFields['sendto'] && (func = isFunc(appFields['sendto']))) { sendtoFunc = func; delete appFields['sendto']; } //check windowname+ImceFinish. old method else if (win.name && (func = isFunc(win.name +'ImceFinish'))) { sendtoFunc = func; } //highlight file if (appFields['url']) { if (appFields['url'].indexOf(',') > -1) {//support multiple url fields url@field1,field2.. var arr = appFields['url'].split(','); for (var i in arr) { if ($('#'+ arr[i], appWindow.document).size()) { appFields['url'] = arr[i]; break; } } } var filename = $('#'+ appFields['url'], appWindow.document).val(); imce.highlight(filename.substr(filename.lastIndexOf('/')+1)); } //set send to sendtoFunc && imce.setSendTo(Drupal.t('Insert file'), sendtoFunc);});//sendTo functionvar appFinish = function(file, win) { var $doc = $(appWindow.document); for (var i in appFields) { $doc.find('#'+ appFields[i]).val(file[i]); } if (appFields['url']) { try{ $doc.find('#'+ appFields['url']).blur().change().focus(); }catch(e){ try{ $doc.find('#'+ appFields['url']).trigger('onblur').trigger('onchange').trigger('onfocus');//inline events for IE }catch(e){} } } appWindow.focus(); win.close();};//checks if a string is a function name in the given scope. returns function reference. supports x.y.z notation.var isFunc = function(str, scope) { var obj = scope || appWindow; var parts = str.split('.'), len = parts.length; for (var i = 0; i < len && (obj = obj[parts[i]]); i++); return obj && i == len && (typeof obj == 'function' || typeof obj != 'string' && !obj.nodeName && obj.constructor != Array && /^[\s[]?function/.test(obj.toString())) ? obj : false;}})(jQuery);
|
if (appFields['imceload'] && (func = isFunc(appFields['imceload']))) {
|
if (appFields.imceload && (func = isFunc(appFields.imceload))) {
|
(function($) {var appFields = {}, appWindow = (top.appiFrm||window).opener || parent;//execute when imce loads.imce.hooks.load.push(function(win) { var data = decodeURIComponent(location.href.substr(location.href.lastIndexOf('app=')+4)).split('|'); var func, appName = data.shift(); //extract fields for (var i in data) { var arr = data[i].split('@'); arr.length > 1 && (appFields[arr[0]] = arr[1]); } //run custom onload function if available if (appFields['imceload'] && (func = isFunc(appFields['imceload']))) { func(win); delete appFields['imceload']; } //set custom sendto function. appFinish is the default. var sendtoFunc = appFields['url'] ? appFinish : false; //check sendto@funcName syntax in URL if (appFields['sendto'] && (func = isFunc(appFields['sendto']))) { sendtoFunc = func; delete appFields['sendto']; } //check windowname+ImceFinish. old method else if (win.name && (func = isFunc(win.name +'ImceFinish'))) { sendtoFunc = func; } //highlight file if (appFields['url']) { if (appFields['url'].indexOf(',') > -1) {//support multiple url fields url@field1,field2.. var arr = appFields['url'].split(','); for (var i in arr) { if ($('#'+ arr[i], appWindow.document).size()) { appFields['url'] = arr[i]; break; } } } var filename = $('#'+ appFields['url'], appWindow.document).val(); imce.highlight(filename.substr(filename.lastIndexOf('/')+1)); } //set send to sendtoFunc && imce.setSendTo(Drupal.t('Insert file'), sendtoFunc);});//sendTo functionvar appFinish = function(file, win) { var $doc = $(appWindow.document); for (var i in appFields) { $doc.find('#'+ appFields[i]).val(file[i]); } if (appFields['url']) { try{ $doc.find('#'+ appFields['url']).blur().change().focus(); }catch(e){ try{ $doc.find('#'+ appFields['url']).trigger('onblur').trigger('onchange').trigger('onfocus');//inline events for IE }catch(e){} } } appWindow.focus(); win.close();};//checks if a string is a function name in the given scope. returns function reference. supports x.y.z notation.var isFunc = function(str, scope) { var obj = scope || appWindow; var parts = str.split('.'), len = parts.length; for (var i = 0; i < len && (obj = obj[parts[i]]); i++); return obj && i == len && (typeof obj == 'function' || typeof obj != 'string' && !obj.nodeName && obj.constructor != Array && /^[\s[]?function/.test(obj.toString())) ? obj : false;}})(jQuery);
|
delete appFields['imceload'];
|
delete appFields.imceload;
|
(function($) {var appFields = {}, appWindow = (top.appiFrm||window).opener || parent;//execute when imce loads.imce.hooks.load.push(function(win) { var data = decodeURIComponent(location.href.substr(location.href.lastIndexOf('app=')+4)).split('|'); var func, appName = data.shift(); //extract fields for (var i in data) { var arr = data[i].split('@'); arr.length > 1 && (appFields[arr[0]] = arr[1]); } //run custom onload function if available if (appFields['imceload'] && (func = isFunc(appFields['imceload']))) { func(win); delete appFields['imceload']; } //set custom sendto function. appFinish is the default. var sendtoFunc = appFields['url'] ? appFinish : false; //check sendto@funcName syntax in URL if (appFields['sendto'] && (func = isFunc(appFields['sendto']))) { sendtoFunc = func; delete appFields['sendto']; } //check windowname+ImceFinish. old method else if (win.name && (func = isFunc(win.name +'ImceFinish'))) { sendtoFunc = func; } //highlight file if (appFields['url']) { if (appFields['url'].indexOf(',') > -1) {//support multiple url fields url@field1,field2.. var arr = appFields['url'].split(','); for (var i in arr) { if ($('#'+ arr[i], appWindow.document).size()) { appFields['url'] = arr[i]; break; } } } var filename = $('#'+ appFields['url'], appWindow.document).val(); imce.highlight(filename.substr(filename.lastIndexOf('/')+1)); } //set send to sendtoFunc && imce.setSendTo(Drupal.t('Insert file'), sendtoFunc);});//sendTo functionvar appFinish = function(file, win) { var $doc = $(appWindow.document); for (var i in appFields) { $doc.find('#'+ appFields[i]).val(file[i]); } if (appFields['url']) { try{ $doc.find('#'+ appFields['url']).blur().change().focus(); }catch(e){ try{ $doc.find('#'+ appFields['url']).trigger('onblur').trigger('onchange').trigger('onfocus');//inline events for IE }catch(e){} } } appWindow.focus(); win.close();};//checks if a string is a function name in the given scope. returns function reference. supports x.y.z notation.var isFunc = function(str, scope) { var obj = scope || appWindow; var parts = str.split('.'), len = parts.length; for (var i = 0; i < len && (obj = obj[parts[i]]); i++); return obj && i == len && (typeof obj == 'function' || typeof obj != 'string' && !obj.nodeName && obj.constructor != Array && /^[\s[]?function/.test(obj.toString())) ? obj : false;}})(jQuery);
|
var sendtoFunc = appFields['url'] ? appFinish : false;
|
var sendtoFunc = appFields.url ? appFinish : false;
|
(function($) {var appFields = {}, appWindow = (top.appiFrm||window).opener || parent;//execute when imce loads.imce.hooks.load.push(function(win) { var data = decodeURIComponent(location.href.substr(location.href.lastIndexOf('app=')+4)).split('|'); var func, appName = data.shift(); //extract fields for (var i in data) { var arr = data[i].split('@'); arr.length > 1 && (appFields[arr[0]] = arr[1]); } //run custom onload function if available if (appFields['imceload'] && (func = isFunc(appFields['imceload']))) { func(win); delete appFields['imceload']; } //set custom sendto function. appFinish is the default. var sendtoFunc = appFields['url'] ? appFinish : false; //check sendto@funcName syntax in URL if (appFields['sendto'] && (func = isFunc(appFields['sendto']))) { sendtoFunc = func; delete appFields['sendto']; } //check windowname+ImceFinish. old method else if (win.name && (func = isFunc(win.name +'ImceFinish'))) { sendtoFunc = func; } //highlight file if (appFields['url']) { if (appFields['url'].indexOf(',') > -1) {//support multiple url fields url@field1,field2.. var arr = appFields['url'].split(','); for (var i in arr) { if ($('#'+ arr[i], appWindow.document).size()) { appFields['url'] = arr[i]; break; } } } var filename = $('#'+ appFields['url'], appWindow.document).val(); imce.highlight(filename.substr(filename.lastIndexOf('/')+1)); } //set send to sendtoFunc && imce.setSendTo(Drupal.t('Insert file'), sendtoFunc);});//sendTo functionvar appFinish = function(file, win) { var $doc = $(appWindow.document); for (var i in appFields) { $doc.find('#'+ appFields[i]).val(file[i]); } if (appFields['url']) { try{ $doc.find('#'+ appFields['url']).blur().change().focus(); }catch(e){ try{ $doc.find('#'+ appFields['url']).trigger('onblur').trigger('onchange').trigger('onfocus');//inline events for IE }catch(e){} } } appWindow.focus(); win.close();};//checks if a string is a function name in the given scope. returns function reference. supports x.y.z notation.var isFunc = function(str, scope) { var obj = scope || appWindow; var parts = str.split('.'), len = parts.length; for (var i = 0; i < len && (obj = obj[parts[i]]); i++); return obj && i == len && (typeof obj == 'function' || typeof obj != 'string' && !obj.nodeName && obj.constructor != Array && /^[\s[]?function/.test(obj.toString())) ? obj : false;}})(jQuery);
|
if (appFields['sendto'] && (func = isFunc(appFields['sendto']))) {
|
if (appFields.sendto && (func = isFunc(appFields.sendto))) {
|
(function($) {var appFields = {}, appWindow = (top.appiFrm||window).opener || parent;//execute when imce loads.imce.hooks.load.push(function(win) { var data = decodeURIComponent(location.href.substr(location.href.lastIndexOf('app=')+4)).split('|'); var func, appName = data.shift(); //extract fields for (var i in data) { var arr = data[i].split('@'); arr.length > 1 && (appFields[arr[0]] = arr[1]); } //run custom onload function if available if (appFields['imceload'] && (func = isFunc(appFields['imceload']))) { func(win); delete appFields['imceload']; } //set custom sendto function. appFinish is the default. var sendtoFunc = appFields['url'] ? appFinish : false; //check sendto@funcName syntax in URL if (appFields['sendto'] && (func = isFunc(appFields['sendto']))) { sendtoFunc = func; delete appFields['sendto']; } //check windowname+ImceFinish. old method else if (win.name && (func = isFunc(win.name +'ImceFinish'))) { sendtoFunc = func; } //highlight file if (appFields['url']) { if (appFields['url'].indexOf(',') > -1) {//support multiple url fields url@field1,field2.. var arr = appFields['url'].split(','); for (var i in arr) { if ($('#'+ arr[i], appWindow.document).size()) { appFields['url'] = arr[i]; break; } } } var filename = $('#'+ appFields['url'], appWindow.document).val(); imce.highlight(filename.substr(filename.lastIndexOf('/')+1)); } //set send to sendtoFunc && imce.setSendTo(Drupal.t('Insert file'), sendtoFunc);});//sendTo functionvar appFinish = function(file, win) { var $doc = $(appWindow.document); for (var i in appFields) { $doc.find('#'+ appFields[i]).val(file[i]); } if (appFields['url']) { try{ $doc.find('#'+ appFields['url']).blur().change().focus(); }catch(e){ try{ $doc.find('#'+ appFields['url']).trigger('onblur').trigger('onchange').trigger('onfocus');//inline events for IE }catch(e){} } } appWindow.focus(); win.close();};//checks if a string is a function name in the given scope. returns function reference. supports x.y.z notation.var isFunc = function(str, scope) { var obj = scope || appWindow; var parts = str.split('.'), len = parts.length; for (var i = 0; i < len && (obj = obj[parts[i]]); i++); return obj && i == len && (typeof obj == 'function' || typeof obj != 'string' && !obj.nodeName && obj.constructor != Array && /^[\s[]?function/.test(obj.toString())) ? obj : false;}})(jQuery);
|
delete appFields['sendto'];
|
delete appFields.sendto;
|
(function($) {var appFields = {}, appWindow = (top.appiFrm||window).opener || parent;//execute when imce loads.imce.hooks.load.push(function(win) { var data = decodeURIComponent(location.href.substr(location.href.lastIndexOf('app=')+4)).split('|'); var func, appName = data.shift(); //extract fields for (var i in data) { var arr = data[i].split('@'); arr.length > 1 && (appFields[arr[0]] = arr[1]); } //run custom onload function if available if (appFields['imceload'] && (func = isFunc(appFields['imceload']))) { func(win); delete appFields['imceload']; } //set custom sendto function. appFinish is the default. var sendtoFunc = appFields['url'] ? appFinish : false; //check sendto@funcName syntax in URL if (appFields['sendto'] && (func = isFunc(appFields['sendto']))) { sendtoFunc = func; delete appFields['sendto']; } //check windowname+ImceFinish. old method else if (win.name && (func = isFunc(win.name +'ImceFinish'))) { sendtoFunc = func; } //highlight file if (appFields['url']) { if (appFields['url'].indexOf(',') > -1) {//support multiple url fields url@field1,field2.. var arr = appFields['url'].split(','); for (var i in arr) { if ($('#'+ arr[i], appWindow.document).size()) { appFields['url'] = arr[i]; break; } } } var filename = $('#'+ appFields['url'], appWindow.document).val(); imce.highlight(filename.substr(filename.lastIndexOf('/')+1)); } //set send to sendtoFunc && imce.setSendTo(Drupal.t('Insert file'), sendtoFunc);});//sendTo functionvar appFinish = function(file, win) { var $doc = $(appWindow.document); for (var i in appFields) { $doc.find('#'+ appFields[i]).val(file[i]); } if (appFields['url']) { try{ $doc.find('#'+ appFields['url']).blur().change().focus(); }catch(e){ try{ $doc.find('#'+ appFields['url']).trigger('onblur').trigger('onchange').trigger('onfocus');//inline events for IE }catch(e){} } } appWindow.focus(); win.close();};//checks if a string is a function name in the given scope. returns function reference. supports x.y.z notation.var isFunc = function(str, scope) { var obj = scope || appWindow; var parts = str.split('.'), len = parts.length; for (var i = 0; i < len && (obj = obj[parts[i]]); i++); return obj && i == len && (typeof obj == 'function' || typeof obj != 'string' && !obj.nodeName && obj.constructor != Array && /^[\s[]?function/.test(obj.toString())) ? obj : false;}})(jQuery);
|
if (appFields['url']) { if (appFields['url'].indexOf(',') > -1) { var arr = appFields['url'].split(',');
|
if (appFields.url) { if (appFields.url.indexOf(',') > -1) { var arr = appFields.url.split(',');
|
(function($) {var appFields = {}, appWindow = (top.appiFrm||window).opener || parent;//execute when imce loads.imce.hooks.load.push(function(win) { var data = decodeURIComponent(location.href.substr(location.href.lastIndexOf('app=')+4)).split('|'); var func, appName = data.shift(); //extract fields for (var i in data) { var arr = data[i].split('@'); arr.length > 1 && (appFields[arr[0]] = arr[1]); } //run custom onload function if available if (appFields['imceload'] && (func = isFunc(appFields['imceload']))) { func(win); delete appFields['imceload']; } //set custom sendto function. appFinish is the default. var sendtoFunc = appFields['url'] ? appFinish : false; //check sendto@funcName syntax in URL if (appFields['sendto'] && (func = isFunc(appFields['sendto']))) { sendtoFunc = func; delete appFields['sendto']; } //check windowname+ImceFinish. old method else if (win.name && (func = isFunc(win.name +'ImceFinish'))) { sendtoFunc = func; } //highlight file if (appFields['url']) { if (appFields['url'].indexOf(',') > -1) {//support multiple url fields url@field1,field2.. var arr = appFields['url'].split(','); for (var i in arr) { if ($('#'+ arr[i], appWindow.document).size()) { appFields['url'] = arr[i]; break; } } } var filename = $('#'+ appFields['url'], appWindow.document).val(); imce.highlight(filename.substr(filename.lastIndexOf('/')+1)); } //set send to sendtoFunc && imce.setSendTo(Drupal.t('Insert file'), sendtoFunc);});//sendTo functionvar appFinish = function(file, win) { var $doc = $(appWindow.document); for (var i in appFields) { $doc.find('#'+ appFields[i]).val(file[i]); } if (appFields['url']) { try{ $doc.find('#'+ appFields['url']).blur().change().focus(); }catch(e){ try{ $doc.find('#'+ appFields['url']).trigger('onblur').trigger('onchange').trigger('onfocus');//inline events for IE }catch(e){} } } appWindow.focus(); win.close();};//checks if a string is a function name in the given scope. returns function reference. supports x.y.z notation.var isFunc = function(str, scope) { var obj = scope || appWindow; var parts = str.split('.'), len = parts.length; for (var i = 0; i < len && (obj = obj[parts[i]]); i++); return obj && i == len && (typeof obj == 'function' || typeof obj != 'string' && !obj.nodeName && obj.constructor != Array && /^[\s[]?function/.test(obj.toString())) ? obj : false;}})(jQuery);
|
appFields['url'] = arr[i];
|
appFields.url = arr[i];
|
(function($) {var appFields = {}, appWindow = (top.appiFrm||window).opener || parent;//execute when imce loads.imce.hooks.load.push(function(win) { var data = decodeURIComponent(location.href.substr(location.href.lastIndexOf('app=')+4)).split('|'); var func, appName = data.shift(); //extract fields for (var i in data) { var arr = data[i].split('@'); arr.length > 1 && (appFields[arr[0]] = arr[1]); } //run custom onload function if available if (appFields['imceload'] && (func = isFunc(appFields['imceload']))) { func(win); delete appFields['imceload']; } //set custom sendto function. appFinish is the default. var sendtoFunc = appFields['url'] ? appFinish : false; //check sendto@funcName syntax in URL if (appFields['sendto'] && (func = isFunc(appFields['sendto']))) { sendtoFunc = func; delete appFields['sendto']; } //check windowname+ImceFinish. old method else if (win.name && (func = isFunc(win.name +'ImceFinish'))) { sendtoFunc = func; } //highlight file if (appFields['url']) { if (appFields['url'].indexOf(',') > -1) {//support multiple url fields url@field1,field2.. var arr = appFields['url'].split(','); for (var i in arr) { if ($('#'+ arr[i], appWindow.document).size()) { appFields['url'] = arr[i]; break; } } } var filename = $('#'+ appFields['url'], appWindow.document).val(); imce.highlight(filename.substr(filename.lastIndexOf('/')+1)); } //set send to sendtoFunc && imce.setSendTo(Drupal.t('Insert file'), sendtoFunc);});//sendTo functionvar appFinish = function(file, win) { var $doc = $(appWindow.document); for (var i in appFields) { $doc.find('#'+ appFields[i]).val(file[i]); } if (appFields['url']) { try{ $doc.find('#'+ appFields['url']).blur().change().focus(); }catch(e){ try{ $doc.find('#'+ appFields['url']).trigger('onblur').trigger('onchange').trigger('onfocus');//inline events for IE }catch(e){} } } appWindow.focus(); win.close();};//checks if a string is a function name in the given scope. returns function reference. supports x.y.z notation.var isFunc = function(str, scope) { var obj = scope || appWindow; var parts = str.split('.'), len = parts.length; for (var i = 0; i < len && (obj = obj[parts[i]]); i++); return obj && i == len && (typeof obj == 'function' || typeof obj != 'string' && !obj.nodeName && obj.constructor != Array && /^[\s[]?function/.test(obj.toString())) ? obj : false;}})(jQuery);
|
var filename = $('#'+ appFields['url'], appWindow.document).val();
|
var filename = $('#'+ appFields.url, appWindow.document).val() || '';
|
(function($) {var appFields = {}, appWindow = (top.appiFrm||window).opener || parent;//execute when imce loads.imce.hooks.load.push(function(win) { var data = decodeURIComponent(location.href.substr(location.href.lastIndexOf('app=')+4)).split('|'); var func, appName = data.shift(); //extract fields for (var i in data) { var arr = data[i].split('@'); arr.length > 1 && (appFields[arr[0]] = arr[1]); } //run custom onload function if available if (appFields['imceload'] && (func = isFunc(appFields['imceload']))) { func(win); delete appFields['imceload']; } //set custom sendto function. appFinish is the default. var sendtoFunc = appFields['url'] ? appFinish : false; //check sendto@funcName syntax in URL if (appFields['sendto'] && (func = isFunc(appFields['sendto']))) { sendtoFunc = func; delete appFields['sendto']; } //check windowname+ImceFinish. old method else if (win.name && (func = isFunc(win.name +'ImceFinish'))) { sendtoFunc = func; } //highlight file if (appFields['url']) { if (appFields['url'].indexOf(',') > -1) {//support multiple url fields url@field1,field2.. var arr = appFields['url'].split(','); for (var i in arr) { if ($('#'+ arr[i], appWindow.document).size()) { appFields['url'] = arr[i]; break; } } } var filename = $('#'+ appFields['url'], appWindow.document).val(); imce.highlight(filename.substr(filename.lastIndexOf('/')+1)); } //set send to sendtoFunc && imce.setSendTo(Drupal.t('Insert file'), sendtoFunc);});//sendTo functionvar appFinish = function(file, win) { var $doc = $(appWindow.document); for (var i in appFields) { $doc.find('#'+ appFields[i]).val(file[i]); } if (appFields['url']) { try{ $doc.find('#'+ appFields['url']).blur().change().focus(); }catch(e){ try{ $doc.find('#'+ appFields['url']).trigger('onblur').trigger('onchange').trigger('onfocus');//inline events for IE }catch(e){} } } appWindow.focus(); win.close();};//checks if a string is a function name in the given scope. returns function reference. supports x.y.z notation.var isFunc = function(str, scope) { var obj = scope || appWindow; var parts = str.split('.'), len = parts.length; for (var i = 0; i < len && (obj = obj[parts[i]]); i++); return obj && i == len && (typeof obj == 'function' || typeof obj != 'string' && !obj.nodeName && obj.constructor != Array && /^[\s[]?function/.test(obj.toString())) ? obj : false;}})(jQuery);
|
if (appFields['url']) {
|
if (appFields.url) {
|
(function($) {var appFields = {}, appWindow = (top.appiFrm||window).opener || parent;//execute when imce loads.imce.hooks.load.push(function(win) { var data = decodeURIComponent(location.href.substr(location.href.lastIndexOf('app=')+4)).split('|'); var func, appName = data.shift(); //extract fields for (var i in data) { var arr = data[i].split('@'); arr.length > 1 && (appFields[arr[0]] = arr[1]); } //run custom onload function if available if (appFields['imceload'] && (func = isFunc(appFields['imceload']))) { func(win); delete appFields['imceload']; } //set custom sendto function. appFinish is the default. var sendtoFunc = appFields['url'] ? appFinish : false; //check sendto@funcName syntax in URL if (appFields['sendto'] && (func = isFunc(appFields['sendto']))) { sendtoFunc = func; delete appFields['sendto']; } //check windowname+ImceFinish. old method else if (win.name && (func = isFunc(win.name +'ImceFinish'))) { sendtoFunc = func; } //highlight file if (appFields['url']) { if (appFields['url'].indexOf(',') > -1) {//support multiple url fields url@field1,field2.. var arr = appFields['url'].split(','); for (var i in arr) { if ($('#'+ arr[i], appWindow.document).size()) { appFields['url'] = arr[i]; break; } } } var filename = $('#'+ appFields['url'], appWindow.document).val(); imce.highlight(filename.substr(filename.lastIndexOf('/')+1)); } //set send to sendtoFunc && imce.setSendTo(Drupal.t('Insert file'), sendtoFunc);});//sendTo functionvar appFinish = function(file, win) { var $doc = $(appWindow.document); for (var i in appFields) { $doc.find('#'+ appFields[i]).val(file[i]); } if (appFields['url']) { try{ $doc.find('#'+ appFields['url']).blur().change().focus(); }catch(e){ try{ $doc.find('#'+ appFields['url']).trigger('onblur').trigger('onchange').trigger('onfocus');//inline events for IE }catch(e){} } } appWindow.focus(); win.close();};//checks if a string is a function name in the given scope. returns function reference. supports x.y.z notation.var isFunc = function(str, scope) { var obj = scope || appWindow; var parts = str.split('.'), len = parts.length; for (var i = 0; i < len && (obj = obj[parts[i]]); i++); return obj && i == len && (typeof obj == 'function' || typeof obj != 'string' && !obj.nodeName && obj.constructor != Array && /^[\s[]?function/.test(obj.toString())) ? obj : false;}})(jQuery);
|
$doc.find('#'+ appFields['url']).blur().change().focus();
|
$doc.find('#'+ appFields.url).blur().change().focus();
|
(function($) {var appFields = {}, appWindow = (top.appiFrm||window).opener || parent;//execute when imce loads.imce.hooks.load.push(function(win) { var data = decodeURIComponent(location.href.substr(location.href.lastIndexOf('app=')+4)).split('|'); var func, appName = data.shift(); //extract fields for (var i in data) { var arr = data[i].split('@'); arr.length > 1 && (appFields[arr[0]] = arr[1]); } //run custom onload function if available if (appFields['imceload'] && (func = isFunc(appFields['imceload']))) { func(win); delete appFields['imceload']; } //set custom sendto function. appFinish is the default. var sendtoFunc = appFields['url'] ? appFinish : false; //check sendto@funcName syntax in URL if (appFields['sendto'] && (func = isFunc(appFields['sendto']))) { sendtoFunc = func; delete appFields['sendto']; } //check windowname+ImceFinish. old method else if (win.name && (func = isFunc(win.name +'ImceFinish'))) { sendtoFunc = func; } //highlight file if (appFields['url']) { if (appFields['url'].indexOf(',') > -1) {//support multiple url fields url@field1,field2.. var arr = appFields['url'].split(','); for (var i in arr) { if ($('#'+ arr[i], appWindow.document).size()) { appFields['url'] = arr[i]; break; } } } var filename = $('#'+ appFields['url'], appWindow.document).val(); imce.highlight(filename.substr(filename.lastIndexOf('/')+1)); } //set send to sendtoFunc && imce.setSendTo(Drupal.t('Insert file'), sendtoFunc);});//sendTo functionvar appFinish = function(file, win) { var $doc = $(appWindow.document); for (var i in appFields) { $doc.find('#'+ appFields[i]).val(file[i]); } if (appFields['url']) { try{ $doc.find('#'+ appFields['url']).blur().change().focus(); }catch(e){ try{ $doc.find('#'+ appFields['url']).trigger('onblur').trigger('onchange').trigger('onfocus');//inline events for IE }catch(e){} } } appWindow.focus(); win.close();};//checks if a string is a function name in the given scope. returns function reference. supports x.y.z notation.var isFunc = function(str, scope) { var obj = scope || appWindow; var parts = str.split('.'), len = parts.length; for (var i = 0; i < len && (obj = obj[parts[i]]); i++); return obj && i == len && (typeof obj == 'function' || typeof obj != 'string' && !obj.nodeName && obj.constructor != Array && /^[\s[]?function/.test(obj.toString())) ? obj : false;}})(jQuery);
|
$doc.find('#'+ appFields['url']).trigger('onblur').trigger('onchange').trigger('onfocus');
|
$doc.find('#'+ appFields.url).trigger('onblur').trigger('onchange').trigger('onfocus');
|
(function($) {var appFields = {}, appWindow = (top.appiFrm||window).opener || parent;//execute when imce loads.imce.hooks.load.push(function(win) { var data = decodeURIComponent(location.href.substr(location.href.lastIndexOf('app=')+4)).split('|'); var func, appName = data.shift(); //extract fields for (var i in data) { var arr = data[i].split('@'); arr.length > 1 && (appFields[arr[0]] = arr[1]); } //run custom onload function if available if (appFields['imceload'] && (func = isFunc(appFields['imceload']))) { func(win); delete appFields['imceload']; } //set custom sendto function. appFinish is the default. var sendtoFunc = appFields['url'] ? appFinish : false; //check sendto@funcName syntax in URL if (appFields['sendto'] && (func = isFunc(appFields['sendto']))) { sendtoFunc = func; delete appFields['sendto']; } //check windowname+ImceFinish. old method else if (win.name && (func = isFunc(win.name +'ImceFinish'))) { sendtoFunc = func; } //highlight file if (appFields['url']) { if (appFields['url'].indexOf(',') > -1) {//support multiple url fields url@field1,field2.. var arr = appFields['url'].split(','); for (var i in arr) { if ($('#'+ arr[i], appWindow.document).size()) { appFields['url'] = arr[i]; break; } } } var filename = $('#'+ appFields['url'], appWindow.document).val(); imce.highlight(filename.substr(filename.lastIndexOf('/')+1)); } //set send to sendtoFunc && imce.setSendTo(Drupal.t('Insert file'), sendtoFunc);});//sendTo functionvar appFinish = function(file, win) { var $doc = $(appWindow.document); for (var i in appFields) { $doc.find('#'+ appFields[i]).val(file[i]); } if (appFields['url']) { try{ $doc.find('#'+ appFields['url']).blur().change().focus(); }catch(e){ try{ $doc.find('#'+ appFields['url']).trigger('onblur').trigger('onchange').trigger('onfocus');//inline events for IE }catch(e){} } } appWindow.focus(); win.close();};//checks if a string is a function name in the given scope. returns function reference. supports x.y.z notation.var isFunc = function(str, scope) { var obj = scope || appWindow; var parts = str.split('.'), len = parts.length; for (var i = 0; i < len && (obj = obj[parts[i]]); i++); return obj && i == len && (typeof obj == 'function' || typeof obj != 'string' && !obj.nodeName && obj.constructor != Array && /^[\s[]?function/.test(obj.toString())) ? obj : false;}})(jQuery);
|
authorurl : 'http: infourl : 'http: version : "0.3"
|
authorurl : 'http: infourl : 'http: version : "0.6"
|
(function() { // Load plugin specific language pack tinymce.PluginManager.requireLangPack('photonav'); tinymce.create('tinymce.plugins.PhotoNav', { /** * Initializes the plugin, this will be executed after the plugin has been created. * This call is done before the editor instance has finished it's initialization so use the onInit event * of the editor instance to intercept that event. * * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. * @param {string} url Absolute URL to where the plugin is located. */ init : function(ed, url) { // Register wp-photonav button ed.addButton('add_photonav', { title : 'photonav.add_photonav', image : url + '/media-button-fullscreen.gif', onclick : function() { tb_show('', tinymce.DOM.get('add_photonav').href); tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); } }); // Add a node change handler, selects the button in the UI when a image is selected ed.onNodeChange.add(function(ed, cm, n) { // cm.setActive('photonav', n.nodeName == 'IMG'); }); // Add Media button to fullscreen ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) { if ( 'mceFullScreen' != cmd ) return; if ( 'mce_fullscreen' != ed.id ) ed.settings.theme_advanced_buttons1 += ',|,add_photonav'; }); }, /** * Creates control instances based in the incomming name. This method is normally not * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons * but you sometimes need to create more complex controls like listboxes, split buttons etc then this * method can be used to create those. * * @param {String} n Name of the control to create. * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control. * @return {tinymce.ui.Control} New control instance or null if no control was created. */ createControl : function(n, cm) { return null; }, /** * Returns information about the plugin as a name/value array. * The current keys are longname, author, authorurl, infourl and version. * * @return {Object} Name/value array containing information about the plugin. */ getInfo : function() { return { longname : 'WP-PhotoNav plugin', author : 'Fabian Moser', authorurl : 'http://fabianmoser.at', infourl : 'http://fabianmoser.at/wp-photonav', version : "0.3" }; } }); // Register plugin tinymce.PluginManager.add('photonav', tinymce.plugins.PhotoNav);})();
|
this.loadMask.hide();
|
ExperimentalDesignController.getExperimentalFactors(this.expressionExperiment, function(factorData) { config = { factors : factorData, bioMaterials : data }; Ext.apply(config, this.originalConfig); this.grid = new Gemma.BioMaterialGrid(config); this.grid.init = this.init.createDelegate(this); }.createDelegate(this));
|
|
Drupal.behaviors.vbo = function(context) { window.onunload = function(){}
|
Drupal.behaviors.vbo = { attach: function(context) { window.onunload = function(){}
|
(function ($) {// START jQueryDrupal.vbo = Drupal.vbo || {};Drupal.vbo.selectAll = function() { var table = this; var form = $(table).parents('form'); var select = $('th.select-all', table).click(function() { setSelectAll(false); }); $('input#vbo-select-all-pages', table).click(function() { setSelectAll(true); }); $('input#vbo-select-this-page', table).click(function() { setSelectAll(false); }); var checkboxes = $('td input:checkbox', table).click(function() { if (checkboxes.length > $(checkboxes).filter(':checked').length) { $('input#edit-objects-select-all', form).val(0); } setSelectAll($('input#edit-objects-select-all', form).val() == 1); }).each(function() { $(this).parents('tr:first')[ this.checked ? 'addClass' : 'removeClass' ]('selected'); }); var setSelectAll = function(all) { $('input#edit-objects-select-all', form).val(all ? 1 : 0); $('th.select-all input:checkbox', table).each(function() { if (this.checked) { $('td.view-field-select-all', table).css('display', $.browser.msie ? 'inline-block' : 'table-cell'); $('span#vbo-this-page', table).css('display', all ? 'none' : 'inline'); $('span#vbo-all-pages', table).css('display', all ? 'inline' : 'none'); } else { $('td.view-field-select-all', table).css('display', 'none'); } }); } var strings = { 'selectAll': Drupal.t('Select all rows in this table'), 'selectNone': Drupal.t('Deselect all rows in this table') }; var updateSelectAll = function(state) { $('th.select-all input:checkbox', table).each(function() { $(this).attr('title', state ? strings.selectNone : strings.selectAll); this.checked = state; setSelectAll($('input#edit-objects-select-all', form).val() == 1); }); }; // Update UI based on initial values. updateSelectAll(checkboxes.length == $(checkboxes).filter(':checked').length);}Drupal.vbo.startUp = function(context) { // Reset the form action that Views Ajax might destroy. $('form[id^=views-bulk-operations-form]').each(function() { $(this).attr('action', Drupal.settings.vbo.url); }); // Set up the VBO table for select-all functionality. $('form table:has(th.select-all)', context).each(this.selectAll); // Set up the ability to click anywhere on the row to select it. $('tr.rowclick', context).click(function(event) { if (event.target.tagName.toLowerCase() != 'input' && event.target.tagName.toLowerCase() != 'a') { $(':checkbox', this).each(function() { var checked = this.checked; // trigger() toggles the checkmark *after* the event is set, // whereas manually clicking the checkbox toggles it *beforehand*. // that's why we manually set the checkmark first, then trigger the // event (so that listeners get notified), then re-set the checkmark // which the trigger will have toggled. yuck! this.checked = !checked; $(this).trigger('click'); this.checked = !checked; }); } });}Drupal.behaviors.vbo = function(context) { // Force Firefox to reload the page if Back is hit. // https://developer.mozilla.org/en/Using_Firefox_1.5_caching window.onunload = function(){} // Set up VBO UI. Drupal.vbo.startUp(context);}// END jQuery})(jQuery);
|
Drupal.vbo.startUp(context);
|
Drupal.vbo.startUp(context); }
|
(function ($) {// START jQueryDrupal.vbo = Drupal.vbo || {};Drupal.vbo.selectAll = function() { var table = this; var form = $(table).parents('form'); var select = $('th.select-all', table).click(function() { setSelectAll(false); }); $('input#vbo-select-all-pages', table).click(function() { setSelectAll(true); }); $('input#vbo-select-this-page', table).click(function() { setSelectAll(false); }); var checkboxes = $('td input:checkbox', table).click(function() { if (checkboxes.length > $(checkboxes).filter(':checked').length) { $('input#edit-objects-select-all', form).val(0); } setSelectAll($('input#edit-objects-select-all', form).val() == 1); }).each(function() { $(this).parents('tr:first')[ this.checked ? 'addClass' : 'removeClass' ]('selected'); }); var setSelectAll = function(all) { $('input#edit-objects-select-all', form).val(all ? 1 : 0); $('th.select-all input:checkbox', table).each(function() { if (this.checked) { $('td.view-field-select-all', table).css('display', $.browser.msie ? 'inline-block' : 'table-cell'); $('span#vbo-this-page', table).css('display', all ? 'none' : 'inline'); $('span#vbo-all-pages', table).css('display', all ? 'inline' : 'none'); } else { $('td.view-field-select-all', table).css('display', 'none'); } }); } var strings = { 'selectAll': Drupal.t('Select all rows in this table'), 'selectNone': Drupal.t('Deselect all rows in this table') }; var updateSelectAll = function(state) { $('th.select-all input:checkbox', table).each(function() { $(this).attr('title', state ? strings.selectNone : strings.selectAll); this.checked = state; setSelectAll($('input#edit-objects-select-all', form).val() == 1); }); }; // Update UI based on initial values. updateSelectAll(checkboxes.length == $(checkboxes).filter(':checked').length);}Drupal.vbo.startUp = function(context) { // Reset the form action that Views Ajax might destroy. $('form[id^=views-bulk-operations-form]').each(function() { $(this).attr('action', Drupal.settings.vbo.url); }); // Set up the VBO table for select-all functionality. $('form table:has(th.select-all)', context).each(this.selectAll); // Set up the ability to click anywhere on the row to select it. $('tr.rowclick', context).click(function(event) { if (event.target.tagName.toLowerCase() != 'input' && event.target.tagName.toLowerCase() != 'a') { $(':checkbox', this).each(function() { var checked = this.checked; // trigger() toggles the checkmark *after* the event is set, // whereas manually clicking the checkbox toggles it *beforehand*. // that's why we manually set the checkmark first, then trigger the // event (so that listeners get notified), then re-set the checkmark // which the trigger will have toggled. yuck! this.checked = !checked; $(this).trigger('click'); this.checked = !checked; }); } });}Drupal.behaviors.vbo = function(context) { // Force Firefox to reload the page if Back is hit. // https://developer.mozilla.org/en/Using_Firefox_1.5_caching window.onunload = function(){} // Set up VBO UI. Drupal.vbo.startUp(context);}// END jQuery})(jQuery);
|
return __method.apply(object, args.concat(arguments) ); }
|
return method.apply(object, args.concat(Array.prototype.slice.call(arguments,0)) ); }
|
return function() { return __method.apply(object, args.concat(arguments) ); }
|
this.on("select", function(combo, record, index) { this.selectedTerm = record.data;
|
this.on("change", function(combo) { if (this.getValue()) { var ix = this.getStore().find("term", this.getValue()); var rec = this.getStore().getAt(ix); this.select(ix, true); this.fireEvent('select', this, rec, ix); }
|
this.on("select", function(combo, record, index) { this.selectedTerm = record.data; });
|
if (onSuccessFn) onSuccessFn(r.getResult().Result);
|
if (onSuccessFn) onSuccessFn(r.Result);
|
function(r) { if (onSuccessFn) onSuccessFn(r.getResult().Result); },
|
test('Strings', function(){ equals(console.dir('Hello!'), '"Hello!"'); equals(console.dir(new String('Hello!')), '"Hello!"'); equals(console.dir("Either the well was very deep, or she fell very slowly, for she had plenty of time as \n\ she went down to look about her and to wonder what was going to happen next. First, she tried to look down and \n\ make out what she was coming to, but it was too dark to see anything; then she looked at the sides of the well, \n\ and noticed that they were filled with cupboards and book-shelves; here and there she saw maps and pictures hung \n\ upon pegs. She took down a jar from one of the shelves as she passed; it was labelled `ORANGE MARMALADE', but to \n\ her great disappointment it was empty: she did not like to drop the jar for fear of killing somebody, so managed \n\ to put it into one of the cupboards as she fell past it."), '"Either the well was very deep, or she fell very slowly, for she had plenty of time as \n\ she went down to look about her and to wonder what was going to happen next. First, she tried to look down and \n\ make out what she was coming to, but it was too dark to see anything; then she looked at the sides of the well, \n\ and noticed that they were filled with cupboards and book-shelves; here and there she saw maps and pictures hung \n\ upon pegs. She took down a jar from one of the shelves as she passed; it was labelled `ORANGE MARMALADE\', but to \n\ her great disappointment it was empty: she did not like to drop the jar for fear of killing somebody, so managed \n\ to put it into one of the cupboards as she fell past it."' ); equals(console.dir(" "), '" "');
|
test('Boolean', function(){ equals(console.dir(true), 'true'); equals(console.dir(false), 'false'); equals(console.dir(new Boolean(false)), 'Boolean false {}'); equals(console.dir(new Boolean(true)), 'Boolean true {}');
|
test('Strings', function(){ equals(console.dir('Hello!'), '"Hello!"'); equals(console.dir(new String('Hello!')), '"Hello!"'); equals(console.dir("Either the well was very deep, or she fell very slowly, for she had plenty of time as \n\ she went down to look about her and to wonder what was going to happen next. First, she tried to look down and \n\ make out what she was coming to, but it was too dark to see anything; then she looked at the sides of the well, \n\ and noticed that they were filled with cupboards and book-shelves; here and there she saw maps and pictures hung \n\ upon pegs. She took down a jar from one of the shelves as she passed; it was labelled `ORANGE MARMALADE', but to \n\ her great disappointment it was empty: she did not like to drop the jar for fear of killing somebody, so managed \n\ to put it into one of the cupboards as she fell past it."), '"Either the well was very deep, or she fell very slowly, for she had plenty of time as \n\ she went down to look about her and to wonder what was going to happen next. First, she tried to look down and \n\ make out what she was coming to, but it was too dark to see anything; then she looked at the sides of the well, \n\ and noticed that they were filled with cupboards and book-shelves; here and there she saw maps and pictures hung \n\ upon pegs. She took down a jar from one of the shelves as she passed; it was labelled `ORANGE MARMALADE\', but to \n\ her great disappointment it was empty: she did not like to drop the jar for fear of killing somebody, so managed \n\ to put it into one of the cupboards as she fell past it."' ); equals(console.dir(" "), '" "');});
|
(function() { var each = tinymce.each; tinymce.create('tinymce.plugins.MediaPlugin', { init : function(ed, url) { var t = this; t.editor = ed; t.url = url; function isMediaElm(n) { return /^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(n.className); }; ed.onPreInit.add(function() { ed.serializer.addRules('param[name|value|_mce_value]'); }); ed.addCommand('mceMedia', function() { ed.windowManager.open({ file : url + '/media.htm', width : 430 + parseInt(ed.getLang('media.delta_width', 0)), height : 470 + parseInt(ed.getLang('media.delta_height', 0)), inline : 1 }, { plugin_url : url }); }); ed.addButton('media', {title : 'media.desc', cmd : 'mceMedia'}); ed.onNodeChange.add(function(ed, cm, n) { cm.setActive('media', n.nodeName == 'IMG' && isMediaElm(n)); }); ed.onInit.add(function() { var lo = { mceItemFlash : 'flash', mceItemShockWave : 'shockwave', mceItemWindowsMedia : 'windowsmedia', mceItemQuickTime : 'quicktime', mceItemRealMedia : 'realmedia' }; ed.selection.onSetContent.add(function() { t._spansToImgs(ed.getBody()); }); ed.selection.onBeforeSetContent.add(t._objectsToSpans, t); if (ed.settings.content_css !== false) ed.dom.loadCSS(url + "/css/content.css"); if (ed.theme && ed.theme.onResolveName) { ed.theme.onResolveName.add(function(th, o) { if (o.name == 'img') { each(lo, function(v, k) { if (ed.dom.hasClass(o.node, k)) { o.name = v; o.title = ed.dom.getAttrib(o.node, 'title'); return false; } }); } }); } if (ed && ed.plugins.contextmenu) { ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) { if (e.nodeName == 'IMG' && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(e.className)) { m.add({title : 'media.edit', icon : 'media', cmd : 'mceMedia'}); } }); } }); ed.onBeforeSetContent.add(t._objectsToSpans, t); ed.onSetContent.add(function() { t._spansToImgs(ed.getBody()); }); ed.onPreProcess.add(function(ed, o) { var dom = ed.dom; if (o.set) { t._spansToImgs(o.node); each(dom.select('IMG', o.node), function(n) { var p; if (isMediaElm(n)) { p = t._parse(n.title); dom.setAttrib(n, 'width', dom.getAttrib(n, 'width', p.width || 100)); dom.setAttrib(n, 'height', dom.getAttrib(n, 'height', p.height || 100)); } }); } if (o.get) { each(dom.select('IMG', o.node), function(n) { var ci, cb, mt; if (ed.getParam('media_use_script')) { if (isMediaElm(n)) n.className = n.className.replace(/mceItem/g, 'mceTemp'); return; } switch (n.className) { case 'mceItemFlash': ci = 'd27cdb6e-ae6d-11cf-96b8-444553540000'; cb = 'http: mt = 'application/x-shockwave-flash'; break; case 'mceItemShockWave': ci = '166b1bca-3f9c-11cf-8075-444553540000'; cb = 'http: mt = 'application/x-director'; break; case 'mceItemWindowsMedia': ci = ed.getParam('media_wmp6_compatible') ? '05589fa1-c356-11ce-bf01-00aa0055595a' : '6bf52a52-394a-11d3-b153-00c04f79faa6'; cb = 'http: mt = 'application/x-mplayer2'; break; case 'mceItemQuickTime': ci = '02bf25d5-8c17-4b23-bc80-d3488abddc6b'; cb = 'http: mt = 'video/quicktime'; break; case 'mceItemRealMedia': ci = 'cfcdaa03-8be4-11cf-b84b-0020afbbccfa'; cb = 'http: mt = 'audio/x-pn-realaudio-plugin'; break; } if (ci) { dom.replace(t._buildObj({ classid : ci, codebase : cb, type : mt }, n), n); } }); } }); ed.onPostProcess.add(function(ed, o) { o.content = o.content.replace(/_mce_value=/g, 'value='); }); function getAttr(s, n) { n = new RegExp(n + '=\"([^\"]+)\"', 'g').exec(s); return n ? ed.dom.decode(n[1]) : ''; }; ed.onPostProcess.add(function(ed, o) { if (ed.getParam('media_use_script')) { o.content = o.content.replace(/<img[^>]+>/g, function(im) { var cl = getAttr(im, 'class'); if (/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(cl)) { at = t._parse(getAttr(im, 'title')); at.width = getAttr(im, 'width'); at.height = getAttr(im, 'height'); im = '<script type="text/javascript">write' + cl.substring(7) + '({' + t._serialize(at) + '});</script>'; } return im; }); } }); }, getInfo : function() { return { longname : 'Media', author : 'Moxiecode Systems AB', authorurl : 'http: infourl : 'http: version : tinymce.majorVersion + "." + tinymce.minorVersion }; }, _objectsToSpans : function(ed, o) { var t = this, h = o.content; h = h.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi, function(a, b, c) { var o = t._parse(c); return '<img class="mceItem' + b + '" title="' + ed.dom.encode(c) + '" src="' + t.url + '/img/trans.gif" width="' + o.width + '" height="' + o.height + '" />' }); h = h.replace(/<object([^>]*)>/gi, '<span class="mceItemObject" $1>'); h = h.replace(/<embed([^>]*)\/?>/gi, '<span class="mceItemEmbed" $1></span>'); h = h.replace(/<embed([^>]*)>/gi, '<span class="mceItemEmbed" $1>'); h = h.replace(/<\/(object)([^>]*)>/gi, '</span>'); h = h.replace(/<\/embed>/gi, ''); h = h.replace(/<param([^>]*)>/gi, function(a, b) {return '<span ' + b.replace(/value=/gi, '_mce_value=') + ' class="mceItemParam"></span>'}); h = h.replace(/\/ class=\"mceItemParam\"><\/span>/gi, 'class="mceItemParam"></span>'); o.content = h; }, _buildObj : function(o, n) { var ob, ed = this.editor, dom = ed.dom, p = this._parse(n.title), stc; stc = ed.getParam('media_strict', true) && o.type == 'application/x-shockwave-flash'; p.width = o.width = dom.getAttrib(n, 'width') || 100; p.height = o.height = dom.getAttrib(n, 'height') || 100; if (p.src) p.src = ed.convertURL(p.src, 'src', n); if (stc) { ob = dom.create('span', { id : p.id, mce_name : 'object', type : 'application/x-shockwave-flash', data : p.src, style : dom.getAttrib(n, 'style'), width : o.width, height : o.height }); } else { ob = dom.create('span', { id : p.id, mce_name : 'object', classid : "clsid:" + o.classid, style : dom.getAttrib(n, 'style'), codebase : o.codebase, width : o.width, height : o.height }); } each (p, function(v, k) { if (!/^(width|height|codebase|classid|id|_cx|_cy)$/.test(k)) { if (o.type == 'application/x-mplayer2' && k == 'src' && !p.url) k = 'url'; if (v) dom.add(ob, 'span', {mce_name : 'param', name : k, '_mce_value' : v}); } }); if (!stc) dom.add(ob, 'span', tinymce.extend({mce_name : 'embed', type : o.type, style : dom.getAttrib(n, 'style')}, p)); return ob; }, _spansToImgs : function(p) { var t = this, dom = t.editor.dom, im, ci; each(dom.select('span', p), function(n) { if (dom.getAttrib(n, 'class') == 'mceItemObject') { ci = dom.getAttrib(n, "classid").toLowerCase().replace(/\s+/g, ''); switch (ci) { case 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000': dom.replace(t._createImg('mceItemFlash', n), n); break; case 'clsid:166b1bca-3f9c-11cf-8075-444553540000': dom.replace(t._createImg('mceItemShockWave', n), n); break; case 'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6': case 'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95': case 'clsid:05589fa1-c356-11ce-bf01-00aa0055595a': dom.replace(t._createImg('mceItemWindowsMedia', n), n); break; case 'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b': dom.replace(t._createImg('mceItemQuickTime', n), n); break; case 'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa': dom.replace(t._createImg('mceItemRealMedia', n), n); break; default: dom.replace(t._createImg('mceItemFlash', n), n); } return; } if (dom.getAttrib(n, 'class') == 'mceItemEmbed') { switch (dom.getAttrib(n, 'type')) { case 'application/x-shockwave-flash': dom.replace(t._createImg('mceItemFlash', n), n); break; case 'application/x-director': dom.replace(t._createImg('mceItemShockWave', n), n); break; case 'application/x-mplayer2': dom.replace(t._createImg('mceItemWindowsMedia', n), n); break; case 'video/quicktime': dom.replace(t._createImg('mceItemQuickTime', n), n); break; case 'audio/x-pn-realaudio-plugin': dom.replace(t._createImg('mceItemRealMedia', n), n); break; default: dom.replace(t._createImg('mceItemFlash', n), n); } } }); }, _createImg : function(cl, n) { var im, dom = this.editor.dom, pa = {}, ti = '', args; args = ['id', 'name', 'width', 'height', 'bgcolor', 'align', 'flashvars', 'src', 'wmode', 'allowfullscreen', 'quality', 'data']; im = dom.create('img', { src : this.url + '/img/trans.gif', width : dom.getAttrib(n, 'width') || 100, height : dom.getAttrib(n, 'height') || 100, style : dom.getAttrib(n, 'style'), 'class' : cl }); each(args, function(na) { var v = dom.getAttrib(n, na); if (v) pa[na] = v; }); each(dom.select('span', n), function(n) { if (dom.hasClass(n, 'mceItemParam')) pa[dom.getAttrib(n, 'name')] = dom.getAttrib(n, '_mce_value'); }); if (pa.movie) { pa.src = pa.movie; delete pa.movie; } if (!pa.src) { pa.src = pa.data; delete pa.data; } n = dom.select('.mceItemEmbed', n)[0]; if (n) { each(args, function(na) { var v = dom.getAttrib(n, na); if (v && !pa[na]) pa[na] = v; }); } delete pa.width; delete pa.height; im.title = this._serialize(pa); return im; }, _parse : function(s) { return tinymce.util.JSON.parse('{' + s + '}'); }, _serialize : function(o) { return tinymce.util.JSON.serialize(o).replace(/[{}]/g, ''); } }); tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin); })();
|
if(!dojo._hasResource["dijit.Dialog"]){dojo._hasResource["dijit.Dialog"]=true;dojo.provide("dijit.Dialog");dojo.require("dojo.dnd.move");dojo.require("dojo.dnd.TimedMoveable");dojo.require("dojo.fx");dojo.require("dijit._Widget");dojo.require("dijit._Templated");dojo.require("dijit.layout.ContentPane");dojo.require("dijit.form.Form");dojo.requireLocalization("dijit","common",null,"ar,ca,ROOT,cs,da,de,el,es,fi,fr,he,hu,it,ja,ko,nb,nl,pl,pt,pt-pt,ru,sk,sl,sv,th,tr,zh,zh-tw");dojo.declare("dijit.DialogUnderlay",[dijit._Widget,dijit._Templated],{templateString:"<div class='dijitDialogUnderlayWrapper' id='${id}_wrapper'><div class='dijitDialogUnderlay ${class}' id='${id}' dojoAttachPoint='node'></div></div>",attributeMap:{},postCreate:function(){dojo.body().appendChild(this.domNode);this.bgIframe=new dijit.BackgroundIframe(this.domNode);},layout:function(){var _1=dijit.getViewport();var is=this.node.style,os=this.domNode.style;os.top=_1.t+"px";os.left=_1.l+"px";is.width=_1.w+"px";is.height=_1.h+"px";var _4=dijit.getViewport();if(_1.w!=_4.w){is.width=_4.w+"px";}if(_1.h!=_4.h){is.height=_4.h+"px";}},show:function(){this.domNode.style.display="block";this.layout();if(this.bgIframe.iframe){this.bgIframe.iframe.style.display="block";}},hide:function(){this.domNode.style.display="none";if(this.bgIframe.iframe){this.bgIframe.iframe.style.display="none";}},uninitialize:function(){if(this.bgIframe){this.bgIframe.destroy();}}});dojo.declare("dijit._DialogMixin",null,{attributeMap:dijit._Widget.prototype.attributeMap,execute:function(_5){},onCancel:function(){},onExecute:function(){},_onSubmit:function(){this.onExecute();this.execute(this.attr("value"));},_getFocusItems:function(_6){var _7=dijit._getTabNavigable(dojo.byId(_6));this._firstFocusItem=_7.lowest||_7.first||_6;this._lastFocusItem=_7.last||_7.highest||this._firstFocusItem;if(dojo.isMoz&&this._firstFocusItem.tagName.toLowerCase()=="input"&&dojo.attr(this._firstFocusItem,"type").toLowerCase()=="file"){dojo.attr(_6,"tabindex","0");this._firstFocusItem=_6;}}});dojo.declare("dijit.Dialog",[dijit.layout.ContentPane,dijit._Templated,dijit.form._FormMixin,dijit._DialogMixin],{templateString:null,templateString:"<div class=\"dijitDialog\" tabindex=\"-1\" waiRole=\"dialog\" waiState=\"labelledby-${id}_title\">\n\t<div dojoAttachPoint=\"titleBar\" class=\"dijitDialogTitleBar\">\n\t<span dojoAttachPoint=\"titleNode\" class=\"dijitDialogTitle\" id=\"${id}_title\"></span>\n\t<span dojoAttachPoint=\"closeButtonNode\" class=\"dijitDialogCloseIcon\" dojoAttachEvent=\"onclick: onCancel\" title=\"${buttonCancel}\">\n\t\t<span dojoAttachPoint=\"closeText\" class=\"closeText\" title=\"${buttonCancel}\">x</span>\n\t</span>\n\t</div>\n\t\t<div dojoAttachPoint=\"containerNode\" class=\"dijitDialogPaneContent\"></div>\n</div>\n",attributeMap:dojo.mixin(dojo.clone(dijit._Widget.prototype.attributeMap),{title:[{node:"titleNode",type:"innerHTML"},{node:"titleBar",type:"attribute"}]}),open:false,duration:dijit.defaultDuration,refocus:true,autofocus:true,_firstFocusItem:null,_lastFocusItem:null,doLayout:false,draggable:true,postMixInProperties:function(){var _8=dojo.i18n.getLocalization("dijit","common");dojo.mixin(this,_8);this.inherited(arguments);},postCreate:function(){var s=this.domNode.style;s.visibility="hidden";s.position="absolute";s.display="";s.top="-9999px";dojo.body().appendChild(this.domNode);this.inherited(arguments);this.connect(this,"onExecute","hide");this.connect(this,"onCancel","hide");this._modalconnects=[];},onLoad:function(){this._position();this.inherited(arguments);},_endDrag:function(e){if(e&&e.node&&e.node===this.domNode){var vp=dijit.getViewport();var p=e._leftTop||dojo.coords(e.node,true);this._relativePosition={t:p.t-vp.t,l:p.l-vp.l};}},_setup:function(){var _d=this.domNode;if(this.titleBar&&this.draggable){this._moveable=(dojo.isIE==6)?new dojo.dnd.TimedMoveable(_d,{handle:this.titleBar}):new dojo.dnd.Moveable(_d,{handle:this.titleBar,timeout:0});dojo.subscribe("/dnd/move/stop",this,"_endDrag");}else{dojo.addClass(_d,"dijitDialogFixed");}this._underlay=new dijit.DialogUnderlay({id:this.id+"_underlay","class":dojo.map(this["class"].split(/\s/),function(s){return s+"_underlay";}).join(" ")});var _f=this._underlay;this._fadeIn=dojo.fadeIn({node:_d,duration:this.duration,onBegin:dojo.hitch(_f,"show")});this._fadeOut=dojo.fadeOut({node:_d,duration:this.duration,onEnd:function(){_d.style.visibility="hidden";_d.style.top="-9999px";_f.hide();}});},uninitialize:function(){if(this._fadeIn&&this._fadeIn.status()=="playing"){this._fadeIn.stop();}if(this._fadeOut&&this._fadeOut.status()=="playing"){this._fadeOut.stop();}if(this._underlay){this._underlay.destroy();}if(this._moveable){this._moveable.destroy();}},_size:function(){var mb=dojo.marginBox(this.domNode);var _11=dijit.getViewport();if(mb.w>=_11.w||mb.h>=_11.h){dojo.style(this.containerNode,{width:Math.min(mb.w,Math.floor(_11.w*0.75))+"px",height:Math.min(mb.h,Math.floor(_11.h*0.75))+"px",overflow:"auto",position:"relative"});}},_position:function(){if(!dojo.hasClass(dojo.body(),"dojoMove")){var _12=this.domNode;var _13=dijit.getViewport();var p=this._relativePosition;var mb=p?null:dojo.marginBox(_12);dojo.style(_12,{left:Math.floor(_13.l+(p?p.l:(_13.w-mb.w)/2))+"px",top:Math.floor(_13.t+(p?p.t:(_13.h-mb.h)/2))+"px"});}},_onKey:function(evt){if(evt.charOrCode){var dk=dojo.keys;var _18=evt.target;if(evt.charOrCode===dk.TAB){this._getFocusItems(this.domNode);}var _19=(this._firstFocusItem==this._lastFocusItem);if(_18==this._firstFocusItem&&evt.shiftKey&&evt.charOrCode===dk.TAB){if(!_19){dijit.focus(this._lastFocusItem);}dojo.stopEvent(evt);}else{if(_18==this._lastFocusItem&&evt.charOrCode===dk.TAB&&!evt.shiftKey){if(!_19){dijit.focus(this._firstFocusItem);}dojo.stopEvent(evt);}else{while(_18){if(_18==this.domNode){if(evt.charOrCode==dk.ESCAPE){this.onCancel();}else{return;}}_18=_18.parentNode;}if(evt.charOrCode!==dk.TAB){dojo.stopEvent(evt);}else{if(!dojo.isOpera){try{this._firstFocusItem.focus();}catch(e){}}}}}}},show:function(){if(this.open){return;}if(!this._alreadyInitialized){this._setup();this._alreadyInitialized=true;}if(this._fadeOut.status()=="playing"){this._fadeOut.stop();}this._modalconnects.push(dojo.connect(window,"onscroll",this,"layout"));this._modalconnects.push(dojo.connect(window,"onresize",this,"layout"));this._modalconnects.push(dojo.connect(dojo.doc.documentElement,"onkeypress",this,"_onKey"));dojo.style(this.domNode,{opacity:0,visibility:""});this.open=true;this._loadCheck();this._size();this._position();this._fadeIn.play();this._savedFocus=dijit.getFocus(this);if(this.autofocus){this._getFocusItems(this.domNode);setTimeout(dojo.hitch(dijit,"focus",this._firstFocusItem),50);}},hide:function(){if(!this._alreadyInitialized){return;}if(this._fadeIn.status()=="playing"){this._fadeIn.stop();}this._fadeOut.play();if(this._scrollConnected){this._scrollConnected=false;}dojo.forEach(this._modalconnects,dojo.disconnect);this._modalconnects=[];if(this.refocus){this.connect(this._fadeOut,"onEnd",dojo.hitch(dijit,"focus",this._savedFocus));}if(this._relativePosition){delete this._relativePosition;}this.open=false;},layout:function(){if(this.domNode.style.visibility!="hidden"){this._underlay.layout();this._position();}},destroy:function(){dojo.forEach(this._modalconnects,dojo.disconnect);if(this.refocus&&this.open){setTimeout(dojo.hitch(dijit,"focus",this._savedFocus),25);}this.inherited(arguments);}});dojo.declare("dijit.TooltipDialog",[dijit.layout.ContentPane,dijit._Templated,dijit.form._FormMixin,dijit._DialogMixin],{title:"",doLayout:false,autofocus:true,"class":"dijitTooltipDialog",_firstFocusItem:null,_lastFocusItem:null,templateString:null,templateString:"<div waiRole=\"presentation\">\n\t<div class=\"dijitTooltipContainer\" waiRole=\"presentation\">\n\t\t<div class =\"dijitTooltipContents dijitTooltipFocusNode\" dojoAttachPoint=\"containerNode\" tabindex=\"-1\" waiRole=\"dialog\"></div>\n\t</div>\n\t<div class=\"dijitTooltipConnector\" waiRole=\"presentation\"></div>\n</div>\n",postCreate:function(){this.inherited(arguments);this.connect(this.containerNode,"onkeypress","_onKey");this.containerNode.title=this.title;},orient:function(_1a,_1b,_1c){this.domNode.className=this["class"]+" dijitTooltipAB"+(_1c.charAt(1)=="L"?"Left":"Right")+" dijitTooltip"+(_1c.charAt(0)=="T"?"Below":"Above");},onOpen:function(pos){this.orient(this.domNode,pos.aroundCorner,pos.corner);this._loadCheck();if(this.autofocus){this._getFocusItems(this.containerNode);dijit.focus(this._firstFocusItem);}},_onKey:function(evt){var _1f=evt.target;var dk=dojo.keys;if(evt.charOrCode===dk.TAB){this._getFocusItems(this.containerNode);}var _21=(this._firstFocusItem==this._lastFocusItem);if(evt.charOrCode==dk.ESCAPE){this.onCancel();dojo.stopEvent(evt);}else{if(_1f==this._firstFocusItem&&evt.shiftKey&&evt.charOrCode===dk.TAB){if(!_21){dijit.focus(this._lastFocusItem);}dojo.stopEvent(evt);}else{if(_1f==this._lastFocusItem&&evt.charOrCode===dk.TAB&&!evt.shiftKey){if(!_21){dijit.focus(this._firstFocusItem);}dojo.stopEvent(evt);}else{if(evt.charOrCode===dk.TAB){evt.stopPropagation();}}}}}});}
|
(function() { var each = tinymce.each; tinymce.create('tinymce.plugins.MediaPlugin', { init : function(ed, url) { var t = this; t.editor = ed; t.url = url; function isMediaElm(n) { return /^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(n.className); }; ed.onPreInit.add(function() { // Force in _value parameter this extra parameter is required for older Opera versions ed.serializer.addRules('param[name|value|_mce_value]'); }); // Register commands ed.addCommand('mceMedia', function() { ed.windowManager.open({ file : url + '/media.htm', width : 430 + parseInt(ed.getLang('media.delta_width', 0)), height : 470 + parseInt(ed.getLang('media.delta_height', 0)), inline : 1 }, { plugin_url : url }); }); // Register buttons ed.addButton('media', {title : 'media.desc', cmd : 'mceMedia'}); ed.onNodeChange.add(function(ed, cm, n) { cm.setActive('media', n.nodeName == 'IMG' && isMediaElm(n)); }); ed.onInit.add(function() { var lo = { mceItemFlash : 'flash', mceItemShockWave : 'shockwave', mceItemWindowsMedia : 'windowsmedia', mceItemQuickTime : 'quicktime', mceItemRealMedia : 'realmedia' }; ed.selection.onSetContent.add(function() { t._spansToImgs(ed.getBody()); }); ed.selection.onBeforeSetContent.add(t._objectsToSpans, t); if (ed.settings.content_css !== false) ed.dom.loadCSS(url + "/css/content.css"); if (ed.theme && ed.theme.onResolveName) { ed.theme.onResolveName.add(function(th, o) { if (o.name == 'img') { each(lo, function(v, k) { if (ed.dom.hasClass(o.node, k)) { o.name = v; o.title = ed.dom.getAttrib(o.node, 'title'); return false; } }); } }); } if (ed && ed.plugins.contextmenu) { ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) { if (e.nodeName == 'IMG' && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(e.className)) { m.add({title : 'media.edit', icon : 'media', cmd : 'mceMedia'}); } }); } }); ed.onBeforeSetContent.add(t._objectsToSpans, t); ed.onSetContent.add(function() { t._spansToImgs(ed.getBody()); }); ed.onPreProcess.add(function(ed, o) { var dom = ed.dom; if (o.set) { t._spansToImgs(o.node); each(dom.select('IMG', o.node), function(n) { var p; if (isMediaElm(n)) { p = t._parse(n.title); dom.setAttrib(n, 'width', dom.getAttrib(n, 'width', p.width || 100)); dom.setAttrib(n, 'height', dom.getAttrib(n, 'height', p.height || 100)); } }); } if (o.get) { each(dom.select('IMG', o.node), function(n) { var ci, cb, mt; if (ed.getParam('media_use_script')) { if (isMediaElm(n)) n.className = n.className.replace(/mceItem/g, 'mceTemp'); return; } switch (n.className) { case 'mceItemFlash': ci = 'd27cdb6e-ae6d-11cf-96b8-444553540000'; cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'; mt = 'application/x-shockwave-flash'; break; case 'mceItemShockWave': ci = '166b1bca-3f9c-11cf-8075-444553540000'; cb = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0'; mt = 'application/x-director'; break; case 'mceItemWindowsMedia': ci = ed.getParam('media_wmp6_compatible') ? '05589fa1-c356-11ce-bf01-00aa0055595a' : '6bf52a52-394a-11d3-b153-00c04f79faa6'; cb = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; mt = 'application/x-mplayer2'; break; case 'mceItemQuickTime': ci = '02bf25d5-8c17-4b23-bc80-d3488abddc6b'; cb = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0'; mt = 'video/quicktime'; break; case 'mceItemRealMedia': ci = 'cfcdaa03-8be4-11cf-b84b-0020afbbccfa'; cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'; mt = 'audio/x-pn-realaudio-plugin'; break; } if (ci) { dom.replace(t._buildObj({ classid : ci, codebase : cb, type : mt }, n), n); } }); } }); ed.onPostProcess.add(function(ed, o) { o.content = o.content.replace(/_mce_value=/g, 'value='); }); function getAttr(s, n) { n = new RegExp(n + '=\"([^\"]+)\"', 'g').exec(s); return n ? ed.dom.decode(n[1]) : ''; }; ed.onPostProcess.add(function(ed, o) { if (ed.getParam('media_use_script')) { o.content = o.content.replace(/<img[^>]+>/g, function(im) { var cl = getAttr(im, 'class'); if (/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(cl)) { at = t._parse(getAttr(im, 'title')); at.width = getAttr(im, 'width'); at.height = getAttr(im, 'height'); im = '<script type="text/javascript">write' + cl.substring(7) + '({' + t._serialize(at) + '});</script>'; } return im; }); } }); }, getInfo : function() { return { longname : 'Media', author : 'Moxiecode Systems AB', authorurl : 'http://tinymce.moxiecode.com', infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media', version : tinymce.majorVersion + "." + tinymce.minorVersion }; }, // Private methods _objectsToSpans : function(ed, o) { var t = this, h = o.content; h = h.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi, function(a, b, c) { var o = t._parse(c); return '<img class="mceItem' + b + '" title="' + ed.dom.encode(c) + '" src="' + t.url + '/img/trans.gif" width="' + o.width + '" height="' + o.height + '" />' }); h = h.replace(/<object([^>]*)>/gi, '<span class="mceItemObject" $1>'); h = h.replace(/<embed([^>]*)\/?>/gi, '<span class="mceItemEmbed" $1></span>'); h = h.replace(/<embed([^>]*)>/gi, '<span class="mceItemEmbed" $1>'); h = h.replace(/<\/(object)([^>]*)>/gi, '</span>'); h = h.replace(/<\/embed>/gi, ''); h = h.replace(/<param([^>]*)>/gi, function(a, b) {return '<span ' + b.replace(/value=/gi, '_mce_value=') + ' class="mceItemParam"></span>'}); h = h.replace(/\/ class=\"mceItemParam\"><\/span>/gi, 'class="mceItemParam"></span>'); o.content = h; }, _buildObj : function(o, n) { var ob, ed = this.editor, dom = ed.dom, p = this._parse(n.title), stc; stc = ed.getParam('media_strict', true) && o.type == 'application/x-shockwave-flash'; p.width = o.width = dom.getAttrib(n, 'width') || 100; p.height = o.height = dom.getAttrib(n, 'height') || 100; if (p.src) p.src = ed.convertURL(p.src, 'src', n); if (stc) { ob = dom.create('span', { id : p.id, mce_name : 'object', type : 'application/x-shockwave-flash', data : p.src, style : dom.getAttrib(n, 'style'), width : o.width, height : o.height }); } else { ob = dom.create('span', { id : p.id, mce_name : 'object', classid : "clsid:" + o.classid, style : dom.getAttrib(n, 'style'), codebase : o.codebase, width : o.width, height : o.height }); } each (p, function(v, k) { if (!/^(width|height|codebase|classid|id|_cx|_cy)$/.test(k)) { // Use url instead of src in IE for Windows media if (o.type == 'application/x-mplayer2' && k == 'src' && !p.url) k = 'url'; if (v) dom.add(ob, 'span', {mce_name : 'param', name : k, '_mce_value' : v}); } }); if (!stc) dom.add(ob, 'span', tinymce.extend({mce_name : 'embed', type : o.type, style : dom.getAttrib(n, 'style')}, p)); return ob; }, _spansToImgs : function(p) { var t = this, dom = t.editor.dom, im, ci; each(dom.select('span', p), function(n) { // Convert object into image if (dom.getAttrib(n, 'class') == 'mceItemObject') { ci = dom.getAttrib(n, "classid").toLowerCase().replace(/\s+/g, ''); switch (ci) { case 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000': dom.replace(t._createImg('mceItemFlash', n), n); break; case 'clsid:166b1bca-3f9c-11cf-8075-444553540000': dom.replace(t._createImg('mceItemShockWave', n), n); break; case 'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6': case 'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95': case 'clsid:05589fa1-c356-11ce-bf01-00aa0055595a': dom.replace(t._createImg('mceItemWindowsMedia', n), n); break; case 'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b': dom.replace(t._createImg('mceItemQuickTime', n), n); break; case 'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa': dom.replace(t._createImg('mceItemRealMedia', n), n); break; default: dom.replace(t._createImg('mceItemFlash', n), n); } return; } // Convert embed into image if (dom.getAttrib(n, 'class') == 'mceItemEmbed') { switch (dom.getAttrib(n, 'type')) { case 'application/x-shockwave-flash': dom.replace(t._createImg('mceItemFlash', n), n); break; case 'application/x-director': dom.replace(t._createImg('mceItemShockWave', n), n); break; case 'application/x-mplayer2': dom.replace(t._createImg('mceItemWindowsMedia', n), n); break; case 'video/quicktime': dom.replace(t._createImg('mceItemQuickTime', n), n); break; case 'audio/x-pn-realaudio-plugin': dom.replace(t._createImg('mceItemRealMedia', n), n); break; default: dom.replace(t._createImg('mceItemFlash', n), n); } } }); }, _createImg : function(cl, n) { var im, dom = this.editor.dom, pa = {}, ti = '', args; args = ['id', 'name', 'width', 'height', 'bgcolor', 'align', 'flashvars', 'src', 'wmode', 'allowfullscreen', 'quality', 'data']; // Create image im = dom.create('img', { src : this.url + '/img/trans.gif', width : dom.getAttrib(n, 'width') || 100, height : dom.getAttrib(n, 'height') || 100, style : dom.getAttrib(n, 'style'), 'class' : cl }); // Setup base parameters each(args, function(na) { var v = dom.getAttrib(n, na); if (v) pa[na] = v; }); // Add optional parameters each(dom.select('span', n), function(n) { if (dom.hasClass(n, 'mceItemParam')) pa[dom.getAttrib(n, 'name')] = dom.getAttrib(n, '_mce_value'); }); // Use src not movie if (pa.movie) { pa.src = pa.movie; delete pa.movie; } // No src try data if (!pa.src) { pa.src = pa.data; delete pa.data; } // Merge with embed args n = dom.select('.mceItemEmbed', n)[0]; if (n) { each(args, function(na) { var v = dom.getAttrib(n, na); if (v && !pa[na]) pa[na] = v; }); } delete pa.width; delete pa.height; im.title = this._serialize(pa); return im; }, _parse : function(s) { return tinymce.util.JSON.parse('{' + s + '}'); }, _serialize : function(o) { return tinymce.util.JSON.serialize(o).replace(/[{}]/g, ''); } }); // Register plugin tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin);})();
|
function(data){ $("#resourcesTable").html(data); renderToDataTable(); }, "text");
|
$(function() { $('#keyword-form').submit(function () { loadIndexTerms(); return false; }); initCollectionTree(); });
|
function(data){ $("#resourcesTable").html(data); renderToDataTable(); }, "text");
|
$('button[type=submit]').click(function(){ });
|
$(function() { // Keep forms from submitting more than once $('input[type=submit]').attr('disabled', false); $('input[type=reset]').attr('disabled', false); $('form').submit(function(){ $('input[type=submit]', this).attr('disabled', 'disabled'); $('input[type=reset]', this).attr('disabled', 'disabled'); }); $('button[type=submit]').click(function(){ }); // Main menu buttons and panels $('#top_nav > a').click(function(){ var menu_div = $(this).attr('href'); if($(this).hasClass('active') == false) { $('#menu-buttons > div.menu-scope-panel').fadeOut(); $('#top_nav > a').removeClass('active'); $(this).addClass('active'); $(menu_div).fadeIn(); } else { $(this).removeClass('active'); $(menu_div).fadeOut(); } return false; });});
|
|
$('.mini-list-click').click(function(){ $('.mini-list').fadeOut(); $('#top_nav > a').removeClass('active'); });
|
$(function() { // Keep forms from submitting more than once $('input[type=submit]').attr('disabled', false); $('input[type=reset]').attr('disabled', false); $('form').submit(function(){ $('input[type=submit]', this).attr('disabled', 'disabled'); $('input[type=reset]', this).attr('disabled', 'disabled'); }); $('button[type=submit]').click(function(){ }); // Main menu buttons and panels $('#top_nav > a').click(function(){ var menu_div = $(this).attr('href'); if($(this).hasClass('active') == false) { $('#menu-buttons > div.menu-scope-panel').fadeOut(); $('#top_nav > a').removeClass('active'); $(this).addClass('active'); $(menu_div).fadeIn(); } else { $(this).removeClass('active'); $(menu_div).fadeOut(); } return false; });});
|
|
this.executer = setInterval(function(){instances[myID].showNextElement()}, 300);
|
this.executer = setInterval(function(){instances[myID].showNextElement()}, this.interval);
|
this.executer = setInterval(function(){instances[myID].showNextElement()}, 300);
|
var input = $(that);
|
return this.each(function(){ var that = this; if (that.placeholder && 'placeholder' in document.createElement(that.tagName)) return; var default_color = that.style.color; var placeholder = that.getAttribute('placeholder'); if (that.value === '' || that.value == placeholder) { that.value = placeholder; that.style.color = color; } var input = $(that); input.focus(function(){ this.style.color = default_color; if (this.value == placeholder) { this.value = ''; } }); input.blur(function(){ if (this.value === '') { this.value = placeholder; this.style.color = color; } else { this.style.color = default_color; } }); that.form && $(that.form).submit(function(){ if (that.value == placeholder) { that.value = ''; } }); });
|
|
if (this.value == placeholder) {
|
if (input.data('placeholder-visible')) { input.data('placeholder-visible', false);
|
return this.each(function(){ var that = this; if (that.placeholder && 'placeholder' in document.createElement(that.tagName)) return; var default_color = that.style.color; var placeholder = that.getAttribute('placeholder'); if (that.value === '' || that.value == placeholder) { that.value = placeholder; that.style.color = color; } var input = $(that); input.focus(function(){ this.style.color = default_color; if (this.value == placeholder) { this.value = ''; } }); input.blur(function(){ if (this.value === '') { this.value = placeholder; this.style.color = color; } else { this.style.color = default_color; } }); that.form && $(that.form).submit(function(){ if (that.value == placeholder) { that.value = ''; } }); });
|
if (that.value == placeholder) {
|
if (input.data('placeholder-visible')) {
|
return this.each(function(){ var that = this; if (that.placeholder && 'placeholder' in document.createElement(that.tagName)) return; var default_color = that.style.color; var placeholder = that.getAttribute('placeholder'); if (that.value === '' || that.value == placeholder) { that.value = placeholder; that.style.color = color; } var input = $(that); input.focus(function(){ this.style.color = default_color; if (this.value == placeholder) { this.value = ''; } }); input.blur(function(){ if (this.value === '') { this.value = placeholder; this.style.color = color; } else { this.style.color = default_color; } }); that.form && $(that.form).submit(function(){ if (that.value == placeholder) { that.value = ''; } }); });
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.