Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1024C200C23 for ; Wed, 22 Feb 2017 20:30:08 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 0EBC0160B8D; Wed, 22 Feb 2017 19:30:08 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 97901160B49 for ; Wed, 22 Feb 2017 20:30:06 +0100 (CET) Received: (qmail 49449 invoked by uid 500); 22 Feb 2017 19:30:05 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 49434 invoked by uid 99); 22 Feb 2017 19:30:05 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Feb 2017 19:30:05 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9F11BDFF0F; Wed, 22 Feb 2017 19:30:05 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: shazron@apache.org To: commits@cordova.apache.org Date: Wed, 22 Feb 2017 19:30:05 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [01/27] cordova-plugins git commit: Removed plugins other than tcpsocket, moved plugin to root archived-at: Wed, 22 Feb 2017 19:30:08 -0000 Repository: cordova-plugins Updated Branches: refs/heads/tcpsocket 8f39c7015 -> 4ee84b860 http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/4ee84b86/notification/src/firefoxos/notification.js ---------------------------------------------------------------------- diff --git a/notification/src/firefoxos/notification.js b/notification/src/firefoxos/notification.js deleted file mode 100644 index 4ff541a..0000000 --- a/notification/src/firefoxos/notification.js +++ /dev/null @@ -1,99 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var NotificationError = require('./NotificationError'); -var modulemapper = require('cordova/modulemapper'); - -// keep hold of notification for future use -var mozNotifications = {}; -var mozNotification = modulemapper.getOriginalSymbol(window, 'window.Notification'); - -var closeEvent = new Event('close'); -var clickEvent = new Event('click'); -var showEvent = new Event('show'); -var errorEvent = new Event('error'); - -function makeNotification(successCB, errorCB, options) { - var title = options.title; - var nId = options.notificationId; - var pluginObject = options.pluginObject; - delete options.title; - delete options.notificationId; - delete options.pluginObject; - - var notification = new mozNotification(title, options); - mozNotifications[nId] = notification; - - // handle events - notification.onclose = function() { - pluginObject.dispatchEvent(closeEvent); - } - notification.onclick = function() { - pluginObject.dispatchEvent(clickEvent); - } - notification.onshow = function() { - pluginObject.dispatchEvent(showEvent); - } - notification.onerror = function() { - pluginObject.dispatchEvent(errorEvent); - } - - successCB(); -} - -// errors currently reporting String for debug only -function create(successCB, errorCB, options) { - console.log('FxOS DEBUG: create', options); - - if (mozNotification.permission === 'denied') { - errorCB(new NotificationError(NotificationError.PERMISSION_DENIED, - 'FxOS Notification: Permission denied')); - return; - } - if (mozNotification.permission === 'granted') { - makeNotification(successCB, errorCB, options); - return; - } - mozNotification.requestPermission(function (permission) { - if (permission === 'granted') { - makeNotification(successCB, errorCB, options); - } else { - errorCB(new NotificationError(NotificationError.USER_DENIED, - 'FxOS Notification: User denied')); - } - }); -} - -function remove(successCB, errorCB, params) { - successCB = (successCB) ? successCB : function() {}; - errorCB = (errorCB) ? errorCB : function() {}; - var nId = params.notificationId; - mozNotifications[nId].close(); - successCB(); -} - - -module.exports = { - create: create, - remove: remove -}; - -require("cordova/exec/proxy").add("Notification", module.exports); http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/4ee84b86/notification/www/NotificationError.js ---------------------------------------------------------------------- diff --git a/notification/www/NotificationError.js b/notification/www/NotificationError.js deleted file mode 100644 index 590720b..0000000 --- a/notification/www/NotificationError.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - - -/** - * Notification error object - * - * @constructor - * @param code - * @param message - */ -var NotificationError = function(code, message) { - this.code = code || null; - this.message = message || ''; -}; - -// Notification error codes -NotificationError.UNKNOWN_ERROR = 0; -NotificationError.PERMISSION_DENIED = 1; -NotificationError.USER_DENIED = 2; - -module.exports = NotificationError; http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/4ee84b86/notification/www/notification.js ---------------------------------------------------------------------- diff --git a/notification/www/notification.js b/notification/www/notification.js deleted file mode 100644 index f10bab3..0000000 --- a/notification/www/notification.js +++ /dev/null @@ -1,79 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var argscheck = require('cordova/argscheck'), - utils = require('cordova/utils'), - exec = require('cordova/exec'); - -// counter for a notification id -var nId = 0; - -// This might not be the best idea -// from http://stackoverflow.com/questions/22186467/how-to-use-javascript-eventtarget - -function Emitter () { - var eventTarget = document.createDocumentFragment(); - - function delegate (method) { - this[method] = eventTarget[method].bind(eventTarget); - } - - Emitter.methods.forEach(delegate, this); -} - -Emitter.methods = ["addEventListener", "dispatchEvent", "removeEventListener"]; - -function Notification(title, options, successCB, errorCB) { - - options = (options) ? options : {}; - successCB = (successCB) ? successCB : function() {}; - errorCB = (errorCB) ? errorCB : function() {}; - - // return object in success callback - var self = this; - function success() { - successCB(self); - } - - // add emitter methods to Notification - Emitter.call(this); - - // set parameters - this.title = options.title = title; - this.dir = options.dir || null; - this.lang = options.lang || null; - this.body = options.dir || null; - this.dir = options.dir || null; - this.dir = options.dir || null; - this.dir = options.dir || null; - // add and store notificationId - this._notificationId = options.notificationId = nId++; - options.pluginObject = self; - exec(success, errorCB, "Notification", "create", options); -} - -// handling closing an event -Notification.prototype.close = function(successCB, errorCB) { - var options = {notificationId: this._notificationId}; - exec(successCB, errorCB, "Notification", "remove", options); -}; - -module.exports = Notification; http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/4ee84b86/plugin.xml ---------------------------------------------------------------------- diff --git a/plugin.xml b/plugin.xml new file mode 100644 index 0000000..8bb3d03 --- /dev/null +++ b/plugin.xml @@ -0,0 +1,49 @@ + + + + + TCPSocket + Cordova TCP Socket Plugin + Apache 2.0 + cordova,tcpsocket,socket,tcp + + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/4ee84b86/src/firefoxos/TCPSocketProxy.js ---------------------------------------------------------------------- diff --git a/src/firefoxos/TCPSocketProxy.js b/src/firefoxos/TCPSocketProxy.js new file mode 100644 index 0000000..bbdf1fa --- /dev/null +++ b/src/firefoxos/TCPSocketProxy.js @@ -0,0 +1,47 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +var mozTCPSocket = cordova.require('cordova/modulemapper').getOriginalSymbol(window, 'navigator.TCPSocket') || navigator.mozTCPSocket; + +function open(successCB, errorCB, options) { + try { + var socket = mozTCPSocket.open(options.host, options.port, options.setup); + } catch (e) { + errorCB(e); + return; + } + successCB(socket); +} + +function listen(successCB, errorCB, options) { + try { + var socket = mozTCPSocket.listen(options.port, options.setup, options.queueLimit); + } catch (e) { + errorCB(e); + return; + } + successCB(socket); +} + +require('cordova/exec/proxy').add('TCPSocket', { + open: open, + listen: listen +}); http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/4ee84b86/tcpsocket/doc/index.md ---------------------------------------------------------------------- diff --git a/tcpsocket/doc/index.md b/tcpsocket/doc/index.md deleted file mode 100644 index 7f840a1..0000000 --- a/tcpsocket/doc/index.md +++ /dev/null @@ -1,60 +0,0 @@ - - -# org.apache.cordova.labs.tcpsocket - -This plugin is used to run sockets - -## Objects - -- navigator.TCPSocket - -## Methods - -### navigator.TCPSocket.open - - navigator.TCPSocket.open(host, port, successCallback, errorCallback, options) - - -- host is a string representing the hostname of the server to connect to (it can also be its raw IP address). -- port is a umber representing the TCP port to be used by the socket (some protocols have a standard port, for example 80 for HTTP, 447 for SSL, 25 for SMTP, etc. Port numbers beyond 1024 are not assigned to any specific protocol and can be used for any purpose.) -- options is an object containing - - useSecureTransport (Boolean) false (default) - - binaryType (String) "string" (default) or "arrayBuffer" - -an instantiation of a new TCPSocket object is returned in success callback - -#### Firefox OS quirks - -Only certified apps can use a port below 1024. - -### navigator.TCPSocket.listen - - navigator.TCPSocket.listen(port, successCallback, errorCallback, options, queueLimit) - -- port is a number representing the TCP port to be used to listen for connections. -- options is an optional object expecting a property called binaryType which is a string that can have two possible values: string and arraybuffer. If the value is arraybuffer then the TCPSocket.send() will use ArrayBuffers and the data received from the remote connection will also be available in that format. -- queueLimit is a number representing the maximum lenght that the pending connections queue can grow. - -an instantiation of a new TCPSocket object is returned in success callback - -#### Firefox OS quirks - -Only certified apps can use a port below 1024. - http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/4ee84b86/tcpsocket/plugin.xml ---------------------------------------------------------------------- diff --git a/tcpsocket/plugin.xml b/tcpsocket/plugin.xml deleted file mode 100644 index 8bb3d03..0000000 --- a/tcpsocket/plugin.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - TCPSocket - Cordova TCP Socket Plugin - Apache 2.0 - cordova,tcpsocket,socket,tcp - - - - - - - - - - - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/4ee84b86/tcpsocket/src/firefoxos/TCPSocketProxy.js ---------------------------------------------------------------------- diff --git a/tcpsocket/src/firefoxos/TCPSocketProxy.js b/tcpsocket/src/firefoxos/TCPSocketProxy.js deleted file mode 100644 index bbdf1fa..0000000 --- a/tcpsocket/src/firefoxos/TCPSocketProxy.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -var mozTCPSocket = cordova.require('cordova/modulemapper').getOriginalSymbol(window, 'navigator.TCPSocket') || navigator.mozTCPSocket; - -function open(successCB, errorCB, options) { - try { - var socket = mozTCPSocket.open(options.host, options.port, options.setup); - } catch (e) { - errorCB(e); - return; - } - successCB(socket); -} - -function listen(successCB, errorCB, options) { - try { - var socket = mozTCPSocket.listen(options.port, options.setup, options.queueLimit); - } catch (e) { - errorCB(e); - return; - } - successCB(socket); -} - -require('cordova/exec/proxy').add('TCPSocket', { - open: open, - listen: listen -}); http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/4ee84b86/tcpsocket/www/TCPSocket.js ---------------------------------------------------------------------- diff --git a/tcpsocket/www/TCPSocket.js b/tcpsocket/www/TCPSocket.js deleted file mode 100644 index b2ab013..0000000 --- a/tcpsocket/www/TCPSocket.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var cordova = require('cordova'), - exec = require('cordova/exec'); - -var TCPSocket = { - open: function(host, port, successCB, errorCB, setup) { - setup = setup || {}; - setup.useSecureTransport = setup.useSecureTransport || false; - setup.binaryType = setup.binaryType || 'string'; - options = { - host: host, - port: port, - setup: setup - } - exec(successCB, errorCB, "TCPSocket", "open", options) - }, - listen: function(port, successCB, errorCB, setup, queueLimit) { - setup = setup || {}; - setup.binaryType = setup.binaryType || 'string'; - options = { - port: port, - setup: setup - }; - if (queueLimit) { - options.queueLimit = queueLimit; - } - exec(successCB, errorCB, "TCPSocket", "listen", options) - } -} - -module.exports = TCPSocket; http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/4ee84b86/wkwebview-engine-localhost/README.md ---------------------------------------------------------------------- diff --git a/wkwebview-engine-localhost/README.md b/wkwebview-engine-localhost/README.md deleted file mode 100644 index 77b5ce9..0000000 --- a/wkwebview-engine-localhost/README.md +++ /dev/null @@ -1,21 +0,0 @@ -Cordova WKWebView Engine with http server (localhost) support -====== - -This plugin uses the: -- [cordova-plugin-wkwebview-engine](https://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine.git) plugin -- [cordova-labs-local-webserver](https://git-wip-us.apache.org/repos/asf/cordova-plugins.git#master:local-webserver) plugin - -This plugin requires at least version 4.1.0 `cordova-ios`. - -To try this: - - cordova create wkwvtest my.project.id wkwvtest - cd wkwvtest - cordova platform add ios@4 - cordova plugin add https://github.com/apache/cordova-plugins.git#master:wkwebview-engine-localhost - - -Supported Platforms -------------------- - -- iOS http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/4ee84b86/wkwebview-engine-localhost/plugin.xml ---------------------------------------------------------------------- diff --git a/wkwebview-engine-localhost/plugin.xml b/wkwebview-engine-localhost/plugin.xml deleted file mode 100644 index 6003793..0000000 --- a/wkwebview-engine-localhost/plugin.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - Cordova WKWebView Engine with http server (localhost) support - Cordova WKWebView Engine with HTTP Server Plugin - Apache 2.0 - cordova,wkwebview,webview - https://git-wip-us.apache.org/repos/asf/cordova-plugins.git - - - - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/4ee84b86/www/TCPSocket.js ---------------------------------------------------------------------- diff --git a/www/TCPSocket.js b/www/TCPSocket.js new file mode 100644 index 0000000..b2ab013 --- /dev/null +++ b/www/TCPSocket.js @@ -0,0 +1,51 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +var cordova = require('cordova'), + exec = require('cordova/exec'); + +var TCPSocket = { + open: function(host, port, successCB, errorCB, setup) { + setup = setup || {}; + setup.useSecureTransport = setup.useSecureTransport || false; + setup.binaryType = setup.binaryType || 'string'; + options = { + host: host, + port: port, + setup: setup + } + exec(successCB, errorCB, "TCPSocket", "open", options) + }, + listen: function(port, successCB, errorCB, setup, queueLimit) { + setup = setup || {}; + setup.binaryType = setup.binaryType || 'string'; + options = { + port: port, + setup: setup + }; + if (queueLimit) { + options.queueLimit = queueLimit; + } + exec(successCB, errorCB, "TCPSocket", "listen", options) + } +} + +module.exports = TCPSocket; --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org For additional commands, e-mail: commits-help@cordova.apache.org