adds missing semicolons in src/static/js folder

This commit is contained in:
disy-mk 2013-03-24 03:44:17 +01:00
parent 35e4891217
commit aabbd8e528
20 changed files with 80 additions and 84 deletions

View file

@ -284,7 +284,7 @@ exports.checkRep = function (cs) {
exports.assert(normalized == cs, normalized, ' != ', cs); exports.assert(normalized == cs, normalized, ' != ', cs);
return cs; return cs;
} };
/** /**

View file

@ -38,7 +38,7 @@ function scriptTag(source) {
'<script type="text/javascript">\n' '<script type="text/javascript">\n'
+ source.replace(/<\//g, '<\\/') + + source.replace(/<\//g, '<\\/') +
'</script>' '</script>'
) );
} }
function Ace2Editor() function Ace2Editor()
@ -63,7 +63,7 @@ function Ace2Editor()
var action = function() var action = function()
{ {
func.apply(that, args); func.apply(that, args);
} };
if (optDoNow) if (optDoNow)
{ {
optDoNow.apply(that, args); optDoNow.apply(that, args);
@ -82,7 +82,7 @@ function Ace2Editor()
function doActionsPendingInit() function doActionsPendingInit()
{ {
_.each(actionsPendingInit, function(fn,i){ _.each(actionsPendingInit, function(fn,i){
fn() fn();
}); });
actionsPendingInit = []; actionsPendingInit = [];
} }
@ -223,12 +223,12 @@ function Ace2Editor()
// source here. // source here.
// these lines must conform to a specific format because they are passed by the build script: // these lines must conform to a specific format because they are passed by the build script:
var includedCSS = []; var includedCSS = [];
var $$INCLUDE_CSS = function(filename) {includedCSS.push(filename)}; var $$INCLUDE_CSS = function(filename) {includedCSS.push(filename);};
$$INCLUDE_CSS("../static/css/iframe_editor.css"); $$INCLUDE_CSS("../static/css/iframe_editor.css");
$$INCLUDE_CSS("../static/css/pad.css"); $$INCLUDE_CSS("../static/css/pad.css");
$$INCLUDE_CSS("../static/custom/pad.css"); $$INCLUDE_CSS("../static/custom/pad.css");
var additionalCSS = _(hooks.callAll("aceEditorCSS")).map(function(path){ return '../static/plugins/' + path }); var additionalCSS = _(hooks.callAll("aceEditorCSS")).map(function(path){ return '../static/plugins/' + path; });
includedCSS = includedCSS.concat(additionalCSS); includedCSS = includedCSS.concat(additionalCSS);
pushStyleTagsFor(iframeHTML, includedCSS); pushStyleTagsFor(iframeHTML, includedCSS);

View file

@ -205,7 +205,7 @@ function Ace2Inner(){
function getAuthorInfos(){ function getAuthorInfos(){
return authorInfos; return authorInfos;
}; }
editorInfo.ace_getAuthorInfos= getAuthorInfos; editorInfo.ace_getAuthorInfos= getAuthorInfos;
function setAuthorInfo(author, info) function setAuthorInfo(author, info)
@ -241,7 +241,7 @@ function Ace2Inner(){
var parentAuthorStyle = parentDynamicCSS.selectorStyle(getAuthorColorClassSelector( var parentAuthorStyle = parentDynamicCSS.selectorStyle(getAuthorColorClassSelector(
getAuthorClassName(author))); getAuthorClassName(author)));
var anchorStyle = dynamicCSS.selectorStyle(getAuthorColorClassSelector( var anchorStyle = dynamicCSS.selectorStyle(getAuthorColorClassSelector(
getAuthorClassName(author))+' > a') getAuthorClassName(author))+' > a');
// author color // author color
authorStyle.backgroundColor = bgcolor; authorStyle.backgroundColor = bgcolor;
@ -350,7 +350,7 @@ function Ace2Inner(){
editorInfo.ace_getAuthor = function() editorInfo.ace_getAuthor = function()
{ {
return thisAuthor; return thisAuthor;
} };
var currentCallStack = null; var currentCallStack = null;
@ -934,8 +934,8 @@ function Ace2Inner(){
// Convinience function returning a setter for a class on an element // Convinience function returning a setter for a class on an element
var setClassPresenceNamed = function(element, cls){ var setClassPresenceNamed = function(element, cls){
return function(value){ return function(value){
setClassPresence(element, cls, !! value) setClassPresence(element, cls, !! value);
} };
}; };
// These properties are exposed // These properties are exposed
@ -960,9 +960,9 @@ function Ace2Inner(){
textface: setTextFace, textface: setTextFace,
textsize: setTextSize, textsize: setTextSize,
rtlistrue: function(value) { rtlistrue: function(value) {
setClassPresence(root, "rtl", value) setClassPresence(root, "rtl", value);
setClassPresence(root, "ltr", !value) setClassPresence(root, "ltr", !value);
document.documentElement.dir = value? 'rtl' : 'ltr' document.documentElement.dir = value? 'rtl' : 'ltr';
} }
}; };
@ -970,7 +970,7 @@ function Ace2Inner(){
// check if setter is present // check if setter is present
if(setter !== undefined){ if(setter !== undefined){
setter(value) setter(value);
} }
}; };
@ -4697,7 +4697,7 @@ function Ace2Inner(){
editorInfo.ace_getInInternationalComposition = function () editorInfo.ace_getInInternationalComposition = function ()
{ {
return inInternationalComposition; return inInternationalComposition;
} };
function bindTheEventHandlers() function bindTheEventHandlers()
{ {
@ -4970,7 +4970,7 @@ function Ace2Inner(){
function getLineListType(lineNum) function getLineListType(lineNum)
{ {
return documentAttributeManager.getAttributeOnLine(lineNum, listAttributeName) return documentAttributeManager.getAttributeOnLine(lineNum, listAttributeName);
} }
function setLineListType(lineNum, listType) function setLineListType(lineNum, listType)
@ -5263,11 +5263,11 @@ function Ace2Inner(){
isSetUp = true; isSetUp = true;
}); });
} };
} }
exports.init = function () { exports.init = function () {
var editor = new Ace2Inner() var editor = new Ace2Inner();
editor.init(); editor.init();
}; };

View file

@ -273,7 +273,7 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro
padContents.currentRevision = revision; padContents.currentRevision = revision;
padContents.currentTime += timeDelta * 1000; padContents.currentTime += timeDelta * 1000;
debugLog('Time Delta: ', timeDelta) debugLog('Time Delta: ', timeDelta);
updateTimer(); updateTimer();
var authors = _.map(padContents.getActiveAuthors(), function(name) var authors = _.map(padContents.getActiveAuthors(), function(name)
@ -292,7 +292,7 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro
while (str.length < length) while (str.length < length)
str = '0' + str; str = '0' + str;
return str; return str;
} };
var date = new Date(padContents.currentTime); var date = new Date(padContents.currentTime);
var dateFormat = function() var dateFormat = function()
@ -311,12 +311,9 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro
"minutes": minutes, "minutes": minutes,
"seconds": seconds "seconds": seconds
})); }));
} };
$('#timer').html(dateFormat()); $('#timer').html(dateFormat());
var revisionDate = html10n.get("timeslider.saved", { var revisionDate = html10n.get("timeslider.saved", {
"day": date.getDate(), "day": date.getDate(),
@ -336,7 +333,7 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro
][date.getMonth()], ][date.getMonth()],
"year": date.getFullYear() "year": date.getFullYear()
}); });
$('#revision_date').html(revisionDate) $('#revision_date').html(revisionDate);
} }
@ -570,7 +567,7 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro
{ {
goToRevision.apply(goToRevision, arguments); goToRevision.apply(goToRevision, arguments);
} }
} };
BroadcastSlider.onSlider(goToRevisionIfEnabled); BroadcastSlider.onSlider(goToRevisionIfEnabled);
@ -586,7 +583,7 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro
if (bgcolor && dynamicCSS) if (bgcolor && dynamicCSS)
{ {
var selector = dynamicCSS.selectorStyle('.' + linestylefilter.getAuthorClassName(author)); var selector = dynamicCSS.selectorStyle('.' + linestylefilter.getAuthorClassName(author));
selector.backgroundColor = bgcolor selector.backgroundColor = bgcolor;
selector.color = (colorutils.luminosity(colorutils.css2triple(bgcolor)) < 0.5) ? '#ffffff' : '#000000'; //see ace2_inner.js for the other part selector.color = (colorutils.luminosity(colorutils.css2triple(bgcolor)) < 0.5) ? '#ffffff' : '#000000'; //see ace2_inner.js for the other part
} }
authorData[author] = data; authorData[author] = data;

View file

@ -46,7 +46,7 @@ function loadBroadcastRevisionsJS()
{ {
return (b.deltaRev - a.deltaRev) return (b.deltaRev - a.deltaRev)
}); });
} };
revisionInfo = {}; revisionInfo = {};
revisionInfo.addChangeset = function(fromIndex, toIndex, changeset, backChangeset, timeDelta) revisionInfo.addChangeset = function(fromIndex, toIndex, changeset, backChangeset, timeDelta)
@ -55,7 +55,7 @@ function loadBroadcastRevisionsJS()
var endRevision = revisionInfo[toIndex] || revisionInfo.createNew(toIndex); var endRevision = revisionInfo[toIndex] || revisionInfo.createNew(toIndex);
startRevision.addChangeset(toIndex, changeset, timeDelta); startRevision.addChangeset(toIndex, changeset, timeDelta);
endRevision.addChangeset(fromIndex, backChangeset, -1 * timeDelta); endRevision.addChangeset(fromIndex, backChangeset, -1 * timeDelta);
} };
revisionInfo.latest = clientVars.collab_client_vars.rev || -1; revisionInfo.latest = clientVars.collab_client_vars.rev || -1;
@ -68,7 +68,7 @@ function loadBroadcastRevisionsJS()
} }
return revisionInfo[index]; return revisionInfo[index];
} };
// assuming that there is a path from fromIndex to toIndex, and that the links // assuming that there is a path from fromIndex to toIndex, and that the links
// are laid out in a skip-list format // are laid out in a skip-list format
@ -80,7 +80,7 @@ function loadBroadcastRevisionsJS()
var elem = revisionInfo[fromIndex] || revisionInfo.createNew(fromIndex); var elem = revisionInfo[fromIndex] || revisionInfo.createNew(fromIndex);
if (elem.changesets.length != 0 && fromIndex != toIndex) if (elem.changesets.length != 0 && fromIndex != toIndex)
{ {
var reverse = !(fromIndex < toIndex) var reverse = !(fromIndex < toIndex);
while (((elem.rev < toIndex) && !reverse) || ((elem.rev > toIndex) && reverse)) while (((elem.rev < toIndex) && !reverse) || ((elem.rev > toIndex) && reverse))
{ {
var couldNotContinue = false; var couldNotContinue = false;
@ -122,7 +122,7 @@ function loadBroadcastRevisionsJS()
'spans': spans, 'spans': spans,
'times': times 'times': times
}; };
} }:
} }
exports.loadBroadcastRevisionsJS = loadBroadcastRevisionsJS; exports.loadBroadcastRevisionsJS = loadBroadcastRevisionsJS;

View file

@ -110,7 +110,7 @@ var chat = (function()
"sticky" : false, "sticky" : false,
"timestamp" : msg.time, "timestamp" : msg.time,
"timeStr" : timeStr "timeStr" : timeStr
} };
// is the users focus already in the chatbox? // is the users focus already in the chatbox?
var alreadyFocused = $("#chatinput").is(":focus"); var alreadyFocused = $("#chatinput").is(":focus");
@ -200,7 +200,7 @@ var chat = (function()
self.historyPointer = start; self.historyPointer = start;
}); });
} }
} };
return self; return self;
}()); }());

View file

@ -94,7 +94,7 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options, _pad)
{ {
if (evt.which == 27) if (evt.which == 27)
{ {
evt.preventDefault() evt.preventDefault();
} }
}); });
} }
@ -547,7 +547,7 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options, _pad)
{ {
action(); action();
} }
} };
} }
function doDeferredActions(tag) function doDeferredActions(tag)

View file

@ -29,7 +29,7 @@ var colorutils = {};
colorutils.isCssHex = function(cssColor) colorutils.isCssHex = function(cssColor)
{ {
return /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(cssColor); return /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(cssColor);
} };
// "#ffffff" or "#fff" or "ffffff" or "fff" to [1.0, 1.0, 1.0] // "#ffffff" or "#fff" or "ffffff" or "fff" to [1.0, 1.0, 1.0]
colorutils.css2triple = function(cssColor) colorutils.css2triple = function(cssColor)
@ -41,7 +41,7 @@ colorutils.css2triple = function(cssColor)
return Number("0x" + hh) / 255; return Number("0x" + hh) / 255;
} }
return [hexToFloat(sixHex.substr(0, 2)), hexToFloat(sixHex.substr(2, 2)), hexToFloat(sixHex.substr(4, 2))]; return [hexToFloat(sixHex.substr(0, 2)), hexToFloat(sixHex.substr(2, 2)), hexToFloat(sixHex.substr(4, 2))];
} };
// "#ffffff" or "#fff" or "ffffff" or "fff" to "ffffff" // "#ffffff" or "#fff" or "ffffff" or "fff" to "ffffff"
colorutils.css2sixhex = function(cssColor) colorutils.css2sixhex = function(cssColor)
@ -55,7 +55,7 @@ colorutils.css2sixhex = function(cssColor)
h = a + a + b + b + c + c; h = a + a + b + b + c + c;
} }
return h; return h;
} };
// [1.0, 1.0, 1.0] -> "#ffffff" // [1.0, 1.0, 1.0] -> "#ffffff"
colorutils.triple2css = function(triple) colorutils.triple2css = function(triple)
@ -66,8 +66,7 @@ colorutils.triple2css = function(triple)
return ("0" + n2.toString(16)).slice(-2); return ("0" + n2.toString(16)).slice(-2);
} }
return "#" + floatToHex(triple[0]) + floatToHex(triple[1]) + floatToHex(triple[2]); return "#" + floatToHex(triple[0]) + floatToHex(triple[1]) + floatToHex(triple[2]);
} };
colorutils.clamp = function(v, bot, top) colorutils.clamp = function(v, bot, top)
{ {
@ -101,18 +100,18 @@ colorutils.unscale = function(v, bot, top)
colorutils.scaleColor = function(c, bot, top) colorutils.scaleColor = function(c, bot, top)
{ {
return [colorutils.scale(c[0], bot, top), colorutils.scale(c[1], bot, top), colorutils.scale(c[2], bot, top)]; return [colorutils.scale(c[0], bot, top), colorutils.scale(c[1], bot, top), colorutils.scale(c[2], bot, top)];
} };
colorutils.unscaleColor = function(c, bot, top) colorutils.unscaleColor = function(c, bot, top)
{ {
return [colorutils.unscale(c[0], bot, top), colorutils.unscale(c[1], bot, top), colorutils.unscale(c[2], bot, top)]; return [colorutils.unscale(c[0], bot, top), colorutils.unscale(c[1], bot, top), colorutils.unscale(c[2], bot, top)];
} };
colorutils.luminosity = function(c) colorutils.luminosity = function(c)
{ {
// rule of thumb for RGB brightness; 1.0 is white // rule of thumb for RGB brightness; 1.0 is white
return c[0] * 0.30 + c[1] * 0.59 + c[2] * 0.11; return c[0] * 0.30 + c[1] * 0.59 + c[2] * 0.11;
} };
colorutils.saturate = function(c) colorutils.saturate = function(c)
{ {
@ -120,17 +119,17 @@ colorutils.saturate = function(c)
var max = colorutils.colorMax(c); var max = colorutils.colorMax(c);
if (max - min <= 0) return [1.0, 1.0, 1.0]; if (max - min <= 0) return [1.0, 1.0, 1.0];
return colorutils.unscaleColor(c, min, max); return colorutils.unscaleColor(c, min, max);
} };
colorutils.blend = function(c1, c2, t) colorutils.blend = function(c1, c2, t)
{ {
return [colorutils.scale(t, c1[0], c2[0]), colorutils.scale(t, c1[1], c2[1]), colorutils.scale(t, c1[2], c2[2])]; return [colorutils.scale(t, c1[0], c2[0]), colorutils.scale(t, c1[1], c2[1]), colorutils.scale(t, c1[2], c2[2])];
} };
colorutils.invert = function(c) colorutils.invert = function(c)
{ {
return [1 - c[0], 1 - c[1], 1- c[2]]; return [1 - c[0], 1 - c[1], 1- c[2]];
} };
colorutils.complementary = function(c) colorutils.complementary = function(c)
{ {
@ -140,6 +139,6 @@ colorutils.complementary = function(c)
(inv[1] >= c[1]) ? Math.min(inv[1] * 1.59, 1) : (c[1] * 0.59), (inv[1] >= c[1]) ? Math.min(inv[1] * 1.59, 1) : (c[1] * 0.59),
(inv[2] >= c[2]) ? Math.min(inv[2] * 1.11, 1) : (c[2] * 0.11) (inv[2] >= c[2]) ? Math.min(inv[2] * 1.11, 1) : (c[2] * 0.11)
]; ];
} };
exports.colorutils = colorutils; exports.colorutils = colorutils;

View file

@ -211,11 +211,11 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
cc.incrementFlag = function(state, flagName) cc.incrementFlag = function(state, flagName)
{ {
state.flags[flagName] = (state.flags[flagName] || 0) + 1; state.flags[flagName] = (state.flags[flagName] || 0) + 1;
} };
cc.decrementFlag = function(state, flagName) cc.decrementFlag = function(state, flagName)
{ {
state.flags[flagName]--; state.flags[flagName]--;
} };
cc.incrementAttrib = function(state, attribName) cc.incrementAttrib = function(state, attribName)
{ {
if (!state.attribs[attribName]) if (!state.attribs[attribName])
@ -227,12 +227,12 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
state.attribs[attribName]++; state.attribs[attribName]++;
} }
_recalcAttribString(state); _recalcAttribString(state);
} };
cc.decrementAttrib = function(state, attribName) cc.decrementAttrib = function(state, attribName)
{ {
state.attribs[attribName]--; state.attribs[attribName]--;
_recalcAttribString(state); _recalcAttribString(state);
} };
function _enterList(state, listType) function _enterList(state, listType)
{ {
@ -311,7 +311,7 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
['insertorder', 'first'] ['insertorder', 'first']
].concat( ].concat(
_.map(state.lineAttributes,function(value,key){ _.map(state.lineAttributes,function(value,key){
if (typeof(window)!= 'undefined' && window.console) console.log([key, value]) if (typeof(window)!= 'undefined' && window.console) console.log([key, value]);
return [key, value]; return [key, value];
}) })
); );
@ -329,7 +329,7 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
} }
} }
lines.startNew(); lines.startNew();
} };
cc.notifySelection = function(sel) cc.notifySelection = function(sel)
{ {
if (sel) if (sel)
@ -724,7 +724,7 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
lines: lineStrings, lines: lineStrings,
lineAttribs: lineAttribs lineAttribs: lineAttribs
}; };
} };
return cc; return cc;
} }

View file

@ -49,7 +49,7 @@ domline.addToLineClass = function(lineClass, cls)
} }
}); });
return lineClass; return lineClass;
} };
// if "document" is falsy we don't create a DOM node, just // if "document" is falsy we don't create a DOM node, just
// an object with innerHTML and className // an object with innerHTML and className

View file

@ -4,11 +4,11 @@
if(language) language = language[1]; if(language) language = language[1];
html10n.bind('indexed', function() { html10n.bind('indexed', function() {
html10n.localize([language, navigator.language, navigator.userLanguage, 'en']) html10n.localize([language, navigator.language, navigator.userLanguage, 'en']);
}) });
html10n.bind('localized', function() { html10n.bind('localized', function() {
document.documentElement.lang = html10n.getLanguage() document.documentElement.lang = html10n.getLanguage();
document.documentElement.dir = html10n.getDirection() document.documentElement.dir = html10n.getDirection();
}) });
})(document) })(document);

View file

@ -117,14 +117,14 @@ var getParameters = [
{ name: "userName", checkVal: null, callback: function(val) { settings.globalUserName = decodeURIComponent(val); } }, { name: "userName", checkVal: null, callback: function(val) { settings.globalUserName = decodeURIComponent(val); } },
// If the userColor is set as a parameter, set a global value to use once we have initiated the pad. // If the userColor is set as a parameter, set a global value to use once we have initiated the pad.
{ name: "userColor", checkVal: null, callback: function(val) { settings.globalUserColor = decodeURIComponent(val); } }, { name: "userColor", checkVal: null, callback: function(val) { settings.globalUserColor = decodeURIComponent(val); } },
{ name: "rtl", checkVal: "true", callback: function(val) { settings.rtlIsTrue = true } }, { name: "rtl", checkVal: "true", callback: function(val) { settings.rtlIsTrue = true; } },
{ name: "alwaysShowChat", checkVal: "true", callback: function(val) { chat.stickToScreen(); } }, { name: "alwaysShowChat", checkVal: "true", callback: function(val) { chat.stickToScreen(); } },
{ name: "lang", checkVal: null, callback: function(val) { window.html10n.localize([val, 'en']); } } { name: "lang", checkVal: null, callback: function(val) { window.html10n.localize([val, 'en']); } }
]; ];
function getParams() function getParams()
{ {
var params = getUrlVars() var params = getUrlVars();
for(var i = 0; i < getParameters.length; i++) for(var i = 0; i < getParameters.length; i++)
{ {
@ -212,7 +212,7 @@ function handshake()
} }
socket.json.send(msg); socket.json.send(msg);
}; }
var disconnectTimeout; var disconnectTimeout;
@ -293,7 +293,7 @@ function handshake()
pad._afterHandshake(); pad._afterHandshake();
initalized = true; initalized = true;
$("body").addClass(clientVars.readonly ? "readonly" : "readwrite") $("body").addClass(clientVars.readonly ? "readonly" : "readwrite");
padeditor.ace.callWithAce(function (ace) { padeditor.ace.callWithAce(function (ace) {
ace.ace_setEditable(!clientVars.readonly); ace.ace_setEditable(!clientVars.readonly);

View file

@ -190,7 +190,7 @@ var padeditbar = (function()
// hide all modules and remove highlighting of all buttons // hide all modules and remove highlighting of all buttons
if(moduleName == "none") if(moduleName == "none")
{ {
var returned = false var returned = false;
for(var i=0;i<modules.length;i++) for(var i=0;i<modules.length;i++)
{ {
//skip the userlist //skip the userlist

View file

@ -78,12 +78,12 @@ var padeditor = (function()
// Right to left // Right to left
padutils.bindCheckboxChange($("#options-rtlcheck"), function() padutils.bindCheckboxChange($("#options-rtlcheck"), function()
{ {
pad.changeViewOption('rtlIsTrue', padutils.getCheckbox($("#options-rtlcheck"))) pad.changeViewOption('rtlIsTrue', padutils.getCheckbox($("#options-rtlcheck")));
}); });
html10n.bind('localized', function() { html10n.bind('localized', function() {
pad.changeViewOption('rtlIsTrue', ('rtl' == html10n.getDirection())); pad.changeViewOption('rtlIsTrue', ('rtl' == html10n.getDirection()));
padutils.setCheckbox($("#options-rtlcheck"), ('rtl' == html10n.getDirection())); padutils.setCheckbox($("#options-rtlcheck"), ('rtl' == html10n.getDirection()));
}) });
// font face // font face
$("#viewfontmenu").change(function() $("#viewfontmenu").change(function()
@ -104,7 +104,7 @@ var padeditor = (function()
if(input.hasClass("editempty")) if(input.hasClass("editempty"))
input.val(html10n.get(input.attr("data-l10n-id"))); input.val(html10n.get(input.attr("data-l10n-id")));
}); });
}) });
$("#languagemenu").val(html10n.getLanguage()); $("#languagemenu").val(html10n.getLanguage());
$("#languagemenu").change(function() { $("#languagemenu").change(function() {
pad.createCookie("language",$("#languagemenu").val(),null,'/'); pad.createCookie("language",$("#languagemenu").val(),null,'/');

View file

@ -215,7 +215,7 @@ var padimpexp = (function()
$('#importsubmitinput').val(html10n.get("pad.impexp.importbutton")); $('#importsubmitinput').val(html10n.get("pad.impexp.importbutton"));
html10n.bind('localized', function() { html10n.bind('localized', function() {
$('#importsubmitinput').val(html10n.get("pad.impexp.importbutton")); $('#importsubmitinput').val(html10n.get("pad.impexp.importbutton"));
}) });
// build the export links // build the export links
$("#exporthtmla").attr("href", pad_root_path + "/export/html"); $("#exporthtmla").attr("href", pad_root_path + "/export/html");

View file

@ -19,8 +19,8 @@ var pad;
exports.saveNow = function(){ exports.saveNow = function(){
pad.collabClient.sendMessage({"type": "SAVE_REVISION"}); pad.collabClient.sendMessage({"type": "SAVE_REVISION"});
alert(_("pad.savedrevs.marked")); alert(_("pad.savedrevs.marked"));
} };
exports.init = function(_pad){ exports.init = function(_pad){
pad = _pad; pad = _pad;
} };

View file

@ -781,7 +781,7 @@ function showColorPicker()
if (!colorPickerSetup) if (!colorPickerSetup)
{ {
var colorsList = $("#colorpickerswatches") var colorsList = $("#colorpickerswatches");
for (var i = 0; i < palette.length; i++) for (var i = 0; i < palette.length; i++)
{ {

View file

@ -30,7 +30,7 @@ function randomString(len)
{ {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
var randomstring = ''; var randomstring = '';
len = len || 20 len = len || 20;
for (var i = 0; i < len; i++) for (var i = 0; i < len; i++)
{ {
var rnum = Math.floor(Math.random() * chars.length); var rnum = Math.floor(Math.random() * chars.length);

View file

@ -87,14 +87,14 @@ function init() {
} }
else if(message.accessStatus) else if(message.accessStatus)
{ {
$("body").html("<h2>You have no permission to access this pad</h2>") $("body").html("<h2>You have no permission to access this pad</h2>");
} else { } else {
changesetLoader.handleMessageFromServer(message); changesetLoader.handleMessageFromServer(message);
} }
}); });
//get all the export links //get all the export links
export_links = $('#export > .exportlink') export_links = $('#export > .exportlink');
if(document.referrer.length > 0 && document.referrer.substring(document.referrer.lastIndexOf("/")-1,document.referrer.lastIndexOf("/")) === "p") { if(document.referrer.length > 0 && document.referrer.substring(document.referrer.lastIndexOf("/")-1,document.referrer.lastIndexOf("/")) === "p") {
$("#returnbutton").attr("href", document.referrer); $("#returnbutton").attr("href", document.referrer);

View file

@ -186,7 +186,7 @@ function makeVirtualLineView(lineNode)
var curNode = null; var curNode = null;
var curChar = 0; var curChar = 0;
var curCharWithinNode = 0 var curCharWithinNode = 0;
var curTop; var curTop;
var curLeft; var curLeft;
var approxLineHeight; var approxLineHeight;
@ -358,11 +358,11 @@ function makeVirtualLineView(lineNode)
seeker.forwardByWhile = function(amount, optCondFunc, optCharLimit) seeker.forwardByWhile = function(amount, optCondFunc, optCharLimit)
{ {
moveByWhile(false, amount, optCondFunc, optCharLimit); moveByWhile(false, amount, optCondFunc, optCharLimit);
} };
seeker.backwardByWhile = function(amount, optCondFunc, optCharLimit) seeker.backwardByWhile = function(amount, optCondFunc, optCharLimit)
{ {
moveByWhile(true, amount, optCondFunc, optCharLimit); moveByWhile(true, amount, optCondFunc, optCharLimit);
} };
seeker.binarySearch = function(condFunc) seeker.binarySearch = function(condFunc)
{ {
// returns index of boundary between false chars and true chars; // returns index of boundary between false chars and true chars;
@ -378,7 +378,7 @@ function makeVirtualLineView(lineNode)
seeker.backwardByWhile(5, trueFunc); seeker.backwardByWhile(5, trueFunc);
seeker.forwardByWhile(1, falseFunc); seeker.forwardByWhile(1, falseFunc);
return seeker.getOffset() + (condFunc() ? 0 : 1); return seeker.getOffset() + (condFunc() ? 0 : 1);
} };
return seeker; return seeker;
} }