diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index 7337a7fbc0..d685d28c81 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -25,7 +25,7 @@ phpbb.loading_alert = function() { setTimeout(function() { if (loading_alert.is(':visible')) { - phpbb.alert('Error', 'Error processing your request. Please try again.'); + phpbb.alert($('body').data('l-err'), $('body').data('l-err-processing-req')); } }, 5000); }); @@ -45,7 +45,9 @@ phpbb.loading_alert = function() { * @returns object Returns the div created. */ phpbb.alert = function(title, msg, fadedark) { - var div = $('

' + title + '

' + msg + '

'); + var div = $('#jalert_alert'); + div.find('h3').html(title); + div.find('p').html(msg); div.bind('click', function(e) { e.stopPropagation(); @@ -54,7 +56,7 @@ phpbb.alert = function(title, msg, fadedark) { dark.one('click', function(e) { var fade = (typeof fadedark !== 'undefined' && !fadedark) ? div : dark; fade.fadeOut(100, function() { - div.remove(); + div.hide(); }); return false; }); @@ -101,15 +103,14 @@ phpbb.alert = function(title, msg, fadedark) { * @returns object Returns the div created. */ phpbb.confirm = function(msg, callback, fadedark) { - var div = $('

' + msg + '

\ -  \ -
'); + var div = $('#jalert_confirm'); + div.find('p').html(msg); div.find('.jalertbut').bind('click', function() { var res = this.value === 'Yes'; var fade = (typeof fadedark !== 'undefined' && !fadedark && res) ? div : dark; fade.fadeOut(100, function() { - div.remove(); + div.hide(); }); callback(res); return false; @@ -227,7 +228,7 @@ phpbb.ajaxify = function(options, refresh, callback) { } dark.fadeOut(100, function() { - alert.remove(); + alert.hide(); }); }, res.REFRESH_DATA.time * 1000); } @@ -296,5 +297,11 @@ phpbb.add_ajax_callback = function(id, callback) } +phpbb.add_ajax_callback('alt_text', function(el) { + var alt_text = $(el).data('alt-text'); + $(el).data('alt-text', $(el).text()); + $(el).text(el.title = alt_text); +}); + })(jQuery); // Avoid conflicts with other libraries \ No newline at end of file diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index e8fff96e5a..ff3d229915 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -179,10 +179,12 @@ $lang = array_merge($lang, array( 'ERR_CONNECTING_SERVER' => 'Error connecting to the server.', 'ERR_JAB_AUTH' => 'Could not authorise on Jabber server.', 'ERR_JAB_CONNECT' => 'Could not connect to Jabber server.', + 'ERR_PROCESSING_REQ' => 'There was an error processing your request. Please try again.', 'ERR_UNABLE_TO_LOGIN' => 'The specified username or password is incorrect.', 'ERR_UNWATCHING' => 'An error occured while trying to unsubscribe.', 'ERR_WATCHING' => 'An error occured while trying to subscribe.', 'ERR_WRONG_PATH_TO_PHPBB' => 'The phpBB path specified appears to be invalid.', + 'ERROR' => 'Error', 'EXPAND_VIEW' => 'Expand view', 'EXTENSION' => 'Extension', 'EXTENSION_CONTROLLER_MISSING' => 'The extension %s is missing a controller class and cannot be accessed through the front-end.', diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js index 38233ad0e0..58b765779e 100644 --- a/phpBB/styles/prosilver/template/ajax.js +++ b/phpBB/styles/prosilver/template/ajax.js @@ -10,18 +10,6 @@ phpbb.add_ajax_callback('post_delete', function(el) { $(this).remove(); }); } -}).add_ajax_callback('bookmark', function(el, res) { - var text = (res.MESSAGE_TEXT.indexOf('Removed') === -1); - text = (text) ? 'Remove from bookmarks' : 'Bookmark topic'; - $(el).text(el.title = text); -}).add_ajax_callback('topic_subscribe', function(el) { - $(el).text(el.title = 'Unsubscribe topic'); -}).add_ajax_callback('topic_unsubscribe', function(el) { - $(el).text(el.title = 'Subscribe forum'); -}).add_ajax_callback('forum_subscribe', function(el) { - $(el).text(el.title = 'Unsubscribe topic'); -}).add_ajax_callback('forum_unsubscribe', function(el) { - $(el).text(el.title = 'Subscribe forum'); }).add_ajax_callback('post_approve', function(el, res, act) { $(el).parents((act === 'approve') ? '.rules' : '.post').fadeOut(function() { $(this).remove(); diff --git a/phpBB/styles/prosilver/template/overall_footer.html b/phpBB/styles/prosilver/template/overall_footer.html index a89cd7f04e..362f8bc1cc 100644 --- a/phpBB/styles/prosilver/template/overall_footer.html +++ b/phpBB/styles/prosilver/template/overall_footer.html @@ -8,9 +8,9 @@