/* * Copyright (c) Codiad & daeks (codiad.com), distributed * as-is and without warranty under the MIT License. See * [root]/license.txt for more. This information must remain intact. */ (function(global, $){ var codiad = global.codiad; $(function() { codiad.market.init(); }); codiad.market = { controller: 'components/market/controller.php', dialog: 'components/market/dialog.php', init: function() { }, ////////////////////////////////////////////////////////////////// // 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('