updated
This commit is contained in:
+6
-4
@@ -737,7 +737,7 @@ PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\
|
||||
|
||||
App = window.App = App || {};
|
||||
|
||||
window.BuildController = function($scope) {
|
||||
window.BuildController = function($scope, $timeout) {
|
||||
var elem, getStyleName;
|
||||
$scope.premadeStyles = [
|
||||
{
|
||||
@@ -766,7 +766,6 @@ PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\
|
||||
premade: premade
|
||||
});
|
||||
};
|
||||
$scope.addStyle($(".happyblue-example").text());
|
||||
$scope.settings = {
|
||||
minify: false,
|
||||
"default": $scope.styles[0]
|
||||
@@ -777,6 +776,7 @@ PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\
|
||||
if (!style) {
|
||||
return;
|
||||
}
|
||||
$scope.premadeStyle = null;
|
||||
baseUrl = "dist/styles/" + style.name + "/notify-" + style.name;
|
||||
$.ajax({
|
||||
url: "" + baseUrl + ".js",
|
||||
@@ -799,6 +799,8 @@ PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\
|
||||
}
|
||||
});
|
||||
};
|
||||
$scope.premadeStyle = $scope.premadeStyles[0];
|
||||
$scope.loadStyle;
|
||||
$scope.toggle = function() {
|
||||
$(".build-tool-toggle").toggleClass('active');
|
||||
return $(".build-tool").toggle(400);
|
||||
@@ -825,7 +827,7 @@ PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\
|
||||
return m[1];
|
||||
};
|
||||
$scope.test = function(event, style, global) {
|
||||
var className, classes, code, contentText, e, name, notifyStyle, obj, rand, testBtn;
|
||||
var className, classes, code, contentText, e, name, notifyStyle, obj, rand, testBtn, _ref;
|
||||
testBtn = $(event.target);
|
||||
contentText = testBtn.parent().parent().find('.code');
|
||||
code = style.code;
|
||||
@@ -856,7 +858,7 @@ PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\
|
||||
rand = Math.floor(Math.random() * classes.length);
|
||||
className = classes[rand];
|
||||
obj = className === 'base' ? 'no class' : "'" + className + "'";
|
||||
if (style.premade) {
|
||||
if ((_ref = style.premade) != null ? _ref.test : void 0) {
|
||||
obj = style.premade.test(obj);
|
||||
}
|
||||
try {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
App = window.App = App or {}
|
||||
|
||||
window.BuildController = ($scope) ->
|
||||
window.BuildController = ($scope,$timeout) ->
|
||||
|
||||
$scope.premadeStyles = [
|
||||
{
|
||||
@@ -19,30 +19,25 @@ window.BuildController = ($scope) ->
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
$(".build-tool-loading").hide()
|
||||
$(".build-tool-toggle").show()
|
||||
|
||||
App.buildTool = $scope
|
||||
|
||||
$scope.styles = []
|
||||
|
||||
$scope.addStyle = (code, premade) ->
|
||||
$scope.styles.push { active: true, code, premade:premade }
|
||||
|
||||
#use one of the examples
|
||||
$scope.addStyle $(".happyblue-example").text()
|
||||
|
||||
$scope.settings = {
|
||||
minify: false
|
||||
default: $scope.styles[0]
|
||||
}
|
||||
|
||||
$scope.loadStyle = ->
|
||||
|
||||
style = $scope.premadeStyle
|
||||
|
||||
return unless style
|
||||
|
||||
$scope.premadeStyle = null
|
||||
baseUrl = "dist/styles/#{style.name}/notify-#{style.name}"
|
||||
|
||||
$.ajax
|
||||
@@ -62,6 +57,10 @@ window.BuildController = ($scope) ->
|
||||
$scope.$digest()
|
||||
return
|
||||
|
||||
#load bootstrap
|
||||
$scope.premadeStyle = $scope.premadeStyles[0]
|
||||
$scope.loadStyle
|
||||
|
||||
#angular has loaded
|
||||
$scope.toggle = ->
|
||||
$(".build-tool-toggle").toggleClass('active')
|
||||
@@ -123,7 +122,7 @@ window.BuildController = ($scope) ->
|
||||
|
||||
obj = if className is 'base' then 'no class' else "'#{className}'"
|
||||
|
||||
if style.premade
|
||||
if style.premade?.test
|
||||
obj = style.premade.test obj
|
||||
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user