Convert last uses of `WCF.Action.Toggle` to `Ui/Action/Toggle`
authorMatthias Schmidt <gravatronics@live.com>
Sun, 21 Mar 2021 08:33:51 +0000 (09:33 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 21 Mar 2021 09:21:40 +0000 (10:21 +0100)
wcfsetup/install/files/acp/templates/categoryList.tpl
wcfsetup/install/files/acp/templates/paidSubscriptionList.tpl
wcfsetup/install/files/acp/templates/reactionTypeList.tpl
wcfsetup/install/files/acp/templates/styleList.tpl

index 45a823ebf9b0720018f3edfd0ef94dd9093dc48f..31f89aedf077ccd54aa2b7d1612cb17d7af1c61e 100644 (file)
@@ -11,8 +11,6 @@
                                new WCF.Action.NestedDelete('wcf\\data\\category\\CategoryAction', '.jsCategory');
                        {/if}
                        {if $objectType->getProcessor()->canEditCategory()}
-                               new WCF.Action.Toggle('wcf\\data\\category\\CategoryAction', '.jsCategory', '> .sortableNodeLabel > .buttons > .jsToggleButton');
-                               
                                var sortableNodes = $('.sortableNode');
                                sortableNodes.each(function(index, node) {
                                        $(node).wcfIdentify();
 
 {hascontent}
        <div id="categoryList" class="section{if $objectType->getProcessor()->canEditCategory()} sortableListContainer{/if}">
-               <ol class="categoryList sortableList" data-object-id="0">
+               <ol class="categoryList sortableList jsObjectActionContainer" data-object-action-class-name="wcf\data\category\CategoryAction" data-object-id="0">
                        {content}
                                {assign var=oldDepth value=0}
                                {foreach from=$categoryNodeList item='category'}
                                        {section name=i loop=$oldDepth-$categoryNodeList->getDepth()}</ol></li>{/section}
                                        
-                                       <li class="{if $objectType->getProcessor()->canEditCategory()}sortableNode {if $categoryNodeList->getDepth() == $objectType->getProcessor()->getMaximumNestingLevel()}sortableNoNesting {/if}{/if}jsCategory" data-object-id="{@$category->categoryID}"{if $collapsedCategoryIDs|is_array} data-is-open="{if $collapsedCategoryIDs[$category->categoryID]|isset}0{else}1{/if}"{/if}>
+                                       <li class="{if $objectType->getProcessor()->canEditCategory()}sortableNode {if $categoryNodeList->getDepth() == $objectType->getProcessor()->getMaximumNestingLevel()}sortableNoNesting {/if}{/if}jsCategory jsObjectActionObject" data-object-id="{@$category->getObjectID()}"{if $collapsedCategoryIDs|is_array} data-is-open="{if $collapsedCategoryIDs[$category->categoryID]|isset}0{else}1{/if}"{/if}>
                                                <span class="sortableNodeLabel">
                                                        <span class="title">
                                                                {event name='beforeTitle'}
                                                                <span class="icon icon16 fa-arrows sortableNodeHandle"></span>
                                                                
                                                                {if $objectType->getProcessor()->canEditCategory()}
-                                                                       <span class="icon icon16 fa-{if !$category->isDisabled}check-{/if}square-o jsToggleButton jsTooltip pointer" title="{lang}wcf.global.button.{if !$category->isDisabled}disable{else}enable{/if}{/lang}" data-object-id="{@$category->categoryID}"></span>
+                                                                       {objectAction action="toggle" isDisabled=$category->isDisabled}
                                                                        <a href="{link controller=$editController application=$objectType->getProcessor()->getApplication() id=$category->categoryID title=$category->getTitle()}{/link}" title="{lang}wcf.global.button.edit{/lang}" class="jsTooltip"><span class="icon icon16 fa-pencil"></span></a>
                                                                {/if}
                                                                
index 40d3008870fface58391f88321b263fafc94de61..5188fc46f6b26302ebd6f52eebcd1fdd2dea169c 100644 (file)
@@ -1,12 +1,5 @@
 {include file='header' pageTitle='wcf.acp.paidSubscription.list'}
 
-<script data-relocate="true">
-       $(function() {
-               new WCF.Action.Delete('wcf\\data\\paid\\subscription\\PaidSubscriptionAction', '.jsPaidSubscriptionRow');
-               new WCF.Action.Toggle('wcf\\data\\paid\\subscription\\PaidSubscriptionAction', '.jsPaidSubscriptionRow');
-       });
-</script>
-
 <header class="contentHeader">
        <div class="contentHeaderTitle">
                <h1 class="contentTitle">{lang}wcf.acp.paidSubscription.list{/lang}{if $items} <span class="badge badgeInverse">{#$items}</span>{/if}</h1>
index 90fb7742dd4067c1126d725456d6323922b03208..c087c1938d681107619ff43f38498ae23cf1c999 100644 (file)
@@ -9,10 +9,6 @@
                                offset: {@$startIndex}
                        });
                });
-               
-               $(function() {
-                       new WCF.Action.Toggle('wcf\\data\\reaction\\type\\ReactionTypeAction', '.reactionTypeRow');
-               });
        </script>
 {/if}
 
                                                
                                                <span class="statusDisplay sortableButtonContainer">
                                                        <span class="icon icon16 fa-arrows sortableNodeHandle"></span>
-                                                       <span class="jsOnly icon icon16 fa-{if $reactionType->isAssignable}check-{/if}square-o jsToggleButton jsTooltip pointer" title="{lang}wcf.acp.reactionType.is{if !$reactionType->isAssignable}Not{/if}Assignable{/lang}" data-disable-title="{lang}wcf.acp.reactionType.isAssignable{/lang}" data-enable-title="{lang}wcf.acp.reactionType.isNotAssignable{/lang}" data-object-id="{@$reactionType->reactionTypeID}"></span>
+                                                       {assign var='reactionTypeIsDisabled' value=true}
+                                                       {if $reactionType->isAssignable}
+                                                               {assign var='reactionTypeIsDisabled' value=false}
+                                                       {/if}
+                                                       {objectAction action="toggle" isDisabled=$reactionTypeIsDisabled disableTitle='wcf.acp.reactionType.isAssignable' enableTitle='wcf.acp.reactionType.isNotAssignable'}
                                                        <a href="{link controller='ReactionTypeEdit' id=$reactionType->reactionTypeID}{/link}"><span title="{lang}wcf.global.button.edit{/lang}" class="jsTooltip icon icon16 fa-pencil"></span></a>
                                                        {objectAction action="delete" objectTitle=$reactionType->getTitle()}
                                                        
index e16e8377e1d37ece6be99e4af6f641e94dfe8501..6ac198e9a757ba12de4b896e9774d3785f9ebc79 100644 (file)
@@ -3,7 +3,6 @@
 <script data-relocate="true" src="{@$__wcf->getPath()}acp/js/WCF.ACP.Style.js?v={@LAST_UPDATE_TIME}"></script>
 <script data-relocate="true">
        $(function() {
-               new WCF.Action.Toggle('wcf\\data\\style\\StyleAction', '.buttonList');
                new WCF.ACP.Style.List();
        });
 </script>
@@ -30,9 +29,9 @@
 {/hascontent}
 
 <div class="section sectionContainerList">
-       <ol class="containerList styleList">
+       <ol class="containerList styleList jsObjectActionContainer" data-object-action-class-name="wcf\data\style\StyleAction">
                {foreach from=$objects item=style}
-                       <li>
+                       <li class="jsObjectActionObject" data-object-id="{@$style->getObjectID()}">
                                <div class="box64">
                                        <span>
                                                <img src="{@$style->getPreviewImage()}" srcset="{@$style->getPreviewImage2x()} 2x" height="64" alt="">
@@ -60,7 +59,7 @@
                                                                <li><a href="{link controller='StyleExport' id=$style->styleID}{/link}" title="{lang}wcf.acp.style.exportStyle{/lang}" class="jsTooltip"><span class="icon icon16 fa-download"></span> <span class="invisible">{lang}wcf.acp.style.exportStyle{/lang}</span></a></li>
                                                                
                                                                {if !$style->isDefault}
-                                                                       <li><a href="#" title="{lang}wcf.global.button.{if $style->isDisabled}enable{else}disable{/if}{/lang}" class="jsTooltip"><span class="icon icon16 fa-{if !$style->isDisabled}check-{/if}square-o jsToggleButton" data-object-id="{@$style->styleID}"></span> <span class="invisible">{lang}wcf.global.button.{if $style->isDisabled}enable{else}disable{/if}{/lang}</span></a></li>
+                                                                       <li><a href="#" title="{lang}wcf.global.button.{if $style->isDisabled}enable{else}disable{/if}{/lang}" class="jsTooltip"><span class="icon icon16 fa-{if !$style->isDisabled}check-{/if}square-o jsObjectAction" data-object-action="toggle"></span> <span class="invisible">{lang}wcf.global.button.{if $style->isDisabled}enable{else}disable{/if}{/lang}</span></a></li>
                                                                        <li><a href="#" title="{lang}wcf.acp.style.button.setAsDefault{/lang}" class="jsSetAsDefault jsTooltip"><span class="icon icon16 fa-check-circle"></span> <span class="invisible">{lang}wcf.acp.style.button.setAsDefault{/lang}</span></a></li>
                                                                        <li><a href="#" title="{lang}wcf.global.button.delete{/lang}" class="jsDelete jsTooltip" data-confirm-message-html="{lang __encode=true}wcf.acp.style.delete.confirmMessage{/lang}"><span class="icon icon16 fa-times"></span> <span class="invisible">{lang}wcf.global.button.delete{/lang}</span></a></li>
                                                                {/if}