diff --git a/src/content/js/restclient.main.js b/src/content/js/restclient.main.js index 25237d9..04bb337 100644 --- a/src/content/js/restclient.main.js +++ b/src/content/js/restclient.main.js @@ -182,62 +182,18 @@ restclient.main = { }, changeSkin: function (theme) { this.currentTheme = theme; - $("link").remove(); + $('link[href^="css/themes/"]').remove(); $("", { rel: "stylesheet", type: "text/css", href: "css/themes/" + theme + "/bootstrap.css" - }).appendTo("head"); - $("", { + }).add("", { rel: "stylesheet", type: "text/css", href: "css/themes/" + theme + "/bootstrap-responsive.css" - }).appendTo("head"); - $("", { - rel: "stylesheet", - type: "text/css", - href: "css/font-awesome.css" - }).appendTo("head"); - $("", { - rel: "stylesheet", - type: "text/css", - href: "css/restclient.css" - }).appendTo("head"); - $("", { - rel: "stylesheet", - type: "text/css", - href: "css/XMLPrettyPrint.css" - }).appendTo("head"); - $("", { - rel: "stylesheet", - type: "text/css", - href: "css/prettify.css" - }).appendTo("head"); - $("", { - rel: "stylesheet", - type: "text/css", - href: "css/KelpJSONView.css" - }).appendTo("head"); - $("", { - rel: "stylesheet", - type: "text/css", - href: "css/bootstrap-tagsinput.css" - }).appendTo("head"); - $("", { - rel: "stylesheet", - type: "text/css", - href: "css/bootstrap-switch.css" - }).appendTo("head"); - $("", { - rel: "stylesheet", - type: "text/css", - href: "css/animate.css" - }).appendTo("head"); - $("", { - rel: "stylesheet", - type: "text/css", - href: "css/restclient.bookmark.css" - }).appendTo("head"); + }).on('error', function() { + restclient.main.changeSkin('cerulean'); + }).insertBefore($('head > link[rel="stylesheet"]').first()); }, initSkin: function () { var requestHeaderLayout = restclient.getPref('requestHeaderLayout', 'tag'), @@ -262,7 +218,7 @@ restclient.main = { $('.enable-curl').text('Disable cURL'); } - var defaultTheme = restclient.getPref('defaultSkin', 'simplex'); + var defaultTheme = restclient.getPref('defaultSkin', 'cerulean'); restclient.main.changeSkin(defaultTheme); $('a[data-theme]').click(function () { restclient.main.changeSkin($(this).attr('data-theme')); diff --git a/src/content/restclient.html b/src/content/restclient.html index d3b9671..4d54b1a 100644 --- a/src/content/restclient.html +++ b/src/content/restclient.html @@ -4,9 +4,18 @@