phpBB

Code Changes

File: assets/javascript/core.js

  Unmodified   Added   Modified   Removed
Line 27Line 27
 */
phpbb.loadingIndicator = function() {
if (!$loadingIndicator) {

 */
phpbb.loadingIndicator = function() {
if (!$loadingIndicator) {

		$loadingIndicator = $('<div />', { id: 'loading_indicator' });




		$loadingIndicator = $('<div />', { 
id: 'loading_indicator',
class: 'loading_indicator',
});

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


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


Line 303Line 306
					alert = phpbb.alert(res.MESSAGE_TITLE, res.MESSAGE_TEXT);
} else {
$dark.fadeOut(phpbb.alertTime);

					alert = phpbb.alert(res.MESSAGE_TITLE, res.MESSAGE_TEXT);
} else {
$dark.fadeOut(phpbb.alertTime);

 

if ($loadingIndicator) {
$loadingIndicator.fadeOut(phpbb.alertTime);
}

				}

if (typeof phpbb.ajaxCallbacks[callback] === 'function') {

				}

if (typeof phpbb.ajaxCallbacks[callback] === 'function') {

Line 394Line 401
				error: errorHandler,
cache: false
});

				error: errorHandler,
cache: false
});

 


			request.always(function() {

			request.always(function() {

 
				if ($loadingIndicator && $loadingIndicator.is(':visible')) {

				$loadingIndicator.fadeOut(phpbb.alertTime);

				$loadingIndicator.fadeOut(phpbb.alertTime);

 
				}

			});
};


			});
};


Line 950Line 960

$anchor.each(function() {
var $this = $(this);


$anchor.each(function() {
var $this = $(this);


// Toggle link text
toggleText = $this.attr('data-toggle-text');
$this.attr('data-toggle-text', $this.text());
$this.attr('title', $.trim(toggleText));
$this.text(toggleText);

 

// Toggle link url
toggleUrl = $this.attr('data-toggle-url');


// Toggle link url
toggleUrl = $this.attr('data-toggle-url');

Line 964Line 968

// Toggle class of link parent
toggleClass = $this.attr('data-toggle-class');


// Toggle class of link parent
toggleClass = $this.attr('data-toggle-class');

		$this.attr('data-toggle-class', $this.parent().attr('class'));
$this.parent().attr('class', toggleClass);







		$this.attr('data-toggle-class', $this.children().attr('class'));
$this.children('.icon').attr('class', toggleClass);

// Toggle link text
toggleText = $this.attr('data-toggle-text');
$this.attr('data-toggle-text', $this.children('span').text());
$this.attr('title', $.trim(toggleText));
$this.children('span').text(toggleText);

	});
});


	});
});


Line 1022Line 1032

function autoResize(item) {
function setHeight(height) {


function autoResize(item) {
function setHeight(height) {

			height += parseInt($item.css('height'), 10) - $item.height();

			height += parseInt($item.css('height'), 10) - $item.innerHeight();

			$item
.css({ height: height + 'px', resize: 'none' })
.addClass('auto-resized');

			$item
.css({ height: height + 'px', resize: 'none' })
.addClass('auto-resized');

Line 1041Line 1051
				configuration.maxHeight
),
$item = $(item),

				configuration.maxHeight
),
$item = $(item),

			height = parseInt($item.height(), 10),

			height = parseInt($item.innerHeight(), 10),

			scrollHeight = (item.scrollHeight) ? item.scrollHeight : 0;

if (height < 0) {

			scrollHeight = (item.scrollHeight) ? item.scrollHeight : 0;

if (height < 0) {

Line 1531Line 1541
		var $this = $(this),
$setting = $($this.data('toggle-setting'));
$setting.toggle($this.is(':selected'));

		var $this = $(this),
$setting = $($this.data('toggle-setting'));
$setting.toggle($this.is(':selected'));

 

// Disable any input elements that are not visible right now
if ($this.is(':selected')) {
$($this.data('toggle-setting') + ' input').prop('disabled', false);
} else {
$($this.data('toggle-setting') + ' input').prop('disabled', true);
}

	});
};


	});
};


Line 1606Line 1623
		}
});
};

		}
});
};

 

/**
* Handle avatars to be lazy loaded.
*/
phpbb.lazyLoadAvatars = function loadAvatars() {
$('.avatar[data-src]').each(function () {
var $avatar = $(this);

$avatar
.attr('src', $avatar.data('src'))
.removeAttr('data-src');
});
};

$(window).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