Committer: pkornilov
LJSUP-7932: Add ability to view names of ml vars using uselang debug for iframesU trunk/htdocs/js/livejournal.js
Modified: trunk/htdocs/js/livejournal.js =================================================================== --- trunk/htdocs/js/livejournal.js 2011-02-12 06:53:42 UTC (rev 18284) +++ trunk/htdocs/js/livejournal.js 2011-02-14 02:56:08 UTC (rev 18285) @@ -144,12 +144,20 @@ } // gets a url for doing ajax requests -LiveJournal.getAjaxUrl = function (action) { - // if we are on a journal subdomain then our url will be - // /journalname/__rpc_action instead of /__rpc_action - return Site.currentJournal - ? "/" + Site.currentJournal + "/__rpc_" + action - : "/__rpc_" + action; +LiveJournal.getAjaxUrl = function(action, params) { + // if we are on a journal subdomain then our url will be + // /journalname/__rpc_action instead of /__rpc_action + var uselang = LiveJournal.parseGetArgs(location.search).uselang; + if (uselang) { + action += "?uselang=" + uselang; + } + if (params) { + action += (uselang ? "&" : "?") + jQuery.param(params); + } + + return Site.currentJournal + ? "/" + Site.currentJournal + "/__rpc_" + action + : "/__rpc_" + action; }; // generic handler for ajax errors