Skip to content
This repository has been archived by the owner on Sep 4, 2019. It is now read-only.

Commit

Permalink
Merge pull request #206 from blackberry-webworks/master
Browse files Browse the repository at this point in the history
Ripple UI 0.9.0 Release
  • Loading branch information
ndaversa committed Oct 18, 2011
2 parents a01eea4 + f98654f commit bfe846b
Show file tree
Hide file tree
Showing 305 changed files with 6,606 additions and 14,547 deletions.
17 changes: 17 additions & 0 deletions .csslintrc
@@ -0,0 +1,17 @@
[
"floats",
"overqualified-elements",
"zero-units",
"universal-selector",
"import",
"font-faces",
"vendor-prefix",
"text-indent",
"gradients",
"compatible-vendor-prefixes",
"adjoining-classes",
"known-properties",
"empty-rules",
"duplicate-properties",
"display-property-grouping"
]
2 changes: 1 addition & 1 deletion .gitmodules
Expand Up @@ -3,7 +3,7 @@
url = http://github.com/pivotal/jasmine.git
[submodule "thirdparty/node-XMLHttpRequest"]
path = thirdparty/node-XMLHttpRequest
url = http://github.com/tinyhippos/node-XMLHttpRequest.git
url = http://github.com/driverdan/node-XMLHttpRequest.git
[submodule "thirdparty/browser-require"]
path = thirdparty/browser-require
url = https://github.com/rsms/browser-require.git
Expand Down
4 changes: 4 additions & 0 deletions .jshintrc
@@ -1,6 +1,10 @@
{
"predef": [
"stagewebview",
"FileReader", "FileWriter",
"WebKitBlobBuilder", "BlobBuilder",
"webkitNotifications",
"FileError",
"DOMDocument",
"$", "it", "describe",
"xit", "xdescribe",
Expand Down
2 changes: 1 addition & 1 deletion Jakefile
Expand Up @@ -30,7 +30,7 @@ task('test', [], function () {
desc("boot test server for running all tests in the browser");
task('btest', [], require('./build/btest'));

desc("runs jshint - jake lint [path1,path2]");
desc("runs jshint + csslint - jake lint [path1] [path2]");
task('lint', [], function () {
require('./build/lint')(complete, Array.prototype.slice.call(arguments));
}, true);
Expand Down
16 changes: 0 additions & 16 deletions LICENSE
Expand Up @@ -266,13 +266,6 @@ licensed under the MIT (MIT-LICENSE.txt)

http://docs.jquery.com/UI

-------------------------------------------------------
* jQuery.Dimensions *

Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.

-------------------------------------------------------
* jQuery Tooltip plugin *

Expand All @@ -285,15 +278,6 @@ Dual licensed under the MIT and GPL licenses:
http://www.opensource.org/licenses/mit-license.php
http://www.gnu.org/licenses/gpl.html

-------------------------------------------------------
* Sinon *

https://github.com/cjohansen/Sinon.JS

Copyright (c) 2010-2011, Christian Johansen, christian@cjohansen.no

licensed under the BSD License

-------------------------------------------------------
* Math.uuid.js (v1.4) *

Expand Down
29 changes: 17 additions & 12 deletions build/btest.js
Expand Up @@ -14,19 +14,29 @@
* limitations under the License.
*/
module.exports = function () {
var express = require('express'),
connect = require('connect'),
var connect = require('connect'),
fs = require('fs'),
sys = require('sys'),
utils = require('./build/utils'),
libs = [],
tests = [],
app = express.createServer(
connect.static(__dirname + "/../lib/"),
connect.static(__dirname + "/../")
),
html = fs.readFileSync(__dirname + "/btest/test.html", "utf-8"),
doc, modules, specs;
doc,
modules,
specs,
app = connect(
connect.static(__dirname + "/../lib/"),
connect.static(__dirname + "/../"),
connect.router(function (app) {
app.get('/', function (req, res) {
res.writeHead(200, {
"Cache-Control": "no-cache",
"Content-Type": "text/html"
});
res.end(doc);
});
})
);

utils.collect(__dirname + "/../lib", libs);
utils.collect(__dirname + "/../test", tests);
Expand All @@ -45,11 +55,6 @@ module.exports = function () {

doc = html.replace(/<!-- SPECS -->/g, specs).replace(/"##FILES##"/g, modules);

app.get('/', function (req, res) {
res.header("Cache-Control", "no-cache");
res.send(doc);
});

app.listen(3000);

sys.puts("Test Server running on:");
Expand Down
17 changes: 3 additions & 14 deletions build/btest/test.html
Expand Up @@ -25,9 +25,9 @@
</script>

<!-- jasmine -->
<link rel="stylesheet" type="text/css" href="thirdparty/jasmine/lib/jasmine.css">
<script type="text/javascript" src="thirdparty/jasmine/lib/jasmine.js"></script>
<script type="text/javascript" src="thirdparty/jasmine/lib/jasmine-html.js"></script>
<link rel="stylesheet" type="text/css" href="thirdparty/jasmine/lib/jasmine-core/jasmine.css">
<script type="text/javascript" src="thirdparty/jasmine/lib/jasmine-core/jasmine.js"></script>
<script type="text/javascript" src="thirdparty/jasmine/lib/jasmine-core/jasmine-html.js"></script>
<script type="text/javascript" charset="utf-8">
// also mocked out in node runner
global.describeBrowser = function () {
Expand Down Expand Up @@ -72,9 +72,6 @@
};
</script>

<!-- sinonjs -->
<script src="thirdparty/sinon.js" type="text/javascript" charset="utf-8"></script>

<!-- jWorkflow -->
<script src="thirdparty/jWorkflow/jworkflow-min-0.4.0.js" type="text/javascript" charset="utf-8"></script>

Expand All @@ -83,21 +80,13 @@
<script src="thirdparty/Math.uuid.js" type="text/javascript" charset="utf-8"></script>
<script src="thirdparty/jquery.js" type="text/javascript" charset="utf-8"></script>
<script src="thirdparty/jquery.ui.js" type="text/javascript" charset="utf-8"></script>
<script src="thirdparty/jquery.dimensions.js" type="text/javascript" charset="utf-8"></script>
<script src="thirdparty/jquery.tooltip.js" type="text/javascript" charset="utf-8"></script>

<!-- define Math.uuid as a ghost -->
<script type="text/javascript" charset="utf-8">
require.define('thirdparty/Math.uuid', function (require, module, exports) {});
</script>

<!-- define sinon as module -->
<script type="text/javascript" charset="utf-8">
require.define('sinon', function (require, module, exports) {
module.exports = window.sinon;
});
</script>

<!-- define jWorkflow as module -->
<script type="text/javascript" charset="utf-8">
require.define('jWorkflow', function (require, module, exports) {
Expand Down
12 changes: 7 additions & 5 deletions build/build/chromium.js
Expand Up @@ -26,16 +26,18 @@ module.exports = function (src, baton) {
'cp -r ' + _c.ASSETS + "styles " + _c.DEPLOY + "chromium/";

childProcess.exec(copy, function () {
var css = _c.DEPLOY + "chromium/styles/main.css",
var css = _c.ASSETS + "ripple.css",
cssDeploy = _c.DEPLOY + "chromium/ripple.css",
manifest = _c.DEPLOY + "chromium/manifest.json",
injection = _c.DEPLOY + "chromium/ripple.js",
bootstrap = _c.DEPLOY + "chromium/injection_src/bootstrap.js",
js = _c.DEPLOY + "chromium/ripple.js",
bootstrap = _c.DEPLOY + "chromium/bootstrap.js",
doc = src.html.replace(/#OVERLAY_VIEWS#/g, src.overlays)
.replace(/#PANEL_VIEWS#/g, src.panels)
.replace(/#DIALOG_VIEWS#/g, src.dialogs)
.replace(_c.SPACES_AND_TABS, " ")
.replace(/'/g, _c.ESCAPED_QUOTES);

fs.writeFileSync(css, fs.readFileSync(css, "utf-8") + src.skins);
fs.writeFileSync(cssDeploy, fs.readFileSync(css, "utf-8") + src.skins);

fs.writeFileSync(manifest, fs.readFileSync(manifest, "utf-8")
.replace(new RegExp('"version": ""', 'g'), '"version": "' + src.info.version + '"'));
Expand All @@ -44,7 +46,7 @@ module.exports = function (src, baton) {
"window.th_panel = {" + "LAYOUT_HTML: '" + doc + "'};" +
fs.readFileSync(bootstrap, "utf-8"));

fs.writeFileSync(injection,
fs.writeFileSync(js,
src.js +
"(function () {" +
"var evt = document.createEvent('Events');" +
Expand Down
2 changes: 1 addition & 1 deletion build/build/conf.js
Expand Up @@ -21,6 +21,7 @@ module.exports = {
BUILD: __dirname + "/../",
EXT: __dirname + "/../../ext/",
ASSETS: __dirname + "/../../ext/assets/",
CACHE_MANIFEST: __dirname + "/../../ext/cache.manifest",
LIB: __dirname + "/../../lib/",
UI: __dirname + "/../../lib/ripple/ui/",
DEVICES: __dirname + "/../../lib/ripple/devices/",
Expand All @@ -32,7 +33,6 @@ module.exports = {
"browser-require/require.js",
"jquery.js",
"jquery.ui.js",
"jquery.dimensions.js",
"jquery.tooltip.js",
"Math.uuid.js",
"jXHR.js",
Expand Down
5 changes: 4 additions & 1 deletion build/build/pack.js
Expand Up @@ -22,13 +22,14 @@ module.exports = function () {
devicesCSS = [],
overlays = [],
panels = [],
dialogs = [],
thirdparty = [],
src = {
info: JSON.parse(fs.readFileSync(_c.PACKAGE_JSON, "utf-8")),
js: "",
injection: "",
overlays: "",
panels: "",
dialogs: "",
html: "",
skins: ""
};
Expand All @@ -54,6 +55,7 @@ module.exports = function () {
utils.collect(_c.DEVICES, devicesCSS, matches(".css"));
utils.collect(_c.UI, overlays, matches("overlay.html"));
utils.collect(_c.UI, panels, matches("panel.html"));
utils.collect(_c.UI, dialogs, matches("dialog.html"));

utils.collect(_c.THIRDPARTY, thirdparty, function (path) {
return _c.thirdpartyIncludes.some(function (file) {
Expand All @@ -65,6 +67,7 @@ module.exports = function () {

src.skins += compile(devicesCSS);
src.panels += compile(panels);
src.dialogs += compile(dialogs);
src.overlays += compile(overlays);

src.js += _c.thirdpartyIncludes.reduce(function (buffer, file) {
Expand Down
53 changes: 45 additions & 8 deletions build/build/web.js
Expand Up @@ -15,25 +15,62 @@
*/
var childProcess = require('child_process'),
fs = require('fs'),
path = require('path'),
utils = require('./utils'),
_c = require('./conf');

function copy(from, callback) {
var cmd = 'cp -r ' + from + ' ' + _c.DEPLOY + "web";
childProcess.exec(cmd, callback);
}

function _cache() {
var files = [],
cache = "";

utils.collect(_c.DEPLOY, files, function (path) {
if (path.indexOf("/web/") > 0 && path.indexOf("/.") === -1) {
return true;
}
return false;
});

files.forEach(function (file) {
var prefix = path.normalize(_c.DEPLOY) + "web/",
parts = file.split(prefix);
if (parts && parts.length > 1) {
cache += parts[1] + "\n";
}
});

cache += "# Manifest build date: " + new Date();
return cache;
}

module.exports = function (src, baton) {
baton.take();

var copy = 'cp -r ' + _c.ASSETS + ' ' + _c.DEPLOY + "web";

childProcess.exec(copy, function () {
var css = _c.DEPLOY + "web/styles/main.css",
copy(_c.ASSETS, function () {
var css = _c.ASSETS + "ripple.css",
cssDeploy = _c.DEPLOY + "web/ripple.css",
cacheDeploy = _c.DEPLOY + "web/cache.manifest",
index = _c.DEPLOY + "web/index.html",
injection = _c.DEPLOY + "web/ripple.js",
js = _c.DEPLOY + "web/ripple.js",
doc = src.html.replace(/#URL_PREFIX#/g, "")
.replace(/#OVERLAY_VIEWS#/g, src.overlays)
.replace(/#DIALOG_VIEWS#/g, src.dialogs)
.replace(/#PANEL_VIEWS#/g, src.panels);

fs.writeFileSync(css, fs.readFileSync(css, "utf-8") + src.skins);
fs.writeFileSync(cssDeploy, fs.readFileSync(css, "utf-8") + src.skins);
fs.writeFileSync(index, doc);
fs.writeFileSync(injection, src.js + "require('ripple/bootstrap').bootstrap();");
fs.writeFileSync(js, src.js +
"require('ripple/ui').register('omnibar');" +
"require('ripple/bootstrap').bootstrap();");

fs.writeFileSync(cacheDeploy, fs.readFileSync(_c.CACHE_MANIFEST, "utf-8") + _cache());

baton.pass(src);
copy(_c.PACKAGE_JSON, function () {
baton.pass(src);
});
});
};
30 changes: 23 additions & 7 deletions build/lint.js
Expand Up @@ -13,17 +13,33 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module.exports = function (done, files) {
var args = files && files.length > 0 ? files : ["."],
options = ["--reporter", "build/lint/reporter.js", "--show-non-errors"],
spawn = require('child_process').spawn,
cmd = spawn('jshint', args.concat(options)),
sys = require('sys');
var childProcess = require('child_process'),
sys = require('sys'),
fs = require('fs');

function _spawn(proc, args, done) {
var cmd = childProcess.spawn(proc, args);
cmd.stdout.on('data', sys.print);
cmd.stderr.on('data', sys.print);

if (done) {
cmd.on('exit', done);
}
}

function _lintJS(files, done) {
var options = ["--reporter", "build/lint/reporter.js", "--show-non-errors"];
_spawn('jshint', files.concat(options), done);
}

function _lintCSS(files, done) {
var rules = JSON.parse(fs.readFileSync(__dirname + "/../.csslintrc", "utf-8")),
options = ["--rules=" + rules, "--format=compact"];
_spawn('csslint', files.concat(options), done);
}

module.exports = function (done, files) {
var cssDirs = ["ext/assets/ripple.css", "ext/chromium/styles", "lib", "test"];
_lintJS(files && files.length > 0 ? files : ["."], function () {
_lintCSS(files && files.length > 0 ? files : cssDirs, done);
});
};
8 changes: 2 additions & 6 deletions build/scripts/build.sh
Expand Up @@ -23,15 +23,11 @@ rm -fr $BUILD_OUTPUT
mkdir $BUILD_OUTPUT

#call jake
jake > $BUILD_OUTPUT/jake.txt
jake deploy > $BUILD_OUTPUT/jake.txt
export BUILD_STATUS=$?

#if jake was good then run jake tests
#if build was good then package zip
if [ $BUILD_STATUS = 0 ]; then
jake test > $BUILD_OUTPUT/jaketest.txt
TEST_STATUS=$?

zip -9 -r $BUILD_OUTPUT/ripple_ui.zip $RIPPLE_BUILD
exit $TEST_STATUS
fi
exit $BUILD_STATUS

0 comments on commit bfe846b

Please sign in to comment.