
org.kohsuke.stapler.bind.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of stapler-core Show documentation
Show all versions of stapler-core Show documentation
Stapler HTTP request handling engine
The newest version!
// included into the page as an adjunct
// @include org.kohsuke.stapler.framework.prototype.prototype
function makeStaplerProxy(url,crumb,methods) {
if (!url.endsWith('/')) url+='/';
var proxy = {};
methods.each(function(methodName) {
proxy[methodName] = function() {
var args = arguments;
// the final argument can be a callback that receives the return value
var callback = (function(){
if (args.length==0) return null;
var tail = args[args.length-1];
return (typeof(tail)=='function') ? tail : null;
})();
// 'arguments' is not an array so we convert it into an array
var a = [];
for (var i=0; i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy