From a7045e65724481002e232a7d143b7cc2ed6acb3a Mon Sep 17 00:00:00 2001 From: David King Date: Fri, 30 Mar 2012 21:43:00 -0400 Subject: [PATCH] [feature/qrpreview] Preview from Quick Reply PHPBB3-10726 --- phpBB/language/en/viewtopic.php | 2 +- phpBB/posting.php | 2 +- phpBB/styles/prosilver/template/ajax.js | 11 +++++++++++ .../styles/prosilver/template/quickreply_editor.html | 4 ++-- .../styles/subsilver2/template/quickreply_editor.html | 4 ++-- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/phpBB/language/en/viewtopic.php b/phpBB/language/en/viewtopic.php index 1460490672..184f88ed3c 100644 --- a/phpBB/language/en/viewtopic.php +++ b/phpBB/language/en/viewtopic.php @@ -62,7 +62,7 @@ $lang = array_merge($lang, array( 'FILE_NOT_FOUND_404' => 'The file %s does not exist.', 'FORK_TOPIC' => 'Copy topic', - 'FULL_EDITOR' => 'Full Editor', + 'FULL_EDITOR' => 'Full Editor & Preview', 'LINKAGE_FORBIDDEN' => 'You are not authorised to view, download or link from/to this site.', 'LOGIN_NOTIFY_TOPIC' => 'You have been notified about this topic, please login to view it.', diff --git a/phpBB/posting.php b/phpBB/posting.php index 56fb7832f2..71ba353e89 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -38,7 +38,7 @@ $load = (isset($_POST['load'])) ? true : false; $delete = (isset($_POST['delete'])) ? true : false; $cancel = (isset($_POST['cancel']) && !isset($_POST['save'])) ? true : false; -$refresh = (isset($_POST['add_file']) || isset($_POST['delete_file']) || isset($_POST['full_editor']) || isset($_POST['cancel_unglobalise']) || $save || $load) ? true : false; +$refresh = (isset($_POST['add_file']) || isset($_POST['delete_file']) || isset($_POST['cancel_unglobalise']) || $save || $load) ? true : false; $mode = ($delete && !$preview && !$refresh && $submit) ? 'delete' : request_var('mode', ''); $error = $post_data = array(); diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js index cc886c42b1..54f34e4204 100644 --- a/phpBB/styles/prosilver/template/ajax.js +++ b/phpBB/styles/prosilver/template/ajax.js @@ -66,6 +66,17 @@ $('[data-ajax]').each(function() { }); +/** + * This simply appends #preview to the action of the + * QR action when you click the Full Editor & Preview button + */ +$('#qr_full_editor').click(function() { + $('#qr_postform').attr('action', function(i, val) { + return val + '#preview'; + }); +}); + + /** * This AJAXifies the quick-mod tools. The reason it cannot be a standard diff --git a/phpBB/styles/prosilver/template/quickreply_editor.html b/phpBB/styles/prosilver/template/quickreply_editor.html index 4cd5eedd3e..c7d998eca5 100644 --- a/phpBB/styles/prosilver/template/quickreply_editor.html +++ b/phpBB/styles/prosilver/template/quickreply_editor.html @@ -14,8 +14,8 @@
{S_FORM_TOKEN} {QR_HIDDEN_FIELDS} -   -   +   +  
diff --git a/phpBB/styles/subsilver2/template/quickreply_editor.html b/phpBB/styles/subsilver2/template/quickreply_editor.html index de5017280c..4c3f7a3d0b 100644 --- a/phpBB/styles/subsilver2/template/quickreply_editor.html +++ b/phpBB/styles/subsilver2/template/quickreply_editor.html @@ -14,8 +14,8 @@ -   - +   + {S_FORM_TOKEN} {QR_HIDDEN_FIELDS}