merge from 1.5.3.2 (~r11225)

git-svn-id: http://xe-core.googlecode.com/svn/trunk@11226 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2012-09-13 06:14:45 +00:00
parent 54e3a72065
commit 77f5aa2671
313 changed files with 8058 additions and 14251 deletions

View file

@ -154,14 +154,13 @@ jQuery(function($){
$.fn.xeMenu = function(){
this
.attr('role', 'navigation') // WAI-ARIA role
.find('>.nav>li')
.find('>.nav-gnb>li')
.attr('role', 'menuitem') // WAI-ARIA role
.find('>ul').css('height','0').end()
.filter(':has(>ul)')
.attr('aria-haspopup', 'true') // WAI-ARIA
.end()
.end()
.find('>.nav')
.find('>.nav-gnb')
.mouseover(function(){
$(this)
.parent('.gnb').addClass('active').end()
@ -185,28 +184,6 @@ jQuery(function($){
$(this).mouseover();
}
});
this
.find('>.bmk')
.removeClass('active')
.mouseover(function(){
$(this).addClass('active')
})
.mouseleave(function(){
$(this).removeClass('active')
})
.focusout(function(){
var $this = $(this);
setTimeout(function(){
if(!$this.find(':focus').length) {
$this.mouseleave();
}
}, 1);
})
.delegate('a', {
focus : function(){
$(this).mouseover();
}
});
};
$('div.gnb').xeMenu();
@ -576,6 +553,202 @@ $('.modulefinder').xeModuleFinder();
});
// Module Search : A New Version Of Module Finder
jQuery(function($){
_xeModuleSearch = function(){
var t = this;
var $t = $(this);
var $moduleSearchWindow = $t.find(".moduleSearchWindow");
var $siteListDiv = $moduleSearchWindow.find('.siteList');
var $moduleTypeListDiv = $moduleSearchWindow.find('.moduleTypeList');
var $moduleInstanceListDiv = $moduleSearchWindow.find('.moduleInstanceList');
var $siteList = $siteListDiv.find('UL');
var $moduleTypeList = $moduleTypeListDiv.find('UL');
var $moduleInstanceList = $moduleInstanceListDiv.find('SELECT');
var $siteListSearchInput = $moduleSearchWindow.find('INPUT.siteListSearchInput');
var aSiteListData;
var MAX_LIST_HEIGHT = 280;
function setListSize($UL, nHeight){
var nWidth, $div;
$UL.find('li div').width('');
$UL.css('height', '');
$UL.css('overflow-y', '');
if($UL.height() > nHeight){
$div = $UL.find('li div');
$div.width($div.width()-20+'px');
$UL.css('height', nHeight+'px');
$UL.css('overflow-y', 'auto');
}
}
function setSiteList(sFilter){
var sDomain;
var rxFilter = new RegExp(sFilter, "ig");
var list = aSiteListData;
$siteList.empty();
for(i=0,c=list.length; i < c; i++) {
sDomain = list[i].domain;
if(sFilter){
if(!sDomain.match(rxFilter)) continue;
sDomain = sDomain.replace(rxFilter, function(sKeyword){
return '<span class="highlight">'+sKeyword+'</span>';
});
}
$li = $('<li />').appendTo($siteList);
$('<a>').attr('href', '#').html(
'<div>' + sDomain + '</div>' +
'<span class="icon-circle-arrow-right" style="display:inline-block;float:right;width:16px;height:16px;"></span>'
).data('site_srl', list[i].site_srl).appendTo($li);
}
setListSize($siteList, MAX_LIST_HEIGHT - $siteListSearchInput.parent("DIV").height());
}
$siteListSearchInput.keyup(function(){
setSiteList($siteListSearchInput.val());
});
if(typeof console == 'undefined'){
console={log:function(){}};
}
$t
.not('.xe-module-search')
.addClass('xe-module-search')
.find('a.tgAnchor.moduleSearch')
.bind('before-open.tc', function(){
var $this;
$this = $(this);
function on_complete(data) {
var $li, list = data.site_list, i, c;
if(data.error || !$.isArray(list)) {
$this.trigger('close.tc');
return;
}
aSiteListData = list;
setSiteList($siteListSearchInput.val());
$siteListSearchInput.focus();
};
$siteList.empty();
$moduleInstanceList.empty();
$moduleTypeListDiv.hide();
$moduleInstanceListDiv.hide();
$.exec_json('admin.getSiteAllList', {domain:""}, on_complete);
})
.end()
.find('.tgContent .siteListUL')
.delegate('a','click',function(oEvent){
var $this, $finder;
$this = $(this);
$finder = $this.closest('.modulefinder');
function on_complete(data) {
var list = data.module_list, x;
if(data.error || !list) return;
for(x in list) {
if(!list.hasOwnProperty(x)) continue;
$li = $('<li />').appendTo($moduleTypeList);
$('<a>').attr('href', '#').html(
'<div>'+list[x].title+'</div>' +
'<span class="icon-circle-arrow-right" style="display:inline-block;float:right;width:16px;height:16px;"></span>'
).data('moduleInstanceList', list[x].list).appendTo($li);
//$('<option />').attr('value', x).text(list[x].title).appendTo($mod_select);
}
$moduleSearchWindow.find('.moduleTypeList').show();
setListSize($moduleTypeList, MAX_LIST_HEIGHT);
$siteList.find('li').removeClass('on');
$this.parent('li').addClass('on');
};
//$finder.find('a.tgAnchor.findsite').trigger('close.tc');
$moduleTypeList.empty();
$moduleInstanceListDiv.hide();
$.exec_json('module.procModuleAdminGetList', {site_srl:$this.data('site_srl')}, on_complete);
oEvent.preventDefault();
})
.end()
//.find('.moduleList,.moduleIdList').hide().end()
.find('.moduleTypeListUL')
.delegate('a', 'click', function(oEvent){
var $this, $mid_select, val, list;
$this = $(this);
list = $this.data('moduleInstanceList');
if(!list) return;
t.sSelectedModuleType = $this.text();
$moduleInstanceList.empty();
for(var x in list) {
if(!list.hasOwnProperty(x)) continue;
$li = $('<option />').html(list[x].browser_title).appendTo($moduleInstanceList).val(list[x].module_srl).data('mid', list[x].module_srl)
.data('module_srl', list[x].module_srl).data('layout_srl', list[x].layout_srl).data('browser_title', list[x].browser_title);
}
$moduleInstanceListDiv.show();
setListSize($moduleInstanceList, MAX_LIST_HEIGHT);
$moduleTypeList.find('li').removeClass('on');
$this.parent('li').addClass('on');
oEvent.preventDefault();
})
.end()
.find('.moduleSearch_ok').click(function(oEvent){
var aSelected = [];
$t.find('.moduleInstanceListSelect option:selected').each(function(){
aSelected.push({
'type' : t.sSelectedModuleType,
'module_srl' : $(this).data('module_srl'),
'layout_srl' : $(this).data('layout_srl'),
'browser_title' : $(this).data('browser_title')
});
});
$t.trigger('moduleSelect', [aSelected]);
$('.tgAnchor.moduleSearch').trigger('close.tc');
oEvent.preventDefault();
});
return this;
};
$.fn.xeModuleSearch = function(){
$(this).each(_xeModuleSearch);
};
$('.moduleSearch').xeModuleSearch();
});
// Sortable table
jQuery(function($){
@ -769,10 +942,10 @@ $('.multiLangEdit')
function on_complete(data, idx){
var results = data.results, $btn, i, c;
if(data.error || !results || (r_idx != idx+1)) return;
$this.removeClass('loading');
if(data.error || !results || results.length === 0 || (r_idx != idx+1)) return;
$ul.empty();
for(i=0,c=results.length; i < c; i++) {
$btn = $('<button type="button" class="_btnLang" />').data('langkey', results[i].name).text(results[i].value);
@ -799,6 +972,8 @@ $('.multiLangEdit')
$active = $ul.find('button.active');
if(key == ENTER) {
if($active.length === 0) return true;
$active.click();
return false;
}
@ -904,8 +1079,17 @@ $('.multiLangEdit')
var $li = $('<li />').appendTo($langlist);
var anchor_id = $layer.data('layer_index');
var lang_text = this[xe.current_lang];
if(!lang_text) {
for(lang_code in this) {
lang_text = this[lang_code];
break;
}
}
$('<a href="#langInput_'+anchor_id+'" class="langItem" />')
.text(this[xe.current_lang])
.text(lang_text)
.data('multilang-name', key)
.appendTo($li);
});
@ -1204,17 +1388,11 @@ function completeInstallModule(ret_obj) {
jQuery(function($){
$('body').ajaxComplete(function(){ hideWaitingFogLayer() });
});
// admin single column layout
jQuery(function($){
if($('.x>.body>.lnb').length == 0){ // When it have no lnb
$('.x>.body>.content').addClass('single'); // Add class single
if($('.x>.body .lnb').length == 0){ // When it have no lnb
$('.x>.body').addClass('single'); // Add class single
}
});
// Details toggle in admin table
jQuery(function($){
var viewBtn = $('.x .dsTg span.side>button.text');
var tdTitle = $('.x .dsTg td.title');
tdTitle.each(function(){
@ -1230,10 +1408,7 @@ jQuery(function($){
viewBtn.toggleClass('details');
details.slideToggle(200);
});
});
// Toggle Content
jQuery(function($){
var $h2h3 = $('.x .content .h2, .x .content .h3').not('.portlet .h2, .modal .h2');
$h2h3.each(function(){
var $sTog = $('<button type="button" class="sTog" title="Open/Close"><i class="icon-chevron-up"></i></button>');
@ -1250,4 +1425,4 @@ jQuery(function($){
}
});
});
});
});