phpBB

Code Changes

File: assets/javascript/core.js

  Unmodified   Added   Modified   Removed
Line 19Line 19
var phpbbAlertTimer = null;

phpbb.isTouch = (window && typeof window.ontouchstart !== 'undefined');

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


/**
* Display a loading screen

Line 28Line 35
phpbb.loadingIndicator = function() {
if (!$loadingIndicator) {
$loadingIndicator = $('<div />', {

phpbb.loadingIndicator = function() {
if (!$loadingIndicator) {
$loadingIndicator = $('<div />', {

			id: 'loading_indicator', 
class: 'loading_indicator',

			'id': 'loading_indicator',
'class': 'loading_indicator'

		});
$loadingIndicator.appendTo('#page-footer');
}

if (!$loadingIndicator.is(':visible')) {
$loadingIndicator.fadeIn(phpbb.alertTime);

		});
$loadingIndicator.appendTo('#page-footer');
}

if (!$loadingIndicator.is(':visible')) {
$loadingIndicator.fadeIn(phpbb.alertTime);

		// Wait fifteen seconds and display an error if nothing has been returned by then.

		// Wait 60 seconds and display an error if nothing has been returned by then.

		phpbb.clearLoadingTimeout();
phpbbAlertTimer = setTimeout(function() {

		phpbb.clearLoadingTimeout();
phpbbAlertTimer = setTimeout(function() {

 
			phpbb.showTimeoutMessage();
}, 60000);
}

return $loadingIndicator;
};

/**
* Show timeout message
*/
phpbb.showTimeoutMessage = function () {

			var $alert = $('#phpbb_alert');

if ($loadingIndicator.is(':visible')) {
phpbb.alert($alert.attr('data-l-err'), $alert.attr('data-l-timeout-processing-req'));
}

			var $alert = $('#phpbb_alert');

if ($loadingIndicator.is(':visible')) {
phpbb.alert($alert.attr('data-l-err'), $alert.attr('data-l-timeout-processing-req'));
}

		}, 15000);
}

return $loadingIndicator;

 
};

/**

};

/**

Line 172Line 186
phpbb.confirm = function(msg, callback, fadedark) {
var $confirmDiv = $('#phpbb_confirm');
$confirmDiv.find('.alert_text').html(msg);

phpbb.confirm = function(msg, callback, fadedark) {
var $confirmDiv = $('#phpbb_confirm');
$confirmDiv.find('.alert_text').html(msg);

	fadedark = fadedark || true;

	fadedark = typeof fadedark !== 'undefined' ? fadedark : true;


$(document).on('keydown.phpbb.alert', function(e) {
if (e.keyCode === keymap.ENTER || e.keyCode === keymap.ESC) {


$(document).on('keydown.phpbb.alert', function(e) {
if (e.keyCode === keymap.ENTER || e.keyCode === keymap.ESC) {

Line 187Line 201
	$confirmDiv.find('input[type="button"]').one('click.phpbb.confirmbox', function(e) {
var confirmed = this.name === 'confirm';


	$confirmDiv.find('input[type="button"]').one('click.phpbb.confirmbox', function(e) {
var confirmed = this.name === 'confirm';


		if (confirmed) {
callback(true);
}

		callback(confirmed);



		$confirmDiv.find('input[type="button"]').off('click.phpbb.confirmbox');
phpbb.alert.close($confirmDiv, fadedark || !confirmed);


		$confirmDiv.find('input[type="button"]').off('click.phpbb.confirmbox');
phpbb.alert.close($confirmDiv, fadedark || !confirmed);


Line 930Line 942
	$anchor.each(function() {
var $this = $(this);
altText = $this.attr('data-alt-text');

	$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);

	});
});


	});
});


Line 1326Line 1338
			$this.css({
marginLeft: 0,
left: 0,

			$this.css({
marginLeft: 0,
left: 0,

 
				marginRight: 0,

				maxWidth: (windowWidth - 4) + 'px'
});


				maxWidth: (windowWidth - 4) + 'px'
});


Line 1637Line 1650
	});
};


	});
};


$(window).load(phpbb.lazyLoadAvatars);

$(window).on('load', phpbb.lazyLoadAvatars);


/**
* Apply code editor to all textarea elements with data-bbcode attribute


/**
* Apply code editor to all textarea elements with data-bbcode attribute

Line 1649Line 1662

phpbb.registerPageDropdowns();



phpbb.registerPageDropdowns();


	$('#color_palette_placeholder').each(function() {

	$('[data-orientation]').each(function() {

		phpbb.registerPalette($(this));
});


		phpbb.registerPalette($(this));
});