summaryrefslogtreecommitdiff
path: root/frontend/gamma
authorGiulio Cesare Solaroli <giulio.cesare@clipperz.com>2011-10-23 17:36:57 (UTC)
committer Giulio Cesare Solaroli <giulio.cesare@clipperz.com>2011-10-23 17:36:57 (UTC)
commit67455b069c4c9ec493f9cef76017e172a430a7d4 (patch) (side-by-side diff)
tree0b287debfeeb0819b3df9dd02860cd84103e25b3 /frontend/gamma
parentb312e037ebba7c94abea9661bcf62c52b7d73fbf (diff)
downloadclipperz-67455b069c4c9ec493f9cef76017e172a430a7d4.zip
clipperz-67455b069c4c9ec493f9cef76017e172a430a7d4.tar.gz
clipperz-67455b069c4c9ec493f9cef76017e172a430a7d4.tar.bz2
Integration of PHP backend with /beta and /gamma front ends
Fixed PHP backend and /beta code to handle request and data format compatible with /gamma. At the moment adding/deleting/editing records seem to work fine.
Diffstat (limited to 'frontend/gamma') (more/less context) (show whitespace changes)
-rw-r--r--frontend/gamma/html/index_template.html5
-rw-r--r--frontend/gamma/js/Clipperz/Async.js19
-rw-r--r--frontend/gamma/js/Clipperz/PM/Proxy.js2
3 files changed, 19 insertions, 7 deletions
diff --git a/frontend/gamma/html/index_template.html b/frontend/gamma/html/index_template.html
index 8cf838c..bedb243 100644
--- a/frontend/gamma/html/index_template.html
+++ b/frontend/gamma/html/index_template.html
@@ -26,32 +26,37 @@ Clipperz_normalizedNewLine = '\x0d\x0a';
@js_DEBUG@
</head>
<body>
<div id="mainDiv">
<div id="loading">
<a href="http://www.clipperz.com" target="_blank"><div id="logo"></div></a>
<h5 class="clipperzPayoff">keep it to yourself!</h5>
<h2>loading ...</h2>
</div>
@js_INSTALL@
</div>
<div id="applicationVersionType" class="@application.version.type@"></div>
+<script>
+ Clipperz.PM.Proxy.defaultProxy = new Clipperz.PM.Proxy.JSON({'url':'@request.path@', 'shouldPayTolls':@should.pay.toll@});
+ /*offline_data_placeholder*/
+</script>
+
<!-- -->
<div id="javaScriptAlert">
<div class="mask"></div>
<div class="message">
<div class="header"></div>
<div class="body">
<div class="alertLogo"></div>
<div class="alert">
<h1>Attention!</h1>
<p>If you can read this message, the chances are that your browser does not properly support JavaScript? or you have disabled this functionality yourself.</p>
<h3>Javascript is required to access Clipperz.</h3>
<h5>Please enable scripting or upgrade your browser.</h5>
</div>
</div>
<div class="footer"></div>
</div>
diff --git a/frontend/gamma/js/Clipperz/Async.js b/frontend/gamma/js/Clipperz/Async.js
index 7c9d783..97d8ecf 100644
--- a/frontend/gamma/js/Clipperz/Async.js
+++ b/frontend/gamma/js/Clipperz/Async.js
@@ -49,88 +49,94 @@ Clipperz.Async.Deferred = function(aName, args) {
//=============================================================================
Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, {
'name': function () {
return this._name;
},
'args': function () {
return this._args;
},
//-----------------------------------------------------------------------------
'callback': function (aValue) {
if (this._shouldTrace) {
- Clipperz.log("CALLBACK " + this._name, aValue);
+ // Clipperz.log("CALLBACK " + this._name, aValue);
+ console.log("CALLBACK " + this._name, aValue);
}
if (this.chained == false) {
var message;
message = "ERROR [" + this._name + "]";
this.addErrback(function(aResult) {
if (! (aResult instanceof MochiKit.Async.CancelledError)) {
Clipperz.log(message, aResult);
}
return aResult;
});
if (this._shouldTrace) {
var resultMessage;
resultMessage = "RESULT " + this._name + " <==";
// this.addCallback(function(aResult) {
Clipperz.Async.Deferred.superclass.addCallback.call(this, function(aResult) {
- Clipperz.log(resultMessage, aResult);
+ // Clipperz.log(resultMessage, aResult);
+ console.log(resultMessage, aResult);
return aResult;
});
}
}
if (CLIPPERZ_DEFERRED_CALL_LOGGING_ENABLED === true) {
Clipperz.log("callback " + this._name, this);
}
return Clipperz.Async.Deferred.superclass.callback.apply(this, arguments);
},
//-----------------------------------------------------------------------------
'addCallback': function () {
var message;
if (this._shouldTrace) {
this._count ++;
message = "[" + this._count + "] " + this._name + " ";
// this.addBoth(function(aResult) {Clipperz.log(message + "-->", aResult); return aResult;});
this.addCallbacks(
- function(aResult) {Clipperz.log("-OK- " + message + "-->"/*, aResult*/); return aResult;},
- function(aResult) {Clipperz.log("FAIL " + message + "-->"/*, aResult*/); return aResult;}
+ // function(aResult) {Clipperz.log("-OK- " + message + "-->"/*, aResult*/); return aResult;},
+ function(aResult) {console.log("-OK- " + message + "-->"/*, aResult*/); return aResult;},
+ // function(aResult) {Clipperz.log("FAIL " + message + "-->"/*, aResult*/); return aResult;}
+ function(aResult) {console.log("FAIL " + message + "-->"/*, aResult*/); return aResult;}
);
}
Clipperz.Async.Deferred.superclass.addCallback.apply(this, arguments);
if (this._shouldTrace) {
// this.addBoth(function(aResult) {Clipperz.log(message + "<--", aResult); return aResult;});
this.addCallbacks(
- function(aResult) {Clipperz.log("-OK- " + message + "<--", aResult); return aResult;},
- function(aResult) {Clipperz.log("FAIL " + message + "<--", aResult); return aResult;}
+ // function(aResult) {Clipperz.log("-OK- " + message + "<--", aResult); return aResult;},
+ function(aResult) {console.log("-OK- " + message + "<--", aResult); return aResult;},
+ // function(aResult) {Clipperz.log("FAIL " + message + "<--", aResult); return aResult;}
+ function(aResult) {console.log("FAIL " + message + "<--", aResult); return aResult;}
);
}
},
//=============================================================================
'addCallbackPass': function() {
var passFunction;
passFunction = MochiKit.Base.partial.apply(null, arguments);
this.addCallback(function() {
var result;
result = arguments[arguments.length -1];
passFunction();
@@ -393,32 +399,33 @@ MochiKit.Base.update(Clipperz.Async.DeferredSynchronizer.prototype, {
}
return this.result();
},
//-----------------------------------------------------------------------------
'handleMethodCallDone': function(anIndexValue, aResult) {
this.incrementNumberOfMethodsDone();
this.methodResults()[anIndexValue] = aResult;
if (this.numberOfMethodsDone() < this.methods().length) {
// nothing to do here other than possibly log something
} else if (this.numberOfMethodsDone() == this.methods().length) {
this.result().callback();
} else if (this.numberOfMethodsDone() > this.methods().length) {
+ alert("Clipperz.Async.Deferred.handleMethodCallDone -> WTF!");
// WTF!!! :(
}
},
//-----------------------------------------------------------------------------
__syntaxFix__: "syntax fix"
});
//#############################################################################
MochiKit.Base.update(Clipperz.Async, {
'callbacks': function (aName, someFunctions, someArguments, aCallbackValue) {
var deferredResult;
diff --git a/frontend/gamma/js/Clipperz/PM/Proxy.js b/frontend/gamma/js/Clipperz/PM/Proxy.js
index 190bffd..9817eac 100644
--- a/frontend/gamma/js/Clipperz/PM/Proxy.js
+++ b/frontend/gamma/js/Clipperz/PM/Proxy.js
@@ -129,33 +129,33 @@ Clipperz.PM.Proxy.prototype = MochiKit.Base.update(null, {
return this.processMessage('handshake', someParameters, 'CONNECT');
},
'message': function (someParameters) {
return this.processMessage('message', someParameters, 'MESSAGE');
},
'logout': function (someParameters) {
return this.processMessage('logout', someParameters, 'MESSAGE');
},
//=========================================================================
'processMessage': function (aFunctionName, someParameters, aRequestType) {
var deferredResult;
- deferredResult = new Clipperz.Async.Deferred("Proxy.processMessage", {trace:false});
+ deferredResult = new Clipperz.Async.Deferred("Proxy.processMessage", {trace:true});
deferredResult.addMethod(this, 'payToll', aRequestType);
deferredResult.addMethod(this, 'sendMessage', aFunctionName);
deferredResult.addMethod(this, 'setTollCallback');
deferredResult.callback(someParameters);
return deferredResult;
},
//=========================================================================
'sendMessage': function () {
throw Clipperz.Base.exception.AbstractMethod;
},
//=========================================================================