Closes #122. Add Titanium style Sheets (TSS) support

See #238.
This commit is contained in:
Glavin Wiechert 2015-04-12 12:58:16 -03:00
parent ca9b20c43d
commit 6204ebbff6
8 changed files with 151 additions and 2 deletions

View File

@ -14,7 +14,7 @@ notifications:
script: sh build-package.sh script: sh build-package.sh
env: env:
- APM_TEST_PACKAGES="language-typescript language-marko" - APM_TEST_PACKAGES="language-typescript language-marko language-tss"
before_install: before_install:
# Update Homebrew # Update Homebrew

View File

@ -0,0 +1,97 @@
"Window": {
exitOnClose: true,
backgroundColor: "#fff",
title: "Kochgut"
}
"Label": {
width: Ti.UI.SIZE,
height: Ti.UI.SIZE,
color: "#555",
touchEnabled: false
}
"Button": {
backgroundColor: "#03a9f4",
color: "#fff",
borderRadius: 2
}
"#menu": {
backgroundImage: "/images/bg.png"
}
".button": {
backgroundColor: "#03a9f4",
color: "#fff",
borderRadius: 2,
width: Ti.UI.SIZE,
height: 48,
top: 16,
bottom: 16
}
".lbl_button": {
left: 20,
right: 20,
color: "#fff"
}
".headline": {
color: "#aaa",
left: 16,
height: 48,
font: {
fontWeight: "bold"
}
}
".grid": {
left: 2,
right: 2,
layout: "horizontal",
height: Ti.UI.SIZE
}
".card [platform=tablet]": {
width: "33%",
height: 150,
bottom: 2
}
".card": {
width: "50%",
height: 150,
bottom: 2
}
".padding": {
right: 2,
left: 0,
top: 0,
bottom: 0,
backgroundImage: "/images/essen.jpg"
}
".card_overlay": {
bottom: 0,
left: 0,
right: 0,
height: 48
}
".card_overlay_bg": {
left: 0,
right: 0,
bottom: 0,
top: 0,
backgroundColor: "#000",
opacity: 0.3
}
".card_lbl": {
color: "#fff",
left: 16,
font: {
fontSize: 16
}
}

View File

@ -0,0 +1,31 @@
".container": {
backgroundImage: 'images/bgbg-builder.png',
width: 1024,
height: 752,
top: 0,
left: 0
},
"#blackArrow": {
touchEnabled: false,
backgroundImage: 'images/arrow-builder.png',
width: 15,
height: 10,
top: 128,
left: 165,
pos0: {
left: 165,
duration: 200
},
pos1: {
left: 301,
duration: 200
},
pos2: {
left: 437,
duration: 200
},
pos3: {
left: 573,
duration: 200
}
},

View File

@ -0,0 +1,17 @@
"use strict"
prettydiff = require("prettydiff")
module.exports = (text, options, callback) ->
args =
source: text
lang: "tss"
mode: "beautify"
inchar: options.indent_char
insize: options.indent_size
alphasort: options.alphasort or false
preserve: (if (options.preserve_newlines is true ) then \
"all" else "none")
output = prettydiff.api(args)
result = output[0]
callback result
result

View File

@ -20,6 +20,7 @@ uncrustifyBeautifier = null
beautifyHTMLERB = null beautifyHTMLERB = null
beautifyMarkdown = null beautifyMarkdown = null
beautifyTypeScript = null beautifyTypeScript = null
beautifyTSS = null
Analytics = null Analytics = null
# Misc # Misc
@ -446,6 +447,9 @@ module.exports =
when "Sass", "SCSS", "LESS" when "Sass", "SCSS", "LESS"
beautifyLESS ?= require("./langs/css-prettydiff-beautify") beautifyLESS ?= require("./langs/css-prettydiff-beautify")
beautifyLESS text, self.getOptions("css", allOptions), beautifyCompleted beautifyLESS text, self.getOptions("css", allOptions), beautifyCompleted
when "TSS"
beautifyTSS ?= require("./langs/tss-prettydiff-beautify")
beautifyTSS text, self.getOptions("css", allOptions), beautifyCompleted
when "SQL (Rails)", "SQL" when "SQL (Rails)", "SQL"
beautifySQL ?= require("./langs/sql-beautify") beautifySQL ?= require("./langs/sql-beautify")
beautifySQL text, self.getOptions("sql", allOptions), beautifyCompleted beautifySQL text, self.getOptions("sql", allOptions), beautifyCompleted

View File

@ -21,7 +21,7 @@ describe "BeautifyLanguages", ->
"java", "javascript", "json", "less", "java", "javascript", "json", "less",
"mustache", "objective-c", "perl", "php", "mustache", "objective-c", "perl", "php",
"python", "ruby", "sass", "sql", "python", "ruby", "sass", "sql",
"typescript", "xml", "csharp", "gfm", "marko" "typescript", "xml", "csharp", "gfm", "marko", "tss"
] ]
beforeEach -> beforeEach ->