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);
return cs;
}
};
/**

View file

@ -38,7 +38,7 @@ function scriptTag(source) {
'<script type="text/javascript">\n'
+ source.replace(/<\//g, '<\\/') +
'</script>'
)
);
}
function Ace2Editor()
@ -63,7 +63,7 @@ function Ace2Editor()
var action = function()
{
func.apply(that, args);
}
};
if (optDoNow)
{
optDoNow.apply(that, args);
@ -82,7 +82,7 @@ function Ace2Editor()
function doActionsPendingInit()
{
_.each(actionsPendingInit, function(fn,i){
fn()
fn();
});
actionsPendingInit = [];
}
@ -223,12 +223,12 @@ function Ace2Editor()
// source here.
// these lines must conform to a specific format because they are passed by the build script:
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/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);
pushStyleTagsFor(iframeHTML, includedCSS);

View file

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

View file

@ -273,7 +273,7 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro
padContents.currentRevision = revision;
padContents.currentTime += timeDelta * 1000;
debugLog('Time Delta: ', timeDelta)
debugLog('Time Delta: ', timeDelta);
updateTimer();
var authors = _.map(padContents.getActiveAuthors(), function(name)
@ -292,7 +292,7 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro
while (str.length < length)
str = '0' + str;
return str;
}
};
var date = new Date(padContents.currentTime);
var dateFormat = function()
@ -311,10 +311,7 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro
"minutes": minutes,
"seconds": seconds
}));
}
};
$('#timer').html(dateFormat());
@ -336,7 +333,7 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro
][date.getMonth()],
"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);
}
}
};
BroadcastSlider.onSlider(goToRevisionIfEnabled);
@ -586,7 +583,7 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro
if (bgcolor && dynamicCSS)
{
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
}
authorData[author] = data;

View file

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

View file

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

View file

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

View file

@ -29,7 +29,7 @@ var colorutils = {};
colorutils.isCssHex = function(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]
colorutils.css2triple = function(cssColor)
@ -41,7 +41,7 @@ colorutils.css2triple = function(cssColor)
return Number("0x" + hh) / 255;
}
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"
colorutils.css2sixhex = function(cssColor)
@ -55,7 +55,7 @@ colorutils.css2sixhex = function(cssColor)
h = a + a + b + b + c + c;
}
return h;
}
};
// [1.0, 1.0, 1.0] -> "#ffffff"
colorutils.triple2css = function(triple)
@ -66,8 +66,7 @@ colorutils.triple2css = function(triple)
return ("0" + n2.toString(16)).slice(-2);
}
return "#" + floatToHex(triple[0]) + floatToHex(triple[1]) + floatToHex(triple[2]);
}
};
colorutils.clamp = function(v, bot, top)
{
@ -101,18 +100,18 @@ colorutils.unscale = function(v, 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)];
}
};
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)];
}
};
colorutils.luminosity = function(c)
{
// rule of thumb for RGB brightness; 1.0 is white
return c[0] * 0.30 + c[1] * 0.59 + c[2] * 0.11;
}
};
colorutils.saturate = function(c)
{
@ -120,17 +119,17 @@ colorutils.saturate = function(c)
var max = colorutils.colorMax(c);
if (max - min <= 0) return [1.0, 1.0, 1.0];
return colorutils.unscaleColor(c, min, max);
}
};
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])];
}
};
colorutils.invert = function(c)
{
return [1 - c[0], 1 - c[1], 1- c[2]];
}
};
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[2] >= c[2]) ? Math.min(inv[2] * 1.11, 1) : (c[2] * 0.11)
];
}
};
exports.colorutils = colorutils;

View file

@ -211,11 +211,11 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
cc.incrementFlag = function(state, flagName)
{
state.flags[flagName] = (state.flags[flagName] || 0) + 1;
}
};
cc.decrementFlag = function(state, flagName)
{
state.flags[flagName]--;
}
};
cc.incrementAttrib = function(state, attribName)
{
if (!state.attribs[attribName])
@ -227,12 +227,12 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
state.attribs[attribName]++;
}
_recalcAttribString(state);
}
};
cc.decrementAttrib = function(state, attribName)
{
state.attribs[attribName]--;
_recalcAttribString(state);
}
};
function _enterList(state, listType)
{
@ -311,7 +311,7 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
['insertorder', 'first']
].concat(
_.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];
})
);
@ -329,7 +329,7 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
}
}
lines.startNew();
}
};
cc.notifySelection = function(sel)
{
if (sel)
@ -724,7 +724,7 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
lines: lineStrings,
lineAttribs: lineAttribs
};
}
};
return cc;
}

View file

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

View file

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

View file

@ -117,14 +117,14 @@ var getParameters = [
{ 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.
{ 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: "lang", checkVal: null, callback: function(val) { window.html10n.localize([val, 'en']); } }
];
function getParams()
{
var params = getUrlVars()
var params = getUrlVars();
for(var i = 0; i < getParameters.length; i++)
{
@ -212,7 +212,7 @@ function handshake()
}
socket.json.send(msg);
};
}
var disconnectTimeout;
@ -293,7 +293,7 @@ function handshake()
pad._afterHandshake();
initalized = true;
$("body").addClass(clientVars.readonly ? "readonly" : "readwrite")
$("body").addClass(clientVars.readonly ? "readonly" : "readwrite");
padeditor.ace.callWithAce(function (ace) {
ace.ace_setEditable(!clientVars.readonly);

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -87,14 +87,14 @@ function init() {
}
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 {
changesetLoader.handleMessageFromServer(message);
}
});
//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") {
$("#returnbutton").attr("href", document.referrer);

View file

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