<
Depuis la version < 2.1 >
modifié par superadmin
sur 2021/12/12 21:55
À la version < 3.1 >
modifié par superadmin
sur 2022/01/01 16:06
>
Commentaire de modification : Install extension [com.xwiki.licensing:application-licensing-licensor-ui/1.20]

Résumé

Détails

Icon XWiki.JavaScriptExtension[0]
Code
... ... @@ -48,6 +48,12 @@
48 48   new XWiki.Document('UpdateOwnerDetails', 'Licenses.Code').getURL('get', 'outputSyntax=plain'),
49 49   data
50 50   );
51 + },
52 + modifyAutoUpgradesBlocklist: function(data) {
53 + return $.post(
54 + new XWiki.Document('UpdateAutomaticUpgradesBlocklist', 'Licenses.Code').getURL('get', 'outputSyntax=plain'),
55 + data
56 + );
51 51   }
52 52   };
53 53  });
... ... @@ -131,6 +131,18 @@
131 131   });
132 132   };
133 133  
140 + // An extensionId could have multiple rows in the livetable if is installed on multiple subwikis, but the blocklist
141 + // is applied to all namespaces.
142 + var updateExtensionOfOtherWikis = function(extensionId, isChecked) {
143 + var similarExtensions = $("input[name='extensionId'][value='" + extensionId + "']");
144 + similarExtensions.each(function() {
145 + var checkbox = $(this).siblings("input[type='checkbox']");
146 + if (checkbox.prop('checked') != isChecked) {
147 + checkbox.prop('checked', isChecked);
148 + }
149 + });
150 + };
151 +
134 134   // xwiki:livetable:displayComplete might be triggered before the code from this jsx is executed. In this case, the
135 135   // livetable is also loaded before, because it is using Prototype.js which is loading before the page loads.
136 136   // Make sure that the livetable is loaded by checking for a row with some data.
... ... @@ -146,16 +146,7 @@
146 146   reloadTimeoutId = setTimeout(function() {
147 147   if ($.type(window.livetable_licenseManager) !== 'undefined') {
148 148   // Reload the livetable.
149 - if ($.type(livetable_licenseManager.refresh) === 'function') {
150 - // Available only for XWiki version >= 9.5RC1.
151 - livetable_licenseManager.refresh();
152 - } else {
153 - // This branch should be removed when the licensing app will use XWiki >= 9.5RC1.
154 - var end = livetable_licenseManager.limit;
155 - var start = Math.max(livetable_licenseManager.lastOffset, 1);
156 - livetable_licenseManager.clearCache();
157 - livetable_licenseManager.getRows(start, end, start, end);
158 - }
167 + livetable_licenseManager.refresh();
159 159   }
160 160   }, 0);
161 161   });
... ... @@ -249,6 +249,20 @@
249 249   });
250 250   });
251 251  
261 + $('input[name=autoUpgrade]').click(function() {
262 + var autoUpgradeForm = $(this).parent('form').serializeArray();
263 + licensor.modifyAutoUpgradesBlocklist(autoUpgradeForm).success(function(data) {
264 + if(data.isAutoUpgrade) {
265 + new XWiki.widgets.Notification(
266 + $jsontool.serialize($services.localization.render('licensor.moreActions.autoUpgrade.added')), 'done');
267 + } else {
268 + new XWiki.widgets.Notification(
269 + $jsontool.serialize($services.localization.render('licensor.moreActions.autoUpgrade.removed')), 'done');
270 + }
271 + updateExtensionOfOtherWikis(data.extensionId, !data.isAutoUpgrade);
272 + });
273 + });
274 +
252 252   // Set the documentation links to open in new tab.
253 253   $('#licenseManager-display td.name a').each(function() {
254 254   $(this).attr('target', '_blank')
Icon XWiki.StyleSheetExtension[0]
Code
... ... @@ -14,3 +14,9 @@
14 14   border: 1px solid #ccc;
15 15   border-radius: 4px;
16 16  }
17 +
18 +/* .dropleft to be used after moving to Bootstrap 4 */
19 +.dropdown-left {
20 + right: 0;
21 + left: auto;
22 +}
This wiki is licensed under a Creative Commons 2.0 license
XWiki 13.10 - Documentation - Conditions