Ox.Clipboard: add events; Ox.Request: cleanup; Ox.MainMenu: use OxHighlight class; Themes: add bar highlight color and gradient
This commit is contained in:
parent
b1b2785a15
commit
27bbbdbd83
8 changed files with 35 additions and 8 deletions
|
@ -828,6 +828,12 @@ Menus
|
||||||
background-image: -webkit-linear-gradient(top, $barSelectedGradient);
|
background-image: -webkit-linear-gradient(top, $barSelectedGradient);
|
||||||
color: $barSelectedColor;
|
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 {
|
.$themeClass .OxMenu {
|
||||||
box-shadow: 0 2px 4px $menuShadow;
|
box-shadow: 0 2px 4px $menuShadow;
|
||||||
|
|
|
@ -14,7 +14,8 @@ Ox.Clipboard <o> Basic clipboard handler
|
||||||
() -> <s|undefined> Item type
|
() -> <s|undefined> Item type
|
||||||
@*/
|
@*/
|
||||||
Ox.Clipboard = (function() {
|
Ox.Clipboard = (function() {
|
||||||
var clipboard = {items: [], type: void 0};
|
var clipboard = {items: [], type: void 0},
|
||||||
|
$element;
|
||||||
return {
|
return {
|
||||||
_print: function() {
|
_print: function() {
|
||||||
Ox.print(JSON.stringify(clipboard));
|
Ox.print(JSON.stringify(clipboard));
|
||||||
|
@ -24,21 +25,34 @@ Ox.Clipboard = (function() {
|
||||||
Ox.Clipboard.clear();
|
Ox.Clipboard.clear();
|
||||||
}
|
}
|
||||||
clipboard = {items: clipboard.items.concat(items), type: type};
|
clipboard = {items: clipboard.items.concat(items), type: type};
|
||||||
|
$element && $element.triggerEvent('add', clipboard);
|
||||||
return clipboard.items.length;
|
return clipboard.items.length;
|
||||||
},
|
},
|
||||||
|
bindEvent: function() {
|
||||||
|
if (!$element) {
|
||||||
|
$element = Ox.Element();
|
||||||
|
}
|
||||||
|
$element.bindEvent.apply(this, arguments);
|
||||||
|
},
|
||||||
clear: function() {
|
clear: function() {
|
||||||
clipboard = {items: [], type: void 0};
|
clipboard = {items: [], type: void 0};
|
||||||
|
$element && $element.triggerEvent('clear', clipboard);
|
||||||
return clipboard.items.length;
|
return clipboard.items.length;
|
||||||
},
|
},
|
||||||
copy: function(items, type) {
|
copy: function(items, type) {
|
||||||
clipboard = {items: items, type: type};
|
clipboard = {items: items, type: type};
|
||||||
|
$element && $element.triggerEvent('copy', clipboard);
|
||||||
return clipboard.items.length;
|
return clipboard.items.length;
|
||||||
},
|
},
|
||||||
paste: function(type) {
|
paste: function(type) {
|
||||||
return !type || type == clipboard.type ? clipboard.items : [];
|
return !type || type == clipboard.type ? clipboard.items : [];
|
||||||
|
$element && $element.triggerEvent('paste', clipboard);
|
||||||
},
|
},
|
||||||
type: function() {
|
type: function() {
|
||||||
return clipboard.type;
|
return clipboard.type;
|
||||||
|
},
|
||||||
|
unbindEvent: function() {
|
||||||
|
$element && $element.bindEvent.apply(this, arguments);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}());
|
}());
|
||||||
|
|
|
@ -12,7 +12,6 @@ Ox.Request <o> Basic request controller
|
||||||
Ox.Request = (function() {
|
Ox.Request = (function() {
|
||||||
|
|
||||||
var cache = {},
|
var cache = {},
|
||||||
$element,
|
|
||||||
pending = {},
|
pending = {},
|
||||||
requests = {},
|
requests = {},
|
||||||
self = {
|
self = {
|
||||||
|
@ -21,7 +20,8 @@ Ox.Request = (function() {
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: '/api/'
|
url: '/api/'
|
||||||
}
|
}
|
||||||
};
|
},
|
||||||
|
$element;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
/*@
|
/*@
|
||||||
|
@ -64,7 +64,7 @@ Ox.Request = (function() {
|
||||||
},
|
},
|
||||||
|
|
||||||
/*@
|
/*@
|
||||||
bindEvent <f> Unbind event
|
bindEvent <f> Bind event
|
||||||
@*/
|
@*/
|
||||||
bindEvent: function() {
|
bindEvent: function() {
|
||||||
if (!$element) {
|
if (!$element) {
|
||||||
|
@ -207,7 +207,6 @@ Ox.Request = (function() {
|
||||||
/*@
|
/*@
|
||||||
unbindEvent <f> Unbind event
|
unbindEvent <f> Unbind event
|
||||||
@*/
|
@*/
|
||||||
// FIXME: Can this be removed?
|
|
||||||
unbindEvent: function() {
|
unbindEvent: function() {
|
||||||
$element && $element.unbindEvent.apply(this, arguments);
|
$element && $element.unbindEvent.apply(this, arguments);
|
||||||
}
|
}
|
||||||
|
|
|
@ -204,11 +204,11 @@ Ox.MainMenu = function(options, self) {
|
||||||
that.highlightMenu = function(id) {
|
that.highlightMenu = function(id) {
|
||||||
var position = Ox.getIndexById(self.options.menus, id);
|
var position = Ox.getIndexById(self.options.menus, id);
|
||||||
self.highlightTimeout && clearTimeout(self.highlightTimeout);
|
self.highlightTimeout && clearTimeout(self.highlightTimeout);
|
||||||
that.titles[position].addClass('OxSelected');
|
that.titles[position].addClass('OxHighlight');
|
||||||
self.highlightTimeout = setTimeout(function() {
|
self.highlightTimeout = setTimeout(function() {
|
||||||
that.titles[position].removeClass('OxSelected');
|
that.titles[position].removeClass('OxHighlight');
|
||||||
delete self.highlightTimeout;
|
delete self.highlightTimeout;
|
||||||
}, 250);
|
}, 500);
|
||||||
};
|
};
|
||||||
|
|
||||||
that.removeMenu = function() {
|
that.removeMenu = function() {
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
"themeColorLightness": 0.25,
|
"themeColorLightness": 0.25,
|
||||||
|
|
||||||
"barGradient": [[224, 224, 224], [192, 192, 192]],
|
"barGradient": [[224, 224, 224], [192, 192, 192]],
|
||||||
|
"barHighlightColor": [255, 255, 255],
|
||||||
|
"barHighlightGradient": [[80, 144, 208], [48, 112, 178]],
|
||||||
"barSelectedColor": [255, 255, 255],
|
"barSelectedColor": [255, 255, 255],
|
||||||
"barSelectedGradient": [[80, 144, 208], [48, 112, 178]],
|
"barSelectedGradient": [[80, 144, 208], [48, 112, 178]],
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
"themeColorLightness": 0.75,
|
"themeColorLightness": 0.75,
|
||||||
|
|
||||||
"barGradient": [[64, 64, 64], [32, 32, 32]],
|
"barGradient": [[64, 64, 64], [32, 32, 32]],
|
||||||
|
"barHighlightColor": [0, 0, 0],
|
||||||
|
"barHighlightGradient": [[255, 255, 0], [192, 192, 0]],
|
||||||
"barSelectedColor": [255, 255, 255],
|
"barSelectedColor": [255, 255, 255],
|
||||||
"barSelectedGradient": [[80, 80, 80], [48, 48, 48]],
|
"barSelectedGradient": [[80, 80, 80], [48, 48, 48]],
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
"themeColorLightness": 0.25,
|
"themeColorLightness": 0.25,
|
||||||
|
|
||||||
"barGradient": [[224, 224, 224], [192, 192, 192]],
|
"barGradient": [[224, 224, 224], [192, 192, 192]],
|
||||||
|
"barHighlightColor": [0, 0, 0],
|
||||||
|
"barHighlightGradient": [[255, 255, 0], [192, 192, 0]],
|
||||||
"barSelectedColor": [0, 0, 0],
|
"barSelectedColor": [0, 0, 0],
|
||||||
"barSelectedGradient": [[208, 208, 208], [176, 176, 176]],
|
"barSelectedGradient": [[208, 208, 208], [176, 176, 176]],
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
"themeColorLightness": 0.25,
|
"themeColorLightness": 0.25,
|
||||||
|
|
||||||
"barGradient": [[160, 160, 160], [128, 128, 128]],
|
"barGradient": [[160, 160, 160], [128, 128, 128]],
|
||||||
|
"barHighlightColor": [0, 0, 0],
|
||||||
|
"barHighlightGradient": [[255, 255, 0], [192, 192, 0]],
|
||||||
"barSelectedColor": [255, 255, 255],
|
"barSelectedColor": [255, 255, 255],
|
||||||
"barSelectedGradient": [[128, 128, 128], [96, 96, 96]],
|
"barSelectedGradient": [[128, 128, 128], [96, 96, 96]],
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue