Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Next push demo #2

Closed
wants to merge 2 commits into from

2 participants

@mdandrea
Collaborator

Switched over to use the webworks-1.0.1.5.js file from the SCM build.

@haahmad haahmad closed this
@haahmad

Merged manually

@astanley astanley referenced this pull request from a commit
Adam Stanley fix issue #2 11cc7bc
@bryanhiggins bryanhiggins referenced this pull request from a commit
Luca Sale Fixing Markdown #2 d783143
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 17, 2012
  1. @mdandrea
Commits on Jul 18, 2012
  1. @mdandrea
This page is out of date. Refresh to see the latest.
View
393 pushCapture/Scripts/webworks-1.0.0.7.js → pushCapture/Scripts/webworks-1.0.1.5.js
@@ -500,130 +500,130 @@ 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
+ }
+ }
+ }
+};
});
define('lib/utils', function (require, exports, module) {
/*
- * Copyright 2010-2011 Research In Motion Limited.
+ * 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.
@@ -985,6 +985,26 @@ self = module.exports = {
return false;
},
+ fileNameToImageMIME : function (fileName) {
+
+ var extensionsToMIME = {},
+ ext;
+
+ extensionsToMIME.png = 'image/png';
+ extensionsToMIME.jpg = 'image/jpeg';
+ extensionsToMIME.jpe = 'image/jpeg';
+ extensionsToMIME.jpeg = 'image/jpeg';
+ extensionsToMIME.gif = 'image/gif';
+ extensionsToMIME.bmp = 'image/bmp';
+ extensionsToMIME.bm = 'image/bmp';
+ extensionsToMIME.svg = 'image/svg+xml';
+ extensionsToMIME.tif = 'image/tiff';
+ extensionsToMIME.tiff = 'image/tiff';
+
+ ext = fileName.split('.').pop();
+ return extensionsToMIME[ext];
+ },
+
isLocalURI : function (uri) {
return uri && uri.scheme && "local:///".indexOf(uri.scheme.toLowerCase()) !== -1;
},
@@ -1050,7 +1070,6 @@ self = module.exports = {
getBlobWithArrayBufferAsData : function (data, dataEncoding) {
var rawData,
blobBuilderObj = new window.WebKitBlobBuilder();
-
rawData = this.convertDataToBinary(data, dataEncoding);
blobBuilderObj.append(rawData);
@@ -1061,81 +1080,81 @@ self = module.exports = {
});
define('lib/exception', function (require, exports, module) {
-/*
- * 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 = {
-
- 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: "5f265a939a8ddc3c998da9ae9a755d09",
- version: "1.0.0.7"
+ hash: "65955a4a246382930a30c0e570183a73",
+ version: "1.0.1.5"
};
});
/*
View
2  pushCapture/index.htm
@@ -18,7 +18,7 @@
<head>
<meta name="viewport" content="initial-scale=1.0,width=device-width,user-scalable=no,target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="Styles/bbui-0.9.3.css"></link>
- <script type="text/javascript" src="Scripts/webworks-1.0.0.7.js"></script>
+ <script type="text/javascript" src="Scripts/webworks-1.0.1.5.js"></script>
<script type="text/javascript" src="Scripts/bbui-0.9.3.js"></script>
<script type="text/javascript" src="Scripts/common.js"></script>
<script type="text/javascript" src="Scripts/pushhandler.js"></script>
Something went wrong with that request. Please try again.