[ Index ] |
PHP Cross Reference of vtigercrm-6.1.0 |
[Summary view] [Print] [Text view]
1 /*+*********************************************************************************** 2 * The contents of this file are subject to the vtiger CRM Public License Version 1.0 3 * ("License"); You may not use this file except in compliance with the License 4 * The Original Code is: vtiger CRM Open Source 5 * The Initial Developer of the Original Code is vtiger. 6 * Portions created by vtiger are Copyright (C) vtiger. 7 * All Rights Reserved. 8 *************************************************************************************/ 9 jQuery.Class('Settings_ModuleManager_ExtensionStore_Js', { 10 }, { 11 12 /** 13 * Function to get import module step1 params 14 */ 15 getExtensionStoreStep1Params : function(){ 16 var params = { 17 'module' : app.getModuleName(), 18 'parent' : app.getParentModuleName(), 19 'view' : 'ExtensionStore', 20 }; 21 return params; 22 }, 23 24 /** 25 * Function to register raty 26 */ 27 registerRaty : function() { 28 jQuery('.rating').raty({ 29 score: function() { 30 return this.getAttribute('data-score'); 31 }, 32 readOnly: function() { 33 return this.getAttribute('data-readonly'); 34 } 35 }); 36 }, 37 38 /** 39 * Function to get import module with respect to view 40 */ 41 getImportModuleStepView : function(params){ 42 var aDeferred = jQuery.Deferred(); 43 var progressIndicatorElement = jQuery.progressIndicator({ 44 'position' : 'html', 45 'blockInfo' : { 46 'enabled' : true 47 } 48 }); 49 50 AppConnector.request(params).then( 51 function(data) { 52 progressIndicatorElement.progressIndicator({'mode' : 'hide'}); 53 aDeferred.resolve(data); 54 }, 55 function(error) { 56 progressIndicatorElement.progressIndicator({'mode' : 'hide'}); 57 aDeferred.reject(error); 58 } 59 ); 60 return aDeferred.promise(); 61 }, 62 63 registerEventsForStep1 : function(container){ 64 var thisInstance = this; 65 jQuery(container).on('keydown','#searchExtension',function(e){ 66 var currentTarget = jQuery(e.currentTarget); 67 var code = e.keyCode; 68 if(code == 13){ 69 var searchTerm = currentTarget.val(); 70 71 var params = { 72 'module' : app.getModuleName(), 73 'parent' : app.getParentModuleName(), 74 'view' : 'ExtensionStore', 75 'mode' : 'searchExtension', 76 'searchTerm' : searchTerm 77 }; 78 79 var progressIndicatorElement = jQuery.progressIndicator({ 80 'position' : 'html', 81 'blockInfo' : { 82 'enabled' : true 83 } 84 }); 85 AppConnector.request(params).then( 86 function(data) { 87 jQuery('#extensionContainer').html(data); 88 thisInstance.registerRaty(); 89 progressIndicatorElement.progressIndicator({'mode' : 'hide'}); 90 }, 91 function(error) { 92 progressIndicatorElement.progressIndicator({'mode' : 'hide'}); 93 } 94 ); 95 } 96 }); 97 98 jQuery(container).on('click','.extensionDetails', function(e){ 99 var element = jQuery(e.currentTarget); 100 var extensionContainer = element.closest('.extension_container'); 101 var extensionId = extensionContainer.find('[name="extensionId"]').val(); 102 var moduleAction = extensionContainer.find('[name="moduleAction"]').val(); 103 var extensionName = extensionContainer.find('[name="extensionName"]').val(); 104 var params = { 105 'module' : app.getModuleName(), 106 'parent' : app.getParentModuleName(), 107 'view' : 'ExtensionStore', 108 'mode' : 'extensionDetail', 109 'extensionId' : extensionId, 110 'moduleAction' : moduleAction, 111 'extensionName' : extensionName 112 }; 113 thisInstance.getImportModuleStepView(params).then(function(data){ 114 var detailContentsHolder = jQuery('.contentsDiv'); 115 detailContentsHolder.html(data); 116 thisInstance.registerEventsForImportModuleStep2(detailContentsHolder); 117 }); 118 }); 119 120 jQuery(container).on('click','#installLoader', function(e){ 121 console.log('install loader click'); 122 var extensionLoaderModal = jQuery(container).find('.extensionLoader').clone(true, true); 123 extensionLoaderModal.removeClass('hide'); 124 125 var callBackFunction = function(data) { 126 127 }; 128 app.showModalWindow(extensionLoaderModal,function(data) { 129 if(typeof callBackFunction == 'function') { 130 callBackFunction(data); 131 } 132 }, {'width':'1000px'}); 133 }); 134 }, 135 136 /** 137 * Function to register event related to Import extrension Modules in step2 138 */ 139 registerEventsForImportModuleStep2 : function(container){ 140 var thisInstance = this; 141 var container = jQuery(container); 142 app.showScrollBar(jQuery('div.scrollableTab'), {'width': '100%', 'height':'400px'}); 143 this.registerRaty(); 144 slider = jQuery('#imageSlider').bxSlider({ 145 auto: true, 146 pause: 1000, 147 randomStart : true, 148 autoHover: true 149 }); 150 jQuery("#screenShots").on('click',function() { 151 slider.reloadSlider(); 152 }); 153 154 container.find('#declineExtension').on('click',function(){ 155 var params = thisInstance.getExtensionStoreStep1Params(); 156 thisInstance.getImportModuleStepView(params).then(function(data){ 157 var detailContentsHolder = jQuery('.contentsDiv'); 158 detailContentsHolder.html(data); 159 thisInstance.registerEventForStep1(); 160 }); 161 }); 162 }, 163 164 /** 165 * Function to register event for step1 of import module 166 */ 167 registerEventForStep1 : function(){ 168 this.registerRaty(); 169 var detailContentsHolder = jQuery('.contentsDiv'); 170 app.showScrollBar(jQuery('.extensionDescription'), {'height':'120px','width':'100%','railVisible': true}); 171 this.registerEventsForStep1(detailContentsHolder); 172 }, 173 174 registerEvents : function(){ 175 this.registerEventForStep1(); 176 } 177 });
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 20:08:37 2014 | Cross-referenced by PHPXref 0.7.1 |