/gi);
if (isNameEditable(data) && tr.find("td.usertdname input:enabled").length > 0)
{
@@ -104,8 +97,7 @@ var paduserlist = (function()
return tr;
}
- function getUserRowHtml(height, data)
- {
+ function getUserRowHtml(height, data) {
var nameHtml;
if (data.name)
{
@@ -119,18 +111,15 @@ var paduserlist = (function()
return [' | ', '', nameHtml, ' | ', '', padutils.escapeHtml(data.activity), ' | '].join('');
}
- function getRowHtml(id, innerHtml, authorId)
- {
+ function getRowHtml(id, innerHtml, authorId) {
return '' + innerHtml + '
';
}
- function rowNode(row)
- {
+ function rowNode(row) {
return $("#" + row.domId);
}
- function handleRowData(row)
- {
+ function handleRowData(row) {
if (row.data && row.data.status == 'Disconnected')
{
row.opacity = 0.5;
@@ -141,13 +130,11 @@ var paduserlist = (function()
}
}
- function handleRowNode(tr, data)
- {
+ function handleRowNode(tr, data) {
if (data.titleText)
{
var titleText = data.titleText;
- window.setTimeout(function()
- {
+ window.setTimeout(function() {
/* tr.attr('title', titleText)*/
}, 0);
}
@@ -157,11 +144,9 @@ var paduserlist = (function()
}
}
- function handleOtherUserInputs()
- {
+ function handleOtherUserInputs() {
// handle 'INPUT' elements for naming other unnamed users
- $("#otheruserstable input.newinput").each(function()
- {
+ $("#otheruserstable input.newinput").each(function() {
var input = $(this);
var tr = input.closest("tr");
if (tr.length > 0)
@@ -179,8 +164,7 @@ var paduserlist = (function()
// animationPower is 0 to skip animation, 1 for linear, 2 for quadratic, etc.
- function insertRow(position, data, animationPower)
- {
+ function insertRow(position, data, animationPower) {
position = Math.max(0, Math.min(rowsPresent.length, position));
animationPower = (animationPower === undefined ? 4 : animationPower);
@@ -227,8 +211,7 @@ var paduserlist = (function()
return row;
}
- function updateRow(position, data)
- {
+ function updateRow(position, data) {
var row = rowsPresent[position];
if (row)
{
@@ -245,8 +228,7 @@ var paduserlist = (function()
}
}
- function removeRow(position, animationPower)
- {
+ function removeRow(position, animationPower) {
animationPower = (animationPower === undefined ? 4 : animationPower);
var row = rowsPresent[position];
if (row)
@@ -272,8 +254,7 @@ var paduserlist = (function()
// newPosition is position after the row has been removed
- function moveRow(oldPosition, newPosition, animationPower)
- {
+ function moveRow(oldPosition, newPosition, animationPower) {
animationPower = (animationPower === undefined ? 1 : animationPower); // linear is best
var row = rowsPresent[oldPosition];
if (row && oldPosition != newPosition)
@@ -284,8 +265,7 @@ var paduserlist = (function()
}
}
- function animateStep()
- {
+ function animateStep() {
// animation must be symmetrical
for (var i = rowsFadingIn.length - 1; i >= 0; i--)
{ // backwards to allow removal
@@ -357,10 +337,8 @@ var paduserlist = (function()
var otherUsersInfo = [];
var otherUsersData = [];
- function rowManagerMakeNameEditor(jnode, userId)
- {
- setUpEditable(jnode, function()
- {
+ function rowManagerMakeNameEditor(jnode, userId) {
+ setUpEditable(jnode, function() {
var existingIndex = findExistingIndex(userId);
if (existingIndex >= 0)
{
@@ -370,8 +348,7 @@ var paduserlist = (function()
{
return '';
}
- }, function(newName)
- {
+ }, function(newName) {
if (!newName)
{
jnode.addClass("editempty");
@@ -385,8 +362,7 @@ var paduserlist = (function()
});
}
- function findExistingIndex(userId)
- {
+ function findExistingIndex(userId) {
var existingIndex = -1;
for (var i = 0; i < otherUsersInfo.length; i++)
{
@@ -399,10 +375,8 @@ var paduserlist = (function()
return existingIndex;
}
- function setUpEditable(jqueryNode, valueGetter, valueSetter)
- {
- jqueryNode.bind('focus', function(evt)
- {
+ function setUpEditable(jqueryNode, valueGetter, valueSetter) {
+ jqueryNode.bind('focus', function(evt) {
var oldValue = valueGetter();
if (jqueryNode.val() !== oldValue)
{
@@ -410,16 +384,13 @@ var paduserlist = (function()
}
jqueryNode.addClass("editactive").removeClass("editempty");
});
- jqueryNode.bind('blur', function(evt)
- {
+ jqueryNode.bind('blur', function(evt) {
var newValue = jqueryNode.removeClass("editactive").val();
valueSetter(newValue);
});
- padutils.bindEnterAndEscape(jqueryNode, function onEnter()
- {
+ padutils.bindEnterAndEscape(jqueryNode, function onEnter() {
jqueryNode.blur();
- }, function onEscape()
- {
+ }, function onEscape() {
jqueryNode.val(valueGetter()).blur();
});
jqueryNode.removeAttr('disabled').addClass('editable');
@@ -429,8 +400,7 @@ var paduserlist = (function()
var guestPromptFlashState = 0;
var guestPromptFlash = padutils.makeAnimationScheduler(
- function()
- {
+ function() {
var prompts = $("#guestprompts .guestprompt");
if (prompts.length == 0)
{
@@ -452,8 +422,7 @@ var paduserlist = (function()
var pad = undefined;
var self = {
- init: function(myInitialUserInfo, _pad)
- {
+ init: function(myInitialUserInfo, _pad) {
pad = _pad;
self.setMyUserInfo(myInitialUserInfo);
@@ -465,17 +434,14 @@ var paduserlist = (function()
if (pad.getUserIsGuest())
{
$("#myusernameedit").addClass('myusernameedithoverable');
- setUpEditable($("#myusernameedit"), function()
- {
+ setUpEditable($("#myusernameedit"), function() {
return myUserInfo.name || '';
- }, function(newValue)
- {
+ }, function(newValue) {
myUserInfo.name = newValue;
pad.notifyChangeName(newValue);
// wrap with setTimeout to do later because we get
// a double "blur" fire in IE...
- window.setTimeout(function()
- {
+ window.setTimeout(function() {
self.renderMyUserInfo();
}, 0);
});
@@ -483,23 +449,19 @@ var paduserlist = (function()
// color picker
$("#myswatchbox").click(showColorPicker);
- $("#mycolorpicker .pickerswatchouter").click(function()
- {
+ $("#mycolorpicker .pickerswatchouter").click(function() {
$("#mycolorpicker .pickerswatchouter").removeClass('picked');
$(this).addClass('picked');
});
- $("#mycolorpickersave").click(function()
- {
+ $("#mycolorpickersave").click(function() {
closeColorPicker(true);
});
- $("#mycolorpickercancel").click(function()
- {
+ $("#mycolorpickercancel").click(function() {
closeColorPicker(false);
});
//
},
- usersOnline: function()
- {
+ usersOnline: function() {
// Returns an object of users who are currently online on this pad
var userList = [].concat(otherUsersInfo); // Make a copy of the otherUsersInfo, otherwise every call to users modifies the referenced array
// Now we need to add ourselves..
@@ -527,8 +489,7 @@ var paduserlist = (function()
}
return userList;
},
- setMyUserInfo: function(info)
- {
+ setMyUserInfo: function(info) {
//translate the colorId
if(typeof info.colorId == "number")
{
@@ -540,8 +501,7 @@ var paduserlist = (function()
self.renderMyUserInfo();
},
- userJoinOrUpdate: function(info)
- {
+ userJoinOrUpdate: function(info) {
if ((!info.userId) || (info.userId == myUserInfo.userId))
{
// not sure how this would happen
@@ -568,8 +528,7 @@ var paduserlist = (function()
{
numUsersBesides--;
}
- var newIndex = padutils.binarySearch(numUsersBesides, function(n)
- {
+ var newIndex = padutils.binarySearch(numUsersBesides, function(n) {
if (existingIndex >= 0 && n >= existingIndex)
{
// pretend existingIndex isn't there
@@ -611,8 +570,7 @@ var paduserlist = (function()
self.updateNumberOfOnlineUsers();
},
- updateNumberOfOnlineUsers: function()
- {
+ updateNumberOfOnlineUsers: function() {
var online = 1; // you are always online!
for (var i = 0; i < otherUsersData.length; i++)
{
@@ -626,8 +584,7 @@ var paduserlist = (function()
return online;
},
- userLeave: function(info)
- {
+ userLeave: function(info) {
var existingIndex = findExistingIndex(info.userId);
if (existingIndex >= 0)
{
@@ -642,8 +599,7 @@ var paduserlist = (function()
// joins, or updates happen for this user in the
// next N seconds, to remove the user from the list.
var thisUserId = info.userId;
- var thisLeaveTimer = window.setTimeout(function()
- {
+ var thisLeaveTimer = window.setTimeout(function() {
var newExistingIndex = findExistingIndex(thisUserId);
if (newExistingIndex >= 0)
{
@@ -664,8 +620,7 @@ var paduserlist = (function()
self.updateNumberOfOnlineUsers();
},
- showGuestPrompt: function(userId, displayName)
- {
+ showGuestPrompt: function(userId, displayName) {
if (knocksToIgnore[userId])
{
return;
@@ -688,30 +643,25 @@ var paduserlist = (function()
// update display name
box.find(".guestname").html(''+_('pad.userlist.guest')+': ' + padutils.escapeHtml(displayName));
}
- var hideLater = padutils.getCancellableAction(actionName, function()
- {
+ var hideLater = padutils.getCancellableAction(actionName, function() {
self.removeGuestPrompt(userId);
});
window.setTimeout(hideLater, 15000); // time-out with no knock
guestPromptFlash.scheduleAnimation();
},
- removeGuestPrompt: function(userId)
- {
+ removeGuestPrompt: function(userId) {
var box = $("#guestprompt-" + padutils.encodeUserId(userId));
// remove ID now so a new knock by same user gets new, unfaded box
- box.removeAttr('id').fadeOut("fast", function()
- {
+ box.removeAttr('id').fadeOut("fast", function() {
box.remove();
});
knocksToIgnore[userId] = true;
- window.setTimeout(function()
- {
+ window.setTimeout(function() {
delete knocksToIgnore[userId];
}, 5000);
},
- answerGuestPrompt: function(encodedUserId, approve)
- {
+ answerGuestPrompt: function(encodedUserId, approve) {
var guestId = padutils.decodeUserId(encodedUserId);
var msg = {
@@ -724,8 +674,7 @@ var paduserlist = (function()
self.removeGuestPrompt(guestId);
},
- renderMyUserInfo: function()
- {
+ renderMyUserInfo: function() {
if (myUserInfo.name)
{
$("#myusernameedit").removeClass("editempty").val(myUserInfo.name);
@@ -757,14 +706,12 @@ var paduserlist = (function()
return self;
}());
-function getColorPickerSwatchIndex(jnode)
-{
+function getColorPickerSwatchIndex(jnode) {
// return Number(jnode.get(0).className.match(/\bn([0-9]+)\b/)[1])-1;
return $("#colorpickerswatches li").index(jnode);
}
-function closeColorPicker(accept)
-{
+function closeColorPicker(accept) {
if (accept)
{
var newColor = $("#mycolorpickerpreview").css("background-color");
@@ -792,8 +739,7 @@ function closeColorPicker(accept)
$("#mycolorpicker").removeClass('popup-show');
}
-function showColorPicker()
-{
+function showColorPicker() {
previousColorId = myUserInfo.colorId;
$.farbtastic('#colorpicker').setColor(myUserInfo.colorId)
@@ -813,8 +759,7 @@ function showColorPicker()
li.appendTo(colorsList);
- li.bind('click', function(event)
- {
+ li.bind('click', function(event) {
$("#colorpickerswatches li").removeClass('picked');
$(event.target).addClass("picked");
diff --git a/src/static/js/pad_utils.js b/src/static/js/pad_utils.js
index 33dcc2b4d..305d73be6 100644
--- a/src/static/js/pad_utils.js
+++ b/src/static/js/pad_utils.js
@@ -26,8 +26,7 @@ var Security = require('./security');
* Generates a random String with the given length. Is needed to generate the Author, Group, readonly, session Ids
*/
-function randomString(len)
-{
+function randomString(len) {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
var randomstring = '';
len = len || 20
@@ -40,27 +39,22 @@ function randomString(len)
}
var padutils = {
- escapeHtml: function(x)
- {
+ escapeHtml: function(x) {
return Security.escapeHTML(String(x));
},
- uniqueId: function()
- {
+ uniqueId: function() {
var pad = require('./pad').pad; // Sidestep circular dependency
- function encodeNum(n, width)
- {
+ function encodeNum(n, width) {
// returns string that is exactly 'width' chars, padding with zeros
// and taking rightmost digits
return (Array(width + 1).join('0') + Number(n).toString(35)).slice(-width);
}
return [pad.getClientIp(), encodeNum(+new Date, 7), encodeNum(Math.floor(Math.random() * 1e9), 4)].join('.');
},
- uaDisplay: function(ua)
- {
+ uaDisplay: function(ua) {
var m;
- function clean(a)
- {
+ function clean(a) {
var maxlen = 16;
a = a.replace(/[^a-zA-Z0-9\.]/g, '');
if (a.length > maxlen)
@@ -70,8 +64,7 @@ var padutils = {
return a;
}
- function checkver(name)
- {
+ function checkver(name) {
var m = ua.match(RegExp(name + '\\/([\\d\\.]+)'));
if (m && m.length > 1)
{
@@ -123,8 +116,7 @@ var padutils = {
return clean(x);
},
// e.g. "Thu Jun 18 2009 13:09"
- simpleDateTime: function(date)
- {
+ simpleDateTime: function(date) {
var d = new Date(+date); // accept either number or date
var dayOfWeek = (['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'])[d.getDay()];
var month = (['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'])[d.getMonth()];
@@ -133,8 +125,7 @@ var padutils = {
var hourmin = d.getHours() + ":" + ("0" + d.getMinutes()).slice(-2);
return dayOfWeek + ' ' + month + ' ' + dayOfMonth + ' ' + year + ' ' + hourmin;
},
- findURLs: function(text)
- {
+ findURLs: function(text) {
// copied from ACE
var _REGEX_WORDCHAR = /[\u0030-\u0039\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u1FFF\u3040-\u9FFF\uF900-\uFDFF\uFE70-\uFEFE\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFDC]/;
var _REGEX_URLCHAR = new RegExp('(' + /[-:@a-zA-Z0-9_.,~%+\/?=()$]/.source + '|' + _REGEX_WORDCHAR.source + ')');
@@ -143,8 +134,7 @@ var padutils = {
// returns null if no URLs, or [[startIndex1, url1], [startIndex2, url2], ...]
- function _findURLs(text)
- {
+ function _findURLs(text) {
_REGEX_URL.lastIndex = 0;
var urls = null;
var execResult;
@@ -161,14 +151,12 @@ var padutils = {
return _findURLs(text);
},
- escapeHtmlWithClickableLinks: function(text, target)
- {
+ escapeHtmlWithClickableLinks: function(text, target) {
var idx = 0;
var pieces = [];
var urls = padutils.findURLs(text);
- function advanceTo(i)
- {
+ function advanceTo(i) {
if (i > idx)
{
pieces.push(Security.escapeHTML(text.substring(idx, i)));
@@ -197,8 +185,7 @@ var padutils = {
advanceTo(text.length);
return pieces.join('');
},
- bindEnterAndEscape: function(node, onEnter, onEscape)
- {
+ bindEnterAndEscape: function(node, onEnter, onEscape) {
// Use keypress instead of keyup in bindEnterAndEscape
// Keyup event is fired on enter in IME (Input Method Editor), But
@@ -206,8 +193,7 @@ var padutils = {
// It is work on Windows (IE8, Chrome 6.0.472), CentOs (Firefox 3.0) and Mac OSX (Firefox 3.6.10, Chrome 6.0.472, Safari 5.0).
if (onEnter)
{
- node.keypress(function(evt)
- {
+ node.keypress(function(evt) {
if (evt.which == 13)
{
onEnter(evt);
@@ -217,8 +203,7 @@ var padutils = {
if (onEscape)
{
- node.keydown(function(evt)
- {
+ node.keydown(function(evt) {
if (evt.which == 27)
{
onEscape(evt);
@@ -226,11 +211,9 @@ var padutils = {
});
}
},
- timediff: function(d)
- {
+ timediff: function(d) {
var pad = require('./pad').pad; // Sidestep circular dependency
- function format(n, word)
- {
+ function format(n, word) {
n = Math.round(n);
return ('' + n + ' ' + word + (n != 1 ? 's' : '') + ' ago');
}
@@ -252,8 +235,7 @@ var padutils = {
d /= 24;
return format(d, 'day');
},
- makeAnimationScheduler: function(funcToAnimateOneStep, stepTime, stepsAtOnce)
- {
+ makeAnimationScheduler: function(funcToAnimateOneStep, stepTime, stepsAtOnce) {
if (stepsAtOnce === undefined)
{
stepsAtOnce = 1;
@@ -261,12 +243,10 @@ var padutils = {
var animationTimer = null;
- function scheduleAnimation()
- {
+ function scheduleAnimation() {
if (!animationTimer)
{
- animationTimer = window.setTimeout(function()
- {
+ animationTimer = window.setTimeout(function() {
animationTimer = null;
var n = stepsAtOnce;
var moreToDo = true;
@@ -287,23 +267,20 @@ var padutils = {
scheduleAnimation: scheduleAnimation
};
},
- makeShowHideAnimator: function(funcToArriveAtState, initiallyShown, fps, totalMs)
- {
+ makeShowHideAnimator: function(funcToArriveAtState, initiallyShown, fps, totalMs) {
var animationState = (initiallyShown ? 0 : -2); // -2 hidden, -1 to 0 fade in, 0 to 1 fade out
var animationFrameDelay = 1000 / fps;
var animationStep = animationFrameDelay / totalMs;
var scheduleAnimation = padutils.makeAnimationScheduler(animateOneStep, animationFrameDelay).scheduleAnimation;
- function doShow()
- {
+ function doShow() {
animationState = -1;
funcToArriveAtState(animationState);
scheduleAnimation();
}
- function doQuickShow()
- { // start showing without losing any fade-in progress
+ function doQuickShow() { // start showing without losing any fade-in progress
if (animationState < -1)
{
animationState = -1;
@@ -316,8 +293,7 @@ var padutils = {
scheduleAnimation();
}
- function doHide()
- {
+ function doHide() {
if (animationState >= -1 && animationState <= 0)
{
animationState = 1e-6;
@@ -325,8 +301,7 @@ var padutils = {
}
}
- function animateOneStep()
- {
+ function animateOneStep() {
if (animationState < -1 || animationState == 0)
{
return false;
@@ -374,8 +349,7 @@ var padutils = {
},
_nextActionId: 1,
uncanceledActions: {},
- getCancellableAction: function(actionType, actionFunc)
- {
+ getCancellableAction: function(actionType, actionFunc) {
var o = padutils.uncanceledActions[actionType];
if (!o)
{
@@ -384,8 +358,7 @@ var padutils = {
}
var actionId = (padutils._nextActionId++);
o[actionId] = true;
- return function()
- {
+ return function() {
var p = padutils.uncanceledActions[actionType];
if (p && p[actionId])
{
@@ -393,8 +366,7 @@ var padutils = {
}
};
},
- cancelActions: function(actionType)
- {
+ cancelActions: function(actionType) {
var o = padutils.uncanceledActions[actionType];
if (o)
{
@@ -402,25 +374,21 @@ var padutils = {
delete padutils.uncanceledActions[actionType];
}
},
- makeFieldLabeledWhenEmpty: function(field, labelText)
- {
+ makeFieldLabeledWhenEmpty: function(field, labelText) {
field = $(field);
- function clear()
- {
+ function clear() {
field.addClass('editempty');
field.val(labelText);
}
- field.focus(function()
- {
+ field.focus(function() {
if (field.hasClass('editempty'))
{
field.val('');
}
field.removeClass('editempty');
});
- field.blur(function()
- {
+ field.blur(function() {
if (!field.val())
{
clear();
@@ -430,12 +398,10 @@ var padutils = {
clear: clear
};
},
- getCheckbox: function(node)
- {
+ getCheckbox: function(node) {
return $(node).is(':checked');
},
- setCheckbox: function(node, value)
- {
+ setCheckbox: function(node, value) {
if (value)
{
$(node).attr('checked', 'checked');
@@ -445,22 +411,17 @@ var padutils = {
$(node).removeAttr('checked');
}
},
- bindCheckboxChange: function(node, func)
- {
+ bindCheckboxChange: function(node, func) {
$(node).change(func);
},
- encodeUserId: function(userId)
- {
- return userId.replace(/[^a-y0-9]/g, function(c)
- {
+ encodeUserId: function(userId) {
+ return userId.replace(/[^a-y0-9]/g, function(c) {
if (c == ".") return "-";
return 'z' + c.charCodeAt(0) + 'z';
});
},
- decodeUserId: function(encodedUserId)
- {
- return encodedUserId.replace(/[a-y0-9]+|-|z.+?z/g, function(cc)
- {
+ decodeUserId: function(encodedUserId) {
+ return encodedUserId.replace(/[a-y0-9]+|-|z.+?z/g, function(cc) {
if (cc == '-') return '.';
else if (cc.charAt(0) == 'z')
{
diff --git a/src/static/js/scroll.js b/src/static/js/scroll.js
index 46a46c9a6..75c488d5f 100644
--- a/src/static/js/scroll.js
+++ b/src/static/js/scroll.js
@@ -17,8 +17,7 @@ function Scroll(outerWin) {
this.rootDocument = parent.parent.document;
}
-Scroll.prototype.scrollWhenCaretIsInTheLastLineOfViewportWhenNecessary = function (rep, isScrollableEvent, innerHeight)
-{
+Scroll.prototype.scrollWhenCaretIsInTheLastLineOfViewportWhenNecessary = function (rep, isScrollableEvent, innerHeight) {
// are we placing the caret on the line at the bottom of viewport?
// And if so, do we need to scroll the editor, as defined on the settings.json?
var shouldScrollWhenCaretIsAtBottomOfViewport = this.scrollSettings.scrollWhenCaretIsInTheLastLineOfViewport;
@@ -36,8 +35,7 @@ Scroll.prototype.scrollWhenCaretIsInTheLastLineOfViewportWhenNecessary = functio
}
}
-Scroll.prototype.scrollWhenPressArrowKeys = function(arrowUp, rep, innerHeight)
-{
+Scroll.prototype.scrollWhenPressArrowKeys = function(arrowUp, rep, innerHeight) {
// if percentageScrollArrowUp is 0, let the scroll to be handled as default, put the previous
// rep line on the top of the viewport
if(this._arrowUpWasPressedInTheFirstLineOfTheViewport(arrowUp, rep)){
@@ -54,8 +52,7 @@ Scroll.prototype.scrollWhenPressArrowKeys = function(arrowUp, rep, innerHeight)
// Some plugins might set a minimum height to the editor (ex: ep_page_view), so checking
// if (caretLine() === rep.lines.length() - 1) is not enough. We need to check if there are
// other lines after caretLine(), and all of them are out of viewport.
-Scroll.prototype._isCaretAtTheBottomOfViewport = function(rep)
-{
+Scroll.prototype._isCaretAtTheBottomOfViewport = function(rep) {
// computing a line position using getBoundingClientRect() is expensive.
// (obs: getBoundingClientRect() is called on caretPosition.getPosition())
// To avoid that, we only call this function when it is possible that the
@@ -76,8 +73,7 @@ Scroll.prototype._isCaretAtTheBottomOfViewport = function(rep)
return false;
}
-Scroll.prototype._isLinePartiallyVisibleOnViewport = function(lineNumber, rep)
-{
+Scroll.prototype._isLinePartiallyVisibleOnViewport = function(lineNumber, rep) {
var lineNode = rep.lines.atIndex(lineNumber);
var linePosition = this._getLineEntryTopBottom(lineNode);
var lineTop = linePosition.top;
@@ -98,8 +94,7 @@ Scroll.prototype._isLinePartiallyVisibleOnViewport = function(lineNumber, rep)
(bottomOfLineIsAboveViewportBottom && bottomOfLineIsBelowViewportTop);
}
-Scroll.prototype._getViewPortTopBottom = function()
-{
+Scroll.prototype._getViewPortTopBottom = function() {
var theTop = this.getScrollY();
var doc = this.doc;
var height = doc.documentElement.clientHeight; // includes padding
@@ -113,23 +108,20 @@ Scroll.prototype._getViewPortTopBottom = function()
};
}
-Scroll.prototype._getEditorPositionTop = function()
-{
+Scroll.prototype._getEditorPositionTop = function() {
var editor = parent.document.getElementsByTagName('iframe');
var editorPositionTop = editor[0].offsetTop;
return editorPositionTop;
}
// ep_page_view adds padding-top, which makes the viewport smaller
-Scroll.prototype._getPaddingTopAddedWhenPageViewIsEnable = function()
-{
+Scroll.prototype._getPaddingTopAddedWhenPageViewIsEnable = function() {
var aceOuter = this.rootDocument.getElementsByName("ace_outer");
var aceOuterPaddingTop = parseInt($(aceOuter).css("padding-top"));
return aceOuterPaddingTop;
}
-Scroll.prototype._getScrollXY = function()
-{
+Scroll.prototype._getScrollXY = function() {
var win = this.outerWin;
var odoc = this.doc;
if (typeof(win.pageYOffset) == "number")
@@ -149,33 +141,27 @@ Scroll.prototype._getScrollXY = function()
}
}
-Scroll.prototype.getScrollX = function()
-{
+Scroll.prototype.getScrollX = function() {
return this._getScrollXY().x;
}
-Scroll.prototype.getScrollY = function()
-{
+Scroll.prototype.getScrollY = function() {
return this._getScrollXY().y;
}
-Scroll.prototype.setScrollX = function(x)
-{
+Scroll.prototype.setScrollX = function(x) {
this.outerWin.scrollTo(x, this.getScrollY());
}
-Scroll.prototype.setScrollY = function(y)
-{
+Scroll.prototype.setScrollY = function(y) {
this.outerWin.scrollTo(this.getScrollX(), y);
}
-Scroll.prototype.setScrollXY = function(x, y)
-{
+Scroll.prototype.setScrollXY = function(x, y) {
this.outerWin.scrollTo(x, y);
}
-Scroll.prototype._isCaretAtTheTopOfViewport = function(rep)
-{
+Scroll.prototype._isCaretAtTheTopOfViewport = function(rep) {
var caretLine = rep.selStart[0];
var linePrevCaretLine = caretLine - 1;
var firstLineVisibleBeforeCaretLine = caretPosition.getPreviousVisibleLine(linePrevCaretLine, rep);
@@ -201,8 +187,7 @@ Scroll.prototype._isCaretAtTheTopOfViewport = function(rep)
// By default, when user makes an edition in a line out of viewport, this line goes
// to the edge of viewport. This function gets the extra pixels necessary to get the
// caret line in a position X relative to Y% viewport.
-Scroll.prototype._getPixelsRelativeToPercentageOfViewport = function(innerHeight, aboveOfViewport)
-{
+Scroll.prototype._getPixelsRelativeToPercentageOfViewport = function(innerHeight, aboveOfViewport) {
var pixels = 0;
var scrollPercentageRelativeToViewport = this._getPercentageToScroll(aboveOfViewport);
if(scrollPercentageRelativeToViewport > 0 && scrollPercentageRelativeToViewport <= 1){
@@ -213,8 +198,7 @@ Scroll.prototype._getPixelsRelativeToPercentageOfViewport = function(innerHeight
// we use different percentages when change selection. It depends on if it is
// either above the top or below the bottom of the page
-Scroll.prototype._getPercentageToScroll = function(aboveOfViewport)
-{
+Scroll.prototype._getPercentageToScroll = function(aboveOfViewport) {
var percentageToScroll = this.scrollSettings.percentage.editionBelowViewport;
if(aboveOfViewport){
percentageToScroll = this.scrollSettings.percentage.editionAboveViewport;
@@ -222,8 +206,7 @@ Scroll.prototype._getPercentageToScroll = function(aboveOfViewport)
return percentageToScroll;
}
-Scroll.prototype._getPixelsToScrollWhenUserPressesArrowUp = function(innerHeight)
-{
+Scroll.prototype._getPixelsToScrollWhenUserPressesArrowUp = function(innerHeight) {
var pixels = 0;
var percentageToScrollUp = this.scrollSettings.percentageToScrollWhenUserPressesArrowUp;
if(percentageToScrollUp > 0 && percentageToScrollUp <= 1){
@@ -232,8 +215,7 @@ Scroll.prototype._getPixelsToScrollWhenUserPressesArrowUp = function(innerHeight
return pixels;
}
-Scroll.prototype._scrollYPage = function(pixelsToScroll)
-{
+Scroll.prototype._scrollYPage = function(pixelsToScroll) {
var durationOfAnimationToShowFocusline = this.scrollSettings.duration;
if(durationOfAnimationToShowFocusline){
this._scrollYPageWithAnimation(pixelsToScroll, durationOfAnimationToShowFocusline);
@@ -242,13 +224,11 @@ Scroll.prototype._scrollYPage = function(pixelsToScroll)
}
}
-Scroll.prototype._scrollYPageWithoutAnimation = function(pixelsToScroll)
-{
+Scroll.prototype._scrollYPageWithoutAnimation = function(pixelsToScroll) {
this.outerWin.scrollBy(0, pixelsToScroll);
}
-Scroll.prototype._scrollYPageWithAnimation = function(pixelsToScroll, durationOfAnimationToShowFocusline)
-{
+Scroll.prototype._scrollYPageWithAnimation = function(pixelsToScroll, durationOfAnimationToShowFocusline) {
var outerDocBody = this.doc.getElementById("outerdocbody");
// it works on later versions of Chrome
@@ -262,8 +242,7 @@ Scroll.prototype._scrollYPageWithAnimation = function(pixelsToScroll, durationOf
// using a custom queue and clearing it, we avoid creating a queue of scroll animations. So if this function
// is called twice quickly, only the last one runs.
-Scroll.prototype._triggerScrollWithAnimation = function($elem, pixelsToScroll, durationOfAnimationToShowFocusline)
-{
+Scroll.prototype._triggerScrollWithAnimation = function($elem, pixelsToScroll, durationOfAnimationToShowFocusline) {
// clear the queue of animation
$elem.stop("scrollanimation");
$elem.animate({
@@ -278,8 +257,7 @@ Scroll.prototype._triggerScrollWithAnimation = function($elem, pixelsToScroll, d
// needed to be completely in view. If the value is greater than 0 and less than or equal to 1,
// besides of scrolling the minimum needed to be visible, it scrolls additionally
// (viewport height * scrollAmountWhenFocusLineIsOutOfViewport) pixels
-Scroll.prototype.scrollNodeVerticallyIntoView = function(rep, innerHeight)
-{
+Scroll.prototype.scrollNodeVerticallyIntoView = function(rep, innerHeight) {
var viewport = this._getViewPortTopBottom();
var isPartOfRepLineOutOfViewport = this._partOfRepLineIsOutOfViewport(viewport, rep);
@@ -304,8 +282,7 @@ Scroll.prototype.scrollNodeVerticallyIntoView = function(rep, innerHeight)
}
}
-Scroll.prototype._partOfRepLineIsOutOfViewport = function(viewportPosition, rep)
-{
+Scroll.prototype._partOfRepLineIsOutOfViewport = function(viewportPosition, rep) {
var focusLine = (rep.selFocusAtStart ? rep.selStart[0] : rep.selEnd[0]);
var line = rep.lines.atIndex(focusLine);
var linePosition = this._getLineEntryTopBottom(line);
@@ -315,8 +292,7 @@ Scroll.prototype._partOfRepLineIsOutOfViewport = function(viewportPosition, rep)
return lineIsBelowOfViewport || lineIsAboveOfViewport;
}
-Scroll.prototype._getLineEntryTopBottom = function(entry, destObj)
-{
+Scroll.prototype._getLineEntryTopBottom = function(entry, destObj) {
var dom = entry.lineNode;
var top = dom.offsetTop;
var height = dom.offsetHeight;
@@ -326,24 +302,20 @@ Scroll.prototype._getLineEntryTopBottom = function(entry, destObj)
return obj;
}
-Scroll.prototype._arrowUpWasPressedInTheFirstLineOfTheViewport = function(arrowUp, rep)
-{
+Scroll.prototype._arrowUpWasPressedInTheFirstLineOfTheViewport = function(arrowUp, rep) {
var percentageScrollArrowUp = this.scrollSettings.percentageToScrollWhenUserPressesArrowUp;
return percentageScrollArrowUp && arrowUp && this._isCaretAtTheTopOfViewport(rep);
}
-Scroll.prototype.getVisibleLineRange = function(rep)
-{
+Scroll.prototype.getVisibleLineRange = function(rep) {
var viewport = this._getViewPortTopBottom();
//console.log("viewport top/bottom: %o", viewport);
var obj = {};
var self = this;
- var start = rep.lines.search(function(e)
- {
+ var start = rep.lines.search(function(e) {
return self._getLineEntryTopBottom(e, obj).bottom > viewport.top;
});
- var end = rep.lines.search(function(e)
- {
+ var end = rep.lines.search(function(e) {
// return the first line that the top position is greater or equal than
// the viewport. That is the first line that is below the viewport bottom.
// So the line that is in the bottom of the viewport is the very previous one.
@@ -354,13 +326,11 @@ Scroll.prototype.getVisibleLineRange = function(rep)
return [start, end - 1];
}
-Scroll.prototype.getVisibleCharRange = function(rep)
-{
+Scroll.prototype.getVisibleCharRange = function(rep) {
var lineRange = this.getVisibleLineRange(rep);
return [rep.lines.offsetOfIndex(lineRange[0]), rep.lines.offsetOfIndex(lineRange[1])];
}
-exports.init = function(outerWin)
-{
+exports.init = function(outerWin) {
return new Scroll(outerWin);
}
diff --git a/src/static/js/skiplist.js b/src/static/js/skiplist.js
index 04155e320..52c2cb88e 100644
--- a/src/static/js/skiplist.js
+++ b/src/static/js/skiplist.js
@@ -25,13 +25,11 @@ var Ace2Common = require('./ace2_common'),
var noop = Ace2Common.noop;
-function SkipList()
-{
+function SkipList() {
var PROFILER = window.PROFILER;
if (!PROFILER)
{
- PROFILER = function()
- {
+ PROFILER = function() {
return {
start: noop,
mark: noop,
@@ -71,8 +69,7 @@ function SkipList()
// this point.
- function _getPoint(targetLoc)
- {
+ function _getPoint(targetLoc) {
var numLevels = start.levels;
var lvl = numLevels - 1;
var i = -1,
@@ -106,15 +103,13 @@ function SkipList()
idxs: idxs,
loc: targetLoc,
widthSkips: widthSkips,
- toString: function()
- {
+ toString: function() {
return "getPoint(" + targetLoc + ")";
}
};
}
- function _getNodeAtOffset(targetOffset)
- {
+ function _getNodeAtOffset(targetOffset) {
var i = 0;
var n = start;
var lvl = start.levels - 1;
@@ -132,13 +127,11 @@ function SkipList()
return n;
}
- function _entryWidth(e)
- {
+ function _entryWidth(e) {
return (e && e.width) || 0;
}
- function _insertKeyAtPoint(point, newKey, entry)
- {
+ function _insertKeyAtPoint(point, newKey, entry) {
var p = PROFILER("insertKey", false);
var newNode = {
key: newKey,
@@ -207,13 +200,11 @@ function SkipList()
p.end();
}
- function _getNodeAtPoint(point)
- {
+ function _getNodeAtPoint(point) {
return point.nodes[0].downPtrs[0];
}
- function _incrementPoint(point)
- {
+ function _incrementPoint(point) {
point.loc++;
for (var i = 0; i < point.nodes.length; i++)
{
@@ -226,8 +217,7 @@ function SkipList()
}
}
- function _deleteKeyAtPoint(point)
- {
+ function _deleteKeyAtPoint(point) {
var elem = point.nodes[0].downPtrs[0];
var elemWidth = _entryWidth(elem.entry);
for (var i = 0; i < point.nodes.length; i++)
@@ -256,8 +246,7 @@ function SkipList()
totalWidth -= elemWidth;
}
- function _propagateWidthChange(node)
- {
+ function _propagateWidthChange(node) {
var oldWidth = node.downSkipWidths[0];
var newWidth = _entryWidth(node.entry);
var widthChange = newWidth - oldWidth;
@@ -275,8 +264,7 @@ function SkipList()
totalWidth += widthChange;
}
- function _getNodeIndex(node, byWidth)
- {
+ function _getNodeIndex(node, byWidth) {
var dist = (byWidth ? 0 : -1);
var n = node;
while (n !== start)
@@ -289,8 +277,7 @@ function SkipList()
return dist;
}
- function _getNodeByKey(key)
- {
+ function _getNodeByKey(key) {
return keyToNodeMap['$KEY$' + key];
}
@@ -299,14 +286,12 @@ function SkipList()
// all truthy entries.
- function _search(entryFunc)
- {
+ function _search(entryFunc) {
var low = start;
var lvl = start.levels - 1;
var lowIndex = -1;
- function f(node)
- {
+ function f(node) {
if (node === start) return false;
else if (node === end) return true;
else return entryFunc(node.entry);
@@ -331,19 +316,16 @@ that is a string.
*/
var self = this;
_.extend(this, {
- length: function()
- {
+ length: function() {
return numNodes;
},
- atIndex: function(i)
- {
+ atIndex: function(i) {
if (i < 0) console.warn("atIndex(" + i + ")");
if (i >= numNodes) console.warn("atIndex(" + i + ">=" + numNodes + ")");
return _getNodeAtPoint(_getPoint(i)).entry;
},
// differs from Array.splice() in that new elements are in an array, not varargs
- splice: function(start, deleteCount, newEntryArray)
- {
+ splice: function(start, deleteCount, newEntryArray) {
if (start < 0) console.warn("splice(" + start + ", ...)");
if (start + deleteCount > numNodes)
{
@@ -366,20 +348,16 @@ that is a string.
node.entry = entry;
}
},
- next: function(entry)
- {
+ next: function(entry) {
return _getNodeByKey(entry.key).downPtrs[0].entry || null;
},
- prev: function(entry)
- {
+ prev: function(entry) {
return _getNodeByKey(entry.key).upPtrs[0].entry || null;
},
- push: function(entry)
- {
+ push: function(entry) {
self.splice(numNodes, 0, [entry]);
},
- slice: function(start, end)
- {
+ slice: function(start, end) {
// act like Array.slice()
if (start === undefined) start = 0;
else if (start < 0) start += numNodes;
@@ -402,68 +380,54 @@ that is a string.
}
return array;
},
- atKey: function(key)
- {
+ atKey: function(key) {
return _getNodeByKey(key).entry;
},
- indexOfKey: function(key)
- {
+ indexOfKey: function(key) {
return _getNodeIndex(_getNodeByKey(key));
},
- indexOfEntry: function(entry)
- {
+ indexOfEntry: function(entry) {
return self.indexOfKey(entry.key);
},
- containsKey: function(key)
- {
+ containsKey: function(key) {
return !!(_getNodeByKey(key));
},
// gets the last entry starting at or before the offset
- atOffset: function(offset)
- {
+ atOffset: function(offset) {
return _getNodeAtOffset(offset).entry;
},
- keyAtOffset: function(offset)
- {
+ keyAtOffset: function(offset) {
return self.atOffset(offset).key;
},
- offsetOfKey: function(key)
- {
+ offsetOfKey: function(key) {
return _getNodeIndex(_getNodeByKey(key), true);
},
- offsetOfEntry: function(entry)
- {
+ offsetOfEntry: function(entry) {
return self.offsetOfKey(entry.key);
},
- setEntryWidth: function(entry, width)
- {
+ setEntryWidth: function(entry, width) {
entry.width = width;
_propagateWidthChange(_getNodeByKey(entry.key));
},
- totalWidth: function()
- {
+ totalWidth: function() {
return totalWidth;
},
- offsetOfIndex: function(i)
- {
+ offsetOfIndex: function(i) {
if (i < 0) return 0;
if (i >= numNodes) return totalWidth;
return self.offsetOfEntry(self.atIndex(i));
},
- indexOfOffset: function(offset)
- {
+ indexOfOffset: function(offset) {
if (offset <= 0) return 0;
if (offset >= totalWidth) return numNodes;
return self.indexOfEntry(self.atOffset(offset));
},
- search: function(entryFunc)
- {
+ search: function(entryFunc) {
return _search(entryFunc);
},
//debugToString: _debugToString,
debugGetPoint: _getPoint,
- debugDepth: function()
- {
+ debugDepth: function() {
return start.levels;
}
});
diff --git a/src/static/js/timeslider.js b/src/static/js/timeslider.js
index 86f5f6137..2bddf2abf 100644
--- a/src/static/js/timeslider.js
+++ b/src/static/js/timeslider.js
@@ -31,8 +31,7 @@ var hooks = require('./pluginfw/hooks');
var token, padId, export_links;
function init() {
- $(document).ready(function ()
- {
+ $(document).ready(function () {
// start the custom js
if (typeof customStart == "function") customStart();
@@ -63,19 +62,16 @@ function init() {
socket = io.connect(url, {path: exports.baseURL + 'socket.io', resource: resource});
//send the ready message once we're connected
- socket.on('connect', function()
- {
+ socket.on('connect', function() {
sendSocketMsg("CLIENT_READY", {});
});
- socket.on('disconnect', function()
- {
+ socket.on('disconnect', function() {
BroadcastSlider.showReconnectUI();
});
//route the incoming messages
- socket.on('message', function(message)
- {
+ socket.on('message', function(message) {
if(message.type == "CLIENT_VARS")
{
handleClientVars(message);
@@ -91,8 +87,7 @@ function init() {
//get all the export links
export_links = $('#export > .exportlink')
- $('button#forcereconnect').click(function()
- {
+ $('button#forcereconnect').click(function() {
window.location.reload();
});
@@ -104,8 +99,7 @@ function init() {
}
//sends a message over the socket
-function sendSocketMsg(type, data)
-{
+function sendSocketMsg(type, data) {
socket.json.send({
component: 'pad', // FIXME: Remove this stupidity!
type,
@@ -120,8 +114,7 @@ function sendSocketMsg(type, data)
var fireWhenAllScriptsAreLoaded = [];
var changesetLoader;
-function handleClientVars(message)
-{
+function handleClientVars(message) {
//save the client Vars
clientVars = message.data;
@@ -137,11 +130,9 @@ function handleClientVars(message)
var baseURI = document.location.pathname;
//change export urls when the slider moves
- BroadcastSlider.onSlider(function(revno)
- {
+ BroadcastSlider.onSlider(function(revno) {
// export_links is a jQuery Array, so .each is allowed.
- export_links.each(function()
- {
+ export_links.each(function() {
// Modified from regular expression to fix:
// https://github.com/ether/etherpad-lite/issues/4071
// Where a padId that was numeric would create the wrong export link
diff --git a/src/static/js/undomodule.js b/src/static/js/undomodule.js
index 7bb47a625..042c18736 100644
--- a/src/static/js/undomodule.js
+++ b/src/static/js/undomodule.js
@@ -23,10 +23,8 @@
var Changeset = require('./Changeset');
var _ = require('./underscore');
-var undoModule = (function()
-{
- var stack = (function()
- {
+var undoModule = (function() {
+ var stack = (function() {
var stackElements = [];
// two types of stackElements:
// 1) { elementType: UNDOABLE_EVENT, eventType: "anything", [backset: ,]
@@ -38,8 +36,7 @@ var undoModule = (function()
var UNDOABLE_EVENT = "undoableEvent";
var EXTERNAL_CHANGE = "externalChange";
- function clearStack()
- {
+ function clearStack() {
stackElements.length = 0;
stackElements.push(
{
@@ -50,8 +47,7 @@ var undoModule = (function()
}
clearStack();
- function pushEvent(event)
- {
+ function pushEvent(event) {
var e = _.extend(
{}, event);
e.elementType = UNDOABLE_EVENT;
@@ -60,8 +56,7 @@ var undoModule = (function()
//dmesg("pushEvent backset: "+event.backset);
}
- function pushExternalChange(cs)
- {
+ function pushExternalChange(cs) {
var idx = stackElements.length - 1;
if (stackElements[idx].elementType == EXTERNAL_CHANGE)
{
@@ -77,8 +72,7 @@ var undoModule = (function()
}
}
- function _exposeEvent(nthFromTop)
- {
+ function _exposeEvent(nthFromTop) {
// precond: 0 <= nthFromTop < numUndoableEvents
var targetIndex = stackElements.length - 1 - nthFromTop;
var idx = stackElements.length - 1;
@@ -121,20 +115,17 @@ var undoModule = (function()
}
}
- function getNthFromTop(n)
- {
+ function getNthFromTop(n) {
// precond: 0 <= n < numEvents()
_exposeEvent(n);
return stackElements[stackElements.length - 1 - n];
}
- function numEvents()
- {
+ function numEvents() {
return numUndoableEvents;
}
- function popEvent()
- {
+ function popEvent() {
// precond: numEvents() > 0
_exposeEvent(0);
numUndoableEvents--;
@@ -154,14 +145,12 @@ var undoModule = (function()
// invariant: stack always has at least one undoable event
var undoPtr = 0; // zero-index from top of stack, 0 == top
- function clearHistory()
- {
+ function clearHistory() {
stack.clearStack();
undoPtr = 0;
}
- function _charOccurrences(str, c)
- {
+ function _charOccurrences(str, c) {
var i = 0;
var count = 0;
while (i >= 0 && i < str.length)
@@ -176,13 +165,11 @@ var undoModule = (function()
return count;
}
- function _opcodeOccurrences(cs, opcode)
- {
+ function _opcodeOccurrences(cs, opcode) {
return _charOccurrences(Changeset.unpack(cs).ops, opcode);
}
- function _mergeChangesets(cs1, cs2)
- {
+ function _mergeChangesets(cs1, cs2) {
if (!cs1) return cs2;
if (!cs2) return cs1;
@@ -219,12 +206,10 @@ var undoModule = (function()
return null;
}
- function reportEvent(event)
- {
+ function reportEvent(event) {
var topEvent = stack.getNthFromTop(0);
- function applySelectionToTop()
- {
+ function applySelectionToTop() {
if ((typeof event.selStart) == "number")
{
topEvent.selStart = event.selStart;
@@ -268,16 +253,14 @@ var undoModule = (function()
}
- function reportExternalChange(changeset)
- {
+ function reportExternalChange(changeset) {
if (changeset && !Changeset.isIdentity(changeset))
{
stack.pushExternalChange(changeset);
}
}
- function _getSelectionInfo(event)
- {
+ function _getSelectionInfo(event) {
if ((typeof event.selStart) != "number")
{
return null;
@@ -298,8 +281,7 @@ var undoModule = (function()
// or can be called with no arguments to mean that no undo is possible.
// "eventFunc" will be called exactly once.
- function performUndo(eventFunc)
- {
+ function performUndo(eventFunc) {
if (undoPtr < stack.numEvents() - 1)
{
var backsetEvent = stack.getNthFromTop(undoPtr);
@@ -311,8 +293,7 @@ var undoModule = (function()
else eventFunc();
}
- function performRedo(eventFunc)
- {
+ function performRedo(eventFunc) {
if (undoPtr >= 2)
{
var backsetEvent = stack.getNthFromTop(0);
@@ -324,8 +305,7 @@ var undoModule = (function()
else eventFunc();
}
- function getAPool()
- {
+ function getAPool() {
return undoModule.apool;
}
diff --git a/src/static/skins/colibris/index.js b/src/static/skins/colibris/index.js
index 152c3d5d7..224d3d7ab 100644
--- a/src/static/skins/colibris/index.js
+++ b/src/static/skins/colibris/index.js
@@ -1,5 +1,4 @@
-function customStart()
-{
+function customStart() {
//define your javascript here
//jquery is available - except index.js
//you can load extra scripts with $.getScript http://api.jquery.com/jQuery.getScript/
diff --git a/src/static/skins/colibris/pad.js b/src/static/skins/colibris/pad.js
index 1a7bd938a..96fc107c7 100644
--- a/src/static/skins/colibris/pad.js
+++ b/src/static/skins/colibris/pad.js
@@ -1,5 +1,4 @@
-function customStart()
-{
+function customStart() {
$('#pad_title').show();
$('.buttonicon').mousedown(function() { $(this).parent().addClass('pressed'); })
$('.buttonicon').mouseup(function() { $(this).parent().removeClass('pressed'); })
diff --git a/src/static/skins/colibris/timeslider.js b/src/static/skins/colibris/timeslider.js
index 1322ec4c8..741011279 100644
--- a/src/static/skins/colibris/timeslider.js
+++ b/src/static/skins/colibris/timeslider.js
@@ -1,3 +1,2 @@
-function customStart()
-{
+function customStart() {
}
diff --git a/tests/backend/fuzzImportTest.js b/tests/backend/fuzzImportTest.js
index f8eac55eb..0f03b9e00 100644
--- a/tests/backend/fuzzImportTest.js
+++ b/tests/backend/fuzzImportTest.js
@@ -58,8 +58,7 @@ function runTest(number){
});
}
-function makeid()
-{
+function makeid() {
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
diff --git a/tests/backend/specs/api/characterEncoding.js b/tests/backend/specs/api/characterEncoding.js
index 494a1bbd6..2bc6c8089 100644
--- a/tests/backend/specs/api/characterEncoding.js
+++ b/tests/backend/specs/api/characterEncoding.js
@@ -98,8 +98,7 @@ var endPoint = function(point, version){
return '/api/'+version+'/'+point+'?apikey='+apiKey;
}
-function makeid()
-{
+function makeid() {
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
diff --git a/tests/backend/specs/api/chat.js b/tests/backend/specs/api/chat.js
index a7c6c0762..02a41a32e 100644
--- a/tests/backend/specs/api/chat.js
+++ b/tests/backend/specs/api/chat.js
@@ -101,8 +101,7 @@ var endPoint = function(point){
return '/api/'+apiVersion+'/'+point+'?apikey='+apiKey;
}
-function makeid()
-{
+function makeid() {
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
diff --git a/tests/backend/specs/api/fuzzImportTest.js b/tests/backend/specs/api/fuzzImportTest.js
index 461d25423..4c612101d 100644
--- a/tests/backend/specs/api/fuzzImportTest.js
+++ b/tests/backend/specs/api/fuzzImportTest.js
@@ -58,8 +58,7 @@ console.log("here");
});
}
-function makeid()
-{
+function makeid() {
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
diff --git a/tests/backend/specs/api/importexport.js b/tests/backend/specs/api/importexport.js
index 3744dd67d..7dd0754ec 100644
--- a/tests/backend/specs/api/importexport.js
+++ b/tests/backend/specs/api/importexport.js
@@ -140,8 +140,7 @@ var endPoint = function(point, version){
return '/api/'+version+'/'+point+'?apikey='+apiKey;
}
-function makeid()
-{
+function makeid() {
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
diff --git a/tests/backend/specs/api/importexportGetPost.js b/tests/backend/specs/api/importexportGetPost.js
index ec751b332..d318163cf 100644
--- a/tests/backend/specs/api/importexportGetPost.js
+++ b/tests/backend/specs/api/importexportGetPost.js
@@ -361,8 +361,7 @@ var endPoint = function(point, version){
return `/api/${version}/${point}?apikey=${apiKey}`;
};
-function makeid()
-{
+function makeid() {
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
diff --git a/tests/backend/specs/api/pad.js b/tests/backend/specs/api/pad.js
index 3f5cbf2e8..cb242dc17 100644
--- a/tests/backend/specs/api/pad.js
+++ b/tests/backend/specs/api/pad.js
@@ -804,8 +804,7 @@ var endPoint = function(point, version){
return '/api/'+version+'/'+point+'?apikey='+apiKey;
}
-function makeid()
-{
+function makeid() {
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
diff --git a/tests/backend/specs/api/sessionsAndGroups.js b/tests/backend/specs/api/sessionsAndGroups.js
index d210aa0d4..28d7eff7d 100644
--- a/tests/backend/specs/api/sessionsAndGroups.js
+++ b/tests/backend/specs/api/sessionsAndGroups.js
@@ -289,8 +289,7 @@ const endPoint = function(point) {
return `/api/${apiVersion}/${point}?apikey=${apiKey}`;
};
-function makeid()
-{
+function makeid() {
let text = '';
const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
diff --git a/tests/frontend/helper.js b/tests/frontend/helper.js
index d867cc1d6..3445ca0e5 100644
--- a/tests/frontend/helper.js
+++ b/tests/frontend/helper.js
@@ -16,8 +16,7 @@ var helper = {};
});
}
- helper.randomString = function randomString(len)
- {
+ helper.randomString = function randomString(len) {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
var randomstring = '';
for (var i = 0; i < len; i++)
diff --git a/tests/frontend/specs/embed_value.js b/tests/frontend/specs/embed_value.js
index e4cbcaaeb..a0e056412 100644
--- a/tests/frontend/specs/embed_value.js
+++ b/tests/frontend/specs/embed_value.js
@@ -1,6 +1,5 @@
describe("embed links", function(){
- var objectify = function (str)
- {
+ var objectify = function (str) {
var hash = {};
var parts = str.split('&');
for(var i = 0; i < parts.length; i++)