cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hermw...@apache.org
Subject [7/7] git commit: updates to initial firefox implementation
Date Wed, 13 Feb 2013 23:30:29 GMT
Updated Branches:
  refs/heads/cordova-firefoxos 3608640e4 -> 5463adb09


updates to initial firefox implementation


Project: http://git-wip-us.apache.org/repos/asf/cordova-labs/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-labs/commit/5463adb0
Tree: http://git-wip-us.apache.org/repos/asf/cordova-labs/tree/5463adb0
Diff: http://git-wip-us.apache.org/repos/asf/cordova-labs/diff/5463adb0

Branch: refs/heads/cordova-firefoxos
Commit: 5463adb096b13eb847414b9603376ea241e20b0b
Parents: 3608640
Author: hermwong <herm.wong@gmail.com>
Authored: Wed Feb 13 11:59:24 2013 -0800
Committer: hermwong <herm.wong@gmail.com>
Committed: Wed Feb 13 11:59:24 2013 -0800

----------------------------------------------------------------------
 Makefile                                           |   24 +
 README.md                                          |   72 +-
 bin/create                                         |   78 -
 bin/templates/project/README.md                    |   21 -
 bin/templates/project/cordova/build                |   20 -
 bin/templates/project/cordova/run                  |   22 -
 bin/templates/project/package.json                 |   16 -
 bin/templates/project/tools/almond.js              |  277 -
 bin/templates/project/tools/build.js               |    8 -
 bin/templates/project/tools/manifest.appcache      |   11 -
 bin/templates/project/tools/oneless.js             |   92 -
 bin/templates/project/tools/r.js                   |15568 ---------------
 bin/templates/project/tools/volo                   |12898 ------------
 bin/templates/project/volofile                     |  197 -
 bin/templates/project/www/css/index.css            |  115 -
 bin/templates/project/www/img/logo.png             |  Bin 21814 -> 0 bytes
 bin/templates/project/www/index.html               |   42 -
 bin/templates/project/www/js/index.js              |   49 -
 bin/templates/project/www/manifest.webapp          |   16 -
 .../project/www/res/icon/android/icon-36-ldpi.png  |  Bin 3096 -> 0 bytes
 .../project/www/res/icon/android/icon-48-mdpi.png  |  Bin 4090 -> 0 bytes
 .../project/www/res/icon/android/icon-72-hdpi.png  |  Bin 6080 -> 0 bytes
 .../project/www/res/icon/android/icon-96-xhdpi.png |  Bin 7685 -> 0 bytes
 .../project/www/res/icon/b2g/icon-128.png          |  Bin 11401 -> 0 bytes
 bin/templates/project/www/res/icon/b2g/icon-48.png |  Bin 4111 -> 0 bytes
 .../www/res/icon/bada-wac/icon-48-type5.png        |  Bin 4111 -> 0 bytes
 .../www/res/icon/bada-wac/icon-50-type3.png        |  Bin 5758 -> 0 bytes
 .../www/res/icon/bada-wac/icon-80-type4.png        |  Bin 7287 -> 0 bytes
 .../project/www/res/icon/bada/icon-128.png         |  Bin 11401 -> 0 bytes
 .../project/www/res/icon/blackberry/icon-80.png    |  Bin 7287 -> 0 bytes
 .../project/www/res/icon/ios/icon-57-2x.png        |  Bin 7869 -> 0 bytes
 bin/templates/project/www/res/icon/ios/icon-57.png |  Bin 3908 -> 0 bytes
 .../project/www/res/icon/ios/icon-72-2x.png        |  Bin 11706 -> 0 bytes
 bin/templates/project/www/res/icon/ios/icon-72.png |  Bin 4944 -> 0 bytes
 .../project/www/res/icon/tizen/icon-128.png        |  Bin 11401 -> 0 bytes
 .../project/www/res/icon/webos/icon-64.png         |  Bin 5463 -> 0 bytes
 .../www/res/icon/windows-phone/icon-173-tile.png   |  Bin 22878 -> 0 bytes
 .../project/www/res/icon/windows-phone/icon-48.png |  Bin 4111 -> 0 bytes
 .../www/res/icon/windows-phone/icon-62-tile.png    |  Bin 7324 -> 0 bytes
 .../res/screen/android/screen-hdpi-landscape.png   |  Bin 218302 -> 0 bytes
 .../res/screen/android/screen-hdpi-portrait.png    |  Bin 222148 -> 0 bytes
 .../res/screen/android/screen-ldpi-landscape.png   |  Bin 42616 -> 0 bytes
 .../res/screen/android/screen-ldpi-portrait.png    |  Bin 42034 -> 0 bytes
 .../res/screen/android/screen-mdpi-landscape.png   |  Bin 92347 -> 0 bytes
 .../res/screen/android/screen-mdpi-portrait.png    |  Bin 90555 -> 0 bytes
 .../res/screen/android/screen-xhdpi-landscape.png  |  Bin 489604 -> 0 bytes
 .../res/screen/android/screen-xhdpi-portrait.png   |  Bin 504508 -> 0 bytes
 .../www/res/screen/bada-wac/screen-type3.png       |  Bin 90555 -> 0 bytes
 .../www/res/screen/bada-wac/screen-type4.png       |  Bin 222148 -> 0 bytes
 .../www/res/screen/bada-wac/screen-type5.png       |  Bin 107580 -> 0 bytes
 .../www/res/screen/bada/screen-portrait.png        |  Bin 222148 -> 0 bytes
 .../www/res/screen/blackberry/screen-225.png       |  Bin 16776 -> 0 bytes
 .../res/screen/ios/screen-ipad-landscape-2x.png    |  Bin 1534088 -> 0 bytes
 .../www/res/screen/ios/screen-ipad-landscape.png   |  Bin 407370 -> 0 bytes
 .../www/res/screen/ios/screen-ipad-portrait-2x.png |  Bin 1610434 -> 0 bytes
 .../www/res/screen/ios/screen-ipad-portrait.png    |  Bin 422441 -> 0 bytes
 .../res/screen/ios/screen-iphone-landscape-2x.png  |  Bin 339639 -> 0 bytes
 .../www/res/screen/ios/screen-iphone-landscape.png |  Bin 92301 -> 0 bytes
 .../res/screen/ios/screen-iphone-portrait-2x.png   |  Bin 350593 -> 0 bytes
 .../www/res/screen/ios/screen-iphone-portrait.png  |  Bin 93897 -> 0 bytes
 .../project/www/res/screen/tizen/README.md         |    3 -
 .../project/www/res/screen/webos/screen-64.png     |  Bin 5463 -> 0 bytes
 .../res/screen/windows-phone/screen-portrait.jpg   |  Bin 22066 -> 0 bytes
 bin/templates/project/www/spec.html                |   68 -
 bin/templates/project/www/spec/helper.js           |   33 -
 bin/templates/project/www/spec/index.js            |   67 -
 .../project/www/spec/lib/jasmine-1.2.0/MIT.LICENSE |   20 -
 .../www/spec/lib/jasmine-1.2.0/jasmine-html.js     |  616 -
 .../project/www/spec/lib/jasmine-1.2.0/jasmine.css |   81 -
 .../project/www/spec/lib/jasmine-1.2.0/jasmine.js  | 2529 ---
 build/install.js                                   |   75 +
 framework/application.zip                          |  Bin 0 -> 1826 bytes
 framework/css/index.css                            |  115 +
 framework/img/logo.png                             |  Bin 0 -> 21814 bytes
 framework/index.html                               |   42 +
 framework/install.html                             |   31 -
 framework/js/index.js                              |   49 +
 framework/manifest.webapp                          |   28 +
 framework/res/icon/webos/icon-64.png               |  Bin 0 -> 5463 bytes
 framework/res/screen/webos/screen-64.png           |  Bin 0 -> 5463 bytes
 framework/style/icons/cordova.png                  |  Bin 0 -> 19932 bytes
 framework/style/icons/cordova_48.png               |  Bin 0 -> 4111 bytes
 javascript/cordova.firefoxos.js                    | 5702 ------
 lib/cordova.firefoxos.js                           | 5702 ++++++
 84 files changed, 6058 insertions(+), 38629 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-labs/blob/5463adb0/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..bc13b07
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,24 @@
+# build script for Apache Cordova Firefox OS
+
+PORT_DEVICE = 6000
+PORT_LOCAL = 6000
+XPCSHELL ?= ~/Documents/mozilla/mozilla-central/obj-x86_64-apple-darwin11.4.2/dist/bin/xpcshell
+ADB ?= adb
+FOLDER = framework
+PGVERSION = 2.4.0
+
+all :: packaged install
+
+copy_js:
+	cp lib/cordova.webos.js framework/cordova-$(PGVERSION).js
+
+package:
+	cd ./${FOLDER} && zip -X ./application.zip ./* -x application.zip
+
+packaged: package
+	${ADB} push ./${FOLDER}/application.zip /data/local/tmp/b2g/${FOLDER}/application.zip
+
+install:
+	${ADB} forward tcp:$(PORT_LOCAL) tcp:$(PORT_DEVICE)
+	@echo "Please confirm the remote debugging prompt on the phone!"
+	${XPCSHELL} build/install.js ${FOLDER} $(PORT_LOCAL)

http://git-wip-us.apache.org/repos/asf/cordova-labs/blob/5463adb0/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index a840494..f635817 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,6 @@
 Cordova FirefoxOS (Boot 2 Gecko)
 ==============================
 
-Directory Structure
--------------------
-
-    framework/ ... Any framework (non app specific code)
-    javascript/ .. Cordova JavaScript (built from the cordova-js project)
-    bin/ ......... Scripts for project creation
-
 Introduction
 ------------
 
@@ -16,57 +9,38 @@ Firefox OS is an open source operating system for smartphones and tablet compute
 cordova-firefoxos allows developers to use the cross platform APIs in Cordova to target the Firefox OS. Most APIs are just proxied to the matching Firefox OS API calls.
 
 
-Getting Started
-===============
+Prerequisties:
+==============
 
 A lot of good documentation is available on the [Mozilla Developer Network](https://developer.mozilla.org/en/docs/Mozilla/Firefox_OS)
 
 A simulator (runs as a Firefox plugin) is availble [here](http://people.mozilla.org/~myk/r2d2b2g/)
 
-Installing the cordova-firefoxos framework
-====================================
-
-Cloning the cordova-firefoxos repository always provides you with the latest (EDGE) version of the Cordova code.  To clone the repository, do the following:
-
-    $ cd ~/some/path
-    $ git clone https://github.com/gtanner/cordova-firefoxos.git
-
-Cordova Firefox OS Developer Tools
----------------------------
-
-The Cordova developer tooling is split between general tooling and project level tooling.  Currently the tooling will only work on OSX or Linux.
-
-### General Commands
-
-    ./bin/create [path appname] ...... creates a sample app with the specified path
-
-#### Running the Example Project
-
-Create the example project and build it to the first device:
-
-    ./bin/create
-    cd example
-    ./cordova/debug
-
-This will start up a web server on port 8008 and ask you to navigate your
-phone or simulator to http://localhost:8008/install.html.  This is really only
-needed to install like you would from an app store.
+The following software is required to package and deploy an app directly to a Firefox OS device:
+-[Android SDK](http://developer.android.com/sdk/index.html)
+-on Mac you will need to install XCode & Command Line Tools for XCode
+-Firefox OS device with OS Version 1.0.0.0 prerelease
 
-You may also use the simluator and Add the www directory to it (point at the manifest.webapp) in that folder. This will
-allow you to refresh the app easier when developing.
+Getting Started:
+================
 
-#### Creating a new Cordova Firefox OS Project
+1. Bootstrap your computer so to make sure that you have all the prerequisites for building Firefox
+- instructions can be found under the "Build prerequisites" section on the following [page](https://developer.mozilla.org/en-US/docs/Simple_Firefox_build)
+2. Clone the Firefox repository: git clone git://github.com/mozilla/mozilla-central.git
+3. Build Firefox by following the instructions under the "Building" on the following [page](https://developer.mozilla.org/en-US/docs/Simple_Firefox_build)
+4. Clone the cordova-firefoxos repository
 
-    ./bin/create ~/Desktop/myapp MyApp
+If Deploying to device:
 
-### Project Commands
+5. Modify the XPCSHELL constant in the Makefile to point to the location of xpcshell on your computer
+6. Modify the ADB constant in the Makefile to point to the location of adb on your computer
+7. Make sure the Firefox OS device has remote debugging enabled. To enable remote debugging navigate to the following settings on the device: Settings->Device Information->More Information->Developer->Remote Debugging.
+8. Run the Makefile by typing "make" into the command line.
+9. The device should prompt you to allow a remote connection, your Apache Cordova Firefox OS app will be installed to the device once you accept the prompt. 
 
-These commands live in a generated Cordova FirefoxOS project. 
+If Deploying to simulator:
 
-    ./cordova/run ............................ install to a connected device or simulator
-    ./cordova/build .......................... build project, but do not deploy to simulator or device
+7. Open the Firefox OS simulator add-on by going to Tools->Web Developer->Firefox OS Simulator
+8. Start the simulator
+9. Click on the Add Directory button and then choose the manifest.webapp file in the framework folder of your Apache Cordova app.
 
-There is currently no way to automate installing to the simulator or device so
-we are currently just hosting an install.html file on the webserver hosting the app
-that you can point your device/simulator to and install the app.  Once more commandline
-tools become available this will probably change.

http://git-wip-us.apache.org/repos/asf/cordova-labs/blob/5463adb0/bin/create
----------------------------------------------------------------------
diff --git a/bin/create b/bin/create
deleted file mode 100755
index 6857cdd..0000000
--- a/bin/create
+++ /dev/null
@@ -1,78 +0,0 @@
-#! /bin/sh
-#       Licensed to the Apache Software Foundation (ASF) under one
-#       or more contributor license agreements.  See the NOTICE file
-#       distributed with this work for additional information
-#       regarding copyright ownership.  The ASF licenses this file
-#       to you under the Apache License, Version 2.0 (the
-#       "License"); you may not use this file except in compliance
-#       with the License.  You may obtain a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#       Unless required by applicable law or agreed to in writing,
-#       software distributed under the License is distributed on an
-#       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#       KIND, either express or implied.  See the License for the
-#       specific language governing permissions and limitations
-#       under the License.
-#
-# create a cordova/blackberry project
-# 
-# USAGE
-#   ./create [path appname]
-#
-set -e
-
-if [ -n "$1" ] && [ "$1" == "-h" ]
-then
-    echo 'usage: create path appname'
-    echo 'After you have created your application, make sure to customize the project.properties file inside your app directory with your environment specifics!'
-    exit 0
-fi
-
-BUILD_PATH="$( cd "$( dirname "$0" )/.." && pwd )"
-VERSION=$(cat "$BUILD_PATH/VERSION")
-
-PROJECT_PATH="${1:-"./example"}"
-APPNAME=${2:-"cordovaExample"}
-MANIFEST_PATH="$PROJECT_PATH/www/manifest.webapp"
-
-# clobber any existing example
-if [ -d "$PROJECT_PATH" ]
-then
-    echo "Project already exists! Delete and recreate"
-    exit 1
-fi
-
-# cleanup after exit and/or on error
-function on_exit {
-    echo "Finished"
-}
-
-function on_error {
-    echo "An error occured. Deleting project..."
-    [ -d "$PROJECT_PATH" ] && rm -rf "$PROJECT_PATH"
-}
-
-
-# we do not want the script to silently fail
-trap on_error ERR
-trap on_exit EXIT
-
-echo "Copying assets and resources ..."
-cp -r $BUILD_PATH/bin/templates/project $PROJECT_PATH
-cp -r $BUILD_PATH/framework/ $PROJECT_PATH/www
-cp -r $BUILD_PATH/framework/install.html $PROJECT_PATH/www/install.html
-
-echo "Building cordova-$VERSION.js ..."
-cp $BUILD_PATH/javascript/cordova.firefoxos.js $PROJECT_PATH/www/cordova-$VERSION.js
-
-# interpolate the app name into manifest.webapp
-echo "Updating manifest.webapp ..."
-sed -i '' -e "s/__NAME__/${APPNAME}/g" "$MANIFEST_PATH"
-
-echo "Updating npm modules ..."
-cd $PROJECT_PATH
-npm install
-cd $BUILD_PATH
-

http://git-wip-us.apache.org/repos/asf/cordova-labs/blob/5463adb0/bin/templates/project/README.md
----------------------------------------------------------------------
diff --git a/bin/templates/project/README.md b/bin/templates/project/README.md
deleted file mode 100644
index 3680525..0000000
--- a/bin/templates/project/README.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# A Blank Template for Open Web Apps
-
-The is a minimal template that has a little HTML, CSS, and js to help
-you start writing an Open Web App.
-
-This is part of the [mortar](https://github.com/mozilla/mortar/)
-template collection for building Open Web Apps.
-
-# Usage
-
-There are a few ways to get this template:
-
-* git clone git://github.com/mozilla/mortar-app-stub.git myapp
-* volo create myapp mozilla/mortar-app-stub
-
-If you have node installed, you can run a development server with volo:
-
-1. cd myapp
-2. volo serve
-
-View the app at http://localhost:8008/.

http://git-wip-us.apache.org/repos/asf/cordova-labs/blob/5463adb0/bin/templates/project/cordova/build
----------------------------------------------------------------------
diff --git a/bin/templates/project/cordova/build b/bin/templates/project/cordova/build
deleted file mode 100755
index 082988b..0000000
--- a/bin/templates/project/cordova/build
+++ /dev/null
@@ -1,20 +0,0 @@
-#! /bin/sh
-#       Licensed to the Apache Software Foundation (ASF) under one
-#       or more contributor license agreements.  See the NOTICE file
-#       distributed with this work for additional information
-#       regarding copyright ownership.  The ASF licenses this file
-#       to you under the Apache License, Version 2.0 (the
-#       "License"); you may not use this file except in compliance
-#       with the License.  You may obtain a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#       Unless required by applicable law or agreed to in writing,
-#       software distributed under the License is distributed on an
-#       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#       KIND, either express or implied.  See the License for the
-#       specific language governing permissions and limitations
-#       under the License.
-
-volo appcache
-cp www-built/manifest.appcache www-built/cache.manifest

http://git-wip-us.apache.org/repos/asf/cordova-labs/blob/5463adb0/bin/templates/project/cordova/run
----------------------------------------------------------------------
diff --git a/bin/templates/project/cordova/run b/bin/templates/project/cordova/run
deleted file mode 100755
index 09ce8c2..0000000
--- a/bin/templates/project/cordova/run
+++ /dev/null
@@ -1,22 +0,0 @@
-#! /bin/sh
-#       Licensed to the Apache Software Foundation (ASF) under one
-#       or more contributor license agreements.  See the NOTICE file
-#       distributed with this work for additional information
-#       regarding copyright ownership.  The ASF licenses this file
-#       to you under the Apache License, Version 2.0 (the
-#       "License"); you may not use this file except in compliance
-#       with the License.  You may obtain a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#       Unless required by applicable law or agreed to in writing,
-#       software distributed under the License is distributed on an
-#       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#       KIND, either express or implied.  See the License for the
-#       specific language governing permissions and limitations
-#       under the License.
-
-volo appcache
-cp www-built/manifest.appcache www-built/cache.manifest
-echo "Navigate your phone or simulator to: http://localhost:8008/install.html"
-volo serve 8008 base=www-built

http://git-wip-us.apache.org/repos/asf/cordova-labs/blob/5463adb0/bin/templates/project/package.json
----------------------------------------------------------------------
diff --git a/bin/templates/project/package.json b/bin/templates/project/package.json
deleted file mode 100644
index 1dffaa3..0000000
--- a/bin/templates/project/package.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
-  "name": "mortar",
-  "version": "0.0.1",
-  "dependencies": {
-    "volo-ghdeploy": "0.0.3",
-    "connect": "~2.4.4",
-    "less-middleware": "~0.1.5"
-  },
-  "amd": {},
-  "volo": {
-    "dependencies": {
-      "zepto": "github:madrobby/zepto/v0.8"
-    },
-    "baseUrl": "www/js/lib"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-labs/blob/5463adb0/bin/templates/project/tools/almond.js
----------------------------------------------------------------------
diff --git a/bin/templates/project/tools/almond.js b/bin/templates/project/tools/almond.js
deleted file mode 100644
index 613854a..0000000
--- a/bin/templates/project/tools/almond.js
+++ /dev/null
@@ -1,277 +0,0 @@
-/**
- * almond 0.0.3 Copyright (c) 2011, The Dojo Foundation All Rights Reserved.
- * Available via the MIT or new BSD license.
- * see: http://github.com/jrburke/almond for details
- */
-/*jslint strict: false, plusplus: false */
-/*global setTimeout: false */
-
-var requirejs, require, define;
-(function (undef) {
-
-    var defined = {},
-        waiting = {},
-        aps = [].slice,
-        main, req;
-
-    if (typeof define === "function") {
-        //If a define is already in play via another AMD loader,
-        //do not overwrite.
-        return;
-    }
-
-    /**
-     * Given a relative module name, like ./something, normalize it to
-     * a real name that can be mapped to a path.
-     * @param {String} name the relative name
-     * @param {String} baseName a real name that the name arg is relative
-     * to.
-     * @returns {String} normalized name
-     */
-    function normalize(name, baseName) {
-        //Adjust any relative paths.
-        if (name && name.charAt(0) === ".") {
-            //If have a base name, try to normalize against it,
-            //otherwise, assume it is a top-level require that will
-            //be relative to baseUrl in the end.
-            if (baseName) {
-                //Convert baseName to array, and lop off the last part,
-                //so that . matches that "directory" and not name of the baseName's
-                //module. For instance, baseName of "one/two/three", maps to
-                //"one/two/three.js", but we want the directory, "one/two" for
-                //this normalization.
-                baseName = baseName.split("/");
-                baseName = baseName.slice(0, baseName.length - 1);
-
-                name = baseName.concat(name.split("/"));
-
-                //start trimDots
-                var i, part;
-                for (i = 0; (part = name[i]); i++) {
-                    if (part === ".") {
-                        name.splice(i, 1);
-                        i -= 1;
-                    } else if (part === "..") {
-                        if (i === 1 && (name[2] === '..' || name[0] === '..')) {
-                            //End of the line. Keep at least one non-dot
-                            //path segment at the front so it can be mapped
-                            //correctly to disk. Otherwise, there is likely
-                            //no path mapping for a path starting with '..'.
-                            //This can still fail, but catches the most reasonable
-                            //uses of ..
-                            break;
-                        } else if (i > 0) {
-                            name.splice(i - 1, 2);
-                            i -= 2;
-                        }
-                    }
-                }
-                //end trimDots
-
-                name = name.join("/");
-            }
-        }
-        return name;
-    }
-
-    function makeRequire(relName, forceSync) {
-        return function () {
-            //A version of a require function that passes a moduleName
-            //value for items that may need to
-            //look up paths relative to the moduleName
-            return req.apply(undef, aps.call(arguments, 0).concat([relName, forceSync]));
-        };
-    }
-
-    function makeNormalize(relName) {
-        return function (name) {
-            return normalize(name, relName);
-        };
-    }
-
-    function makeLoad(depName) {
-        return function (value) {
-            defined[depName] = value;
-        };
-    }
-
-    function callDep(name) {
-        if (waiting.hasOwnProperty(name)) {
-            var args = waiting[name];
-            delete waiting[name];
-            main.apply(undef, args);
-        }
-        return defined[name];
-    }
-
-    /**
-     * Makes a name map, normalizing the name, and using a plugin
-     * for normalization if necessary. Grabs a ref to plugin
-     * too, as an optimization.
-     */
-    function makeMap(name, relName) {
-        var prefix, plugin,
-            index = name.indexOf('!');
-
-        if (index !== -1) {
-            prefix = normalize(name.slice(0, index), relName);
-            name = name.slice(index + 1);
-            plugin = callDep(prefix);
-
-            //Normalize according
-            if (plugin && plugin.normalize) {
-                name = plugin.normalize(name, makeNormalize(relName));
-            } else {
-                name = normalize(name, relName);
-            }
-        } else {
-            name = normalize(name, relName);
-        }
-
-        //Using ridiculous property names for space reasons
-        return {
-            f: prefix ? prefix + '!' + name : name, //fullName
-            n: name,
-            p: plugin
-        };
-    }
-
-    main = function (name, deps, callback, relName) {
-        var args = [],
-            usingExports,
-            cjsModule, depName, i, ret, map;
-
-        //Use name if no relName
-        if (!relName) {
-            relName = name;
-        }
-
-        //Call the callback to define the module, if necessary.
-        if (typeof callback === 'function') {
-
-            //Default to require, exports, module if no deps if
-            //the factory arg has any arguments specified.
-            if (!deps.length && callback.length) {
-                deps = ['require', 'exports', 'module'];
-            }
-
-            //Pull out the defined dependencies and pass the ordered
-            //values to the callback.
-            for (i = 0; i < deps.length; i++) {
-                map = makeMap(deps[i], relName);
-                depName = map.f;
-
-                //Fast path CommonJS standard dependencies.
-                if (depName === "require") {
-                    args[i] = makeRequire(name);
-                } else if (depName === "exports") {
-                    //CommonJS module spec 1.1
-                    args[i] = defined[name] = {};
-                    usingExports = true;
-                } else if (depName === "module") {
-                    //CommonJS module spec 1.1
-                    cjsModule = args[i] = {
-                        id: name,
-                        uri: '',
-                        exports: defined[name]
-                    };
-                } else if (defined.hasOwnProperty(depName) || waiting.hasOwnProperty(depName)) {
-                    args[i] = callDep(depName);
-                } else if (map.p) {
-                    map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {});
-                    args[i] = defined[depName];
-                } else {
-                    throw name + ' missing ' + depName;
-                }
-            }
-
-            ret = callback.apply(defined[name], args);
-
-            if (name) {
-                //If setting exports via "module" is in play,
-                //favor that over return value and exports. After that,
-                //favor a non-undefined return value over exports use.
-                if (cjsModule && cjsModule.exports !== undef) {
-                    defined[name] = cjsModule.exports;
-                } else if (!usingExports) {
-                    //Use the return value from the function.
-                    defined[name] = ret;
-                }
-            }
-        } else if (name) {
-            //May just be an object definition for the module. Only
-            //worry about defining if have a module name.
-            defined[name] = callback;
-        }
-    };
-
-    requirejs = req = function (deps, callback, relName, forceSync) {
-        if (typeof deps === "string") {
-
-            //Just return the module wanted. In this scenario, the
-            //deps arg is the module name, and second arg (if passed)
-            //is just the relName.
-            //Normalize module name, if it contains . or ..
-            return callDep(makeMap(deps, callback).f);
-        } else if (!deps.splice) {
-            //deps is a config object, not an array.
-            //Drop the config stuff on the ground.
-            if (callback.splice) {
-                //callback is an array, which means it is a dependency list.
-                //Adjust args if there are dependencies
-                deps = callback;
-                callback = arguments[2];
-            } else {
-                deps = [];
-            }
-        }
-
-        //Simulate async callback;
-        if (forceSync) {
-            main(undef, deps, callback, relName);
-        } else {
-            setTimeout(function () {
-                main(undef, deps, callback, relName);
-            }, 15);
-        }
-
-        return req;
-    };
-
-    /**
-     * Just drops the config on the floor, but returns req in case
-     * the config return value is used.
-     */
-    req.config = function () {
-        return req;
-    };
-
-    /**
-     * Export require as a global, but only if it does not already exist.
-     */
-    if (!require) {
-        require = req;
-    }
-
-    define = function (name, deps, callback) {
-
-        //This module may not have dependencies
-        if (!deps.splice) {
-            //deps is not an array, so probably means
-            //an object literal or factory function for
-            //the value. Adjust args.
-            callback = deps;
-            deps = [];
-        }
-
-        if (define.unordered) {
-            waiting[name] = [name, deps, callback];
-        } else {
-            main(name, deps, callback);
-        }
-    };
-
-    define.amd = {
-        jQuery: true
-    };
-}());

http://git-wip-us.apache.org/repos/asf/cordova-labs/blob/5463adb0/bin/templates/project/tools/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/project/tools/build.js b/bin/templates/project/tools/build.js
deleted file mode 100644
index 65e9851..0000000
--- a/bin/templates/project/tools/build.js
+++ /dev/null
@@ -1,8 +0,0 @@
-({
-    baseUrl: "js/lib",
-    map: { '*': { 'jquery': 'zepto' } },
-    dir: "../www-built",
-    appDir: "../www",
-    removeCombined: true,
-    modules: []
-})

http://git-wip-us.apache.org/repos/asf/cordova-labs/blob/5463adb0/bin/templates/project/tools/manifest.appcache
----------------------------------------------------------------------
diff --git a/bin/templates/project/tools/manifest.appcache b/bin/templates/project/tools/manifest.appcache
deleted file mode 100644
index d337bb4..0000000
--- a/bin/templates/project/tools/manifest.appcache
+++ /dev/null
@@ -1,11 +0,0 @@
-CACHE MANIFEST
-# {stamp}
-
-CACHE:
-{files}
-
-# catch-all for anything else
-NETWORK:
-*
-http://*
-https://*
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-labs/blob/5463adb0/bin/templates/project/tools/oneless.js
----------------------------------------------------------------------
diff --git a/bin/templates/project/tools/oneless.js b/bin/templates/project/tools/oneless.js
deleted file mode 100755
index afee5b0..0000000
--- a/bin/templates/project/tools/oneless.js
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/usr/bin/env node
-//
-// LESS - Leaner CSS v@VERSION
-// http://lesscss.org
-// 
-// Copyright (c) 2009-2011, Alexis Sellier
-// Licensed under the Apache 2.0 License.
-//
-(function(B){function l(c){return c==="../lib/less"?p:c==="./parser"?p:c.indexOf(".")===0?p[c.split("/")[1]]:B(c)}exports.tree={};var f=exports.tree,p;if(typeof environment==="object"&&{}.toString.call(environment)==="[object Environment]")p=typeof window==="undefined"?{}:window.less={},f=p.tree={},p.mode="rhino";else if(typeof window==="undefined")p=exports,f=l("./tree"),p.mode="node";else{if(typeof window.less==="undefined")window.less={};p=window.less;f=window.less.tree={};p.mode="browser"}p.Parser=
-function(c){function a(){u=q[o];v=j;t=j}function b(){q[o]=u;j=v;t=j}function e(){j>t&&(q[o]=q[o].slice(j-t),t=j)}function d(d){var a,b,c,g;if(d instanceof Function)return d.call(x.parsers);else if(typeof d==="string")d=k.charAt(j)===d?d:null,a=1,e();else if(e(),d=d.exec(q[o]))a=d[0].length;else return null;if(d){g=j+=a;for(c=j+q[o].length-a;j<c;){b=k.charCodeAt(j);if(!(b===32||b===10||b===9))break;j++}q[o]=q[o].slice(a+(j-g));t=j;q[o].length===0&&o<q.length-1&&o++;return typeof d==="string"?d:d.length===
-1?d[0]:d}}function i(a,b){var c=d(a);if(c)return c;else g(b||(typeof a==="string"?"expected '"+a+"' got '"+k.charAt(j)+"'":"unexpected token"))}function g(d,a){throw{index:j,type:a||"Syntax",message:d};}function h(d){return typeof d==="string"?k.charAt(j)===d:d.test(q[o])?!0:!1}function n(d,a){for(var b=d,c=-1;b>=0&&a.charAt(b)!=="\n";b--)c++;return{line:typeof d==="number"?(a.slice(0,d).match(/\n/g)||"").length:null,column:c}}function m(d,a){var b=d.filename&&a.filename&&d.filename!==a.filename?
-x.imports.contents[p.mode==="node"?l("path").basename(d.filename):d.filename.match(/[^\/]+$/)[0]]:k,c=n(d.index,b),e=c.line,c=c.column,g=b.split("\n");this.type=d.type||"Syntax";this.message=d.message;this.filename=d.filename||a.filename;this.index=d.index;this.line=typeof e==="number"?e+1:null;this.callLine=d.call&&n(d.call,b).line+1;this.callExtract=g[n(d.call,b).line];this.stack=d.stack;this.column=c;this.extract=[g[e-1],g[e],g[e+1]]}var k,j,o,u,v,y,q,t,x,A=function(){},z=this.imports={paths:c&&
-c.paths||[],queue:[],files:{},contents:{},mime:c&&c.mime,error:null,push:function(d,a){var b=this;this.queue.push(d);p.Parser.importer(d,this.paths,function(c,e,g){b.queue.splice(b.queue.indexOf(d),1);b.files[d]=e;b.contents[d]=g;if(c&&!b.error)b.error=c;a(c,e);b.queue.length===0&&A()},c)}};this.env=c=c||{};this.optimization="optimization"in this.env?this.env.optimization:1;this.env.filename=this.env.filename||null;return x={imports:z,parse:function(a,b){var e,g,i,h=null;j=o=t=y=0;k=a.replace(/\r\n/g,
-"\n");q=function(d){for(var a=0,b=/[^"'`\{\}\/\(\)\\]+/g,e=/\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,w=/"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`\\\r\n]|\\.)*)`/g,g=0,i,s=d[0],j,f=0,r,n;f<k.length;f++){b.lastIndex=f;if((i=b.exec(k))&&i.index===f)f+=i[0].length,s.push(i[0]);r=k.charAt(f);e.lastIndex=w.lastIndex=f;if((i=w.exec(k))&&i.index===f)f+=i[0].length,s.push(i[0]),r=k.charAt(f);if(!j&&r==="/"&&(n=k.charAt(f+1),n==="/"||n==="*"))if((i=e.exec(k))&&i.index===f)f+=i[0].length,s.push(i[0]),
-r=k.charAt(f);switch(r){case "{":if(!j){g++;s.push(r);break}case "}":if(!j){g--;s.push(r);d[++a]=s=[];break}case "(":if(!j){j=!0;s.push(r);break}case ")":if(j){j=!1;s.push(r);break}default:s.push(r)}}g>0&&(h=new m({index:f,type:"Parse",message:"missing closing `}`",filename:c.filename},c));return d.map(function(d){return d.join("")})}([[]]);if(h)return b(h);try{e=new f.Ruleset([],d(this.parsers.primary)),e.root=!0}catch(n){return b(new m(n,c))}e.toCSS=function(d){return function(a,b){var e=[],a=a||
-{};typeof b==="object"&&!Array.isArray(b)&&(b=Object.keys(b).map(function(d){var a=b[d];a instanceof f.Value||(a instanceof f.Expression||(a=new f.Expression([a])),a=new f.Value([a]));return new f.Rule("@"+d,a,!1,0)}),e=[new f.Ruleset(null,b)]);try{var w=d.call(this,{frames:e}).toCSS([],{compress:a.compress||!1})}catch(g){throw new m(g,c);}if(e=x.imports.error)if(e instanceof m)throw e;else throw new m(e,c);return a.yuicompress&&p.mode==="node"?l("./cssmin").compressor.cssmin(w):a.compress?w.replace(/(\s)+/g,
-"$1"):w}}(e.eval);if(j<k.length-1){j=y;i=k.split("\n");g=(k.slice(0,j).match(/\n/g)||"").length+1;for(var u=j,v=-1;u>=0&&k.charAt(u)!=="\n";u--)v++;h={type:"Parse",message:"Syntax Error on line "+g,index:j,filename:c.filename,line:g,column:v,extract:[i[g-2],i[g-1],i[g]]}}this.imports.queue.length>0?A=function(){b(h,e)}:b(h,e)},parsers:{primary:function(){for(var a,b=[];(a=d(this.mixin.definition)||d(this.rule)||d(this.ruleset)||d(this.mixin.call)||d(this.comment)||d(this.directive))||d(/^[\s\n]+/);)a&&
-b.push(a);return b},comment:function(){var a;if(k.charAt(j)==="/")if(k.charAt(j+1)==="/")return new f.Comment(d(/^\/\/.*/),!0);else if(a=d(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))return new f.Comment(a)},entities:{quoted:function(){var a;a=j;var b;k.charAt(a)==="~"&&(a++,b=!0);if(!(k.charAt(a)!=='"'&&k.charAt(a)!=="'")&&(b&&d("~"),a=d(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/)))return new f.Quoted(a[0],a[1]||a[2],b)},keyword:function(){var a;if(a=d(/^[_A-Za-z-][_A-Za-z0-9-]*/))return f.colors.hasOwnProperty(a)?
-new f.Color(f.colors[a].slice(1)):new f.Keyword(a)},call:function(){var a,b,e=j;if(a=/^([\w-]+|%|progid:[\w\.]+)\(/.exec(q[o])){a=a[1].toLowerCase();if(a==="url")return null;else j+=a.length;if(a==="alpha")return d(this.alpha);d("(");b=d(this.entities.arguments);if(d(")")&&a)return new f.Call(a,b,e,c.filename)}},arguments:function(){for(var a=[],b;b=d(this.entities.assignment)||d(this.expression);)if(a.push(b),!d(","))break;return a},literal:function(){return d(this.entities.dimension)||d(this.entities.color)||
-d(this.entities.quoted)},assignment:function(){var a,b;if((a=d(/^\w+(?=\s?=)/i))&&d("=")&&(b=d(this.entity)))return new f.Assignment(a,b)},url:function(){var a;if(k.charAt(j)==="u"&&d(/^url\(/))return a=d(this.entities.quoted)||d(this.entities.variable)||d(this.entities.dataURI)||d(/^[-\w%@$\/.&=:;#+?~]+/)||"",i(")"),new f.URL(a.value||a.data||a instanceof f.Variable?a:new f.Anonymous(a),z.paths)},dataURI:function(){var a;if(d(/^data:/)&&(a={},a.mime=d(/^[^\/]+\/[^,;)]+/)||"",a.charset=d(/^;\s*charset=[^,;)]+/)||
-"",a.base64=d(/^;\s*base64/)||"",a.data=d(/^,\s*[^)]+/),a.data))return a},variable:function(){var a,b=j;if(k.charAt(j)==="@"&&(a=d(/^@@?[\w-]+/)))return new f.Variable(a,b,c.filename)},color:function(){var a;if(k.charAt(j)==="#"&&(a=d(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/)))return new f.Color(a[1])},dimension:function(){var a;a=k.charCodeAt(j);if(!(a>57||a<45||a===47))if(a=d(/^(-?\d*\.?\d+)(px|%|em|rem|pc|ex|in|deg|s|ms|pt|cm|mm|rad|grad|turn)?/))return new f.Dimension(a[1],a[2])},javascript:function(){var a;
-a=j;var b;k.charAt(a)==="~"&&(a++,b=!0);if(k.charAt(a)==="`"&&(b&&d("~"),a=d(/^`([^`]*)`/)))return new f.JavaScript(a[1],j,b)}},variable:function(){var a;if(k.charAt(j)==="@"&&(a=d(/^(@[\w-]+)\s*:/)))return a[1]},shorthand:function(){var a,b;if(h(/^[@\w.%-]+\/[@\w.-]+/)&&(a=d(this.entity))&&d("/")&&(b=d(this.entity)))return new f.Shorthand(a,b)},mixin:{call:function(){var a=[],b,e,g,i=j;b=k.charAt(j);var n=!1;if(!(b!=="."&&b!=="#")){for(;b=d(/^[#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/);)a.push(new f.Element(e,
-b,j)),e=d(">");d("(")&&(g=d(this.entities.arguments))&&d(")");d(this.important)&&(n=!0);if(a.length>0&&(d(";")||h("}")))return new f.mixin.Call(a,g||[],i,c.filename,n)}},definition:function(){var c,e=[],g,n,m,l=!1;if(!(k.charAt(j)!=="."&&k.charAt(j)!=="#"||h(/^[^{]*(;|})/)))if(a(),c=d(/^([#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+)\s*\(/)){c=c[1];do if(k.charAt(j)==="."&&d(/^\.{3}/)){l=!0;break}else if(g=d(this.entities.variable)||d(this.entities.literal)||d(this.entities.keyword))if(g instanceof
-f.Variable)if(d(":"))n=i(this.expression,"expected expression"),e.push({name:g.name,value:n});else if(d(/^\.{3}/)){e.push({name:g.name,variadic:!0});l=!0;break}else e.push({name:g.name});else e.push({value:g});else break;while(d(","));i(")");d(/^when/)&&(m=i(this.conditions,"expected condition"));if(g=d(this.block))return new f.mixin.Definition(c,e,g,m,l);else b()}}},entity:function(){return d(this.entities.literal)||d(this.entities.variable)||d(this.entities.url)||d(this.entities.call)||d(this.entities.keyword)||
-d(this.entities.javascript)||d(this.comment)},end:function(){return d(";")||h("}")},alpha:function(){var a;if(d(/^\(opacity=/i)&&(a=d(/^\d+/)||d(this.entities.variable)))return i(")"),new f.Alpha(a)},element:function(){var a,b,c;b=d(this.combinator);(a=d(/^(?:\d+\.\d+|\d+)%/)||d(/^(?:[.#]?|:*)(?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/)||d("*")||d(this.attribute)||d(/^\([^)@]+\)/))||d("(")&&(c=d(this.entities.variable))&&d(")")&&(a=new f.Paren(c));if(a)return new f.Element(b,a,j);if(b.value&&
-b.value.charAt(0)==="&")return new f.Element(b,null,j)},combinator:function(){var a;a=k.charAt(j);if(a===">"||a==="+"||a==="~"){for(j++;k.charAt(j)===" ";)j++;return new f.Combinator(a)}else if(a==="&"){a="&";j++;for(k.charAt(j)===" "&&(a="& ");k.charAt(j)===" ";)j++;return new f.Combinator(a)}else return k.charAt(j-1)===" "?new f.Combinator(" "):new f.Combinator(null)},selector:function(){var a,b=[],c;if(d("("))return a=d(this.entity),i(")"),new f.Selector([new f.Element("",a,j)]);for(;a=d(this.element);)if(c=
-k.charAt(j),b.push(a),c==="{"||c==="}"||c===";"||c===",")break;if(b.length>0)return new f.Selector(b)},tag:function(){return d(/^[a-zA-Z][a-zA-Z-]*[0-9]?/)||d("*")},attribute:function(){var a="",b,c,e;if(d("[")){if(b=d(/^[a-zA-Z-]+/)||d(this.entities.quoted))a=(e=d(/^[|~*$^]?=/))&&(c=d(this.entities.quoted)||d(/^[\w-]+/))?[b,e,c.toCSS?c.toCSS():c].join(""):b;if(d("]")&&a)return"["+a+"]"}},block:function(){var a;if(d("{")&&(a=d(this.primary))&&d("}"))return a},ruleset:function(){var e=[],g,i;for(a();g=
-d(this.selector);){e.push(g);d(this.comment);if(!d(","))break;d(this.comment)}if(e.length>0&&(i=d(this.block)))return new f.Ruleset(e,i,c.strictImports);else y=j,b()},rule:function(){var c,e;c=k.charAt(j);var g;a();if(!(c==="."||c==="#"||c==="&"))if(c=d(this.variable)||d(this.property))if(c.charAt(0)!="@"&&(e=/^([^@+\/'"*`(;{}-]*);/.exec(q[o]))?(j+=e[0].length-1,e=new f.Anonymous(e[1])):e=c==="font"?d(this.font):d(this.value),g=d(this.important),e&&d(this.end))return new f.Rule(c,e,g,v);else y=j,
-b()},"import":function(){var a,b,c=j;if(d(/^@import\s+/)&&(a=d(this.entities.quoted)||d(this.entities.url)))if(b=d(this.mediaFeatures),d(";"))return new f.Import(a,z,b,c)},mediaFeature:function(){var a,b,c=[];do if(a=d(this.entities.keyword))c.push(a);else if(d("("))if(b=d(this.property),a=d(this.entity),d(")"))if(b&&a)c.push(new f.Paren(new f.Rule(b,a,null,j,!0)));else if(a)c.push(new f.Paren(a));else return null;else return null;while(a);if(c.length>0)return new f.Expression(c)},mediaFeatures:function(){var a,
-b=[];do if(a=d(this.mediaFeature)){if(b.push(a),!d(","))break}else if(a=d(this.entities.variable))if(b.push(a),!d(","))break;while(a);return b.length>0?b:null},media:function(){var a,b;if(d(/^@media/)&&(a=d(this.mediaFeatures),b=d(this.block)))return new f.Media(b,a)},directive:function(){var a,b,c;if(k.charAt(j)==="@")if(b=d(this["import"])||d(this.media))return b;else if(a=d(/^@page|@keyframes/)||d(/^@(?:-webkit-|-moz-|-o-|-ms-)[a-z0-9-]+/)){if(c=(d(/^[^{]+/)||"").trim(),b=d(this.block))return new f.Directive(a+
-" "+c,b)}else if(a=d(/^@[-a-z]+/))if(a==="@font-face"){if(b=d(this.block))return new f.Directive(a,b)}else if((b=d(this.entity))&&d(";"))return new f.Directive(a,b)},font:function(){for(var a=[],b=[],c;c=d(this.shorthand)||d(this.entity);)b.push(c);a.push(new f.Expression(b));if(d(","))for(;c=d(this.expression);)if(a.push(c),!d(","))break;return new f.Value(a)},value:function(){for(var a,b=[];a=d(this.expression);)if(b.push(a),!d(","))break;if(b.length>0)return new f.Value(b)},important:function(){if(k.charAt(j)===
-"!")return d(/^! *important/)},sub:function(){var a;if(d("(")&&(a=d(this.expression))&&d(")"))return a},multiplication:function(){var a,b,c,e;if(a=d(this.operand)){for(;!h(/^\/\*/)&&(c=d("/")||d("*"))&&(b=d(this.operand));)e=new f.Operation(c,[e||a,b]);return e||a}},addition:function(){var a,b,c,e;if(a=d(this.multiplication)){for(;(c=d(/^[-+]\s+/)||k.charAt(j-1)!=" "&&(d("+")||d("-")))&&(b=d(this.multiplication));)e=new f.Operation(c,[e||a,b]);return e||a}},conditions:function(){var a,b,c=j,e;if(a=
-d(this.condition)){for(;d(",")&&(b=d(this.condition));)e=new f.Condition("or",e||a,b,c);return e||a}},condition:function(){var a,b,c,e,h=j,k=!1;d(/^not/)&&(k=!0);i("(");if(a=d(this.addition)||d(this.entities.keyword)||d(this.entities.quoted))return(e=d(/^(?:>=|=<|[<=>])/))?(b=d(this.addition)||d(this.entities.keyword)||d(this.entities.quoted))?c=new f.Condition(e,a,b,h,k):g("expected expression"):c=new f.Condition("=",a,new f.Keyword("true"),h,k),i(")"),d(/^and/)?new f.Condition("and",c,d(this.condition)):
-c},operand:function(){var a,b=k.charAt(j+1);if(k.charAt(j)==="-"&&(b==="@"||b==="("))a=d("-");b=d(this.sub)||d(this.entities.dimension)||d(this.entities.color)||d(this.entities.variable)||d(this.entities.call);return a?new f.Operation("*",[new f.Dimension(-1),b]):b},expression:function(){for(var a,b=[];a=d(this.addition)||d(this.entity);)b.push(a);if(b.length>0)return new f.Expression(b)},property:function(){var a;if(a=d(/^(\*?-?[-a-z_0-9]+)\s*:/))return a[1]}}}};if(p.mode==="browser"||p.mode==="rhino")p.Parser.importer=
-function(c,a,b,e){!/^([a-z]+:)?\//.test(c)&&a.length>0&&(c=a[0]+c);loadStyleSheet({href:c,title:c,type:e.mime},function(d){d&&typeof e.errback==="function"?e.errback.call(null,c,a,b,e):b.apply(null,arguments)},!0)};(function(c){function a(a){return c.functions.hsla(a.h,a.s,a.l,a.a)}function b(a){if(a instanceof c.Dimension)return parseFloat(a.unit=="%"?a.value/100:a.value);else if(typeof a==="number")return a;else throw{error:"RuntimeError",message:"color functions take numbers as parameters"};}function e(a){return Math.min(1,
-Math.max(0,a))}c.functions={rgb:function(a,b,c){return this.rgba(a,b,c,1)},rgba:function(a,e,g,h){a=[a,e,g].map(function(a){return b(a)});h=b(h);return new c.Color(a,h)},hsl:function(a,b,c){return this.hsla(a,b,c,1)},hsla:function(a,c,e,h){function f(a){a=a<0?a+1:a>1?a-1:a;return a*6<1?k+(m-k)*a*6:a*2<1?m:a*3<2?k+(m-k)*(2/3-a)*6:k}var a=b(a)%360/360,c=b(c),e=b(e),h=b(h),m=e<=0.5?e*(c+1):e+c-e*c,k=e*2-m;return this.rgba(f(a+1/3)*255,f(a)*255,f(a-1/3)*255,h)},hue:function(a){return new c.Dimension(Math.round(a.toHSL().h))},
-saturation:function(a){return new c.Dimension(Math.round(a.toHSL().s*100),"%")},lightness:function(a){return new c.Dimension(Math.round(a.toHSL().l*100),"%")},alpha:function(a){return new c.Dimension(a.toHSL().a)},saturate:function(d,b){var c=d.toHSL();c.s+=b.value/100;c.s=e(c.s);return a(c)},desaturate:function(b,c){var g=b.toHSL();g.s-=c.value/100;g.s=e(g.s);return a(g)},lighten:function(b,c){var g=b.toHSL();g.l+=c.value/100;g.l=e(g.l);return a(g)},darken:function(b,c){var g=b.toHSL();g.l-=c.value/
-100;g.l=e(g.l);return a(g)},fadein:function(b,c){var g=b.toHSL();g.a+=c.value/100;g.a=e(g.a);return a(g)},fadeout:function(b,c){var g=b.toHSL();g.a-=c.value/100;g.a=e(g.a);return a(g)},fade:function(b,c){var g=b.toHSL();g.a=c.value/100;g.a=e(g.a);return a(g)},spin:function(b,c){var e=b.toHSL(),h=(e.h+c.value)%360;e.h=h<0?360+h:h;return a(e)},mix:function(a,b,e){var e=e.value/100,h=e*2-1,f=a.toHSL().a-b.toHSL().a,h=((h*f==-1?h:(h+f)/(1+h*f))+1)/2,f=1-h;return new c.Color([a.rgb[0]*h+b.rgb[0]*f,a.rgb[1]*
-h+b.rgb[1]*f,a.rgb[2]*h+b.rgb[2]*f],a.alpha*e+b.alpha*(1-e))},greyscale:function(a){return this.desaturate(a,new c.Dimension(100))},e:function(a){return new c.Anonymous(a instanceof c.JavaScript?a.evaluated:a)},escape:function(a){return new c.Anonymous(encodeURI(a.value).replace(/=/g,"%3D").replace(/:/g,"%3A").replace(/#/g,"%23").replace(/;/g,"%3B").replace(/\(/g,"%28").replace(/\)/g,"%29"))},"%":function(a){for(var b=Array.prototype.slice.call(arguments,1),e=a.value,h=0;h<b.length;h++)e=e.replace(/%[sda]/i,
-function(a){var d=a.match(/s/i)?b[h].value:b[h].toCSS();return a.match(/[A-Z]$/)?encodeURIComponent(d):d});e=e.replace(/%%/g,"%");return new c.Quoted('"'+e+'"',e)},round:function(a){return this._math("round",a)},ceil:function(a){return this._math("ceil",a)},floor:function(a){return this._math("floor",a)},_math:function(a,e){if(e instanceof c.Dimension)return new c.Dimension(Math[a](b(e)),e.unit);else if(typeof e==="number")return Math[a](e);else throw{type:"Argument",message:"argument must be a number"};
-},argb:function(a){return new c.Anonymous(a.toARGB())},percentage:function(a){return new c.Dimension(a.value*100,"%")},color:function(a){if(a instanceof c.Quoted)return new c.Color(a.value.slice(1));else throw{type:"Argument",message:"argument must be a string"};},iscolor:function(a){return this._isa(a,c.Color)},isnumber:function(a){return this._isa(a,c.Dimension)},isstring:function(a){return this._isa(a,c.Quoted)},iskeyword:function(a){return this._isa(a,c.Keyword)},isurl:function(a){return this._isa(a,
-c.URL)},ispixel:function(a){return a instanceof c.Dimension&&a.unit==="px"?c.True:c.False},ispercentage:function(a){return a instanceof c.Dimension&&a.unit==="%"?c.True:c.False},isem:function(a){return a instanceof c.Dimension&&a.unit==="em"?c.True:c.False},_isa:function(a,b){return a instanceof b?c.True:c.False}}})(l("./tree"));(function(c){c.colors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",
-blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",
-darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",
-ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",
-magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",
-palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",
-tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}})(l("./tree"));(function(c){c.Alpha=function(a){this.value=a};c.Alpha.prototype={toCSS:function(){return"alpha(opacity="+(this.value.toCSS?this.value.toCSS():this.value)+")"},eval:function(a){if(this.value.eval)this.value=this.value.eval(a);return this}}})(l("../tree"));(function(c){c.Anonymous=function(a){this.value=
-a.value||a};c.Anonymous.prototype={toCSS:function(){return this.value},eval:function(){return this}}})(l("../tree"));(function(c){c.Assignment=function(a,b){this.key=a;this.value=b};c.Assignment.prototype={toCSS:function(){return this.key+"="+(this.value.toCSS?this.value.toCSS():this.value)},eval:function(a){if(this.value.eval)this.value=this.value.eval(a);return this}}})(l("../tree"));(function(c){c.Call=function(a,b,c,d){this.name=a;this.args=b;this.index=c;this.filename=d};c.Call.prototype={eval:function(a){var b=
-this.args.map(function(b){return b.eval(a)});if(this.name in c.functions)try{return c.functions[this.name].apply(c.functions,b)}catch(e){throw{type:e.type||"Runtime",message:"error evaluating function `"+this.name+"`"+(e.message?": "+e.message:""),index:this.index,filename:this.filename};}else return new c.Anonymous(this.name+"("+b.map(function(a){return a.toCSS()}).join(", ")+")")},toCSS:function(a){return this.eval(a).toCSS()}}})(l("../tree"));(function(c){c.Color=function(a,b){this.rgb=Array.isArray(a)?
-a:a.length==6?a.match(/.{2}/g).map(function(a){return parseInt(a,16)}):a.split("").map(function(a){return parseInt(a+a,16)});this.alpha=typeof b==="number"?b:1};c.Color.prototype={eval:function(){return this},toCSS:function(){return this.alpha<1?"rgba("+this.rgb.map(function(a){return Math.round(a)}).concat(this.alpha).join(", ")+")":"#"+this.rgb.map(function(a){a=Math.round(a);a=(a>255?255:a<0?0:a).toString(16);return a.length===1?"0"+a:a}).join("")},operate:function(a,b){var e=[];b instanceof c.Color||
-(b=b.toColor());for(var d=0;d<3;d++)e[d]=c.operate(a,this.rgb[d],b.rgb[d]);return new c.Color(e,this.alpha+b.alpha)},toHSL:function(){var a=this.rgb[0]/255,b=this.rgb[1]/255,c=this.rgb[2]/255,d=this.alpha,i=Math.max(a,b,c),g=Math.min(a,b,c),h,f=(i+g)/2,m=i-g;if(i===g)h=g=0;else{g=f>0.5?m/(2-i-g):m/(i+g);switch(i){case a:h=(b-c)/m+(b<c?6:0);break;case b:h=(c-a)/m+2;break;case c:h=(a-b)/m+4}h/=6}return{h:h*360,s:g,l:f,a:d}},toARGB:function(){return"#"+[Math.round(this.alpha*255)].concat(this.rgb).map(function(a){a=
-Math.round(a);a=(a>255?255:a<0?0:a).toString(16);return a.length===1?"0"+a:a}).join("")}}})(l("../tree"));(function(c){c.Comment=function(a,b){this.value=a;this.silent=!!b};c.Comment.prototype={toCSS:function(a){return a.compress?"":this.value},eval:function(){return this}}})(l("../tree"));(function(c){c.Condition=function(a,b,c,d,i){this.op=a.trim();this.lvalue=b;this.rvalue=c;this.index=d;this.negate=i};c.Condition.prototype.eval=function(a){var b=this.lvalue.eval(a),c=this.rvalue.eval(a),d=this.index,
-i;i=function(a){switch(a){case "and":return b&&c;case "or":return b||c;default:if(b.compare)i=b.compare(c);else if(c.compare)i=c.compare(b);else throw{type:"Type",message:"Unable to perform comparison",index:d};switch(i){case -1:return a==="<"||a==="=<";case 0:return a==="="||a===">="||a==="=<";case 1:return a===">"||a===">="}}}(this.op);return this.negate?!i:i}})(l("../tree"));(function(c){c.Dimension=function(a,b){this.value=parseFloat(a);this.unit=b||null};c.Dimension.prototype={eval:function(){return this},
-toColor:function(){return new c.Color([this.value,this.value,this.value])},toCSS:function(){return this.value+this.unit},operate:function(a,b){return new c.Dimension(c.operate(a,this.value,b.value),this.unit||b.unit)},compare:function(a){return a instanceof c.Dimension?a.value>this.value?-1:a.value<this.value?1:0:-1}}})(l("../tree"));(function(c){c.Directive=function(a,b){this.name=a;Array.isArray(b)?(this.ruleset=new c.Ruleset([],b),this.ruleset.allowImports=!0):this.value=b};c.Directive.prototype=
-{toCSS:function(a,b){return this.ruleset?(this.ruleset.root=!0,this.name+(b.compress?"{":" {\n  ")+this.ruleset.toCSS(a,b).trim().replace(/\n/g,"\n  ")+(b.compress?"}":"\n}\n")):this.name+" "+this.value.toCSS()+";\n"},eval:function(a){a.frames.unshift(this);this.ruleset=this.ruleset&&this.ruleset.eval(a);a.frames.shift();return this},variable:function(a){return c.Ruleset.prototype.variable.call(this.ruleset,a)},find:function(){return c.Ruleset.prototype.find.apply(this.ruleset,arguments)},rulesets:function(){return c.Ruleset.prototype.rulesets.apply(this.ruleset)}}})(l("../tree"));
-(function(c){c.Element=function(a,b,e){this.combinator=a instanceof c.Combinator?a:new c.Combinator(a);this.value=typeof b==="string"?b.trim():b?b:"";this.index=e};c.Element.prototype.eval=function(a){return new c.Element(this.combinator,this.value.eval?this.value.eval(a):this.value,this.index)};c.Element.prototype.toCSS=function(a){return this.combinator.toCSS(a||{})+(this.value.toCSS?this.value.toCSS(a):this.value)};c.Combinator=function(a){this.value=a===" "?" ":a==="& "?"& ":a?a.trim():""};c.Combinator.prototype.toCSS=
-function(a){return{"":""," ":" ","&":"","& ":" ",":":" :","+":a.compress?"+":" + ","~":a.compress?"~":" ~ ",">":a.compress?">":" > "}[this.value]}})(l("../tree"));(function(c){c.Expression=function(a){this.value=a};c.Expression.prototype={eval:function(a){return this.value.length>1?new c.Expression(this.value.map(function(b){return b.eval(a)})):this.value.length===1?this.value[0].eval(a):this},toCSS:function(a){return this.value.map(function(b){return b.toCSS?b.toCSS(a):""}).join(" ")}}})(l("../tree"));
-(function(c){c.Import=function(a,b,e,d){var i=this;this.index=d;this._path=a;this.features=e&&new c.Value(e);this.path=a instanceof c.Quoted?/\.(le?|c)ss(\?.*)?$/.test(a.value)?a.value:a.value+".less":a.value.value||a.value;(this.css=/css(\?.*)?$/.test(this.path))||b.push(this.path,function(a,b){if(a)a.index=d;i.root=b||new c.Ruleset([],[])})};c.Import.prototype={toCSS:function(a){a=this.features?" "+this.features.toCSS(a):"";return this.css?"@import "+this._path.toCSS()+a+";\n":""},eval:function(a){var b;
-this.features&&this.features.eval(a);if(this.css)return this;else{b=new c.Ruleset([],this.root.rules.slice(0));for(var e=0;e<b.rules.length;e++)b.rules[e]instanceof c.Import&&Array.prototype.splice.apply(b.rules,[e,1].concat(b.rules[e].eval(a)));return this.features?new c.Media(b.rules,this.features.value):b.rules}}}})(l("../tree"));(function(c){c.JavaScript=function(a,b,c){this.escaped=c;this.expression=a;this.index=b};c.JavaScript.prototype={eval:function(a){var b,e=this,d={},i=this.expression.replace(/@\{([\w-]+)\}/g,
-function(b,d){return c.jsify((new c.Variable("@"+d,e.index)).eval(a))});try{i=new Function("return ("+i+")")}catch(g){throw{message:"JavaScript evaluation error: `"+i+"`",index:this.index};}for(var h in a.frames[0].variables())d[h.slice(1)]={value:a.frames[0].variables()[h].value,toJS:function(){return this.value.eval(a).toCSS()}};try{b=i.call(d)}catch(f){throw{message:"JavaScript evaluation error: '"+f.name+": "+f.message+"'",index:this.index};}return typeof b==="string"?new c.Quoted('"'+b+'"',b,
-this.escaped,this.index):Array.isArray(b)?new c.Anonymous(b.join(", ")):new c.Anonymous(b)}}})(l("../tree"));(function(c){c.Keyword=function(a){this.value=a};c.Keyword.prototype={eval:function(){return this},toCSS:function(){return this.value},compare:function(a){return a instanceof c.Keyword?a.value===this.value?0:1:-1}};c.True=new c.Keyword("true");c.False=new c.Keyword("false")})(l("../tree"));(function(c){c.Media=function(a,b){var e=new c.Element("&",null,0),e=[new c.Selector([e])];this.features=
-new c.Value(b);this.ruleset=new c.Ruleset(e,a);this.ruleset.allowImports=!0};c.Media.prototype={toCSS:function(a,b){var c=this.features.toCSS(b);this.ruleset.root=a.length===0||a[0].multiMedia;return"@media "+c+(b.compress?"{":" {\n  ")+this.ruleset.toCSS(a,b).trim().replace(/\n/g,"\n  ")+(b.compress?"}":"\n}\n")},eval:function(a){if(!a.mediaBlocks)a.mediaBlocks=[],a.mediaPath=[];var b=a.mediaBlocks.length;a.mediaPath.push(this);a.mediaBlocks.push(this);var e=new c.Media([],[]);e.features=this.features.eval(a);
-a.frames.unshift(this.ruleset);e.ruleset=this.ruleset.eval(a);a.frames.shift();a.mediaBlocks[b]=e;a.mediaPath.pop();return a.mediaPath.length===0?e.evalTop(a):e.evalNested(a)},variable:function(a){return c.Ruleset.prototype.variable.call(this.ruleset,a)},find:function(){return c.Ruleset.prototype.find.apply(this.ruleset,arguments)},rulesets:function(){return c.Ruleset.prototype.rulesets.apply(this.ruleset)},evalTop:function(a){var b=this;if(a.mediaBlocks.length>1)b=new c.Element("&",null,0),b=[new c.Selector([b])],
-b=new c.Ruleset(b,a.mediaBlocks),b.multiMedia=!0;delete a.mediaBlocks;delete a.mediaPath;return b},evalNested:function(a){var b,e=a.mediaPath.concat([this]);for(b=0;b<e.length;b++)a=e[b].features instanceof c.Value?e[b].features.value:e[b].features,e[b]=Array.isArray(a)?a:[a];this.features=new c.Value(this.permute(e).map(function(a){a=a.map(function(a){return a.toCSS?a:new c.Anonymous(a)});for(b=a.length-1;b>0;b--)a.splice(b,0,new c.Anonymous("and"));return new c.Expression(a)}));return new c.Ruleset([],
-[])},permute:function(a){if(a.length===0)return[];else if(a.length===1)return a[0];else{for(var b=[],c=this.permute(a.slice(1)),d=0;d<c.length;d++)for(var i=0;i<a[0].length;i++)b.push([a[0][i]].concat(c[d]));return b}}}})(l("../tree"));(function(c){c.mixin={};c.mixin.Call=function(a,b,e,d,i){this.selector=new c.Selector(a);this.arguments=b;this.index=e;this.filename=d;this.important=i};c.mixin.Call.prototype={eval:function(a){var b,c,d=[],i=!1;for(c=0;c<a.frames.length;c++)if((b=a.frames[c].find(this.selector)).length>
-0){c=this.arguments&&this.arguments.map(function(b){return b.eval(a)});for(var g=0;g<b.length;g++)if(b[g].match(c,a))try{Array.prototype.push.apply(d,b[g].eval(a,this.arguments,this.important).rules),i=!0}catch(h){throw{message:h.message,index:this.index,filename:this.filename,stack:h.stack};}if(i)return d;else throw{type:"Runtime",message:"No matching definition was found for `"+this.selector.toCSS().trim()+"("+this.arguments.map(function(a){return a.toCSS()}).join(", ")+")`",index:this.index,filename:this.filename};
-}throw{type:"Name",message:this.selector.toCSS().trim()+" is undefined",index:this.index,filename:this.filename};}};c.mixin.Definition=function(a,b,e,d,i){this.name=a;this.selectors=[new c.Selector([new c.Element(null,a)])];this.params=b;this.condition=d;this.variadic=i;this.arity=b.length;this.rules=e;this._lookups={};this.required=b.reduce(function(a,b){return!b.name||b.name&&!b.value?a+1:a},0);this.parent=c.Ruleset.prototype;this.frames=[]};c.mixin.Definition.prototype={toCSS:function(){return""},
-variable:function(a){return this.parent.variable.call(this,a)},variables:function(){return this.parent.variables.call(this)},find:function(){return this.parent.find.apply(this,arguments)},rulesets:function(){return this.parent.rulesets.apply(this)},evalParams:function(a,b){for(var e=new c.Ruleset(null,[]),d,i=0,g;i<this.params.length;i++)if(g=this.params[i].name)if(this.params[i].variadic&&b){d=[];for(var h=i;h<b.length;h++)d.push(b[h].eval(a));e.rules.unshift(new c.Rule(g,(new c.Expression(d)).eval(a)))}else if(d=
-b&&b[i]||this.params[i].value)e.rules.unshift(new c.Rule(g,d.eval(a)));else throw{type:"Runtime",message:"wrong number of arguments for "+this.name+" ("+b.length+" for "+this.arity+")"};return e},eval:function(a,b,e){for(var d=this.evalParams(a,b),i=[],g=0;g<Math.max(this.params.length,b&&b.length);g++)i.push(b[g]||this.params[g].value);d.rules.unshift(new c.Rule("@arguments",(new c.Expression(i)).eval(a)));b=e?this.rules.map(function(a){return new c.Rule(a.name,a.value,"!important",a.index)}):this.rules.slice(0);
-return(new c.Ruleset(null,b)).eval({frames:[this,d].concat(this.frames,a.frames)})},match:function(a,b){var c=a&&a.length||0;if(!this.variadic){if(c<this.required)return!1;if(c>this.params.length)return!1;if(this.required>0&&c>this.params.length)return!1}if(this.condition&&!this.condition.eval({frames:[this.evalParams(b,a)].concat(b.frames)}))return!1;for(var c=Math.min(c,this.arity),d=0;d<c;d++)if(!this.params[d].name&&a[d].eval(b).toCSS()!=this.params[d].value.eval(b).toCSS())return!1;return!0}}})(l("../tree"));
-(function(c){c.Operation=function(a,b){this.op=a.trim();this.operands=b};c.Operation.prototype.eval=function(a){var b=this.operands[0].eval(a),a=this.operands[1].eval(a),e;if(b instanceof c.Dimension&&a instanceof c.Color)if(this.op==="*"||this.op==="+")e=a,a=b,b=e;else throw{name:"OperationError",message:"Can't substract or divide a color from a number"};return b.operate(this.op,a)};c.operate=function(a,b,c){switch(a){case "+":return b+c;case "-":return b-c;case "*":return b*c;case "/":return b/
-c}}})(l("../tree"));(function(c){c.Paren=function(a){this.value=a};c.Paren.prototype={toCSS:function(a){return"("+this.value.toCSS(a)+")"},eval:function(a){return new c.Paren(this.value.eval(a))}}})(l("../tree"));(function(c){c.Quoted=function(a,b,c,d){this.escaped=c;this.value=b||"";this.quote=a.charAt(0);this.index=d};c.Quoted.prototype={toCSS:function(){return this.escaped?this.value:this.quote+this.value+this.quote},eval:function(a){var b=this,e=this.value.replace(/`([^`]+)`/g,function(d,e){return(new c.JavaScript(e,
-b.index,!0)).eval(a).value}).replace(/@\{([\w-]+)\}/g,function(d,e){var g=(new c.Variable("@"+e,b.index)).eval(a);return"value"in g?g.value:g.toCSS()});return new c.Quoted(this.quote+e+this.quote,e,this.escaped,this.index)}}})(l("../tree"));(function(c){c.Rule=function(a,b,e,d,i){this.name=a;this.value=b instanceof c.Value?b:new c.Value([b]);this.important=e?" "+e.trim():"";this.index=d;this.inline=i||!1;this.variable=a.charAt(0)==="@"?!0:!1};c.Rule.prototype.toCSS=function(a){return this.variable?
-"":this.name+(a.compress?":":": ")+this.value.toCSS(a)+this.important+(this.inline?"":";")};c.Rule.prototype.eval=function(a){return new c.Rule(this.name,this.value.eval(a),this.important,this.index,this.inline)};c.Shorthand=function(a,b){this.a=a;this.b=b};c.Shorthand.prototype={toCSS:function(a){return this.a.toCSS(a)+"/"+this.b.toCSS(a)},eval:function(){return this}}})(l("../tree"));(function(c){c.Ruleset=function(a,b,c){this.selectors=a;this.rules=b;this._lookups={};this.strictImports=c};c.Ruleset.prototype=
-{eval:function(a){var b=this.selectors&&this.selectors.map(function(b){return b.eval(a)}),b=new c.Ruleset(b,this.rules.slice(0),this.strictImports);b.root=this.root;b.allowImports=this.allowImports;a.frames.unshift(b);if(b.root||b.allowImports||!b.strictImports)for(var e=0;e<b.rules.length;e++)b.rules[e]instanceof c.Import&&Array.prototype.splice.apply(b.rules,[e,1].concat(b.rules[e].eval(a)));for(e=0;e<b.rules.length;e++)if(b.rules[e]instanceof c.mixin.Definition)b.rules[e].frames=a.frames.slice(0);
-for(e=0;e<b.rules.length;e++)b.rules[e]instanceof c.mixin.Call&&Array.prototype.splice.apply(b.rules,[e,1].concat(b.rules[e].eval(a)));for(var e=0,d;e<b.rules.length;e++)d=b.rules[e],d instanceof c.mixin.Definition||(b.rules[e]=d.eval?d.eval(a):d);a.frames.shift();return b},match:function(a){return!a||a.length===0},variables:function(){return this._variables?this._variables:this._variables=this.rules.reduce(function(a,b){b instanceof c.Rule&&b.variable===!0&&(a[b.name]=b);return a},{})},variable:function(a){return this.variables()[a]},
-rulesets:function(){return this._rulesets?this._rulesets:this._rulesets=this.rules.filter(function(a){return a instanceof c.Ruleset||a instanceof c.mixin.Definition})},find:function(a,b){var b=b||this,e=[],d=a.toCSS();if(d in this._lookups)return this._lookups[d];this.rulesets().forEach(function(d){if(d!==b)for(var g=0;g<d.selectors.length;g++)if(a.match(d.selectors[g])){a.elements.length>d.selectors[g].elements.length?Array.prototype.push.apply(e,d.find(new c.Selector(a.elements.slice(1)),b)):e.push(d);
-break}});return this._lookups[d]=e},toCSS:function(a,b){var e=[],d=[],i=[],g=[],h;this.root||(a.length===0?g=this.selectors.map(function(a){return[a]}):this.joinSelectors(g,a,this.selectors));for(var f=0;f<this.rules.length;f++)h=this.rules[f],h.rules||h instanceof c.Directive||h instanceof c.Media?i.push(h.toCSS(g,b)):h instanceof c.Comment?h.silent||(this.root?i.push(h.toCSS(b)):d.push(h.toCSS(b))):h.toCSS&&!h.variable?d.push(h.toCSS(b)):h.value&&!h.variable&&d.push(h.value.toString());i=i.join("");
-this.root?e.push(d.join(b.compress?"":"\n")):d.length>0&&(g=g.map(function(a){return a.map(function(a){return a.toCSS(b)}).join("").trim()}).join(b.compress?",":",\n"),e.push(g,(b.compress?"{":" {\n  ")+d.join(b.compress?"":"\n  ")+(b.compress?"}":"\n}\n")));e.push(i);return e.join("")+(b.compress?"\n":"")},joinSelectors:function(a,b,c){for(var d=0;d<c.length;d++)this.joinSelector(a,b,c[d])},joinSelector:function(a,b,e){for(var d=[],i=[],g=[],h=[],f=!1,l,k=0;k<e.elements.length;k++)l=e.elements[k],
-l.combinator.value.charAt(0)==="&"&&(f=!0),f?h.push(l):g.push(l);f||(h=g,g=[]);g.length>0&&d.push(new c.Selector(g));h.length>0&&i.push(new c.Selector(h));for(e=0;e<b.length;e++)a.push(d.concat(b[e]).concat(i))}}})(l("../tree"));(function(c){c.Selector=function(a){this.elements=a;if(this.elements[0].combinator.value==="")this.elements[0].combinator.value=" "};c.Selector.prototype.match=function(a){var b=this.elements.length,c=a.elements.length,d=Math.min(b,c);if(b<c)return!1;else for(b=0;b<d;b++)if(this.elements[b].value!==
-a.elements[b].value)return!1;return!0};c.Selector.prototype.eval=function(a){return new c.Selector(this.elements.map(function(b){return b.eval(a)}))};c.Selector.prototype.toCSS=function(a){return this._css?this._css:this._css=this.elements.map(function(b){return typeof b==="string"?" "+b.trim():b.toCSS(a)}).join("")}})(l("../tree"));(function(c){c.URL=function(a,b){if(a.data)this.attrs=a;else{if(typeof window!=="undefined"&&!/^(?:https?:\/\/|file:\/\/|data:|\/)/.test(a.value)&&b.length>0)a.value=
-b[0]+(a.value.charAt(0)==="/"?a.value.slice(1):a.value);this.value=a;this.paths=b}};c.URL.prototype={toCSS:function(){return"url("+(this.attrs?"data:"+this.attrs.mime+this.attrs.charset+this.attrs.base64+this.attrs.data:this.value.toCSS())+")"},eval:function(a){return this.attrs?this:new c.URL(this.value.eval(a),this.paths)}}})(l("../tree"));(function(c){c.Value=function(a){this.value=a;this.is="value"};c.Value.prototype={eval:function(a){return this.value.length===1?this.value[0].eval(a):new c.Value(this.value.map(function(b){return b.eval(a)}))},
-toCSS:function(a){return this.value.map(function(b){return b.toCSS(a)}).join(a.compress?",":", ")}}})(l("../tree"));(function(c){c.Variable=function(a,b,c){this.name=a;this.index=b;this.file=c};c.Variable.prototype={eval:function(a){var b,e,d=this.name;d.indexOf("@@")==0&&(d="@"+(new c.Variable(d.slice(1))).eval(a).value);if(b=c.find(a.frames,function(b){if(e=b.variable(d))return e.value.eval(a)}))return b;else throw{type:"Name",message:"variable "+d+" is undefined",filename:this.file,index:this.index};
-}}})(l("../tree"));(function(c){c.find=function(a,b){for(var c=0,d;c<a.length;c++)if(d=b.call(a,a[c]))return d;return null};c.jsify=function(a){return Array.isArray(a.value)&&a.value.length>1?"["+a.value.map(function(a){return a.toCSS(!1)}).join(", ")+"]":a.toCSS(!1)}})(l("./tree"));(function(){var c=l("path"),a=l("util"),b=l("fs"),e={version:[1,3,0],Parser:l("./parser").Parser,importer:l("./parser").importer,tree:l("./tree"),render:function(a,b,c){b=b||{};typeof b==="function"&&(c=b,b={});var d=
-new e.Parser(b),f;if(c)d.parse(a,function(a,d){c(a,d&&d.toCSS&&d.toCSS(b))});else return f=new (l("events").EventEmitter),process.nextTick(function(){d.parse(a,function(a,c){a?f.emit("error",a):f.emit("success",c.toCSS(b))})}),f},writeError:function(b,c){var c=c||{},d="",f=b.extract,l=[],k=c.color?e.stylize:function(a){return a};if(!c.silent){if(b.stack)return a.error(k(b.stack,"red"));if(!b.hasOwnProperty("index"))return a.error(b.stack||b.message);typeof f[0]==="string"&&l.push(k(b.line-1+" "+f[0],
-"grey"));f[1]&&l.push(b.line+" "+f[1].slice(0,b.column)+k(k(k(f[1][b.column],"bold")+f[1].slice(b.column+1),"red"),"inverse"));typeof f[2]==="string"&&l.push(k(b.line+1+" "+f[2],"grey"));l=l.join("\n")+"\u001b[0m\n";d+=k(b.type+"Error: "+b.message,"red");b.filename&&(d+=k(" in ","red")+b.filename+k(":"+b.line+":"+b.column,"grey"));a.error(d,l);b.callLine&&(a.error(k("from ","red")+(b.filename||"")),a.error(k(b.callLine,"grey")+" "+b.callExtract))}}};"color,directive,operation,dimension,keyword,variable,ruleset,element,selector,quoted,expression,rule,call,url,alpha,import,mixin,comment,anonymous,value,javascript,assignment,condition,paren,media".split(",").forEach(function(a){l("./tree/"+
-a)});e.Parser.importer=function(a,d,f,l){var m;d.unshift(".");for(var k=0;k<d.length;k++)try{m=c.join(d[k],a);b.statSync(m);break}catch(j){m=null}m?b.readFile(m,"utf-8",function(a,b){if(a)return f(a);(new e.Parser({paths:[c.dirname(m)].concat(d),filename:m})).parse(b,function(a,c){f(a,c,b)})}):typeof l.errback==="function"?l.errback(a,d,f):f({type:"File",message:"'"+a+"' wasn't found.\n"})};l("./functions");l("./colors");for(var d in e)exports[d]=e[d];e.stylize=function(a,b){var c={bold:[1,22],inverse:[7,
-27],underline:[4,24],yellow:[33,39],green:[32,39],red:[31,39],grey:[90,39]};return"\u001b["+c[b][0]+"m"+a+"\u001b["+c[b][1]+"m"}})();(function(){var c=l("path"),a=l("fs"),b=l("util"),e=l("os"),d=l("../lib/less"),f=process.argv.slice(1),g={compress:!1,yuicompress:!1,optimization:1,silent:!1,paths:[],color:!0,strictImports:!1},f=f.filter(function(a){var f;if(f=a.match(/^-I(.+)$/))return g.paths.push(f[1]),!1;if(f=a.match(/^--?([a-z][0-9a-z-]*)(?:=([^\s]+))?$/i))a=f[1];else return a;switch(a){case "v":case "version":b.puts("lessc "+
-d.version.join(".")+" (LESS Compiler) [JavaScript]"),process.exit(0);case "verbose":g.verbose=!0;break;case "s":case "silent":g.silent=!0;break;case "strict-imports":g.strictImports=!0;break;case "h":case "help":b.puts("usage: lessc source [destination]"),process.exit(0);case "x":case "compress":g.compress=!0;break;case "yui-compress":g.yuicompress=!0;break;case "no-color":g.color=!1;break;case "include-path":g.paths=f[2].split(e.type().match(/Windows/)?";":":").map(function(a){if(a)return c.resolve(process.cwd(),
-a)});break;case "O0":g.optimization=0;break;case "O1":g.optimization=1;break;case "O2":g.optimization=2}}),h=f[1];h&&h!="-"&&(h=c.resolve(process.cwd(),h));var n=f[2];n&&(n=c.resolve(process.cwd(),n));var m,k;h||(b.puts("lessc: no input files"),process.exit(1));var j=function(e,f){e&&(b.puts("lessc: "+e.message),process.exit(1));(new d.Parser({paths:[c.dirname(h)].concat(g.paths),optimization:g.optimization,filename:h,strictImports:g.strictImports})).parse(f,function(c,e){if(c)d.writeError(c,g),process.exit(1);
-else try{m=e.toCSS({compress:g.compress,yuicompress:g.yuicompress}),n?(k=a.openSync(n,"w"),a.writeSync(k,m,0,"utf8")):b.print(m)}catch(f){d.writeError(f,g),process.exit(2)}})};if(h!="-")a.readFile(h,"utf-8",j);else{process.stdin.resume();process.stdin.setEncoding("utf8");var o="";process.stdin.on("data",function(a){o+=a});process.stdin.on("end",function(){j(!1,o)})}})()})(require);


Mime
View raw message