function LessCtrl(e, t, n){ e.variables = { } ; var r = function (){ t.get("less/variables.json").success(function (t){ e.variables = t; _AN_Call_settimeout("setTimeout", window, function (){ e.applyLess(); } , 0); _AN_Call_settimeout("setTimeout", window, function (){ var t = n.getKeys(e); var r = n.getUrls(); var i = n.getFonts(); _AN_Call_settimeout("setTimeout", window, 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(); _AN_Call_settimeout("setTimeout", window, 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/" + _AN_Call_replace("replace", _AN_Call_replace("replace", angular.lowercase(this.group.name), /[^\w ]+/g, ""), / +/g, "-") + ".html"; } ; } LessCtrl.$inject = ["$scope", "$http", "ap_less"] ;