/* * Copyright (c) Codiad & daeks (codiad.com), and Isaac Brown (telaaedifex.com), distributed * as-is and without warranty under the MIT License. See * [root]/license.txt for more. This information must remain intact. */ ( function( global, $ ) { let codiad = global.codiad; $( function() { codiad.market.init(); }); codiad.market = { controller: 'components/market/controller.php', dialog: 'components/market/dialog.php', plugins: [], themes: [], init: function() {}, get_all: function() {}, get_installed_plugins: function() {}, get_installed_themes: function() {}, get_plugins: function() {}, get_themes: function() {}, install: function() {}, search: function() {}, uninstall: function() {}, update: function() {}, }; })( this, jQuery ); /* ////////////////////////////////////////////////////////////////// // Open marketplace ////////////////////////////////////////////////////////////////// list: function(type, note) { $('#modal-content form') .die('submit'); // Prevent form bubbling codiad.modal.load(800, this.dialog + '?action=list&type='+type+'¬e='+note); }, ////////////////////////////////////////////////////////////////// // Search marketplace ////////////////////////////////////////////////////////////////// search: function(e, query, note) { $('#modal-content form') .die('submit'); // Prevent form bubbling var key= e.charCode || e.keyCode || e.which; if(query != '' && key==13) { codiad.modal.load(800, this.dialog + '?action=list¬e=' + note + '&type=undefined&query='+query); } }, openInBrowser: function(path) { window.open(path, '_newtab'); }, ////////////////////////////////////////////////////////////////// // Install ////////////////////////////////////////////////////////////////// install: function(page, type, name, repo) { var _this = this; if(repo != '') { $('#modal-content').html('