Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

code cleanups, re-pointed to upstream node-XMLHttpRequest, added a ha…

…cked .csslintrc file, removed Aero device, removed ripple/config module
  • Loading branch information...
commit 15815c5ab09f6aa1cc777260fab14b8340f4d255 1 parent cfc7b85
@brentlintner brentlintner authored
View
22 .csslintrc
@@ -0,0 +1,22 @@
+[
+ "unique-headings",
+ "qualified-headings",
+ "ids",
+ "font-sizes",
+ "floats",
+ "overqualified-elements",
+ "zero-units",
+ "universal-selector",
+ "regex-selectors",
+ "import",
+ "font-faces",
+ "vendor-prefix",
+ "text-indent",
+ "gradients",
+ "compatible-vendor-prefixes",
+ "adjoining-classes",
+ "known-properties",
+ "empty-rules",
+ "duplicate-properties",
+ "display-property-grouping"
+]
View
2  .gitmodules
@@ -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
View
2  Jakefile
@@ -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);
View
21 build/btest.js
@@ -14,16 +14,24 @@
* 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(
+ app = connect(
connect.static(__dirname + "/../lib/"),
- connect.static(__dirname + "/../")
+ 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);
+ });
+ })
),
html = fs.readFileSync(__dirname + "/btest/test.html", "utf-8"),
doc, modules, specs;
@@ -45,11 +53,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:");
View
1  build/build/pack.js
@@ -26,7 +26,6 @@ module.exports = function () {
src = {
info: JSON.parse(fs.readFileSync(_c.PACKAGE_JSON, "utf-8")),
js: "",
- injection: "",
overlays: "",
panels: "",
html: "",
View
29 build/lint.js
@@ -13,17 +13,32 @@
* 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", "ext", "lib", "test"];
+ _spawn('csslint', files.concat(options), done);
+}
+
+module.exports = function (done, files) {
+ _lintJS(files && files.length > 0 ? files : ["."], function () {
+ _lintCSS(files && files.length > 0 ? files : ["ext", "lib", "test"], done);
+ });
};
View
2  configure
@@ -1,4 +1,4 @@
npm install -g jake jshint uglify-js
-npm install jsdom sinon jasmine-node jWorkflow connect express argsparser
+npm install jsdom sinon jasmine-node jWorkflow connect argsparser
git submodule init
git submodule update
View
1  ext/assets/index.html
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
+<!DOCTYPE html>
<html>
<head>
<link href="#URL_PREFIX#styles/main.css" type="text/css" rel="stylesheet" />
View
10 ext/assets/styles/extension.css
@@ -41,20 +41,20 @@ textarea:focus, input:focus {
color: #333333;
}
-p:first-letter, th, li:first-letter, label, button, h1, h2, h3{ text-transform: capitalize; }
+p:first-letter, th, li:first-letter, label, button { text-transform: capitalize; }
-h1{ font-size: 2em; font-weight: bold; }
+h1 { font-size: 2em; font-weight: bold; text-transform: capitalize; }
-h2{ font-size: 1em; font-weight: bold;}
+h2 { font-size: 1em; font-weight: bold; text-transform: capitalize; }
-h3{ font-style: italic; font-size: 1.07em; font-weight: normal; }
+h3 { font-style: italic; font-size: 1.07em; font-weight: normal; text-transform: capitalize; }
.irrelevant{ display: none; }
hr { color: #1e1e1e; }
.popup-body {
- width:300px;
+ width: 300px;
padding: 0 .5em;
}
View
155 ext/assets/styles/main.css
@@ -43,14 +43,18 @@ input, textarea, keygen, select, button, isindex, datagrid {
height: 70px;
}
-.beta{
+.beta {
-webkit-transform: rotate(-35deg);
+ -moz-transform: rotate(-35deg);
+ -ms-transform: rotate(-35deg);
+ -o-transform: rotate(-35deg);
+ transform: rotate(-35deg);
position: absolute;
left: 390px;
top: 7px;
}
-.main{
+.main {
font-size: 12px !important;
}
@@ -61,17 +65,17 @@ input, textarea, keygen, select, button, isindex, datagrid {
cursor: pointer;
}
-.main img{ border: 0; margin: 0; padding: 0; }
+.main img { border: 0; margin: 0; padding: 0; }
-.main table, .main tr, .main td, .main th{
+.main table, .main tr, .main td, .main th {
border: 0;
}
.main table{
font-size: 1.00em;
-}
+ }
-.main input[type^=text], .main input[type^=number], .main select, .main textarea{
+.main input[type^=text], .main input[type^=number], .main select, .main textarea {
-webkit-appearance: none;
padding: 0.4em 1em !important;
}
@@ -93,21 +97,21 @@ input:focus, textarea:focus, isindex:focus, keygen:focus, select:focus {
padding: 0.4em 0.5em 0.4em 0;
}
-.main button:hover, .main select, .main input[type^=submit]:hover, .main input[type^=checkbox]:hover{
+.main button:hover, .main select, .main input[type^=submit]:hover, .main input[type^=checkbox]:hover {
cursor: pointer;
}
-.h1, .main h1{ font-size: 1.25em; font-weight: bold; }
+.h1, .main h1 { font-size: 1.25em; font-weight: bold; }
-.h2, .main h2{ font-size: 1.14em; font-weight: bold;}
+.h2, .main h2 { font-size: 1.14em; font-weight: bold; }
-.h3, .main h3{ font-size: 1.07em; font-weight: bold; }
+.h3, .main h3 { font-size: 1.07em; font-weight: bold; }
-.h4, .main h4{ font-size: 1em; font-weight: normal; }
+.h4, .main h4 { font-size: 1em; font-weight: normal; }
-.irrelevant{ display: none; }
+.irrelevant { display: none; }
-section, header, footer, aside, nav{ display: block; }
+section, header, footer, aside, nav { display: block; }
/* ------------------------------>
Top Section */
@@ -276,21 +280,23 @@ section.left { left: 0; }
text-align: left;
}
-.preferences-table td:nth-child(2), .preferences-table th:nth-child(2){
+.preferences-table td:nth-child(2), .preferences-table th:nth-child(2) {
width: 70%;
word-break: break-all;
}
-/* Panel UI */
-.collapse-handle{
+/* ------------------------------>
+ Panel UI */
+
+.collapse-handle {
padding: 5px 9px;
}
-.drag-handle:hover{
+.drag-handle:hover {
opacity: 0.75;
}
-.drag-handle:active{
+.drag-handle:active {
opacity: 1.0;
}
@@ -309,7 +315,9 @@ section.left { left: 0; }
opacity: 0.9;
}
-/* overlay UI */
+/* ------------------------------>
+ overlay UI */
+
.overlay {
z-index: 10000;
width: 100%;
@@ -340,7 +348,7 @@ section.left { left: 0; }
background: rgba(0,0,0,1.0);
}
-.overlay-dialog-message{
+.overlay-dialog-message {
width: 100%;
max-height: 50%;
display: block;
@@ -348,7 +356,7 @@ section.left { left: 0; }
overflow-x: hidden;
}
-.overlay-dialog-buttons{
+.overlay-dialog-buttons {
padding-top: 10px;
width:100%;
text-align: center;
@@ -391,29 +399,29 @@ section.left { left: 0; }
-webkit-border-radius: 1ex;
}
-.overlay-menu-item, .overlay-menu-item-default{
+.overlay-menu-item, .overlay-menu-item-default {
width: 100%;
display:block;
font-size: 1.65em;
}
-.overlay-menu-item:hover, .overlay-menu-item-default:hover{
+.overlay-menu-item:hover, .overlay-menu-item-default:hover {
background-color: #0f55ad;
cursor: pointer;
}
-.overlay-menu-item-default{
+.overlay-menu-item-default {
background-color: #1F1F1F;
}
-.overlay-menu-buttons > table{
+.overlay-menu-buttons > table {
color: #FFF;
}
/* ------------------------------>
Notifications */
-#panel-notification{
+#panel-notification {
position: absolute;
width: 40%;
min-height: 100px;
@@ -427,7 +435,7 @@ section.left { left: 0; }
z-index: 1100;
}
-.panel-notification-closebtn{
+.panel-notification-closebtn {
position: relative;
float: right;
z-index: 999;
@@ -437,16 +445,17 @@ section.left { left: 0; }
border-radius: 6px;
}
-.panel-notification-closebtn:hover{
+.panel-notification-closebtn:hover {
text-decoration: underline;
}
-#panel-notification-text{
+#panel-notification-text {
word-wrap: break-word;
}
/* ------------------------------>
UI.Devices */
+
#layout-portrait, #layout-landscape {
display: inline-block;
width:16px;
@@ -457,6 +466,7 @@ section.left { left: 0; }
#layout-landscape {
-webkit-transform: rotate(-90deg);
+ transform: rotate(-90deg);
}
.layout-selected {
@@ -470,7 +480,7 @@ section.left { left: 0; }
/* ------------------------------>
UI.Geo */
-#geo-map{
+#geo-map {
position: relative;
padding: 10px 0;
width: 316px;
@@ -541,18 +551,18 @@ section.left { left: 0; }
padding: .25em .5em !important;
}
-#widget-config div > h3:hover{
+#widget-config div > h3:hover {
cursor: pointer;
}
#widget-config h3 a{
text-decoration: none !important;
}
-#widget-config h3 a:hover{
+#widget-config h3 a:hover {
text-decoration: none !important;
}
-.configPass, .configFail{
+.configPass, .configFail {
height: auto !important;
}
@@ -601,11 +611,11 @@ section.left { left: 0; }
clear: both;
}
-.information-widgetname{
+.information-widgetname {
font-weight: bold;
}
-.information-widgetversion{
+.information-widgetversion {
}
#emulator-booting {
@@ -658,79 +668,6 @@ section.left { left: 0; }
}
/* ------------------------------>
- UI.Telephony */
-
-.call-number {
- width: 100px;
-}
-
-.call-name {
- width: 130px !important;
-}
-
-/* ------------------------------>
- UI.PhotoGrid */
-
-#photogrid-window {
- font-size: 5em;
- text-align: center;
- color: #1E1E1E;
- vertical-align: middle;
- background-color: #000000;
-}
-
-.photogrid-photo {
- position: relative;
- float: left;
-}
-
-.photogrid-item {
- width: 100px;
-}
-
-#photogallery-window {
- font-size: 5em;
- text-align:center;
- color: #1E1E1E;
- background-color: #000000;
-}
-
-#photogallery-container {
- height: 100%;
- /* flexbox, por favor */
- display: -webkit-box;
- /* this could be vertical, too */
- -webkit-box-orient: horizontal;
- /* these centers do the hard work */
- -webkit-box-pack: center;
- -webkit-box-align: center;
-}
-
-.photogallery-photo {
- vertical-align: middle;
- border: 2px groove #000000;
-}
-
-/* ------------------------------>
- UI.Multimedia Table */
-
-.audio-table td:nth-child(2) {
- word-wrap: break-word;
- max-width: 200px;
-}
-.video-table td:nth-child(2) {
- word-wrap: break-word;
- max-width: 200px;
-}
-
-/* ------------------------------>
- UI.Security Settings */
-
-#security-level-select {
- width: 90%;
-}
-
-/* ------------------------------>
Device Wrapper */
.device-wrapper {
@@ -895,8 +832,6 @@ section.left { left: 0; }
opacity: 0.5;
}
-::-webkit-scrollbar:hover {}
-
::-webkit-resizer {
-webkit-border-radius: 4px;
background-color: #333333;
View
3  ext/chromium/manifest.json
@@ -20,6 +20,5 @@
"permissions": ["tabs", "unlimitedStorage", "notifications", "contextMenus", "http://*/*", "https://*/*"],
"description": "A browser based html5 mobile application development and testing tool",
"file_name": "manifest.json",
- "update_page": "update.html",
- "themes": ["dark","light"]
+ "update_page": "update.html"
}
View
2  ext/chromium/views/update.html
@@ -39,8 +39,6 @@
}
document.write(html);
</script></p>
-
- <p>Join the Ripple <a href="http://ripple.tinyhippos.com/signup" target="_blank">Community</a></p>
</div>
</body>
</html>
View
43 lib/ripple/config.js
@@ -1,43 +0,0 @@
-/*
- * Copyright 2011 Research In Motion Limited.
- *
- * Licensed 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.
- */
-var exception = require('ripple/exception'),
- _environmentConfiguration = {
- "Production": {
- "apiURL": "http://api.tinyhippos.com"
- },
-
- "Demo": {
- "apiURL": "http://apidemo.tinyhippos.com"
- },
-
- "Local": {
- "apiURL": "http://127.0.0.1:4567"
- }
- },
- _environment = "Production";
-
-module.exports = {
- getAPIURL: function () {
- return _environmentConfiguration[_environment].apiURL;
- },
-
- setEnvironment: function (env) {
- if (!_environmentConfiguration[env]) {
- exception.raise(exception.types.Application, "No configuration found for selected environment: " + env);
- }
- _environment = env;
- }
-};
View
2  lib/ripple/constants.js
@@ -14,6 +14,8 @@
* limitations under the License.
*/
module.exports = {
+ "API_URL": "http://api.tinyhippos.com",
+
"SERVICES": {
"GOOGLE_MAPS_URI": "http://maps.google.com/maps/api/staticmap?size=476x476&maptype=roadmap",
"GOOGLE_MAPS_API_KEY": "ABQIAAAA-CaPZHXR-0Tzhui_h6gpjhSE_2rGlnYiB7L-ZGVwgaut5s7OYRSlBAaHCzBuZf2_23_vrCOfPxXHjA"
View
1  lib/ripple/devices.js
@@ -52,7 +52,6 @@ function _currentID() {
_self = module.exports = {
initialize: function () {
_devices = [
- "Aero",
"Bold9700",
"Bold9900",
"FWVGA",
View
51 lib/ripple/devices/Aero.js
@@ -1,51 +0,0 @@
-/*
- * Copyright 2011 Research In Motion Limited.
- *
- * Licensed 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.
- */
-module.exports = {
- "group": "Dell",
-
- "id": "Areo",
- "name": "Dell Aero",
- "osName": "Android",
- "osVersion": "1.5",
- "manufacturer": "Dell",
- "model": "Aero",
- "uuid": "42",
- "firmware": "Android",
-
- "screen": {
- "width": 360,
- "height": 640
- },
- "viewPort": {
- "portrait": {
- "width": 360,
- "height": 640,
- "paddingTop": 0,
- "paddingLeft": 0
- },
- "landscape": {
- "width": 640,
- "height": 360,
- "paddingTop": 0,
- "paddingLeft": 0
- }
- },
-
- "browser": ["Webkit"],
- "ppi": 209.8,
- "platforms": ["web"],
- "userAgent": "Mozilla/5.0 (Linux; U; Android 1.5; en-us; Dell Aero Build/MASTER) AppleWebKit/528.5+ (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1"
-};
View
4 lib/ripple/platform/phonegap/1.0/Contact.js
@@ -54,7 +54,7 @@ module.exports = function (
connected
) {
- return ({
+ return {
id: id || Math.uuid(undefined, 16),
displayName: displayName,
name: name,
@@ -99,5 +99,5 @@ module.exports = function (
copy.id = null;
return copy;
}
- });
+ };
};
View
7 lib/ripple/xhr/cors.js
@@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-var config = require('ripple/config'),
- helpers = require('ripple/xhr/helpers'),
+var helpers = require('ripple/xhr/helpers'),
+ constants = require('ripple/constants'),
_console = require('ripple/console'),
XHR = require('ripple/xhr/base');
@@ -34,8 +34,7 @@ function _XMLHttpRequest() {
xhr.open = function (method, url, async, user, password) {
if (!helpers.isLocalRequest(url)) {
- url = config.getAPIURL() +
- "/xhr_proxy?tinyhippos_apikey=ABC&tinyhippos_rurl=" + escape(url);
+ url = constants.API_URL + "/xhr_proxy?tinyhippos_apikey=ABC&tinyhippos_rurl=" + escape(url);
}
origMethods.open.apply(xhr, Array.prototype.slice.call(arguments));
View
5 lib/ripple/xhr/jsonp.js
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-var config = require('ripple/config'),
+var constants = require('ripple/constants'),
exception = require('ripple/exception'),
utils = require('ripple/utils'),
helpers = require('ripple/xhr/helpers'),
@@ -126,8 +126,7 @@ function _XMLHttpRequest() {
};
_jxhr.onerror = xhr.onerror;
- _jxhr.open(method, config.getAPIURL() +
- "/jsonp_xhr_proxy?callback=?&tinyhippos_apikey=ABC&tinyhippos_rurl=" + escape(url));
+ _jxhr.open(method, constants.API_URL + "/jsonp_xhr_proxy?callback=?&tinyhippos_apikey=ABC&tinyhippos_rurl=" + escape(url));
}
};
View
4 package.json
@@ -2,10 +2,10 @@
"name": "ripple",
"version": "0.6.1",
"description": "A browser based html5 mobile application development and testing tool",
- "homepage": "http://github.com/blackberry/ripple",
+ "homepage": "http://github.com/blackberry/Rippe-UI",
"author": {
"name": "Research In Motion",
- "url": "http://github.com/blackberry/ripple"
+ "url": "http://github.com/blackberry/Ripple-UI"
},
"licenses": [{
"type": "Apache 2.0",
View
0  test/assets/config/config_no_widet_node.xml → test/assets/config/config_no_widget_node.xml
File renamed without changes
View
2  test/unit/phonegap/accelerometer.js
@@ -32,7 +32,7 @@ describe("phonegap_accelerometer", function () {
});
// TODO: why does this fail when not run atomicly
- xit("accelleration info is updated on AccelerometerInfoChangedEvent", function () {
+ xit("acceleration info is updated on AccelerometerInfoChangedEvent", function () {
event.trigger("AccelerometerInfoChangedEvent", [{
x: 9.8,
y: 9.8,
View
2  test/unit/webworks.tablet/systemEvent.js
@@ -163,7 +163,7 @@ describe("webworks.tablet system event", function () {
expect(baton.pass).toHaveBeenCalledWith({code: 1, data: 3}); // state CHARGING
});
- it("passes state CHARGING when charging is false", function () {
+ it("passes state CHARGING when charging is true", function () {
var baton = new MockBaton();
server.deviceBatteryStateChange({}, {}, baton);
event.trigger("DeviceBatteryStateChanged", [true], true);
View
16 test/unit/widgetConfig.js
@@ -87,12 +87,8 @@ describeBrowser("widgetConfig", function () {
});
it("config_file_validation_returns_returns_proper_nodes_as_being_validated", function () {
- var configXML,
- result;
-
- configXML = _getConfig("config.xml");
-
- result = widgetConfig.validate(configXML).widget;
+ var configXML = _getConfig("config.xml"),
+ result = widgetConfig.validate(configXML).widget;
expect(result.validationResult[0].valid).toEqual(true);
expect(result.children["name"].validationResult[0].valid).toEqual(true);
@@ -103,12 +99,8 @@ describeBrowser("widgetConfig", function () {
});
it("config_file_validation_validates_for_required_widget_and_icon_nodes", function () {
- var configXML,
- result;
-
- configXML = _getConfig("config_no_widet_node.xml");
-
- result = widgetConfig.validate(configXML).widget;
+ var configXML = _getConfig("config_no_widget_node.xml"),
+ result = widgetConfig.validate(configXML).widget;
expect(result).toBeTruthy();
expect(result.validationResult[0].message).toEqual("widget node expected, but not found");
2  thirdparty/node-XMLHttpRequest
@@ -1 +1 @@
-Subproject commit fdcdd8a9e82a85611aa56d83b871076134a242e4
+Subproject commit 13d0ef11c228692e8349d1f545ba0010cff04908
Please sign in to comment.
Something went wrong with that request. Please try again.