aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/assets/javascript
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/assets/javascript')
-rw-r--r--phpBB/assets/javascript/core.js43
-rw-r--r--phpBB/assets/javascript/jquery.min.js (renamed from phpBB/assets/javascript/jquery.js)0
-rw-r--r--phpBB/assets/javascript/plupload.js5
3 files changed, 42 insertions, 6 deletions
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js
index ae8583ddbf..37728864c4 100644
--- a/phpBB/assets/javascript/core.js
+++ b/phpBB/assets/javascript/core.js
@@ -15,7 +15,7 @@ var dark = $('#darkenwrapper');
var loadingIndicator = $('#loading_indicator');
var phpbbAlertTimer = null;
-var isTouch = (window && typeof window.ontouchstart !== 'undefined');
+phpbb.isTouch = (window && typeof window.ontouchstart !== 'undefined');
/**
* Display a loading screen
@@ -84,8 +84,8 @@ phpbb.alert = function(title, msg, fadedark) {
e.stopPropagation();
});
- $(document).bind('keydown', function(e) {
- if (e.keyCode === keymap.ENTER || e.keyCode === keymap.ESC) {
+ $(document).keydown(function(e) {
+ if ((e.keyCode === keymap.ENTER || e.keyCode === keymap.ESC) && dark.is(':visible')) {
dark.trigger('click');
e.preventDefault();
@@ -333,7 +333,9 @@ phpbb.ajaxify = function(options) {
// Hide the alert even if we refresh the page, in case the user
// presses the back button.
dark.fadeOut(phpbb.alertTime, function() {
- alert.hide();
+ if (typeof alert !== 'undefined') {
+ alert.hide();
+ }
});
}, res.REFRESH_DATA.time * 1000); // Server specifies time in seconds
}
@@ -1009,7 +1011,7 @@ phpbb.resizeTextArea = function(items, options) {
resetCallback: function(item) { }
};
- if (isTouch) return;
+ if (phpbb.isTouch) return;
if (arguments.length > 1) {
configuration = $.extend(configuration, options);
@@ -1199,7 +1201,11 @@ phpbb.applyCodeEditor = function(textarea) {
var key = event.keyCode || event.which;
// intercept tabs
- if (key == 9) {
+ if (key == 9 &&
+ !event.ctrlKey &&
+ !event.shiftKey &&
+ !event.altKey &&
+ !event.metaKey) {
if (inTag()) {
appendText("\t");
event.preventDefault();
@@ -1476,6 +1482,21 @@ phpbb.toggleDisplay = function(id, action, type) {
}
/**
+* Toggle additional settings based on the selected
+* option of select element.
+*
+* @param jQuery el jQuery select element object.
+* @return undefined
+*/
+phpbb.toggleSelectSettings = function(el) {
+ el.children().each(function() {
+ var option = $(this),
+ setting = $(option.data('toggle-setting'));
+ setting.toggle(option.is(':selected'));
+ });
+};
+
+/**
* Get function from name.
* Based on http://stackoverflow.com/a/359910
*
@@ -1516,6 +1537,16 @@ $(document).ready(function() {
// Update browser history URL to point to specific post in viewtopic.php
// when using view=unread#unread link.
phpbb.history.replaceUrl($('#unread[data-url]').data('url'));
+
+ // Hide settings that are not selected via select element.
+ $('select[data-togglable-settings]').each(function() {
+ var select = $(this);
+
+ select.change(function() {
+ phpbb.toggleSelectSettings(select);
+ });
+ phpbb.toggleSelectSettings(select);
+ });
});
})(jQuery); // Avoid conflicts with other libraries
diff --git a/phpBB/assets/javascript/jquery.js b/phpBB/assets/javascript/jquery.min.js
index 73f33fb3aa..73f33fb3aa 100644
--- a/phpBB/assets/javascript/jquery.js
+++ b/phpBB/assets/javascript/jquery.min.js
diff --git a/phpBB/assets/javascript/plupload.js b/phpBB/assets/javascript/plupload.js
index 8ffd452a09..5445e83e15 100644
--- a/phpBB/assets/javascript/plupload.js
+++ b/phpBB/assets/javascript/plupload.js
@@ -586,6 +586,11 @@ uploader.bind('FilesAdded', function(up, files) {
return;
}
+ // Switch the active tab if the style supports it
+ if (typeof activateSubPanel == 'function') {
+ activateSubPanel('attach-panel');
+ }
+
// Show the file list if there aren't any files currently.
if (!$('#file-list-container').is(':visible')) {
$('#file-list-container').show(100);