1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-09 19:26:53 +02:00

Merge branch 'develop' into feature/merging-style-components

* develop: (175 commits)
  [feature/ajax] Remove strange non-breaking spaces from approve button
  [feature/ajax] Add entirely unrelated but nice newlines
  [feature/ajax] Unify phpbb_json_response instantiation
  [feature/ajax] Fix acp_styles activate_deactivate ajax callback name
  [feature/ajax] Send correct activate/deactivate JSON response in acp_profile
  [ticket/10270] Alter background colors for posts
  [feature/ajax] Remove not working module enable/disable ajax code
  [feature/ajax] Replace static call to phpbb_request with OO
  [feature/ajax] Remove quick-reply AJAX handling until we have something good
  [ticket/10270] Changing close button for ajax popups
  [ticket/10270] Disabling links in disappearing content
  [ticket/10291] Fixed an AJAX bug on quick reply form submit.
  [ticket/10273] Fixed accepting / denying posts AJAX.
  [ticket/10272] Removed code that was prevent event propogation in AJAX.
  [ticket/10291] Fixed a bug in the quick reply AJAX.
  [feature/ajax] Handle acp_modules error cases with JSON response
  [feature/ajax] Fix filter check, quick mod tools data-attribute
  [feature/ajax] Use the error handler
  [feature/ajax] Generic error handling with a phpbb.alert box
  [feature/ajax] Change filter semantics, some minor adjustments
  ...

Conflicts:
	phpBB/adm/style/acp_styles.html
	phpBB/includes/acp/acp_styles.php
This commit is contained in:
Vjacheslav Trushkin
2012-03-31 10:43:06 +03:00
81 changed files with 1716 additions and 627 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -248,7 +248,7 @@
<!-- ELSE --><br /><span>&raquo; {L_ALLOWED_IN_PM_POST}</span><!-- ENDIF -->
</td>
<td>{groups.CATEGORY}</td>
<td align="center" valign="middle" style="white-space: nowrap;">&nbsp;<a href="{groups.U_EDIT}">{ICON_EDIT}</a>&nbsp;&nbsp;<a href="{groups.U_DELETE}">{ICON_DELETE}</a>&nbsp;</td>
<td align="center" valign="middle" style="white-space: nowrap;">&nbsp;<a href="{groups.U_EDIT}">{ICON_EDIT}</a>&nbsp;&nbsp;<a href="{groups.U_DELETE}" data-ajax="row_delete">{ICON_DELETE}</a>&nbsp;</td>
</tr>
<!-- END groups -->
</tbody>

View File

@ -101,7 +101,7 @@
<!-- BEGIN bbcodes -->
<!-- IF bbcodes.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td style="text-align: center;">{bbcodes.BBCODE_TAG}</td>
<td style="text-align: right; width: 40px;"><a href="{bbcodes.U_EDIT}">{ICON_EDIT}</a> <a href="{bbcodes.U_DELETE}">{ICON_DELETE}</a></td>
<td style="text-align: right; width: 40px;"><a href="{bbcodes.U_EDIT}">{ICON_EDIT}</a> <a href="{bbcodes.U_DELETE}" data-ajax="row_delete">{ICON_DELETE}</a></td>
</tr>
<!-- BEGINELSE -->
<tr class="row3">

View File

@ -76,9 +76,9 @@
<!-- IF bots.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td style="width: 50%;">{bots.BOT_NAME}</td>
<td style="width: 15%; white-space: nowrap;" align="center">&nbsp;{bots.LAST_VISIT}&nbsp;</td>
<td style="text-align: center;">&nbsp;<a href="{bots.U_ACTIVATE_DEACTIVATE}">{bots.L_ACTIVATE_DEACTIVATE}</a>&nbsp;</td>
<td style="text-align: center;">&nbsp;<a href="{bots.U_ACTIVATE_DEACTIVATE}" data-ajax="activate_deactivate">{bots.L_ACTIVATE_DEACTIVATE}</a>&nbsp;</td>
<td style="text-align: center;">&nbsp;<a href="{bots.U_EDIT}">{L_EDIT}</a>&nbsp;</td>
<td style="text-align: center;">&nbsp;<a href="{bots.U_DELETE}">{L_DELETE}</a>&nbsp;</td>
<td style="text-align: center;">&nbsp;<a href="{bots.U_DELETE}" data-ajax="row_delete">{L_DELETE}</a>&nbsp;</td>
<td style="text-align: center;"><input type="checkbox" class="radio" name="mark[]" value="{bots.BOT_ID}" /></td>
</tr>
<!-- END bots -->

View File

@ -443,7 +443,7 @@
<col class="row1" /><col class="row1" /><col class="row2" />
<tbody>
<!-- BEGIN forums -->
<tr>
<tr data-down="{forums.U_MOVE_DOWN}" data-up="{forums.U_MOVE_UP}">
<td style="width: 5%; text-align: center;">{forums.FOLDER_IMAGE}</td>
<td>
<!-- IF forums.FORUM_IMAGE --><div style="float: {S_CONTENT_FLOW_BEGIN}; margin-right: 5px;">{forums.FORUM_IMAGE}</div><!-- ENDIF -->
@ -453,17 +453,17 @@
</td>
<td style="vertical-align: top; width: 100px; text-align: right; white-space: nowrap;">
<!-- IF forums.S_FIRST_ROW && not forums.S_LAST_ROW -->
{ICON_MOVE_UP_DISABLED}
<a href="{forums.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<span class="up">{ICON_MOVE_UP_DISABLED}</span>
<span class="down"><a href="{forums.U_MOVE_DOWN}" data-ajax="forum_down">{ICON_MOVE_DOWN}</a></span>
<!-- ELSEIF not forums.S_FIRST_ROW && not forums.S_LAST_ROW -->
<a href="{forums.U_MOVE_UP}">{ICON_MOVE_UP}</a>
<a href="{forums.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<span class="up"><a href="{forums.U_MOVE_UP}" data-ajax="forum_up">{ICON_MOVE_UP}</a></span>
<span class="down"><a href="{forums.U_MOVE_DOWN}" data-ajax="forum_down">{ICON_MOVE_DOWN}</a></span>
<!-- ELSEIF forums.S_LAST_ROW && not forums.S_FIRST_ROW -->
<a href="{forums.U_MOVE_UP}">{ICON_MOVE_UP}</a>
{ICON_MOVE_DOWN_DISABLED}
<span class="up"><a href="{forums.U_MOVE_UP}" data-ajax="forum_up">{ICON_MOVE_UP}</a></span>
<span class="down">{ICON_MOVE_DOWN_DISABLED}</span>
<!-- ELSE -->
{ICON_MOVE_UP_DISABLED}
{ICON_MOVE_DOWN_DISABLED}
<span class="up">{ICON_MOVE_UP_DISABLED}</span>
<span class="down">{ICON_MOVE_DOWN_DISABLED}</span>
<!-- ENDIF -->
<a href="{forums.U_EDIT}">{ICON_EDIT}</a>
<!-- IF not forums.S_FORUM_LINK -->
@ -500,6 +500,14 @@
</fieldset>
</form>
<div class="hidden">
<a class="template-up-img" href="#">{ICON_MOVE_UP}</a>
<span class="template-up-img-disabled">{ICON_MOVE_UP_DISABLED}</span>
<a class="template-down-img" href="#">{ICON_MOVE_DOWN}</a>
<span class="template-down-img-disabled">{ICON_MOVE_DOWN_DISABLED}</span>
</div>
<!-- ENDIF -->
<!-- INCLUDE overall_footer.html -->

View File

@ -350,7 +350,7 @@
<td style="text-align: center;">{groups.TOTAL_MEMBERS}</td>
<td style="text-align: center;"><a href="{groups.U_EDIT}">{L_SETTINGS}</a></td>
<td style="text-align: center;"><a href="{groups.U_LIST}">{L_MEMBERS}</a></td>
<td style="text-align: center;"><!-- IF not groups.S_GROUP_SPECIAL and groups.U_DELETE --><a href="{groups.U_DELETE}">{L_DELETE}</a><!-- ELSE -->{L_DELETE}<!-- ENDIF --></td>
<td style="text-align: center;"><!-- IF not groups.S_GROUP_SPECIAL and groups.U_DELETE --><a href="{groups.U_DELETE}" data-ajax="row_delete">{L_DELETE}</a><!-- ELSE -->{L_DELETE}<!-- ENDIF --></td>
</tr>
<!-- ENDIF -->
<!-- END groups -->

View File

@ -245,7 +245,7 @@
<td style="text-align: right; white-space: nowrap;">
<!-- IF items.S_FIRST_ROW and not PREVIOUS_PAGE -->{ICON_MOVE_UP_DISABLED}<!-- ELSE --><a href="{items.U_MOVE_UP}">{ICON_MOVE_UP}</a><!-- ENDIF -->&nbsp;
<!-- IF items.S_LAST_ROW and not NEXT_PAGE -->{ICON_MOVE_DOWN_DISABLED}<!-- ELSE --><a href="{items.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a><!-- ENDIF -->
&nbsp;<a href="{items.U_EDIT}">{ICON_EDIT}</a> <a href="{items.U_DELETE}">{ICON_DELETE}</a>
&nbsp;<a href="{items.U_EDIT}">{ICON_EDIT}</a> <a href="{items.U_DELETE}" data-ajax="row_delete">{ICON_DELETE}</a>
</td>
</tr>
<!-- BEGINELSE -->

View File

@ -152,35 +152,35 @@
<fieldset>
<legend>{L_STATISTIC_RESYNC_OPTIONS}</legend>
<form id="action_online_form" method="post" action="{U_ACTION}">
<form id="action_online_form" method="post" action="{U_ACTION}" data-ajax="true">
<dl>
<dt><label for="action_online">{L_RESET_ONLINE}</label><br /><span>&nbsp;</span></dt>
<dd><input type="hidden" name="action" value="online" /><input class="button2" type="submit" id="action_online" name="action_online" value="{L_RUN}" /></dd>
</dl>
</form>
<form id="action_date_form" method="post" action="{U_ACTION}">
<form id="action_date_form" method="post" action="{U_ACTION}" data-ajax="true">
<dl>
<dt><label for="action_date">{L_RESET_DATE}</label><br /><span>&nbsp;</span></dt>
<dd><input type="hidden" name="action" value="date" /><input class="button2" type="submit" id="action_date" name="action_date" value="{L_RUN}" /></dd>
</dl>
</form>
<form id="action_stats_form" method="post" action="{U_ACTION}">
<form id="action_stats_form" method="post" action="{U_ACTION}" data-ajax="true">
<dl>
<dt><label for="action_stats">{L_RESYNC_STATS}</label><br /><span>{L_RESYNC_STATS_EXPLAIN}</span></dt>
<dd><input type="hidden" name="action" value="stats" /><input class="button2" type="submit" id="action_stats" name="action_stats" value="{L_RUN}" /></dd>
</dl>
</form>
<form id="action_user_form" method="post" action="{U_ACTION}">
<form id="action_user_form" method="post" action="{U_ACTION}" data-ajax="true">
<dl>
<dt><label for="action_user">{L_RESYNC_POSTCOUNTS}</label><br /><span>{L_RESYNC_POSTCOUNTS_EXPLAIN}</span></dt>
<dd><input type="hidden" name="action" value="user" /><input class="button2" type="submit" id="action_user" name="action_user" value="{L_RUN}" /></dd>
</dl>
</form>
<form id="action_db_track_form" method="post" action="{U_ACTION}">
<form id="action_db_track_form" method="post" action="{U_ACTION}" data-ajax="true">
<dl>
<dt><label for="action_db_track">{L_RESYNC_POST_MARKING}</label><br /><span>{L_RESYNC_POST_MARKING_EXPLAIN}</span></dt>
<dd><input type="hidden" name="action" value="db_track" /><input class="button2" type="submit" id="action_db_track" name="action_db_track" value="{L_RUN}" /></dd>
@ -188,19 +188,20 @@
</form>
<!-- IF S_FOUNDER -->
<form id="action_purge_sessions_form" method="post" action="{U_ACTION}">
<form id="action_purge_sessions_form" method="post" action="{U_ACTION}" data-ajax="true">
<dl>
<dt><label for="action_purge_sessions">{L_PURGE_SESSIONS}</label><br /><span>{L_PURGE_SESSIONS_EXPLAIN}</span></dt>
<dd><input type="hidden" name="action" value="purge_sessions" /><input class="button2" type="submit" id="action_purge_sessions" name="action_purge_sessions" value="{L_RUN}" /></dd>
</dl>
</form>
<form id="action_purge_cache_form" method="post" action="{U_ACTION}">
<!-- ENDIF -->
<form id="action_purge_cache_form" method="post" action="{U_ACTION}" data-ajax="true">
<dl>
<dt><label for="action_purge_cache">{L_PURGE_CACHE}</label><br /><span>{L_PURGE_CACHE_EXPLAIN}</span></dt>
<dd><input type="hidden" name="action" value="purge_cache" /><input class="button2" type="submit" id="action_purge_cache" name="action_purge_cache" value="{L_RUN}" /></dd>
</dl>
</form>
<!-- ENDIF -->
</fieldset>
<!-- ENDIF -->

View File

@ -164,7 +164,7 @@
{ICON_MOVE_DOWN_DISABLED}
<!-- ENDIF -->
<a href="{modules.U_EDIT}">{ICON_EDIT}</a>
<a href="{modules.U_DELETE}">{ICON_DELETE}</a>
<a href="{modules.U_DELETE}" data-ajax="row_delete">{ICON_DELETE}</a>
</td>
</tr>
<!-- END modules -->

View File

@ -174,7 +174,7 @@
{ICON_MOVE_DOWN_DISABLED}
<!-- ENDIF -->
<a href="{roles.U_EDIT}" title="{L_EDIT_ROLE}">{ICON_EDIT}</a>
<a href="{roles.U_REMOVE}" title="{L_REMOVE_ROLE}">{ICON_DELETE}</a>
<a href="{roles.U_REMOVE}" title="{L_REMOVE_ROLE}" data-ajax="row_delete">{ICON_DELETE}</a>
</td>
</tr>
<!-- END roles -->

View File

@ -195,7 +195,7 @@
<td>{fields.FIELD_IDENT}</td>
<td>{fields.FIELD_TYPE}</td>
<td style="text-align: center;"><a href="{fields.U_ACTIVATE_DEACTIVATE}">{fields.L_ACTIVATE_DEACTIVATE}</a><!-- IF fields.S_NEED_EDIT --> | <a href="{fields.U_TRANSLATE}" style="color: red;">{L_TRANSLATE}</a><!-- ENDIF --></td>
<td style="text-align: center;"><a href="{fields.U_ACTIVATE_DEACTIVATE}" data-ajax="activate_deactivate">{fields.L_ACTIVATE_DEACTIVATE}</a><!-- IF fields.S_NEED_EDIT --> | <a href="{fields.U_TRANSLATE}" style="color: red;">{L_TRANSLATE}</a><!-- ENDIF --></td>
<td style="width: 80px; text-align: right; white-space: nowrap;">
<!-- IF fields.S_FIRST_ROW && not fields.S_LAST_ROW -->
@ -213,7 +213,7 @@
<!-- ELSE -->
{ICON_EDIT_DISABLED}
<!-- ENDIF -->
<a href="{fields.U_DELETE}">{ICON_DELETE}</a>
<a href="{fields.U_DELETE}" data-ajax="row_delete">{ICON_DELETE}</a>
</td>
</tr>

View File

@ -80,7 +80,7 @@
<td style="text-align: center;"><!-- IF ranks.S_RANK_IMAGE --><img src="{ranks.RANK_IMAGE}" alt="{ranks.RANK_TITLE}" title="{ranks.RANK_TITLE}" /><!-- ELSE -->&nbsp; - &nbsp;<!-- ENDIF --></td>
<td style="text-align: center;">{ranks.RANK_TITLE}</td>
<td style="text-align: center;"><!-- IF ranks.S_SPECIAL_RANK -->&nbsp; - &nbsp;<!-- ELSE -->{ranks.MIN_POSTS}<!-- ENDIF --></td>
<td style="text-align: center;"><a href="{ranks.U_EDIT}">{ICON_EDIT}</a> <a href="{ranks.U_DELETE}">{ICON_DELETE}</a></td>
<td style="text-align: center;"><a href="{ranks.U_EDIT}">{ICON_EDIT}</a> <a href="{ranks.U_DELETE}" data-ajax="row_delete">{ICON_DELETE}</a></td>
</tr>
<!-- END ranks -->
</tbody>

View File

@ -99,7 +99,7 @@
<!-- ENDIF -->
<a href="{reasons.U_EDIT}">{ICON_EDIT}</a>
<!-- IF reasons.U_DELETE -->
<a href="{reasons.U_DELETE}">{ICON_DELETE}</a>
<a href="{reasons.U_DELETE}" data-ajax="row_delete">{ICON_DELETE}</a>
<!-- ELSE -->
{ICON_DELETE_DISABLED}
<!-- ENDIF -->

View File

@ -60,7 +60,7 @@
<!-- IF words.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td style="text-align: center;">{words.WORD}</td>
<td style="text-align: center;">{words.REPLACEMENT}</td>
<td>&nbsp;<a href="{words.U_EDIT}">{ICON_EDIT}</a>&nbsp;&nbsp;<a href="{words.U_DELETE}">{ICON_DELETE}</a>&nbsp;</td>
<td>&nbsp;<a href="{words.U_EDIT}">{ICON_EDIT}</a>&nbsp;&nbsp;<a href="{words.U_DELETE}" data-ajax="row_delete">{ICON_DELETE}</a>&nbsp;</td>
</tr>
<!-- BEGINELSE -->
<tr class="row3">

View File

@ -101,6 +101,10 @@ hr {
font-size: 0.85em;
}
.hidden {
display: none;
}
/* General links */
a:link, a:visited {
color: #105289;
@ -1087,6 +1091,56 @@ input.disabled {
color: #666666;
}
/* jQuery popups
---------------------------------------- */
.phpbb_alert {
background-color: #FFFFFF;
border: 1px solid #999999;
position: fixed;
display: none;
top: 100px;
left: 35%;
width: 30%;
z-index: 50;
padding: 25px;
padding: 0 25px 20px 25px;
}
.phpbb_alert .alert_close {
display: block;
float: right;
width: 16px;
height: 16px;
overflow: hidden;
text-decoration: none !important;
background: transparent url("../images/alert_close.png") 0 0 no-repeat;
margin-top: -7px;
margin-right: -31px;
}
.phpbb_alert .alert_close:hover {
background-position: 0 -16px;
}
.phpbb_alert p {
margin: 8px 0;
padding-bottom: 8px;
}
#darkenwrapper {
display: none;
}
#darken {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: #000000;
opacity: 0.5;
}
/* Pagination
---------------------------------------- */
.pagination {

135
phpBB/adm/style/ajax.js Normal file
View File

@ -0,0 +1,135 @@
(function($) { // Avoid conflicts with other libraries
"use strict";
var img_templates = {
up: $('.template-up-img'),
up_disabled: $('.template-up-img-disabled'),
down: $('.template-down-img'),
down_disabled: $('.template-down-img-disabled')
};
/**
* The following callbacks are for reording forums in acp_forums. forum_down
* is triggered when a forum is moved down, and forum_up is triggered when
* a forum is moved up. It moves the row up or down, and deactivates /
* activates any up / down icons that require it (the ones at the top or bottom).
*/
phpbb.add_ajax_callback('forum_down', function() {
var el = $(this),
tr = el.parents('tr');
if (tr.is(':first-child'))
{
var up_img = img_templates.up.clone().attr('href', tr.attr('data-up'));
el.parents('span').siblings('.up').html(up_img);
tr.next().find('.up').html(img_templates.up_disabled);
phpbb.ajaxify({
selector: el.parents('span').siblings('.up').children('a'),
callback: 'forum_up'
});
}
tr.insertAfter(tr.next());
if (tr.is(':last-child'))
{
el.replaceWith(img_templates.down_disabled);
var down_img = img_templates.down.clone().attr('href', tr.attr('data-down'));
tr.prev().find('.down').html(down_img);
phpbb.ajaxify({
selector: tr.prev().find('.down').children('a'),
callback: 'forum_down'
});
}
});
phpbb.add_ajax_callback('forum_up', function() {
var el = $(this),
tr = el.parents('tr');
if (tr.is(':last-child'))
{
var down_img = img_templates.down.clone().attr('href', tr.attr('data-down'));
el.parents('span').siblings('.down').html(down_img);
tr.prev().find('.down').html(img_templates.down_disabled);
phpbb.ajaxify({
selector: el.parents('span').siblings('.down').children('a'),
callback: 'forum_down'
});
}
tr.insertBefore(tr.prev());
if (tr.is(':first-child'))
{
el.replaceWith(img_templates.up_disabled);
var up_img = img_templates.up.clone().attr('href', tr.attr('data-up'));
tr.next().find('.up').html(up_img);
phpbb.ajaxify({
selector: tr.next().find('.up').children('a'),
callback: 'forum_up'
});
}
});
/**
* This callback replaces activate links with deactivate links and vice versa.
* It does this by replacing the text, and replacing all instances of "activate"
* in the href with "deactivate", and vice versa.
*/
phpbb.add_ajax_callback('activate_deactivate', function(res) {
var el = $(this),
new_href = el.attr('href');
el.text(res.text);
if (new_href.indexOf('deactivate') !== -1)
{
new_href = new_href.replace('deactivate', 'activate')
}
else
{
new_href = new_href.replace('activate', 'deactivate')
}
el.attr('href', new_href);
});
/**
* The removes the parent row of the link or form that triggered the callback,
* and is good for stuff like the removal of forums.
*/
phpbb.add_ajax_callback('row_delete', function() {
$(this).parents('tr').remove();
});
$('[data-ajax]').each(function() {
var $this = $(this),
ajax = $this.attr('data-ajax'),
fn;
if (ajax !== 'false')
{
fn = (ajax !== 'true') ? ajax : null;
phpbb.ajaxify({
selector: this,
refresh: $this.attr('data-refresh') !== undefined,
callback: fn
});
}
});
})(jQuery); // Avoid conflicts with other libraries

View File

@ -17,11 +17,29 @@
<!-- IF S_COPYRIGHT_HTML --><br /><!-- ENDIF -->
{DEBUG_OUTPUT}
<!-- ENDIF -->
<div id="darkenwrapper" data-ajax-error-title="{L_AJAX_ERROR_TITLE}" data-ajax-error-text="{L_AJAX_ERROR_TEXT}">
<div id="darken">&nbsp;</div>
<div class="jalert" id="loadingalert"><h3>{L_LOADING}</h3><p>{L_PLEASE_WAIT}</p></div>
</div>
<div id="phpbb_alert" class="phpbb_alert" data-l-err="{L_ERROR}" data-l-timeout-processing-req="{L_TIMEOUT_PROCESSING_REQ}">
<a href="#" class="alert_close"></a>
<h3 class="alert_title"></h3><p class="alert_text"></p>
</div>
<div id="phpbb_confirm" class="phpbb_alert">
<a href="#" class="alert_close"></a>
<p class="alert_text"></p>
<input type="button" class="button1" value="{L_YES}" />&nbsp;
<input type="button" class="button2" value="{L_NO}" />
</div>
</div>
</div>
<script type="text/javascript" src="{T_JQUERY_LINK}"></script>
<!-- IF S_JQUERY_FALLBACK --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.js" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js"></script>
<script type="text/javascript" src="style/ajax.js"></script>
</body>
</html>