diff options
Diffstat (limited to 'phpBB/assets/javascript/core.js')
-rw-r--r-- | phpBB/assets/javascript/core.js | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index a88719f1df..5218a8c1be 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -20,6 +20,13 @@ var phpbbAlertTimer = null; phpbb.isTouch = (window && typeof window.ontouchstart !== 'undefined'); +// Add ajax pre-filter to prevent cross-domain script execution +$.ajaxPrefilter(function(s) { + if (s.crossDomain) { + s.contents.script = false; + } +}); + /** * Display a loading screen * @@ -27,9 +34,9 @@ phpbb.isTouch = (window && typeof window.ontouchstart !== 'undefined'); */ phpbb.loadingIndicator = function() { if (!$loadingIndicator) { - $loadingIndicator = $('<div />', { - id: 'loading_indicator', - class: 'loading_indicator', + $loadingIndicator = $('<div />', { + 'id': 'loading_indicator', + 'class': 'loading_indicator' }); $loadingIndicator.appendTo('#page-footer'); } @@ -179,7 +186,7 @@ phpbb.alert.close = function($alert, fadedark) { phpbb.confirm = function(msg, callback, fadedark) { var $confirmDiv = $('#phpbb_confirm'); $confirmDiv.find('.alert_text').html(msg); - fadedark = fadedark !== 'undefined' ? fadedark : true; + fadedark = typeof fadedark !== 'undefined' ? fadedark : true; $(document).on('keydown.phpbb.alert', function(e) { if (e.keyCode === keymap.ENTER || e.keyCode === keymap.ESC) { @@ -935,9 +942,9 @@ phpbb.addAjaxCallback('alt_text', function() { $anchor.each(function() { var $this = $(this); altText = $this.attr('data-alt-text'); - $this.attr('data-alt-text', $this.text()); - $this.attr('title', $.trim(altText)); - $this.text(altText); + $this.attr('data-alt-text', $.trim($this.text())); + $this.attr('title', altText); + $this.children('span').text(altText); }); }); @@ -1331,6 +1338,7 @@ phpbb.toggleDropdown = function() { $this.css({ marginLeft: 0, left: 0, + marginRight: 0, maxWidth: (windowWidth - 4) + 'px' }); @@ -1642,7 +1650,7 @@ phpbb.lazyLoadAvatars = function loadAvatars() { }); }; -$(window).load(phpbb.lazyLoadAvatars); +$(window).on('load', phpbb.lazyLoadAvatars); /** * Apply code editor to all textarea elements with data-bbcode attribute @@ -1654,7 +1662,7 @@ $(function() { phpbb.registerPageDropdowns(); - $('#color_palette_placeholder').each(function() { + $('[data-orientation]').each(function() { phpbb.registerPalette($(this)); }); |