adding some css, removing some print statements

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

View file

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

View file

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