Mini Shell

Direktori : /home/athamevents/public_html/admin/assets/js/
Upload File :
Current File : /home/athamevents/public_html/admin/assets/js/style-switcher.min.js

/**
* Metis - Bootstrap-Admin-Template v2.3.2
* Author : puikinsh 
* Copyright 2016
* Licensed under MIT (https://github.com/puikinsh/Bootstrap-Admin-Template/blob/master/LICENSE.md)
*/

function LocalStorageManager(){this.bgColor="bgColor",this.fgcolor="fgcolor",this.bgImage="bgImage";var a=this.localStorageSupported();this.storage=a?window.localStorage:window.fakeStorage}function InputTypeManager(){var a=this.colorTypeSupported();this.ci=a}window.fakeStorage={_data:{},setItem:function(a,b){return this._data[a]=String(b)},getItem:function(a){return this._data.hasOwnProperty(a)?this._data[a]:void 0},removeItem:function(a){return delete this._data[a]},clear:function(){return this._data={}}},LocalStorageManager.prototype.localStorageSupported=function(){var a="test",b=window.localStorage;try{return b.setItem(a,"1"),b.removeItem(a),!0}catch(c){return!1}},LocalStorageManager.prototype.getBgColor=function(){return this.storage.getItem(this.bgColor)||"#333"},LocalStorageManager.prototype.setBgColor=function(a){this.storage.setItem(this.bgColor,a)},LocalStorageManager.prototype.getFgColor=function(){return this.storage.getItem(this.fgColor)||"#fff"},LocalStorageManager.prototype.setFgColor=function(a){this.storage.setItem(this.fgColor,a)},LocalStorageManager.prototype.getBgImage=function(){return this.storage.getItem(this.bgImage)||"arches"},LocalStorageManager.prototype.setBgImage=function(a){this.storage.setItem(this.bgImage,a)},LocalStorageManager.prototype.clearItems=function(){this.storage.removeItem(this.bgColor),this.storage.removeItem(this.fgColor),this.storage.removeItem(this.bgImage)},InputTypeManager.prototype.colorTypeSupported=function(){var a=document.createElement("input");return a.setAttribute("type","color"),"text"!==a.type},StyleSwitcher=function(){this.inputManager=new InputTypeManager,this.storageManager=new LocalStorageManager,this.init()},StyleSwitcher.prototype.init=function(){this.showChange(),this.build()},StyleSwitcher.prototype.showChange=function(){this.bgColor=this.storageManager.getBgColor(),this.fgColor=this.storageManager.getFgColor(),this.bgImage=this.storageManager.getBgImage(),this.postLess(this.bgColor,this.fgColor,this.bgImage)},StyleSwitcher.prototype.build=function(){var a=this;a.storageManager=new LocalStorageManager;var b=window.location.pathname.toString(),c="";"rtl"===$("body").css("direction")&&$("body").addClass("rtl"),b.indexOf("/rtl/")>-1&&(c+="../"),$("body").css({"background-image":"url("+c+"assets/img/pattern/"+a.storageManager.getBgImage()+".png)","background-repeat":" repeat"});var d='<div id="getCSSModal" class="modal fade"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button><h4 class="modal-title">Theme CSS</h4><code>Copy textarea content and paste into theme.css</code></div> <div class="modal-body"><textarea class="form-control" name="cssbeautify" id="cssbeautify" readonly></textarea></div> <div class="modal-footer"><button aria-hidden="true" data-dismiss="modal" class="btn btn-danger">Close</button></div> </div></div> </div>';$("body").append(d);var e=$("<div />").attr("id","style-switcher").addClass("style-switcher hidden-xs"),f=$("<i />").addClass("fa fa-cogs fa-2x"),g=$("<a />").attr({href:"#",id:"switcher-link"}).on(Metis.buttonPressedEvent,function(a){a.preventDefault(),e.toggleClass("open"),$(this).find("i").toggleClass("fa-spin")}).append(f),h=$("<h5 />").html("Style Switcher").append(g),i=$("<ul />").addClass("options").attr("data-type","colors"),j=[{Hex:"#0088CC",colorName:"Blue"},{Hex:"#4EB25C",colorName:"Green"},{Hex:"#4A5B7D",colorName:"Navy"},{Hex:"#E05048",colorName:"Red"},{Hex:"#B8A279",colorName:"Beige"},{Hex:"#c71c77",colorName:"Pink"},{Hex:"#734BA9",colorName:"Purple"},{Hex:"#2BAAB1",colorName:"Cyan"}];$.each(j,function(a){var b=$("<li/>").append($("<a/>").css("background-color",j[a].Hex).attr({"data-color-hex":j[a].Hex,"data-color-name":j[a].colorName,href:"#",title:j[a].colorName}).tooltip({placement:"bottom"}));i.append(b)});var k,l=new InputTypeManager;if(l.ci)k=$("<input/>").addClass("color-picker-icon").attr({id:"colorSelector",type:"color"}).val(a.storageManager.getBgColor()),k.on("change",function(b){a.storageManager.setBgColor($(this).val()),a.showChange()});else{var m=$("<link/>").attr({rel:"stylesheet",href:c+"assets/lib/colorpicker/css/colorpicker.css"}),n=$("<link/>").attr({rel:"stylesheet",href:c+"assets/css/colorpicker_hack.css"});k=$("<div/>").addClass("color-picker").attr({id:"colorSelector","data-color":a.storageManager.getBgColor(),"data-color-format":"hex"});var o=c+"assets/lib/colorpicker/js/bootstrap-colorpicker.js";$.getScript(o,function(){$("head").append(m,n),k.append($("<a/>").css({"background-color":a.storageManager.getBgColor()}).attr({href:"#",id:"colorSelectorA"})),k.colorpicker().on("changeColor",function(b){k.find("a").css("background-color",b.color.toHex()),a.storageManager.setBgColor(b.color.toHex()),a.showChange()})})}var p=$("<li/>").append(k);i.find("a").on(Metis.buttonPressedEvent,function(b){b.preventDefault(),a.storageManager.setBgColor($(this).data("colorHex")),a.showChange(),k.attr("data-color",$(this).data("colorHex")),k.val($(this).data("colorHex")),k.find("a").css("background-color",$(this).data("colorHex"))}),i.append(p);var q=$("<div />").addClass("style-switcher-wrap").append($("<h6 />").html("Background Colors"),i,$("<hr/>")),r=$("<input/>").attr({type:"radio",name:"fgcolor"}).val("#ffffff").on("change",function(b){a.storageManager.setFgColor("#ffffff"),a.showChange()}),s=$("<label/>").addClass("btn btn-xs btn-primary").html("White").append(r),t=$("<input/>").attr({type:"radio",name:"fgcolor"}).val("#333333").on("change",function(b){a.storageManager.setFgColor("#333333"),a.showChange()}),u=$("<label/>").addClass("btn btn-xs btn-danger").html("Black").append(t),v=$("<div/>").addClass("btn-group").attr("data-toggle","buttons").append(s,u);q.append($("<div/>").addClass("options-link").append($("<h6/>").html("Font Colors"),v));var w=$("<ul />").addClass("options").attr("data-type","pattern"),x=[{image:"brillant",title:"Brillant"},{image:"always_grey",title:"Always Grey"},{image:"retina_wood",title:"Retina Wood"},{image:"low_contrast_linen",title:"Low Constrat Linen"},{image:"egg_shell",title:"Egg Shel"},{image:"cartographer",title:"Cartographer"},{image:"batthern",title:"Batthern"},{image:"noisy_grid",title:"Noisy Grid"},{image:"diamond_upholstery",title:"Diamond Upholstery"},{image:"greyfloral",title:"Gray Floral"},{image:"white_tiles",title:"White Tiles"},{image:"gplaypattern",title:"GPlay"},{image:"arches",title:"Arches"},{image:"purty_wood",title:"Purty Wood"},{image:"diagonal_striped_brick",title:"Diagonal Striped Brick"},{image:"large_leather",title:"Large Leather"},{image:"bo_play_pattern",title:"BO Play"},{image:"irongrip",title:"Iron Grip"},{image:"wood_1",title:"Dark Wood"},{image:"pool_table",title:"Pool Table"},{image:"crissXcross",title:"crissXcross"},{image:"rip_jobs",title:"R.I.P Steve Jobs"},{image:"random_grey_variations",title:"Random Grey Variations"},{image:"carbon_fibre",title:"Carbon Fibre"}];$.each(x,function(a){var b=$("<li/>").append($("<a/>").css({background:"url("+c+"assets/img/pattern/"+x[a].image+".png) repeat"}).attr({href:"#",title:x[a].title,"data-pattern-image":x[a].image}).tooltip({placement:"bottom"}));w.append(b)}),w.find("a").on(Metis.buttonPressedEvent,function(b){b.preventDefault(),$("body").css({"background-image":"url("+c+"assets/img/pattern/"+$(this).data("patternImage")+".png)","background-repeat":" repeat"}),a.patternImage=$(this).data("patternImage"),a.storageManager.setBgImage(a.patternImage),a.showChange()}),q.append($("<div/>").addClass("pattern").append($("<h6/>").html("Background Pattern"),w));var y=$("<a/>").html("Reset").attr("href","#").on(Metis.buttonPressedEvent,function(b){a.reset(),b.preventDefault()}),z=$("<a/>").html("Get CSS").attr("href","#").on(Metis.buttonPressedEvent,function(b){b.preventDefault(),a.getCss()});q.append($("<div/>").addClass("options-link").append($("<hr/>"),y,z)),e.append(h,q),$("body").append(e)},StyleSwitcher.prototype.postLess=function(a,b,c){this.bgc=a,this.fgc=b,this.bgi=c,less.modifyVars({"@bgColor":this.bgc,"@fgColor":this.fgc,"@bgImage":this.bgi})},StyleSwitcher.prototype.getCss=function(){var a=this,b="",c=$("body").hasClass("fixed"),d=$("#cssbeautify");c?(b='body { background-image: url("../img/pattern/'+a.patternImage+'.png"); }',$("#boxedBodyAlert").removeClass("hide")):$("#boxedBodyAlert").addClass("hide"),d.text(""),b+=$('style[id^="less:"]').text(),d.text(b),$("#getCSSModal").modal("show")},StyleSwitcher.prototype.reset=function(){this.storageManager.clearItems(),this.showChange()},window.StyleSwitcher=new StyleSwitcher;
//# sourceMappingURL=style-switcher.js.map

Zerion Mini Shell 1.0