aboutsummaryrefslogtreecommitdiffstats
path: root/template-common/scripts.js
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2009-12-18 21:08:21 +0000
committerrvelices <rv-github@modusoptimus.com>2009-12-18 21:08:21 +0000
commit8b66788392652515532a89e0dd7e3af594272cb4 (patch)
tree2d93c632523b9d0dfe8c536747dd2fe6adfef6be /template-common/scripts.js
parent2a9b358dc8ebe8f1a077c88e7e7e49813c34a829 (diff)
web method images.setPrivacyLevel (ws_images_setPrivacyLevel) is POST only
git-svn-id: http://piwigo.org/svn/branches/2.0@4512 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--template-common/scripts.js58
1 files changed, 35 insertions, 23 deletions
diff --git a/template-common/scripts.js b/template-common/scripts.js
index f6b22b41c..389ed1b21 100644
--- a/template-common/scripts.js
+++ b/template-common/scripts.js
@@ -71,6 +71,23 @@ function popuphelp(url)
}
+function blockToggleDisplay(headerId, contentId)
+{
+ var revHeader = document.getElementById(headerId);
+ var revContent = document.getElementById(contentId);
+
+ if (revContent.style.display == 'none')
+ {
+ revContent.style.display = 'block';
+ revHeader.className = 'instructionBlockHeaderExpanded';
+ }
+ else
+ {
+ revContent.style.display = 'none';
+ revHeader.className = 'instructionBlockHeaderCollapsed';
+ }
+}
+
Function.prototype.pwgBind = function() {
var __method = this, object = arguments[0], args = new Array();
@@ -90,23 +107,6 @@ function PwgWS(urlRoot)
};
};
-function blockToggleDisplay(headerId, contentId)
-{
- var revHeader = document.getElementById(headerId);
- var revContent = document.getElementById(contentId);
-
- if (revContent.style.display == 'none')
- {
- revContent.style.display = 'block';
- revHeader.className = 'instructionBlockHeaderExpanded';
- }
- else
- {
- revContent.style.display = 'none';
- revHeader.className = 'instructionBlockHeaderCollapsed';
- }
-}
-
PwgWS.prototype = {
@@ -129,8 +129,9 @@ PwgWS.prototype = {
}
this.transport.onreadystatechange = this.onStateChange.pwgBind(this);
- var url = this.urlRoot;
- url += "ws.php?format=json&method="+method;
+ var url = this.urlRoot+"ws.php?format=json";
+
+ var body = "method="+method;
if (parameters)
{
for (var property in parameters)
@@ -138,14 +139,25 @@ PwgWS.prototype = {
if ( typeof parameters[property] == 'object' && parameters[property])
{
for (var i=0; i<parameters[property].length; i++)
- url += "&"+property+"[]="+encodeURIComponent(parameters[property][i]);
+ body += "&"+property+"[]="+encodeURIComponent(parameters[property][i]);
}
else
- url += "&"+property+"="+encodeURIComponent(parameters[property]);
+ body += "&"+property+"="+encodeURIComponent(parameters[property]);
}
}
- this.transport.open(this.options.method, url, this.options.async);
- this.transport.send(null);
+
+ if (this.options.method == "POST" )
+ {
+ this.transport.open(this.options.method, url, this.options.async);
+ this.transport.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+ this.transport.send(body);
+ }
+ else
+ {
+ url += "&"+body;
+ this.transport.open(this.options.method, url, this.options.async);
+ this.transport.send(null);
+ }
},
onStateChange: function() {