$(function () {
/* For demo purposes */
var demo = $("
").css({
position: "fixed",
top: "70px",
right: "0",
background: "#fff",
"border-radius": "5px 0px 0px 5px",
padding: "10px 15px",
"font-size": "16px",
"z-index": "99999",
cursor: "pointer",
color: "#3c8dbc",
"box-shadow": "0 1px 3px rgba(0,0,0,0.1)"
}).html("").addClass("no-print");
var demo_settings = $("").css({
"padding": "10px",
position: "fixed",
top: "70px",
right: "-250px",
background: "#fff",
border: "0px solid #ddd",
"width": "250px",
"z-index": "99999",
"box-shadow": "0 1px 3px rgba(0,0,0,0.1)"
}).addClass("no-print");
demo_settings.append(
"Layout Options
"
//Fixed layout
+ ""
//Boxed layout
+ ""
//Sidebar Collapse
+ ""
);
var skins_list = $("", {"class": 'list-unstyled'});
var skin_blue =
$("", {style: "float:left; width: 50%; padding: 5px;"})
.append(""
+ "
"
+ "
"
+ "Skin Blue
"
+ "");
skins_list.append(skin_blue);
var skin_black =
$("", {style: "float:left; width: 50%; padding: 5px;"})
.append(""
+ "
"
+ "
"
+ "Skin Black
"
+ "");
skins_list.append(skin_black);
var skin_purple =
$("", {style: "float:left; width: 50%; padding: 5px;"})
.append(""
+ "
"
+ "
"
+ "Skin Purple
"
+ "");
skins_list.append(skin_purple);
var skin_green =
$("", {style: "float:left; width: 50%; padding: 5px;"})
.append(""
+ "
"
+ "
"
+ "Skin Green
"
+ "");
skins_list.append(skin_green);
var skin_red =
$("", {style: "float:left; width: 50%; padding: 5px;"})
.append(""
+ "
"
+ "
"
+ "Skin Red
"
+ "");
skins_list.append(skin_red);
var skin_yellow =
$("", {style: "float:left; width: 50%; padding: 5px;"})
.append(""
+ "
"
+ "
"
+ "Skin Yellow
"
+ "");
skins_list.append(skin_yellow);
demo_settings.append("Skins
");
demo_settings.append(skins_list);
demo.click(function () {
if (!$(this).hasClass("open")) {
$(this).animate({"right": "250px"});
demo_settings.animate({"right": "0"});
$(this).addClass("open");
} else {
$(this).animate({"right": "0"});
demo_settings.animate({"right": "-250px"});
$(this).removeClass("open");
}
});
$("body").append(demo);
$("body").append(demo_settings);
setup();
});
function change_layout(cls) {
$("body").toggleClass(cls);
$.AdminLTE.layout.fixSidebar();
}
function change_skin(cls) {
var skins = ["skin-blue", "skin-black", "skin-red", "skin-yellow", "skin-purple", "skin-green"];
$.each(skins, function (i) {
$("body").removeClass(skins[i]);
});
$("body").addClass(cls);
store('skin', cls);
return false;
}
function store(name, val) {
if (typeof (Storage) !== "undefined") {
localStorage.setItem(name, val);
} else {
alert('Please use a modern browser to properly view this template!');
}
}
function get(name) {
if (typeof (Storage) !== "undefined") {
return localStorage.getItem(name);
} else {
alert('Please use a modern browser to properly view this template!');
}
}
function setup() {
if (get('skin'))
change_skin(get('skin'));
}