You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

apps.js 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647
  1. /* global Handlebars */
  2. Handlebars.registerHelper('score', function() {
  3. if(this.score) {
  4. var score = Math.round( this.score / 10 );
  5. var imageName = 'rating/s' + score + '.svg';
  6. return new Handlebars.SafeString('<img src="' + OC.imagePath('core', imageName) + '">');
  7. }
  8. return new Handlebars.SafeString('');
  9. });
  10. Handlebars.registerHelper('level', function() {
  11. if(typeof this.level !== 'undefined') {
  12. if(this.level === 200) {
  13. return new Handlebars.SafeString('<span class="official icon-checkmark">' + t('settings', 'Official') + '</span>');
  14. } else if(this.level === 100) {
  15. return new Handlebars.SafeString('<span class="approved">' + t('settings', 'Approved') + '</span>');
  16. } else {
  17. return new Handlebars.SafeString('<span class="experimental">' + t('settings', 'Experimental') + '</span>');
  18. }
  19. }
  20. });
  21. OC.Settings = OC.Settings || {};
  22. OC.Settings.Apps = OC.Settings.Apps || {
  23. setupGroupsSelect: function($elements) {
  24. OC.Settings.setupGroupsSelect($elements, {
  25. placeholder: t('core', 'All')
  26. });
  27. },
  28. State: {
  29. currentCategory: null,
  30. apps: null
  31. },
  32. loadCategories: function() {
  33. if (this._loadCategoriesCall) {
  34. this._loadCategoriesCall.abort();
  35. }
  36. var categories = [
  37. {displayName: t('settings', 'Enabled'), ident: 'enabled', id: '0'},
  38. {displayName: t('settings', 'Not enabled'), ident: 'disabled', id: '1'}
  39. ];
  40. var source = $("#categories-template").html();
  41. var template = Handlebars.compile(source);
  42. var html = template(categories);
  43. $('#apps-categories').html(html);
  44. OC.Settings.Apps.loadCategory($('#app-navigation').attr('data-category'));
  45. this._loadCategoriesCall = $.ajax(OC.generateUrl('settings/apps/categories'), {
  46. data:{},
  47. type:'GET',
  48. success:function (jsondata) {
  49. var html = template(jsondata);
  50. $('#apps-categories').html(html);
  51. $('#app-category-' + OC.Settings.Apps.State.currentCategory).addClass('active');
  52. },
  53. complete: function() {
  54. $('#app-navigation').removeClass('icon-loading');
  55. }
  56. });
  57. },
  58. loadCategory: function(categoryId) {
  59. if (OC.Settings.Apps.State.currentCategory === categoryId) {
  60. return;
  61. }
  62. if (this._loadCategoryCall) {
  63. this._loadCategoryCall.abort();
  64. }
  65. $('#apps-list')
  66. .addClass('icon-loading')
  67. .removeClass('hidden')
  68. .html('');
  69. $('#apps-list-empty').addClass('hidden');
  70. $('#app-category-' + OC.Settings.Apps.State.currentCategory).removeClass('active');
  71. $('#app-category-' + categoryId).addClass('active');
  72. OC.Settings.Apps.State.currentCategory = categoryId;
  73. this._loadCategoryCall = $.ajax(OC.generateUrl('settings/apps/list?category={categoryId}&includeUpdateInfo=0', {
  74. categoryId: categoryId
  75. }), {
  76. type:'GET',
  77. success: function (apps) {
  78. var appListWithIndex = _.indexBy(apps.apps, 'id');
  79. OC.Settings.Apps.State.apps = appListWithIndex;
  80. var appList = _.map(appListWithIndex, function(app) {
  81. // default values for missing fields
  82. return _.extend({level: 0}, app);
  83. });
  84. var source = $("#app-template").html();
  85. var template = Handlebars.compile(source);
  86. if (appList.length) {
  87. appList.sort(function(a,b) {
  88. var levelDiff = b.level - a.level;
  89. if (levelDiff === 0) {
  90. return OC.Util.naturalSortCompare(a.name, b.name);
  91. }
  92. return levelDiff;
  93. });
  94. var firstExperimental = false;
  95. _.each(appList, function(app) {
  96. if(app.level === 0 && firstExperimental === false) {
  97. firstExperimental = true;
  98. OC.Settings.Apps.renderApp(app, template, null, true);
  99. } else {
  100. OC.Settings.Apps.renderApp(app, template, null, false);
  101. }
  102. });
  103. } else {
  104. $('#apps-list').addClass('hidden');
  105. $('#apps-list-empty').removeClass('hidden').find('h2').text(t('settings', 'No apps found for your version'));
  106. }
  107. $('.enable.needs-download').tooltip({
  108. title: t('settings', 'The app will be downloaded from the app store'),
  109. placement: 'bottom',
  110. container: 'body'
  111. });
  112. $('.app-level .official').tooltip({
  113. title: t('settings', 'Official apps are developed by and within the community. They offer central functionality and are ready for production use.'),
  114. placement: 'bottom',
  115. container: 'body'
  116. });
  117. $('.app-level .approved').tooltip({
  118. title: t('settings', 'Approved apps are developed by trusted developers and have passed a cursory security check. They are actively maintained in an open code repository and their maintainers deem them to be stable for casual to normal use.'),
  119. placement: 'bottom',
  120. container: 'body'
  121. });
  122. $('.app-level .experimental').tooltip({
  123. title: t('settings', 'This app is not checked for security issues and is new or known to be unstable. Install at your own risk.'),
  124. placement: 'bottom',
  125. container: 'body'
  126. });
  127. },
  128. complete: function() {
  129. var availableUpdates = 0;
  130. $('#apps-list').removeClass('icon-loading');
  131. $.ajax(OC.generateUrl('settings/apps/list?category={categoryId}&includeUpdateInfo=1', {
  132. categoryId: categoryId
  133. }), {
  134. type: 'GET',
  135. success: function (apps) {
  136. _.each(apps.apps, function(app) {
  137. if (app.update) {
  138. var $update = $('#app-' + app.id + ' .update');
  139. $update.removeClass('hidden');
  140. $update.val(t('settings', 'Update to %s').replace(/%s/g, app.update));
  141. availableUpdates++;
  142. OC.Settings.Apps.State.apps[app.id].update = true;
  143. }
  144. });
  145. if (availableUpdates > 0) {
  146. OC.Notification.show(n('settings', 'You have %n app update pending', 'You have %n app updates pending', availableUpdates));
  147. }
  148. }
  149. });
  150. }
  151. });
  152. },
  153. renderApp: function(app, template, selector, firstExperimental) {
  154. if (!template) {
  155. var source = $("#app-template").html();
  156. template = Handlebars.compile(source);
  157. }
  158. if (typeof app === 'string') {
  159. app = OC.Settings.Apps.State.apps[app];
  160. }
  161. app.firstExperimental = firstExperimental;
  162. if (!app.preview) {
  163. app.preview = OC.imagePath('core', 'default-app-icon');
  164. app.previewAsIcon = true;
  165. }
  166. var html = template(app);
  167. if (selector) {
  168. selector.html(html);
  169. } else {
  170. $('#apps-list').append(html);
  171. }
  172. var page = $('#app-' + app.id);
  173. // image loading kung-fu (IE doesn't properly scale SVGs, so disable app icons)
  174. if (app.preview && !OC.Util.isIE()) {
  175. var currentImage = new Image();
  176. currentImage.src = app.preview;
  177. currentImage.onload = function() {
  178. page.find('.app-image')
  179. .append(this)
  180. .fadeIn();
  181. };
  182. }
  183. // set group select properly
  184. if(OC.Settings.Apps.isType(app, 'filesystem') || OC.Settings.Apps.isType(app, 'prelogin') ||
  185. OC.Settings.Apps.isType(app, 'authentication') || OC.Settings.Apps.isType(app, 'logging') ||
  186. OC.Settings.Apps.isType(app, 'prevent_group_restriction')) {
  187. page.find(".groups-enable").hide();
  188. page.find(".groups-enable__checkbox").prop('checked', false);
  189. } else {
  190. page.find('#group_select').val((app.groups || []).join('|'));
  191. if (app.active) {
  192. if (app.groups.length) {
  193. OC.Settings.Apps.setupGroupsSelect(page.find('#group_select'));
  194. page.find(".groups-enable__checkbox").prop('checked', true);
  195. } else {
  196. page.find(".groups-enable__checkbox").prop('checked', false);
  197. }
  198. page.find(".groups-enable").show();
  199. } else {
  200. page.find(".groups-enable").hide();
  201. }
  202. }
  203. },
  204. isType: function(app, type){
  205. return app.types && app.types.indexOf(type) !== -1;
  206. },
  207. /**
  208. * Checks the server health.
  209. *
  210. * If the promise fails, the server is broken.
  211. *
  212. * @return {Promise} promise
  213. */
  214. _checkServerHealth: function() {
  215. return $.get(OC.generateUrl('apps/files'));
  216. },
  217. enableApp:function(appId, active, element, groups) {
  218. var self = this;
  219. OC.Settings.Apps.hideErrorMessage(appId);
  220. groups = groups || [];
  221. var appItem = $('div#app-'+appId+'');
  222. element.val(t('settings','Please wait....'));
  223. if(active && !groups.length) {
  224. $.post(OC.filePath('settings','ajax','disableapp.php'),{appid:appId},function(result) {
  225. if(!result || result.status !== 'success') {
  226. if (result.data && result.data.message) {
  227. OC.Settings.Apps.showErrorMessage(appId, result.data.message);
  228. appItem.data('errormsg', result.data.message);
  229. } else {
  230. OC.Settings.Apps.showErrorMessage(appId, t('settings', 'Error while disabling app'));
  231. appItem.data('errormsg', t('settings', 'Error while disabling app'));
  232. }
  233. element.val(t('settings','Disable'));
  234. appItem.addClass('appwarning');
  235. } else {
  236. OC.Settings.Apps.rebuildNavigation();
  237. appItem.data('active',false);
  238. appItem.data('groups', '');
  239. element.data('active',false);
  240. appItem.removeClass('active');
  241. element.val(t('settings','Enable'));
  242. element.parent().find(".groups-enable").hide();
  243. element.parent().find('#group_select').hide().val(null);
  244. OC.Settings.Apps.State.apps[appId].active = false;
  245. }
  246. },'json');
  247. } else {
  248. // TODO: display message to admin to not refresh the page!
  249. // TODO: lock UI to prevent further operations
  250. $.post(OC.filePath('settings','ajax','enableapp.php'),{appid: appId, groups: groups},function(result) {
  251. if(!result || result.status !== 'success') {
  252. if (result.data && result.data.message) {
  253. OC.Settings.Apps.showErrorMessage(appId, result.data.message);
  254. appItem.data('errormsg', result.data.message);
  255. } else {
  256. OC.Settings.Apps.showErrorMessage(appId, t('settings', 'Error while enabling app'));
  257. appItem.data('errormsg', t('settings', 'Error while disabling app'));
  258. }
  259. element.val(t('settings','Enable'));
  260. appItem.addClass('appwarning');
  261. } else {
  262. self._checkServerHealth().done(function() {
  263. if (result.data.update_required) {
  264. OC.Settings.Apps.showReloadMessage();
  265. setTimeout(function() {
  266. location.reload();
  267. }, 5000);
  268. }
  269. OC.Settings.Apps.rebuildNavigation();
  270. appItem.data('active',true);
  271. element.data('active',true);
  272. appItem.addClass('active');
  273. element.val(t('settings','Disable'));
  274. var app = OC.Settings.Apps.State.apps[appId];
  275. app.active = true;
  276. if (OC.Settings.Apps.isType(app, 'filesystem') || OC.Settings.Apps.isType(app, 'prelogin') ||
  277. OC.Settings.Apps.isType(app, 'authentication') || OC.Settings.Apps.isType(app, 'logging')) {
  278. element.parent().find(".groups-enable").prop('checked', true);
  279. element.parent().find(".groups-enable").hide();
  280. element.parent().find('#group_select').hide().val(null);
  281. } else {
  282. element.parent().find("#groups-enable").show();
  283. if (groups) {
  284. appItem.data('groups', JSON.stringify(groups));
  285. } else {
  286. appItem.data('groups', '');
  287. }
  288. }
  289. }).fail(function() {
  290. // server borked, emergency disable app
  291. $.post(OC.webroot + '/index.php/disableapp', {appid: appId}, function() {
  292. OC.Settings.Apps.showErrorMessage(
  293. appId,
  294. t('settings', 'Error: this app cannot be enabled because it makes the server unstable')
  295. );
  296. appItem.data('errormsg', t('settings', 'Error while enabling app'));
  297. element.val(t('settings','Enable'));
  298. appItem.addClass('appwarning');
  299. }).fail(function() {
  300. OC.Settings.Apps.showErrorMessage(
  301. appId,
  302. t('settings', 'Error: could not disable broken app')
  303. );
  304. appItem.data('errormsg', t('settings', 'Error while disabling broken app'));
  305. element.val(t('settings','Enable'));
  306. });
  307. });
  308. }
  309. },'json')
  310. .fail(function() {
  311. OC.Settings.Apps.showErrorMessage(appId, t('settings', 'Error while enabling app'));
  312. appItem.data('errormsg', t('settings', 'Error while enabling app'));
  313. appItem.data('active',false);
  314. appItem.addClass('appwarning');
  315. element.val(t('settings','Enable'));
  316. });
  317. }
  318. },
  319. updateApp:function(appId, element) {
  320. var oldButtonText = element.val();
  321. element.val(t('settings','Updating....'));
  322. OC.Settings.Apps.hideErrorMessage(appId);
  323. $.post(OC.filePath('settings','ajax','updateapp.php'),{appid:appId},function(result) {
  324. if(!result || result.status !== 'success') {
  325. if (result.data && result.data.message) {
  326. OC.Settings.Apps.showErrorMessage(appId, result.data.message);
  327. } else {
  328. OC.Settings.Apps.showErrorMessage(appId, t('settings','Error while updating app'));
  329. }
  330. element.val(oldButtonText);
  331. }
  332. else {
  333. element.val(t('settings','Updated'));
  334. element.hide();
  335. }
  336. },'json');
  337. },
  338. uninstallApp:function(appId, element) {
  339. OC.Settings.Apps.hideErrorMessage(appId);
  340. element.val(t('settings','Uninstalling ....'));
  341. $.post(OC.filePath('settings','ajax','uninstallapp.php'),{appid:appId},function(result) {
  342. if(!result || result.status !== 'success') {
  343. OC.Settings.Apps.showErrorMessage(appId, t('settings','Error while uninstalling app'));
  344. element.val(t('settings','Uninstall'));
  345. } else {
  346. OC.Settings.Apps.rebuildNavigation();
  347. element.parent().fadeOut(function() {
  348. element.remove();
  349. });
  350. }
  351. },'json');
  352. },
  353. rebuildNavigation: function() {
  354. $.getJSON(OC.filePath('settings', 'ajax', 'navigationdetect.php')).done(function(response){
  355. if(response.status === 'success'){
  356. var idsToKeep = {};
  357. var navEntries=response.nav_entries;
  358. var container = $('#apps ul');
  359. for(var i=0; i< navEntries.length; i++){
  360. var entry = navEntries[i];
  361. idsToKeep[entry.id] = true;
  362. if(container.children('li[data-id="'+entry.id+'"]').length === 0){
  363. var li=$('<li></li>');
  364. li.attr('data-id', entry.id);
  365. var img = '<svg width="32" height="32" viewBox="0 0 32 32">';
  366. img += '<defs><filter id="invert"><feColorMatrix in="SourceGraphic" type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" /></filter></defs>';
  367. img += '<image x="0" y="0" width="32" height="32" preserveAspectRatio="xMinYMin meet" filter="url(#invert)" xlink:href="' + entry.icon + '" class="app-icon" /></svg>';
  368. var a=$('<a></a>').attr('href', entry.href);
  369. var filename=$('<span></span>');
  370. var loading = $('<div class="icon-loading-dark"></div>').css('display', 'none');
  371. filename.text(entry.name);
  372. a.prepend(filename);
  373. a.prepend(loading);
  374. a.prepend(img);
  375. li.append(a);
  376. // append the new app as last item in the list
  377. // which is the "add apps" entry with the id
  378. // #apps-management
  379. $('#apps-management').before(li);
  380. // scroll the app navigation down
  381. // so the newly added app is seen
  382. $('#navigation').animate({
  383. scrollTop: $('#navigation').height()
  384. }, 'slow');
  385. // draw attention to the newly added app entry
  386. // by flashing it twice
  387. $('#header .menutoggle')
  388. .animate({opacity: 0.5})
  389. .animate({opacity: 1})
  390. .animate({opacity: 0.5})
  391. .animate({opacity: 1})
  392. .animate({opacity: 0.75});
  393. }
  394. }
  395. container.children('li[data-id]').each(function(index, el) {
  396. if (!idsToKeep[$(el).data('id')]) {
  397. $(el).remove();
  398. }
  399. });
  400. }
  401. });
  402. },
  403. showErrorMessage: function(appId, message) {
  404. $('div#app-'+appId+' .warning')
  405. .show()
  406. .text(message);
  407. },
  408. hideErrorMessage: function(appId) {
  409. $('div#app-'+appId+' .warning')
  410. .hide()
  411. .text('');
  412. },
  413. showReloadMessage: function() {
  414. OC.dialogs.info(
  415. t(
  416. 'settings',
  417. 'The app has been enabled but needs to be updated. You will be redirected to the update page in 5 seconds.'
  418. ),
  419. t('settings','App update'),
  420. function () {
  421. window.location.reload();
  422. },
  423. true
  424. );
  425. },
  426. filter: function(query) {
  427. var $appList = $('#apps-list'),
  428. $emptyList = $('#apps-list-empty');
  429. $appList.removeClass('hidden');
  430. $appList.find('.section').removeClass('hidden');
  431. $emptyList.addClass('hidden');
  432. if (query === '') {
  433. return;
  434. }
  435. query = query.toLowerCase();
  436. $appList.find('.section').addClass('hidden');
  437. // App Name
  438. var apps = _.filter(OC.Settings.Apps.State.apps, function (app) {
  439. return app.name.toLowerCase().indexOf(query) !== -1;
  440. });
  441. // App ID
  442. apps = apps.concat(_.filter(OC.Settings.Apps.State.apps, function (app) {
  443. return app.id.toLowerCase().indexOf(query) !== -1;
  444. }));
  445. // App Description
  446. apps = apps.concat(_.filter(OC.Settings.Apps.State.apps, function (app) {
  447. return app.description.toLowerCase().indexOf(query) !== -1;
  448. }));
  449. // Author Name
  450. apps = apps.concat(_.filter(OC.Settings.Apps.State.apps, function (app) {
  451. return app.author.toLowerCase().indexOf(query) !== -1;
  452. }));
  453. // App status
  454. if (t('settings', 'Official').toLowerCase().indexOf(query) !== -1) {
  455. apps = apps.concat(_.filter(OC.Settings.Apps.State.apps, function (app) {
  456. return app.level === 200;
  457. }));
  458. }
  459. if (t('settings', 'Approved').toLowerCase().indexOf(query) !== -1) {
  460. apps = apps.concat(_.filter(OC.Settings.Apps.State.apps, function (app) {
  461. return app.level === 100;
  462. }));
  463. }
  464. if (t('settings', 'Experimental').toLowerCase().indexOf(query) !== -1) {
  465. apps = apps.concat(_.filter(OC.Settings.Apps.State.apps, function (app) {
  466. return app.level !== 100 && app.level !== 200;
  467. }));
  468. }
  469. apps = _.uniq(apps, function(app){return app.id;});
  470. if (apps.length === 0) {
  471. $appList.addClass('hidden');
  472. $emptyList.removeClass('hidden');
  473. $emptyList.removeClass('hidden').find('h2').text(t('settings', 'No apps found for {query}', {
  474. query: query
  475. }));
  476. } else {
  477. _.each(apps, function (app) {
  478. $('#app-' + app.id).removeClass('hidden');
  479. });
  480. $('#searchresults').hide();
  481. }
  482. },
  483. _onPopState: function(params) {
  484. params = _.extend({
  485. category: 'enabled'
  486. }, params);
  487. OC.Settings.Apps.loadCategory(params.category);
  488. },
  489. /**
  490. * Initializes the apps list
  491. */
  492. initialize: function($el) {
  493. OC.Plugins.register('OCA.Search', OC.Settings.Apps.Search);
  494. OC.Settings.Apps.loadCategories();
  495. OC.Util.History.addOnPopStateHandler(_.bind(this._onPopState, this));
  496. $(document).on('click', 'ul#apps-categories li', function () {
  497. var categoryId = $(this).data('categoryId');
  498. OC.Settings.Apps.loadCategory(categoryId);
  499. OC.Util.History.pushState({
  500. category: categoryId
  501. });
  502. $('#searchbox').val('');
  503. });
  504. $(document).on('click', '.app-description-toggle-show', function () {
  505. $(this).addClass('hidden');
  506. $(this).siblings('.app-description-toggle-hide').removeClass('hidden');
  507. $(this).siblings('.app-description-container').slideDown();
  508. });
  509. $(document).on('click', '.app-description-toggle-hide', function () {
  510. $(this).addClass('hidden');
  511. $(this).siblings('.app-description-toggle-show').removeClass('hidden');
  512. $(this).siblings('.app-description-container').slideUp();
  513. });
  514. $(document).on('click', '#apps-list input.enable', function () {
  515. var appId = $(this).data('appid');
  516. var element = $(this);
  517. var active = $(this).data('active');
  518. OC.Settings.Apps.enableApp(appId, active, element);
  519. });
  520. $(document).on('click', '#apps-list input.uninstall', function () {
  521. var appId = $(this).data('appid');
  522. var element = $(this);
  523. OC.Settings.Apps.uninstallApp(appId, element);
  524. });
  525. $(document).on('click', '#apps-list input.update', function () {
  526. var appId = $(this).data('appid');
  527. var element = $(this);
  528. OC.Settings.Apps.updateApp(appId, element);
  529. });
  530. $(document).on('change', '#group_select', function() {
  531. var element = $(this).parent().find('input.enable');
  532. var groups = $(this).val();
  533. if (groups && groups !== '') {
  534. groups = groups.split('|');
  535. } else {
  536. groups = [];
  537. }
  538. var appId = element.data('appid');
  539. if (appId) {
  540. OC.Settings.Apps.enableApp(appId, false, element, groups);
  541. OC.Settings.Apps.State.apps[appId].groups = groups;
  542. }
  543. });
  544. $(document).on('change', ".groups-enable__checkbox", function() {
  545. var $select = $(this).closest('.section').find('#group_select');
  546. $select.val('');
  547. if (this.checked) {
  548. OC.Settings.Apps.setupGroupsSelect($select);
  549. } else {
  550. $select.select2('destroy');
  551. }
  552. $select.change();
  553. });
  554. $(document).on('click', '#enable-experimental-apps', function () {
  555. var state = $(this).prop('checked');
  556. $.ajax(OC.generateUrl('settings/apps/experimental'), {
  557. data: {state: state},
  558. type: 'POST',
  559. success:function () {
  560. location.reload();
  561. }
  562. });
  563. });
  564. }
  565. };
  566. OC.Settings.Apps.Search = {
  567. attach: function (search) {
  568. search.setFilter('settings', OC.Settings.Apps.filter);
  569. }
  570. };
  571. $(document).ready(function () {
  572. // HACK: FIXME: use plugin approach
  573. if (!window.TESTING) {
  574. OC.Settings.Apps.initialize($('#apps-list'));
  575. }
  576. });