Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Replaced rim logo with public domain image, updated webworks.js files…

… to match the packager being released, added node server folder and organized fileDemo directory
  • Loading branch information...
commit 73a2abc56a477e2b8c36836ab9ddc37511ccd862 1 parent a50b87c
@haahmad haahmad authored
View
61 README.md.orig
@@ -1,61 +0,0 @@
-<<<<<<< HEAD
-BB10-WebWorks-Samples
-=====================
-
-WebWorks Samples for the BlackBerry 10 Platform
-=======
-
-#BB10 WebWorks Samples Repository
-
-The _**BB10-WebWorks-Samples**_ repository is an area where members of the community can post up their WebWorks sample applications to share with the rest of the world.
-
-All APIs shared in this repository are Open Source under the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0.html)
-
-**To contribute code to this repository you must be [signed up as an official contributor](https://github.com/blackberry/WebWorks/wiki/How-to-Contribute).**
-
-
-## Code Organization
-
-Each Sample added to the repository should be placed in its own directory. Make sure you name the directory something simple, yet descriptive. Each Sample must also have a README.md file at the root of its directory.
-This README needs to indicate the Author of the API, devices and OS versions it was tested on, and information about the application and how to use it.
-
-
-## Contributing Samples
-
-To add new Samples or make modifications to existing Samples:
-
-1. Fork the **BB10-WebWorks-Samples** repository
-2. Make the changes/additions to your fork
-3. Send a pull request from your fork back to the **BB10-WebWorks-Samples** repository
-4. If you made changes to code which you are NOT the owner, send a message via github messages to the Author(s) of the Sample to indicate that you have a pull request for them to review
-5. If you made changes to code which you own, send a message via github messages to one of the Committers listed below to have your code merged
-
-Contributors:
-
-[Hasan Ahmad](https://github.com/haahmad)
-[Matthew D'Andrea](https://github.com/mdandrea)
-[Marco Di Cesare](https://github.com/mdicesare)
-
-## Governence
-
-The code for each of the WebWorks Samples is managed by the author of the Sample. When a pull request comes in for a specific Sample the Author(s) should be notified by the pull request owner to perform a code review. When the author
-indicates that the pull request is ready to be merged (via a comment on the pull request) they can then send a message to a committer through github messages to have the changes merged.
-
-If there are more than one Author for a specific Sample, only one Author is required to indicate that the pull request is ready. If there's more than one Sample affected by a pull request, at least one Author from each Sample must code review
-the pull request and indicate that it is ready to be merged before the pull request can be merged.
-
-If the Author of the pull request is the actual owner of the Sample, then the Author should send a message to a committer via github messages to have their changes merged.
-
-**Ownership Transfer:**
-An Author can transfer ownership to another Author by opening up an [Issue](https://github.com/blackberry/BB10-WebWorks-Samples/issues) where both the original Author requests ownership to be transfered to the new Author, and the new Author agrees to take ownership of the code.
-The README for the Sample should be updated to indicate the new Author.
-
-## Bug Reporting and Feature Requests
-
-If you find a bug in a Sample, or have an enhancement request, simply file an [Issue](https://github.com/blackberry/BB10-WebWorks-Samples/issues) for the Sample and send a message (via github messages) to the Sample Author(s) to let them know that you have filed an [Issue](https://github.com/blackberry/BB10-WebWorks-Samples/issues).
-
-## Disclaimer
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
->>>>>>> origin/bb10-next
View
1  fileTransfer/config.xml → fileTransfer/app/config.xml
@@ -41,7 +41,6 @@ limitations under the License.
<access uri="http://w3.org/" subdomains="true" />
<access uri="http://10.137.251.215/" subdomains="true" />
- <access uri="http://bojap.com/" subdomains="true" />
<access uri="http://rim.com/" subdomains="true" />
<rim:permissions>
View
2  fileTransfer/fileDownload.html → fileTransfer/app/fileDownload.html
@@ -17,7 +17,7 @@
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
- <script src="webworks-1.0.0.7.js"></script>
+ <script src="webworks-1.0.1.5.js"></script>
<link rel="stylesheet" href="jquery/jquery.mobile-1.1.0.min.css" />
<script src="jquery/jquery-1.7.1.min.js"></script>
<script src="jquery/jquery.mobile-1.1.0.min.js"></script>
View
2  fileTransfer/fileUpload.html → fileTransfer/app/fileUpload.html
@@ -17,7 +17,7 @@
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
- <script src="webworks-1.0.0.7.js"></script>
+ <script src="webworks-1.0.1.5.js"></script>
<link rel="stylesheet" href="jquery/jquery.mobile-1.1.0.min.css" />
<script src="jquery/jquery-1.7.1.min.js"></script>
<script src="jquery/jquery.mobile-1.1.0.min.js"></script>
View
BIN  fileTransfer/filetransfer.zip → fileTransfer/app/filetransfer.zip
Binary file not shown
View
0  fileTransfer/index.html → fileTransfer/app/index.html
File renamed without changes
View
0  fileTransfer/jquery/jquery-1.7.1.min.js → fileTransfer/app/jquery/jquery-1.7.1.min.js
File renamed without changes
View
0  ...ansfer/jquery/jquery.mobile-1.1.0.min.css → ...er/app/jquery/jquery.mobile-1.1.0.min.css
File renamed without changes
View
0  ...ransfer/jquery/jquery.mobile-1.1.0.min.js → ...fer/app/jquery/jquery.mobile-1.1.0.min.js
File renamed without changes
View
370 invoke/invoker/webworks-1.0.0.7.js → fileTransfer/app/webworks-1.0.1.5.js
@@ -500,124 +500,124 @@ module.exports = _self;
});
define('window', function (require, exports, module) {
-/*
- * Copyright 2010-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.
- */
-
-// HACK have to live with differentiating node from browser for now
-module.exports = {
- "window": function () {
- return !!require.resolve ? null : window;
- }
+/*
+ * Copyright 2010-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.
+ */
+
+// HACK have to live with differentiating node from browser for now
+module.exports = {
+ "window": function () {
+ return !!require.resolve ? null : window;
+ }
};
});
define('event', function (require, exports, module) {
-/*
-* Copyright 2010-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 _handlers = {};
-
-function _add(featureId, name, cb, success, fail, once) {
- var handler;
- if (featureId && name && typeof cb === "function") {
- handler = {
- func: cb,
- once: !!once
- };
- //If this is the first time we are adding a cb
- if (!_handlers.hasOwnProperty(name)) {
- _handlers[name] = [handler];
- //Do not call exec for once because its not necessary
- if (!once) {
- window.webworks.exec(success, fail, featureId, "add", {"eventName": name});
- }
- } else if (_handlers[name].some(function (element, index, array) {
- return element.func !== cb;
- })) {
- //Only add unique callbacks
- _handlers[name].push(handler);
- }
- }
-}
-
-module.exports = {
- add: function (featureId, name, cb, success, fail) {
- _add(featureId, name, cb, success, fail, false);
- },
-
- once: function (featureId, name, cb, success, fail) {
- _add(featureId, name, cb, success, fail, true);
- },
-
- isOn: function (name) {
- return !!_handlers[name];
- },
-
- remove: function (featureId, name, cb, success, fail) {
- if (featureId && name && typeof cb === "function") {
- if (_handlers.hasOwnProperty(name)) {
- _handlers[name] = _handlers[name].filter(function (element, index, array) {
- return element.func !== cb || element.once;
- });
-
- if (_handlers[name].length === 0) {
- delete _handlers[name];
- window.webworks.exec(success, fail, featureId, "remove", {"eventName": name});
- }
- }
- }
- },
-
- trigger: function (name, args) {
- var parsedArgs;
- if (_handlers.hasOwnProperty(name)) {
- if (args && args !== "undefined") {
- parsedArgs = JSON.parse(args);
- }
- //Call the handlers
- _handlers[name].forEach(function (handler) {
- if (handler) {
- handler.func(parsedArgs);
- }
- });
- //Remove the once listeners
- _handlers[name] = _handlers[name].filter(function (handler) {
- return !handler.once;
- });
- //Clean up the array if it is empty
- if (_handlers[name].length === 0) {
- delete _handlers[name];
- //No need to call remove since this would only be for callbacks
- }
- }
- }
-};
+/*
+* Copyright 2010-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 _handlers = {};
+
+function _add(featureId, name, cb, success, fail, once) {
+ var handler;
+ if (featureId && name && typeof cb === "function") {
+ handler = {
+ func: cb,
+ once: !!once
+ };
+ //If this is the first time we are adding a cb
+ if (!_handlers.hasOwnProperty(name)) {
+ _handlers[name] = [handler];
+ //Do not call exec for once because its not necessary
+ if (!once) {
+ window.webworks.exec(success, fail, featureId, "add", {"eventName": name});
+ }
+ } else if (_handlers[name].some(function (element, index, array) {
+ return element.func !== cb;
+ })) {
+ //Only add unique callbacks
+ _handlers[name].push(handler);
+ }
+ }
+}
+
+module.exports = {
+ add: function (featureId, name, cb, success, fail) {
+ _add(featureId, name, cb, success, fail, false);
+ },
+
+ once: function (featureId, name, cb, success, fail) {
+ _add(featureId, name, cb, success, fail, true);
+ },
+
+ isOn: function (name) {
+ return !!_handlers[name];
+ },
+
+ remove: function (featureId, name, cb, success, fail) {
+ if (featureId && name && typeof cb === "function") {
+ if (_handlers.hasOwnProperty(name)) {
+ _handlers[name] = _handlers[name].filter(function (element, index, array) {
+ return element.func !== cb || element.once;
+ });
+
+ if (_handlers[name].length === 0) {
+ delete _handlers[name];
+ window.webworks.exec(success, fail, featureId, "remove", {"eventName": name});
+ }
+ }
+ }
+ },
+
+ trigger: function (name, args) {
+ var parsedArgs;
+ if (_handlers.hasOwnProperty(name)) {
+ if (args && args !== "undefined") {
+ parsedArgs = JSON.parse(args);
+ }
+ //Call the handlers
+ _handlers[name].forEach(function (handler) {
+ if (handler) {
+ handler.func(parsedArgs);
+ }
+ });
+ //Remove the once listeners
+ _handlers[name] = _handlers[name].filter(function (handler) {
+ return !handler.once;
+ });
+ //Clean up the array if it is empty
+ if (_handlers[name].length === 0) {
+ delete _handlers[name];
+ //No need to call remove since this would only be for callbacks
+ }
+ }
+ }
+};
});
@@ -1080,81 +1080,81 @@ self = module.exports = {
});
define('lib/exception', function (require, exports, module) {
-/*
- * Copyright 2012 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 = {
-
- types: {
- Application: "Application",
- ArgumentLength: "ArgumentLength",
- ArgumentType: "ArgumentType",
- Argument: "Argument",
- NotificationType: "NotificationType",
- NotificationStateType: "NotificationStateType",
- DomObjectNotFound: "DomObjectNotFound",
- MethodNotImplemented: "MethodNotImplemented",
- InvalidState: "InvalidState",
- ApplicationState: "ApplicationState"
- },
-
- handle: function handle(exception, reThrow) {
- reThrow = reThrow || false;
-
- var eMsg = exception.message || "exception caught!",
- msg = eMsg + "\n\n" + (exception.stack || "*no stack provided*") + "\n\n";
-
- console.error(msg);
-
- if (reThrow) {
- throw exception;
- }
- },
-
- raise: function raise(exceptionType, message, customExceptionObject) {
- var obj = customExceptionObject || {
- type: "",
- message: "",
-
- toString: function () {
- var result = this.name + ': "' + this.message + '"';
-
- if (this.stack) {
- result += "\n" + this.stack;
- }
- return result;
- }
- };
-
- message = message || "";
-
- obj.name = exceptionType;
- obj.type = exceptionType;
- // TODO: include the exception objects original message if exists
- obj.message = message;
-
- throw obj;
- }
-};
+/*
+ * Copyright 2012 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 = {
+
+ types: {
+ Application: "Application",
+ ArgumentLength: "ArgumentLength",
+ ArgumentType: "ArgumentType",
+ Argument: "Argument",
+ NotificationType: "NotificationType",
+ NotificationStateType: "NotificationStateType",
+ DomObjectNotFound: "DomObjectNotFound",
+ MethodNotImplemented: "MethodNotImplemented",
+ InvalidState: "InvalidState",
+ ApplicationState: "ApplicationState"
+ },
+
+ handle: function handle(exception, reThrow) {
+ reThrow = reThrow || false;
+
+ var eMsg = exception.message || "exception caught!",
+ msg = eMsg + "\n\n" + (exception.stack || "*no stack provided*") + "\n\n";
+
+ console.error(msg);
+
+ if (reThrow) {
+ throw exception;
+ }
+ },
+
+ raise: function raise(exceptionType, message, customExceptionObject) {
+ var obj = customExceptionObject || {
+ type: "",
+ message: "",
+
+ toString: function () {
+ var result = this.name + ': "' + this.message + '"';
+
+ if (this.stack) {
+ result += "\n" + this.stack;
+ }
+ return result;
+ }
+ };
+
+ message = message || "";
+
+ obj.name = exceptionType;
+ obj.type = exceptionType;
+ // TODO: include the exception objects original message if exists
+ obj.message = message;
+
+ throw obj;
+ }
+};
});
define('lib/webworks-info', function (require, exports, module) {
module.exports = {
- hash: "0f40cbc4da91e910601fc2ad0128c86c",
- version: "1.0.0.7"
+ hash: "65955a4a246382930a30c0e570183a73",
+ version: "1.0.1.5"
};
});
/*
View
2  fileTransfer/xhr2.html → fileTransfer/app/xhr2.html
@@ -17,7 +17,7 @@
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
- <script src="webworks-1.0.0.7.js"></script>
+ <script src="webworks-1.0.1.5.js"></script>
<link rel="stylesheet" href="jquery/jquery.mobile-1.1.0.min.css" />
<script src="jquery/jquery-1.7.1.min.js"></script>
<script src="jquery/jquery.mobile-1.1.0.min.js"></script>
View
47 fileTransfer/node-upload/app.js
@@ -0,0 +1,47 @@
+/*
+* Copyright 2012 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 format = require('util').format,
+ express = require('express'),
+ fs = require("fs"),
+ path = require("path"),
+ app = express.createServer();
+
+
+app.use(express.bodyParser());
+
+app.get('/', function(req, res) {
+ res.send('Hello World');
+});
+
+app.post('/upload', function(req, res) {
+ console.log(req.files);
+
+ if (path.existsSync(req.files.file.path)){
+ res.send(format('uploaded %s (%d Kb) to %s as %s'
+ , req.files.file.name
+ , req.files.file.size / 1024 | 0
+ , req.files.file.path
+ , req.body.title));
+ fs.rename(req.files.file.path, __dirname + "/uploads/" + req.files.file.name);
+ } else {
+ res.send('File not found :(', 404);
+ }
+
+
+});
+
+app.listen(8080);
View
2  invoke/README.md
@@ -13,7 +13,7 @@ Sample applications that demonstrate how to use the blackberry.invoke API for th
**Dependencies**
1. [jquery.mobile-1.1.0.min.js, jquery.mobile-1.1.0.min.css, jquery-1.7.1.min.js ](http://www.jquerymobile.com/) The jQuery Mobile Framework
-
+2. [/invoke/invoker/cliffs.jpg](http://www.public-domain-image.com/nature-landscapes-public-domain-images-pictures/cliffs-public-domain-images-pictures/cliffs-ocean-slieve-league.jpg.html) from public-domain-image.com
**To contribute code to this repository you must be [signed up as an official contributor](http://blackberry.github.com/howToContribute.html).**
View
2  invoke/invokable/index.html
@@ -18,7 +18,7 @@
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
- <script src="webworks-1.0.0.7.js"></script>
+ <script src="webworks-1.0.1.5.js"></script>
<script type="text/javascript">
function ready() {
View
BIN  invoke/invokable/invokable.zip
Binary file not shown
View
370 fileTransfer/webworks-1.0.0.7.js → invoke/invokable/webworks-1.0.1.5.js 100644 → 100755
@@ -500,124 +500,124 @@ module.exports = _self;
});
define('window', function (require, exports, module) {
-/*
- * Copyright 2010-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.
- */
-
-// HACK have to live with differentiating node from browser for now
-module.exports = {
- "window": function () {
- return !!require.resolve ? null : window;
- }
+/*
+ * Copyright 2010-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.
+ */
+
+// HACK have to live with differentiating node from browser for now
+module.exports = {
+ "window": function () {
+ return !!require.resolve ? null : window;
+ }
};
});
define('event', function (require, exports, module) {
-/*
-* Copyright 2010-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 _handlers = {};
-
-function _add(featureId, name, cb, success, fail, once) {
- var handler;
- if (featureId && name && typeof cb === "function") {
- handler = {
- func: cb,
- once: !!once
- };
- //If this is the first time we are adding a cb
- if (!_handlers.hasOwnProperty(name)) {
- _handlers[name] = [handler];
- //Do not call exec for once because its not necessary
- if (!once) {
- window.webworks.exec(success, fail, featureId, "add", {"eventName": name});
- }
- } else if (_handlers[name].some(function (element, index, array) {
- return element.func !== cb;
- })) {
- //Only add unique callbacks
- _handlers[name].push(handler);
- }
- }
-}
-
-module.exports = {
- add: function (featureId, name, cb, success, fail) {
- _add(featureId, name, cb, success, fail, false);
- },
-
- once: function (featureId, name, cb, success, fail) {
- _add(featureId, name, cb, success, fail, true);
- },
-
- isOn: function (name) {
- return !!_handlers[name];
- },
-
- remove: function (featureId, name, cb, success, fail) {
- if (featureId && name && typeof cb === "function") {
- if (_handlers.hasOwnProperty(name)) {
- _handlers[name] = _handlers[name].filter(function (element, index, array) {
- return element.func !== cb || element.once;
- });
-
- if (_handlers[name].length === 0) {
- delete _handlers[name];
- window.webworks.exec(success, fail, featureId, "remove", {"eventName": name});
- }
- }
- }
- },
-
- trigger: function (name, args) {
- var parsedArgs;
- if (_handlers.hasOwnProperty(name)) {
- if (args && args !== "undefined") {
- parsedArgs = JSON.parse(args);
- }
- //Call the handlers
- _handlers[name].forEach(function (handler) {
- if (handler) {
- handler.func(parsedArgs);
- }
- });
- //Remove the once listeners
- _handlers[name] = _handlers[name].filter(function (handler) {
- return !handler.once;
- });
- //Clean up the array if it is empty
- if (_handlers[name].length === 0) {
- delete _handlers[name];
- //No need to call remove since this would only be for callbacks
- }
- }
- }
-};
+/*
+* Copyright 2010-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 _handlers = {};
+
+function _add(featureId, name, cb, success, fail, once) {
+ var handler;
+ if (featureId && name && typeof cb === "function") {
+ handler = {
+ func: cb,
+ once: !!once
+ };
+ //If this is the first time we are adding a cb
+ if (!_handlers.hasOwnProperty(name)) {
+ _handlers[name] = [handler];
+ //Do not call exec for once because its not necessary
+ if (!once) {
+ window.webworks.exec(success, fail, featureId, "add", {"eventName": name});
+ }
+ } else if (_handlers[name].some(function (element, index, array) {
+ return element.func !== cb;
+ })) {
+ //Only add unique callbacks
+ _handlers[name].push(handler);
+ }
+ }
+}
+
+module.exports = {
+ add: function (featureId, name, cb, success, fail) {
+ _add(featureId, name, cb, success, fail, false);
+ },
+
+ once: function (featureId, name, cb, success, fail) {
+ _add(featureId, name, cb, success, fail, true);
+ },
+
+ isOn: function (name) {
+ return !!_handlers[name];
+ },
+
+ remove: function (featureId, name, cb, success, fail) {
+ if (featureId && name && typeof cb === "function") {
+ if (_handlers.hasOwnProperty(name)) {
+ _handlers[name] = _handlers[name].filter(function (element, index, array) {
+ return element.func !== cb || element.once;
+ });
+
+ if (_handlers[name].length === 0) {
+ delete _handlers[name];
+ window.webworks.exec(success, fail, featureId, "remove", {"eventName": name});
+ }
+ }
+ }
+ },
+
+ trigger: function (name, args) {
+ var parsedArgs;
+ if (_handlers.hasOwnProperty(name)) {
+ if (args && args !== "undefined") {
+ parsedArgs = JSON.parse(args);
+ }
+ //Call the handlers
+ _handlers[name].forEach(function (handler) {
+ if (handler) {
+ handler.func(parsedArgs);
+ }
+ });
+ //Remove the once listeners
+ _handlers[name] = _handlers[name].filter(function (handler) {
+ return !handler.once;
+ });
+ //Clean up the array if it is empty
+ if (_handlers[name].length === 0) {
+ delete _handlers[name];
+ //No need to call remove since this would only be for callbacks
+ }
+ }
+ }
+};
});
@@ -1080,81 +1080,81 @@ self = module.exports = {
});
define('lib/exception', function (require, exports, module) {
-/*
- * Copyright 2012 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 = {
-
- types: {
- Application: "Application",
- ArgumentLength: "ArgumentLength",
- ArgumentType: "ArgumentType",
- Argument: "Argument",
- NotificationType: "NotificationType",
- NotificationStateType: "NotificationStateType",
- DomObjectNotFound: "DomObjectNotFound",
- MethodNotImplemented: "MethodNotImplemented",
- InvalidState: "InvalidState",
- ApplicationState: "ApplicationState"
- },
-
- handle: function handle(exception, reThrow) {
- reThrow = reThrow || false;
-
- var eMsg = exception.message || "exception caught!",
- msg = eMsg + "\n\n" + (exception.stack || "*no stack provided*") + "\n\n";
-
- console.error(msg);
-
- if (reThrow) {
- throw exception;
- }
- },
-
- raise: function raise(exceptionType, message, customExceptionObject) {
- var obj = customExceptionObject || {
- type: "",
- message: "",
-
- toString: function () {
- var result = this.name + ': "' + this.message + '"';
-
- if (this.stack) {
- result += "\n" + this.stack;
- }
- return result;
- }
- };
-
- message = message || "";
-
- obj.name = exceptionType;
- obj.type = exceptionType;
- // TODO: include the exception objects original message if exists
- obj.message = message;
-
- throw obj;
- }
-};
+/*
+ * Copyright 2012 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 = {
+
+ types: {
+ Application: "Application",
+ ArgumentLength: "ArgumentLength",
+ ArgumentType: "ArgumentType",
+ Argument: "Argument",
+ NotificationType: "NotificationType",
+ NotificationStateType: "NotificationStateType",
+ DomObjectNotFound: "DomObjectNotFound",
+ MethodNotImplemented: "MethodNotImplemented",
+ InvalidState: "InvalidState",
+ ApplicationState: "ApplicationState"
+ },
+
+ handle: function handle(exception, reThrow) {
+ reThrow = reThrow || false;
+
+ var eMsg = exception.message || "exception caught!",
+ msg = eMsg + "\n\n" + (exception.stack || "*no stack provided*") + "\n\n";
+
+ console.error(msg);
+
+ if (reThrow) {
+ throw exception;
+ }
+ },
+
+ raise: function raise(exceptionType, message, customExceptionObject) {
+ var obj = customExceptionObject || {
+ type: "",
+ message: "",
+
+ toString: function () {
+ var result = this.name + ': "' + this.message + '"';
+
+ if (this.stack) {
+ result += "\n" + this.stack;
+ }
+ return result;
+ }
+ };
+
+ message = message || "";
+
+ obj.name = exceptionType;
+ obj.type = exceptionType;
+ // TODO: include the exception objects original message if exists
+ obj.message = message;
+
+ throw obj;
+ }
+};
});
define('lib/webworks-info', function (require, exports, module) {
module.exports = {
- hash: "0f40cbc4da91e910601fc2ad0128c86c",
- version: "1.0.0.7"
+ hash: "65955a4a246382930a30c0e570183a73",
+ version: "1.0.1.5"
};
});
/*
View
BIN  invoke/invoker/cliffs.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
4 invoke/invoker/index.html
@@ -18,7 +18,7 @@
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
- <script src="webworks-1.0.0.7.js"></script>
+ <script src="webworks-1.0.1.5.js"></script>
<script src="invocations.js"></script>
<link rel="stylesheet" type="text/css" href="jquery/jquery.mobile-1.1.0.min.css" />
<script src="jquery/jquery-1.7.1.min.js"></script>
@@ -52,7 +52,7 @@
<li id="adobeReader">Invoke Adobe Reader</li>
<li id="adobeReaderPdf">Open a PDF file in Adobe Reader</li>
<li id="userApp">Invoke Apps</li>
- <li id="pictures">Open a PNG</li>
+ <li id="pictures">Open a JPG</li>
</ul>
<div id="log"></div>
</div>
View
6 invoke/invoker/invocations.js
@@ -72,14 +72,14 @@ function invokePictures() {
downloadPicture();
blackberry.invoke.invoke({
- uri: "file:///accounts/1000/shared/downloads/rim_logo_black.jpg",
+ uri: "file:///accounts/1000/shared/downloads/cliffs.jpg",
}, onSuccess, onError);
}
//Supported in HTML5: getting binary data from XHR request
function downloadPicture() {
var xhr = new XMLHttpRequest();
- xhr.open('GET', "/rim_logo_black.jpg", true);
+ xhr.open('GET', "/cliffs.jpg", true);
xhr.responseType = 'arraybuffer';
xhr.onload = function(e) {
@@ -96,7 +96,7 @@ function downloadPicture() {
//This function demonstrates how to use the HTML5 FileSystem API: a .png blob is saved to a URI which is used for invocation
function saveFile (blob) {
function gotFs(fs) {
- fs.root.getFile("/accounts/1000/shared/downloads/rim_logo_black.jpg", {create: true}, gotFile, errorHandler);
+ fs.root.getFile("/accounts/1000/shared/downloads/cliffs.jpg", {create: true}, gotFile, errorHandler);
}
function gotFile(fileEntry) {
View
BIN  invoke/invoker/invoker.zip
Binary file not shown
View
BIN  invoke/invoker/rim_logo_black.jpg
Deleted file not rendered
View
370 invoke/invokable/webworks-1.0.0.7.js → invoke/invoker/webworks-1.0.1.5.js 100644 → 100755
@@ -500,124 +500,124 @@ module.exports = _self;
});
define('window', function (require, exports, module) {
-/*
- * Copyright 2010-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.
- */
-
-// HACK have to live with differentiating node from browser for now
-module.exports = {
- "window": function () {
- return !!require.resolve ? null : window;
- }
+/*
+ * Copyright 2010-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.
+ */
+
+// HACK have to live with differentiating node from browser for now
+module.exports = {
+ "window": function () {
+ return !!require.resolve ? null : window;
+ }
};
});
define('event', function (require, exports, module) {
-/*
-* Copyright 2010-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 _handlers = {};
-
-function _add(featureId, name, cb, success, fail, once) {
- var handler;
- if (featureId && name && typeof cb === "function") {
- handler = {
- func: cb,
- once: !!once
- };
- //If this is the first time we are adding a cb
- if (!_handlers.hasOwnProperty(name)) {
- _handlers[name] = [handler];
- //Do not call exec for once because its not necessary
- if (!once) {
- window.webworks.exec(success, fail, featureId, "add", {"eventName": name});
- }
- } else if (_handlers[name].some(function (element, index, array) {
- return element.func !== cb;
- })) {
- //Only add unique callbacks
- _handlers[name].push(handler);
- }
- }
-}
-
-module.exports = {
- add: function (featureId, name, cb, success, fail) {
- _add(featureId, name, cb, success, fail, false);
- },
-
- once: function (featureId, name, cb, success, fail) {
- _add(featureId, name, cb, success, fail, true);
- },
-
- isOn: function (name) {
- return !!_handlers[name];
- },
-
- remove: function (featureId, name, cb, success, fail) {
- if (featureId && name && typeof cb === "function") {
- if (_handlers.hasOwnProperty(name)) {
- _handlers[name] = _handlers[name].filter(function (element, index, array) {
- return element.func !== cb || element.once;
- });
-
- if (_handlers[name].length === 0) {
- delete _handlers[name];
- window.webworks.exec(success, fail, featureId, "remove", {"eventName": name});
- }
- }
- }
- },
-
- trigger: function (name, args) {
- var parsedArgs;
- if (_handlers.hasOwnProperty(name)) {
- if (args && args !== "undefined") {
- parsedArgs = JSON.parse(args);
- }
- //Call the handlers
- _handlers[name].forEach(function (handler) {
- if (handler) {
- handler.func(parsedArgs);
- }
- });
- //Remove the once listeners
- _handlers[name] = _handlers[name].filter(function (handler) {
- return !handler.once;
- });
- //Clean up the array if it is empty
- if (_handlers[name].length === 0) {
- delete _handlers[name];
- //No need to call remove since this would only be for callbacks
- }
- }
- }
-};
+/*
+* Copyright 2010-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 _handlers = {};
+
+function _add(featureId, name, cb, success, fail, once) {
+ var handler;
+ if (featureId && name && typeof cb === "function") {
+ handler = {
+ func: cb,
+ once: !!once
+ };
+ //If this is the first time we are adding a cb
+ if (!_handlers.hasOwnProperty(name)) {
+ _handlers[name] = [handler];
+ //Do not call exec for once because its not necessary
+ if (!once) {
+ window.webworks.exec(success, fail, featureId, "add", {"eventName": name});
+ }
+ } else if (_handlers[name].some(function (element, index, array) {
+ return element.func !== cb;
+ })) {
+ //Only add unique callbacks
+ _handlers[name].push(handler);
+ }
+ }
+}
+
+module.exports = {
+ add: function (featureId, name, cb, success, fail) {
+ _add(featureId, name, cb, success, fail, false);
+ },
+
+ once: function (featureId, name, cb, success, fail) {
+ _add(featureId, name, cb, success, fail, true);
+ },
+
+ isOn: function (name) {
+ return !!_handlers[name];
+ },
+
+ remove: function (featureId, name, cb, success, fail) {
+ if (featureId && name && typeof cb === "function") {
+ if (_handlers.hasOwnProperty(name)) {
+ _handlers[name] = _handlers[name].filter(function (element, index, array) {
+ return element.func !== cb || element.once;
+ });
+
+ if (_handlers[name].length === 0) {
+ delete _handlers[name];
+ window.webworks.exec(success, fail, featureId, "remove", {"eventName": name});
+ }
+ }
+ }
+ },
+
+ trigger: function (name, args) {
+ var parsedArgs;
+ if (_handlers.hasOwnProperty(name)) {
+ if (args && args !== "undefined") {
+ parsedArgs = JSON.parse(args);
+ }
+ //Call the handlers
+ _handlers[name].forEach(function (handler) {
+ if (handler) {
+ handler.func(parsedArgs);
+ }
+ });
+ //Remove the once listeners
+ _handlers[name] = _handlers[name].filter(function (handler) {
+ return !handler.once;
+ });
+ //Clean up the array if it is empty
+ if (_handlers[name].length === 0) {
+ delete _handlers[name];
+ //No need to call remove since this would only be for callbacks
+ }
+ }
+ }
+};
});
@@ -1080,81 +1080,81 @@ self = module.exports = {
});
define('lib/exception', function (require, exports, module) {
-/*
- * Copyright 2012 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 = {
-
- types: {
- Application: "Application",
- ArgumentLength: "ArgumentLength",
- ArgumentType: "ArgumentType",
- Argument: "Argument",
- NotificationType: "NotificationType",
- NotificationStateType: "NotificationStateType",
- DomObjectNotFound: "DomObjectNotFound",
- MethodNotImplemented: "MethodNotImplemented",
- InvalidState: "InvalidState",
- ApplicationState: "ApplicationState"
- },
-
- handle: function handle(exception, reThrow) {
- reThrow = reThrow || false;
-
- var eMsg = exception.message || "exception caught!",
- msg = eMsg + "\n\n" + (exception.stack || "*no stack provided*") + "\n\n";
-
- console.error(msg);
-
- if (reThrow) {
- throw exception;
- }
- },
-
- raise: function raise(exceptionType, message, customExceptionObject) {
- var obj = customExceptionObject || {
- type: "",
- message: "",
-
- toString: function () {
- var result = this.name + ': "' + this.message + '"';
-
- if (this.stack) {
- result += "\n" + this.stack;
- }
- return result;
- }
- };
-
- message = message || "";
-
- obj.name = exceptionType;
- obj.type = exceptionType;
- // TODO: include the exception objects original message if exists
- obj.message = message;
-
- throw obj;
- }
-};
+/*
+ * Copyright 2012 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 = {
+
+ types: {
+ Application: "Application",
+ ArgumentLength: "ArgumentLength",
+ ArgumentType: "ArgumentType",
+ Argument: "Argument",
+ NotificationType: "NotificationType",
+ NotificationStateType: "NotificationStateType",
+ DomObjectNotFound: "DomObjectNotFound",
+ MethodNotImplemented: "MethodNotImplemented",
+ InvalidState: "InvalidState",
+ ApplicationState: "ApplicationState"
+ },
+
+ handle: function handle(exception, reThrow) {
+ reThrow = reThrow || false;
+
+ var eMsg = exception.message || "exception caught!",
+ msg = eMsg + "\n\n" + (exception.stack || "*no stack provided*") + "\n\n";
+
+ console.error(msg);
+
+ if (reThrow) {
+ throw exception;
+ }
+ },
+
+ raise: function raise(exceptionType, message, customExceptionObject) {
+ var obj = customExceptionObject || {
+ type: "",
+ message: "",
+
+ toString: function () {
+ var result = this.name + ': "' + this.message + '"';
+
+ if (this.stack) {
+ result += "\n" + this.stack;
+ }
+ return result;
+ }
+ };
+
+ message = message || "";
+
+ obj.name = exceptionType;
+ obj.type = exceptionType;
+ // TODO: include the exception objects original message if exists
+ obj.message = message;
+
+ throw obj;
+ }
+};
});
define('lib/webworks-info', function (require, exports, module) {
module.exports = {
- hash: "0f40cbc4da91e910601fc2ad0128c86c",
- version: "1.0.0.7"
+ hash: "65955a4a246382930a30c0e570183a73",
+ version: "1.0.1.5"
};
});
/*

0 comments on commit 73a2abc

Please sign in to comment.
Something went wrong with that request. Please try again.