|
@@ -151,8 +151,9 @@ function EditNews()
|
|
|
'function' => create_function('$news', '
|
|
|
|
|
|
if (is_numeric($news[\'id\']))
|
|
|
- return \'<textarea rows="3" cols="65" name="news[]" style="\' . (isBrowser(\'is_ie8\') ? \'width: 635px; max-width: 85%; min-width: 85%\' : \'width: 85%\') . \';">\' . $news[\'unparsed\'] . \'</textarea>
|
|
|
- <div style="float:right" id="preview_\' . $news[\'id\'] . \'"></div>\';
|
|
|
+ return \'<textarea id="data_\' . $news[\'id\'] . \'" rows="3" cols="65" name="news[]" style="\' . (isBrowser(\'is_ie8\') ? \'width: 635px; max-width: 85%; min-width: 85%\' : \'width 100%;margin 0 5em\') . \';">\' . $news[\'unparsed\'] . \'</textarea>
|
|
|
+ <br />
|
|
|
+ <div class="floatleft" id="preview_\' . $news[\'id\'] . \'"></div>\';
|
|
|
else
|
|
|
return $news[\'unparsed\'];
|
|
|
'),
|
|
@@ -197,11 +198,18 @@ function EditNews()
|
|
|
array(
|
|
|
'position' => 'bottom_of_list',
|
|
|
'value' => '
|
|
|
- <span id="moreNewsItems_link" style="display: none;">[<a href="javascript:void(0);" onclick="addNewsItem(); return false;">' . $txt['editnews_clickadd'] . '</a>]</span>
|
|
|
- <script type="text/javascript"><!-- // --><![CDATA[
|
|
|
+ <span id="moreNewsItems_link" class="floatleft" style="display: none;">
|
|
|
+ <a class="button_link" href="javascript:void(0);" onclick="addNewsItem(); return false;">' . $txt['editnews_clickadd'] . '</a>
|
|
|
+ </span>
|
|
|
+ <input type="submit" name="save_items" value="' . $txt['save'] . '" class="button_submit" />
|
|
|
+ <input type="submit" name="delete_selection" value="' . $txt['editnews_remove_selected'] . '" onclick="return confirm(\'' . $txt['editnews_remove_confirm'] . '\');" class="button_submit" />',
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ 'javascript' => '
|
|
|
document.getElementById(\'list_news_lists_last\').style.display = "none";
|
|
|
document.getElementById("moreNewsItems_link").style.display = "";
|
|
|
var last_preview = 0;
|
|
|
+
|
|
|
$(document).ready(function () {
|
|
|
$("div[id ^= \'preview_\']").each(function () {
|
|
|
var preview_id = $(this).attr(\'id\').split(\'_\')[1];
|
|
@@ -213,12 +221,12 @@ function EditNews()
|
|
|
|
|
|
function make_preview_btn (preview_id)
|
|
|
{
|
|
|
- $("#preview_" + preview_id).css({cursor: \'hand\', cursor: \'pointer\', });
|
|
|
+ $("#preview_" + preview_id).addClass("button_link");
|
|
|
$("#preview_" + preview_id).text(\'' . $txt['preview'] . '\').click(function () {
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
|
url: "' . $scripturl . '?action=xmlhttp;sa=previews;xml",
|
|
|
- data: {item: "newspreview", news: $("#preview_" + preview_id).prev().val()},
|
|
|
+ data: {item: "newspreview", news: $("#data_" + preview_id).val()},
|
|
|
context: document.body,
|
|
|
success: function(request){
|
|
|
if ($(request).find("error").text() == \'\')
|
|
@@ -236,8 +244,9 @@ function EditNews()
|
|
|
$("#list_news_lists_last").before(' . javaScriptEscape('
|
|
|
<tr class="windowbg') . ' + (last_preview % 2 == 0 ? \'\' : \'2\') + ' . javaScriptEscape('">
|
|
|
<td style="width: 50%;">
|
|
|
- <textarea rows="3" cols="65" name="news[]" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 85%; min-width: 85%' : 'width: 85%') . ';"></textarea>
|
|
|
- <div style="float:right" id="preview_') . ' + last_preview + ' . javaScriptEscape('"></div>
|
|
|
+ <textarea id="data_') . ' + last_preview + ' . javaScriptEscape('" rows="3" cols="65" name="news[]" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 85%; min-width: 85%' : 'width: 95%') . ';"></textarea>
|
|
|
+ <br />
|
|
|
+ <div class="floatleft" id="preview_') . ' + last_preview + ' . javaScriptEscape('"></div>
|
|
|
</td>
|
|
|
<td style="width: 45%;">
|
|
|
<div id="box_preview_') . ' + last_preview + ' . javaScriptEscape('" style="overflow: auto; width: 100%; height: 10ex;"></div>
|
|
@@ -245,13 +254,7 @@ function EditNews()
|
|
|
<td></td>
|
|
|
</tr>') . ');
|
|
|
make_preview_btn(last_preview);
|
|
|
- }
|
|
|
-
|
|
|
- // ]]></script>
|
|
|
- <input type="submit" name="save_items" value="' . $txt['save'] . '" class="button_submit" /> <input type="submit" name="delete_selection" value="' . $txt['editnews_remove_selected'] . '" onclick="return confirm(\'' . $txt['editnews_remove_confirm'] . '\');" class="button_submit" />',
|
|
|
- 'align' => 'right',
|
|
|
- ),
|
|
|
- ),
|
|
|
+ }',
|
|
|
);
|
|
|
|
|
|
// Create the request list.
|