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