summaryrefslogtreecommitdiffstats
path: root/qx08/source/class/tr/Server.js
diff options
context:
space:
mode:
authorTobi Oetiker <tobi@oetiker.ch>2008-11-04 11:14:06 +0100
committerTobi Oetiker <tobi@oetiker.ch>2008-11-04 11:14:06 +0100
commit996d9e92e597bc462d874b335865ff7844e2d332 (patch)
tree136211ddffb3eebacf540783a82bd7e31bc34f9b /qx08/source/class/tr/Server.js
parent2bb54a7dd3145c431b0e63cfd83df37f9a4b40d4 (diff)
downloadsmokeping-996d9e92e597bc462d874b335865ff7844e2d332.tar.gz
smokeping-996d9e92e597bc462d874b335865ff7844e2d332.tar.xz
added 0.8 port
Diffstat (limited to 'qx08/source/class/tr/Server.js')
-rw-r--r--qx08/source/class/tr/Server.js72
1 files changed, 72 insertions, 0 deletions
diff --git a/qx08/source/class/tr/Server.js b/qx08/source/class/tr/Server.js
new file mode 100644
index 0000000..89496f1
--- /dev/null
+++ b/qx08/source/class/tr/Server.js
@@ -0,0 +1,72 @@
+/* ************************************************************************
+#module(Tr)
+************************************************************************ */
+
+/**
+ * A Tr specific rpc call which works
+ */
+
+qx.Class.define('Tr.Server', {
+ extend: qx.io.remote.Rpc,
+ type: "singleton",
+
+ /*
+ *****************************************************************************
+ CONSTRUCTOR
+ *****************************************************************************
+ */
+
+ /**
+ * @param local_url {String} When running the application in file:// mode.
+ * where will we find our RPC server.
+ */
+ construct: function (local_url) {
+ this.base(arguments);
+ this.set({
+ timeout: 7000000,
+ url: 'tr.cgi',
+ serviceName: 'Tr',
+ crossDomain: true
+ });
+ return this;
+ },
+
+ /*
+ *****************************************************************************
+ MEMBERS
+ *****************************************************************************
+ */
+
+ members :
+ {
+
+ /*
+ ---------------------------------------------------------------------------
+ CORE METHODS
+ ---------------------------------------------------------------------------
+ */
+
+ /**
+ * Tell about the BaseUrl we found.
+ *
+ * @type member
+ *
+ * @param {void}
+ *
+ * @return BaseUrl {Strings}
+ */
+
+ getBaseUrl: function(){
+ return this.__base_url;
+ },
+
+ setLocalUrl: function(local_url){
+ if ( document.location.host === '' ) {
+ with(this){
+ setUrl(local_url+'tr.cgi');
+ }
+ }
+ }
+
+ }
+});