aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/adm/style/ajax.js4
-rw-r--r--phpBB/adm/style/editor.js2
-rw-r--r--phpBB/adm/style/timezone.js2
-rw-r--r--phpBB/assets/javascript/core.js32
-rw-r--r--phpBB/styles/prosilver/template/ajax.js9
-rw-r--r--phpBB/styles/prosilver/template/editor.js2
-rw-r--r--phpBB/styles/prosilver/template/timezone.js2
-rw-r--r--phpBB/styles/subsilver2/template/editor.js5
-rw-r--r--phpBB/styles/subsilver2/template/timezone.js2
9 files changed, 32 insertions, 28 deletions
diff --git a/phpBB/adm/style/ajax.js b/phpBB/adm/style/ajax.js
index 294a35b615..8f7c210e00 100644
--- a/phpBB/adm/style/ajax.js
+++ b/phpBB/adm/style/ajax.js
@@ -115,9 +115,9 @@ phpbb.addAjaxCallback('activate_deactivate', function(res) {
el.text(res.text);
if (newHref.indexOf('deactivate') !== -1) {
- newHref = newHref.replace('deactivate', 'activate')
+ newHref = newHref.replace('deactivate', 'activate');
} else {
- newHref = newHref.replace('activate', 'deactivate')
+ newHref = newHref.replace('activate', 'deactivate');
}
el.attr('href', newHref);
diff --git a/phpBB/adm/style/editor.js b/phpBB/adm/style/editor.js
index c9e8afe08e..2b814a10c6 100644
--- a/phpBB/adm/style/editor.js
+++ b/phpBB/adm/style/editor.js
@@ -10,7 +10,7 @@ var theSelection = false;
// Check for Browser & Platform for PC & IE specific bits
// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
-var clientVer = parseInt(navigator.appVersion); // Get browser version
+var clientVer = parseInt(navigator.appVersion, 10); // Get browser version
var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == -1));
var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1));
diff --git a/phpBB/adm/style/timezone.js b/phpBB/adm/style/timezone.js
index 419d37c34f..b5e27c907c 100644
--- a/phpBB/adm/style/timezone.js
+++ b/phpBB/adm/style/timezone.js
@@ -1,5 +1,7 @@
(function($) { // Avoid conflicts with other libraries
+"use strict";
+
$('#tz_date').change(function() {
phpbb.timezoneSwitchDate(false);
});
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js
index 16ed04746d..f38b35d613 100644
--- a/phpBB/assets/javascript/core.js
+++ b/phpBB/assets/javascript/core.js
@@ -57,7 +57,7 @@ phpbb.clearLoadingTimeout = function() {
* @param string title Title of the message, eg "Information" (HTML).
* @param string msg Message to display (HTML).
* @param bool fadedark Remove the dark background when done? Defaults
- * to yes.
+ * to yes.
*
* @returns object Returns the div created.
*/
@@ -121,9 +121,9 @@ phpbb.alert = function(title, msg, fadedark) {
*
* @param string msg Message to display (HTML).
* @param function callback Callback. Bool param, whether the user pressed
- * yes or no (or whatever their language is).
+ * yes or no (or whatever their language is).
* @param bool fadedark Remove the dark background when done? Defaults
- * to yes.
+ * to yes.
*
* @returns object Returns the div created.
*/
@@ -232,10 +232,10 @@ phpbb.parseQuerystring = function(string) {
*
* @param object options Options.
* @param bool/function refresh If we are sent back a refresh, should it be
- * acted upon? This can either be true / false / a function.
+ * acted upon? This can either be true / false / a function.
* @param function callback Callback to call on completion of event. Has
- * three parameters: the element that the event was evoked from, the JSON
- * that was returned and (if it is a form) the form action.
+ * three parameters: the element that the event was evoked from, the JSON
+ * that was returned and (if it is a form) the form action.
*/
phpbb.ajaxify = function(options) {
var elements = $(options.selector),
@@ -252,6 +252,11 @@ phpbb.ajaxify = function(options) {
return;
}
+ function errorHandler() {
+ phpbb.clearLoadingTimeout();
+ phpbb.alert(dark.attr('data-ajax-error-title'), dark.attr('data-ajax-error-text'));
+ }
+
/**
* This is a private function used to handle the callbacks, refreshes
* and alert. It calls the callback, refreshes the page if necessary, and
@@ -320,13 +325,6 @@ phpbb.ajaxify = function(options) {
}
}
- function errorHandler() {
- var alert;
-
- phpbb.clearLoadingTimeout();
- alert = phpbb.alert(dark.attr('data-ajax-error-title'), dark.attr('data-ajax-error-text'));
- }
-
// If the element is a form, POST must be used and some extra data must
// be taken from the form.
var runFilter = (typeof options.filter === 'function');
@@ -440,12 +438,11 @@ phpbb.timezonePreselectSelect = function(forceSelector) {
// The offset returned here is in minutes and negated.
// http://www.w3schools.com/jsref/jsref_getTimezoneOffset.asp
var offset = (new Date()).getTimezoneOffset();
+ var sign = '-';
if (offset < 0) {
- var sign = '+';
+ sign = '+';
offset = -offset;
- } else {
- var sign = '-';
}
var minutes = offset % 60;
@@ -466,8 +463,9 @@ phpbb.timezonePreselectSelect = function(forceSelector) {
var prefix = 'GMT' + sign + hours + ':' + minutes;
var prefixLength = prefix.length;
var selectorOptions = $('#tz_date > option');
+ var i;
- for (var i = 0; i < selectorOptions.length; ++i) {
+ for (i = 0; i < selectorOptions.length; ++i) {
var option = selectorOptions[i];
if (option.value.substring(0, prefixLength) == prefix) {
diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js
index 0b587ac561..e38e3d4cb2 100644
--- a/phpBB/styles/prosilver/template/ajax.js
+++ b/phpBB/styles/prosilver/template/ajax.js
@@ -189,18 +189,19 @@ phpbb.ajaxify({
refresh: true,
filter: function (data) {
var action = $('#quick-mod-select').val();
+ var ret = false;
if (action === 'make_normal') {
- return $(this).find('select option[value="make_global"]').length > 0;
+ ret = $(this).find('select option[value="make_global"]').length > 0;
} else if (action === 'lock' || action === 'unlock') {
- return true;
+ ret = true;
}
if (action === 'delete_topic' || action === 'make_sticky' || action === 'make_announce' || action === 'make_global') {
- return true;
+ ret = true;
}
- return false;
+ return ret;
}
});
diff --git a/phpBB/styles/prosilver/template/editor.js b/phpBB/styles/prosilver/template/editor.js
index c16b0ef703..c099466005 100644
--- a/phpBB/styles/prosilver/template/editor.js
+++ b/phpBB/styles/prosilver/template/editor.js
@@ -11,7 +11,7 @@ var bbcodeEnabled = true;
// Check for Browser & Platform for PC & IE specific bits
// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
-var clientVer = parseInt(navigator.appVersion); // Get browser version
+var clientVer = parseInt(navigator.appVersion, 10); // Get browser version
var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == -1));
var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1));
diff --git a/phpBB/styles/prosilver/template/timezone.js b/phpBB/styles/prosilver/template/timezone.js
index af8206d12d..b0e8a38366 100644
--- a/phpBB/styles/prosilver/template/timezone.js
+++ b/phpBB/styles/prosilver/template/timezone.js
@@ -1,5 +1,7 @@
(function($) { // Avoid conflicts with other libraries
+"use strict";
+
$('#tz_date').change(function() {
phpbb.timezoneSwitchDate(false);
});
diff --git a/phpBB/styles/subsilver2/template/editor.js b/phpBB/styles/subsilver2/template/editor.js
index 151cf53ff1..0b5b15643a 100644
--- a/phpBB/styles/subsilver2/template/editor.js
+++ b/phpBB/styles/subsilver2/template/editor.js
@@ -179,11 +179,10 @@ function insert_text(text, spaces, popup)
{
textarea.value = textarea.value + text;
}
- if (!popup)
+ if (!popup)
{
textarea.focus();
- }
-
+ }
}
/**
diff --git a/phpBB/styles/subsilver2/template/timezone.js b/phpBB/styles/subsilver2/template/timezone.js
index af8206d12d..b0e8a38366 100644
--- a/phpBB/styles/subsilver2/template/timezone.js
+++ b/phpBB/styles/subsilver2/template/timezone.js
@@ -1,5 +1,7 @@
(function($) { // Avoid conflicts with other libraries
+"use strict";
+
$('#tz_date').change(function() {
phpbb.timezoneSwitchDate(false);
});