Issue 2304 : Now, multiple selection is possible and problem with single module selection in widget code generation page is fixed

git-svn-id: http://xe-core.googlecode.com/svn/branches/luminous@11132 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
nagoon97 2012-09-02 14:17:40 +00:00
parent 47a05c9259
commit 19f6f31085
7 changed files with 134 additions and 973 deletions

View file

@ -13,7 +13,7 @@ xe.MidManager = xe.createApp("MidManager", {
return false;
});
$keyObj.siblings('button.delete').bind('click', function(){
$keyObj.parent().find('button.delete,a.delete').bind('click', function(){
$keyObj.val('').next().val('');
return false;
});
@ -24,6 +24,13 @@ xe.MidManager = xe.createApp("MidManager", {
$finder.slideUp(100);
return false;
});
jQuery(function($){
$('.moduleSearch').bind('moduleSelect', function(e, aSelected){
self.cast('MID_SYNC_NEW', aSelected);
});
});
},
API_MID_SYNC: function(){
@ -43,6 +50,27 @@ xe.MidManager = xe.createApp("MidManager", {
self.$keyObj.next().val(data.module_list[0].browser_title+' ('+data.module_list[0].mid+', '+data.module_list[0].module_name+')');
}
$.exec_json('module.getModuleAdminModuleList', {'module_srls': module_srl}, on_complete);
},
API_MID_SYNC_NEW: function(htBase, aParam){
var self = this;
htSelected = aParam[0];
var module_srl = htSelected.module_srl;
if (!module_srl) return;
function on_complete(data){
if (data.error){
alert(data.message);
return;
}
self.$keyObj.val(data.module_list[0].module_srl);
self.$keyObj.next().val(data.module_list[0].browser_title+' ('+data.module_list[0].mid+', '+data.module_list[0].module_name+')');
}
$.exec_json('module.getModuleAdminModuleList', {'module_srls': module_srl}, on_complete);
}
});

View file

@ -118,8 +118,15 @@
<script>
jQuery(function($){
$('.moduleSearch1').bind('moduleSelect', function(e, sType, sName, sSrl){
xe.broadcast("ADD_MODULE_TO_MODULELIST_MANAGER", [sType, sName, sSrl]);
$('.moduleSearch1').bind('moduleSelect', function(e, aSelected){
var sType, sName, sSrl;
for(var i=0, nLen=aSelected.length; i<nLen; i++){
sType = aSelected[i].type;
sName = aSelected[i].browser_title;
sSrl = aSelected[i].module_srl;
xe.broadcast("ADD_MODULE_TO_MODULELIST_MANAGER", [sType, sName, sSrl]);
}
});
});
@ -150,18 +157,56 @@
<div class="moduleInstanceList sectionDiv">
<h2>{$lang->select_module_instance}</h2>
<div>
<ul class="moduleInstanceListUL">
</ul>
<select class="moduleInstanceListSelect" multiple="multiple" size="8">
</select>
</div>
<button class="btn btn_primary moduleSearch_ok">{$lang->cmd_select}</button>
</div>
</div>
<!--// new module search -->
</block>
<block cond="$var->type == 'mid'">
<input type="hidden" name="{$id}" value="" />
<input type="text" readonly="readonly" /> <button class="text search">{$lang->cmd_search}</button> <button class="text delete">{$lang->cmd_delete}</button>
<input type="text" readonly="readonly" /> <!--button class="text search">{$lang->cmd_search}</button> <button class="text delete">{$lang->cmd_delete}</button-->
<span style="padding:1px;margin:1px"><b><a href="#moduleSearchWindow2" class="tgAnchor moduleSearch">{$lang->cmd_select}</a></b></span>
<span style="padding:1px;margin:1px"><b><a href="#" class="text delete">{$lang->cmd_delete}</a></b></span>
<!-- callback function for moduleSearchWindow2 is defined in MidManager -->
<!-- new module search -->
<div id="moduleSearchWindow2" class="moduleSearchWindow tgContent">
<div class="siteList sectionDiv">
<h2>{$lang->select_site}</h2>
<div class="siteListSearchBox">
<div class="siteListSearchBoxBorder">
<div class="searchImg icon-search"></div>
<input type="text" class="siteListSearchInput" name="site_filter">
</div>
</div>
<div class="siteListUL">
<ul>
</ul>
</div>
</div>
<div class="moduleTypeList sectionDiv">
<h2>{$lang->select_module_type}</h2>
<div>
<ul class="moduleTypeListUL">
</ul>
</div>
</div>
<div class="moduleInstanceList sectionDiv">
<h2>{$lang->select_module_instance}</h2>
<div>
<select class="moduleInstanceListSelect"size="8">
</select>
</div>
<button class="btn btn_primary moduleSearch_ok">{$lang->cmd_select}</button>
</div>
</div>
<!--// new module search -->
<div class="finder" style="display: none;">
<div class="a">
<input type="text" class="site_keyword" /> <a href="#suggestion_{$suggestion_id}" class="tgAnchor findSite">{$lang->find_site}</a>
<div id="suggestion_{$suggestion_id}" class="tgContent suggestion">
<ul>
@ -174,6 +219,8 @@
<script>
xe.registerApp(new xe.MidManager('{$id}'));
</script>
</block>
<block cond="$var->type == 'filebox'">
{@$use_filebox = true}