mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-11 04:52:14 +09:00
As now, some UIPatterns are also jQuery plugins
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9051 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
b8a597e219
commit
e883af153e
1 changed files with 265 additions and 217 deletions
|
|
@ -96,8 +96,73 @@ jQuery(function($){
|
|||
})
|
||||
.end()
|
||||
|
||||
// Modal Window
|
||||
$('a.modalAnchor')
|
||||
// pagination
|
||||
$.fn.xePagination = function(){
|
||||
this
|
||||
.find('span.tgContent').css('whiteSpace', 'nowrap').end()
|
||||
.find('a.tgAnchor[href="#goTo"]')
|
||||
.each(function(idx){
|
||||
var $this = $(this);
|
||||
$this.after( $($this.attr('href')) );
|
||||
})
|
||||
.end();
|
||||
|
||||
return this;
|
||||
};
|
||||
$('.pagination').xePagination();
|
||||
|
||||
// Portlet Action
|
||||
$('.portlet .action')
|
||||
.css({display:'none',position:'absolute'})
|
||||
.parent()
|
||||
.mouseleave(function(){ $(this).find('>.action').fadeOut(100); })
|
||||
.mouseenter(function(){ $(this).find('>.action').fadeIn(100); })
|
||||
.focusin(function(){ $(this).mouseenter() })
|
||||
.focusout(function(){
|
||||
var $this = $(this), timer;
|
||||
|
||||
clearTimeout($this.data('timer'));
|
||||
timer = setTimeout(function(){ if(!$this.find(':focus').length) $this.mouseleave() }, 10);
|
||||
|
||||
$this.data('timer', timer);
|
||||
});
|
||||
|
||||
// Display the dashboard in two column
|
||||
$('.dashboard>.section>.portlet:odd').after('<br style="clear:both" />');
|
||||
|
||||
|
||||
// Popup list : 'Move to site' and 'Site map'
|
||||
$('.header>.siteTool>a.i')
|
||||
.bind('before-open.tc', function(){
|
||||
$(this)
|
||||
.addClass('active')
|
||||
.next('div.tgContent')
|
||||
.find('>.section:gt(0)').hide().end()
|
||||
.find('>.btnArea>button').show();
|
||||
})
|
||||
.bind('after-close.tc', function(){
|
||||
$(this).removeClass('active');
|
||||
})
|
||||
.next('#siteMapList')
|
||||
.find('>.section:last')
|
||||
.after('<p class="btnArea"><button type="button">› more</button></p>')
|
||||
.find('+p>button')
|
||||
.click(function(){
|
||||
// Display all sections then hide this button
|
||||
$(this).hide().parent().prevAll('.section').show();
|
||||
});
|
||||
});
|
||||
|
||||
// Modal Window
|
||||
jQuery(function($){
|
||||
|
||||
$.fn.xeModalWindow = function(){
|
||||
this
|
||||
.not('.xe-modal-window')
|
||||
.addClass('xe-modal-window')
|
||||
.each(function(){
|
||||
$( $(this).attr('href') ).addClass('x').hide();
|
||||
})
|
||||
.click(function(){
|
||||
var $this = $(this), $modal, $btnClose, disabled;
|
||||
|
||||
|
|
@ -193,40 +258,21 @@ jQuery(function($){
|
|||
$modal.fadeOut(duration, after);
|
||||
$this.focus();
|
||||
});
|
||||
};
|
||||
$('a.modalAnchor').xeModalWindow();
|
||||
|
||||
$('div.modal').addClass('x').hide();
|
||||
});
|
||||
|
||||
// pagination
|
||||
$('.pagination')
|
||||
.find('span.tgContent').css('whiteSpace', 'nowrap').end()
|
||||
.find('a.tgAnchor[href="#goTo"]')
|
||||
.each(function(idx){
|
||||
var $this = $(this);
|
||||
$this.after( $($this.attr('href')) );
|
||||
// Content Toggler
|
||||
jQuery(function($){
|
||||
|
||||
$.fn.xeContentToggler = function(){
|
||||
this
|
||||
.not('.xe-content-toggler')
|
||||
.addClass('xe-content-toggler')
|
||||
.each(function(){
|
||||
$($(this).attr('href')).hide().focusout(focusoutContent);
|
||||
})
|
||||
.end();
|
||||
|
||||
// Portlet Action
|
||||
$('.portlet .action')
|
||||
.css({display:'none',position:'absolute'})
|
||||
.parent()
|
||||
.mouseleave(function(){ $(this).find('>.action').fadeOut(100); })
|
||||
.mouseenter(function(){ $(this).find('>.action').fadeIn(100); })
|
||||
.focusin(function(){ $(this).mouseenter() })
|
||||
.focusout(function(){
|
||||
var $this = $(this), timer;
|
||||
|
||||
clearTimeout($this.data('timer'));
|
||||
timer = setTimeout(function(){ if(!$this.find(':focus').length) $this.mouseleave() }, 10);
|
||||
|
||||
$this.data('timer', timer);
|
||||
});
|
||||
|
||||
// Display the dashboard in two column
|
||||
$('.dashboard>.section>.portlet:odd').after('<br style="clear:both" />');
|
||||
|
||||
// Toggle Contents
|
||||
$('a.tgAnchor')
|
||||
.click(function(){
|
||||
var $this = $(this), $layer;
|
||||
|
||||
|
|
@ -340,41 +386,28 @@ jQuery(function($){
|
|||
$this.trigger('after-close.tc');
|
||||
}
|
||||
});
|
||||
$('.tgContent')
|
||||
.hide()
|
||||
.focusout(function(event){
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
$('a.tgAnchor').xeContentToggler();
|
||||
|
||||
function focusoutContent(event) {
|
||||
var $this = $(this), $anchor = $this.data('anchor');
|
||||
setTimeout(function(){
|
||||
if(!$this.find(':focus').length && $this.data('state') == 'showing') $anchor.trigger('close.tc');
|
||||
}, 1);
|
||||
})
|
||||
};
|
||||
|
||||
// Popup list : 'Move to site' and 'Site map'
|
||||
$('.header>.siteTool>a.i')
|
||||
.bind('before-open.tc', function(){
|
||||
$(this)
|
||||
.addClass('active')
|
||||
.next('div.tgContent')
|
||||
.find('>.section:gt(0)').hide().end()
|
||||
.find('>.btnArea>button').show();
|
||||
})
|
||||
.bind('after-close.tc', function(){
|
||||
$(this).removeClass('active');
|
||||
})
|
||||
.next('#siteMapList')
|
||||
.find('>.section:last')
|
||||
.after('<p class="btnArea"><button type="button">› more</button></p>')
|
||||
.find('+p>button')
|
||||
.click(function(){
|
||||
// Display all sections then hide this button
|
||||
$(this).hide().parent().prevAll('.section').show();
|
||||
});
|
||||
});
|
||||
|
||||
// Module finder
|
||||
jQuery(function($){
|
||||
|
||||
$('.modulefinder')
|
||||
$.fn.xeModuleFinder = function(){
|
||||
this
|
||||
.not('.xe-module-finder')
|
||||
.addClass('xe-module-finder')
|
||||
.find('a.tgAnchor.findsite')
|
||||
.bind('before-open.tc', function(){
|
||||
var $this, $ul, val;
|
||||
|
|
@ -456,6 +489,11 @@ $('.modulefinder')
|
|||
}
|
||||
$mid_select.prop('selectedIndex', 0);
|
||||
});
|
||||
|
||||
return this;
|
||||
};
|
||||
$('.modulefinder').xeModuleFinder();
|
||||
|
||||
});
|
||||
|
||||
// Sortable table
|
||||
|
|
@ -465,7 +503,10 @@ var
|
|||
dragging = false,
|
||||
$holder = $('<tr class="placeholder"><td> </td></tr>');
|
||||
|
||||
$('table.sortable')
|
||||
$.fn.xeSortableTable = function(){
|
||||
this
|
||||
.not('.xe-sortable-table')
|
||||
.addClass('xe-sortable-table')
|
||||
.delegate('button.dragBtn', 'mousedown.st', function(event){
|
||||
var $this, $tr, $table, $th, height, width, offset, position, offsets, i, dropzone, cols;
|
||||
|
||||
|
|
@ -578,6 +619,11 @@ $('table.sortable')
|
|||
});
|
||||
})
|
||||
|
||||
return this;
|
||||
};
|
||||
$('table.sortable').xeSortableTable();
|
||||
|
||||
|
||||
function getOffset(elem, offsetParent) {
|
||||
var top = 0, left = 0;
|
||||
|
||||
|
|
@ -662,6 +708,8 @@ $('.multiLangEdit')
|
|||
.blur(function(){
|
||||
clearTimeout(w_timer);
|
||||
w_timer = null;
|
||||
|
||||
$(this).closest('.multiLangEdit').focusout();
|
||||
})
|
||||
.end()
|
||||
.find('a.tgAnchor.editUserLang')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue