Commit be2e830c authored by jonnybradley's avatar jonnybradley

[FIX] JSLint: Part 4 of JSLint* corrections: various js - mostly missing line...

[FIX] JSLint: Part 4 of JSLint* corrections: various js - mostly missing line terminations and var declarations (*actually phpStorm code inspections)
parent 4e30823f
......@@ -202,7 +202,7 @@ function initPreviewWindow (editorId, autoSaveId, allowHtml) {
var features = 'menubar=no,toolbar=no,fullscreen=no,titlebar=no,status=no,width=600';
var url = $.service("edit", "preview", {editor_id: editorId, autoSaveId: autoSaveId, allowHtml: allowHtml });
window.open(url, "_blank", features);
};
}
$(window).unload(function () {
if (ajaxPreviewWindow && typeof ajaxPreviewWindow.get_new_preview === 'function') {
......
......@@ -18,7 +18,7 @@ CKEDITOR.plugins.add( 'autosave',
init: function( editor ) {
asplugin = this; // for closure references later
var asplugin = this, command; // for closure references later
this.editor = editor;
editor.ui.addButton( 'autosave', {
......
......@@ -8,7 +8,7 @@ CKEDITOR.plugins.add('inlinecancel',
{
init: function (editor) {
var asplugin = this; // for closure references later
var asplugin = this, command; // for closure references later
this.editor = editor;
editor.ui.addButton('inlinecancel', {
......
......@@ -17,7 +17,7 @@ CKEDITOR.addTemplates('default',
// Template definitions.
templates: getContentTemplates()
})
});
function getContentTemplates() {
......@@ -43,7 +43,7 @@ function getContentTemplates() {
result.push(
[{
title: content[i]['title'],
html: content[i]['html'],
html: content[i]['html']
}]);
}
return result;
......
......@@ -306,7 +306,7 @@ jQuery.fn.extend({
var editor = syntaxHighlighter.ready(textarea, settings, mode),
editorWindow = jQuery(editor.getWrapperElement()).find('.CodeMirror-scroll').addBack(),
scroller = jQuery(editor.getScrollerElement());
scroller.scrollTop(scrollTop * (scroller.innerHeight() / textareaHeight))
scroller.scrollTop(scrollTop * (scroller.innerHeight() / textareaHeight));
o.removeClass('CodeMirrorHide');
......@@ -702,11 +702,11 @@ var syntaxHighlighter = {
return;
},
selection: function(textareaEditor, getStartEnd) {
selection = textareaEditor.getSelection();
var selection = textareaEditor.getSelection();
if (getStartEnd) {
var startCursor = textareaEditor.getCursor(true),
endCursor = textareaEditor.getCursor(false);
endCursor = textareaEditor.getCursor(false), val;
val = (textareaEditor.getValue() + '').split('\n');
var result = {
......
......@@ -39,7 +39,7 @@ CodeMirror.defineMode('tiki', function(config, parserConfig) {
case "{": //plugin
type = stream.eat("/") ? "closeTag" : "openTag";
stream.eatSpace();
tagName = "";
var tagName = "";
var c;
while ((c = stream.eat(/[^\s\u00a0=\"\'\/?(}]/))) tagName += c;
state.tokenize = inPlugin;
......
......@@ -8,7 +8,7 @@ $(document).ready(function() {
// when previewing a comment set the page anchor to the comment preview
$('#comments_previewComment').click(function() {
action = $('#editpostform').attr('action');
var action = $('#editpostform').attr('action');
$('#editpostform').attr('action', action.replace('#comments', '#form'));
});
......
......@@ -398,7 +398,7 @@ $.fn.reportBuilderImport = function(data, o) {
if (!o) o = "";
me.find(':checkbox').removeAttr('checked');
var i = 0;
var i = 0, type;
//TODO: needs further application, but the idea is to apply the name of the array to the object on the page ;)
var importData = function(dataItem, trail, I) {
for(type in dataItem) {
......@@ -454,7 +454,7 @@ $.fn.reportBuilderImport = function(data, o) {
};
$.cleanArray = function(arr) {
$.each(arr, function() {})
$.each(arr, function() {});
for (var i = 0; i < arr.length; i++) {
if (!arr[i]) {
arr.splice(i, 1);
......
......@@ -31,18 +31,18 @@ function Diaporama(imgName, arrPixId, options)
this.sliding = 0;
this.backward = 0;
this.toTheEnd = 0;
for (opt in options) {
for (var opt in options) {
this[opt] = options[opt];
}
for (this.curPix = 0;
this.curPix < this.length && arrPixId[this.curPix] !== this.startId;
this.curPix++) {} ;
this.curPix++) {}
this.curPix = this.curPix % this.length;
this.hopePix = 0;
this.thePix = null;
this.timerPix = null;
this.arrPix = new Array();
this.arrPix = [];
}
Diaporama.prototype.setClassStyle = function (className, prop, val) {
var elts = this.root.all ? this.root.all : this.root.getElementsByTagName('*');
......
......@@ -32,7 +32,7 @@ var canTranslateIt = function( e ) {
} else {
return true;
}
}
};
var interTransDeepestElement = -1;
......
......@@ -11,6 +11,7 @@ function foo() {
}
function msg(msg) {
var req;
try {
// for Mozilla
req = new XMLHttpRequest();
......@@ -27,6 +28,7 @@ function msg(msg) {
}
function msgxml(msg) {
var req;
try {
// for Mozilla
req = new XMLHttpRequest();
......@@ -62,6 +64,7 @@ function pollForEvents() {
+ document.getElementById('reqId').value + '&senderId=' + document.getElementById('senderId').value);
/* alert(ret);
alert(last_event); */
var last_event;
if (ret > last_event) {
while (last_event < ret) {
last_event = last_event + 1;
......@@ -114,7 +117,7 @@ function client_close() {
/*** Operator console functions ***/
function pollForRequests() {
var last = msg('tiki-live_support_server.php?poll_requests=1');
var last = msg('tiki-live_support_server.php?poll_requests=1'), last_req;
if (last > last_req) {
window.location.reload();
......
......@@ -96,7 +96,7 @@ rangy.createModule("Phraser", function(api, module) {
return (rootNode = $(rootNode));
}
var dom = api.dom;
var dom = api.dom, Phraser;
api = $.extend(api, {
words: {},
chs: {},
......@@ -119,6 +119,7 @@ rangy.createModule("Phraser", function(api, module) {
boundaries = parentConcat.split(phraseConcat),
indexes = [];
var boundaryLength;
for (var i = 0; i < boundaries.length; i++) {
boundaryLength = boundaries[i].split('|').length - 1;
......@@ -242,7 +243,7 @@ rangy.createModule("Phraser", function(api, module) {
sanitized = sanitized.replace(/\W/g, ' ');
sanitized = sanitized.split(' ');
var sanitizedFiltered = [];
var sanitizedFiltered = [], i;
for(i in sanitized) {
if (sanitized[i])
sanitizedFiltered.push(sanitized[i]);
......
......@@ -111,7 +111,7 @@ var ttlResizeTimerID = null;
$(window).resize( function () {
if (ttlTimeline && ttlResizeTimerID == null) {
ttlResizeTimerID = window.setTimeout(function() {
resizeTimerID = null;
ttlResizeTimerID = null;
ttlTimeline.layout();
}, 500);
}
......
......@@ -197,7 +197,7 @@ $.fn.loadDraw = function(o) {
}, function(data) {
if (data.removeButtons) {
if (!$.isArray(data.removeButtons)) data.removeButtons = data.removeButtons.split(',');
for(id in data.removeButtons) {
for(var id in data.removeButtons) {
me.data('doc').find('#' + $.trim(data.removeButtons[id])).wrap('<div style="display:none;"/>');
}
}
......
......@@ -76,7 +76,7 @@ $(document).ready(function () {
sortList(this);
}
});
sortList = function (list) {
var sortList = function (list) {
var arr = $(list).children().get(), item, labelA, labelB;
arr.sort(function(a, b) {
labelA = $(a).text().toUpperCase();
......@@ -96,7 +96,7 @@ $(document).ready(function () {
$('.qt-custom').dblclick(function () { showToolEditForm(this); });
// show edit form dialogue
showToolEditForm = function(item) {
var showToolEditForm = function (item) {
if (item) {
$('#toolbar_edit_div #tool_name').val($(item).text()); //.attr('disabled','disabled');
......@@ -161,7 +161,7 @@ $(document).ready(function () {
}
});
checkLength = function (o, n, min, max) {
var checkLength = function (o, n, min, max) {
if (o.val().length > max || o.val().length < min) {
o.addClass('ui-state-error');
o.prev("label").find(".dialog_tips").text(" Length must be between " + min + " and " + max).addClass('ui-state-highlight');
......@@ -175,7 +175,7 @@ $(document).ready(function () {
};
// save toolbars
saveRows = function () {
var saveRows = function () {
var ser, text;
ser = $('.toolbars-admin .row').map(function (){ /* do this on everything of class 'row' inside toolbars-admin div */
var right_section = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment