From a63843e3ef6c1b372e2933dda222594e90086d20 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 27 Jan 2010 18:55:37 +0530 Subject: [PATCH] add app.request, extend demo --- build/css/ox.ui.classic.css | 2 +- build/js/ox.ui.js | 112 ++++++++++++++++++++++-------------- demos/test/app.html | 27 +++++---- 3 files changed, 86 insertions(+), 55 deletions(-) diff --git a/build/css/ox.ui.classic.css b/build/css/ox.ui.classic.css index 7849788..9cbeefc 100644 --- a/build/css/ox.ui.classic.css +++ b/build/css/ox.ui.classic.css @@ -110,4 +110,4 @@ Scrollbars .OxThemeClassic ::-webkit-scrollbar:active, .OxThemeClassic ::-webkit-scrollbar-thumb:vertical:active { background: rgb(192, 192, 192); -} \ No newline at end of file +} diff --git a/build/js/ox.ui.js b/build/js/ox.ui.js index 9443659..91033e0 100644 --- a/build/js/ox.ui.js +++ b/build/js/ox.ui.js @@ -105,6 +105,21 @@ requires return Ox.getset(self.options, Array.slice.call(arguments), self.change, that); }; + that.request = function(fn, data, callback) { + if(Ox.isFunction(data)) { + callback = data; + data = {}; + } + return Ox.Request.send({ + url: self.options.requestURL, + data: { + "function": fn, + data: JSON.stringify(data) + }, + callback: callback + }); + }; + return that; }; @@ -442,50 +457,59 @@ requires } function error(request, status, error) { - var $dialog = new Ox.Dialog({ - title: "Error: Remote request failed.", - buttons: [ - new Ox.Button({ - value: "Details", - click: function() { - var $iframe = $("