rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
console.info(conf);
$.fn.lazyload = function(conf, all) { // return existing instance var el = this.data("lazyload"); if (el) { return el; } // loadOnScroll shortcut if (conf === true) { conf = {loadOnScroll: true, progress: null}; } // configuration conf = $.extend(true, {}, tool.conf, conf); console.info(conf); // construct loader el = new Loader(this, conf); this.data("lazyload", el); return conf.api ? el: this; };
$(self).one("appear",function(){if(!this.loaded){$("<img />").attr("src",$(self).attr("original")).bind("load",function(){$(self).hide().attr("src",$(self).attr("original")) [settings.effect](settings.effectspeed);self.loaded=true;});};});if("scroll"!=settings.event){$(self).bind(settings.event,function(event){if(!self.loaded){$(self).trigger("appear");}});}});};$.belowthefold=function(element,settings){var fold=$(window).height()+$(window).scrollTop();return fold<=$(element).offset().top-settings.threshold;};$.rightoffold=function(element,settings){var fold=$(window).width()+$(window).scrollLeft();return fold<=$(element).offset().left-settings.threshold;};$.extend($.expr[':'],{"below-the-fold":"$.belowthefold(a, {threshold : 0})","above-the-fold":"!$.belowthefold(a, {threshold : 0})","right-of-fold":"$.rightoffold(a, {threshold : 0})","left-of-fold":"!$.rightoffold(a, {threshold : 0})"});})(jQuery);
$(self).one("appear",function(){if(!this.loaded){$("<img />").bind("load",function(){$(self).hide().attr("src",$(self).attr("original")) [settings.effect](settings.effectspeed);self.loaded=true;}).attr("src",$(self).attr("original"));};});if("scroll"!=settings.event){$(self).bind(settings.event,function(event){if(!self.loaded){$(self).trigger("appear");}});}});$(settings.container).trigger(settings.event);return this;};$.belowthefold=function(element,settings){if(settings.container===undefined||settings.container===window){var fold=$(window).height()+$(window).scrollTop();}else{var fold=$(settings.container).offset().top+$(settings.container).height();}
(function($){$.fn.lazyload=function(options){var settings={threshold:0,failurelimit:0,event:"scroll",effect:"show"};if(options){$.extend(settings,options);}var elements=this;if("scroll"==settings.event){$(window).bind("scroll",function(event){var counter=0;elements.each(function(){if(!$.belowthefold(this,settings)&&!$.rightoffold(this,settings)){$(this).trigger("appear");}else{if(counter++>settings.failurelimit){return false;}}});var temp=$.grep(elements,function(element){return!element.loaded;});elements=$(temp);});}return this.each(function(){var self=this;$(self).attr("original",$(self).attr("src"));if("scroll"!=settings.event||$.belowthefold(self,settings)||$.rightoffold(self,settings)){if(settings.placeholder){$(self).attr("src",settings.placeholder);}else{$(self).removeAttr("src");}self.loaded=false;}else{self.loaded=true;}$(self).one("appear",function(){if(!this.loaded){$("<img />").attr("src",$(self).attr("original")).bind("load",function(){$(self).hide().attr("src",$(self).attr("original"))[settings.effect](settings.effectspeed);self.loaded=true;});};});if("scroll"!=settings.event){$(self).bind(settings.event,function(event){if(!self.loaded){$(self).trigger("appear");}});}});};$.belowthefold=function(element,settings){var fold=$(window).height()+$(window).scrollTop();return fold<=$(element).offset().top-settings.threshold;};$.rightoffold=function(element,settings){var fold=$(window).width()+$(window).scrollLeft();return fold<=$(element).offset().left-settings.threshold;};$.extend($.expr[':'],{"below-the-fold":"$.belowthefold(a, {threshold : 0})","above-the-fold":"!$.belowthefold(a, {threshold : 0})","right-of-fold":"$.rightoffold(a, {threshold : 0})","left-of-fold":"!$.rightoffold(a, {threshold : 0})"});})(jQuery);
lastId = response.lastid.toInt();
if(response.lastid) lastId = response.lastid.toInt();
leaveRoom: function () { lastId = null; var request = new ServerReq ('exit.php',function(response) { response.messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); if(!lastId) lastId = item.lid -1; MBchat.updateables.processMessage(item); }); lastId = response.lastid.toInt(); //Ensure we get all message from here on in MBchat.updateables.poller.setLastId(lastId); MBchat.updateables.online.show(0); //Show online list for entrance hall }).transmit({'rid' : room.rid}); //we might have been in a room that stopped me going to private room if (room.type == 'M' && (me.mod == 'M' || me.role == 'H' || me.role == 'G' || me.role == 'S' )) { //Can't go to private room here var whisperBoxes = $$('.whisperBox'); whisperBoxes.each ( function (whisperBox) { var privateBox = whisperBox.getElement('.nonprivate'); if (privateBox) { privateBox.removeClass('nonprivate'); privateBox.addClass('private'); privateBox.addEvent('click',goPrivate); } }); } room.set (entranceHall);; //Set up to be in the entrance hall messageList.removeClass('chat'); messageList.empty(); messageList.addClass('whisper'); $('roomNameContainer').empty(); var el = new Element('h1') .set('text', room.name) .inject('roomNameContainer'); $('inputContainer').set('styles',{ 'display':'none'}); $('entranceHall').set('styles',{'display':'block'}); },
lastId = response.lastid.toInt();
if(response.lastid)lastId = response.lastid.toInt();
leaveRoom: function () { lastId = null; var request = new ServerReq ('exit.php',function(response) { response.messages.each(function(item) { item.lid = item.lid.toInt(); item.rid = item.rid.toInt(); item.user.uid = item.user.uid.toInt(); if(!lastId) lastId = item.lid -1; MBchat.updateables.processMessage(item); }); lastId = response.lastid.toInt(); //Ensure we get all message from here on in MBchat.updateables.poller.setLastId(lastId); MBchat.updateables.online.show(0); //Show online list for entrance hall }).transmit({'rid' : room.rid}); //we might have been in a room that stopped me going to private room if (room.type == 'M' && (me.mod == 'M' || me.role == 'H' || me.role == 'G' || me.role == 'S' )) { //Can't go to private room here var whisperBoxes = $$('.whisperBox'); whisperBoxes.each ( function (whisperBox) { var privateBox = whisperBox.getElement('.nonprivate'); if (privateBox) { privateBox.removeClass('nonprivate'); privateBox.addClass('private'); privateBox.addEvent('click',goPrivate); } }); } room.set (entranceHall);; //Set up to be in the entrance hall messageList.removeClass('chat'); messageList.empty(); messageList.addClass('whisper'); $('roomNameContainer').empty(); var el = new Element('h1') .set('text', room.name) .inject('roomNameContainer'); $('inputContainer').set('styles',{ 'display':'none'}); $('emoticonContainer').set('styles',{ 'display':'none'}); $('entranceHall').set('styles',{'display':'block'}); var exit = $('exit'); exit.addClass('exit-f'); exit.removeClass('exit-r'); MBchat.sounds.resetTimer(); },
switch (ch)
var macro = multilineVars.macros[line[i]]; if (macro !== undefined) { if (macro[0] === '!' || macro[0] === '+') macro = macro.substring(1); if (macro[macro.length-1] === '!' || macro[macro.length-1] === '+') macro = macro.substring(0, macro.length-1); if (legalAccents.detect(function(acc) { return (macro === acc); })) return [ 1, macro ]; } switch (line[i])
var letter_to_accent = function(line, i) {// var ch = line[i];// var macro = multilineVars.macros[ch];//// if (macro !== undefined) {// ch = macro;// i = 0;// } switch (ch) { case '.':return [1, 'staccato']; case 'u':return [1, 'upbow']; case 'v':return [1, 'downbow']; case '~':return [1, 'roll']; case '!': case '+': var ret = getBrackettedSubstring(line, i, 5); // Be sure that the accent is recognizable. var legalAccents = [ "trill", "lowermordent", "uppermordent", "mordent", "pralltriller", "accent", "emphasis", "fermata", "invertedfermata", "tenuto", "0", "1", "2", "3", "4", "5", "+", "wedge", "open", "thumb", "snap", "turn", "roll", "breath", "shortphrase", "mediumphrase", "longphrase", "segno", "coda", "D.S.", "D.C.", "fine", "crescendo(", "crescendo)", "diminuendo(", "diminuendo)", "p", "pp", "f", "ff", "mf", "ppp", "pppp", "fff", "ffff", "sfz", "repeatbar", "repeatbar2", "slide", "upbow", "downbow" ]; if (ret[1].length > 0 && (ret[1][0] === '^' || ret[1][0] ==='_')) ret[1] = ret[1].substring(1); // TODO-PER: The test files have indicators forcing the orniment to the top or bottom, but that isn't in the standard. We'll just ignore them. if (legalAccents.detect(function(acc) { return (ret[1] === acc); })) return ret; // We didn't find the accent in the list, so consume the space, but don't return an accent. // Although it is possible that ! was used as a line break, so accept that. if (line[i] === '!' && (ret[0] === 1 || line[i+ret[0]-1] !== '!')) return [1, null ]; warn("Unknown decoration: " + ret[1], line, i); ret[1] = ""; return ret; case 'H':return [1, 'fermata']; case 'J':return [1, 'slide']; case 'M':return [1, 'mordent']; case 'R':return [1, 'roll']; case 'T':return [1, 'trill']; } return [0, 0]; };
var legalAccents = [ "trill", "lowermordent", "uppermordent", "mordent", "pralltriller", "accent", "emphasis", "fermata", "invertedfermata", "tenuto", "0", "1", "2", "3", "4", "5", "+", "wedge", "open", "thumb", "snap", "turn", "roll", "breath", "shortphrase", "mediumphrase", "longphrase", "segno", "coda", "D.S.", "D.C.", "fine", "crescendo(", "crescendo)", "diminuendo(", "diminuendo)", "p", "pp", "f", "ff", "mf", "ppp", "pppp", "fff", "ffff", "sfz", "repeatbar", "repeatbar2", "slide", "upbow", "downbow" ];
var letter_to_accent = function(line, i) {// var ch = line[i];// var macro = multilineVars.macros[ch];//// if (macro !== undefined) {// ch = macro;// i = 0;// } switch (ch) { case '.':return [1, 'staccato']; case 'u':return [1, 'upbow']; case 'v':return [1, 'downbow']; case '~':return [1, 'roll']; case '!': case '+': var ret = getBrackettedSubstring(line, i, 5); // Be sure that the accent is recognizable. var legalAccents = [ "trill", "lowermordent", "uppermordent", "mordent", "pralltriller", "accent", "emphasis", "fermata", "invertedfermata", "tenuto", "0", "1", "2", "3", "4", "5", "+", "wedge", "open", "thumb", "snap", "turn", "roll", "breath", "shortphrase", "mediumphrase", "longphrase", "segno", "coda", "D.S.", "D.C.", "fine", "crescendo(", "crescendo)", "diminuendo(", "diminuendo)", "p", "pp", "f", "ff", "mf", "ppp", "pppp", "fff", "ffff", "sfz", "repeatbar", "repeatbar2", "slide", "upbow", "downbow" ]; if (ret[1].length > 0 && (ret[1][0] === '^' || ret[1][0] ==='_')) ret[1] = ret[1].substring(1); // TODO-PER: The test files have indicators forcing the orniment to the top or bottom, but that isn't in the standard. We'll just ignore them. if (legalAccents.detect(function(acc) { return (ret[1] === acc); })) return ret; // We didn't find the accent in the list, so consume the space, but don't return an accent. // Although it is possible that ! was used as a line break, so accept that. if (line[i] === '!' && (ret[0] === 1 || line[i+ret[0]-1] !== '!')) return [1, null ]; warn("Unknown decoration: " + ret[1], line, i); ret[1] = ""; return ret; case 'H':return [1, 'fermata']; case 'J':return [1, 'slide']; case 'M':return [1, 'mordent']; case 'R':return [1, 'roll']; case 'T':return [1, 'trill']; } return [0, 0]; };
var macro = multilineVars.macros[line[i]]; if (macro !== undefined) { if (macro[0] === '!' || macro[0] === '+') macro = macro.substring(1); if (macro[macro.length-1] === '!' || macro[macro.length-1] === '+') macro = macro.substring(0, macro.length-1);
case '.':return [1, 'staccato']; case 'u':return [1, 'upbow']; case 'v':return [1, 'downbow']; case '~':return [1, 'roll']; case '!': case '+': var ret = tokenizer.getBrackettedSubstring(line, i, 5); if (ret[1].length > 0 && (ret[1][0] === '^' || ret[1][0] ==='_')) ret[1] = ret[1].substring(1);
var letter_to_accent = function(line, i) { var macro = multilineVars.macros[line[i]]; if (macro !== undefined) { if (macro[0] === '!' || macro[0] === '+') macro = macro.substring(1); if (macro[macro.length-1] === '!' || macro[macro.length-1] === '+') macro = macro.substring(0, macro.length-1); if (legalAccents.detect(function(acc) { return (macro === acc); })) return [ 1, macro ]; } switch (line[i]) { case '.':return [1, 'staccato']; case 'u':return [1, 'upbow']; case 'v':return [1, 'downbow']; case '~':return [1, 'roll']; case '!': case '+': var ret = tokenizer.getBrackettedSubstring(line, i, 5); // Be sure that the accent is recognizable. if (ret[1].length > 0 && (ret[1][0] === '^' || ret[1][0] ==='_')) ret[1] = ret[1].substring(1); // TODO-PER: The test files have indicators forcing the orniment to the top or bottom, but that isn't in the standard. We'll just ignore them. if (legalAccents.detect(function(acc) { return (ret[1] === acc); })) return ret; // We didn't find the accent in the list, so consume the space, but don't return an accent. // Although it is possible that ! was used as a line break, so accept that. if (line[i] === '!' && (ret[0] === 1 || line[i+ret[0]-1] !== '!')) return [1, null ]; warn("Unknown decoration: " + ret[1], line, i); ret[1] = ""; return ret; case 'H':return [1, 'fermata']; case 'J':return [1, 'slide']; case 'M':return [1, 'mordent']; case 'R':return [1, 'roll']; case 'T':return [1, 'trill']; } return [0, 0]; };
return (macro === acc);
return (ret[1] === acc);
var letter_to_accent = function(line, i) { var macro = multilineVars.macros[line[i]]; if (macro !== undefined) { if (macro[0] === '!' || macro[0] === '+') macro = macro.substring(1); if (macro[macro.length-1] === '!' || macro[macro.length-1] === '+') macro = macro.substring(0, macro.length-1); if (legalAccents.detect(function(acc) { return (macro === acc); })) return [ 1, macro ]; } switch (line[i]) { case '.':return [1, 'staccato']; case 'u':return [1, 'upbow']; case 'v':return [1, 'downbow']; case '~':return [1, 'roll']; case '!': case '+': var ret = tokenizer.getBrackettedSubstring(line, i, 5); // Be sure that the accent is recognizable. if (ret[1].length > 0 && (ret[1][0] === '^' || ret[1][0] ==='_')) ret[1] = ret[1].substring(1); // TODO-PER: The test files have indicators forcing the orniment to the top or bottom, but that isn't in the standard. We'll just ignore them. if (legalAccents.detect(function(acc) { return (ret[1] === acc); })) return ret; // We didn't find the accent in the list, so consume the space, but don't return an accent. // Although it is possible that ! was used as a line break, so accept that. if (line[i] === '!' && (ret[0] === 1 || line[i+ret[0]-1] !== '!')) return [1, null ]; warn("Unknown decoration: " + ret[1], line, i); ret[1] = ""; return ret; case 'H':return [1, 'fermata']; case 'J':return [1, 'slide']; case 'M':return [1, 'mordent']; case 'R':return [1, 'roll']; case 'T':return [1, 'trill']; } return [0, 0]; };
return [ 1, macro ]; } switch (line[i]) { case '.':return [1, 'staccato']; case 'u':return [1, 'upbow']; case 'v':return [1, 'downbow']; case '~':return [1, 'roll']; case '!': case '+': var ret = tokenizer.getBrackettedSubstring(line, i, 5); if (ret[1].length > 0 && (ret[1][0] === '^' || ret[1][0] ==='_')) ret[1] = ret[1].substring(1); if (legalAccents.detect(function(acc) { return (ret[1] === acc); })) return ret; if (line[i] === '!' && (ret[0] === 1 || line[i+ret[0]-1] !== '!')) return [1, null ]; warn("Unknown decoration: " + ret[1], line, i); ret[1] = "";
var letter_to_accent = function(line, i) { var macro = multilineVars.macros[line[i]]; if (macro !== undefined) { if (macro[0] === '!' || macro[0] === '+') macro = macro.substring(1); if (macro[macro.length-1] === '!' || macro[macro.length-1] === '+') macro = macro.substring(0, macro.length-1); if (legalAccents.detect(function(acc) { return (macro === acc); })) return [ 1, macro ]; } switch (line[i]) { case '.':return [1, 'staccato']; case 'u':return [1, 'upbow']; case 'v':return [1, 'downbow']; case '~':return [1, 'roll']; case '!': case '+': var ret = tokenizer.getBrackettedSubstring(line, i, 5); // Be sure that the accent is recognizable. if (ret[1].length > 0 && (ret[1][0] === '^' || ret[1][0] ==='_')) ret[1] = ret[1].substring(1); // TODO-PER: The test files have indicators forcing the orniment to the top or bottom, but that isn't in the standard. We'll just ignore them. if (legalAccents.detect(function(acc) { return (ret[1] === acc); })) return ret; // We didn't find the accent in the list, so consume the space, but don't return an accent. // Although it is possible that ! was used as a line break, so accept that. if (line[i] === '!' && (ret[0] === 1 || line[i+ret[0]-1] !== '!')) return [1, null ]; warn("Unknown decoration: " + ret[1], line, i); ret[1] = ""; return ret; case 'H':return [1, 'fermata']; case 'J':return [1, 'slide']; case 'M':return [1, 'mordent']; case 'R':return [1, 'roll']; case 'T':return [1, 'trill']; } return [0, 0]; };
case 'H':return [1, 'fermata']; case 'J':return [1, 'slide']; case 'M':return [1, 'mordent']; case 'R':return [1, 'roll']; case 'T':return [1, 'trill']; } return [0, 0]; };
if (line[i] === '!' && (ret[0] === 1 || line[i+ret[0]-1] !== '!')) return [1, null ]; warn("Unknown decoration: " + ret[1], line, i); ret[1] = ""; return ret; case 'H':return [1, 'fermata']; case 'J':return [1, 'slide']; case 'M':return [1, 'mordent']; case 'R':return [1, 'roll']; case 'T':return [1, 'trill']; } return [0, 0]; };
var letter_to_accent = function(line, i) { var macro = multilineVars.macros[line[i]]; if (macro !== undefined) { if (macro[0] === '!' || macro[0] === '+') macro = macro.substring(1); if (macro[macro.length-1] === '!' || macro[macro.length-1] === '+') macro = macro.substring(0, macro.length-1); if (legalAccents.detect(function(acc) { return (macro === acc); })) return [ 1, macro ]; } switch (line[i]) { case '.':return [1, 'staccato']; case 'u':return [1, 'upbow']; case 'v':return [1, 'downbow']; case '~':return [1, 'roll']; case '!': case '+': var ret = tokenizer.getBrackettedSubstring(line, i, 5); // Be sure that the accent is recognizable. if (ret[1].length > 0 && (ret[1][0] === '^' || ret[1][0] ==='_')) ret[1] = ret[1].substring(1); // TODO-PER: The test files have indicators forcing the orniment to the top or bottom, but that isn't in the standard. We'll just ignore them. if (legalAccents.detect(function(acc) { return (ret[1] === acc); })) return ret; // We didn't find the accent in the list, so consume the space, but don't return an accent. // Although it is possible that ! was used as a line break, so accept that. if (line[i] === '!' && (ret[0] === 1 || line[i+ret[0]-1] !== '!')) return [1, null ]; warn("Unknown decoration: " + ret[1], line, i); ret[1] = ""; return ret; case 'H':return [1, 'fermata']; case 'J':return [1, 'slide']; case 'M':return [1, 'mordent']; case 'R':return [1, 'roll']; case 'T':return [1, 'trill']; } return [0, 0]; };
switch (line[i])
switch (ch)
var letter_to_accent = function(line, i) { switch (line[i]) { case '.':return [1, 'staccato']; case 'u':return [1, 'upbow']; case 'v':return [1, 'downbow']; case '~':return [1, 'roll']; case '!': case '+': var ret = getBrackettedSubstring(line, i, 5); // Be sure that the accent is recognizable. var legalAccents = [ "trill", "lowermordent", "uppermordent", "mordent", "pralltriller", "accent", "emphasis", "fermata", "invertedfermata", "tenuto", "0", "1", "2", "3", "4", "5", "+", "wedge", "open", "thumb", "snap", "turn", "roll", "breath", "shortphrase", "mediumphrase", "longphrase", "segno", "coda", "D.S.", "D.C.", "fine", "crescendo(", "crescendo)", "diminuendo(", "diminuendo)", "p", "pp", "f", "ff", "mf", "ppp", "pppp", "fff", "ffff", "sfz", "repeatbar", "repeatbar2", "slide", "upbow", "downbow" ]; if (ret[1].length > 0 && (ret[1][0] === '^' || ret[1][0] ==='_')) ret[1] = ret[1].substring(1); // TODO-PER: The test files have indicators forcing the orniment to the top or bottom, but that isn't in the standard. We'll just ignore them. if (legalAccents.detect(function(acc) { return (ret[1] === acc); })) return ret; // We didn't find the accent in the list, so consume the space, but don't return an accent. // Although it is possible that ! was used as a line break, so accept that. if (line[i] === '!' && (ret[0] === 1 || line[i+ret[0]-1] !== '!')) return [1, null ]; warn("Unknown decoration: " + ret[1], line, i); ret[1] = ""; return ret; case 'H':return [1, 'fermata']; case 'J':return [1, 'slide']; case 'M':return [1, 'mordent']; case 'R':return [1, 'roll']; case 'T':return [1, 'trill']; } return [0, 0]; };
{ var ret = tokenizer.getBarLine(line, curr_pos); if (ret.len === 0) return [0,""]; if (ret.warn) { warn(ret.warn, line, curr_pos); return [ret.len,""];
{ var ret = tokenizer.getBarLine(line, curr_pos); if (ret.len === 0) return [0,""]; if (ret.warn) { warn(ret.warn, line, curr_pos); return [ret.len,""]; } for (var ws = 0; ws < line.length; ws++) if (line[curr_pos+ret.len+ws] !== ' ') break; var orig_bar_len = ret.len; if (line[curr_pos+ret.len+ws] === '[') { ret.len += ws + 1; if (line[curr_pos+ret.len] === '"') { var ending = tokenizer.getBrackettedSubstring(line, curr_pos+ret.len, 5); return [ret.len+ending[0], ret.token, ending[1]];
var letter_to_bar = function(line, curr_pos) { var ret = tokenizer.getBarLine(line, curr_pos); if (ret.len === 0) return [0,""]; if (ret.warn) { warn(ret.warn, line, curr_pos); return [ret.len,""]; } // Now see if this is a repeated ending // A repeated ending is all of the characters 1,2,3,4,5,6,7,8,9,0,-, and comma // It can also optionally start with '[', which is ignored. // Also, it can have white space before the '['. for (var ws = 0; ws < line.length; ws++) if (line[curr_pos+ret.len+ws] !== ' ') break; var orig_bar_len = ret.len; if (line[curr_pos+ret.len+ws] === '[') { ret.len += ws + 1; // It can also be a quoted string. It is unclear whether that construct requires '[', but it seems like it would. otherwise it would be confused with a regular chord. if (line[curr_pos+ret.len] === '"') { var ending = tokenizer.getBrackettedSubstring(line, curr_pos+ret.len, 5); return [ret.len+ending[0], ret.token, ending[1]]; } } var retRep = tokenizer.getTokenOf(line.substring(curr_pos+ret.len), "1234567890-,"); if (retRep.len === 0) return [orig_bar_len, ret.token]; return [ret.len+retRep.len, ret.token, retRep.token]; };
for (var ws = 0; ws < line.length; ws++) if (line[curr_pos+ret.len+ws] !== ' ') break; var orig_bar_len = ret.len; if (line[curr_pos+ret.len+ws] === '[') { ret.len += ws + 1; if (line[curr_pos+ret.len] === '"') { var ending = tokenizer.getBrackettedSubstring(line, curr_pos+ret.len, 5); return [ret.len+ending[0], ret.token, ending[1]]; } } var retRep = tokenizer.getTokenOf(line.substring(curr_pos+ret.len), "1234567890-,"); if (retRep.len === 0) return [orig_bar_len, ret.token]; return [ret.len+retRep.len, ret.token, retRep.token]; };
return [ret.len+retRep.len, ret.token, retRep.token]; };
var letter_to_bar = function(line, curr_pos) { var ret = tokenizer.getBarLine(line, curr_pos); if (ret.len === 0) return [0,""]; if (ret.warn) { warn(ret.warn, line, curr_pos); return [ret.len,""]; } // Now see if this is a repeated ending // A repeated ending is all of the characters 1,2,3,4,5,6,7,8,9,0,-, and comma // It can also optionally start with '[', which is ignored. // Also, it can have white space before the '['. for (var ws = 0; ws < line.length; ws++) if (line[curr_pos+ret.len+ws] !== ' ') break; var orig_bar_len = ret.len; if (line[curr_pos+ret.len+ws] === '[') { ret.len += ws + 1; // It can also be a quoted string. It is unclear whether that construct requires '[', but it seems like it would. otherwise it would be confused with a regular chord. if (line[curr_pos+ret.len] === '"') { var ending = tokenizer.getBrackettedSubstring(line, curr_pos+ret.len, 5); return [ret.len+ending[0], ret.token, ending[1]]; } } var retRep = tokenizer.getTokenOf(line.substring(curr_pos+ret.len), "1234567890-,"); if (retRep.len === 0) return [orig_bar_len, ret.token]; return [ret.len+retRep.len, ret.token, retRep.token]; };
return [ line.length, line[i], line.substring(i+2).strip()]; default: }
return [ line.length, line[i], line.substring(i+2).strip()]; default:
this.letter_to_body_header = function(line, i) { if (line.length >= i+3) { switch(line.substring(i, i+2)) { case "I:": var err = this.addDirective(line.substring(i+2)); if (err) warn(err, line, i); return [ line.length ]; case "M:": var meter = this.setMeter(line.substring(i+2)); if (tune.hasBeginMusic() && meter) tune.appendStartingElement('meter', -1, -1, meter); return [ line.length ]; case "K:": var result = this.parseKey(line.substring(i+2)); if (result.foundClef && tune.hasBeginMusic()) tune.appendStartingElement('clef', -1, -1, multilineVars.clef); if (result.foundKey && tune.hasBeginMusic()) tune.appendStartingElement('key', -1, -1, this.fixKey(multilineVars.clef, multilineVars.key)); return [ line.length ]; case "P:": if (tune.hasBeginMusic()) tune.appendElement('part', -1, -1, {title: line.substring(i+2)}); return [ line.length ]; case "L:": this.setDefaultLength(line, i+2, line.length); return [ line.length ]; case "Q:": var e = line.indexOf('\x12', i+2); if (e === -1) e = line.length; var tempo = this.setTempo(line, i+2, e); if (tempo.type === 'delaySet') tune.appendElement('tempo', -1, -1, this.calcTempo(tempo.tempo)); else if (tempo.type === 'immediate') tune.appendElement('tempo', -1, -1, tempo.tempo); return [ e, line[i], line.substring(i+2).strip()]; case "V:": this.parseVoice(line, 2, line.length);// startNewLine(); return [ line.length, line[i], line.substring(i+2).strip()]; default: // TODO: complain about unhandled header } } return [ 0 ]; };
return [ 0 ]; };
} return [ 0 ]; };
this.letter_to_body_header = function(line, i) { if (line.length >= i+3) { switch(line.substring(i, i+2)) { case "I:": var err = this.addDirective(line.substring(i+2)); if (err) warn(err, line, i); return [ line.length ]; case "M:": var meter = this.setMeter(line.substring(i+2)); if (tune.hasBeginMusic() && meter) tune.appendStartingElement('meter', -1, -1, meter); return [ line.length ]; case "K:": var result = this.parseKey(line.substring(i+2)); if (result.foundClef && tune.hasBeginMusic()) tune.appendStartingElement('clef', -1, -1, multilineVars.clef); if (result.foundKey && tune.hasBeginMusic()) tune.appendStartingElement('key', -1, -1, this.fixKey(multilineVars.clef, multilineVars.key)); return [ line.length ]; case "P:": if (tune.hasBeginMusic()) tune.appendElement('part', -1, -1, {title: line.substring(i+2)}); return [ line.length ]; case "L:": this.setDefaultLength(line, i+2, line.length); return [ line.length ]; case "Q:": var e = line.indexOf('\x12', i+2); if (e === -1) e = line.length; var tempo = this.setTempo(line, i+2, e); if (tempo.type === 'delaySet') tune.appendElement('tempo', -1, -1, this.calcTempo(tempo.tempo)); else if (tempo.type === 'immediate') tune.appendElement('tempo', -1, -1, tempo.tempo); return [ e, line[i], line.substring(i+2).strip()]; case "V:": this.parseVoice(line, 2, line.length);// startNewLine(); return [ line.length, line[i], line.substring(i+2).strip()]; default: // TODO: complain about unhandled header } } return [ 0 ]; };
tune.appendStartingElement('clef', -1, -1, {type: multilineVars.clef});
tune.appendStartingElement('clef', -1, -1, multilineVars.clef);
var letter_to_body_header = function(line, i) { if (line.length >= i+3) { switch(line.substring(i, i+2)) { case "I:": var err = addDirective(line.substring(i+2)); if (err) warn(err, line, i); return [ line.length ]; case "M:": setMeter(line.substring(i+2)); tune.appendStartingElement('meter', -1, -1, multilineVars.meter); return [ line.length ]; case "K:": var result = parseKey(line.substring(i+2)); if (result.foundClef) tune.appendStartingElement('clef', -1, -1, {type: multilineVars.clef}); if (result.foundKey) tune.appendStartingElement('key', -1, -1, multilineVars.key); return [ line.length ]; case "P:": tune.appendStartingElement('part', -1, -1, {title: line.substring(i+2)}); return [ line.length ]; case "L:": case "Q:": // TODO-PER: handle these return [ line.length, line[i], line.substring(2).strip()]; break; case "V:": parseVoice(line, 2, line.length);// setCurrentVoice(line.substring(2).strip()); startNewLine(); return [ line.length, line[i], line.substring(2).strip()]; default: // TODO: complain about unhandled header } } return [ 0 ]; };
return [ line.length, line[i], line.substring(2).strip()];
return [ line.length, line[i], line.substring(i+2).strip()];
var letter_to_body_header = function(line, i) { if (line.length >= i+3) { switch(line.substring(i, i+2)) { case "I:": var err = addDirective(line.substring(i+2)); if (err) warn(err, line, i); return [ line.length ]; case "M:": setMeter(line.substring(i+2)); tune.appendStartingElement('meter', -1, -1, multilineVars.meter); return [ line.length ]; case "K:": var result = parseKey(line.substring(i+2)); if (result.foundClef) tune.appendStartingElement('clef', -1, -1, {type: multilineVars.clef}); if (result.foundKey) tune.appendStartingElement('key', -1, -1, multilineVars.key); return [ line.length ]; case "P:": tune.appendStartingElement('part', -1, -1, {title: line.substring(i+2)}); return [ line.length ]; case "L:": case "Q:": // TODO-PER: handle these return [ line.length, line[i], line.substring(2).strip()]; break; case "V:": parseVoice(line, 2, line.length);// setCurrentVoice(line.substring(2).strip()); startNewLine(); return [ line.length, line[i], line.substring(2).strip()]; default: // TODO: complain about unhandled header } } return [ 0 ]; };
return [ line.length, line[i], line.substring(i+2).strip()];
var e = line.indexOf('\x12', i+2); if (e === -1) e = line.length; var tempo = setTempo(line, i+2, e); if (tempo.type === 'delaySet') tune.appendElement('tempo', -1, -1, calcTempo(tempo.tempo)); else if (tempo.type === 'immediate') tune.appendElement('tempo', -1, -1, tempo.tempo); return [ e, line[i], line.substring(i+2).strip()];
var letter_to_body_header = function(line, i) { if (line.length >= i+3) { switch(line.substring(i, i+2)) { case "I:": var err = addDirective(line.substring(i+2)); if (err) warn(err, line, i); return [ line.length ]; case "M:": setMeter(line.substring(i+2)); tune.appendStartingElement('meter', -1, -1, multilineVars.meter); return [ line.length ]; case "K:": var result = parseKey(line.substring(i+2)); if (result.foundClef) tune.appendStartingElement('clef', -1, -1, multilineVars.clef); if (result.foundKey) tune.appendStartingElement('key', -1, -1, multilineVars.key); return [ line.length ]; case "P:": tune.appendStartingElement('part', -1, -1, {title: line.substring(i+2)}); return [ line.length ]; case "L:": setDefaultLength(line, i+2, line.length); return [ line.length ]; case "Q:": // TODO-PER: handle these return [ line.length, line[i], line.substring(i+2).strip()]; break; case "V:": parseVoice(line, 2, line.length);// setCurrentVoice(line.substring(2).strip()); startNewLine(); return [ line.length, line[i], line.substring(i+2).strip()]; default: // TODO: complain about unhandled header } } return [ 0 ]; };
if (line[i] === '"') { var chord = tokenizer.getBrackettedSubstring(line, i, 5); if (!chord[2]) warn("Missing the closing quote while parsing the chord symbol", line , i); if (chord[0] > 0 && chord[1].length > 0 && chord[1][0] === '^') { chord[1] = chord[1].substring(1); chord[2] = 'above'; } else if (chord[0] > 0 && chord[1].length > 0 && chord[1][0] === '_') { chord[1] = chord[1].substring(1); chord[2] = 'below'; } else chord[2] = 'default'; return chord; } return [0, ""]; };
var chord = tokenizer.getBrackettedSubstring(line, i, 5); if (!chord[2]) warn("Missing the closing quote while parsing the chord symbol", line , i); if (chord[0] > 0 && chord[1].length > 0 && chord[1][0] === '^') { chord[1] = chord[1].substring(1); chord[2] = 'above'; } else if (chord[0] > 0 && chord[1].length > 0 && chord[1][0] === '_') { chord[1] = chord[1].substring(1); chord[2] = 'below'; } else chord[2] = 'default'; return chord; } return [0, ""]; };
var letter_to_chord = function(line, i) { if (line[i] === '"') { var chord = tokenizer.getBrackettedSubstring(line, i, 5); if (!chord[2]) warn("Missing the closing quote while parsing the chord symbol", line , i); // If it starts with ^, then the chord appears above. // If it starts with _ then the chord appears below. // (note that the 2.0 draft standard defines them as not chords, but annotations and also defines < > and @.) if (chord[0] > 0 && chord[1].length > 0 && chord[1][0] === '^') { chord[1] = chord[1].substring(1); chord[2] = 'above'; } else if (chord[0] > 0 && chord[1].length > 0 && chord[1][0] === '_') { chord[1] = chord[1].substring(1); chord[2] = 'below'; } else chord[2] = 'default'; return chord; } return [0, ""]; };
ii = note.endChar; delete note.endChar; } else { if (gra[1][ii] === ' ') { if (gracenotes.length > 0) gracenotes[gracenotes.length-1].end_beam = true; } else warn("Unknown character '" + gra[1][ii] + "' while parsing grace note", line, i); ii++; }
ii = note.endChar; delete note.endChar;
var letter_to_grace = function(line, i) { // Grace notes are an array of: startslur, note, endslur, space; where note is accidental, pitch, duration if (line[i] === '{') { // fetch the gracenotes string and consume that into the array var gra = tokenizer.getBrackettedSubstring(line, i, 1, '}'); if (!gra[2]) warn("Missing the closing '}' while parsing grace note", line, i); var gracenotes = []; var ii = 0; var inTie = false; while (ii < gra[1].length) { var note = getCoreNote(gra[1], ii, {}, false); if (note !== null) { gracenotes.push(note); if (inTie) { note.endTie = true; inTie = false; } if (note.startTie) inTie = true; ii = note.endChar; delete note.endChar; } else { // We shouldn't get anything but notes or a space here, so report an error if (gra[1][ii] === ' ') { if (gracenotes.length > 0) gracenotes[gracenotes.length-1].end_beam = true; } else warn("Unknown character '" + gra[1][ii] + "' while parsing grace note", line, i); ii++; } } if (gracenotes.length) return [gra[0], gracenotes];// for (var ret = letter_to_pitch(gra[1], ii); ret[0]>0 && ii<gra[1].length;// ret = letter_to_pitch(gra[1], ii)) {// //todo get other stuff that could be in a grace note// ii += ret[0];// gracenotes.push({el_type:"gracenote",pitch:ret[1]});// }// return [ gra[0], gracenotes ]; } return [ 0 ]; };
if (gracenotes.length) return [gra[0], gracenotes];
else { if (gra[1][ii] === ' ') { if (gracenotes.length > 0) gracenotes[gracenotes.length-1].end_beam = true; } else warn("Unknown character '" + gra[1][ii] + "' while parsing grace note", line, i); ii++; } } if (gracenotes.length) return [gra[0], gracenotes];
var letter_to_grace = function(line, i) { // Grace notes are an array of: startslur, note, endslur, space; where note is accidental, pitch, duration if (line[i] === '{') { // fetch the gracenotes string and consume that into the array var gra = tokenizer.getBrackettedSubstring(line, i, 1, '}'); if (!gra[2]) warn("Missing the closing '}' while parsing grace note", line, i); var gracenotes = []; var ii = 0; var inTie = false; while (ii < gra[1].length) { var note = getCoreNote(gra[1], ii, {}, false); if (note !== null) { gracenotes.push(note); if (inTie) { note.endTie = true; inTie = false; } if (note.startTie) inTie = true; ii = note.endChar; delete note.endChar; } else { // We shouldn't get anything but notes or a space here, so report an error if (gra[1][ii] === ' ') { if (gracenotes.length > 0) gracenotes[gracenotes.length-1].end_beam = true; } else warn("Unknown character '" + gra[1][ii] + "' while parsing grace note", line, i); ii++; } } if (gracenotes.length) return [gra[0], gracenotes];// for (var ret = letter_to_pitch(gra[1], ii); ret[0]>0 && ii<gra[1].length;// ret = letter_to_pitch(gra[1], ii)) {// //todo get other stuff that could be in a grace note// ii += ret[0];// gracenotes.push({el_type:"gracenote",pitch:ret[1]});// }// return [ gra[0], gracenotes ]; } return [ 0 ]; };
default: }
default:
this.letter_to_inline_header = function(line, i) { var ws = tokenizer.eatWhiteSpace(line, i); i +=ws; if (line.length >= i+5 && line[i] === '[' && line[i+2] === ':') { var e = line.indexOf(']', i); switch(line.substring(i, i+3)) { case "[I:": var err = this.addDirective(line.substring(i+3, e)); if (err) warn(err, line, i); return [ e-i+1+ws ]; case "[M:": var meter = this.setMeter(line.substring(i+3, e)); if (tune.hasBeginMusic() && meter) tune.appendStartingElement('meter', -1, -1, meter); return [ e-i+1+ws ]; case "[K:": var result = this.parseKey(line.substring(i+3, e)); if (result.foundClef && tune.hasBeginMusic()) tune.appendStartingElement('clef', -1, -1, multilineVars.clef); if (result.foundKey && tune.hasBeginMusic()) tune.appendStartingElement('key', -1, -1, this.fixKey(multilineVars.clef, multilineVars.key)); return [ e-i+1+ws ]; case "[P:": tune.appendElement('part', -1, -1, {title: line.substring(i+3, e)}); return [ e-i+1+ws ]; case "[L:": this.setDefaultLength(line, i+3, e); return [ e-i+1+ws ]; case "[Q:": if (e > 0) { var tempo = this.setTempo(line, i+3, e); if (tempo.type === 'delaySet') tune.appendElement('tempo', -1, -1, this.calcTempo(tempo.tempo)); else if (tempo.type === 'immediate') tune.appendElement('tempo', -1, -1, tempo.tempo); return [ e-i+1+ws, line[i+1], line.substring(i+3, e)]; } break; case "[V:": if (e > 0) { this.parseVoice(line, i+3, e); //startNewLine(); return [ e-i+1+ws, line[i+1], line.substring(i+3, e)]; } break; default: // TODO: complain about unhandled header } } return [ 0 ]; };
return [ 0 ]; };
} return [ 0 ]; };
this.letter_to_inline_header = function(line, i) { var ws = tokenizer.eatWhiteSpace(line, i); i +=ws; if (line.length >= i+5 && line[i] === '[' && line[i+2] === ':') { var e = line.indexOf(']', i); switch(line.substring(i, i+3)) { case "[I:": var err = this.addDirective(line.substring(i+3, e)); if (err) warn(err, line, i); return [ e-i+1+ws ]; case "[M:": var meter = this.setMeter(line.substring(i+3, e)); if (tune.hasBeginMusic() && meter) tune.appendStartingElement('meter', -1, -1, meter); return [ e-i+1+ws ]; case "[K:": var result = this.parseKey(line.substring(i+3, e)); if (result.foundClef && tune.hasBeginMusic()) tune.appendStartingElement('clef', -1, -1, multilineVars.clef); if (result.foundKey && tune.hasBeginMusic()) tune.appendStartingElement('key', -1, -1, this.fixKey(multilineVars.clef, multilineVars.key)); return [ e-i+1+ws ]; case "[P:": tune.appendElement('part', -1, -1, {title: line.substring(i+3, e)}); return [ e-i+1+ws ]; case "[L:": this.setDefaultLength(line, i+3, e); return [ e-i+1+ws ]; case "[Q:": if (e > 0) { var tempo = this.setTempo(line, i+3, e); if (tempo.type === 'delaySet') tune.appendElement('tempo', -1, -1, this.calcTempo(tempo.tempo)); else if (tempo.type === 'immediate') tune.appendElement('tempo', -1, -1, tempo.tempo); return [ e-i+1+ws, line[i+1], line.substring(i+3, e)]; } break; case "[V:": if (e > 0) { this.parseVoice(line, i+3, e); //startNewLine(); return [ e-i+1+ws, line[i+1], line.substring(i+3, e)]; } break; default: // TODO: complain about unhandled header } } return [ 0 ]; };
tune.appendStartingElement('clef', -1, -1, {type: multilineVars.clef});
tune.appendStartingElement('clef', -1, -1, multilineVars.clef);
var letter_to_inline_header = function(line, i) { var ws = tokenizer.eatWhiteSpace(line, i); i +=ws; if (line.length >= i+5) { var e = line.indexOf(']', i); switch(line.substring(i, i+3)) { case "[I:": var err = addDirective(line.substring(i+3, e)); if (err) warn(err, line, i); return [ e-i+1+ws ]; case "[M:": setMeter(line.substring(i+3, e)); tune.appendStartingElement('meter', -1, -1, multilineVars.meter); return [ e-i+1+ws ]; case "[K:": var result = parseKey(line.substring(i+3, e)); if (result.foundClef) tune.appendStartingElement('clef', -1, -1, {type: multilineVars.clef}); if (result.foundKey) tune.appendStartingElement('key', -1, -1, multilineVars.key); return [ e-i+1+ws ]; case "[P:": tune.appendElement('part', -1, -1, {title: line.substring(i+3, e)}); return [ e-i+1+ws ]; case "[L:": case "[Q:": if (e > 0) return [ e-i+1+ws, line[i+1], line.substring(i+3, e)]; break; case "[V:": if (e > 0) { parseVoice(line, i+3, e); startNewLine(); return [ e-i+1+ws, line[i+1], line.substring(i+3, e)]; } break; default: // TODO: complain about unhandled header } } return [ 0 ]; };
setDefaultLength(line, i+3, e); return [ e-i+1+ws ];
var letter_to_inline_header = function(line, i) { var ws = tokenizer.eatWhiteSpace(line, i); i +=ws; if (line.length >= i+5) { var e = line.indexOf(']', i); switch(line.substring(i, i+3)) { case "[I:": var err = addDirective(line.substring(i+3, e)); if (err) warn(err, line, i); return [ e-i+1+ws ]; case "[M:": setMeter(line.substring(i+3, e)); tune.appendStartingElement('meter', -1, -1, multilineVars.meter); return [ e-i+1+ws ]; case "[K:": var result = parseKey(line.substring(i+3, e)); if (result.foundClef) tune.appendStartingElement('clef', -1, -1, {type: multilineVars.clef}); if (result.foundKey) tune.appendStartingElement('key', -1, -1, multilineVars.key); return [ e-i+1+ws ]; case "[P:": tune.appendElement('part', -1, -1, {title: line.substring(i+3, e)}); return [ e-i+1+ws ]; case "[L:": case "[Q:": if (e > 0) return [ e-i+1+ws, line[i+1], line.substring(i+3, e)]; break; case "[V:": if (e > 0) { parseVoice(line, i+3, e); startNewLine(); return [ e-i+1+ws, line[i+1], line.substring(i+3, e)]; } break; default: // TODO: complain about unhandled header } } return [ 0 ]; };
if (e > 0)
if (e > 0) { var tempo = setTempo(line, i+3, e); if (tempo.type === 'delaySet') tune.appendElement('tempo', -1, -1, calcTempo(tempo.tempo)); else if (tempo.type === 'immediate') tune.appendElement('tempo', -1, -1, tempo.tempo);
var letter_to_inline_header = function(line, i) { var ws = tokenizer.eatWhiteSpace(line, i); i +=ws; if (line.length >= i+5) { var e = line.indexOf(']', i); switch(line.substring(i, i+3)) { case "[I:": var err = addDirective(line.substring(i+3, e)); if (err) warn(err, line, i); return [ e-i+1+ws ]; case "[M:": setMeter(line.substring(i+3, e)); tune.appendStartingElement('meter', -1, -1, multilineVars.meter); return [ e-i+1+ws ]; case "[K:": var result = parseKey(line.substring(i+3, e)); if (result.foundClef) tune.appendStartingElement('clef', -1, -1, multilineVars.clef); if (result.foundKey) tune.appendStartingElement('key', -1, -1, multilineVars.key); return [ e-i+1+ws ]; case "[P:": tune.appendElement('part', -1, -1, {title: line.substring(i+3, e)}); return [ e-i+1+ws ]; case "[L:": setDefaultLength(line, i+3, e); return [ e-i+1+ws ]; case "[Q:": if (e > 0) return [ e-i+1+ws, line[i+1], line.substring(i+3, e)]; break; case "[V:": if (e > 0) { parseVoice(line, i+3, e); startNewLine(); return [ e-i+1+ws, line[i+1], line.substring(i+3, e)]; } break; default: // TODO: complain about unhandled header } } return [ 0 ]; };
}
var letter_to_inline_header = function(line, i) { var ws = tokenizer.eatWhiteSpace(line, i); i +=ws; if (line.length >= i+5) { var e = line.indexOf(']', i); switch(line.substring(i, i+3)) { case "[I:": var err = addDirective(line.substring(i+3, e)); if (err) warn(err, line, i); return [ e-i+1+ws ]; case "[M:": setMeter(line.substring(i+3, e)); tune.appendStartingElement('meter', -1, -1, multilineVars.meter); return [ e-i+1+ws ]; case "[K:": var result = parseKey(line.substring(i+3, e)); if (result.foundClef) tune.appendStartingElement('clef', -1, -1, multilineVars.clef); if (result.foundKey) tune.appendStartingElement('key', -1, -1, multilineVars.key); return [ e-i+1+ws ]; case "[P:": tune.appendElement('part', -1, -1, {title: line.substring(i+3, e)}); return [ e-i+1+ws ]; case "[L:": setDefaultLength(line, i+3, e); return [ e-i+1+ws ]; case "[Q:": if (e > 0) return [ e-i+1+ws, line[i+1], line.substring(i+3, e)]; break; case "[V:": if (e > 0) { parseVoice(line, i+3, e); startNewLine(); return [ e-i+1+ws, line[i+1], line.substring(i+3, e)]; } break; default: // TODO: complain about unhandled header } } return [ 0 ]; };
ret.num_notes = line - '0';
ret.num_notes = line.charAt(i+5) - '0';
var letter_to_open_slurs_and_triplets = function(line, i) { // consume spaces, and look for all the open parens. If there is a number after the open paren, // that is a triplet. Otherwise that is a slur. Collect all the slurs and the first triplet. var ret = {}; var start = i; while (line.charAt(i) === '(' || tokenizer.isWhiteSpace(line.charAt(i))) { if (line.charAt(i) === '(') { if (i+1 < line.length && (line.charAt(i+1) >= '2' && line.charAt(i+1) <= '9')) { if (ret.triplet !== undefined) warn("Can't nest triplets", line, i); else { ret.triplet = line.charAt(i+1) - '0'; if (i+2 < line.length && line.charAt(i+2) === ':') { // We are expecting "(p:q:r" or "(p:q" or "(p::r" we are only interested in the first number (p) and the number of notes (r) // if r is missing, then it is equal to p. if (i+3 < line.length && line.charAt(i+3) === ':') { if (i+4 < line.length && (line.charAt(i+4) >= '1' && line.charAt(i+4) <= '9')) { ret.num_notes = line.charAt(i+4) - '0'; i += 3; } else warn("expected number after the two colons after the triplet to mark the duration", line, i); } else if (i+3 < line.length && (line.charAt(i+3) >= '1' && line.charAt(i+3) <= '9')) { // ignore this middle number if (i+4 < line.length && line.charAt(i+4) === ':') { if (i+5 < line.length && (line.charAt(i+5) >= '1' && line.charAt(i+5) <= '9')) { ret.num_notes = line - '0'; i += 4; } } else { ret.num_notes = ret.triplet; i += 3; } } else warn("expected number after the triplet to mark the duration", line, i); } } i++; } else { if (ret.startSlur === undefined) ret.startSlur = 1; else ret.startSlur++; } } i++; } ret.consumed = i-start; return ret; };
var ret = {}; var start = i; while (line[i] === '(' || tokenizer.isWhiteSpace(line[i])) { if (line[i] === '(') { if (i+1 < line.length && (line[i+1] >= '2' && line[i+1] <= '9')) { if (ret.triplet !== undefined) warn("Can't nest triplets", line, i); else { ret.triplet = line[i+1] - '0'; if (i+2 < line.length && line[i+2] === ':') { if (i+3 < line.length && line[i+3] === ':') { if (i+4 < line.length && (line[i+4] >= '1' && line[i+4] <= '9')) { ret.num_notes = line[i+4] - '0'; i += 3; } else warn("expected number after the two colons after the triplet to mark the duration", line, i); } else if (i+3 < line.length && (line[i+3] >= '1' && line[i+3] <= '9')) { if (i+4 < line.length && line[i+4] === ':') { if (i+5 < line.length && (line[i+5] >= '1' && line[i+5] <= '9')) { ret.num_notes = line[i+5] - '0'; i += 4; } } else { ret.num_notes = ret.triplet; i += 3;
var ret = {}; var start = i; while (line[i] === '(' || tokenizer.isWhiteSpace(line[i])) { if (line[i] === '(') { if (i+1 < line.length && (line[i+1] >= '2' && line[i+1] <= '9')) { if (ret.triplet !== undefined) warn("Can't nest triplets", line, i); else { ret.triplet = line[i+1] - '0'; if (i+2 < line.length && line[i+2] === ':') { if (i+3 < line.length && line[i+3] === ':') { if (i+4 < line.length && (line[i+4] >= '1' && line[i+4] <= '9')) { ret.num_notes = line[i+4] - '0'; i += 3; } else warn("expected number after the two colons after the triplet to mark the duration", line, i); } else if (i+3 < line.length && (line[i+3] >= '1' && line[i+3] <= '9')) { if (i+4 < line.length && line[i+4] === ':') { if (i+5 < line.length && (line[i+5] >= '1' && line[i+5] <= '9')) { ret.num_notes = line[i+5] - '0'; i += 4;
var letter_to_open_slurs_and_triplets = function(line, i) { // consume spaces, and look for all the open parens. If there is a number after the open paren, // that is a triplet. Otherwise that is a slur. Collect all the slurs and the first triplet. var ret = {}; var start = i; while (line[i] === '(' || tokenizer.isWhiteSpace(line[i])) { if (line[i] === '(') { if (i+1 < line.length && (line[i+1] >= '2' && line[i+1] <= '9')) { if (ret.triplet !== undefined) warn("Can't nest triplets", line, i); else { ret.triplet = line[i+1] - '0'; if (i+2 < line.length && line[i+2] === ':') { // We are expecting "(p:q:r" or "(p:q" or "(p::r" we are only interested in the first number (p) and the number of notes (r) // if r is missing, then it is equal to p. if (i+3 < line.length && line[i+3] === ':') { if (i+4 < line.length && (line[i+4] >= '1' && line[i+4] <= '9')) { ret.num_notes = line[i+4] - '0'; i += 3; } else warn("expected number after the two colons after the triplet to mark the duration", line, i); } else if (i+3 < line.length && (line[i+3] >= '1' && line[i+3] <= '9')) { // ignore this middle number if (i+4 < line.length && line[i+4] === ':') { if (i+5 < line.length && (line[i+5] >= '1' && line[i+5] <= '9')) { ret.num_notes = line[i+5] - '0'; i += 4; } } else { ret.num_notes = ret.triplet; i += 3; } } else warn("expected number after the triplet to mark the duration", line, i); } } i++; } else { if (ret.startSlur === undefined) ret.startSlur = 1; else ret.startSlur++; } } i++; } ret.consumed = i-start; return ret; };
} else warn("expected number after the triplet to mark the duration", line, i); }
} else { ret.num_notes = ret.triplet; i += 3; } } else warn("expected number after the triplet to mark the duration", line, i);
var letter_to_open_slurs_and_triplets = function(line, i) { // consume spaces, and look for all the open parens. If there is a number after the open paren, // that is a triplet. Otherwise that is a slur. Collect all the slurs and the first triplet. var ret = {}; var start = i; while (line[i] === '(' || tokenizer.isWhiteSpace(line[i])) { if (line[i] === '(') { if (i+1 < line.length && (line[i+1] >= '2' && line[i+1] <= '9')) { if (ret.triplet !== undefined) warn("Can't nest triplets", line, i); else { ret.triplet = line[i+1] - '0'; if (i+2 < line.length && line[i+2] === ':') { // We are expecting "(p:q:r" or "(p:q" or "(p::r" we are only interested in the first number (p) and the number of notes (r) // if r is missing, then it is equal to p. if (i+3 < line.length && line[i+3] === ':') { if (i+4 < line.length && (line[i+4] >= '1' && line[i+4] <= '9')) { ret.num_notes = line[i+4] - '0'; i += 3; } else warn("expected number after the two colons after the triplet to mark the duration", line, i); } else if (i+3 < line.length && (line[i+3] >= '1' && line[i+3] <= '9')) { // ignore this middle number if (i+4 < line.length && line[i+4] === ':') { if (i+5 < line.length && (line[i+5] >= '1' && line[i+5] <= '9')) { ret.num_notes = line[i+5] - '0'; i += 4; } } else { ret.num_notes = ret.triplet; i += 3; } } else warn("expected number after the triplet to mark the duration", line, i); } } i++; } else { if (ret.startSlur === undefined) ret.startSlur = 1; else ret.startSlur++; } } i++; } ret.consumed = i-start; return ret; };
i++;
var letter_to_open_slurs_and_triplets = function(line, i) { // consume spaces, and look for all the open parens. If there is a number after the open paren, // that is a triplet. Otherwise that is a slur. Collect all the slurs and the first triplet. var ret = {}; var start = i; while (line[i] === '(' || tokenizer.isWhiteSpace(line[i])) { if (line[i] === '(') { if (i+1 < line.length && (line[i+1] >= '2' && line[i+1] <= '9')) { if (ret.triplet !== undefined) warn("Can't nest triplets", line, i); else { ret.triplet = line[i+1] - '0'; if (i+2 < line.length && line[i+2] === ':') { // We are expecting "(p:q:r" or "(p:q" or "(p::r" we are only interested in the first number (p) and the number of notes (r) // if r is missing, then it is equal to p. if (i+3 < line.length && line[i+3] === ':') { if (i+4 < line.length && (line[i+4] >= '1' && line[i+4] <= '9')) { ret.num_notes = line[i+4] - '0'; i += 3; } else warn("expected number after the two colons after the triplet to mark the duration", line, i); } else if (i+3 < line.length && (line[i+3] >= '1' && line[i+3] <= '9')) { // ignore this middle number if (i+4 < line.length && line[i+4] === ':') { if (i+5 < line.length && (line[i+5] >= '1' && line[i+5] <= '9')) { ret.num_notes = line[i+5] - '0'; i += 4; } } else { ret.num_notes = ret.triplet; i += 3; } } else warn("expected number after the triplet to mark the duration", line, i); } } i++; } else { if (ret.startSlur === undefined) ret.startSlur = 1; else ret.startSlur++; } } i++; } ret.consumed = i-start; return ret; };
else { if (ret.startSlur === undefined) ret.startSlur = 1; else ret.startSlur++; }
i++;
var letter_to_open_slurs_and_triplets = function(line, i) { // consume spaces, and look for all the open parens. If there is a number after the open paren, // that is a triplet. Otherwise that is a slur. Collect all the slurs and the first triplet. var ret = {}; var start = i; while (line[i] === '(' || tokenizer.isWhiteSpace(line[i])) { if (line[i] === '(') { if (i+1 < line.length && (line[i+1] >= '2' && line[i+1] <= '9')) { if (ret.triplet !== undefined) warn("Can't nest triplets", line, i); else { ret.triplet = line[i+1] - '0'; if (i+2 < line.length && line[i+2] === ':') { // We are expecting "(p:q:r" or "(p:q" or "(p::r" we are only interested in the first number (p) and the number of notes (r) // if r is missing, then it is equal to p. if (i+3 < line.length && line[i+3] === ':') { if (i+4 < line.length && (line[i+4] >= '1' && line[i+4] <= '9')) { ret.num_notes = line[i+4] - '0'; i += 3; } else warn("expected number after the two colons after the triplet to mark the duration", line, i); } else if (i+3 < line.length && (line[i+3] >= '1' && line[i+3] <= '9')) { // ignore this middle number if (i+4 < line.length && line[i+4] === ':') { if (i+5 < line.length && (line[i+5] >= '1' && line[i+5] <= '9')) { ret.num_notes = line[i+5] - '0'; i += 4; } } else { ret.num_notes = ret.triplet; i += 3; } } else warn("expected number after the triplet to mark the duration", line, i); } } i++; } else { if (ret.startSlur === undefined) ret.startSlur = 1; else ret.startSlur++; } } i++; } ret.consumed = i-start; return ret; };
i++;
else { if (ret.startSlur === undefined) ret.startSlur = 1; else ret.startSlur++; }
var letter_to_open_slurs_and_triplets = function(line, i) { // consume spaces, and look for all the open parens. If there is a number after the open paren, // that is a triplet. Otherwise that is a slur. Collect all the slurs and the first triplet. var ret = {}; var start = i; while (line[i] === '(' || tokenizer.isWhiteSpace(line[i])) { if (line[i] === '(') { if (i+1 < line.length && (line[i+1] >= '2' && line[i+1] <= '9')) { if (ret.triplet !== undefined) warn("Can't nest triplets", line, i); else { ret.triplet = line[i+1] - '0'; if (i+2 < line.length && line[i+2] === ':') { // We are expecting "(p:q:r" or "(p:q" or "(p::r" we are only interested in the first number (p) and the number of notes (r) // if r is missing, then it is equal to p. if (i+3 < line.length && line[i+3] === ':') { if (i+4 < line.length && (line[i+4] >= '1' && line[i+4] <= '9')) { ret.num_notes = line[i+4] - '0'; i += 3; } else warn("expected number after the two colons after the triplet to mark the duration", line, i); } else if (i+3 < line.length && (line[i+3] >= '1' && line[i+3] <= '9')) { // ignore this middle number if (i+4 < line.length && line[i+4] === ':') { if (i+5 < line.length && (line[i+5] >= '1' && line[i+5] <= '9')) { ret.num_notes = line[i+5] - '0'; i += 4; } } else { ret.num_notes = ret.triplet; i += 3; } } else warn("expected number after the triplet to mark the duration", line, i); } } i++; } else { if (ret.startSlur === undefined) ret.startSlur = 1; else ret.startSlur++; } } i++; } ret.consumed = i-start; return ret; };
ret.consumed = i-start; return ret; };
i++; } ret.consumed = i-start; return ret; };
var letter_to_open_slurs_and_triplets = function(line, i) { // consume spaces, and look for all the open parens. If there is a number after the open paren, // that is a triplet. Otherwise that is a slur. Collect all the slurs and the first triplet. var ret = {}; var start = i; while (line[i] === '(' || tokenizer.isWhiteSpace(line[i])) { if (line[i] === '(') { if (i+1 < line.length && (line[i+1] >= '2' && line[i+1] <= '9')) { if (ret.triplet !== undefined) warn("Can't nest triplets", line, i); else { ret.triplet = line[i+1] - '0'; if (i+2 < line.length && line[i+2] === ':') { // We are expecting "(p:q:r" or "(p:q" or "(p::r" we are only interested in the first number (p) and the number of notes (r) // if r is missing, then it is equal to p. if (i+3 < line.length && line[i+3] === ':') { if (i+4 < line.length && (line[i+4] >= '1' && line[i+4] <= '9')) { ret.num_notes = line[i+4] - '0'; i += 3; } else warn("expected number after the two colons after the triplet to mark the duration", line, i); } else if (i+3 < line.length && (line[i+3] >= '1' && line[i+3] <= '9')) { // ignore this middle number if (i+4 < line.length && line[i+4] === ':') { if (i+5 < line.length && (line[i+5] >= '1' && line[i+5] <= '9')) { ret.num_notes = line[i+5] - '0'; i += 4; } } else { ret.num_notes = ret.triplet; i += 3; } } else warn("expected number after the triplet to mark the duration", line, i); } } i++; } else { if (ret.startSlur === undefined) ret.startSlur = 1; else ret.startSlur++; } } i++; } ret.consumed = i-start; return ret; };
let dirs = abManager.directories;
let dirs = services.get("abManager").directories;
list: function (filter, newMail) { let addresses = []; let dirs = abManager.directories; let lowerFilter = filter.toLowerCase(); while (dirs.hasMoreElements()) { let addrbook = dirs.getNext().QueryInterface(Ci.nsIAbDirectory); let cards = addrbook.childCards; while (cards.hasMoreElements()) { let card = cards.getNext().QueryInterface(Ci.nsIAbCard); //var mail = card.primaryEmail || ""; //XXX let displayName = card.displayName; if (!displayName) displayName = this.generateDisplayName(card.firstName, card.lastName); if (displayName.toLowerCase().indexOf(lowerFilter) > -1 || card.primaryEmail.toLowerCase().indexOf(lowerFilter) > -1) addresses.push([displayName, card.primaryEmail]); } } if (addresses.length < 1) { if (!filter) liberator.echoerr("Exxx: No contacts", commandline.FORCE_SINGLELINE); else liberator.echoerr("Exxx: No contacts matching string '" + filter + "'", commandline.FORCE_SINGLELINE); return false; } if (newMail) { // Now we have to create a new message let args = {}; args.to = addresses.map( function (address) "\"" + address[0].replace(/"/g, "") + " <" + address[1] + ">\"" ).join(", "); mail.composeNewMail(args); } else { let list = template.tabular(["Name", "Address"], [], [[util.clip(address[0], 50), address[1]] for ([, address] in Iterator(addresses))] ); commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE); } return true; }
if (initFunction)
if (initFunction) {
var listenerFunction = function() { GEvent.removeListener(listenerHandler); if (initFunction) initFunction(scope.map, windowLocation, initFunctionParam); };
}
var listenerFunction = function() { GEvent.removeListener(listenerHandler); if (initFunction) initFunction(scope.map, windowLocation, initFunctionParam); };
l.on('selectionChange',function(m){var n=l.getCommand('unlink'),o=m.data.path.lastElement.getAscendant('a',true);if(o&&o.getName()=='a'&&o.getAttribute('href'))n.setState(2);else n.setState(0);});if(l.addMenuItems)l.addMenuItems({anchor:{label:l.lang.anchor.menu,command:'anchor',group:'anchor'},link:{label:l.lang.link.menu,command:'link',group:'link',order:1},unlink:{label:l.lang.unlink,command:'unlink',group:'link',order:5}});if(l.contextMenu)l.contextMenu.addListener(function(m,n){if(!m)return null;var o=m.is('img')&&m.getAttribute('_cke_real_element_type')=='anchor';if(!o){if(!(m=j.link.getSelectedLink(l)))return null;o=m.getAttribute('name')&&!m.getAttribute('href');}return o?{anchor:2}:{link:2,unlink:2};});},afterInit:function(l){var m=l.dataProcessor,n=m&&m.dataFilter;if(n)n.addRules({elements:{a:function(o){var p=o.attributes;if(p.name&&!p.href)return l.createFakeParserElement(o,'cke_anchor','anchor');}}});},requires:['fakeobjects']});j.link={getSelectedLink:function(l){var m;try{m=l.getSelection().getRanges()[0];}catch(o){return null;}m.shrink(a.SHRINK_TEXT);var n=m.getCommonAncestor();return n.getAscendant('a',true);}};a.unlinkCommand=function(){};a.unlinkCommand.prototype={exec:function(l){var m=l.getSelection(),n=m.createBookmarks(),o=m.getRanges(),p,q;for(var r=0;r<o.length;r++){p=o[r].getCommonAncestor(true);q=p.getAscendant('a',true);if(!q)continue;o[r].selectNodeContents(q);}m.selectRanges(o);l.document.$.execCommand('unlink',false,null);m.selectBookmarks(n);},startDisabled:true};e.extend(i,{linkShowAdvancedTab:true,linkShowTargetTab:true});(function(){var l={ol:1,ul:1},m=/^[\n\r\t ]*$/;j.list={listToArray:function(A,B,C,D,E){if(!l[A.getName()])return[];if(!D)D=0;if(!C)C=[];for(var F=0,G=A.getChildCount();F<G;F++){var H=A.getChild(F);if(H.$.nodeName.toLowerCase()!='li')continue;var I={parent:A,indent:D,element:H,contents:[]};if(!E){I.grandparent=A.getParent();if(I.grandparent&&I.grandparent.$.nodeName.toLowerCase()=='li')I.grandparent=I.grandparent.getParent();}else I.grandparent=E;if(B)h.setMarker(B,H,'listarray_index',C.length);C.push(I);for(var J=0,K=H.getChildCount(),L;J<K;J++){L=H.getChild(J);if(L.type==1&&l[L.getName()])j.list.listToArray(L,B,C,D+1,I.grandparent);else I.contents.push(L);}}return C;},arrayToList:function(A,B,C,D){if(!C)C=0;if(!A||A.length<C+1)return null;var E=A[C].parent.getDocument(),F=new d.documentFragment(E),G=null,H=C,I=Math.max(A[C].indent,0),J=null,K=D==1?'p':'div';for(;;){var L=A[H];if(L.indent==I){if(!G||A[H].parent.getName()!=G.getName()){G=A[H].parent.clone(false,true);
for(var r=0;r<o.length;r++){p=o[r].getCommonAncestor(true);q=p.getAscendant('a',true);if(!q)continue;o[r].selectNodeContents(q);}m.selectRanges(o);l.document.$.execCommand('unlink',false,null);m.selectBookmarks(n);},startDisabled:true};e.extend(i,{linkShowAdvancedTab:true,linkShowTargetTab:true});(function(){var l={ol:1,ul:1},m=/^[\n\r\t ]*$/;j.list={listToArray:function(B,C,D,E,F){if(!l[B.getName()])return[];if(!E)E=0;if(!D)D=[];for(var G=0,H=B.getChildCount();G<H;G++){var I=B.getChild(G);if(I.$.nodeName.toLowerCase()!='li')continue;var J={parent:B,indent:E,element:I,contents:[]};if(!F){J.grandparent=B.getParent();if(J.grandparent&&J.grandparent.$.nodeName.toLowerCase()=='li')J.grandparent=J.grandparent.getParent();}else J.grandparent=F;if(C)h.setMarker(C,I,'listarray_index',D.length);D.push(J);for(var K=0,L=I.getChildCount(),M;K<L;K++){M=I.getChild(K);if(M.type==1&&l[M.getName()])j.list.listToArray(M,C,D,E+1,J.grandparent);else J.contents.push(M);}}return D;},arrayToList:function(B,C,D,E,F){if(!D)D=0;if(!B||B.length<D+1)return null;var G=B[D].parent.getDocument(),H=new d.documentFragment(G),I=null,J=D,K=Math.max(B[D].indent,0),L=null,M=E==1?'p':'div';for(;;){var N=B[J];if(N.indent==K){if(!I||B[J].parent.getName()!=I.getName()){I=B[J].parent.clone(false,true);H.append(I);}L=I.append(N.element.clone(false,true));for(var O=0;O<N.contents.length;O++)L.append(N.contents[O].clone(true,true));J++;}else if(N.indent==Math.max(K,0)+1){var P=j.list.arrayToList(B,null,J,E);L.append(P.listNode);J=P.nextIndex;}else if(N.indent==-1&&!D&&N.grandparent){L;if(l[N.grandparent.getName()])L=N.element.clone(false,true);else if(F||E!=2&&N.grandparent.getName()!='td'){L=G.createElement(M);if(F)L.setAttribute('dir',F);}else L=new d.documentFragment(G);for(O=0;O<N.contents.length;O++)L.append(N.contents[O].clone(true,true));if(L.type==11&&J!=B.length-1){if(L.getLast()&&L.getLast().type==1&&L.getLast().getAttribute('type')=='_moz')L.getLast().remove();L.appendBogus();}if(L.type==1&&L.getName()==M&&L.$.firstChild){L.trim();var Q=L.getFirst();if(Q.type==1&&Q.isBlockBoundary()){var R=new d.documentFragment(G);L.moveChildren(R);L=R;}}var S=L.$.nodeName.toLowerCase();if(!c&&(S=='div'||S=='p'))L.appendBogus();H.append(L);I=null;J++;}else return null;if(B.length<=J||Math.max(B[J].indent,0)<K)break;}if(C){var T=H.getFirst();while(T){if(T.type==1)h.clearMarkers(C,T);T=T.getNextSourceNode();}}return{listNode:H,nextIndex:J};}};function n(B,C){B.getCommand(this.name).setState(C);};function o(B){var C=B.data.path,D=C.blockLimit,E=C.elements,F;
l.on('selectionChange',function(m){var n=l.getCommand('unlink'),o=m.data.path.lastElement.getAscendant('a',true);if(o&&o.getName()=='a'&&o.getAttribute('href'))n.setState(2);else n.setState(0);});if(l.addMenuItems)l.addMenuItems({anchor:{label:l.lang.anchor.menu,command:'anchor',group:'anchor'},link:{label:l.lang.link.menu,command:'link',group:'link',order:1},unlink:{label:l.lang.unlink,command:'unlink',group:'link',order:5}});if(l.contextMenu)l.contextMenu.addListener(function(m,n){if(!m)return null;var o=m.is('img')&&m.getAttribute('_cke_real_element_type')=='anchor';if(!o){if(!(m=j.link.getSelectedLink(l)))return null;o=m.getAttribute('name')&&!m.getAttribute('href');}return o?{anchor:2}:{link:2,unlink:2};});},afterInit:function(l){var m=l.dataProcessor,n=m&&m.dataFilter;if(n)n.addRules({elements:{a:function(o){var p=o.attributes;if(p.name&&!p.href)return l.createFakeParserElement(o,'cke_anchor','anchor');}}});},requires:['fakeobjects']});j.link={getSelectedLink:function(l){var m;try{m=l.getSelection().getRanges()[0];}catch(o){return null;}m.shrink(a.SHRINK_TEXT);var n=m.getCommonAncestor();return n.getAscendant('a',true);}};a.unlinkCommand=function(){};a.unlinkCommand.prototype={exec:function(l){var m=l.getSelection(),n=m.createBookmarks(),o=m.getRanges(),p,q;for(var r=0;r<o.length;r++){p=o[r].getCommonAncestor(true);q=p.getAscendant('a',true);if(!q)continue;o[r].selectNodeContents(q);}m.selectRanges(o);l.document.$.execCommand('unlink',false,null);m.selectBookmarks(n);},startDisabled:true};e.extend(i,{linkShowAdvancedTab:true,linkShowTargetTab:true});(function(){var l={ol:1,ul:1},m=/^[\n\r\t ]*$/;j.list={listToArray:function(A,B,C,D,E){if(!l[A.getName()])return[];if(!D)D=0;if(!C)C=[];for(var F=0,G=A.getChildCount();F<G;F++){var H=A.getChild(F);if(H.$.nodeName.toLowerCase()!='li')continue;var I={parent:A,indent:D,element:H,contents:[]};if(!E){I.grandparent=A.getParent();if(I.grandparent&&I.grandparent.$.nodeName.toLowerCase()=='li')I.grandparent=I.grandparent.getParent();}else I.grandparent=E;if(B)h.setMarker(B,H,'listarray_index',C.length);C.push(I);for(var J=0,K=H.getChildCount(),L;J<K;J++){L=H.getChild(J);if(L.type==1&&l[L.getName()])j.list.listToArray(L,B,C,D+1,I.grandparent);else I.contents.push(L);}}return C;},arrayToList:function(A,B,C,D){if(!C)C=0;if(!A||A.length<C+1)return null;var E=A[C].parent.getDocument(),F=new d.documentFragment(E),G=null,H=C,I=Math.max(A[C].indent,0),J=null,K=D==1?'p':'div';for(;;){var L=A[H];if(L.indent==I){if(!G||A[H].parent.getName()!=G.getName()){G=A[H].parent.clone(false,true);
filename = AssetCompress.classUrl + buildName.reverse().join('-') + '?file[]=' + args.join('&file[]=');
filename = AssetCompress.classUrl + AssetCompress.underscore(buildName.reverse().join('')) + '.js' + '?file[]=' + args.join('&file[]=');
AssetCompress.load = function () { function _appendScript(filename, callback) { var head = document.getElementsByTagName("head")[0]; var script = document.createElement("script"); script.src = filename; var done = false; script.onload = script.onreadystatechange = function () { if (!done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") ) { done = true; callback(); } } head.appendChild(script); } var args = Array.prototype.slice.call(arguments), readyCallback = function () {}, buildName = [], i, className, filename; if (typeof args[args.length -1] == 'function') { readyCallback = args.pop(); } for (i = args.length; i--;) { className = args[i]; buildName.push(className); if (window[className] !== undefined) { delete args[i]; } } filename = AssetCompress.classUrl + buildName.reverse().join('-') + '?file[]=' + args.join('&file[]='); _appendScript(filename, readyCallback);};
if (maskConf) { $.mask.load(overlay, maskConf); }
if (maskConf) { $(overlay).expose(maskConf); }
load: function(e) { // can be opened only once if (self.isOpened()) { return self; } // find the effect var eff = effects[conf.effect]; if (!eff) { throw "Overlay: cannot find effect : \"" + conf.effect + "\""; } // close other instances? if (conf.oneInstance) { $.each(instances, function() { this.close(e); }); } // onBeforeLoad e = e || $.Event(); e.type = "onBeforeLoad"; fire.trigger(e); if (e.isDefaultPrevented()) { return self; } // opened opened = true; // possible mask effect if (maskConf) { $.mask.load(overlay, maskConf); } // position & dimensions var top = conf.top, left = conf.left, oWidth = overlay.outerWidth({margin:true}), oHeight = overlay.outerHeight({margin:true}); if (typeof top == 'string') { top = top == 'center' ? Math.max((w.height() - oHeight) / 2, 0) : parseInt(top, 10) / 100 * w.height(); } if (left == 'center') { left = Math.max((w.width() - oWidth) / 2, 0); } if (!conf.absolute) { top += w.scrollTop(); left += w.scrollLeft(); } // position overlay overlay.css({position: conf.fixed ? 'fixed' : 'absolute'}).css({top: top, left: left}); // load effect eff[0].call(self, function() { if (opened) { e.type = "onLoad"; fire.trigger(e); } }); // mask.click closes overlay if (maskConf) { $.mask.getMask().one("click", self.close); } // when window is clicked outside overlay, we close if (conf.closeOnClick) { $(document).bind("click." + uid, function(e) { if (!$(e.target).parents(overlay).length) { self.close(e); } }); } // keyboard::escape if (conf.closeOnEsc) { // one callback is enough if multiple instances are loaded simultaneously $(document).bind("keydown." + uid, function(e) { if (e.keyCode == 27) { self.close(e); } }); } return self; },
if (!conf.absolute) { top += w.scrollTop(); left += w.scrollLeft(); } overlay.css({position: conf.fixed ? 'fixed' : 'absolute'}).css({top: top, left: left});
load: function(e) { // can be opened only once if (self.isOpened()) { return self; } // find the effect var eff = effects[conf.effect]; if (!eff) { throw "Overlay: cannot find effect : \"" + conf.effect + "\""; } // close other instances? if (conf.oneInstance) { $.each(instances, function() { this.close(e); }); } // onBeforeLoad e = e || $.Event(); e.type = "onBeforeLoad"; fire.trigger(e); if (e.isDefaultPrevented()) { return self; } // opened opened = true; // possible mask effect if (maskConf) { $.mask.load(overlay, maskConf); } // position & dimensions var top = conf.top, left = conf.left, oWidth = overlay.outerWidth({margin:true}), oHeight = overlay.outerHeight({margin:true}); if (typeof top == 'string') { top = top == 'center' ? Math.max((w.height() - oHeight) / 2, 0) : parseInt(top, 10) / 100 * w.height(); } if (left == 'center') { left = Math.max((w.width() - oWidth) / 2, 0); } if (!conf.absolute) { top += w.scrollTop(); left += w.scrollLeft(); } // position overlay overlay.css({position: conf.fixed ? 'fixed' : 'absolute'}).css({top: top, left: left}); // load effect eff[0].call(self, function() { if (opened) { e.type = "onLoad"; fire.trigger(e); } }); // mask.click closes overlay if (maskConf) { $.mask.getMask().one("click", self.close); } // when window is clicked outside overlay, we close if (conf.closeOnClick) { $(document).bind("click." + uid, function(e) { if (!$(e.target).parents(overlay).length) { self.close(e); } }); } // keyboard::escape if (conf.closeOnEsc) { // one callback is enough if multiple instances are loaded simultaneously $(document).bind("keydown." + uid, function(e) { if (e.keyCode == 27) { self.close(e); } }); } return self; },
eff[0].call(self, function() {
eff[0].call(self, {top: top, left: left}, function() {
load: function(e) { // can be opened only once if (self.isOpened()) { return self; } // find the effect var eff = effects[conf.effect]; if (!eff) { throw "Overlay: cannot find effect : \"" + conf.effect + "\""; } // close other instances? if (conf.oneInstance) { $.each(instances, function() { this.close(e); }); } // onBeforeLoad e = e || $.Event(); e.type = "onBeforeLoad"; fire.trigger(e); if (e.isDefaultPrevented()) { return self; } // opened opened = true; // possible mask effect if (maskConf) { $.mask.load(overlay, maskConf); } // position & dimensions var top = conf.top, left = conf.left, oWidth = overlay.outerWidth({margin:true}), oHeight = overlay.outerHeight({margin:true}); if (typeof top == 'string') { top = top == 'center' ? Math.max((w.height() - oHeight) / 2, 0) : parseInt(top, 10) / 100 * w.height(); } if (left == 'center') { left = Math.max((w.width() - oWidth) / 2, 0); } if (!conf.absolute) { top += w.scrollTop(); left += w.scrollLeft(); } // position overlay overlay.css({position: conf.fixed ? 'fixed' : 'absolute'}).css({top: top, left: left}); // load effect eff[0].call(self, function() { if (opened) { e.type = "onLoad"; fire.trigger(e); } }); // mask.click closes overlay if (maskConf) { $.mask.getMask().one("click", self.close); } // when window is clicked outside overlay, we close if (conf.closeOnClick) { $(document).bind("click." + uid, function(e) { if (!$(e.target).parents(overlay).length) { self.close(e); } }); } // keyboard::escape if (conf.closeOnEsc) { // one callback is enough if multiple instances are loaded simultaneously $(document).bind("keydown." + uid, function(e) { if (e.keyCode == 27) { self.close(e); } }); } return self; },
if (maskConf) {
if (maskConf && conf.closeOnClick) {
load: function(e) { // can be opened only once if (self.isOpened()) { return self; } // find the effect var eff = effects[conf.effect]; if (!eff) { throw "Overlay: cannot find effect : \"" + conf.effect + "\""; } // close other instances? if (conf.oneInstance) { $.each(instances, function() { this.close(e); }); } // onBeforeLoad e = e || $.Event(); e.type = "onBeforeLoad"; fire.trigger(e); if (e.isDefaultPrevented()) { return self; } // opened opened = true; // possible mask effect if (maskConf) { $.mask.load(overlay, maskConf); } // position & dimensions var top = conf.top, left = conf.left, oWidth = overlay.outerWidth({margin:true}), oHeight = overlay.outerHeight({margin:true}); if (typeof top == 'string') { top = top == 'center' ? Math.max((w.height() - oHeight) / 2, 0) : parseInt(top, 10) / 100 * w.height(); } if (left == 'center') { left = Math.max((w.width() - oWidth) / 2, 0); } if (!conf.absolute) { top += w.scrollTop(); left += w.scrollLeft(); } // position overlay overlay.css({position: conf.fixed ? 'fixed' : 'absolute'}).css({top: top, left: left}); // load effect eff[0].call(self, function() { if (opened) { e.type = "onLoad"; fire.trigger(e); } }); // mask.click closes overlay if (maskConf) { $.mask.getMask().one("click", self.close); } // when window is clicked outside overlay, we close if (conf.closeOnClick) { $(document).bind("click." + uid, function(e) { if (!$(e.target).parents(overlay).length) { self.close(e); } }); } // keyboard::escape if (conf.closeOnEsc) { // one callback is enough if multiple instances are loaded simultaneously $(document).bind("keydown." + uid, function(e) { if (e.keyCode == 27) { self.close(e); } }); } return self; },
App.load = function () {
AssetCompress.load = function () {
App.load = function () { function _appendScript(filename, callback) { var head = document.getElementsByTagName("head")[0]; var script = document.createElement("script"); script.src = filename; var done = false; script.onload = script.onreadystatechange = function () { if (!done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") ) { done = true; callback(); } } head.appendChild(script); } var args = Array.prototype.slice.call(arguments); var readyCallback = function () {}; if (typeof args[args.length -1] == 'function') { readyCallback = args.pop(); } for (var i = args.length; i; i--) { var className = args[i]; if (window.className !== undefined) { delete args[i]; } } var filename = App.classUrl + args.join('/'); _appendScript(filename, readyCallback);};
if (window.className !== undefined) {
if (window[className] !== undefined) {
App.load = function () { function _appendScript(filename, callback) { var head = document.getElementsByTagName("head")[0]; var script = document.createElement("script"); script.src = filename; var done = false; script.onload = script.onreadystatechange = function () { if (!done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") ) { done = true; callback(); } } head.appendChild(script); } var args = Array.prototype.slice.call(arguments); var readyCallback = function () {}; if (typeof args[args.length -1] == 'function') { readyCallback = args.pop(); } for (var i = args.length; i; i--) { var className = args[i]; if (window.className !== undefined) { delete args[i]; } } var filename = App.classUrl + args.join('/'); _appendScript(filename, readyCallback);};
for (var i = args.length; i; i--) {
var buildName = []; for (var i = args.length; i--;) {
AssetCompress.load = function () { function _appendScript(filename, callback) { var head = document.getElementsByTagName("head")[0]; var script = document.createElement("script"); script.src = filename; var done = false; script.onload = script.onreadystatechange = function () { if (!done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") ) { done = true; callback(); } } head.appendChild(script); } var args = Array.prototype.slice.call(arguments); var readyCallback = function () {}; if (typeof args[args.length -1] == 'function') { readyCallback = args.pop(); } for (var i = args.length; i; i--) { var className = args[i]; if (window[className] !== undefined) { delete args[i]; } } var filename = App.classUrl + args.join('/'); _appendScript(filename, readyCallback);};
var filename = App.classUrl + args.join('/');
var filename = AssetCompress.classUrl + buildName.reverse().join('-') + '?file[]=' + args.join('&file[]=');
AssetCompress.load = function () { function _appendScript(filename, callback) { var head = document.getElementsByTagName("head")[0]; var script = document.createElement("script"); script.src = filename; var done = false; script.onload = script.onreadystatechange = function () { if (!done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") ) { done = true; callback(); } } head.appendChild(script); } var args = Array.prototype.slice.call(arguments); var readyCallback = function () {}; if (typeof args[args.length -1] == 'function') { readyCallback = args.pop(); } for (var i = args.length; i; i--) { var className = args[i]; if (window[className] !== undefined) { delete args[i]; } } var filename = App.classUrl + args.join('/'); _appendScript(filename, readyCallback);};
load: function(els, conf) {
load: function(conf, els) {
load: function(els, conf) { // already loaded ? if (loaded) { return this; } // configuration if (typeof conf == 'string') { conf = {color: conf}; } exposed = els; // use latest config conf = conf || config; config = conf = $.extend($.extend({}, tool.conf), conf); // get the mask mask = $("#" + conf.maskId); // or create it if (!mask.length) { mask = $('<div/>').attr("id", conf.maskId); $("body").append(mask); } // set position and dimensions var size = viewport(); mask.css({ position:'absolute', top: 0, left: 0, width: size[0], height: size[1], display: 'none', opacity: conf.startOpacity, zIndex: conf.zIndex }); // background color var bg = mask.css("backgroundColor"); if (!bg || bg == 'transparent' || bg == 'rgba(0, 0, 0, 0)') { mask.css("backgroundColor", conf.color); } // onBeforeLoad if (call(conf.onBeforeLoad) === false) { return this; } // esc button if (conf.closeOnEsc) { $(document).bind("keydown.mask", function(e) { if (e.keyCode == 27) { $.mask.close(e); } }); } // mask click closes if (conf.closeOnClick) { mask.bind("click.mask", function(e) { $.mask.close(e); }); } // resize mask when window is resized $(window).bind("resize.mask", function() { $.mask.fit(); }); // exposed elements if (els && els.length) { overlayIndex = els.eq(0).css("zIndex"); // make sure element is positioned absolutely or relatively $.each(els, function() { var el = $(this); if (!/relative|absolute|fixed/i.test(el.css("position"))) { el.css("position", "relative"); } }); // make elements sit on top of the mask els.css({zIndex:Math.max(conf.zIndex + 1, overlayIndex == 'auto' ? 0 : overlayIndex)}); } // reveal mask mask.css({display: 'block'}).fadeTo(conf.loadSpeed, conf.opacity, function() { $.mask.fit(); call(conf.onLoad); }); loaded = true; return this; },
exposed = els;
load: function(els, conf) { // already loaded ? if (loaded) { return this; } // configuration if (typeof conf == 'string') { conf = {color: conf}; } exposed = els; // use latest config conf = conf || config; config = conf = $.extend($.extend({}, tool.conf), conf); // get the mask mask = $("#" + conf.maskId); // or create it if (!mask.length) { mask = $('<div/>').attr("id", conf.maskId); $("body").append(mask); } // set position and dimensions var size = viewport(); mask.css({ position:'absolute', top: 0, left: 0, width: size[0], height: size[1], display: 'none', opacity: conf.startOpacity, zIndex: conf.zIndex }); // background color var bg = mask.css("backgroundColor"); if (!bg || bg == 'transparent' || bg == 'rgba(0, 0, 0, 0)') { mask.css("backgroundColor", conf.color); } // onBeforeLoad if (call(conf.onBeforeLoad) === false) { return this; } // esc button if (conf.closeOnEsc) { $(document).bind("keydown.mask", function(e) { if (e.keyCode == 27) { $.mask.close(e); } }); } // mask click closes if (conf.closeOnClick) { mask.bind("click.mask", function(e) { $.mask.close(e); }); } // resize mask when window is resized $(window).bind("resize.mask", function() { $.mask.fit(); }); // exposed elements if (els && els.length) { overlayIndex = els.eq(0).css("zIndex"); // make sure element is positioned absolutely or relatively $.each(els, function() { var el = $(this); if (!/relative|absolute|fixed/i.test(el.css("position"))) { el.css("position", "relative"); } }); // make elements sit on top of the mask els.css({zIndex:Math.max(conf.zIndex + 1, overlayIndex == 'auto' ? 0 : overlayIndex)}); } // reveal mask mask.css({display: 'block'}).fadeTo(conf.loadSpeed, conf.opacity, function() { $.mask.fit(); call(conf.onLoad); }); loaded = true; return this; },
els.css({zIndex:Math.max(conf.zIndex + 1, overlayIndex == 'auto' ? 0 : overlayIndex)});
exposed = els.css({zIndex:Math.max(conf.zIndex + 1, overlayIndex == 'auto' ? 0 : overlayIndex)});
load: function(els, conf) { // already loaded ? if (loaded) { return this; } // configuration if (typeof conf == 'string') { conf = {color: conf}; } exposed = els; // use latest config conf = conf || config; config = conf = $.extend($.extend({}, tool.conf), conf); // get the mask mask = $("#" + conf.maskId); // or create it if (!mask.length) { mask = $('<div/>').attr("id", conf.maskId); $("body").append(mask); } // set position and dimensions var size = viewport(); mask.css({ position:'absolute', top: 0, left: 0, width: size[0], height: size[1], display: 'none', opacity: conf.startOpacity, zIndex: conf.zIndex }); // background color var bg = mask.css("backgroundColor"); if (!bg || bg == 'transparent' || bg == 'rgba(0, 0, 0, 0)') { mask.css("backgroundColor", conf.color); } // onBeforeLoad if (call(conf.onBeforeLoad) === false) { return this; } // esc button if (conf.closeOnEsc) { $(document).bind("keydown.mask", function(e) { if (e.keyCode == 27) { $.mask.close(e); } }); } // mask click closes if (conf.closeOnClick) { mask.bind("click.mask", function(e) { $.mask.close(e); }); } // resize mask when window is resized $(window).bind("resize.mask", function() { $.mask.fit(); }); // exposed elements if (els && els.length) { overlayIndex = els.eq(0).css("zIndex"); // make sure element is positioned absolutely or relatively $.each(els, function() { var el = $(this); if (!/relative|absolute|fixed/i.test(el.css("position"))) { el.css("position", "relative"); } }); // make elements sit on top of the mask els.css({zIndex:Math.max(conf.zIndex + 1, overlayIndex == 'auto' ? 0 : overlayIndex)}); } // reveal mask mask.css({display: 'block'}).fadeTo(conf.loadSpeed, conf.opacity, function() { $.mask.fit(); call(conf.onLoad); }); loaded = true; return this; },
self.bind("onLoad.tmp", function() {
$(self).bind("onLoad.tmp", function() {
load: function(begin, end) { // filtered set of nodes var nodes = null, preload = arguments[arguments.length -1] === true; if (begin && begin.jquery) { nodes = begin.filter(function() { return els.index(this) >= 0; }); } else { nodes = begin >= 0 ? els.slice(begin, end || begin + 1) : els; } // loop trough nodes nodes.each(function(index) { var el = $(this); // already loaded --> skip. if (el.is(":loaded")) { return effects[conf.effect].call(self, el, function() {}); } // loop trough loaders $.each(loaders, function(matcher, loader) { if (el.is(matcher) && $.isFunction(loader[1])) { // match found var e = new $.Event("onBeforeLoad"); trigger.trigger(e, [el]); // loading cancelled by user if (e.isDefaultPrevented()) { return false; } // start loading el.addClass(css.loading); loader[1].call(self, el, function(error) { // loading failed if (error) { return trigger.trigger("onError", [el, error]); } function setLoaded() { // loaded flag el.data("loaded", true); // CSS class names el.removeClass(css.before).removeClass(css.loading); if (css.after) { el.addClass(css.after); } // onLoad callback trigger.trigger("onLoad", [el]); } if (preload) { // mark as loaded setLoaded(); } else { // perform effect and mark loaded effects[conf.effect].call(self, el, setLoaded); } }); } }); }); // onLoadAll callback self.bind("onLoad.tmp", function() { if (!nodes.not(":loaded").length) { trigger.trigger("onLoadAll", [nodes], preload); self.unbind("onLoad.tmp"); } }); return self; },
self.unbind("onLoad.tmp");
$(self).unbind("onLoad.tmp");
load: function(begin, end) { // filtered set of nodes var nodes = null, preload = arguments[arguments.length -1] === true; if (begin && begin.jquery) { nodes = begin.filter(function() { return els.index(this) >= 0; }); } else { nodes = begin >= 0 ? els.slice(begin, end || begin + 1) : els; } // loop trough nodes nodes.each(function(index) { var el = $(this); // already loaded --> skip. if (el.is(":loaded")) { return effects[conf.effect].call(self, el, function() {}); } // loop trough loaders $.each(loaders, function(matcher, loader) { if (el.is(matcher) && $.isFunction(loader[1])) { // match found var e = new $.Event("onBeforeLoad"); trigger.trigger(e, [el]); // loading cancelled by user if (e.isDefaultPrevented()) { return false; } // start loading el.addClass(css.loading); loader[1].call(self, el, function(error) { // loading failed if (error) { return trigger.trigger("onError", [el, error]); } function setLoaded() { // loaded flag el.data("loaded", true); // CSS class names el.removeClass(css.before).removeClass(css.loading); if (css.after) { el.addClass(css.after); } // onLoad callback trigger.trigger("onLoad", [el]); } if (preload) { // mark as loaded setLoaded(); } else { // perform effect and mark loaded effects[conf.effect].call(self, el, setLoaded); } }); } }); }); // onLoadAll callback self.bind("onLoad.tmp", function() { if (!nodes.not(":loaded").length) { trigger.trigger("onLoadAll", [nodes], preload); self.unbind("onLoad.tmp"); } }); return self; },
$('#chooseExtra').dialog({ autoOpen: false, draggable: false, resizable: false, modal: true,
$('#chooseExtra').dialog({ autoOpen: false, draggable: false, resizable: false, modal: true, width: 500,
load: function() { // set correct $('input.block_extra_id').each(function() { jsBackend.pages.extras.changeExtra($(this).val(), $(this).attr('id').replace('blockExtraId', '')); }) // initialize the modal for choosing an extra if($('#chooseExtra').length > 0) { $('#chooseExtra').dialog({ autoOpen: false, draggable: false, resizable: false, modal: true, buttons: { '{$lblOK|ucfirst}': function() { // change the extra for real jsBackend.pages.extras.changeExtra(); // close dialog $(this).dialog('close'); }, '{$lblCancel|ucfirst}': function() { // empty the extraForBlock $('#extraForBlock').val(''); // close the dialog $(this).dialog('close'); } } }); } if($('#chooseTemplate').length > 0) { $('#chooseTemplate').dialog({ autoOpen: false, draggable: false, resizable: false, modal: true, width: 500, buttons: { '{$lblOK|ucfirst}': function() { if($('#templateList input:radio:checked').val() != $('#templateId').val()) { // empty extra's $('.block_extra_id').val(''); // change the template for real jsBackend.pages.template.changeTemplate(); } // close dialog $(this).dialog('close'); }, '{$lblCancel|ucfirst}': function() { // close the dialog $(this).dialog('close'); } } }); } },
if (conf.color) {
var bg = mask.css("backgroundColor"); if (!bg || bg == 'transparent' || bg == 'rgba(0, 0, 0, 0)') {
load: function(els, conf) { // already loaded ? if (loaded) { return this; } // configuration if (typeof conf == 'string') { conf = {color: conf}; } config = conf = $.extend($.extend({}, tool.conf), conf); // get the mask mask = $("#" + conf.maskId); // or create it if (!mask.length) { mask = $('<div/>').attr("id", conf.maskId); $("body").append(mask); } // set position and dimensions var size = viewport(); mask.css({ position:'absolute', top: 0, left: 0, width: size[0], height: size[1], display: 'none', opacity: conf.startOpacity, zIndex: conf.zIndex }); // background color if (conf.color) { mask.css("backgroundColor", conf.color); } // onBeforeLoad if (call(conf.onBeforeLoad) === false) { return this; } // esc button if (conf.closeOnEsc) { $(document).bind("keydown.mask", function(e) { if (e.keyCode == 27) { $.mask.close(e); } }); } // mask click closes if (conf.closeOnClick) { mask.bind("click.mask", function(e) { $.mask.close(e); }); } // resize mask when window is resized $(window).bind("resize.mask", function() { $.mask.fit(); }); // exposed elements if (els && els.length) { overlayIndex = els.eq(0).css("zIndex"); // make sure element is positioned absolutely or relatively $.each(els, function() { var el = $(this); if (!/relative|absolute|fixed/i.test(el.css("position"))) { el.css("position", "relative"); } }); // make elements sit on top of the mask exposed = els.css({zIndex:Math.max(conf.zIndex + 1, overlayIndex == 'auto' ? 0 : overlayIndex)}); } // reveal mask mask.css({display: 'block'}).fadeTo(conf.loadSpeed, conf.opacity, function() { $.mask.fit(); call(conf.onLoad); }); loaded = true; return this; },
exposed = els.css({zIndex:Math.max(conf.zIndex + 1, overlayIndex == 'auto' ? 0 : overlayIndex)});
els.css({zIndex:Math.max(conf.zIndex + 1, overlayIndex == 'auto' ? 0 : overlayIndex)});
load: function(els, conf) { // already loaded ? if (loaded) { return this; } // configuration if (typeof conf == 'string') { conf = {color: conf}; } config = conf = $.extend($.extend({}, tool.conf), conf); // get the mask mask = $("#" + conf.maskId); // or create it if (!mask.length) { mask = $('<div/>').attr("id", conf.maskId); $("body").append(mask); } // set position and dimensions var size = viewport(); mask.css({ position:'absolute', top: 0, left: 0, width: size[0], height: size[1], display: 'none', opacity: conf.startOpacity, zIndex: conf.zIndex }); // background color if (conf.color) { mask.css("backgroundColor", conf.color); } // onBeforeLoad if (call(conf.onBeforeLoad) === false) { return this; } // esc button if (conf.closeOnEsc) { $(document).bind("keydown.mask", function(e) { if (e.keyCode == 27) { $.mask.close(e); } }); } // mask click closes if (conf.closeOnClick) { mask.bind("click.mask", function(e) { $.mask.close(e); }); } // resize mask when window is resized $(window).bind("resize.mask", function() { $.mask.fit(); }); // exposed elements if (els && els.length) { overlayIndex = els.eq(0).css("zIndex"); // make sure element is positioned absolutely or relatively $.each(els, function() { var el = $(this); if (!/relative|absolute|fixed/i.test(el.css("position"))) { el.css("position", "relative"); } }); // make elements sit on top of the mask exposed = els.css({zIndex:Math.max(conf.zIndex + 1, overlayIndex == 'auto' ? 0 : overlayIndex)}); } // reveal mask mask.css({display: 'block'}).fadeTo(conf.loadSpeed, conf.opacity, function() { $.mask.fit(); call(conf.onLoad); }); loaded = true; return this; },
if(opts.staticData) { callback.call(null, opts.staticData);
if(opts.static) { callback.call(null, opts.static);
load : function(data, tree, opts, callback) { if(opts.staticData) { callback.call(null, opts.staticData); } else { $.ajax({ 'type' : opts.method, 'url' : opts.url, 'data' : data, 'dataType' : "json", 'success' : function (d, textStatus) { callback.call(null, d); }, 'error' : function (xhttp, textStatus, errorThrown) { callback.call(null, false); tree.error(errorThrown + " " + textStatus); } }); } }
jsBackend.pages.template.changeTemplate();
if($('#templateList input:radio:checked').val() != $('#templateId').val()) { jsBackend.pages.template.changeTemplate(); }
load: function() { // set correct $('input.block_extra_id').each(function() { jsBackend.pages.extras.changeExtra($(this).val(), $(this).attr('id').replace('blockExtraId', '')); }) // initialize the modal for choosing an extra if($('#chooseExtra').length > 0) { $('#chooseExtra').dialog({ autoOpen: false, draggable: false, resizable: false, modal: true, buttons: { '{$lblOK|ucfirst}': function() { // change the extra for real jsBackend.pages.extras.changeExtra(); // close dialog $(this).dialog('close'); }, '{$lblCancel|ucfirst}': function() { // empty the extraForBlock $('#extraForBlock').val(''); // close the dialog $(this).dialog('close'); } } }); } if($('#chooseTemplate').length > 0) { $('#chooseTemplate').dialog({ autoOpen: false, draggable: false, resizable: false, modal: true, width: 500, buttons: { '{$lblOK|ucfirst}': function() { // change the template for real jsBackend.pages.template.changeTemplate(); // close dialog $(this).dialog('close'); }, '{$lblCancel|ucfirst}': function() { // close the dialog $(this).dialog('close'); } } }); } },
var bg = mask.css("backgroundColor"); if (!bg || bg == 'transparent' || bg == 'rgba(0, 0, 0, 0)') {
if (conf.color) {
load: function(conf, els) { // already loaded ? if (loaded) { return this; } // configuration if (typeof conf == 'string') { conf = {color: conf}; } // use latest config conf = conf || config; config = conf = $.extend($.extend({}, tool.conf), conf); // get the mask mask = $("#" + conf.maskId); // or create it if (!mask.length) { mask = $('<div/>').attr("id", conf.maskId); $("body").append(mask); } // set position and dimensions var size = viewport(); mask.css({ position:'absolute', top: 0, left: 0, width: size[0], height: size[1], display: 'none', opacity: conf.startOpacity, zIndex: conf.zIndex }); // background color var bg = mask.css("backgroundColor"); if (!bg || bg == 'transparent' || bg == 'rgba(0, 0, 0, 0)') { mask.css("backgroundColor", conf.color); } // onBeforeLoad if (call(conf.onBeforeLoad) === false) { return this; } // esc button if (conf.closeOnEsc) { $(document).bind("keydown.mask", function(e) { if (e.keyCode == 27) { $.mask.close(e); } }); } // mask click closes if (conf.closeOnClick) { mask.bind("click.mask", function(e) { $.mask.close(e); }); } // resize mask when window is resized $(window).bind("resize.mask", function() { $.mask.fit(); }); // exposed elements if (els && els.length) { overlayIndex = els.eq(0).css("zIndex"); // make sure element is positioned absolutely or relatively $.each(els, function() { var el = $(this); if (!/relative|absolute|fixed/i.test(el.css("position"))) { el.css("position", "relative"); } }); // make elements sit on top of the mask exposed = els.css({ zIndex: Math.max(conf.zIndex + 1, overlayIndex == 'auto' ? 0 : overlayIndex)}); } // reveal mask mask.css({display: 'block'}).fadeTo(conf.loadSpeed, conf.opacity, function() { $.mask.fit(); call(conf.onLoad); }); loaded = true; return this; },
$('.block_extra_id').val('');
load: function() { // set correct $('input.block_extra_id').each(function() { jsBackend.pages.extras.changeExtra($(this).val(), $(this).attr('id').replace('blockExtraId', '')); }) // initialize the modal for choosing an extra if($('#chooseExtra').length > 0) { $('#chooseExtra').dialog({ autoOpen: false, draggable: false, resizable: false, modal: true, buttons: { '{$lblOK|ucfirst}': function() { // change the extra for real jsBackend.pages.extras.changeExtra(); // close dialog $(this).dialog('close'); }, '{$lblCancel|ucfirst}': function() { // empty the extraForBlock $('#extraForBlock').val(''); // close the dialog $(this).dialog('close'); } } }); } if($('#chooseTemplate').length > 0) { $('#chooseTemplate').dialog({ autoOpen: false, draggable: false, resizable: false, modal: true, width: 500, buttons: { '{$lblOK|ucfirst}': function() { if($('#templateList input:radio:checked').val() != $('#templateId').val()) { // change the template for real jsBackend.pages.template.changeTemplate(); } // close dialog $(this).dialog('close'); }, '{$lblCancel|ucfirst}': function() { // close the dialog $(this).dialog('close'); } } }); } },
if (!document.activeElement) { function trackActiveElement(evt) { if (evt && evt.target) { document.activeElement = evt.target == document ? null : evt.target; } } function trackActiveElementLost(evt) { document.activeElement = null; } document.addEventListener("focus", trackActiveElement, true); document.addEventListener("blur", trackActiveElementLost, true); }
function load() { WT.history._initialize(); initDragDrop(); if (!loaded) { loaded = true; _$_ONLOAD_$_(); keepAliveTimer = setTimeout(doKeepAlive, _$_KEEP_ALIVE_$_000); }};
head.innerHTML = '<a class=\"fref\" href=\".\">' + pending_tree + '</a>';
head.innerHTML = '<a class=\"fref\" href=\".\">' + escape(pending_tree) + '</a>';
function load_file_finalize(content) { var res = document.getElementById('content'); res.innerHTML = 'Done'; res.innerHTML = content; var head = document.getElementById('current_path'); head.innerHTML = '<a class=\"fref\" href=\".\">' + pending_tree + '</a>'; var path_walked = ''; var elems = pending_file.split(/\//); for (var i = 0; i < elems.length; i++) { if (elems[i] != '') { head.innerHTML = head.innerHTML + '/' + '<a class=\"fref\" href=\"' + path_walked + elems[i] + '\">' + elems[i] + '</a>'; path_walked = path_walked + elems[i] + '/'; } } document.title = 'LXR ' + pending_tree + '/' + pending_file; var full_tree = pending_tree; if (pending_ver) { full_tree = full_tree + '+' + pending_ver; } var full_path = full_tree + '/' + pending_file.replace(/^\/?/, ''); var print = document.getElementById('lxr_print'); var dirlist = document.getElementById('content_dir'); if (dirlist) { print.style.display = 'none'; } else { var pform = document.getElementById('print_form'); pform.action = '../' + full_tree + '/+print=' + pending_file.replace(/^\/?/, ''); print.style.display = 'inline'; } if (hash_check) { clearTimeout(hash_check); } location.hash = full_path; loaded_hash = location.hash; loaded_tree = pending_tree; loaded_file = pending_file; loaded_ver = pending_ver; if (pending_line) { location.hash = full_path + '#L' + pending_line; } hash_check = setTimeout('check_hash_navigation()', 50); ajaxify_link_handlers(document.links); load_next_pending_fragment();}
'<a class=\"fref\" href=\"' + path_walked + elems[i] + '\">' + elems[i] + '</a>';
'<a class=\"fref\" href=\"' + escape(path_walked) + escape(elems[i]) + '\">' + escape(elems[i]) + '</a>';
function load_file_finalize(content) { var res = document.getElementById('content'); res.innerHTML = 'Done'; res.innerHTML = content; var head = document.getElementById('current_path'); head.innerHTML = '<a class=\"fref\" href=\".\">' + pending_tree + '</a>'; var path_walked = ''; var elems = pending_file.split(/\//); for (var i = 0; i < elems.length; i++) { if (elems[i] != '') { head.innerHTML = head.innerHTML + '/' + '<a class=\"fref\" href=\"' + path_walked + elems[i] + '\">' + elems[i] + '</a>'; path_walked = path_walked + elems[i] + '/'; } } document.title = 'LXR ' + pending_tree + '/' + pending_file; var full_tree = pending_tree; if (pending_ver) { full_tree = full_tree + '+' + pending_ver; } var full_path = full_tree + '/' + pending_file.replace(/^\/?/, ''); var print = document.getElementById('lxr_print'); var dirlist = document.getElementById('content_dir'); if (dirlist) { print.style.display = 'none'; } else { var pform = document.getElementById('print_form'); pform.action = '../' + full_tree + '/+print=' + pending_file.replace(/^\/?/, ''); print.style.display = 'inline'; } if (hash_check) { clearTimeout(hash_check); } location.hash = full_path; loaded_hash = location.hash; loaded_tree = pending_tree; loaded_file = pending_file; loaded_ver = pending_ver; if (pending_line) { location.hash = full_path + '#L' + pending_line; } hash_check = setTimeout('check_hash_navigation()', 50); ajaxify_link_handlers(document.links); load_next_pending_fragment();}
});
lazy_check(); });
var load_url = function() { var url = $(this).attr('href'); var place = '#plugins'; if (get_container(this) == 'hosts-container') { $('#hosts a').each(function() { $(this).removeClass('selected'); }); $selected_host = $(this).html(); $.getJSON('cgi-bin/collection.modified.cgi?action=pluginlist_json&host=' + $selected_host, function(data){ $("#plugins").html(''); $("#plugins").append(create_plugin_menu($selected_host, data)); $('#plugins ul li a').click(function(){ $('#plugins').data('selected_plugin', $(this).attr('rel')); }); }); } else { $selected_plugin = $(this).html(); $(".graph-imgs-container").html(''); $.getJSON('cgi-bin/collection.modified.cgi?action=graphs_json;plugin=' + $selected_plugin + ';host=' + $selected_host, function(data){ $graph_json = data create_graph_list("hour", data.hour); $('#graph-container').html(get_graph_main_container($selected_host)); }); } $('#plugins a').each(function() { $(this).removeClass('selected'); }); lazy_check(); $(this).addClass('selected'); return false;}
lazy_check();
var load_url = function() { var url = $(this).attr('href'); var place = '#plugins'; if (get_container(this) == 'hosts-container') { $('#hosts a').each(function() { $(this).removeClass('selected'); }); $selected_host = $(this).html(); $.getJSON('cgi-bin/collection.modified.cgi?action=pluginlist_json&host=' + $selected_host, function(data){ $("#plugins").html(''); $("#plugins").append(create_plugin_menu($selected_host, data)); $('#plugins ul li a').click(function(){ $('#plugins').data('selected_plugin', $(this).attr('rel')); }); }); } else { $selected_plugin = $(this).html(); $(".graph-imgs-container").html(''); $.getJSON('cgi-bin/collection.modified.cgi?action=graphs_json;plugin=' + $selected_plugin + ';host=' + $selected_host, function(data){ $graph_json = data create_graph_list("hour", data.hour); $('#graph-container').html(get_graph_main_container($selected_host)); }); } $('#plugins a').each(function() { $(this).removeClass('selected'); }); lazy_check(); $(this).addClass('selected'); return false;}
var place = get_container(this) == 'hosts-container' ? '#plugins' : '#graph-container'; $(place).load(url); $('#plugins a').each(function() { $(this).removeClass('selected'); });
var place = '#plugins';
var load_url = function() { var url = $(this).attr('href'); var place = get_container(this) == 'hosts-container' ? '#plugins' : '#graph-container'; $(place).load(url); $('#plugins a').each(function() { $(this).removeClass('selected'); }); if (get_container(this) == 'hosts-container') { $('#hosts a').each(function() { $(this).removeClass('selected'); }); } $(this).addClass('selected'); return false;}
$('#plugins a').each(function() { $(this).removeClass('selected'); }); lazy_check();
var load_url = function() { var url = $(this).attr('href'); var place = get_container(this) == 'hosts-container' ? '#plugins' : '#graph-container'; $(place).load(url); $('#plugins a').each(function() { $(this).removeClass('selected'); }); if (get_container(this) == 'hosts-container') { $('#hosts a').each(function() { $(this).removeClass('selected'); }); } $(this).addClass('selected'); return false;}
loadAndAutoSubmit : function (usernameName,usernameValue,
loadAndAutoSubmit : function (button, ctrlClick, usernameName,usernameValue,
loadAndAutoSubmit : function (usernameName,usernameValue, actionURL,usernameID,formID,uniqueID) { if (KFLog.logSensitiveData) KFLog.debug("loading and auto submitting " + actionURL); else KFLog.debug("loading and auto submitting..."); var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var newWindow = wm.getMostRecentWindow("navigator:browser"); var b = newWindow.getBrowser(); var newTab = b.loadOneTab( actionURL, null, null, null, false, null ); newTab.setAttribute("KF_uniqueID", uniqueID); newTab.setAttribute("KF_autoSubmit", "yes"); }
KFLog.debug("loading and auto submitting " + actionURL);
KFLog.debug("loading and auto submitting button " + button + ctrlClick + ":" + actionURL);
loadAndAutoSubmit : function (usernameName,usernameValue, actionURL,usernameID,formID,uniqueID) { if (KFLog.logSensitiveData) KFLog.debug("loading and auto submitting " + actionURL); else KFLog.debug("loading and auto submitting..."); var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var newWindow = wm.getMostRecentWindow("navigator:browser"); var b = newWindow.getBrowser(); var newTab = b.loadOneTab( actionURL, null, null, null, false, null ); newTab.setAttribute("KF_uniqueID", uniqueID); newTab.setAttribute("KF_autoSubmit", "yes"); }
KFLog.debug("loading and auto submitting...");
KFLog.debug("loading and auto submitting button " + button + ctrlClick + "...");
loadAndAutoSubmit : function (usernameName,usernameValue, actionURL,usernameID,formID,uniqueID) { if (KFLog.logSensitiveData) KFLog.debug("loading and auto submitting " + actionURL); else KFLog.debug("loading and auto submitting..."); var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var newWindow = wm.getMostRecentWindow("navigator:browser"); var b = newWindow.getBrowser(); var newTab = b.loadOneTab( actionURL, null, null, null, false, null ); newTab.setAttribute("KF_uniqueID", uniqueID); newTab.setAttribute("KF_autoSubmit", "yes"); }
var newTab = b.loadOneTab( actionURL, null, null, null, false, null ); newTab.setAttribute("KF_uniqueID", uniqueID); newTab.setAttribute("KF_autoSubmit", "yes");
var tab; if (button == 1 || (button == 0 && ctrlClick)) { tab = b.loadOneTab( actionURL, null, null, null, false, null ); tab.setAttribute("KF_uniqueID", uniqueID); tab.setAttribute("KF_autoSubmit", "yes"); } else { tab = b.selectedTab; tab.setAttribute("KF_uniqueID", uniqueID); tab.setAttribute("KF_autoSubmit", "yes"); b.loadURI( actionURL, null, null); }
loadAndAutoSubmit : function (usernameName,usernameValue, actionURL,usernameID,formID,uniqueID) { if (KFLog.logSensitiveData) KFLog.debug("loading and auto submitting " + actionURL); else KFLog.debug("loading and auto submitting..."); var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var newWindow = wm.getMostRecentWindow("navigator:browser"); var b = newWindow.getBrowser(); var newTab = b.loadOneTab( actionURL, null, null, null, false, null ); newTab.setAttribute("KF_uniqueID", uniqueID); newTab.setAttribute("KF_autoSubmit", "yes"); }
tab.setAttribute("KF_uniqueID", uniqueID); tab.setAttribute("KF_autoSubmit", "yes");
loadAndAutoSubmit : function (button, ctrlClick, usernameName,usernameValue, actionURL,usernameID,formID,uniqueID) { if (KFLog.logSensitiveData) KFLog.debug("loading and auto submitting button " + button + ctrlClick + ":" + actionURL); else KFLog.debug("loading and auto submitting button " + button + ctrlClick + "..."); var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var newWindow = wm.getMostRecentWindow("navigator:browser"); var b = newWindow.getBrowser(); var tab; if (button == 1 || (button == 0 && ctrlClick)) { tab = b.loadOneTab( actionURL, null, null, null, false, null ); tab.setAttribute("KF_uniqueID", uniqueID); tab.setAttribute("KF_autoSubmit", "yes"); } else { tab = b.selectedTab; tab.setAttribute("KF_uniqueID", uniqueID); tab.setAttribute("KF_autoSubmit", "yes"); b.loadURI( actionURL, null, null); } }
var i=a.config;a.focusManager=function(j){if(j.focusManager)return j.focusManager;this.hasFocus=false;this._={editor:j};return this;};a.focusManager.prototype={focus:function(){var k=this;if(k._.timer)clearTimeout(k._.timer);if(!k.hasFocus){if(a.currentInstance)a.currentInstance.focusManager.forceBlur();var j=k._.editor;j.container.getChild(1).addClass('cke_focus');k.hasFocus=true;j.fire('focus');}},blur:function(){var j=this;if(j._.timer)clearTimeout(j._.timer);j._.timer=setTimeout(function(){delete j._.timer;j.forceBlur();},100);},forceBlur:function(){if(this.hasFocus){var j=this._.editor;j.container.getChild(1).removeClass('cke_focus');this.hasFocus=false;j.fire('blur');}}};(function(){var j={};a.lang={languages:{af:1,ar:1,bg:1,bn:1,bs:1,ca:1,cs:1,cy:1,da:1,de:1,el:1,'en-au':1,'en-ca':1,'en-gb':1,en:1,eo:1,es:1,et:1,eu:1,fa:1,fi:1,fo:1,'fr-ca':1,fr:1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,is:1,it:1,ja:1,km:1,ko:1,lt:1,lv:1,mn:1,ms:1,nb:1,nl:1,no:1,pl:1,'pt-br':1,pt:1,ro:1,ru:1,sk:1,sl:1,'sr-latn':1,sr:1,sv:1,th:1,tr:1,uk:1,vi:1,'zh-cn':1,zh:1},load:function(k,l,m){if(!k||!a.lang.languages[k])k=this.detect(l,k);if(!this[k])a.scriptLoader.load(a.getUrl('lang/'+k+'.js'),function(){m(k,this[k]);},this);else m(k,this[k]);},detect:function(k,l){var m=this.languages;l=l||navigator.userLanguage||navigator.language;var n=l.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),o=n[1],p=n[2];if(m[o+'-'+p])o=o+'-'+p;else if(!m[o])o=null;a.lang.detect=o?function(){return o;}:function(q){return q;};return o||k;}};})();a.scriptLoader=(function(){var j={},k={};return{load:function(l,m,n,o,p){var q=typeof l=='string';if(q)l=[l];if(!n)n=a;var r=l.length,s=[],t=[],u=function(z){if(m)if(q)m.call(n,z);else m.call(n,s,t);};if(r===0){u(true);return;}var v=function(z,A){(A?s:t).push(z);if(--r<=0){p&&a.document.getDocumentElement().removeStyle('cursor');u(A);}},w=function(z,A){j[z]=1;var B=k[z];delete k[z];for(var C=0;C<B.length;C++)B[C](z,A);},x=function(z){if(o!==true&&j[z]){v(z,true);return;}var A=k[z]||(k[z]=[]);A.push(v);if(A.length>1)return;var B=new h('script');B.setAttributes({type:'text/javascript',src:z});if(m)if(c)B.$.onreadystatechange=function(){if(B.$.readyState=='loaded'||B.$.readyState=='complete'){B.$.onreadystatechange=null;w(z,true);}};else{B.$.onload=function(){setTimeout(function(){w(z,true);},0);};B.$.onerror=function(){w(z,false);};}B.appendTo(a.document.getHead());};p&&a.document.getDocumentElement().setStyle('cursor','wait');for(var y=0;y<r;y++)x(l[y]);},loadCode:function(l){var m=new h('script'); m.setAttribute('type','text/javascript');m.appendText(l);m.appendTo(a.document.getHead());}};})();a.resourceManager=function(j,k){var l=this;l.basePath=j;l.fileName=k;l.registered={};l.loaded={};l.externals={};l._={waitingList:{}};};a.resourceManager.prototype={add:function(j,k){if(this.registered[j])throw '[CKEDITOR.resourceManager.add] The resource name "'+j+'" is already registered.';a.fire(j+e.capitalize(this.fileName)+'Ready',this.registered[j]=k||{});},get:function(j){return this.registered[j]||null;},getPath:function(j){var k=this.externals[j];return a.getUrl(k&&k.dir||this.basePath+j+'/');},getFilePath:function(j){var k=this.externals[j];return a.getUrl(this.getPath(j)+(k&&typeof k.file=='string'?k.file:this.fileName+'.js'));},addExternal:function(j,k,l){j=j.split(',');for(var m=0;m<j.length;m++){var n=j[m];this.externals[n]={dir:k,file:l};}},load:function(j,k,l){if(!e.isArray(j))j=j?[j]:[];var m=this.loaded,n=this.registered,o=[],p={},q={};for(var r=0;r<j.length;r++){var s=j[r];if(!s)continue;if(!m[s]&&!n[s]){var t=this.getFilePath(s);o.push(t);if(!(t in p))p[t]=[];p[t].push(s);}else q[s]=this.get(s);}a.scriptLoader.load(o,function(u,v){if(v.length)throw '[CKEDITOR.resourceManager.load] Resource name "'+p[v[0]].join(',')+'" was not found at "'+v[0]+'".';for(var w=0;w<u.length;w++){var x=p[u[w]];for(var y=0;y<x.length;y++){var z=x[y];q[z]=this.get(z);m[z]=1;}}k.call(l,q);},this);}};a.plugins=new a.resourceManager('plugins/','plugin');var j=a.plugins;j.load=e.override(j.load,function(k){return function(l,m,n){var o={},p=function(q){k.call(this,q,function(r){e.extend(o,r);var s=[];for(var t in r){var u=r[t],v=u&&u.requires;if(v)for(var w=0;w<v.length;w++){if(!o[v[w]])s.push(v[w]);}}if(s.length)p.call(this,s);else{for(t in o){u=o[t];if(u.onLoad&&!u.onLoad._called){u.onLoad();u.onLoad._called=1;}}if(m)m.call(n||window,o);}},this);};p.call(this,l);};});j.setLang=function(k,l,m){var n=this.get(k),o=n.lang||(n.lang={});o[l]=m;};(function(){var k={},l=function(m,n){var o=function(){p.removeAllListeners();k[m]=1;n();},p=new h('img');p.on('load',o);p.on('error',o);p.setAttribute('src',m);};a.imageCacher={load:function(m,n){var o=m.length,p=function(){if(--o===0)n();};for(var q=0;q<m.length;q++){var r=m[q];if(k[r])p();else l(r,p);}}};})();a.skins=(function(){var k={},l={},m={},n=function(o,p,q,r){var s=k[p];if(!o.skin){o.skin=s;if(s.init)s.init(o);}var t=function(D){for(var E=0;E<D.length;E++)D[E]=a.getUrl(m[p]+D[E]);};function u(D,E){return D.replace(/url\s*\(([\s'"]*)(.*?)([\s"']*)\)/g,function(F,G,H,I){if(/^\/|^\w?:/.test(H))return F;
j.forceBlur();},100);},forceBlur:function(){if(this.hasFocus){var j=this._.editor;j.container.getChild(1).removeClass('cke_focus');this.hasFocus=false;j.fire('blur');}}};(function(){var j={};a.lang={languages:{af:1,ar:1,bg:1,bn:1,bs:1,ca:1,cs:1,cy:1,da:1,de:1,el:1,'en-au':1,'en-ca':1,'en-gb':1,en:1,eo:1,es:1,et:1,eu:1,fa:1,fi:1,fo:1,'fr-ca':1,fr:1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,is:1,it:1,ja:1,km:1,ko:1,lt:1,lv:1,mn:1,ms:1,nb:1,nl:1,no:1,pl:1,'pt-br':1,pt:1,ro:1,ru:1,sk:1,sl:1,'sr-latn':1,sr:1,sv:1,th:1,tr:1,uk:1,vi:1,'zh-cn':1,zh:1},load:function(k,l,m){if(!k||!a.lang.languages[k])k=this.detect(l,k);if(!this[k])a.scriptLoader.load(a.getUrl('lang/'+k+'.js'),function(){m(k,this[k]);},this);else m(k,this[k]);},detect:function(k,l){var m=this.languages;l=l||navigator.userLanguage||navigator.language;var n=l.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),o=n[1],p=n[2];if(m[o+'-'+p])o=o+'-'+p;else if(!m[o])o=null;a.lang.detect=o?function(){return o;}:function(q){return q;};return o||k;}};})();a.scriptLoader=(function(){var j={},k={};return{load:function(l,m,n,o,p){var q=typeof l=='string';if(q)l=[l];if(!n)n=a;var r=l.length,s=[],t=[],u=function(z){if(m)if(q)m.call(n,z);else m.call(n,s,t);};if(r===0){u(true);return;}var v=function(z,A){(A?s:t).push(z);if(--r<=0){p&&a.document.getDocumentElement().removeStyle('cursor');u(A);}},w=function(z,A){j[z]=1;var B=k[z];delete k[z];for(var C=0;C<B.length;C++)B[C](z,A);},x=function(z){if(o!==true&&j[z]){v(z,true);return;}var A=k[z]||(k[z]=[]);A.push(v);if(A.length>1)return;var B=new h('script');B.setAttributes({type:'text/javascript',src:z});if(m)if(c)B.$.onreadystatechange=function(){if(B.$.readyState=='loaded'||B.$.readyState=='complete'){B.$.onreadystatechange=null;w(z,true);}};else{B.$.onload=function(){setTimeout(function(){w(z,true);},0);};B.$.onerror=function(){w(z,false);};}B.appendTo(a.document.getHead());};p&&a.document.getDocumentElement().setStyle('cursor','wait');for(var y=0;y<r;y++)x(l[y]);},loadCode:function(l){var m=new h('script');m.setAttribute('type','text/javascript');m.appendText(l);m.appendTo(a.document.getHead());}};})();a.resourceManager=function(j,k){var l=this;l.basePath=j;l.fileName=k;l.registered={};l.loaded={};l.externals={};l._={waitingList:{}};};a.resourceManager.prototype={add:function(j,k){if(this.registered[j])throw '[CKEDITOR.resourceManager.add] The resource name "'+j+'" is already registered.';a.fire(j+e.capitalize(this.fileName)+'Ready',this.registered[j]=k||{});},get:function(j){return this.registered[j]||null;
var i=a.config;a.focusManager=function(j){if(j.focusManager)return j.focusManager;this.hasFocus=false;this._={editor:j};return this;};a.focusManager.prototype={focus:function(){var k=this;if(k._.timer)clearTimeout(k._.timer);if(!k.hasFocus){if(a.currentInstance)a.currentInstance.focusManager.forceBlur();var j=k._.editor;j.container.getChild(1).addClass('cke_focus');k.hasFocus=true;j.fire('focus');}},blur:function(){var j=this;if(j._.timer)clearTimeout(j._.timer);j._.timer=setTimeout(function(){delete j._.timer;j.forceBlur();},100);},forceBlur:function(){if(this.hasFocus){var j=this._.editor;j.container.getChild(1).removeClass('cke_focus');this.hasFocus=false;j.fire('blur');}}};(function(){var j={};a.lang={languages:{af:1,ar:1,bg:1,bn:1,bs:1,ca:1,cs:1,cy:1,da:1,de:1,el:1,'en-au':1,'en-ca':1,'en-gb':1,en:1,eo:1,es:1,et:1,eu:1,fa:1,fi:1,fo:1,'fr-ca':1,fr:1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,is:1,it:1,ja:1,km:1,ko:1,lt:1,lv:1,mn:1,ms:1,nb:1,nl:1,no:1,pl:1,'pt-br':1,pt:1,ro:1,ru:1,sk:1,sl:1,'sr-latn':1,sr:1,sv:1,th:1,tr:1,uk:1,vi:1,'zh-cn':1,zh:1},load:function(k,l,m){if(!k||!a.lang.languages[k])k=this.detect(l,k);if(!this[k])a.scriptLoader.load(a.getUrl('lang/'+k+'.js'),function(){m(k,this[k]);},this);else m(k,this[k]);},detect:function(k,l){var m=this.languages;l=l||navigator.userLanguage||navigator.language;var n=l.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),o=n[1],p=n[2];if(m[o+'-'+p])o=o+'-'+p;else if(!m[o])o=null;a.lang.detect=o?function(){return o;}:function(q){return q;};return o||k;}};})();a.scriptLoader=(function(){var j={},k={};return{load:function(l,m,n,o,p){var q=typeof l=='string';if(q)l=[l];if(!n)n=a;var r=l.length,s=[],t=[],u=function(z){if(m)if(q)m.call(n,z);else m.call(n,s,t);};if(r===0){u(true);return;}var v=function(z,A){(A?s:t).push(z);if(--r<=0){p&&a.document.getDocumentElement().removeStyle('cursor');u(A);}},w=function(z,A){j[z]=1;var B=k[z];delete k[z];for(var C=0;C<B.length;C++)B[C](z,A);},x=function(z){if(o!==true&&j[z]){v(z,true);return;}var A=k[z]||(k[z]=[]);A.push(v);if(A.length>1)return;var B=new h('script');B.setAttributes({type:'text/javascript',src:z});if(m)if(c)B.$.onreadystatechange=function(){if(B.$.readyState=='loaded'||B.$.readyState=='complete'){B.$.onreadystatechange=null;w(z,true);}};else{B.$.onload=function(){setTimeout(function(){w(z,true);},0);};B.$.onerror=function(){w(z,false);};}B.appendTo(a.document.getHead());};p&&a.document.getDocumentElement().setStyle('cursor','wait');for(var y=0;y<r;y++)x(l[y]);},loadCode:function(l){var m=new h('script');m.setAttribute('type','text/javascript');m.appendText(l);m.appendTo(a.document.getHead());}};})();a.resourceManager=function(j,k){var l=this;l.basePath=j;l.fileName=k;l.registered={};l.loaded={};l.externals={};l._={waitingList:{}};};a.resourceManager.prototype={add:function(j,k){if(this.registered[j])throw '[CKEDITOR.resourceManager.add] The resource name "'+j+'" is already registered.';a.fire(j+e.capitalize(this.fileName)+'Ready',this.registered[j]=k||{});},get:function(j){return this.registered[j]||null;},getPath:function(j){var k=this.externals[j];return a.getUrl(k&&k.dir||this.basePath+j+'/');},getFilePath:function(j){var k=this.externals[j];return a.getUrl(this.getPath(j)+(k&&typeof k.file=='string'?k.file:this.fileName+'.js'));},addExternal:function(j,k,l){j=j.split(',');for(var m=0;m<j.length;m++){var n=j[m];this.externals[n]={dir:k,file:l};}},load:function(j,k,l){if(!e.isArray(j))j=j?[j]:[];var m=this.loaded,n=this.registered,o=[],p={},q={};for(var r=0;r<j.length;r++){var s=j[r];if(!s)continue;if(!m[s]&&!n[s]){var t=this.getFilePath(s);o.push(t);if(!(t in p))p[t]=[];p[t].push(s);}else q[s]=this.get(s);}a.scriptLoader.load(o,function(u,v){if(v.length)throw '[CKEDITOR.resourceManager.load] Resource name "'+p[v[0]].join(',')+'" was not found at "'+v[0]+'".';for(var w=0;w<u.length;w++){var x=p[u[w]];for(var y=0;y<x.length;y++){var z=x[y];q[z]=this.get(z);m[z]=1;}}k.call(l,q);},this);}};a.plugins=new a.resourceManager('plugins/','plugin');var j=a.plugins;j.load=e.override(j.load,function(k){return function(l,m,n){var o={},p=function(q){k.call(this,q,function(r){e.extend(o,r);var s=[];for(var t in r){var u=r[t],v=u&&u.requires;if(v)for(var w=0;w<v.length;w++){if(!o[v[w]])s.push(v[w]);}}if(s.length)p.call(this,s);else{for(t in o){u=o[t];if(u.onLoad&&!u.onLoad._called){u.onLoad();u.onLoad._called=1;}}if(m)m.call(n||window,o);}},this);};p.call(this,l);};});j.setLang=function(k,l,m){var n=this.get(k),o=n.lang||(n.lang={});o[l]=m;};(function(){var k={},l=function(m,n){var o=function(){p.removeAllListeners();k[m]=1;n();},p=new h('img');p.on('load',o);p.on('error',o);p.setAttribute('src',m);};a.imageCacher={load:function(m,n){var o=m.length,p=function(){if(--o===0)n();};for(var q=0;q<m.length;q++){var r=m[q];if(k[r])p();else l(r,p);}}};})();a.skins=(function(){var k={},l={},m={},n=function(o,p,q,r){var s=k[p];if(!o.skin){o.skin=s;if(s.init)s.init(o);}var t=function(D){for(var E=0;E<D.length;E++)D[E]=a.getUrl(m[p]+D[E]);};function u(D,E){return D.replace(/url\s*\(([\s'"]*)(.*?)([\s"']*)\)/g,function(F,G,H,I){if(/^\/|^\w?:/.test(H))return F;
var answer = confirm("${_('Sure to replace with last edit content?')}");
var answer = confirm("${_('Sure to restore the last edited content?')}");
function loadEditBuffer(evt) { var answer = confirm("${_('Sure to replace with last edit content?')}"); if (!answer) { return; } // get last ticket field values $.getJSON(rel_url + "query", function(result){ // replace ticket fields queryResult = result; var ticketType = queryResult.field_value_mapping_custom["edit_buffer"]; _updateTargetElem(ticketType); }); }
img.css({border:0,position:'absolute',display:'none'}).width(oWidth);
img.css({border:0, position: opts.fixed ? 'fixed' : 'absolute', display:'none'}).width(oWidth);
var loadEffect = function(onLoad) { var overlay = this.getOverlay(), opts = this.getConf(), trigger = this.getTrigger(), self = this, oWidth = overlay.outerWidth({margin:true}), img = overlay.data("img"); // growing image is required. if (!img) { var bg = overlay.css("backgroundImage"); if (!bg) { throw "background-image CSS property not set for overlay"; } // url("bg.jpg") --> bg.jpg bg = bg.slice(bg.indexOf("(") + 1, bg.indexOf(")")).replace(/\"/g, ""); overlay.css("backgroundImage", "none"); img = $('<img src="' + bg + '"/>'); img.css({border:0,position:'absolute',display:'none'}).width(oWidth); $('body').append(img); overlay.data("img", img); } // initial top & left var w = $(window), itop = opts.start.top || Math.round(w.height() / 2), ileft = opts.start.left || Math.round(w.width() / 2); if (trigger) { var p = getPosition(trigger); itop = p[0]; ileft = p[1]; } // adjust positioning relative toverlay scrolling position if (!opts.start.absolute) { itop += w.scrollTop(); ileft += w.scrollLeft(); } // initialize background image and make it visible img.css({ top: itop, left: ileft, width: 0, zIndex: opts.zIndex }).show(); // begin growing img.animate({ top: overlay.css("top"), left: overlay.css("left"), width: oWidth}, opts.speed, function() { // set close button and content over the image overlay.css("zIndex", opts.zIndex + 1).fadeIn(opts.fadeInSpeed, function() { if (self.isOpened() && !$(this).index(overlay)) { onLoad.call(); } else { overlay.hide(); } }); }); };
img = overlay.data("img");
img = overlay.data("img"), position = conf.fixed ? 'fixed' : 'absolute';
var loadEffect = function(pos, onLoad) { var overlay = this.getOverlay(), conf = this.getConf(), trigger = this.getTrigger(), self = this, oWidth = overlay.outerWidth({margin:true}), img = overlay.data("img"); // growing image is required. if (!img) { var bg = overlay.css("backgroundImage"); if (!bg) { throw "background-image CSS property not set for overlay"; } // url("bg.jpg") --> bg.jpg bg = bg.slice(bg.indexOf("(") + 1, bg.indexOf(")")).replace(/\"/g, ""); overlay.css("backgroundImage", "none"); img = $('<img src="' + bg + '"/>'); img.css({border:0, display:'none'}).width(oWidth); $('body').append(img); overlay.data("img", img); } // initial top & left var itop = conf.start.top || Math.round(w.height() / 2), ileft = conf.start.left || Math.round(w.width() / 2); if (trigger) { var p = getPosition(trigger); itop = p.top; ileft = p.left; } // initialize background image and make it visible img.css({ position: 'absolute', top: itop, left: ileft, width: 0, zIndex: conf.zIndex }).show(); // put overlay into final position pos.top += w.scrollTop(); pos.left += w.scrollLeft(); pos.position = 'absolute'; overlay.css(pos); // begin growing img.animate({ top: overlay.css("top"), left: overlay.css("left"), width: oWidth}, conf.speed, function() { if (conf.fixed) { pos.top -= w.scrollTop(); pos.left -= w.scrollLeft(); pos.position = 'fixed'; img.add(overlay).css(pos); } // set close button and content over the image overlay.css("zIndex", conf.zIndex + 1).fadeIn(conf.fadeInSpeed, function() { if (self.isOpened() && !$(this).index(overlay)) { onLoad.call(); } else { overlay.hide(); } }); }); };
position: 'absolute',
position: position,
var loadEffect = function(pos, onLoad) { var overlay = this.getOverlay(), conf = this.getConf(), trigger = this.getTrigger(), self = this, oWidth = overlay.outerWidth({margin:true}), img = overlay.data("img"); // growing image is required. if (!img) { var bg = overlay.css("backgroundImage"); if (!bg) { throw "background-image CSS property not set for overlay"; } // url("bg.jpg") --> bg.jpg bg = bg.slice(bg.indexOf("(") + 1, bg.indexOf(")")).replace(/\"/g, ""); overlay.css("backgroundImage", "none"); img = $('<img src="' + bg + '"/>'); img.css({border:0, display:'none'}).width(oWidth); $('body').append(img); overlay.data("img", img); } // initial top & left var itop = conf.start.top || Math.round(w.height() / 2), ileft = conf.start.left || Math.round(w.width() / 2); if (trigger) { var p = getPosition(trigger); itop = p.top; ileft = p.left; } // initialize background image and make it visible img.css({ position: 'absolute', top: itop, left: ileft, width: 0, zIndex: conf.zIndex }).show(); // put overlay into final position pos.top += w.scrollTop(); pos.left += w.scrollLeft(); pos.position = 'absolute'; overlay.css(pos); // begin growing img.animate({ top: overlay.css("top"), left: overlay.css("left"), width: oWidth}, conf.speed, function() { if (conf.fixed) { pos.top -= w.scrollTop(); pos.left -= w.scrollLeft(); pos.position = 'fixed'; img.add(overlay).css(pos); } // set close button and content over the image overlay.css("zIndex", conf.zIndex + 1).fadeIn(conf.fadeInSpeed, function() { if (self.isOpened() && !$(this).index(overlay)) { onLoad.call(); } else { overlay.hide(); } }); }); };
pos.position = 'absolute';
pos.position = position;
var loadEffect = function(pos, onLoad) { var overlay = this.getOverlay(), conf = this.getConf(), trigger = this.getTrigger(), self = this, oWidth = overlay.outerWidth({margin:true}), img = overlay.data("img"); // growing image is required. if (!img) { var bg = overlay.css("backgroundImage"); if (!bg) { throw "background-image CSS property not set for overlay"; } // url("bg.jpg") --> bg.jpg bg = bg.slice(bg.indexOf("(") + 1, bg.indexOf(")")).replace(/\"/g, ""); overlay.css("backgroundImage", "none"); img = $('<img src="' + bg + '"/>'); img.css({border:0, display:'none'}).width(oWidth); $('body').append(img); overlay.data("img", img); } // initial top & left var itop = conf.start.top || Math.round(w.height() / 2), ileft = conf.start.left || Math.round(w.width() / 2); if (trigger) { var p = getPosition(trigger); itop = p.top; ileft = p.left; } // initialize background image and make it visible img.css({ position: 'absolute', top: itop, left: ileft, width: 0, zIndex: conf.zIndex }).show(); // put overlay into final position pos.top += w.scrollTop(); pos.left += w.scrollLeft(); pos.position = 'absolute'; overlay.css(pos); // begin growing img.animate({ top: overlay.css("top"), left: overlay.css("left"), width: oWidth}, conf.speed, function() { if (conf.fixed) { pos.top -= w.scrollTop(); pos.left -= w.scrollLeft(); pos.position = 'fixed'; img.add(overlay).css(pos); } // set close button and content over the image overlay.css("zIndex", conf.zIndex + 1).fadeIn(conf.fadeInSpeed, function() { if (self.isOpened() && !$(this).index(overlay)) { onLoad.call(); } else { overlay.hide(); } }); }); };
width: oWidth}, conf.speed, function() { if (conf.fixed) { pos.top -= w.scrollTop(); pos.left -= w.scrollLeft(); pos.position = 'fixed'; img.add(overlay).css(pos); }
width: oWidth}, conf.speed, function() {
var loadEffect = function(pos, onLoad) { var overlay = this.getOverlay(), conf = this.getConf(), trigger = this.getTrigger(), self = this, oWidth = overlay.outerWidth({margin:true}), img = overlay.data("img"); // growing image is required. if (!img) { var bg = overlay.css("backgroundImage"); if (!bg) { throw "background-image CSS property not set for overlay"; } // url("bg.jpg") --> bg.jpg bg = bg.slice(bg.indexOf("(") + 1, bg.indexOf(")")).replace(/\"/g, ""); overlay.css("backgroundImage", "none"); img = $('<img src="' + bg + '"/>'); img.css({border:0, display:'none'}).width(oWidth); $('body').append(img); overlay.data("img", img); } // initial top & left var itop = conf.start.top || Math.round(w.height() / 2), ileft = conf.start.left || Math.round(w.width() / 2); if (trigger) { var p = getPosition(trigger); itop = p.top; ileft = p.left; } // initialize background image and make it visible img.css({ position: 'absolute', top: itop, left: ileft, width: 0, zIndex: conf.zIndex }).show(); // put overlay into final position pos.top += w.scrollTop(); pos.left += w.scrollLeft(); pos.position = 'absolute'; overlay.css(pos); // begin growing img.animate({ top: overlay.css("top"), left: overlay.css("left"), width: oWidth}, conf.speed, function() { if (conf.fixed) { pos.top -= w.scrollTop(); pos.left -= w.scrollLeft(); pos.position = 'fixed'; img.add(overlay).css(pos); } // set close button and content over the image overlay.css("zIndex", conf.zIndex + 1).fadeIn(conf.fadeInSpeed, function() { if (self.isOpened() && !$(this).index(overlay)) { onLoad.call(); } else { overlay.hide(); } }); }); };
var loadEffect = function(onLoad) {
var loadEffect = function(pos, onLoad) {
var loadEffect = function(onLoad) { var overlay = this.getOverlay(), opts = this.getConf(), trigger = this.getTrigger(), self = this, oWidth = overlay.outerWidth({margin:true}), img = overlay.data("img"); // growing image is required. if (!img) { var bg = overlay.css("backgroundImage"); if (!bg) { throw "background-image CSS property not set for overlay"; } // url("bg.jpg") --> bg.jpg bg = bg.slice(bg.indexOf("(") + 1, bg.indexOf(")")).replace(/\"/g, ""); overlay.css("backgroundImage", "none"); img = $('<img src="' + bg + '"/>'); img.css({border:0, position: opts.fixed ? 'fixed' : 'absolute', display:'none'}).width(oWidth); $('body').append(img); overlay.data("img", img); } // initial top & left var w = $(window), itop = opts.start.top || Math.round(w.height() / 2), ileft = opts.start.left || Math.round(w.width() / 2); if (trigger) { var p = getPosition(trigger); itop = p[0]; ileft = p[1]; } // adjust positioning relative to overlay scrolling position if (!opts.start.absolute) { itop += w.scrollTop(); ileft += w.scrollLeft(); } // initialize background image and make it visible img.css({ top: itop, left: ileft, width: 0, zIndex: opts.zIndex }).show(); // begin growing img.animate({ top: overlay.css("top"), left: overlay.css("left"), width: oWidth}, opts.speed, function() { // set close button and content over the image overlay.css("zIndex", opts.zIndex + 1).fadeIn(opts.fadeInSpeed, function() { if (self.isOpened() && !$(this).index(overlay)) { onLoad.call(); } else { overlay.hide(); } }); }); };
opts = this.getConf(),
conf = this.getConf(),
var loadEffect = function(onLoad) { var overlay = this.getOverlay(), opts = this.getConf(), trigger = this.getTrigger(), self = this, oWidth = overlay.outerWidth({margin:true}), img = overlay.data("img"); // growing image is required. if (!img) { var bg = overlay.css("backgroundImage"); if (!bg) { throw "background-image CSS property not set for overlay"; } // url("bg.jpg") --> bg.jpg bg = bg.slice(bg.indexOf("(") + 1, bg.indexOf(")")).replace(/\"/g, ""); overlay.css("backgroundImage", "none"); img = $('<img src="' + bg + '"/>'); img.css({border:0, position: opts.fixed ? 'fixed' : 'absolute', display:'none'}).width(oWidth); $('body').append(img); overlay.data("img", img); } // initial top & left var w = $(window), itop = opts.start.top || Math.round(w.height() / 2), ileft = opts.start.left || Math.round(w.width() / 2); if (trigger) { var p = getPosition(trigger); itop = p[0]; ileft = p[1]; } // adjust positioning relative to overlay scrolling position if (!opts.start.absolute) { itop += w.scrollTop(); ileft += w.scrollLeft(); } // initialize background image and make it visible img.css({ top: itop, left: ileft, width: 0, zIndex: opts.zIndex }).show(); // begin growing img.animate({ top: overlay.css("top"), left: overlay.css("left"), width: oWidth}, opts.speed, function() { // set close button and content over the image overlay.css("zIndex", opts.zIndex + 1).fadeIn(opts.fadeInSpeed, function() { if (self.isOpened() && !$(this).index(overlay)) { onLoad.call(); } else { overlay.hide(); } }); }); };
img.css({border:0, position: opts.fixed ? 'fixed' : 'absolute', display:'none'}).width(oWidth);
img.css({border:0, display:'none'}).width(oWidth);
var loadEffect = function(onLoad) { var overlay = this.getOverlay(), opts = this.getConf(), trigger = this.getTrigger(), self = this, oWidth = overlay.outerWidth({margin:true}), img = overlay.data("img"); // growing image is required. if (!img) { var bg = overlay.css("backgroundImage"); if (!bg) { throw "background-image CSS property not set for overlay"; } // url("bg.jpg") --> bg.jpg bg = bg.slice(bg.indexOf("(") + 1, bg.indexOf(")")).replace(/\"/g, ""); overlay.css("backgroundImage", "none"); img = $('<img src="' + bg + '"/>'); img.css({border:0, position: opts.fixed ? 'fixed' : 'absolute', display:'none'}).width(oWidth); $('body').append(img); overlay.data("img", img); } // initial top & left var w = $(window), itop = opts.start.top || Math.round(w.height() / 2), ileft = opts.start.left || Math.round(w.width() / 2); if (trigger) { var p = getPosition(trigger); itop = p[0]; ileft = p[1]; } // adjust positioning relative to overlay scrolling position if (!opts.start.absolute) { itop += w.scrollTop(); ileft += w.scrollLeft(); } // initialize background image and make it visible img.css({ top: itop, left: ileft, width: 0, zIndex: opts.zIndex }).show(); // begin growing img.animate({ top: overlay.css("top"), left: overlay.css("left"), width: oWidth}, opts.speed, function() { // set close button and content over the image overlay.css("zIndex", opts.zIndex + 1).fadeIn(opts.fadeInSpeed, function() { if (self.isOpened() && !$(this).index(overlay)) { onLoad.call(); } else { overlay.hide(); } }); }); };
var w = $(window), itop = opts.start.top || Math.round(w.height() / 2), ileft = opts.start.left || Math.round(w.width() / 2);
var itop = conf.start.top || Math.round(w.height() / 2), ileft = conf.start.left || Math.round(w.width() / 2);
var loadEffect = function(onLoad) { var overlay = this.getOverlay(), opts = this.getConf(), trigger = this.getTrigger(), self = this, oWidth = overlay.outerWidth({margin:true}), img = overlay.data("img"); // growing image is required. if (!img) { var bg = overlay.css("backgroundImage"); if (!bg) { throw "background-image CSS property not set for overlay"; } // url("bg.jpg") --> bg.jpg bg = bg.slice(bg.indexOf("(") + 1, bg.indexOf(")")).replace(/\"/g, ""); overlay.css("backgroundImage", "none"); img = $('<img src="' + bg + '"/>'); img.css({border:0, position: opts.fixed ? 'fixed' : 'absolute', display:'none'}).width(oWidth); $('body').append(img); overlay.data("img", img); } // initial top & left var w = $(window), itop = opts.start.top || Math.round(w.height() / 2), ileft = opts.start.left || Math.round(w.width() / 2); if (trigger) { var p = getPosition(trigger); itop = p[0]; ileft = p[1]; } // adjust positioning relative to overlay scrolling position if (!opts.start.absolute) { itop += w.scrollTop(); ileft += w.scrollLeft(); } // initialize background image and make it visible img.css({ top: itop, left: ileft, width: 0, zIndex: opts.zIndex }).show(); // begin growing img.animate({ top: overlay.css("top"), left: overlay.css("left"), width: oWidth}, opts.speed, function() { // set close button and content over the image overlay.css("zIndex", opts.zIndex + 1).fadeIn(opts.fadeInSpeed, function() { if (self.isOpened() && !$(this).index(overlay)) { onLoad.call(); } else { overlay.hide(); } }); }); };
itop = p[0]; ileft = p[1];
itop = p.top; ileft = p.left;
var loadEffect = function(onLoad) { var overlay = this.getOverlay(), opts = this.getConf(), trigger = this.getTrigger(), self = this, oWidth = overlay.outerWidth({margin:true}), img = overlay.data("img"); // growing image is required. if (!img) { var bg = overlay.css("backgroundImage"); if (!bg) { throw "background-image CSS property not set for overlay"; } // url("bg.jpg") --> bg.jpg bg = bg.slice(bg.indexOf("(") + 1, bg.indexOf(")")).replace(/\"/g, ""); overlay.css("backgroundImage", "none"); img = $('<img src="' + bg + '"/>'); img.css({border:0, position: opts.fixed ? 'fixed' : 'absolute', display:'none'}).width(oWidth); $('body').append(img); overlay.data("img", img); } // initial top & left var w = $(window), itop = opts.start.top || Math.round(w.height() / 2), ileft = opts.start.left || Math.round(w.width() / 2); if (trigger) { var p = getPosition(trigger); itop = p[0]; ileft = p[1]; } // adjust positioning relative to overlay scrolling position if (!opts.start.absolute) { itop += w.scrollTop(); ileft += w.scrollLeft(); } // initialize background image and make it visible img.css({ top: itop, left: ileft, width: 0, zIndex: opts.zIndex }).show(); // begin growing img.animate({ top: overlay.css("top"), left: overlay.css("left"), width: oWidth}, opts.speed, function() { // set close button and content over the image overlay.css("zIndex", opts.zIndex + 1).fadeIn(opts.fadeInSpeed, function() { if (self.isOpened() && !$(this).index(overlay)) { onLoad.call(); } else { overlay.hide(); } }); }); };
if (!opts.start.absolute) { itop += w.scrollTop(); ileft += w.scrollLeft(); }
var loadEffect = function(onLoad) { var overlay = this.getOverlay(), opts = this.getConf(), trigger = this.getTrigger(), self = this, oWidth = overlay.outerWidth({margin:true}), img = overlay.data("img"); // growing image is required. if (!img) { var bg = overlay.css("backgroundImage"); if (!bg) { throw "background-image CSS property not set for overlay"; } // url("bg.jpg") --> bg.jpg bg = bg.slice(bg.indexOf("(") + 1, bg.indexOf(")")).replace(/\"/g, ""); overlay.css("backgroundImage", "none"); img = $('<img src="' + bg + '"/>'); img.css({border:0, position: opts.fixed ? 'fixed' : 'absolute', display:'none'}).width(oWidth); $('body').append(img); overlay.data("img", img); } // initial top & left var w = $(window), itop = opts.start.top || Math.round(w.height() / 2), ileft = opts.start.left || Math.round(w.width() / 2); if (trigger) { var p = getPosition(trigger); itop = p[0]; ileft = p[1]; } // adjust positioning relative to overlay scrolling position if (!opts.start.absolute) { itop += w.scrollTop(); ileft += w.scrollLeft(); } // initialize background image and make it visible img.css({ top: itop, left: ileft, width: 0, zIndex: opts.zIndex }).show(); // begin growing img.animate({ top: overlay.css("top"), left: overlay.css("left"), width: oWidth}, opts.speed, function() { // set close button and content over the image overlay.css("zIndex", opts.zIndex + 1).fadeIn(opts.fadeInSpeed, function() { if (self.isOpened() && !$(this).index(overlay)) { onLoad.call(); } else { overlay.hide(); } }); }); };
zIndex: opts.zIndex
zIndex: conf.zIndex
var loadEffect = function(onLoad) { var overlay = this.getOverlay(), opts = this.getConf(), trigger = this.getTrigger(), self = this, oWidth = overlay.outerWidth({margin:true}), img = overlay.data("img"); // growing image is required. if (!img) { var bg = overlay.css("backgroundImage"); if (!bg) { throw "background-image CSS property not set for overlay"; } // url("bg.jpg") --> bg.jpg bg = bg.slice(bg.indexOf("(") + 1, bg.indexOf(")")).replace(/\"/g, ""); overlay.css("backgroundImage", "none"); img = $('<img src="' + bg + '"/>'); img.css({border:0, position: opts.fixed ? 'fixed' : 'absolute', display:'none'}).width(oWidth); $('body').append(img); overlay.data("img", img); } // initial top & left var w = $(window), itop = opts.start.top || Math.round(w.height() / 2), ileft = opts.start.left || Math.round(w.width() / 2); if (trigger) { var p = getPosition(trigger); itop = p[0]; ileft = p[1]; } // adjust positioning relative to overlay scrolling position if (!opts.start.absolute) { itop += w.scrollTop(); ileft += w.scrollLeft(); } // initialize background image and make it visible img.css({ top: itop, left: ileft, width: 0, zIndex: opts.zIndex }).show(); // begin growing img.animate({ top: overlay.css("top"), left: overlay.css("left"), width: oWidth}, opts.speed, function() { // set close button and content over the image overlay.css("zIndex", opts.zIndex + 1).fadeIn(opts.fadeInSpeed, function() { if (self.isOpened() && !$(this).index(overlay)) { onLoad.call(); } else { overlay.hide(); } }); }); };
width: oWidth}, opts.speed, function() {
width: oWidth}, conf.speed, function() {
var loadEffect = function(onLoad) { var overlay = this.getOverlay(), opts = this.getConf(), trigger = this.getTrigger(), self = this, oWidth = overlay.outerWidth({margin:true}), img = overlay.data("img"); // growing image is required. if (!img) { var bg = overlay.css("backgroundImage"); if (!bg) { throw "background-image CSS property not set for overlay"; } // url("bg.jpg") --> bg.jpg bg = bg.slice(bg.indexOf("(") + 1, bg.indexOf(")")).replace(/\"/g, ""); overlay.css("backgroundImage", "none"); img = $('<img src="' + bg + '"/>'); img.css({border:0, position: opts.fixed ? 'fixed' : 'absolute', display:'none'}).width(oWidth); $('body').append(img); overlay.data("img", img); } // initial top & left var w = $(window), itop = opts.start.top || Math.round(w.height() / 2), ileft = opts.start.left || Math.round(w.width() / 2); if (trigger) { var p = getPosition(trigger); itop = p[0]; ileft = p[1]; } // adjust positioning relative to overlay scrolling position if (!opts.start.absolute) { itop += w.scrollTop(); ileft += w.scrollLeft(); } // initialize background image and make it visible img.css({ top: itop, left: ileft, width: 0, zIndex: opts.zIndex }).show(); // begin growing img.animate({ top: overlay.css("top"), left: overlay.css("left"), width: oWidth}, opts.speed, function() { // set close button and content over the image overlay.css("zIndex", opts.zIndex + 1).fadeIn(opts.fadeInSpeed, function() { if (self.isOpened() && !$(this).index(overlay)) { onLoad.call(); } else { overlay.hide(); } }); }); };
overlay.css("zIndex", opts.zIndex + 1).fadeIn(opts.fadeInSpeed, function() {
overlay.css("zIndex", conf.zIndex + 1).fadeIn(conf.fadeInSpeed, function() {
var loadEffect = function(onLoad) { var overlay = this.getOverlay(), opts = this.getConf(), trigger = this.getTrigger(), self = this, oWidth = overlay.outerWidth({margin:true}), img = overlay.data("img"); // growing image is required. if (!img) { var bg = overlay.css("backgroundImage"); if (!bg) { throw "background-image CSS property not set for overlay"; } // url("bg.jpg") --> bg.jpg bg = bg.slice(bg.indexOf("(") + 1, bg.indexOf(")")).replace(/\"/g, ""); overlay.css("backgroundImage", "none"); img = $('<img src="' + bg + '"/>'); img.css({border:0, position: opts.fixed ? 'fixed' : 'absolute', display:'none'}).width(oWidth); $('body').append(img); overlay.data("img", img); } // initial top & left var w = $(window), itop = opts.start.top || Math.round(w.height() / 2), ileft = opts.start.left || Math.round(w.width() / 2); if (trigger) { var p = getPosition(trigger); itop = p[0]; ileft = p[1]; } // adjust positioning relative to overlay scrolling position if (!opts.start.absolute) { itop += w.scrollTop(); ileft += w.scrollLeft(); } // initialize background image and make it visible img.css({ top: itop, left: ileft, width: 0, zIndex: opts.zIndex }).show(); // begin growing img.animate({ top: overlay.css("top"), left: overlay.css("left"), width: oWidth}, opts.speed, function() { // set close button and content over the image overlay.css("zIndex", opts.zIndex + 1).fadeIn(opts.fadeInSpeed, function() { if (self.isOpened() && !$(this).index(overlay)) { onLoad.call(); } else { overlay.hide(); } }); }); };
position: position,
position: 'absolute',
var loadEffect = function(pos, onLoad) { var overlay = this.getOverlay(), conf = this.getConf(), trigger = this.getTrigger(), self = this, oWidth = overlay.outerWidth({margin:true}), img = overlay.data("img"), position = conf.fixed ? 'fixed' : 'absolute'; // growing image is required. if (!img) { var bg = overlay.css("backgroundImage"); if (!bg) { throw "background-image CSS property not set for overlay"; } // url("bg.jpg") --> bg.jpg bg = bg.slice(bg.indexOf("(") + 1, bg.indexOf(")")).replace(/\"/g, ""); overlay.css("backgroundImage", "none"); img = $('<img src="' + bg + '"/>'); img.css({border:0, display:'none'}).width(oWidth); $('body').append(img); overlay.data("img", img); } // initial top & left var itop = conf.start.top || Math.round(w.height() / 2), ileft = conf.start.left || Math.round(w.width() / 2); if (trigger) { var p = getPosition(trigger); itop = p.top; ileft = p.left; } // initialize background image and make it visible img.css({ position: position, top: itop, left: ileft, width: 0, zIndex: conf.zIndex }).show(); // put overlay into final position pos.top += w.scrollTop(); pos.left += w.scrollLeft(); pos.position = position; overlay.css(pos); // begin growing img.animate({ top: overlay.css("top"), left: overlay.css("left"), width: oWidth}, conf.speed, function() { // set close button and content over the image overlay.css("zIndex", conf.zIndex + 1).fadeIn(conf.fadeInSpeed, function() { if (self.isOpened() && !$(this).index(overlay)) { onLoad.call(); } else { overlay.hide(); } }); }); };
pos.top += w.scrollTop(); pos.left += w.scrollLeft();
var loadEffect = function(pos, onLoad) { var overlay = this.getOverlay(), conf = this.getConf(), trigger = this.getTrigger(), self = this, oWidth = overlay.outerWidth({margin:true}), img = overlay.data("img"), position = conf.fixed ? 'fixed' : 'absolute'; // growing image is required. if (!img) { var bg = overlay.css("backgroundImage"); if (!bg) { throw "background-image CSS property not set for overlay"; } // url("bg.jpg") --> bg.jpg bg = bg.slice(bg.indexOf("(") + 1, bg.indexOf(")")).replace(/\"/g, ""); overlay.css("backgroundImage", "none"); img = $('<img src="' + bg + '"/>'); img.css({border:0, display:'none'}).width(oWidth); $('body').append(img); overlay.data("img", img); } // initial top & left var itop = conf.start.top || Math.round(w.height() / 2), ileft = conf.start.left || Math.round(w.width() / 2); if (trigger) { var p = getPosition(trigger); itop = p.top; ileft = p.left; } // initialize background image and make it visible img.css({ position: position, top: itop, left: ileft, width: 0, zIndex: conf.zIndex }).show(); // put overlay into final position pos.top += w.scrollTop(); pos.left += w.scrollLeft(); pos.position = position; overlay.css(pos); // begin growing img.animate({ top: overlay.css("top"), left: overlay.css("left"), width: oWidth}, conf.speed, function() { // set close button and content over the image overlay.css("zIndex", conf.zIndex + 1).fadeIn(conf.fadeInSpeed, function() { if (self.isOpened() && !$(this).index(overlay)) { onLoad.call(); } else { overlay.hide(); } }); }); };
});
}).css("position", position);
var loadEffect = function(pos, onLoad) { var overlay = this.getOverlay(), conf = this.getConf(), trigger = this.getTrigger(), self = this, oWidth = overlay.outerWidth({margin:true}), img = overlay.data("img"), position = conf.fixed ? 'fixed' : 'absolute'; // growing image is required. if (!img) { var bg = overlay.css("backgroundImage"); if (!bg) { throw "background-image CSS property not set for overlay"; } // url("bg.jpg") --> bg.jpg bg = bg.slice(bg.indexOf("(") + 1, bg.indexOf(")")).replace(/\"/g, ""); overlay.css("backgroundImage", "none"); img = $('<img src="' + bg + '"/>'); img.css({border:0, display:'none'}).width(oWidth); $('body').append(img); overlay.data("img", img); } // initial top & left var itop = conf.start.top || Math.round(w.height() / 2), ileft = conf.start.left || Math.round(w.width() / 2); if (trigger) { var p = getPosition(trigger); itop = p.top; ileft = p.left; } // initialize background image and make it visible img.css({ position: position, top: itop, left: ileft, width: 0, zIndex: conf.zIndex }).show(); // put overlay into final position pos.top += w.scrollTop(); pos.left += w.scrollLeft(); pos.position = position; overlay.css(pos); // begin growing img.animate({ top: overlay.css("top"), left: overlay.css("left"), width: oWidth}, conf.speed, function() { // set close button and content over the image overlay.css("zIndex", conf.zIndex + 1).fadeIn(conf.fadeInSpeed, function() { if (self.isOpened() && !$(this).index(overlay)) { onLoad.call(); } else { overlay.hide(); } }); }); };
});};var z=window.scayt_custom_params;if(typeof z=='object')for(var A in z)y[A]=z[A];if(o)y.id=o;var B=new window.scayt(y),C=r.instances[u.name];if(C){B.sLang=C.sLang;B.option(C.option());B.paused=C.paused;}r.instances[u.name]=B;var D='scaytButton',E=window.scayt.uiTags,F=[];for(var G=0,H=4;G<H;G++)F.push(E[G]&&r.uiTabs[G]);r.uiTabs=F;try{B.setDisabled(n===false);}catch(I){}u.fire('showScaytState');};u.on('contentDom',v);u.on('contentDomUnload',function(){var y=a.document.getElementsByTag('script'),z=/^dojoIoScript(\d+)$/i,A=/^https?:\/\/svc\.spellchecker\.net\/spellcheck\/script\/ssrv\.cgi/i;for(var B=0;B<y.count();B++){var C=y.getItem(B),D=C.getId(),E=C.getAttribute('src');if(D&&E&&D.match(z)&&E.match(A))C.remove();}});u.on('beforeCommandExec',function(y){if((y.data.name=='source'||y.data.name=='newpage')&&u.mode=='wysiwyg'){var z=r.getScayt(u);if(z){n=z.paused=!z.disabled;o=z.id;z.destroy(true);delete r.instances[u.name];}}});u.on('destroy',function(y){var z=y.editor,A=r.getScayt(z);o=A.id;A.destroy(true);delete r.instances[z.name];});u.on('afterSetData',function(){if(r.isScaytEnabled(u))window.setTimeout(function(){r.getScayt(u).refresh();},10);});u.on('insertElement',function(){var y=r.getScayt(u);if(r.isScaytEnabled(u)){if(c)u.getSelection().unlock(true);window.setTimeout(function(){y.refresh();},10);}},this,null,50);u.on('insertHtml',function(){var y=r.getScayt(u);if(r.isScaytEnabled(u)){if(c)u.getSelection().unlock(true);window.setTimeout(function(){y.refresh();},10);}},this,null,50);u.on('scaytDialog',function(y){y.data.djConfig=window.djConfig;y.data.scayt_control=r.getScayt(u);y.data.tab=m;y.data.scayt=window.scayt;});var w=u.dataProcessor,x=w&&w.htmlFilter;if(x)x.addRules({elements:{span:function(y){if(y.attributes.scayt_word&&y.attributes.scaytid){delete y.name;return y;}}}});if(u.document)v();};j.scayt={engineLoaded:false,instances:{},getScayt:function(u){return this.instances[u.name];},isScaytReady:function(u){return this.engineLoaded===true&&'undefined'!==typeof window.scayt&&this.getScayt(u);},isScaytEnabled:function(u){var v=this.getScayt(u);return v?v.disabled===false:false;},loadEngine:function(u){if(b.opera)return null;if(this.engineLoaded===true)return q.apply(u);else if(this.engineLoaded==-1)return a.on('scaytReady',function(){q.apply(u);});a.on('scaytReady',q,u);a.on('scaytReady',function(){this.engineLoaded=true;},this,null,0);this.engineLoaded=-1;var v=document.location.protocol;v=v.search(/https?:/)!=-1?v:'http:';var w='svc.spellchecker.net/spellcheck31/lf/scayt/scayt22.js',x=u.config.scayt_srcUrl||v+' a._djScaytConfig={baseUrl:y,addOnLoad:[function(){a.fireOnce('scaytReady');}],isDebug:false};a.document.getHead().append(a.document.createElement('script',{attributes:{type:'text/javascript',src:x}}));return null;},parseUrl:function(u){var v;if(u.match&&(v=u.match(/(.*)[\/\\](.*?\.\w+)$/)))return{path:v[1],file:v[2]};else return u;}};var r=j.scayt,s=function(u,v,w,x,y,z,A){u.addCommand(x,y);u.addMenuItem(x,{label:w,command:x,group:z,order:A});},t={preserveState:true,editorFocus:false,exec:function(u){if(r.isScaytReady(u)){var v=r.isScaytEnabled(u);this.setState(v?2:1);var w=r.getScayt(u);w.setDisabled(v);}else if(!u.config.scayt_autoStartup&&r.engineLoaded>=0){this.setState(0);u.on('showScaytState',function(){this.removeListener();this.setState(r.isScaytEnabled(u)?1:2);},this);r.loadEngine(u);}}};j.add('scayt',{requires:['menubutton'],beforeInit:function(u){u.config.menu_groups='scayt_suggest,scayt_moresuggest,scayt_control,'+u.config.menu_groups;},init:function(u){var v={},w={},x=u.addCommand(l,t);a.dialog.add(l,a.getUrl(this.path+'dialogs/options.js'));var y=u.config.scayt_uiTabs||'1,1,1',z=[];y=y.split(',');for(var A=0,B=3;A<B;A++){var C=parseInt(y[A]||'1',10);z.push(C);}var D='scaytButton';u.addMenuGroup(D);var E={};E.scaytToggle={label:u.lang.scayt.enable,command:l,group:D};if(z[0]==1)E.scaytOptions={label:u.lang.scayt.options,group:D,onClick:function(){m='options';u.openDialog(l);}};if(z[1]==1)E.scaytLangs={label:u.lang.scayt.langs,group:D,onClick:function(){m='langs';u.openDialog(l);}};if(z[2]==1)E.scaytDict={label:u.lang.scayt.dictionariesTab,group:D,onClick:function(){m='dictionaries';u.openDialog(l);}};E.scaytAbout={label:u.lang.scayt.about,group:D,onClick:function(){m='about';u.openDialog(l);}};z[3]=1;r.uiTabs=z;u.addMenuItems(E);u.ui.add('Scayt',5,{label:u.lang.scayt.title,title:u.lang.scayt.title,className:'cke_button_scayt',onRender:function(){x.on('state',function(){this.setState(x.state);},this);},onMenu:function(){var G=r.isScaytEnabled(u);u.getMenuItem('scaytToggle').label=u.lang.scayt[G?'disable':'enable'];return{scaytToggle:2,scaytOptions:G&&r.uiTabs[0]?2:0,scaytLangs:G&&r.uiTabs[1]?2:0,scaytDict:G&&r.uiTabs[2]?2:0,scaytAbout:G&&r.uiTabs[3]?2:0};}});if(u.contextMenu&&u.addMenuItems)u.contextMenu.addListener(function(){if(!r.isScaytEnabled(u))return null;var G=r.getScayt(u),H=G.getScaytNode();if(!H)return null;var I=G.getWord(H);if(!I)return null;var J=G.getLang(),K={},L=window.scayt.getSuggestion(I,J);if(!L||!L.length)return null;for(A in v){delete u._.menuItems[A];
});s.on('destroy',function(x){var y=x.editor,z=p.getScayt(y);if(!z)return;delete p.instances[y.name];p.setControlId(y,z.id);z.destroy(true);});s.on('afterSetData',function(){if(p.isScaytEnabled(s))window.setTimeout(function(){var x=p.getScayt(s);x&&x.refresh();},10);});s.on('insertElement',function(){var x=p.getScayt(s);if(p.isScaytEnabled(s)){if(c)s.getSelection().unlock(true);window.setTimeout(function(){x.focus();x.refresh();},10);}},this,null,50);s.on('insertHtml',function(){var x=p.getScayt(s);if(p.isScaytEnabled(s)){if(c)s.getSelection().unlock(true);window.setTimeout(function(){x.focus();x.refresh();},10);}},this,null,50);s.on('scaytDialog',function(x){x.data.djConfig=window.djConfig;x.data.scayt_control=p.getScayt(s);x.data.tab=m;x.data.scayt=window.scayt;});var u=s.dataProcessor,v=u&&u.htmlFilter;if(v)v.addRules({elements:{span:function(x){if(x.attributes.scayt_word&&x.attributes.scaytid){delete x.name;return x;}}}});var w=j.undo.Image.prototype;w.equals=e.override(w.equals,function(x){return function(y){var D=this;var z=D.contents,A=y.contents,B=p.getScayt(D.editor);if(B&&p.isScaytReady(D.editor)){D.contents=B.reset(z)||'';y.contents=B.reset(A)||'';}var C=x.apply(D,arguments);D.contents=z;y.contents=A;return C;};});if(s.document)t();};j.scayt={engineLoaded:false,instances:{},controlInfo:{},setControlInfo:function(s,t){if(s&&s.name&&typeof this.controlInfo[s.name]!='object')this.controlInfo[s.name]={};for(var u in t)this.controlInfo[s.name][u]=t[u];},isControlRestored:function(s){if(s&&s.name&&this.controlInfo[s.name])return this.controlInfo[s.name].restored;return false;},markControlRestore:function(s){this.setControlInfo(s,{restored:true});},setControlId:function(s,t){this.setControlInfo(s,{id:t});},getControlId:function(s){if(s&&s.name&&this.controlInfo[s.name]&&this.controlInfo[s.name].id)return this.controlInfo[s.name].id;return null;},setPaused:function(s,t){this.setControlInfo(s,{paused:t});},isPaused:function(s){if(s&&s.name&&this.controlInfo[s.name])return this.controlInfo[s.name].paused;return undefined;},getScayt:function(s){return this.instances[s.name];},isScaytReady:function(s){return this.engineLoaded===true&&'undefined'!==typeof window.scayt&&this.getScayt(s);},isScaytEnabled:function(s){var t=this.getScayt(s);return t?t.disabled===false:false;},loadEngine:function(s){if(b.gecko&&b.version<10900||b.opera)return s.fire('showScaytState');if(this.engineLoaded===true)return o.apply(s);else if(this.engineLoaded==-1)return a.on('scaytReady',function(){o.apply(s); });a.on('scaytReady',o,s);a.on('scaytReady',function(){this.engineLoaded=true;},this,null,0);this.engineLoaded=-1;var t=document.location.protocol;t=t.search(/https?:/)!=-1?t:'http:';var u='svc.spellchecker.net/scayt25/loader__base.js',v=s.config.scayt_srcUrl||t+'
});};var z=window.scayt_custom_params;if(typeof z=='object')for(var A in z)y[A]=z[A];if(o)y.id=o;var B=new window.scayt(y),C=r.instances[u.name];if(C){B.sLang=C.sLang;B.option(C.option());B.paused=C.paused;}r.instances[u.name]=B;var D='scaytButton',E=window.scayt.uiTags,F=[];for(var G=0,H=4;G<H;G++)F.push(E[G]&&r.uiTabs[G]);r.uiTabs=F;try{B.setDisabled(n===false);}catch(I){}u.fire('showScaytState');};u.on('contentDom',v);u.on('contentDomUnload',function(){var y=a.document.getElementsByTag('script'),z=/^dojoIoScript(\d+)$/i,A=/^https?:\/\/svc\.spellchecker\.net\/spellcheck\/script\/ssrv\.cgi/i;for(var B=0;B<y.count();B++){var C=y.getItem(B),D=C.getId(),E=C.getAttribute('src');if(D&&E&&D.match(z)&&E.match(A))C.remove();}});u.on('beforeCommandExec',function(y){if((y.data.name=='source'||y.data.name=='newpage')&&u.mode=='wysiwyg'){var z=r.getScayt(u);if(z){n=z.paused=!z.disabled;o=z.id;z.destroy(true);delete r.instances[u.name];}}});u.on('destroy',function(y){var z=y.editor,A=r.getScayt(z);o=A.id;A.destroy(true);delete r.instances[z.name];});u.on('afterSetData',function(){if(r.isScaytEnabled(u))window.setTimeout(function(){r.getScayt(u).refresh();},10);});u.on('insertElement',function(){var y=r.getScayt(u);if(r.isScaytEnabled(u)){if(c)u.getSelection().unlock(true);window.setTimeout(function(){y.refresh();},10);}},this,null,50);u.on('insertHtml',function(){var y=r.getScayt(u);if(r.isScaytEnabled(u)){if(c)u.getSelection().unlock(true);window.setTimeout(function(){y.refresh();},10);}},this,null,50);u.on('scaytDialog',function(y){y.data.djConfig=window.djConfig;y.data.scayt_control=r.getScayt(u);y.data.tab=m;y.data.scayt=window.scayt;});var w=u.dataProcessor,x=w&&w.htmlFilter;if(x)x.addRules({elements:{span:function(y){if(y.attributes.scayt_word&&y.attributes.scaytid){delete y.name;return y;}}}});if(u.document)v();};j.scayt={engineLoaded:false,instances:{},getScayt:function(u){return this.instances[u.name];},isScaytReady:function(u){return this.engineLoaded===true&&'undefined'!==typeof window.scayt&&this.getScayt(u);},isScaytEnabled:function(u){var v=this.getScayt(u);return v?v.disabled===false:false;},loadEngine:function(u){if(b.opera)return null;if(this.engineLoaded===true)return q.apply(u);else if(this.engineLoaded==-1)return a.on('scaytReady',function(){q.apply(u);});a.on('scaytReady',q,u);a.on('scaytReady',function(){this.engineLoaded=true;},this,null,0);this.engineLoaded=-1;var v=document.location.protocol;v=v.search(/https?:/)!=-1?v:'http:';var w='svc.spellchecker.net/spellcheck31/lf/scayt/scayt22.js',x=u.config.scayt_srcUrl||v+'//'+w,y=r.parseUrl(x).path+'/';a._djScaytConfig={baseUrl:y,addOnLoad:[function(){a.fireOnce('scaytReady');}],isDebug:false};a.document.getHead().append(a.document.createElement('script',{attributes:{type:'text/javascript',src:x}}));return null;},parseUrl:function(u){var v;if(u.match&&(v=u.match(/(.*)[\/\\](.*?\.\w+)$/)))return{path:v[1],file:v[2]};else return u;}};var r=j.scayt,s=function(u,v,w,x,y,z,A){u.addCommand(x,y);u.addMenuItem(x,{label:w,command:x,group:z,order:A});},t={preserveState:true,editorFocus:false,exec:function(u){if(r.isScaytReady(u)){var v=r.isScaytEnabled(u);this.setState(v?2:1);var w=r.getScayt(u);w.setDisabled(v);}else if(!u.config.scayt_autoStartup&&r.engineLoaded>=0){this.setState(0);u.on('showScaytState',function(){this.removeListener();this.setState(r.isScaytEnabled(u)?1:2);},this);r.loadEngine(u);}}};j.add('scayt',{requires:['menubutton'],beforeInit:function(u){u.config.menu_groups='scayt_suggest,scayt_moresuggest,scayt_control,'+u.config.menu_groups;},init:function(u){var v={},w={},x=u.addCommand(l,t);a.dialog.add(l,a.getUrl(this.path+'dialogs/options.js'));var y=u.config.scayt_uiTabs||'1,1,1',z=[];y=y.split(',');for(var A=0,B=3;A<B;A++){var C=parseInt(y[A]||'1',10);z.push(C);}var D='scaytButton';u.addMenuGroup(D);var E={};E.scaytToggle={label:u.lang.scayt.enable,command:l,group:D};if(z[0]==1)E.scaytOptions={label:u.lang.scayt.options,group:D,onClick:function(){m='options';u.openDialog(l);}};if(z[1]==1)E.scaytLangs={label:u.lang.scayt.langs,group:D,onClick:function(){m='langs';u.openDialog(l);}};if(z[2]==1)E.scaytDict={label:u.lang.scayt.dictionariesTab,group:D,onClick:function(){m='dictionaries';u.openDialog(l);}};E.scaytAbout={label:u.lang.scayt.about,group:D,onClick:function(){m='about';u.openDialog(l);}};z[3]=1;r.uiTabs=z;u.addMenuItems(E);u.ui.add('Scayt',5,{label:u.lang.scayt.title,title:u.lang.scayt.title,className:'cke_button_scayt',onRender:function(){x.on('state',function(){this.setState(x.state);},this);},onMenu:function(){var G=r.isScaytEnabled(u);u.getMenuItem('scaytToggle').label=u.lang.scayt[G?'disable':'enable'];return{scaytToggle:2,scaytOptions:G&&r.uiTabs[0]?2:0,scaytLangs:G&&r.uiTabs[1]?2:0,scaytDict:G&&r.uiTabs[2]?2:0,scaytAbout:G&&r.uiTabs[3]?2:0};}});if(u.contextMenu&&u.addMenuItems)u.contextMenu.addListener(function(){if(!r.isScaytEnabled(u))return null;var G=r.getScayt(u),H=G.getScaytNode();if(!H)return null;var I=G.getWord(H);if(!I)return null;var J=G.getLang(),K={},L=window.scayt.getSuggestion(I,J);if(!L||!L.length)return null;for(A in v){delete u._.menuItems[A];
getElements: function() { return els; },
function Loader(els, conf) { // private variables var self = this, $self = $(this), css = conf.css, progress; if (conf.progress) { progress = $("<div/>").addClass(css.progress).html(conf.progress); } // The API $.extend(self, { preload: function(begin, end) { return self.load(begin, end, true); }, /* load() // loads all load(2) // loads 3:rd element load(2, 4) // loads elements 3 - 5 load(els) // loads supplied elements. must be a subset of the initial elements */ load: function(begin, end) { // filtered set of nodes var nodes = null, preload = arguments[arguments.length -1] === true; if (begin && begin.jquery) { nodes = begin.filter(function() { return els.index(this) >= 0; }); } else { nodes = begin >= 0 ? els.slice(begin, end || begin + 1) : els; } // loop trough nodes nodes.each(function(index) { var el = $(this); // already loaded --> skip. if (el.is(":loaded")) { return effects[conf.effect].call(self, el, function() {}); } // loop trough loaders $.each(loaders, function(matcher, loader) { if (el.is(matcher) && $.isFunction(loader[1])) { // match found var e = new $.Event("onBeforeLoad"); $self.trigger(e, [el]); // loading cancelled by user if (e.isDefaultPrevented()) { return false; } // start loading el.addClass(css.loading); loader[1].call(self, el, function(error) { // if (el.is(":loaded")) { return; } // loading failed if (error) { return $self.trigger("onError", [el, error]); } function setLoaded() { // loaded flag el.data("loaded", true); // CSS class names el.removeClass(css.before).removeClass(css.loading); if (css.after) { el.addClass(css.after); } // onLoad callback $self.trigger("onLoad", [el]); } if (preload) { // mark as loaded setLoaded(); } else { // perform effect and mark loaded effects[conf.effect].call(self, el, setLoaded); } }); } }); }); // onLoadAll callback $self.bind("onLoad.tmp", function() { if (!nodes.not(":loaded").length) { $self.trigger("onLoadAll", [nodes], preload); $self.unbind("onLoad.tmp"); } }); return self; }, getElements: function() { return els; }, getConf: function() { return conf; }, getProgress: function() { return progress ? progress.clone() : null; }, bind: function(name, fn) { $self.bind(name, fn); return self; }, one: function(name, fn) { $self.one(name, fn); return self; }, unbind: function(name) { $self.unbind(name); return self; } }); // callbacks $.each("onBeforeLoad,onLoad,onLoadAll,onError".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { self.bind(name, conf[name]); } // API methods self[name] = function(fn) { return self.bind(name, fn); }; }); if (conf.loadOnScroll) { $(window).bind("scroll", function() { els.each(function() { var el = $(this); if (!el.is(":loaded") && !el.is(":invisible")) { self.load(els.index(el[0])); } }); }); } // initialize els.each(function() { var el = $(this).addClass(css.before).data("loaded", false); $.each(loaders, function(matcher, loader) { if (el.filter(matcher).length && $.isFunction(loader[0])) { loader[0].call(self, el); } }); }); }
self.bind("onLoad.tmp", function() {
$(self).bind("onLoad.tmp", function() {
function Loader(els, conf) { // private variables var self = this, trigger = els.add(this), css = conf.css, progress; if (conf.progress) { progress = $("<div/>").addClass(css.progress).html(conf.progress); } // The API $.extend(self, { preload: function(begin, end) { return self.load(begin, end, true); }, /* load() // loads all load(2) // loads 3:rd element load(2, 4) // loads elements 3 - 5 load(els) // loads supplied elements. must be a subset of the initial elements */ load: function(begin, end) { // filtered set of nodes var nodes = null, preload = arguments[arguments.length -1] === true; if (begin && begin.jquery) { nodes = begin.filter(function() { return els.index(this) >= 0; }); } else { nodes = begin >= 0 ? els.slice(begin, end || begin + 1) : els; } // loop trough nodes nodes.each(function(index) { var el = $(this); // already loaded --> skip. if (el.is(":loaded")) { return effects[conf.effect].call(self, el, function() {}); } // loop trough loaders $.each(loaders, function(matcher, loader) { if (el.is(matcher) && $.isFunction(loader[1])) { // match found var e = new $.Event("onBeforeLoad"); trigger.trigger(e, [el]); // loading cancelled by user if (e.isDefaultPrevented()) { return false; } // start loading el.addClass(css.loading); loader[1].call(self, el, function(error) { // loading failed if (error) { return trigger.trigger("onError", [el, error]); } function setLoaded() { // loaded flag el.data("loaded", true); // CSS class names el.removeClass(css.before).removeClass(css.loading); if (css.after) { el.addClass(css.after); } // onLoad callback trigger.trigger("onLoad", [el]); } if (preload) { // mark as loaded setLoaded(); } else { // perform effect and mark loaded effects[conf.effect].call(self, el, setLoaded); } }); } }); }); // onLoadAll callback self.bind("onLoad.tmp", function() { if (!nodes.not(":loaded").length) { trigger.trigger("onLoadAll", [nodes], preload); self.unbind("onLoad.tmp"); } }); return self; }, getConf: function() { return conf; }, getProgress: function() { return progress ? progress.clone() : null; } }); // callbacks $.each("onBeforeLoad,onLoad,onLoadAll,onError".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); if (conf.loadOnScroll) { $(window).bind("scroll", function() { els.each(function() { var el = $(this); if (!el.is(":loaded") && !el.is(":invisible")) { self.load(els.index(el[0])); } }); }); } // initialize els.each(function() { var el = $(this).addClass(css.before).data("loaded", false); $.each(loaders, function(matcher, loader) { if (el.filter(matcher).length && $.isFunction(loader[0])) { loader[0].call(self, el); } }); }); }
self.unbind("onLoad.tmp");
$(self).unbind("onLoad.tmp");
function Loader(els, conf) { // private variables var self = this, trigger = els.add(this), css = conf.css, progress; if (conf.progress) { progress = $("<div/>").addClass(css.progress).html(conf.progress); } // The API $.extend(self, { preload: function(begin, end) { return self.load(begin, end, true); }, /* load() // loads all load(2) // loads 3:rd element load(2, 4) // loads elements 3 - 5 load(els) // loads supplied elements. must be a subset of the initial elements */ load: function(begin, end) { // filtered set of nodes var nodes = null, preload = arguments[arguments.length -1] === true; if (begin && begin.jquery) { nodes = begin.filter(function() { return els.index(this) >= 0; }); } else { nodes = begin >= 0 ? els.slice(begin, end || begin + 1) : els; } // loop trough nodes nodes.each(function(index) { var el = $(this); // already loaded --> skip. if (el.is(":loaded")) { return effects[conf.effect].call(self, el, function() {}); } // loop trough loaders $.each(loaders, function(matcher, loader) { if (el.is(matcher) && $.isFunction(loader[1])) { // match found var e = new $.Event("onBeforeLoad"); trigger.trigger(e, [el]); // loading cancelled by user if (e.isDefaultPrevented()) { return false; } // start loading el.addClass(css.loading); loader[1].call(self, el, function(error) { // loading failed if (error) { return trigger.trigger("onError", [el, error]); } function setLoaded() { // loaded flag el.data("loaded", true); // CSS class names el.removeClass(css.before).removeClass(css.loading); if (css.after) { el.addClass(css.after); } // onLoad callback trigger.trigger("onLoad", [el]); } if (preload) { // mark as loaded setLoaded(); } else { // perform effect and mark loaded effects[conf.effect].call(self, el, setLoaded); } }); } }); }); // onLoadAll callback self.bind("onLoad.tmp", function() { if (!nodes.not(":loaded").length) { trigger.trigger("onLoadAll", [nodes], preload); self.unbind("onLoad.tmp"); } }); return self; }, getConf: function() { return conf; }, getProgress: function() { return progress ? progress.clone() : null; } }); // callbacks $.each("onBeforeLoad,onLoad,onLoadAll,onError".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } // API methods self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); if (conf.loadOnScroll) { $(window).bind("scroll", function() { els.each(function() { var el = $(this); if (!el.is(":loaded") && !el.is(":invisible")) { self.load(els.index(el[0])); } }); }); } // initialize els.each(function() { var el = $(this).addClass(css.before).data("loaded", false); $.each(loaders, function(matcher, loader) { if (el.filter(matcher).length && $.isFunction(loader[0])) { loader[0].call(self, el); } }); }); }
throw "We couldn't find a favicon for this URL: " + url;
if (this._KFLog.logSensitiveData) throw "We couldn't find a favicon for this URL: " + url; else throw "We couldn't find a favicon";
loadFavicon: function(url) { try { var faviconService = Components.classes["@mozilla.org/browser/favicon-service;1"] .getService(Components.interfaces.nsIFaviconService); var ioservice = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var pageURI = ioservice.newURI(url, null, null); var favIconURI = faviconService.getFaviconForPage(pageURI); if (!faviconService.isFailedFavicon(favIconURI)) { var datalen = {}; var mimeType = {}; var data = faviconService.getFaviconData(favIconURI, mimeType, datalen); var faviconBytes = String.fromCharCode.apply(null, data); return btoa(faviconBytes); } throw "We couldn't find a favicon for this URL: " + url; } catch (ex) { // something failed so we can't get the favicon. We don't really mind too much... this._KFLog.info("favicon load failed for " + url + " : " + ex); throw "We couldn't find a favicon for this URL: " + url + " BECAUSE: " + ex; } }
this._KFLog.info("favicon load failed for " + url + " : " + ex); throw "We couldn't find a favicon for this URL: " + url + " BECAUSE: " + ex;
if (this._KFLog.logSensitiveData) { this._KFLog.info("favicon load failed for " + url + " : " + ex); throw "We couldn't find a favicon for this URL: " + url + " BECAUSE: " + ex; } else { this._KFLog.info("favicon load failed: " + ex); throw "We couldn't find a favicon BECAUSE: " + ex; }
loadFavicon: function(url) { try { var faviconService = Components.classes["@mozilla.org/browser/favicon-service;1"] .getService(Components.interfaces.nsIFaviconService); var ioservice = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var pageURI = ioservice.newURI(url, null, null); var favIconURI = faviconService.getFaviconForPage(pageURI); if (!faviconService.isFailedFavicon(favIconURI)) { var datalen = {}; var mimeType = {}; var data = faviconService.getFaviconData(favIconURI, mimeType, datalen); var faviconBytes = String.fromCharCode.apply(null, data); return btoa(faviconBytes); } throw "We couldn't find a favicon for this URL: " + url; } catch (ex) { // something failed so we can't get the favicon. We don't really mind too much... this._KFLog.info("favicon load failed for " + url + " : " + ex); throw "We couldn't find a favicon for this URL: " + url + " BECAUSE: " + ex; } }
m.setData(m.config.newpage_html,function(){setTimeout(function(){m.fire('afterCommandExec',{name:n.name,command:n});},200);});m.focus();},async:true});l.ui.addButton('NewPage',{label:l.lang.newPage,command:'newpage'});}});i.newpage_html='';j.add('pagebreak',{init:function(l){l.addCommand('pagebreak',j.pagebreakCmd);l.ui.addButton('PageBreak',{label:l.lang.pagebreak,command:'pagebreak'});l.addCss('img.cke_pagebreak{background-image: url('+a.getUrl(this.path+'images/pagebreak.gif')+');'+'background-position: center center;'+'background-repeat: no-repeat;'+'clear: both;'+'display: block;'+'float: none;'+'width: 100%;'+'border-top: #999999 1px dotted;'+'border-bottom: #999999 1px dotted;'+'height: 5px;'+'page-break-after: always;'+'}');},afterInit:function(l){var m=l.dataProcessor,n=m&&m.dataFilter;if(n)n.addRules({elements:{div:function(o){var p=o.attributes,q=p&&p.style,r=q&&o.children.length==1&&o.children[0],s=r&&r.name=='span'&&r.attributes.style;if(s&&/page-break-after\s*:\s*always/i.test(q)&&/display\s*:\s*none/i.test(s))return l.createFakeParserElement(o,'cke_pagebreak','div');}}});},requires:['fakeobjects']});j.pagebreakCmd={exec:function(l){var m=h.createFromHtml('<div style="page-break-after: always;"><span style="display: none;">&nbsp;</span></div>');m=l.createFakeElement(m,'cke_pagebreak','div');var n=l.getSelection().getRanges();for(var o,p=0;p<n.length;p++){o=n[p];if(p>0)m=m.clone(true);o.splitBlock('p');o.insertNode(m);if(p==n.length-1){o.moveToPosition(m,4);o.select();}}}};(function(){j.add('pastefromword',{init:function(l){var m=0,n=function(){setTimeout(function(){m=0;},0);};l.addCommand('pastefromword',{canUndo:false,exec:function(){m=1;if(l.execCommand('paste')===false)l.on('dialogHide',function(o){o.removeListener();n();});}});l.ui.addButton('PasteFromWord',{label:l.lang.pastefromword.toolbar,command:'pastefromword'});l.on('paste',function(o){var p=o.data,q;if((q=p.html)&&(m||/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(q))){var r=this.loadFilterRules(function(){if(r)l.fire('paste',p);else if(!l.config.pasteFromWordPromptCleanup||m||confirm(l.lang.pastefromword.confirmCleanup))p.html=a.cleanWord(q,l);});r&&o.cancel();}},this);},loadFilterRules:function(l){var m=a.cleanWord;if(m)l();else{var n=a.getUrl(i.pasteFromWordCleanupFile||this.path+'filter/default.js');a.scriptLoader.load(n,l,null,false,true);}return!m;}});})();(function(){var l={exec:function(o){var p=e.tryThese(function(){var q=window.clipboardData.getData('Text');if(!q)throw 0;
if(l.execCommand('paste')===false)l.on('dialogHide',function(o){o.removeListener();n();});else n();}});l.ui.addButton('PasteFromWord',{label:l.lang.pastefromword.toolbar,command:'pastefromword'});l.on('paste',function(o){var p=o.data,q;if((q=p.html)&&(m||/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(q))){var r=this.loadFilterRules(function(){if(r)l.fire('paste',p);else if(!l.config.pasteFromWordPromptCleanup||m||confirm(l.lang.pastefromword.confirmCleanup))p.html=a.cleanWord(q,l);});r&&o.cancel();}},this);},loadFilterRules:function(l){var m=a.cleanWord;if(m)l();else{var n=a.getUrl(i.pasteFromWordCleanupFile||this.path+'filter/default.js');a.scriptLoader.load(n,l,null,false,true);}return!m;}});})();(function(){var l={exec:function(o){var p=e.tryThese(function(){var q=window.clipboardData.getData('Text');if(!q)throw 0;return q;});if(!p){o.openDialog('pastetext');return false;}else o.fire('paste',{text:p});return true;}};function m(o,p){if(c){var q=o.selection;if(q.type=='Control')q.clear();q.createRange().pasteHTML(p);}else o.execCommand('inserthtml',false,p);};j.add('pastetext',{init:function(o){var p='pastetext',q=o.addCommand(p,l);o.ui.addButton('PasteText',{label:o.lang.pasteText.button,command:p});a.dialog.add(p,a.getUrl(this.path+'dialogs/pastetext.js'));if(o.config.forcePasteAsPlainText)o.on('beforeCommandExec',function(r){if(r.data.name=='paste'){o.execCommand('pastetext');r.cancel();}},null,null,0);},requires:['clipboard']});function n(o,p,q,r){while(q--)j.enterkey[p==2?'enterBr':'enterBlock'](o,p,null,r);};a.editor.prototype.insertText=function(o){this.focus();this.fire('saveSnapshot');var p=this.getSelection().getStartElement().hasAscendant('pre',true)?2:this.config.enterMode,q=p==2,r=this.document.$,s=this,t;o=e.htmlEncode(o.replace(/\r\n|\r/g,'\n'));var u=0;o.replace(/\n+/g,function(v,w){t=o.substring(u,w);u=w+v.length;t.length&&m(r,t);var x=v.length,y=q?0:Math.floor(x/2),z=q?x:x%2;n(s,p,y);n(s,2,z,q?false:true);});t=o.substring(u,o.length);t.length&&m(r,t);this.fire('saveSnapshot');};})();j.add('popup');e.extend(a.editor.prototype,{popup:function(l,m,n,o){m=m||'80%';n=n||'70%';if(typeof m=='string'&&m.length>1&&m.substr(m.length-1,1)=='%')m=parseInt(window.screen.width*parseInt(m,10)/100,10);if(typeof n=='string'&&n.length>1&&n.substr(n.length-1,1)=='%')n=parseInt(window.screen.height*parseInt(n,10)/100,10);if(m<640)m=640;if(n<420)n=420;var p=parseInt((window.screen.height-n)/2,10),q=parseInt((window.screen.width-m)/2,10);o=(o||'location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,scrollbars=yes')+',width='+m+',height='+n+',top='+p+',left='+q;
m.setData(m.config.newpage_html,function(){setTimeout(function(){m.fire('afterCommandExec',{name:n.name,command:n});},200);});m.focus();},async:true});l.ui.addButton('NewPage',{label:l.lang.newPage,command:'newpage'});}});i.newpage_html='';j.add('pagebreak',{init:function(l){l.addCommand('pagebreak',j.pagebreakCmd);l.ui.addButton('PageBreak',{label:l.lang.pagebreak,command:'pagebreak'});l.addCss('img.cke_pagebreak{background-image: url('+a.getUrl(this.path+'images/pagebreak.gif')+');'+'background-position: center center;'+'background-repeat: no-repeat;'+'clear: both;'+'display: block;'+'float: none;'+'width: 100%;'+'border-top: #999999 1px dotted;'+'border-bottom: #999999 1px dotted;'+'height: 5px;'+'page-break-after: always;'+'}');},afterInit:function(l){var m=l.dataProcessor,n=m&&m.dataFilter;if(n)n.addRules({elements:{div:function(o){var p=o.attributes,q=p&&p.style,r=q&&o.children.length==1&&o.children[0],s=r&&r.name=='span'&&r.attributes.style;if(s&&/page-break-after\s*:\s*always/i.test(q)&&/display\s*:\s*none/i.test(s))return l.createFakeParserElement(o,'cke_pagebreak','div');}}});},requires:['fakeobjects']});j.pagebreakCmd={exec:function(l){var m=h.createFromHtml('<div style="page-break-after: always;"><span style="display: none;">&nbsp;</span></div>');m=l.createFakeElement(m,'cke_pagebreak','div');var n=l.getSelection().getRanges();for(var o,p=0;p<n.length;p++){o=n[p];if(p>0)m=m.clone(true);o.splitBlock('p');o.insertNode(m);if(p==n.length-1){o.moveToPosition(m,4);o.select();}}}};(function(){j.add('pastefromword',{init:function(l){var m=0,n=function(){setTimeout(function(){m=0;},0);};l.addCommand('pastefromword',{canUndo:false,exec:function(){m=1;if(l.execCommand('paste')===false)l.on('dialogHide',function(o){o.removeListener();n();});}});l.ui.addButton('PasteFromWord',{label:l.lang.pastefromword.toolbar,command:'pastefromword'});l.on('paste',function(o){var p=o.data,q;if((q=p.html)&&(m||/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(q))){var r=this.loadFilterRules(function(){if(r)l.fire('paste',p);else if(!l.config.pasteFromWordPromptCleanup||m||confirm(l.lang.pastefromword.confirmCleanup))p.html=a.cleanWord(q,l);});r&&o.cancel();}},this);},loadFilterRules:function(l){var m=a.cleanWord;if(m)l();else{var n=a.getUrl(i.pasteFromWordCleanupFile||this.path+'filter/default.js');a.scriptLoader.load(n,l,null,false,true);}return!m;}});})();(function(){var l={exec:function(o){var p=e.tryThese(function(){var q=window.clipboardData.getData('Text');if(!q)throw 0;
this.find('name', 'twinpanel')[0].disable(); this.find('name', 'roles-privs-tree')[0].dragZone.lock(); this.find('name', 'all-roles-privs-tree')[0].dragZone.lock();
loadHandler : function() { if (!this.payload.data.userManaged) { this.find('name', 'internalResourceHeader')[0].setVisible(true); this.find('name', 'id')[0].disable(); this.find('name', 'name')[0].disable(); this.find('name', 'description')[0].disable(); this.find('name', 'twinpanel')[0].disable(); this.find('name', 'roles-privs-tree')[0].dragZone.lock(); this.find('name', 'all-roles-privs-tree')[0].dragZone.lock(); for (var i = 0; i < this.buttons.length; i++) { this.buttons[i].disable(); } } },
var formatField = this.form.findField('format'); if ( formatField ){ this.updateDownloadRemoteIndexCombo( formatField.getValue() ); this.updateIndexableCombo( formatField.getValue() ); }
loadHandler: function( form, action, receivedData ) { var repoType = receivedData.repoType; var repoPolicy = receivedData.repoPolicy; if ( repoType == 'proxy' &&! receivedData.remoteStorage.remoteStorageUrl .match( REPO_REMOTE_STORAGE_REGEXP ) ) { var rsUrl = this.form.findField( 'remoteStorage.remoteStorageUrl' ); rsUrl.disable(); rsUrl.clearInvalid(); // Disable the editor - this is a temporary measure, // until we find a better solution for procurement repos this.buttons[0].disable(); } },
if (cswRecord.getFilteredOnlineResources('WFS').length != 0) {
if (cswRecord.getFilteredOnlineResources('WFS').length !== 0) {
var loadLayer = function(activeLayerRecord) { var cswRecords = activeLayerRecord.getCSWRecords(); //We simplify things by treating the record list as a single type of WFS, WCS or WMS //So lets find the first record with a type we can choose (Prioritise WFS -> WCS -> WMS) if (cswRecords.length > 0) { var cswRecord = cswRecords[0]; if (cswRecord.getFilteredOnlineResources('WFS').length != 0) { wfsHandler(activeLayerRecord); } else if (cswRecord.getFilteredOnlineResources('WCS').length != 0) { wcsHandler(activeLayerRecord); } else if (cswRecord.getFilteredOnlineResources('WMS').length != 0) { wmsHandler(activeLayerRecord); } else { genericRecordHandler(activeLayerRecord); } } };