Ox.Clipboard: add events; Ox.Request: cleanup; Ox.MainMenu: use OxHighlight class; Themes: add bar highlight color and gradient

This commit is contained in:
rlx 2013-07-15 09:10:08 +00:00
parent b1b2785a15
commit 27bbbdbd83
8 changed files with 35 additions and 8 deletions

View file

@ -828,6 +828,12 @@ Menus
background-image: -webkit-linear-gradient(top, $barSelectedGradient);
color: $barSelectedColor;
}
.$themeClass .OxMainMenu > .OxTitle.OxHighlight {
background-image: -moz-linear-gradient(top, $barHighlightGradient);
background-image: -o-linear-gradient(top, $barHighlightGradient);
background-image: -webkit-linear-gradient(top, $barHighlightGradient);
color: $barHighlightColor;
}
.$themeClass .OxMenu {
box-shadow: 0 2px 4px $menuShadow;

View file

@ -14,7 +14,8 @@ Ox.Clipboard <o> Basic clipboard handler
() -> <s|undefined> Item type
@*/
Ox.Clipboard = (function() {
var clipboard = {items: [], type: void 0};
var clipboard = {items: [], type: void 0},
$element;
return {
_print: function() {
Ox.print(JSON.stringify(clipboard));
@ -24,21 +25,34 @@ Ox.Clipboard = (function() {
Ox.Clipboard.clear();
}
clipboard = {items: clipboard.items.concat(items), type: type};
$element && $element.triggerEvent('add', clipboard);
return clipboard.items.length;
},
bindEvent: function() {
if (!$element) {
$element = Ox.Element();
}
$element.bindEvent.apply(this, arguments);
},
clear: function() {
clipboard = {items: [], type: void 0};
$element && $element.triggerEvent('clear', clipboard);
return clipboard.items.length;
},
copy: function(items, type) {
clipboard = {items: items, type: type};
$element && $element.triggerEvent('copy', clipboard);
return clipboard.items.length;
},
paste: function(type) {
return !type || type == clipboard.type ? clipboard.items : [];
$element && $element.triggerEvent('paste', clipboard);
},
type: function() {
return clipboard.type;
},
unbindEvent: function() {
$element && $element.bindEvent.apply(this, arguments);
}
};
}());

View file

@ -12,7 +12,6 @@ Ox.Request <o> Basic request controller
Ox.Request = (function() {
var cache = {},
$element,
pending = {},
requests = {},
self = {
@ -21,7 +20,8 @@ Ox.Request = (function() {
type: 'POST',
url: '/api/'
}
};
},
$element;
return {
/*@
@ -64,7 +64,7 @@ Ox.Request = (function() {
},
/*@
bindEvent <f> Unbind event
bindEvent <f> Bind event
@*/
bindEvent: function() {
if (!$element) {
@ -207,7 +207,6 @@ Ox.Request = (function() {
/*@
unbindEvent <f> Unbind event
@*/
// FIXME: Can this be removed?
unbindEvent: function() {
$element && $element.unbindEvent.apply(this, arguments);
}

View file

@ -204,11 +204,11 @@ Ox.MainMenu = function(options, self) {
that.highlightMenu = function(id) {
var position = Ox.getIndexById(self.options.menus, id);
self.highlightTimeout && clearTimeout(self.highlightTimeout);
that.titles[position].addClass('OxSelected');
that.titles[position].addClass('OxHighlight');
self.highlightTimeout = setTimeout(function() {
that.titles[position].removeClass('OxSelected');
that.titles[position].removeClass('OxHighlight');
delete self.highlightTimeout;
}, 250);
}, 500);
};
that.removeMenu = function() {

View file

@ -5,6 +5,8 @@
"themeColorLightness": 0.25,
"barGradient": [[224, 224, 224], [192, 192, 192]],
"barHighlightColor": [255, 255, 255],
"barHighlightGradient": [[80, 144, 208], [48, 112, 178]],
"barSelectedColor": [255, 255, 255],
"barSelectedGradient": [[80, 144, 208], [48, 112, 178]],

View file

@ -5,6 +5,8 @@
"themeColorLightness": 0.75,
"barGradient": [[64, 64, 64], [32, 32, 32]],
"barHighlightColor": [0, 0, 0],
"barHighlightGradient": [[255, 255, 0], [192, 192, 0]],
"barSelectedColor": [255, 255, 255],
"barSelectedGradient": [[80, 80, 80], [48, 48, 48]],

View file

@ -5,6 +5,8 @@
"themeColorLightness": 0.25,
"barGradient": [[224, 224, 224], [192, 192, 192]],
"barHighlightColor": [0, 0, 0],
"barHighlightGradient": [[255, 255, 0], [192, 192, 0]],
"barSelectedColor": [0, 0, 0],
"barSelectedGradient": [[208, 208, 208], [176, 176, 176]],

View file

@ -5,6 +5,8 @@
"themeColorLightness": 0.25,
"barGradient": [[160, 160, 160], [128, 128, 128]],
"barHighlightColor": [0, 0, 0],
"barHighlightGradient": [[255, 255, 0], [192, 192, 0]],
"barSelectedColor": [255, 255, 255],
"barSelectedGradient": [[128, 128, 128], [96, 96, 96]],