[Pkg-javascript-commits] [node-css] 01/02: Imported Upstream version 1.6.0
Leo Iannacone
l3on-guest at moszumanska.debian.org
Tue May 6 14:27:24 UTC 2014
This is an automated email from the git hooks/post-receive script.
l3on-guest pushed a commit to branch master
in repository node-css.
commit 17ab0ecc8d9f17cd9d0320d5acad2f9fd3607aa9
Author: Leo Iannacone <l3on at ubuntu.com>
Date: Tue May 6 16:12:14 2014 +0200
Imported Upstream version 1.6.0
---
.npmignore | 4 +
.travis.yml | 3 +
History.md | 34 ++++++
LICENSE | 9 ++
Makefile | 8 ++
Readme.md | 77 +++++++++++++
benchmark.js | 36 ++++++
component.json | 13 +++
examples/ui.css | 337 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
examples/ui.js | 10 ++
index.js | 3 +
package.json | 23 ++++
test.js | 6 +
13 files changed, 563 insertions(+)
diff --git a/.npmignore b/.npmignore
new file mode 100644
index 0000000..f1250e5
--- /dev/null
+++ b/.npmignore
@@ -0,0 +1,4 @@
+support
+test
+examples
+*.sock
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..6e5919d
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,3 @@
+language: node_js
+node_js:
+ - "0.10"
diff --git a/History.md b/History.md
new file mode 100644
index 0000000..e79b6cb
--- /dev/null
+++ b/History.md
@@ -0,0 +1,34 @@
+1.6.0 / 2013-12-21
+==================
+
+ * update deps
+
+1.5.0 / 2013-12-03
+==================
+
+ * update deps
+
+1.1.0 / 2013-04-04
+==================
+
+ * update deps
+
+1.0.7 / 2012-11-21
+==================
+
+ * fix component.json
+
+1.0.4 / 2012-11-15
+==================
+
+ * update css-stringify
+
+1.0.3 / 2012-09-01
+==================
+
+ * add component support
+
+0.0.1 / 2010-01-03
+==================
+
+ * Initial release
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..0239d9c
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,9 @@
+(The MIT License)
+
+Copyright (c) 2012 TJ Holowaychuk <tj at vision-media.ca>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..f13b4a7
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,8 @@
+
+test:
+ @node test
+
+benchmark:
+ @node benchmark
+
+.PHONY: test benchmark
\ No newline at end of file
diff --git a/Readme.md b/Readme.md
new file mode 100644
index 0000000..c37a34d
--- /dev/null
+++ b/Readme.md
@@ -0,0 +1,77 @@
+
+# css
+
+ CSS parser / stringifier using [css-parse](https://github.com/visionmedia/css-parse) and [css-stringify](https://github.com/visionmedia/css-stringify).
+
+## Installation
+
+ $ npm install css
+
+## Example
+
+js:
+
+```js
+var css = require('css')
+var obj = css.parse('tobi { name: "tobi" }')
+css.stringify(obj);
+```
+
+object returned by `.parse()`:
+
+```json
+{
+ "stylesheet": {
+ "rules": [
+ {
+ "selector": "tobi",
+ "declarations": [
+ {
+ "property": "name",
+ "value": "tobi"
+ }
+ ]
+ }
+ ]
+ }
+}
+```
+
+string returned by `.stringify(ast)`:
+
+```css
+tobi {
+ name: tobi;
+}
+```
+
+string returned by `.stringify(ast, { compress: true })`:
+
+```css
+tobi{name:tobi}
+```
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2012 TJ Holowaychuk <tj at vision-media.ca>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/benchmark.js b/benchmark.js
new file mode 100644
index 0000000..dec711d
--- /dev/null
+++ b/benchmark.js
@@ -0,0 +1,36 @@
+
+var css = require('./')
+ , fs = require('fs')
+ , read = fs.readFileSync
+ , str = read('examples/ui.css', 'utf8');
+
+var n = 5000;
+var ops = 200;
+var t = process.hrtime(t);
+var results = [];
+
+while (n--) {
+ css.stringify(css.parse(str));
+ if (n % ops == 0) {
+ t = process.hrtime(t);
+ var ms = t[1] / 1000 / 1000;
+ var persec = (ops * (1000 / ms) | 0);
+ results.push(persec);
+ process.stdout.write('\r [' + persec + ' ops/s] [' + n + ']');
+ t = process.hrtime();
+ }
+}
+
+function sum(arr) {
+ return arr.reduce(function(sum, n){
+ return sum + n;
+ });
+}
+
+function mean(arr) {
+ return sum(arr) / arr.length | 0;
+}
+
+console.log();
+console.log(' avg: %d ops/s', mean(results));
+console.log(' size: %d kb', (str.length / 1024).toFixed(2));
\ No newline at end of file
diff --git a/component.json b/component.json
new file mode 100644
index 0000000..d4ef70b
--- /dev/null
+++ b/component.json
@@ -0,0 +1,13 @@
+{
+ "name": "css",
+ "version": "1.6.0",
+ "description": "CSS parser / stringifier using css-parse and css-stringify",
+ "keywords": ["css", "parser", "stylesheet"],
+ "dependencies": {
+ "visionmedia/css-parse": "1.7.0",
+ "visionmedia/css-stringify": "1.4.1"
+ },
+ "scripts": [
+ "index.js"
+ ]
+}
diff --git a/examples/ui.css b/examples/ui.css
new file mode 100644
index 0000000..e81e195
--- /dev/null
+++ b/examples/ui.css
@@ -0,0 +1,337 @@
+#dialog {
+ position: fixed;
+ left: 50%;
+ top: 150px;
+ max-width: 600px;
+ min-width: 250px;
+ border: 1px solid #eee;
+ background: white;
+ z-index: 1000;
+}
+
+#dialog .content {
+ padding: 15px 20px;
+}
+
+#dialog h1 {
+ margin: 0 0 5px 0;
+ font-size: 16px;
+ font-weight: normal;
+}
+
+#dialog p {
+ margin: 0;
+ padding: 0;
+ font-size: .9em;
+}
+
+#dialog.modal {
+ box-shadow: 0 1px 8px 0 black;
+}
+
+/* close */
+
+#dialog .close {
+ position: absolute;
+ top: 3px;
+ right: 10px;
+ text-decoration: none;
+ color: #888;
+ font-size: 16px;
+ font-weight: bold;
+ display: none;
+}
+
+#dialog.closable .close {
+ display: block;
+}
+
+#dialog .close:hover {
+ color: black;
+}
+
+#dialog .close:active {
+ margin-top: 1px;
+}
+
+/* slide */
+
+#dialog.slide {
+ -webkit-transition: opacity 300ms, top 300ms;
+ -moz-transition: opacity 300ms, top 300ms;
+}
+
+#dialog.slide.hide {
+ opacity: 0;
+ top: -500px;
+}
+
+/* fade */
+
+#dialog.fade {
+ -webkit-transition: opacity 300ms;
+ -moz-transition: opacity 300ms;
+}
+
+#dialog.fade.hide {
+ opacity: 0;
+}
+
+/* scale */
+
+#dialog.scale {
+ -webkit-transition: -webkit-transform 300ms;
+ -moz-transition: -moz-transform 300ms;
+ -webkit-transform: scale(1);
+ -moz-transform: scale(1);
+}
+
+#dialog.scale.hide {
+ -webkit-transform: scale(0);
+ -moz-transform: scale(0);
+}#overlay {
+ position: fixed;
+ top: 0;
+ left: 0;
+ opacity: 1;
+ width: 100%;
+ height: 100%;
+ background: rgba(0,0,0,.75);
+ transition: opacity 300ms;
+ z-index: 500;
+}
+
+#overlay.hide {
+ pointer-events: none;
+ opacity: 0;
+}.confirmation .actions {
+ border-top: 1px solid #eee;
+ padding: 5px;
+ text-align: right;
+ background: #fafafa;
+ box-shadow: inset 0 1px 0 white;
+}.color-picker canvas {
+ border: 1px solid #888;
+}
+.color-picker canvas:active {
+ cursor: none;
+}
+
+#notifications {
+ position: fixed;
+ top: 10px;
+ right: 15px;
+}
+
+#notifications li {
+ margin-bottom: 5px;
+ list-style: none;
+}
+
+.notification {
+ position: relative;
+ max-width: 600px;
+ min-width: 250px;
+ border: 1px solid #eee;
+ background: white;
+ z-index: 100;
+}
+
+.notification .content {
+ padding: 15px 20px;
+}
+
+.notification h1 {
+ margin: 0 0 5px 0;
+ font-size: 16px;
+ font-weight: normal;
+}
+
+.notification p {
+ margin: 0;
+ padding: 0;
+ font-size: .9em;
+}
+
+.notification .close {
+ position: absolute;
+ top: 5px;
+ right: 10px;
+ text-decoration: none;
+ color: #888;
+ display: none;
+}
+
+.notification.closable .close {
+ display: block;
+}
+
+.notification .close:hover {
+ color: black;
+}
+
+.notification .close:active {
+ margin-top: 1px;
+}
+
+/* close */
+
+.notification .close {
+ position: absolute;
+ top: 3px;
+ right: 10px;
+ text-decoration: none;
+ color: #888;
+ font-size: 16px;
+ font-weight: bold;
+ display: none;
+}
+
+/* slide */
+
+.notification.slide {
+ -webkit-transition: opacity 300ms, top 300ms;
+ -moz-transition: opacity 300ms, top 300ms;
+}
+
+.notification.slide.hide {
+ opacity: 0;
+ top: -500px;
+}
+
+/* fade */
+
+.notification.fade {
+ -webkit-transition: opacity 300ms;
+ -moz-transition: opacity 300ms;
+}
+
+.notification.fade.hide {
+ opacity: 0;
+}
+
+/* scale */
+
+.notification.scale {
+ -webkit-transition: -webkit-transform 300ms;
+ -moz-transition: -moz-transform 300ms;
+ -webkit-transform: scale(1);
+ -moz-transform: scale(1);
+}
+
+.notification.scale.hide {
+ -webkit-transform: scale(0);
+ -moz-transform: scale(0);
+}.split-button {
+ display: inline-block;
+ border: 1px solid #eee;
+}
+
+.split-button a {
+ display: inline-block;
+ float: left;
+ height: 20px;
+ line-height: 20px;
+ padding: 5px 10px;
+ text-decoration: none;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+}
+
+.split-button .toggle {
+ border-left: 1px solid #eee;
+}
+
+.split-button .toggle span {
+ display: block;
+ margin-top: 8px;
+ border-left: 4px solid transparent;
+ border-right: 4px solid transparent;
+ border-top: 4px solid #888;
+}.menu {
+ position: absolute;
+ top: 0;
+ left: 0;
+ z-index: 100;
+ margin: 0;
+ padding: 0;
+ background: white;
+ border: 1px solid rgba(0,0,0,0.2);
+}
+
+.menu li {
+ list-style: none;
+}
+
+.menu li a {
+ display: block;
+ padding: 5px 30px 5px 12px;
+ text-decoration: none;
+ border-top: 1px solid #eee;
+ color: #2e2e2e;
+ outline: none;
+}
+
+.menu li:first-child a {
+ border-top: none;
+}
+
+.menu li a:hover,
+.menu li.selected a {
+ background: #f1faff;
+}
+
+/* from: http://desandro.github.com/3dtransforms */
+
+.card {
+ width: 200px;
+ height: 260px;
+ position: relative;
+ perspective: 800;
+}
+
+.card .wrapper {
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ -webkit-transform-style: preserve-3d;
+ -moz-transform-style: preserve-3d;
+ -webkit-transition: -webkit-transform 500ms ease-in-out;
+ -moz-transition: -moz-transform 500ms ease-in-out;
+ border: 1px solid #eee;
+ border-bottom-color: #cacaca;
+ border-radius: 3px;
+ -webkit-box-shadow: inset 0 -1px 0 0 white, 0 1px 4px 0 #ddd;
+ -moz-box-shadow: inset 0 -1px 0 0 white, 0 1px 4px 0 #ddd;
+}
+
+.card .face {
+ display: block;
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ -webkit-backface-visibility: hidden;
+ -moz-backface-visibility: hidden;
+}
+
+.card .back {
+ -webkit-transform: rotateY(180deg);
+ -moz-transform: rotateY(180deg);
+}
+
+.card.flipped .wrapper {
+ -webkit-transform: rotateY(180deg);
+ -moz-transform: rotateY(180deg);
+}
+
+/* sideflip effect */
+
+.card.sideflip .wrapper {
+ -webkit-transform-origin: right center;
+ -moz-transform-origin: right center;
+}
+
+.card.sideflip.flipped .wrapper {
+ -webkit-transform: translateX(-100%) rotateY(180deg);
+ -moz-transform: translateX(-100%) rotateY(180deg);
+}
\ No newline at end of file
diff --git a/examples/ui.js b/examples/ui.js
new file mode 100644
index 0000000..9dd2f3e
--- /dev/null
+++ b/examples/ui.js
@@ -0,0 +1,10 @@
+
+var css = require('..')
+ , fs = require('fs')
+ , read = fs.readFileSync
+ , str = read('examples/ui.css', 'utf8');
+
+var ast = css.parse(str);
+console.log(JSON.stringify(ast, null, 2));
+
+console.log(css.stringify(ast));
\ No newline at end of file
diff --git a/index.js b/index.js
new file mode 100644
index 0000000..19ec91a
--- /dev/null
+++ b/index.js
@@ -0,0 +1,3 @@
+
+exports.parse = require('css-parse');
+exports.stringify = require('css-stringify');
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..4627499
--- /dev/null
+++ b/package.json
@@ -0,0 +1,23 @@
+{
+ "name": "css",
+ "version": "1.6.0",
+ "description": "CSS parser / stringifier using css-parse and css-stringify",
+ "keywords": [
+ "css",
+ "parser",
+ "stylesheet"
+ ],
+ "author": "TJ Holowaychuk <tj at vision-media.ca>",
+ "dependencies": {
+ "css-parse": "1.7.0",
+ "css-stringify": "1.4.1"
+ },
+ "main": "index",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/visionmedia/css.git"
+ },
+ "scripts": {
+ "test": "make test"
+ }
+}
diff --git a/test.js b/test.js
new file mode 100644
index 0000000..3e1b4d3
--- /dev/null
+++ b/test.js
@@ -0,0 +1,6 @@
+
+var css = require('./')
+ , assert = require('assert');
+
+assert(css.parse);
+assert(css.stringify);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-css.git
More information about the Pkg-javascript-commits
mailing list