extjsテーマ切替(switch themes)


http://extjs.com/forum/showthread.php?t=2420&highlight=theme
Ext.theme = function() {
    return{
        apply:function(A) {
            A = A.id ? A.id : A;
            Cookies.set("xrinsurtheme", A);
            Ext.util.CSS.swapStyleSheet("theme", getSitePath() + "/extjs/resources/css/ytheme-" + A + ".css");
            Ext.util.CSS.swapStyleSheet("theme", getSitePath() + "/extjs/resources/css/xtheme-" + A + ".css");
        }
    }
} ();
var path = getSitePath();


function getSitePath() {
    var B = document.location.protocol, C = document.location.host, D = document.location.pathname, A = document.location.search, E = B + "//" + C + "/" + (D.split("/"))[1];
    return E;
}
function setSitePath(A) {
    return path + "/" + A;
}
公式提供のテーマ:http://extjs.com/learn/Ext_Extensions萝Ext啝2.0_Themes