Browse files

Merge pull request #670 from imkingdavid/feature/qrpreview

[feature/qrpreview] Preview from Quick Reply
  • Loading branch information...
2 parents 9a075e9 + 5ccd691 commit bf0a3ddacafa434f2f33a28124e095e959e164b6 @rxu rxu committed Apr 1, 2012
View
2 phpBB/language/en/viewtopic.php
@@ -62,7 +62,7 @@
'FILE_NOT_FOUND_404' => 'The file <strong>%s</strong> does not exist.',
'FORK_TOPIC' => 'Copy topic',
- 'FULL_EDITOR' => 'Full Editor',
+ 'FULL_EDITOR' => 'Full Editor &amp; 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.',
View
6 phpBB/posting.php
@@ -38,7 +38,7 @@
$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 || $preview) ? true : false;
$mode = ($delete && !$preview && !$refresh && $submit) ? 'delete' : request_var('mode', '');
$error = $post_data = array();
@@ -1198,8 +1198,8 @@
'PREVIEW_MESSAGE' => $preview_message,
'PREVIEW_SIGNATURE' => $preview_signature,
- 'S_DISPLAY_PREVIEW' => true)
- );
+ 'S_DISPLAY_PREVIEW' => !empty($preview_message),
+ ));
}
}
View
11 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
View
6 phpBB/styles/prosilver/template/quickreply_editor.html
@@ -1,4 +1,4 @@
-<form method="post" action="{U_QR_ACTION}">
+<form method="post" action="{U_QR_ACTION}" id="qr_postform">
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<h2>{L_QUICKREPLY}</h2>
@@ -14,8 +14,8 @@
<fieldset class="submit-buttons">
{S_FORM_TOKEN}
{QR_HIDDEN_FIELDS}
- <input type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" class="button1" />&nbsp;
- <input type="submit" accesskey="f" tabindex="7" name="full_editor" value="{L_FULL_EDITOR}" class="button2" data-ajax="false" />&nbsp;
+ <input type="submit" accesskey="f" tabindex="6" name="preview" value="{L_FULL_EDITOR}" class="button2" data-ajax="false" id="qr_full_editor" />&nbsp;
+ <input type="submit" accesskey="s" tabindex="7" name="post" value="{L_SUBMIT}" class="button1" />&nbsp;
</fieldset>
<span class="corners-bottom"><span></span></span></div>
</div>
View
4 phpBB/styles/subsilver2/template/quickreply_editor.html
@@ -14,8 +14,8 @@
</tr>
<tr>
<td class="cat" colspan="2" align="center">
- <input class="btnmain" type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" />&nbsp;
- <input class="btnlite" type="submit" accesskey="f" tabindex="7" name="full_editor" value="{L_FULL_EDITOR}" />
+ <input class="btnlite" type="submit" accesskey="f" tabindex="6" name="preview" value="{L_FULL_EDITOR}" />&nbsp;
+ <input class="btnmain" type="submit" accesskey="s" tabindex="7" name="post" value="{L_SUBMIT}" />
{S_FORM_TOKEN}
{QR_HIDDEN_FIELDS}

0 comments on commit bf0a3dd

Please sign in to comment.