forked from pikock/bootstrap-magic
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontrollers.min.js
More file actions
1 lines (1 loc) · 1.5 KB
/
Copy pathcontrollers.min.js
File metadata and controls
1 lines (1 loc) · 1.5 KB
1
function LessCtrl(e,t,n){e.variables={};var r=function(){t.get("less/variables.json").success(function(t){e.variables=t;setTimeout(function(){e.applyLess()},0);setTimeout(function(){var t=n.getKeys(e);var r=n.getUrls();var i=n.getFonts();setTimeout(function(){var e=$(".colorpicker");e.colorpicker().on("changeColor",function(e){var t=angular.element(this).scope();t.variable.value=e.color.toHex()});$(".lessVariable").each(function(e){var n=angular.element(this).scope();console.log();switch(n.variable.type){case"icons":var s=r;break;case"font":var s=i;break;case"color":default:var s=t}console.log();$(this).typeahead({source:s,updater:function(e){n.variable.value=e;return e}})})},0)},0)})};r();e.applyLess=function(t){var r=n.getVariables(e);less.modifyVars(r)};e.colorpicker=function(e){return e=="color"?true:false};e.color=function(e,t){return e=="color"&&/^#[0-9a-f]{3}([0-9a-f]{3})?$/i.test(t)?t:"#ffffff"};e.$on("applyLess",function(){e.applyLess()});e.setIsViewLoading=function(t){e.isViewLoading=t};e.minified=false;e.saveCSS=function(){n.saveCSS(e)};e.saveLessVariables=function(){n.saveLessVar(n.getVariablesToString(e))};e.resetLessVariables=function(){r();setTimeout(function(){e.applyLess()},0)};e.isViewLoading=false;e.$on("$routeChangeStart",function(){e.isViewLoading=true});e.$on("$routeChangeSuccess",function(){e.isViewLoading=false});e.getGroupUrl=function(){return"preview/"+angular.lowercase(this.group.name).replace(/[^\w ]+/g,"").replace(/ +/g,"-")+".html"}}LessCtrl.$inject=["$scope","$http","ap_less"]