/*
 * hyLink urls
 *
 * 02 / 10 / 2010 william@hypios.com
 *
 */

/* We could generate the urls from ocsigen, or at least the url table */

var services = new Object ()

services.wiki_save = "/ajax/update/%s"
services.wiki_get_markup = "/ajax/source/%s"

services.hide_job = "/ajax/hide_job/%s"
/* This function create the uri and apply the arguments, using vargs */
function make_uri () {
    var uri_scheme ; 
    var uri ; 
    var argv ;

    uri_scheme = services[ arguments[0] ] ;
    if (!uri_scheme) throw new Error ("Unknown ressource");
    
    argv = Array.apply(null, arguments).slice(1);

    uri = $.vsprintf ( uri_scheme, argv ) ; 

    return uri ;         
}

// Example : alert ( make_uri ("wiki_save", "test", "encore" )); 
