mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/13887] Minor JS refactoring
PHPBB3-13887
This commit is contained in:
parent
2a83290e7c
commit
143578ad09
5 changed files with 63 additions and 58 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
/* global bbfontstyle */
|
||||||
|
|
||||||
var phpbb = {};
|
var phpbb = {};
|
||||||
phpbb.alertTime = 100;
|
phpbb.alertTime = 100;
|
||||||
|
|
||||||
|
@ -197,7 +199,7 @@ phpbb.confirm = function(msg, callback, fadedark) {
|
||||||
*
|
*
|
||||||
* @argument {string} string The querystring to parse.
|
* @argument {string} string The querystring to parse.
|
||||||
* @returns {object} The object created.
|
* @returns {object} The object created.
|
||||||
*/{}
|
*/
|
||||||
phpbb.parseQuerystring = function(string) {
|
phpbb.parseQuerystring = function(string) {
|
||||||
var params = {}, i, split;
|
var params = {}, i, split;
|
||||||
|
|
||||||
|
@ -764,7 +766,7 @@ phpbb.timezoneSwitchDate = function(keepSelection) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tzDate.val() !== '') {
|
if ($tzDate.val() !== '') {
|
||||||
$timezone.children('optgroup').remove(':not([data-tz-value="' + $('#tz_date').val() + '"])');
|
$timezone.children('optgroup').remove(':not([data-tz-value="' + $tzDate.val() + '"])');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tzDate.val() === $tzSelectDateSuggest.attr('data-suggested-tz')) {
|
if ($tzDate.val() === $tzSelectDateSuggest.attr('data-suggested-tz')) {
|
||||||
|
@ -1004,7 +1006,7 @@ phpbb.resizeTextArea = function($items, options) {
|
||||||
|
|
||||||
function autoResize(item) {
|
function autoResize(item) {
|
||||||
function setHeight(height) {
|
function setHeight(height) {
|
||||||
height += parseInt($item.css('height')) - $item.height();
|
height += parseInt($item.css('height'), 10) - $item.height();
|
||||||
$item.css({height: height + 'px', resize: 'none'}).addClass('auto-resized');
|
$item.css({height: height + 'px', resize: 'none'}).addClass('auto-resized');
|
||||||
configuration.resizeCallback.call(item, $item);
|
configuration.resizeCallback.call(item, $item);
|
||||||
}
|
}
|
||||||
|
@ -1021,7 +1023,7 @@ phpbb.resizeTextArea = function($items, options) {
|
||||||
configuration.maxHeight
|
configuration.maxHeight
|
||||||
),
|
),
|
||||||
$item = $(item),
|
$item = $(item),
|
||||||
height = parseInt($item.height()),
|
height = parseInt($item.height(), 10),
|
||||||
scrollHeight = (item.scrollHeight) ? item.scrollHeight : 0;
|
scrollHeight = (item.scrollHeight) ? item.scrollHeight : 0;
|
||||||
|
|
||||||
if (height < 0) {
|
if (height < 0) {
|
||||||
|
@ -1213,10 +1215,10 @@ phpbb.applyCodeEditor = function(textarea) {
|
||||||
* This function will enable the drag and drop animation for a specified
|
* This function will enable the drag and drop animation for a specified
|
||||||
* textarea.
|
* textarea.
|
||||||
*
|
*
|
||||||
* @param {object} textarea Textarea DOM object to apply editor to
|
* @param {HTMLElement} textarea Textarea DOM object to apply editor to
|
||||||
*/
|
*/
|
||||||
phpbb.showDragNDrop = function(textarea) {
|
phpbb.showDragNDrop = function(textarea) {
|
||||||
if (textarea == null) {
|
if (!textarea) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1474,7 +1476,7 @@ phpbb.registerPalette = function(el) {
|
||||||
}
|
}
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set display of page element
|
* Set display of page element
|
||||||
|
|
|
@ -159,7 +159,7 @@ function insert_text(text, spaces, popup) {
|
||||||
/**
|
/**
|
||||||
* Add inline attachment at position
|
* Add inline attachment at position
|
||||||
*/
|
*/
|
||||||
function attach_inline(index, filename) {
|
function attachInline(index, filename) {
|
||||||
insert_text('[attachment=' + index + ']' + filename + '[/attachment]');
|
insert_text('[attachment=' + index + ']' + filename + '[/attachment]');
|
||||||
document.forms[form_name].elements[text_name].focus();
|
document.forms[form_name].elements[text_name].focus();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
|
/* global phpbb, plupload, attachInline */
|
||||||
|
|
||||||
plupload.addI18n(phpbb.plupload.i18n);
|
plupload.addI18n(phpbb.plupload.i18n);
|
||||||
phpbb.plupload.ids = [];
|
phpbb.plupload.ids = [];
|
||||||
|
|
||||||
(function($) { // Avoid conflicts with other libraries
|
(function($) { // Avoid conflicts with other libraries
|
||||||
|
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set up the uploader.
|
* Set up the uploader.
|
||||||
|
@ -18,7 +20,7 @@ phpbb.plupload.initialize = function() {
|
||||||
|
|
||||||
// Only execute if Plupload initialized successfully.
|
// Only execute if Plupload initialized successfully.
|
||||||
phpbb.plupload.uploader.bind('Init', function() {
|
phpbb.plupload.uploader.bind('Init', function() {
|
||||||
phpbb.plupload.form = $(phpbb.plupload.config.form_hook)[0],
|
phpbb.plupload.form = $(phpbb.plupload.config.form_hook)[0];
|
||||||
phpbb.plupload.rowTpl = $('#attach-row-tpl')[0].outerHTML;
|
phpbb.plupload.rowTpl = $('#attach-row-tpl')[0].outerHTML;
|
||||||
|
|
||||||
// Hide the basic upload panel and remove the attach row template.
|
// Hide the basic upload panel and remove the attach row template.
|
||||||
|
@ -64,10 +66,8 @@ phpbb.plupload.clearParams = function() {
|
||||||
* @param {object} obj
|
* @param {object} obj
|
||||||
*/
|
*/
|
||||||
phpbb.plupload.updateMultipartParams = function(obj) {
|
phpbb.plupload.updateMultipartParams = function(obj) {
|
||||||
phpbb.plupload.uploader.settings.multipart_params = $.extend(
|
var settings = phpbb.plupload.uploader.settings;
|
||||||
phpbb.plupload.uploader.settings.multipart_params,
|
settings.multipart_params = $.extend(settings.multipart_params, obj);
|
||||||
obj
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -95,11 +95,11 @@ phpbb.plupload.getSerializedData = function() {
|
||||||
* Get the index from the phpbb.plupload.data array where the given
|
* Get the index from the phpbb.plupload.data array where the given
|
||||||
* attachment id appears.
|
* attachment id appears.
|
||||||
*
|
*
|
||||||
* @param {int} attach_id The attachment id of the file.
|
* @param {int} attachId The attachment id of the file.
|
||||||
* @returns {bool|int} Index of the file if exists, otherwise false.
|
* @returns {bool|int} Index of the file if exists, otherwise false.
|
||||||
*/
|
*/
|
||||||
phpbb.plupload.getIndex = function(attach_id) {
|
phpbb.plupload.getIndex = function(attachId) {
|
||||||
var index = $.inArray(Number(attach_id), phpbb.plupload.ids);
|
var index = $.inArray(Number(attachId), phpbb.plupload.ids);
|
||||||
return (index !== -1) ? index : false;
|
return (index !== -1) ? index : false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ phpbb.plupload.updateRows = function(downloadUrl) {
|
||||||
* #file-list based on the attach_order setting.
|
* #file-list based on the attach_order setting.
|
||||||
*
|
*
|
||||||
* @param {object} file Plupload file object for the new attachment.
|
* @param {object} file Plupload file object for the new attachment.
|
||||||
*/{}
|
*/
|
||||||
phpbb.plupload.insertRow = function(file) {
|
phpbb.plupload.insertRow = function(file) {
|
||||||
var row = $(phpbb.plupload.rowTpl);
|
var row = $(phpbb.plupload.rowTpl);
|
||||||
|
|
||||||
|
@ -182,10 +182,10 @@ phpbb.plupload.updateRow = function(index, downloadUrl) {
|
||||||
// Add the link to the file
|
// Add the link to the file
|
||||||
if (typeof downloadUrl !== 'undefined' && typeof downloadUrl[index] !== 'undefined') {
|
if (typeof downloadUrl !== 'undefined' && typeof downloadUrl[index] !== 'undefined') {
|
||||||
var url = downloadUrl[index].replace('&', '&'),
|
var url = downloadUrl[index].replace('&', '&'),
|
||||||
link = ${('}<a></a>');
|
link = $('<a></a>');
|
||||||
|
|
||||||
link.attr('href', url).html(attach.real_filename);
|
link.attr('href', url).html(attach.real_filename);
|
||||||
row.find('.file-name').html(link)
|
row.find('.file-name').html(link);
|
||||||
}
|
}
|
||||||
|
|
||||||
row.find('textarea').attr('name', 'comment_list[' + index + ']');
|
row.find('textarea').attr('name', 'comment_list[' + index + ']');
|
||||||
|
@ -203,6 +203,10 @@ phpbb.plupload.updateHiddenData = function(row, attach, index) {
|
||||||
row.find('input[type="hidden"]').remove();
|
row.find('input[type="hidden"]').remove();
|
||||||
|
|
||||||
for (var key in attach) {
|
for (var key in attach) {
|
||||||
|
if (!attach.hasOwnProperty(key)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var input = $('<input />')
|
var input = $('<input />')
|
||||||
.attr('type', 'hidden')
|
.attr('type', 'hidden')
|
||||||
.attr('name', 'attachment_data[' + index + '][' + key +']')
|
.attr('name', 'attachment_data[' + index + '][' + key +']')
|
||||||
|
@ -290,7 +294,7 @@ phpbb.plupload.hideEmptyList = function() {
|
||||||
if (!$('#file-list').children().length) {
|
if (!$('#file-list').children().length) {
|
||||||
$('#file-list-container').slideUp(100);
|
$('#file-list-container').slideUp(100);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the indices used in inline attachment bbcodes. This ensures that the bbcodes
|
* Update the indices used in inline attachment bbcodes. This ensures that the bbcodes
|
||||||
|
@ -324,7 +328,7 @@ phpbb.plupload.updateBbcode = function(action, index) {
|
||||||
// Private function used to generate search regexp
|
// Private function used to generate search regexp
|
||||||
var searchRegexp = function(index) {
|
var searchRegexp = function(index) {
|
||||||
return new RegExp('\\[attachment=' + index + '\\](.*?)\\[\\/attachment\\]', 'g');
|
return new RegExp('\\[attachment=' + index + '\\](.*?)\\[\\/attachment\\]', 'g');
|
||||||
}
|
};
|
||||||
// The update order of the indices is based on the action taken to ensure that we don't corrupt
|
// The update order of the indices is based on the action taken to ensure that we don't corrupt
|
||||||
// the bbcode index by updating it several times as we move through the loop.
|
// the bbcode index by updating it several times as we move through the loop.
|
||||||
// Removal loop starts at the removed index and moves to the end of the array.
|
// Removal loop starts at the removed index and moves to the end of the array.
|
||||||
|
@ -334,12 +338,12 @@ phpbb.plupload.updateBbcode = function(action, index) {
|
||||||
i = (removal) ? index : phpbb.plupload.ids.length - 1;
|
i = (removal) ? index : phpbb.plupload.ids.length - 1;
|
||||||
}
|
}
|
||||||
return (removal) ? (i < phpbb.plupload.ids.length): (i >= index);
|
return (removal) ? (i < phpbb.plupload.ids.length): (i >= index);
|
||||||
}
|
};
|
||||||
var i;
|
var i;
|
||||||
|
|
||||||
while (searchLoop()) {
|
while (searchLoop()) {
|
||||||
text = text.replace(searchRegexp(i), updateBbcode);
|
text = text.replace(searchRegexp(i), updateBbcode);
|
||||||
(removal) ? i++ : i--;
|
i += (removal) ? 1 : -1;
|
||||||
}
|
}
|
||||||
textarea.val(text);
|
textarea.val(text);
|
||||||
};
|
};
|
||||||
|
@ -361,7 +365,7 @@ phpbb.plupload.getFilesByStatus = function(status) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return files;
|
return files;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check whether the user has reached the maximun number of files that he's allowed
|
* Check whether the user has reached the maximun number of files that he's allowed
|
||||||
|
@ -389,7 +393,7 @@ phpbb.plupload.handleMaxFilesReached = function() {
|
||||||
phpbb.plupload.enableUploader();
|
phpbb.plupload.enableUploader();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disable the uploader
|
* Disable the uploader
|
||||||
|
@ -397,7 +401,7 @@ phpbb.plupload.handleMaxFilesReached = function() {
|
||||||
phpbb.plupload.disableUploader = function() {
|
phpbb.plupload.disableUploader = function() {
|
||||||
$('#add_files').addClass('disabled');
|
$('#add_files').addClass('disabled');
|
||||||
phpbb.plupload.uploader.disableBrowse();
|
phpbb.plupload.uploader.disableBrowse();
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable the uploader
|
* Enable the uploader
|
||||||
|
@ -405,7 +409,7 @@ phpbb.plupload.disableUploader = function() {
|
||||||
phpbb.plupload.enableUploader = function() {
|
phpbb.plupload.enableUploader = function() {
|
||||||
$('#add_files').removeClass('disabled');
|
$('#add_files').removeClass('disabled');
|
||||||
phpbb.plupload.uploader.disableBrowse(false);
|
phpbb.plupload.uploader.disableBrowse(false);
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mark all queued files as failed.
|
* Mark all queued files as failed.
|
||||||
|
@ -419,7 +423,7 @@ phpbb.plupload.markQueuedFailed = function(error) {
|
||||||
$('#' + file.id).find('.file-progress').hide();
|
$('#' + file.id).find('.file-progress').hide();
|
||||||
phpbb.plupload.fileError(file, error);
|
phpbb.plupload.fileError(file, error);
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Marks a file as failed and sets the error message for it.
|
* Marks a file as failed and sets the error message for it.
|
||||||
|
@ -430,10 +434,13 @@ phpbb.plupload.markQueuedFailed = function(error) {
|
||||||
phpbb.plupload.fileError = function(file, error) {
|
phpbb.plupload.fileError = function(file, error) {
|
||||||
file.status = plupload.FAILED;
|
file.status = plupload.FAILED;
|
||||||
file.error = error;
|
file.error = error;
|
||||||
$('#' + file.id).find('.file-status').addClass('file-error').attr({'data-error-title': phpbb.plupload.lang.ERROR, 'data-error-message': error});
|
$('#' + file.id).find('.file-status')
|
||||||
}
|
.addClass('file-error')
|
||||||
|
.attr({
|
||||||
|
'data-error-title': phpbb.plupload.lang.ERROR,
|
||||||
|
'data-error-message': error
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -442,24 +449,23 @@ phpbb.plupload.fileError = function(file, error) {
|
||||||
phpbb.plupload.uploader = new plupload.Uploader(phpbb.plupload.config);
|
phpbb.plupload.uploader = new plupload.Uploader(phpbb.plupload.config);
|
||||||
phpbb.plupload.initialize();
|
phpbb.plupload.initialize();
|
||||||
|
|
||||||
|
var $fileList = $('#file-list');
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Insert inline attachment bbcode.
|
* Insert inline attachment bbcode.
|
||||||
*/
|
*/
|
||||||
$('#file-list').on('click', '.file-inline-bbcode', function(e) {
|
$fileList.on('click', '.file-inline-bbcode', function(e) {
|
||||||
var attachId = $(this).parents('.attach-row').attr('data-attach-id'),
|
var attachId = $(this).parents('.attach-row').attr('data-attach-id'),
|
||||||
index = phpbb.plupload.getIndex(attachId);
|
index = phpbb.plupload.getIndex(attachId);
|
||||||
|
|
||||||
attach_inline(index, phpbb.plupload.data[index].real_filename);
|
attachInline(index, phpbb.plupload.data[index].real_filename);
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete a file.
|
* Delete a file.
|
||||||
*/
|
*/
|
||||||
$('#file-list').on('click', '.file-delete', function(e) {
|
$fileList.on('click', '.file-delete', function(e) {
|
||||||
var row = $(this).parents('.attach-row'),
|
var row = $(this).parents('.attach-row'),
|
||||||
attachId = row.attr('data-attach-id');
|
attachId = row.attr('data-attach-id');
|
||||||
|
|
||||||
|
@ -470,7 +476,7 @@ $('#file-list').on('click', '.file-delete', function(e) {
|
||||||
/**
|
/**
|
||||||
* Display the error message for a particular file when the error icon is clicked.
|
* Display the error message for a particular file when the error icon is clicked.
|
||||||
*/
|
*/
|
||||||
$('#file-list').on('click', '.file-error', function(e) {
|
$fileList.on('click', '.file-error', function(e) {
|
||||||
phpbb.alert($(this).attr('data-error-title'), $(this).attr('data-error-message'));
|
phpbb.alert($(this).attr('data-error-title'), $(this).attr('data-error-message'));
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
|
@ -563,13 +569,14 @@ phpbb.plupload.uploader.bind('FilesAdded', function(up, files) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Switch the active tab if the style supports it
|
// Switch the active tab if the style supports it
|
||||||
if (typeof activateSubPanel == 'function') {
|
if (typeof activateSubPanel === 'function') {
|
||||||
activateSubPanel('attach-panel');
|
activateSubPanel('attach-panel'); // jshint ignore: line
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show the file list if there aren't any files currently.
|
// Show the file list if there aren't any files currently.
|
||||||
if (!$('#file-list-container').is(':visible')) {
|
var $fileListContainer = $('#file-list-container');
|
||||||
$('#file-list-container').show(100);
|
if (!$fileListContainer.is(':visible')) {
|
||||||
|
$fileListContainer.show(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
$.each(files, function(i, file) {
|
$.each(files, function(i, file) {
|
||||||
|
@ -577,7 +584,7 @@ phpbb.plupload.uploader.bind('FilesAdded', function(up, files) {
|
||||||
});
|
});
|
||||||
|
|
||||||
up.bind('UploadProgress', function(up, file) {
|
up.bind('UploadProgress', function(up, file) {
|
||||||
$('#' + file.id + " .file-progress-bar").css('width', file.percent + '%');
|
$('.file-progress-bar', '#' + file.id).css('width', file.percent + '%');
|
||||||
$('#file-total-progress-bar').css('width', up.total.percent + '%');
|
$('#file-total-progress-bar').css('width', up.total.percent + '%');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -609,7 +616,7 @@ phpbb.plupload.uploader.bind('FileUploaded', function(up, file, response) {
|
||||||
row.find('.file-progress').hide();
|
row.find('.file-progress').hide();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
json = $.parseJSON(response.response);
|
json = JSON.parse(response.response);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
error = 'Error parsing server response.';
|
error = 'Error parsing server response.';
|
||||||
}
|
}
|
||||||
|
@ -628,23 +635,19 @@ phpbb.plupload.uploader.bind('FileUploaded', function(up, file, response) {
|
||||||
if (typeof error !== 'undefined') {
|
if (typeof error !== 'undefined') {
|
||||||
phpbb.plupload.fileError(file, error);
|
phpbb.plupload.fileError(file, error);
|
||||||
} else if (file.status === plupload.DONE) {
|
} else if (file.status === plupload.DONE) {
|
||||||
file.attachment_data = json['data'][0];
|
file.attachment_data = json.data[0];
|
||||||
|
|
||||||
row.attr('data-attach-id', file.attachment_data.attach_id);
|
row.attr('data-attach-id', file.attachment_data.attach_id);
|
||||||
row.find('.file-inline-bbcode').show();
|
row.find('.file-inline-bbcode').show();
|
||||||
row.find('.file-status').addClass('file-uploaded');
|
row.find('.file-status').addClass('file-uploaded');
|
||||||
phpbb.plupload.update(json['data'], 'addition', 0, [json['download_url']]);
|
phpbb.plupload.update(json.data, 'addition', 0, [json.download_url]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires when the entire queue of files have been uploaded.
|
* Fires when the entire queue of files have been uploaded.
|
||||||
*
|
|
||||||
* @param {object} up The plupload.Uploader object
|
|
||||||
* @param {Array} files An array of plupload.File objects that have just
|
|
||||||
* been uploaded as part of a queue
|
|
||||||
*/
|
*/
|
||||||
phpbb.plupload.uploader.bind('UploadComplete', function(up, files) {
|
phpbb.plupload.uploader.bind('UploadComplete', function() {
|
||||||
// Hide the progress bar
|
// Hide the progress bar
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
$('#file-total-progress-bar').fadeOut(500, function() {
|
$('#file-total-progress-bar').fadeOut(500, function() {
|
||||||
|
|
|
@ -138,9 +138,9 @@ phpbb.markNotifications = function($popup, unreadCount) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update page title
|
// Update page title
|
||||||
$('title').text(
|
var $title = $('title');
|
||||||
(unreadCount ? '(' + unreadCount + ')' : '') + $('title').text().replace(/(\(([0-9])\))/, '')
|
var originalTitle = $title.text().replace(/(\((\d+)\))/, '');
|
||||||
);
|
$title.text((unreadCount ? '(' + unreadCount + ')' : '') + originalTitle);
|
||||||
};
|
};
|
||||||
|
|
||||||
// This callback finds the post from the delete link, and removes it.
|
// This callback finds the post from the delete link, and removes it.
|
||||||
|
@ -205,7 +205,7 @@ phpbb.addAjaxCallback('vote_poll', function(res) {
|
||||||
|
|
||||||
// Set min-height to prevent the page from jumping when the content changes
|
// Set min-height to prevent the page from jumping when the content changes
|
||||||
var updatePanelHeight = function (height) {
|
var updatePanelHeight = function (height) {
|
||||||
var height = (typeof height === 'undefined') ? panel.find('.inner').outerHeight() : height;
|
height = (typeof height === 'undefined') ? panel.find('.inner').outerHeight() : height;
|
||||||
panel.css('min-height', height);
|
panel.css('min-height', height);
|
||||||
};
|
};
|
||||||
updatePanelHeight();
|
updatePanelHeight();
|
||||||
|
@ -378,7 +378,7 @@ $('#member_search').click(function () {
|
||||||
*/
|
*/
|
||||||
$(function() {
|
$(function() {
|
||||||
phpbb.resizeTextArea($('textarea:not(#message-box textarea, .no-auto-resize)'), {minHeight: 75, maxHeight: 250});
|
phpbb.resizeTextArea($('textarea:not(#message-box textarea, .no-auto-resize)'), {minHeight: 75, maxHeight: 250});
|
||||||
phpbb.resizeTextArea($('#message-box textarea'));
|
phpbb.resizeTextArea($('textarea', '#message-box'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -221,7 +221,7 @@
|
||||||
<!-- IF S_INLINE_ATTACHMENT_OPTIONS -->
|
<!-- IF S_INLINE_ATTACHMENT_OPTIONS -->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1"><b class="genmed">{L_ATTACHMENTS}{L_COLON}</b></td>
|
<td class="row1"><b class="genmed">{L_ATTACHMENTS}{L_COLON}</b></td>
|
||||||
<td class="row2"><select name="attachments">{S_INLINE_ATTACHMENT_OPTIONS}</select> <input type="button" class="btnbbcode" accesskey="a" value="{L_PLACE_INLINE}" name="attachinline" onclick="attach_form = document.forms[form_name].elements['attachments']; attach_inline(attach_form.value, attach_form.options[attach_form.selectedIndex].text);" onmouseover="helpline('a')" onmouseout="helpline('tip')" />
|
<td class="row2"><select name="attachments">{S_INLINE_ATTACHMENT_OPTIONS}</select> <input type="button" class="btnbbcode" accesskey="a" value="{L_PLACE_INLINE}" name="attachinline" onclick="attach_form = document.forms[form_name].elements['attachments']; attachInline(attach_form.value, attach_form.options[attach_form.selectedIndex].text);" onmouseover="helpline('a')" onmouseout="helpline('tip')" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|
Loading…
Add table
Reference in a new issue