summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/www
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-09-21 18:43:03 +0200
committerJules Laplace <julescarbon@gmail.com>2020-09-21 18:43:03 +0200
commit7f6c5134780ad3cedc718772b40578f0170f200e (patch)
tree15a120d91855ae66f42111e05f696e5600a9b832 /StoneIsland/platforms/ios/www
parent853bd5fa85812316a72b2f5ce755dc0facb91932 (diff)
cordova-plugin-inappbrowser welcome to the family!!
Diffstat (limited to 'StoneIsland/platforms/ios/www')
-rw-r--r--StoneIsland/platforms/ios/www/cordova_plugins.js11
-rwxr-xr-xStoneIsland/platforms/ios/www/css/products.css3
-rwxr-xr-xStoneIsland/platforms/ios/www/js/index.js2
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/view/Serializable.js2
-rw-r--r--StoneIsland/platforms/ios/www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js122
5 files changed, 137 insertions, 3 deletions
diff --git a/StoneIsland/platforms/ios/www/cordova_plugins.js b/StoneIsland/platforms/ios/www/cordova_plugins.js
index 86f1a2e6..48715900 100644
--- a/StoneIsland/platforms/ios/www/cordova_plugins.js
+++ b/StoneIsland/platforms/ios/www/cordova_plugins.js
@@ -339,6 +339,14 @@ cordova.define('cordova/plugin_list', function(require, exports, module) {
"clobbers": [
"cordova.plugin.http"
]
+ },
+ {
+ "id": "cordova-plugin-inappbrowser.inappbrowser",
+ "file": "plugins/cordova-plugin-inappbrowser/www/inappbrowser.js",
+ "pluginId": "cordova-plugin-inappbrowser",
+ "clobbers": [
+ "cordova.InAppBrowser.open"
+ ]
}
];
module.exports.metadata = {
@@ -357,6 +365,7 @@ cordova.define('cordova/plugin_list', function(require, exports, module) {
"cordova-plugin-x-socialsharing": "5.1.8",
"cordova-plugin-whitelist": "1.3.0",
"cordova-plugin-file": "6.0.2",
- "cordova-plugin-advanced-http": "3.0.1"
+ "cordova-plugin-advanced-http": "3.0.1",
+ "cordova-plugin-inappbrowser": "4.0.0"
};
}); \ No newline at end of file
diff --git a/StoneIsland/platforms/ios/www/css/products.css b/StoneIsland/platforms/ios/www/css/products.css
index e15e0e54..143204f8 100755
--- a/StoneIsland/platforms/ios/www/css/products.css
+++ b/StoneIsland/platforms/ios/www/css/products.css
@@ -130,6 +130,7 @@
margin-top: 0;
}
+/*
#product::before {
content:'';
width:100%;
@@ -140,7 +141,7 @@
bottom:0px;
left:0
}
-
+*/
.product .style {
padding: 0;
border:1px solid black;
diff --git a/StoneIsland/platforms/ios/www/js/index.js b/StoneIsland/platforms/ios/www/js/index.js
index 3947b43e..0e9ee355 100755
--- a/StoneIsland/platforms/ios/www/js/index.js
+++ b/StoneIsland/platforms/ios/www/js/index.js
@@ -115,6 +115,8 @@ var app = (function(){
// }
push.init()
+ window.open = cordova.InAppBrowser.open
+
if (navigator.onLine) {
app.account.connect(window.deepLinkRoute || '/intro')
app.blog.fetch(function(){
diff --git a/StoneIsland/platforms/ios/www/js/lib/view/Serializable.js b/StoneIsland/platforms/ios/www/js/lib/view/Serializable.js
index acf77f2c..bc281b15 100755
--- a/StoneIsland/platforms/ios/www/js/lib/view/Serializable.js
+++ b/StoneIsland/platforms/ios/www/js/lib/view/Serializable.js
@@ -155,7 +155,7 @@ var SerializableView = View.extend({
}
else {
this.hide_errors()
- window.cordova && window.Keyboard.close()
+ window.cordova && window.Keyboard.hide()
}
var finalized_data = this.finalize(valid.data)
diff --git a/StoneIsland/platforms/ios/www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js b/StoneIsland/platforms/ios/www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js
new file mode 100644
index 00000000..577ffac4
--- /dev/null
+++ b/StoneIsland/platforms/ios/www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js
@@ -0,0 +1,122 @@
+cordova.define("cordova-plugin-inappbrowser.inappbrowser", function(require, exports, module) {
+/*
+ *
+ * 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.
+ *
+*/
+
+(function () {
+ var exec = require('cordova/exec');
+ var channel = require('cordova/channel');
+ var modulemapper = require('cordova/modulemapper');
+ var urlutil = require('cordova/urlutil');
+
+ function InAppBrowser () {
+ this.channels = {
+ 'beforeload': channel.create('beforeload'),
+ 'loadstart': channel.create('loadstart'),
+ 'loadstop': channel.create('loadstop'),
+ 'loaderror': channel.create('loaderror'),
+ 'exit': channel.create('exit'),
+ 'customscheme': channel.create('customscheme'),
+ 'message': channel.create('message')
+ };
+ }
+
+ InAppBrowser.prototype = {
+ _eventHandler: function (event) {
+ if (event && (event.type in this.channels)) {
+ if (event.type === 'beforeload') {
+ this.channels[event.type].fire(event, this._loadAfterBeforeload);
+ } else {
+ this.channels[event.type].fire(event);
+ }
+ }
+ },
+ _loadAfterBeforeload: function (strUrl) {
+ strUrl = urlutil.makeAbsolute(strUrl);
+ exec(null, null, 'InAppBrowser', 'loadAfterBeforeload', [strUrl]);
+ },
+ close: function (eventname) {
+ exec(null, null, 'InAppBrowser', 'close', []);
+ },
+ show: function (eventname) {
+ exec(null, null, 'InAppBrowser', 'show', []);
+ },
+ hide: function (eventname) {
+ exec(null, null, 'InAppBrowser', 'hide', []);
+ },
+ addEventListener: function (eventname, f) {
+ if (eventname in this.channels) {
+ this.channels[eventname].subscribe(f);
+ }
+ },
+ removeEventListener: function (eventname, f) {
+ if (eventname in this.channels) {
+ this.channels[eventname].unsubscribe(f);
+ }
+ },
+
+ executeScript: function (injectDetails, cb) {
+ if (injectDetails.code) {
+ exec(cb, null, 'InAppBrowser', 'injectScriptCode', [injectDetails.code, !!cb]);
+ } else if (injectDetails.file) {
+ exec(cb, null, 'InAppBrowser', 'injectScriptFile', [injectDetails.file, !!cb]);
+ } else {
+ throw new Error('executeScript requires exactly one of code or file to be specified');
+ }
+ },
+
+ insertCSS: function (injectDetails, cb) {
+ if (injectDetails.code) {
+ exec(cb, null, 'InAppBrowser', 'injectStyleCode', [injectDetails.code, !!cb]);
+ } else if (injectDetails.file) {
+ exec(cb, null, 'InAppBrowser', 'injectStyleFile', [injectDetails.file, !!cb]);
+ } else {
+ throw new Error('insertCSS requires exactly one of code or file to be specified');
+ }
+ }
+ };
+
+ module.exports = function (strUrl, strWindowName, strWindowFeatures, callbacks) {
+ // Don't catch calls that write to existing frames (e.g. named iframes).
+ if (window.frames && window.frames[strWindowName]) {
+ var origOpenFunc = modulemapper.getOriginalSymbol(window, 'open');
+ return origOpenFunc.apply(window, arguments);
+ }
+
+ strUrl = urlutil.makeAbsolute(strUrl);
+ var iab = new InAppBrowser();
+
+ callbacks = callbacks || {};
+ for (var callbackName in callbacks) {
+ iab.addEventListener(callbackName, callbacks[callbackName]);
+ }
+
+ var cb = function (eventname) {
+ iab._eventHandler(eventname);
+ };
+
+ strWindowFeatures = strWindowFeatures || '';
+
+ exec(cb, cb, 'InAppBrowser', 'open', [strUrl, strWindowName, strWindowFeatures]);
+ return iab;
+ };
+})();
+
+});