Issue 2443. Multilingual UI development.

git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@11595 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ChanMyeong 2012-10-05 01:53:10 +00:00
parent 3ca52fedc8
commit 437e52e3fa
4 changed files with 215 additions and 92 deletions

View file

@ -6,7 +6,6 @@ jQuery(function($){
$('.x .skipNav>a').click(function(){
$($(this).attr('href')).attr('tabindex','0').css('outline','0').focus();
});
// TARGET toggle
$(document.body).on('click', '.x [data-toggle]', function(){
var $this = $(this);
@ -33,7 +32,6 @@ jQuery(function($){
$this.focus();
return false;
});
// Tab Navigation
$('.x .x_tab-content>.x_tab-pane:not(".x_active")').hide();
$('.x .x_nav-tabs').find('>li>a[href^="#"]').click(function(){
@ -99,20 +97,6 @@ jQuery(function($){
$xBody.addClass('wide');
contentBugFix();
});
// Multilingual
var $multilingual_a = $('#multilingual .item>a');
$multilingual_a.append('<i class="x_icon-chevron-down"></i>');
$multilingual_a.click(function(){
var $this = $(this);
var up = 'x_icon-chevron-up';
var down = 'x_icon-chevron-down';
if($this.next('fieldset').is(':visible')){
$this.children('i').removeClass(down).addClass(up);
$this.parent('.item').siblings('.item').find('a>i').removeClass(up).addClass(down).end().children('fieldset').hide();
} else {
$this.children('i').removeClass(up).addClass(down);
}
});
// Check All
$('.x th>input[type="checkbox"]')
.change(function() {
@ -166,7 +150,6 @@ jQuery(function($){
}
});
});
// Modal Window
jQuery(function($){

View file

@ -6,9 +6,8 @@ jQuery(function($){
$('.x .skipNav>a').click(function(){
$($(this).attr('href')).attr('tabindex','0').css('outline','0').focus();
});
// TARGET toggle
$('.x [data-toggle]').click(function(){
$(document.body).on('click', '.x [data-toggle]', function(){
var $this = $(this);
var $target = $($this.attr('data-toggle'));
$target.toggle();
@ -22,18 +21,17 @@ jQuery(function($){
return false;
});
// TARGET show
$('.x [data-show]').click(function(){
$(document.body).on('click', '.x [data-show]', function(){
$($(this).attr('data-show')).show().attr('tabindex','0').focus();
return false;
});
// TARGET hide
$('.x [data-hide]').click(function(){
$(document.body).on('click', '.x [data-hide]', function(){
var $this = $(this);
$($this.attr('data-hide')).hide();
$this.focus();
return false;
});
// Tab Navigation
$('.x .x_tab-content>.x_tab-pane:not(".x_active")').hide();
$('.x .x_nav-tabs').find('>li>a[href^="#"]').click(function(){
@ -99,20 +97,6 @@ jQuery(function($){
$xBody.addClass('wide');
contentBugFix();
});
// Multilingual
var $multilingual_a = $('#multilingual .item>a');
$multilingual_a.append('<i class="x_icon-chevron-down"></i>');
$multilingual_a.click(function(){
var $this = $(this);
var up = 'x_icon-chevron-up';
var down = 'x_icon-chevron-down';
if($this.next('fieldset').is(':visible')){
$this.children('i').removeClass(down).addClass(up);
$this.parent('.item').siblings('.item').find('a>i').removeClass(up).addClass(down).end().children('fieldset').hide();
} else {
$this.children('i').removeClass(up).addClass(down);
}
});
// Check All
$('.x th>input[type="checkbox"]')
.change(function() {
@ -130,7 +114,7 @@ jQuery(function($){
.trigger('update.checkbox', [name, this.checked]);
});
// Pagination
$('.x .x_pagination .x_disabled, .x .x_pagination .x_active').click(function(){
$(document.body).on('click', '.x .x_pagination .x_disabled, .x .x_pagination .x_active', function(){
return false;
});
// Section Toggle
@ -166,7 +150,6 @@ jQuery(function($){
}
});
});
// Modal Window
jQuery(function($){
@ -845,6 +828,71 @@ $.fn.xeSortableTable = function(){
};
$('table.sortable').xeSortableTable();
// filebox
jQuery(function($){
$('.filebox')
.bind('before-open.mw', function(){
var $this, $list, $parentObj;
var anchor;
$this = $(this);
anchor = $this.attr('href');
$list = $(anchor).find('.filebox_list');
function on_complete(data){
$list.html(data.html);
$list.find('.select')
.bind('click', function(event){
var selectedImages = $('input.select_checkbox:checked');
if(selectedImages.length == 0) {
var selectedImgSrc = $(this).closest('tr').find('img.filebox_item').attr('src');
if(!selectedImgSrc){
alert("None selected!");
}else{
$this.trigger('filebox.selected', [selectedImgSrc]);
$this.trigger('close.mw');
}
}else {
$this.trigger('filebox.selected', [selectedImages]);
$this.trigger('close.mw');
}
return false;
});
$list.find('.x_pagination')
.find('a')
.filter(function(){
if ($(this).data('toggle')) return false;
if ($(this).parent().hasClass('x_disabled')) return false;
if ($(this).parent().hasClass('x_active')) return false;
return true;
})
.bind('click', function(){
var page = $(this).attr('page');
$.exec_json('module.getFileBoxListHtml', {'page': page}, on_complete);
return false;
});
$('#goToFileBox')
.find('button')
.bind('click', function(){
var page = $(this).prev('input').val();
$.exec_json('module.getFileBoxListHtml', {'page': page}, on_complete);
return false;
});
$list.closest('.x_modal-body').scrollTop(0);
}
$.exec_json('module.getFileBoxListHtml', {'page': '1'}, on_complete);
});
});
function getOffset(elem, offsetParent) {
var top = 0, left = 0;