mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-30 00:29:58 +09:00
merge sandbox to trunk for 1.4.4
git-svn-id: http://xe-core.googlecode.com/svn/trunk@7723 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
200d63636c
commit
b8299c8a65
683 changed files with 70982 additions and 69716 deletions
|
|
@ -1,5 +1,5 @@
|
|||
@charset "utf-8";
|
||||
/* NHN > UIT Center > Open UI Technology Team > Jeong Chan Myeong(dece24@nhncorp.com) */
|
||||
/* NHN (developers@xpressengine.com) */
|
||||
|
||||
/* common */
|
||||
.open{ display:block !important;}
|
||||
|
|
|
|||
|
|
@ -1,119 +1,118 @@
|
|||
/*
|
||||
* jQuery Hotkey Plug-in
|
||||
*
|
||||
* @author Kim Taegon(gonom9@nhncorp.com)
|
||||
*/
|
||||
|
||||
(function($){
|
||||
|
||||
// virtual keys
|
||||
var VKEY = {
|
||||
'TAB' : 9,
|
||||
'ESC' : 27,
|
||||
'ENTER,RETURN' : 13,
|
||||
'UP' : 38,
|
||||
'DOWN' : 40,
|
||||
'LEFT' : 37,
|
||||
'RIGHT' : 39,
|
||||
'BACKSPACE,BKSP' : 8,
|
||||
'DEL' : 46,
|
||||
'SPACE' : 32
|
||||
};
|
||||
|
||||
var Hotkey = new Object;
|
||||
|
||||
$.fn.hotkey = function(key, func) {
|
||||
if (typeof key == "object" && key.toString() == '[object Object]') {
|
||||
for(var x in key) $(this).hotkey(x, key[x]);
|
||||
return this;
|
||||
}
|
||||
|
||||
if (!$.isString(key)) return this;
|
||||
if (key == 'disable' || key == 'enable') {
|
||||
this.attr('hotkey_disabled', (key=='disable'));
|
||||
return this;
|
||||
}
|
||||
|
||||
if (!$.isFunction(func)) return this;
|
||||
if ($.isObject(key)) key = hk2str(key);
|
||||
|
||||
Hotkey[key] = func;
|
||||
|
||||
if (!this.attr('assign-hotkey')) {
|
||||
this.attr('assign-hotkey', true);
|
||||
|
||||
this.keydown(function(evt){
|
||||
if ($(this).attr('hotkey_disabled')) return;
|
||||
|
||||
var stroke = hk2str(evt).split(',');
|
||||
|
||||
for(var i=0; i < stroke.length; i++) {
|
||||
if (Hotkey[stroke[i]]) {
|
||||
if ($(evt.target).is(':input') && (evt.ctrlKey||evt.altKey||evt.metaKey)) break;
|
||||
|
||||
Hotkey[stroke[i]](evt, stroke[i]);
|
||||
|
||||
evt.stopPropagation();
|
||||
evt.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
$.extend({
|
||||
isObject : function(obj) {
|
||||
return (typeof obj == 'object' && obj.toString() == '[object Object]');
|
||||
},
|
||||
isArray : function(arr) {
|
||||
return (Object.prototype.toString.call(arr) == '[object Array]');
|
||||
},
|
||||
isString : function(str) {
|
||||
return (typeof str == 'string');
|
||||
}
|
||||
});
|
||||
|
||||
// hotkey to string
|
||||
function hk2str(key) {
|
||||
var str = [], vkey = false;
|
||||
var _ = null; // do nothing. It is just dummy.
|
||||
|
||||
for(var x in VKEY) {
|
||||
if (VKEY[x] == key.keyCode) {
|
||||
vkey = x;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!vkey) {
|
||||
vkey = String.fromCharCode(key.keyCode).toUpperCase();
|
||||
if (vkey.length != 1) return '';
|
||||
}
|
||||
|
||||
key.altKey?str.push('Alt'):_;
|
||||
key.ctrlKey?str.push('Ctrl'):_;
|
||||
key.shiftKey?str.push('Shift'):_;
|
||||
|
||||
str.push(vkey);
|
||||
|
||||
return str.join('+');
|
||||
}
|
||||
|
||||
// string to hotkey
|
||||
function str2hk(str) {
|
||||
var key = {altKey:false,ctrlKey:false,shiftKey:false,keyCode:0};
|
||||
var lastKey = str.match(/\+([A-Z0-9]+)$/)[1];
|
||||
|
||||
if (!lastKey) return key;
|
||||
|
||||
str += '+';
|
||||
|
||||
key.altKey = str.indexOf('Alt+') > -1;
|
||||
key.ctrlKey = str.indexOf('Ctrl+') > -1;
|
||||
key.shiftKey = str.indexOf('Shift+') > -1;
|
||||
|
||||
key.keyCode = VKEY[lastKey] || lastKey.charCodeAt(0);
|
||||
}
|
||||
|
||||
/*
|
||||
* jQuery Hotkey Plug-in
|
||||
* @author NHN (developer@xpressengine.com)
|
||||
*/
|
||||
|
||||
(function($){
|
||||
|
||||
// virtual keys
|
||||
var VKEY = {
|
||||
'TAB' : 9,
|
||||
'ESC' : 27,
|
||||
'ENTER,RETURN' : 13,
|
||||
'UP' : 38,
|
||||
'DOWN' : 40,
|
||||
'LEFT' : 37,
|
||||
'RIGHT' : 39,
|
||||
'BACKSPACE,BKSP' : 8,
|
||||
'DEL' : 46,
|
||||
'SPACE' : 32
|
||||
};
|
||||
|
||||
var Hotkey = new Object;
|
||||
|
||||
$.fn.hotkey = function(key, func) {
|
||||
if (typeof key == "object" && key.toString() == '[object Object]') {
|
||||
for(var x in key) $(this).hotkey(x, key[x]);
|
||||
return this;
|
||||
}
|
||||
|
||||
if (!$.isString(key)) return this;
|
||||
if (key == 'disable' || key == 'enable') {
|
||||
this.attr('hotkey_disabled', (key=='disable'));
|
||||
return this;
|
||||
}
|
||||
|
||||
if (!$.isFunction(func)) return this;
|
||||
if ($.isObject(key)) key = hk2str(key);
|
||||
|
||||
Hotkey[key] = func;
|
||||
|
||||
if (!this.attr('assign-hotkey')) {
|
||||
this.attr('assign-hotkey', true);
|
||||
|
||||
this.keydown(function(evt){
|
||||
if ($(this).attr('hotkey_disabled')) return;
|
||||
|
||||
var stroke = hk2str(evt).split(',');
|
||||
|
||||
for(var i=0; i < stroke.length; i++) {
|
||||
if (Hotkey[stroke[i]]) {
|
||||
if ($(evt.target).is(':input') && (evt.ctrlKey||evt.altKey||evt.metaKey)) break;
|
||||
|
||||
Hotkey[stroke[i]](evt, stroke[i]);
|
||||
|
||||
evt.stopPropagation();
|
||||
evt.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
$.extend({
|
||||
isObject : function(obj) {
|
||||
return (typeof obj == 'object' && obj.toString() == '[object Object]');
|
||||
},
|
||||
isArray : function(arr) {
|
||||
return (Object.prototype.toString.call(arr) == '[object Array]');
|
||||
},
|
||||
isString : function(str) {
|
||||
return (typeof str == 'string');
|
||||
}
|
||||
});
|
||||
|
||||
// hotkey to string
|
||||
function hk2str(key) {
|
||||
var str = [], vkey = false;
|
||||
var _ = null; // do nothing. It is just dummy.
|
||||
|
||||
for(var x in VKEY) {
|
||||
if (VKEY[x] == key.keyCode) {
|
||||
vkey = x;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!vkey) {
|
||||
vkey = String.fromCharCode(key.keyCode).toUpperCase();
|
||||
if (vkey.length != 1) return '';
|
||||
}
|
||||
|
||||
key.altKey?str.push('Alt'):_;
|
||||
key.ctrlKey?str.push('Ctrl'):_;
|
||||
key.shiftKey?str.push('Shift'):_;
|
||||
|
||||
str.push(vkey);
|
||||
|
||||
return str.join('+');
|
||||
}
|
||||
|
||||
// string to hotkey
|
||||
function str2hk(str) {
|
||||
var key = {altKey:false,ctrlKey:false,shiftKey:false,keyCode:0};
|
||||
var lastKey = str.match(/\+([A-Z0-9]+)$/)[1];
|
||||
|
||||
if (!lastKey) return key;
|
||||
|
||||
str += '+';
|
||||
|
||||
key.altKey = str.indexOf('Alt+') > -1;
|
||||
key.ctrlKey = str.indexOf('Ctrl+') > -1;
|
||||
key.shiftKey = str.indexOf('Shift+') > -1;
|
||||
|
||||
key.keyCode = VKEY[lastKey] || lastKey.charCodeAt(0);
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
|
|
@ -1,139 +1,138 @@
|
|||
/*
|
||||
* jQuery Toolbar Plug-in
|
||||
*
|
||||
* @author Kim Taegon(gonom9@nhncorp.com)
|
||||
*/
|
||||
|
||||
(function($){
|
||||
|
||||
$.fn.toolbar = function(settings) {
|
||||
settings = $.extend({
|
||||
items : '.buttons button',
|
||||
fade : false,
|
||||
click : function(){},
|
||||
hover : function(){},
|
||||
show : function(){},
|
||||
hide : function(){}
|
||||
}, settings);
|
||||
|
||||
// get elements
|
||||
var items = this.find(settings.items);
|
||||
var menus = items.find('+ ul');
|
||||
var menuitems = menus.find('> li');
|
||||
|
||||
// hover action - submenu
|
||||
menus.mouseout(
|
||||
function(event) {
|
||||
var el = $(event.relatedTarget).parents().add(event.relatedTarget);
|
||||
|
||||
if ( el.index(this) < 0 && el.index($(this).prev()) < 0 ) hideMenu($(this), settings);
|
||||
}
|
||||
).click(
|
||||
function(event) {
|
||||
var item = $(event.target).parent();
|
||||
|
||||
var data = createData(item);
|
||||
|
||||
if ( !item.is('li') ) return;
|
||||
|
||||
// radio button
|
||||
selectItem(data);
|
||||
|
||||
// callback
|
||||
settings.click(data);
|
||||
}
|
||||
);
|
||||
|
||||
menuitems.mouseover(
|
||||
function(event){
|
||||
var item = $(this);
|
||||
|
||||
item.parent().find('> li').removeClass('tb-menu-item-hover');
|
||||
item.addClass('tb-menu-item-hover');
|
||||
|
||||
// callback
|
||||
settings.hover(createData(item));
|
||||
}
|
||||
);
|
||||
|
||||
// hover action - button
|
||||
items.hover(
|
||||
function(event) {
|
||||
showMenu($(this).find('+ ul'), settings);
|
||||
},
|
||||
function(event) {
|
||||
var menu = $(this).find('+ ul');
|
||||
var el = $(event.relatedTarget).parents().add(event.relatedTarget);
|
||||
|
||||
// hide menu
|
||||
if ( el.index(menu) < 0 && el.index(this) < 0 ) hideMenu(menu, settings);
|
||||
}
|
||||
);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
function hideMenu(menu, settings) {
|
||||
menu[settings.fade?'fadeOut':'hide'](settings.fade)
|
||||
.removeClass('tb-menu-active')
|
||||
.find('> li').removeClass('tb-menu-item-hover');
|
||||
|
||||
menu.prev().removeClass('tb-btn-active');
|
||||
|
||||
// hidemenu event
|
||||
settings.hide(menu);
|
||||
}
|
||||
|
||||
function showMenu(menu, settings) {
|
||||
menu[settings.fade?'fadeIn':'show'](settings.fade)
|
||||
.addClass('tb-menu-active')
|
||||
.css({position:'absolute',left:0,top:0});
|
||||
|
||||
menu.prev().addClass('tb-btn-active');
|
||||
|
||||
// positioning
|
||||
var btn = menu.prev();
|
||||
var btn_pos = btn.offset();
|
||||
var mnu_pos = menu.offset();
|
||||
|
||||
menu.css({
|
||||
left : btn_pos.left - mnu_pos.left,
|
||||
top : btn_pos.top - mnu_pos.top + btn.height()
|
||||
})
|
||||
|
||||
// showmenu event
|
||||
settings.show(menu);
|
||||
}
|
||||
|
||||
function selectItem(data) {
|
||||
var item = data.element;
|
||||
|
||||
switch(data.type){
|
||||
case 'radio':
|
||||
item.parent().find('> li').removeClass('tb-menu-item-selected');
|
||||
item.addClass('tb-menu-item-selected')
|
||||
data.checked = true;
|
||||
break;
|
||||
case 'checkbox':
|
||||
data.checked = !data.checked;
|
||||
if (data.checked) {
|
||||
item.addClass('tb-menu-item-selected');
|
||||
} else {
|
||||
item.removeClass('tb-menu-item-selected');
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
function createData(item) {
|
||||
return {
|
||||
element : item,
|
||||
type : item.attr('tb:type'),
|
||||
arg : item.attr('tb:arg'),
|
||||
checked : item.hasClass('tb-menu-item-selected')
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
* jQuery Toolbar Plug-in
|
||||
* @author NHN (developer@xpressengine.com)
|
||||
*/
|
||||
|
||||
(function($){
|
||||
|
||||
$.fn.toolbar = function(settings) {
|
||||
settings = $.extend({
|
||||
items : '.buttons button',
|
||||
fade : false,
|
||||
click : function(){},
|
||||
hover : function(){},
|
||||
show : function(){},
|
||||
hide : function(){}
|
||||
}, settings);
|
||||
|
||||
// get elements
|
||||
var items = this.find(settings.items);
|
||||
var menus = items.find('+ ul');
|
||||
var menuitems = menus.find('> li');
|
||||
|
||||
// hover action - submenu
|
||||
menus.mouseout(
|
||||
function(event) {
|
||||
var el = $(event.relatedTarget).parents().add(event.relatedTarget);
|
||||
|
||||
if ( el.index(this) < 0 && el.index($(this).prev()) < 0 ) hideMenu($(this), settings);
|
||||
}
|
||||
).click(
|
||||
function(event) {
|
||||
var item = $(event.target).parent();
|
||||
|
||||
var data = createData(item);
|
||||
|
||||
if ( !item.is('li') ) return;
|
||||
|
||||
// radio button
|
||||
selectItem(data);
|
||||
|
||||
// callback
|
||||
settings.click(data);
|
||||
}
|
||||
);
|
||||
|
||||
menuitems.mouseover(
|
||||
function(event){
|
||||
var item = $(this);
|
||||
|
||||
item.parent().find('> li').removeClass('tb-menu-item-hover');
|
||||
item.addClass('tb-menu-item-hover');
|
||||
|
||||
// callback
|
||||
settings.hover(createData(item));
|
||||
}
|
||||
);
|
||||
|
||||
// hover action - button
|
||||
items.hover(
|
||||
function(event) {
|
||||
showMenu($(this).find('+ ul'), settings);
|
||||
},
|
||||
function(event) {
|
||||
var menu = $(this).find('+ ul');
|
||||
var el = $(event.relatedTarget).parents().add(event.relatedTarget);
|
||||
|
||||
// hide menu
|
||||
if ( el.index(menu) < 0 && el.index(this) < 0 ) hideMenu(menu, settings);
|
||||
}
|
||||
);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
function hideMenu(menu, settings) {
|
||||
menu[settings.fade?'fadeOut':'hide'](settings.fade)
|
||||
.removeClass('tb-menu-active')
|
||||
.find('> li').removeClass('tb-menu-item-hover');
|
||||
|
||||
menu.prev().removeClass('tb-btn-active');
|
||||
|
||||
// hidemenu event
|
||||
settings.hide(menu);
|
||||
}
|
||||
|
||||
function showMenu(menu, settings) {
|
||||
menu[settings.fade?'fadeIn':'show'](settings.fade)
|
||||
.addClass('tb-menu-active')
|
||||
.css({position:'absolute',left:0,top:0});
|
||||
|
||||
menu.prev().addClass('tb-btn-active');
|
||||
|
||||
// positioning
|
||||
var btn = menu.prev();
|
||||
var btn_pos = btn.offset();
|
||||
var mnu_pos = menu.offset();
|
||||
|
||||
menu.css({
|
||||
left : btn_pos.left - mnu_pos.left,
|
||||
top : btn_pos.top - mnu_pos.top + btn.height()
|
||||
})
|
||||
|
||||
// showmenu event
|
||||
settings.show(menu);
|
||||
}
|
||||
|
||||
function selectItem(data) {
|
||||
var item = data.element;
|
||||
|
||||
switch(data.type){
|
||||
case 'radio':
|
||||
item.parent().find('> li').removeClass('tb-menu-item-selected');
|
||||
item.addClass('tb-menu-item-selected')
|
||||
data.checked = true;
|
||||
break;
|
||||
case 'checkbox':
|
||||
data.checked = !data.checked;
|
||||
if (data.checked) {
|
||||
item.addClass('tb-menu-item-selected');
|
||||
} else {
|
||||
item.removeClass('tb-menu-item-selected');
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
function createData(item) {
|
||||
return {
|
||||
element : item,
|
||||
type : item.attr('tb:type'),
|
||||
arg : item.attr('tb:arg'),
|
||||
checked : item.hasClass('tb-menu-item-selected')
|
||||
};
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
Loading…
Add table
Add a link
Reference in a new issue