adding some css, removing some print statements

This commit is contained in:
Rolux 2010-06-29 14:57:42 +02:00
parent 2773a5a545
commit e7d2a5de0a
2 changed files with 3 additions and 47 deletions

View File

@ -252,7 +252,6 @@ requires
return { return {
// make these bind, trigger, unbind // make these bind, trigger, unbind
publish: function(event, data) { publish: function(event, data) {
Ox.print("publish", event, data);
if (events[event]) { if (events[event]) {
$.each(events[event], function(i, v) { $.each(events[event], function(i, v) {
setTimeout(function() { setTimeout(function() {
@ -262,7 +261,6 @@ requires
} }
}, },
subscribe: function(event, callback) { subscribe: function(event, callback) {
Ox.print("subscribe", event, callback);
if (events[event]) { if (events[event]) {
events[event].push(callback); events[event].push(callback);
} else { } else {
@ -270,7 +268,6 @@ requires
} }
}, },
unsubscribe: function(event, callback) { unsubscribe: function(event, callback) {
Ox.print("unsubscribe", event, callback);
$.each(events[event], function(i, v) { $.each(events[event], function(i, v) {
if (Ox.startsWith(callback.toString(), v.toString())) { if (Ox.startsWith(callback.toString(), v.toString())) {
events[event].splice(i, 1); events[event].splice(i, 1);
@ -686,7 +683,6 @@ requires
data: data, data: data,
time: Ox.getTime() time: Ox.getTime()
}; };
//Ox.print("callback", callback, "options.callback", options.callback, "data", data)
callback(data); callback(data);
} }
@ -875,7 +871,6 @@ requires
*/ */
self.defaults = defaults; self.defaults = defaults;
delete self.options; // fixme: hackish fix for that = Ox.Foo({...}, self).defaults({...}).options({...}) delete self.options; // fixme: hackish fix for that = Ox.Foo({...}, self).defaults({...}).options({...})
Ox.print("self.defaults", self.defaults, "self.options", self.options)
return that; return that;
}; };
that.gainFocus = function() { that.gainFocus = function() {
@ -912,7 +907,6 @@ requires
// options (str, val) or options({str: val, ...}) // options (str, val) or options({str: val, ...})
// translate (str, val) to ({str: val}) // translate (str, val) to ({str: val})
args = Ox.makeObject.apply(that, arguments); args = Ox.makeObject.apply(that, arguments);
Ox.print("args", args, "self.options", self.options, "self.defaults", self.defaults)
/* /*
options = self.options; options = self.options;
*/ */
@ -1457,9 +1451,7 @@ requires
} }
that.open = function() { that.open = function() {
Ox.print("opening...")
that.$layer.appendTo($body); that.$layer.appendTo($body);
Ox.print("opening...")
center(); center();
reset(); reset();
that.css({ that.css({
@ -1610,7 +1602,6 @@ requires
} }
} }
if (self.options.values.length == 2) { if (self.options.values.length == 2) {
Ox.print("2 values")
that.options({ that.options({
value: self.options.value == self.options.values[0] ? value: self.options.value == self.options.values[0] ?
self.options.values[1] : self.options.values[0] self.options.values[1] : self.options.values[0]
@ -1620,14 +1611,12 @@ requires
} }
self.onChange = function(key, value) { self.onChange = function(key, value) {
//Ox.print("setOption", option, value) //Ox.print("setOption", option, value)
Ox.print("OxButton onChange", key, value)
if (key == "selected") { if (key == "selected") {
if (value != that.hasClass("OxSelected")) { // fixme: neccessary? if (value != that.hasClass("OxSelected")) { // fixme: neccessary?
that.toggleClass("OxSelected"); that.toggleClass("OxSelected");
} }
that.triggerEvent("change"); that.triggerEvent("change");
} else if (key == "value") { } else if (key == "value") {
Ox.print("OxButton onChange value", value)
if (self.options.type == "image") { if (self.options.type == "image") {
that.attr({ that.attr({
src: oxui.path + "png/ox.ui." + Ox.theme() + src: oxui.path + "png/ox.ui." + Ox.theme() +
@ -1702,7 +1691,6 @@ requires
function onChange(event, data) { function onChange(event, data) {
console.log("event", event, "data", data) console.log("event", event, "data", data)
var id = event.split("_")[1]; var id = event.split("_")[1];
Ox.print("OK")
if (self.options.selected > -1) { if (self.options.selected > -1) {
that.$buttons[self.options.selected].toggleSelected(); that.$buttons[self.options.selected].toggleSelected();
} }
@ -1895,7 +1883,6 @@ requires
function call() { function call() {
var value = that.$input.val(); var value = that.$input.val();
if (self.options.autocomplete) { if (self.options.autocomplete) {
//Ox.print("###", self.option, value, callback)
Ox.isFunction(self.options.autocomplete) ? ( Ox.isFunction(self.options.autocomplete) ? (
self.option ? self.option ?
self.options.autocomplete(self.option, value, callback) : self.options.autocomplete(self.option, value, callback) :
@ -1984,7 +1971,6 @@ requires
} }
function onClick(event, data) { function onClick(event, data) {
Ox.print("onClick", data)
that.$input.focus().val(Ox.stripTags(data.title)); that.$input.focus().val(Ox.stripTags(data.title));
self.autocompleteMenu.hideMenu(); self.autocompleteMenu.hideMenu();
submit(); submit();
@ -2159,7 +2145,6 @@ requires
c = $image[0].getContext('2d'); c = $image[0].getContext('2d');
c.mozImageSmoothingEnabled = false; // we may want to remove this later c.mozImageSmoothingEnabled = false; // we may want to remove this later
$.each(self.options.trackImages, function(i, v) { $.each(self.options.trackImages, function(i, v) {
//Ox.print(v)
$("<img/>") $("<img/>")
.attr({ .attr({
src: v src: v
@ -2250,7 +2235,6 @@ requires
value: val value: val
}); });
setThumb(animate); setThumb(animate);
//Ox.print("triggering OxRange" + that.id + "Change")
that.triggerEvent("change", { value: val }); that.triggerEvent("change", { value: val });
} }
} }
@ -2353,7 +2337,6 @@ requires
} }
function clickMenu(event, data) { function clickMenu(event, data) {
Ox.print("clickMenu", event, data)
that.$button.options({ that.$button.options({
value: data.value value: data.value
}); });
@ -2401,8 +2384,6 @@ requires
.options(options || {}) .options(options || {})
.scroll(scroll); .scroll(scroll);
Ox.print("List options", options, self, self.options);
$.extend(self, { $.extend(self, {
$items: [], $items: [],
$pages: [], $pages: [],
@ -2423,7 +2404,6 @@ requires
pageHeight: self.options.orientation == "horizontal" ? 0 : pageHeight: self.options.orientation == "horizontal" ? 0 :
self.pageLength * self.options.itemHeight / self.options.rowLength self.pageLength * self.options.itemHeight / self.options.rowLength
}); });
Ox.print("List self", self);
loadPages(self.page); loadPages(self.page);
} }
}); });
@ -2530,12 +2510,9 @@ requires
var offset = page * self.pageLength, var offset = page * self.pageLength,
range = [offset, offset + (page < self.pages - 1 ? range = [offset, offset + (page < self.pages - 1 ?
self.pageLength : self.listLength % self.pageLength)]; self.pageLength : self.listLength % self.pageLength)];
Ox.print("page", self.$pages[page]);
if (Ox.isUndefined(self.$pages[page])) { if (Ox.isUndefined(self.$pages[page])) {
Ox.print("request...")
self.requests.push(self.options.request({ self.requests.push(self.options.request({
callback: function(result) { callback: function(result) {
Ox.print("callback", result)
self.$pages[page] = new Ox.ListPage(); self.$pages[page] = new Ox.ListPage();
if (self.options.type == "text") { if (self.options.type == "text") {
self.$pages[page].css({ self.$pages[page].css({
@ -2719,14 +2696,10 @@ requires
}) })
.options(options || {}) .options(options || {})
Ox.print("ListItem self", self, "options", options)
$.each(self.options.data, function(k, v) { $.each(self.options.data, function(k, v) {
self.options.data[k] = $.isArray(v) ? v.join(", ") : v; self.options.data[k] = $.isArray(v) ? v.join(", ") : v;
}); });
Ox.print("ListItem self", self, "options", options)
that.append(self.options.construct(self.options.data, self.options.pos)); that.append(self.options.construct(self.options.data, self.options.pos));
return that; return that;
@ -2766,7 +2739,6 @@ requires
$.extend(self, { $.extend(self, {
pageHeight: self.pageLength * self.itemHeight pageHeight: self.pageLength * self.itemHeight
}); });
Ox.print("TextList self", self);
// Head // Head
@ -2875,15 +2847,13 @@ requires
function constructItem(data, pos) { function constructItem(data, pos) {
var $item = $("<div>") var $item = $("<div>")
.addClass("OxListItem") .addClass("OxItem")
.css({ .css({
width: Ox.sum(self.columnWidths) + "px" width: Ox.sum(self.columnWidths) + "px"
}) })
.data("pos", pos) .data("pos", pos)
.click(function() {}); .click(function() {});
Ox.print(1);
$.each(self.visibleColumns, function(i, v) { $.each(self.visibleColumns, function(i, v) {
Ox.print(data, v.id)
var $cell = $("<div>") var $cell = $("<div>")
.addClass("OxCell OxColumn" + Ox.toTitleCase(v.id)) .addClass("OxCell OxColumn" + Ox.toTitleCase(v.id))
.css({ .css({
@ -2893,7 +2863,6 @@ requires
.html(data[v.id]) .html(data[v.id])
.appendTo($item) .appendTo($item)
}); });
Ox.print(2);
return $item; return $item;
} }
@ -2948,6 +2917,7 @@ requires
} }
function toggleSelected(pos) { function toggleSelected(pos) {
Ox.print("toggleSelected", pos)
if (pos > 0) { if (pos > 0) {
that.$titles[pos].prev().children().eq(2).toggleClass("OxSelected"); that.$titles[pos].prev().children().eq(2).toggleClass("OxSelected");
} }
@ -3025,7 +2995,6 @@ requires
that.bindEvent("hide_" + that.menus[position].options("id"), onHideMenu); that.bindEvent("hide_" + that.menus[position].options("id"), onHideMenu);
}); });
Ox.print(self.options)
if (self.options.extras.length) { if (self.options.extras.length) {
that.extras = $("<div>") that.extras = $("<div>")
.addClass("OxExtras") .addClass("OxExtras")
@ -3050,11 +3019,9 @@ requires
that.menus[self.selected].hideMenu(); that.menus[self.selected].hideMenu();
} }
if (position > -1) { if (position > -1) {
Ox.print("position", position, "self.selected", self.selected)
if (position != selected) { if (position != selected) {
self.focused = true; self.focused = true;
self.selected = position; self.selected = position;
Ox.print("position", position, "setting self.selected", self.selected)
that.titles[self.selected].addClass("OxSelected"); that.titles[self.selected].addClass("OxSelected");
that.menus[self.selected].showMenu(); that.menus[self.selected].showMenu();
} }
@ -3078,7 +3045,6 @@ requires
} }
function onHideMenu() { function onHideMenu() {
Ox.print("hideMenu self.selected", self.selected)
if (self.selected > -1) { if (self.selected > -1) {
that.titles[self.selected].removeClass("OxSelected"); that.titles[self.selected].removeClass("OxSelected");
self.selected = -1; self.selected = -1;
@ -3234,7 +3200,6 @@ requires
function clickItem(position) { function clickItem(position) {
var item = that.items[position]; var item = that.items[position];
Ox.print("clickItem", position, item.options("items").length)
if (!item.options("items").length) { if (!item.options("items").length) {
if (that.options("parent")) { if (that.options("parent")) {
that.options("parent").hideMenu().triggerEvent("click"); that.options("parent").hideMenu().triggerEvent("click");
@ -3303,7 +3268,6 @@ requires
} }
}); });
if (!that.is(":hidden")) { if (!that.is(":hidden")) {
Ox.print("hide&show")
that.hideMenu(); that.hideMenu();
that.showMenu(); that.showMenu();
} }
@ -3520,7 +3484,6 @@ requires
selectItem(selected); selectItem(selected);
} }
offset = that.items[selected].offset().top - that.$container.offset().top; offset = that.items[selected].offset().top - that.$container.offset().top;
Ox.print(offset);
if (offset < 0) { if (offset < 0) {
if (that.$scrollbars.down.is(":hidden")) { if (that.$scrollbars.down.is(":hidden")) {
that.$scrollbars.down.show(); that.$scrollbars.down.show();
@ -3556,7 +3519,6 @@ requires
that.items[self.options.selected].trigger("mouseleave"); that.items[self.options.selected].trigger("mouseleave");
self.options.parent.gainFocus(); self.options.parent.gainFocus();
} else if (self.options.mainmenu) { } else if (self.options.mainmenu) {
Ox.print("previousMenu")
self.options.mainmenu.selectPreviousMenu(); self.options.mainmenu.selectPreviousMenu();
} }
} }
@ -3603,7 +3565,6 @@ requires
}; };
that.hideMenu = function() { that.hideMenu = function() {
Ox.print("hideMenu")
$.each(that.submenus, function(i, submenu) { $.each(that.submenus, function(i, submenu) {
if (submenu.is(":visible")) { if (submenu.is(":visible")) {
submenu.hideMenu(); submenu.hideMenu();
@ -3644,7 +3605,6 @@ requires
}; };
that.showMenu = function() { that.showMenu = function() {
Ox.print("showMenu");
if (!self.options.parent && !that.$layer.parent().length) { if (!self.options.parent && !that.$layer.parent().length) {
that.$layer.appendTo($body); that.$layer.appendTo($body);
} }
@ -3660,7 +3620,6 @@ requires
top = offset.top + self.options.offset.top + (self.options.side == "bottom" ? height : 0), top = offset.top + self.options.offset.top + (self.options.side == "bottom" ? height : 0),
menuHeight = that.$content.outerHeight(); // fixme: why is outerHeight 0 when hidden? menuHeight = that.$content.outerHeight(); // fixme: why is outerHeight 0 when hidden?
menuMaxHeight = Math.floor($window.height() - top - 16), menuMaxHeight = Math.floor($window.height() - top - 16),
Ox.print("menuHeight", menuHeight, "menuMaxHeight", menuMaxHeight, that.items.length);
if (self.options.parent) { if (self.options.parent) {
if (menuHeight > menuMaxHeight) { if (menuHeight > menuMaxHeight) {
top = Ox.limit(top - menuHeight + menuMaxHeight, self.options.parent.offset().top, top); top = Ox.limit(top - menuHeight + menuMaxHeight, self.options.parent.offset().top, top);
@ -3694,7 +3653,6 @@ requires
}; };
that.toggleMenu = function() { that.toggleMenu = function() {
Ox.print("toggleMenu")
that.is(":hidden") ? that.showMenu() : that.hideMenu(); that.is(":hidden") ? that.showMenu() : that.hideMenu();
}; };
@ -3779,7 +3737,6 @@ requires
} }
self.onChange = function(key, value) { self.onChange = function(key, value) {
Ox.print("MenuItem", self.options.id, "onChange", key, value);
if (key == "checked") { if (key == "checked") {
if (value && self.options.group) { if (value && self.options.group) {
$.each(self.options.menu.items, function(i, item) { $.each(self.options.menu.items, function(i, item) {
@ -3944,7 +3901,6 @@ requires
dimensions = oxui.getDimensions(self.options.orientation), dimensions = oxui.getDimensions(self.options.orientation),
edges = oxui.getEdges(self.options.orientation); edges = oxui.getEdges(self.options.orientation);
$.each(self.options.elements, function(i, v) { $.each(self.options.elements, function(i, v) {
Ox.print("v", v);
var element = v.element var element = v.element
.css({ .css({
position: "absolute" // fixme: this can go into a class position: "absolute" // fixme: this can go into a class

View File

@ -53,7 +53,7 @@ $(function() {
conditions: [ conditions: [
{ {
key: "country", key: "country",
value: "france", value: "",
operator: "" operator: ""
} }
], ],