Commit 873348a3 authored by jiacheng.mao's avatar jiacheng.mao

ios init20231123

parent 6d4e4200
......@@ -55,6 +55,10 @@ For a detailed explanation on how things work, check out the [guide](http://vuej
# 签名
jarsigner -verbose -keystore xcmg.keystore -signedjar 徐工融租.apk xcmg.apk XCMGKEY
# md5:047c68ff98d1ac55bf9b68300eeaca73
# sha1:06afdecaf65df111139891d015d9e70778d780fe
# sha256:f7ac80c0dde82d3a064dc61ecb3842f4237b81599b5910c7c98a4bf889102256
# publicKey:miibijanbgkqhkig9w0baqefaaocaq8amiibcgkcaqeai1bftfqbfjxfh/gyz/m2nlftypu4kj2zkpcw4mjmtv9lcqvfgni0fuapwytj5xqdg2q+a9lmlfdfnpeixq64ox9wwouzlfg4vcvwvkfhzvvrwcblfevotrmvqh9hlizyp2kc693+hpyfc5wkmg/fxdi+hd8eldtic7kc2tfp0cm26xg97gimqu0eqoxus4lcs3un5mhuwhmg8laz/edftt6oixt0zxeqd941n7lyqmkw9tafa746rxfuuusfr2khyaeubggwtyehvwpcoa+2fzmqfw8vp4/fvlif6rv+v1hxsuah+tir5fbniiy+now/n7oljkeqfb+tz4bp8w3jbqidaqab
#极光推送信息
账户:15062177566@163.com
......
......@@ -111,7 +111,12 @@
<plugin name="cordova-plugin-device" spec="2.0.2" />
<plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
<plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
<engine name="android" spec="~6.2.0" />
<plugin name="cordova-plugin-ionic-webview" spec="~1.2.1" />
<plugin name="cordova-plugin-inappbrowser" spec="~4.0.0" />
<plugin name="IdCardPlugin" spec="/Users/mjc/Desktop/workspace/xcmg/cordova-plugin-hand-idcardplug" />
<engine name="ios" spec="^4.5.5" />
<preference name="xwalkVersion" value="19+" />
<preference name="xwalkCommandLine" value="--disable-pull-to-refresh-effect" />
<preference name="xwalkMode" value="embedded" />
<preference name="xwalkMultipleApk" value="true" />
</widget>
'use strict'
module.exports = {
NODE_ENV: '"development"',
NODE_ENV: '"production"',
CONFIG_ENV: JSON.stringify(process.env.CONFIG_ENV),
debug: true,
isMobilePlatform: true,
loginPath: '"http://180.104.121.66:8088/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=appadmin&password=" ',
basePath: '"http://180.104.121.66:8088/r/api/interface?sysName=XCMG_DEV&apiName="',
basePath: '"http://180.104.121.66:8088/r/api/interface?sysName=XCMG_UAT&apiName="',
rootPath: '"http://180.104.121.66:8088/r/api"',
filePath: '"http://180.104.121.66:8088/r/api/app/fileViewSvc?sysName=XCMG_DEV&apiName=file_view&"',
filePath: '"http://180.104.121.66:8088/r/api/app/fileViewSvc?sysName=XCMG_UAT&apiName=file_view&"',
ocrPath:'"http://180.104.121.66:8088/r/api"',
fileUploadSvcPath:'"http://180.104.121.66:8088/r/api/app/fileUploadSvc?sysName=XCMG_DEV&apiName="',
fileUploadSvcPath:'"http://180.104.121.66:8088/r/api/app/fileUploadSvc?sysName=XCMG_UAT&apiName="',
privacyPath: '"http://180.104.121.66:8090/html/PrivacyPolicy.html"',
appId: '"com.xcmg.app.dev"',
currentVersion: '"3.7.8"'
currentVersion: '"4.3.1"'
}
{
"name": "IdCardPlugin",
"version": "1.0.0",
"name": "cordova-plugin-hand-idcardplugin",
"version": "0.3.1",
"description": "",
"cordova": {
"id": "IdCardPlugin",
"platforms": []
"id": "cordova-plugin-hand-idcardplugin",
"platforms": [
"ios",
"android"
]
},
"keywords": [
"ecosystem:cordova"
......
<?xml version='1.0' encoding='utf-8'?>
<plugin id="IdCardPlugin" version="1.0.0" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<name>IdCardPlugin</name>
<plugin id="cordova-plugin-hand-idcardplugin" version="0.3.1" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<name>IdCardPlugin</name>
<js-module name="IdCardPlugin" src="www/IdCardPlugin.js">
<clobbers target="cordova.plugins.IdCardPlugin" />
</js-module>
<!-- android -->
<platform name="android">
<!-- 业务类指定 -->
<config-file target="res/xml/config.xml" parent="/*">
<feature name="IdCardIdentifyPlugin">
<param name="android-package" value="com.xg.idcard.IdCardIdentifyPlugin"/>
</feature>
</config-file>
<config-file target="config.xml" parent="/*">
<!-- QSign 支持的最低 SDK 版本是 21 -->
<preference name="android-minSdkVersion" value="21"/>
</config-file>
<!-- 需要的android权限 -->
<config-file target="AndroidManifest.xml" parent="/*">
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
</config-file>
<config-file target="AndroidManifest.xml" parent="/manifest/application">
<activity android:name="com.qsign.face.LivenessDetectActivity"/>
</config-file>
<!-- arr引用 -->
<resource-file src="src/android/lib/jsgzsdk.aar" target="libs/jsgzsdk.aar" />
<framework src="src/android/lib/idCard.gradle" custom="true" type="gradleReference" />
<source-file src="src/android/java/IdCardIdentifyPlugin.java" target-dir="src/com/xg/idcard/" />
<source-file src="src/android/lib/com.xcmg.app.dev-license.qsign-android" target-dir="assets/" />
<source-file src="src/android/lib/com.xcmg.app-license.qsign-android" target-dir="assets/" />
</platform>
<platform name="ios">
<config-file parent="/*" target="config.xml">
<feature name="IdCardIdentifyPlugin">
<param name="ios-package" value="IdCardIdentifyCordova"/>
</feature>
</config-file>
<!-- 第三方库依赖 -->
<config-file target="*-Info.plist" parent="NSCameraUsageDescription">
<string>亲,我们需要访问您的相机,用于拍摄人脸、身份证等照片</string>
</config-file>
<config-file target="*-Info.plist" parent="NSFaceIDUsageDescription">
<string>需要设备访问Face ID,用于校验权限</string>
</config-file>
<config-file target="*-Info.plist" parent="NSMicrophoneUsageDescription">
<string>亲,我们需要访问您的麦克风,用于录制视频</string>
</config-file>
<config-file target="*-Info.plist" parent="NSPhotoLibraryUsageDescription">
<string>亲,我们需要访问您的相册,用于提供图片素材</string>
</config-file>
<!-- <config-file target="*-Info.plist" parent="NSPhotoLibraryAddUsageDescription">
<string>亲,我们需要访问您的相册,用于提供图片素材</string>
</config-file> -->
<header-file src="src/ios/IdCardIdentifyCordova.h" target-dir="."/>
<source-file src="src/ios/IdCardIdentifyCordova.m" target-dir="."/>
<!-- <framework src="CoreBluetooth.framework" weak="true"/> -->
<framework src="src/ios/QsignSDK/QsignFaceSDK.framework" custom="true" embed="true" />
<framework src="src/ios/QsignSDK/QsignNotarySDK.framework" custom="true" embed="true"/>
<framework src="src/ios/QsignSDK/QsignSafeSDK.framework" custom="true" embed="true" />
<!-- <source-file src="src/ios/QsignSDK/com.xcmg.app-license.qsign-ios" target-dir="."/>
<source-file src="src/ios/QsignSDK/com.xcmg.app.dev-license.qsign-ios" target-dir="."/> -->
<resource-file src="src/ios/QsignSDK/com.xcmg.app-license.qsign-ios" target-dir="res/com.xcmg.app-license.qsign-ios"/>
<resource-file src="src/ios/QsignSDK/com.xcmg.app.dev-license.qsign-ios" target-dir="res/om.xcmg.app.dev-license.qsign-ios"/>
<resource-file src="src/ios/QsignSDK/com.cn.weslink.qsign.jsgzdemo-license.qsign-ios" target-dir="res/om.xcmg.app.dev-license.qsign-ios"/>
<js-module name="IdCardPlugin" src="www/IdCardPlugin.js">
<clobbers target="cordova.plugins.IdCardPlugin" />
</js-module>
<!-- android -->
<platform name="android">
<!-- 业务类指定 -->
<config-file target="res/xml/config.xml" parent="/*">
<feature name="IdCardIdentifyPlugin">
<param name="android-package" value="com.xg.idcard.IdCardIdentifyPlugin"/>
</feature>
</config-file>
<!-- 需要的android权限 -->
<config-file target="AndroidManifest.xml" parent="/*">
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
</config-file>
<config-file target="AndroidManifest.xml" parent="/manifest/application">
<activity android:name="com.qsign.face.LivenessDetectActivity"/>
</config-file>
<!-- arr引用 -->
<resource-file src="src/android/lib/jsgzsdk.aar" target="libs/jsgzsdk.aar" />
<framework src="src/android/lib/idCard.gradle" custom="true" type="gradleReference" />
<source-file src="src/android/java/IdCardIdentifyPlugin.java" target-dir="src/com/xg/idcard/" />
<source-file src="src/android/lib/com.xcmg.app.dev-license.qsign-android" target-dir="assets/" />
<source-file src="src/android/lib/com.xcmg.app-license.qsign-android" target-dir="assets/" />
</platform>
<!-- 3.0 4 required cordova 6.4.0
<framework src="src/ios/AFNetworking.framework" custom="true" embed="true" />
-->
<!-- 使用热更新插件中的 AFNetworkingFramwork.framework -->
<!-- 当单独使用时 放开 以下内容 -->
</platform>
</plugin>
This diff is collapsed.
repositories{
jcenter()
flatDir {
dirs 'libs'
}
}
dependencies {
compile(name:"jsgzsdk",ext: 'aar')
implementation 'com.android.support:appcompat-v7:28.+'
//必须添加如下依赖!!!
implementation 'com.android.support:recyclerview-v7:28.+'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.alibaba:fastjson:1.2.31'
implementation 'com.lzy.net:okgo:3.0.4'
implementation ('com.github.bumptech.glide:glide:4.8.0'){
exclude group:"com.android.support"
}
implementation "com.android.support:exifinterface:28.+"
implementation 'com.otaliastudios:cameraview:1.5.0'
}
android {
packagingOptions {
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}
aaptOptions {
noCompress "dat"
}
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '28.0.0'
}
}
}
}
\ No newline at end of file
repositories{
jcenter()
flatDir {
dirs 'libs'
}
}
dependencies {
compile(name:"jsgzsdk",ext: 'aar')
//必须添加如下依赖!!!
implementation 'com.android.support:appcompat-v7:28.+'
implementation 'com.android.support:support-v4:28.+'
implementation 'com.android.support:recyclerview-v7:28.+'
implementation 'com.android.support:design:28.+'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.alibaba:fastjson:1.2.31'
implementation 'com.tencent:mmkv:1.2.14'
implementation 'com.getkeepsafe.relinker:relinker:1.4.3'
implementation 'com.lzy.net:okgo:3.0.4'
implementation ('com.github.bumptech.glide:glide:4.8.0'){
exclude group:"com.android.support"
}
implementation 'com.github.lzyzsd:jsbridge:1.0.4'
implementation 'com.otaliastudios:cameraview:1.6.1'
implementation "com.android.support:exifinterface:28.+"
}
android {
packagingOptions {
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}
aaptOptions {
noCompress "dat"
}
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '28.0.0'
}
}
}
}
This diff is collapsed.
......@@ -101,4 +101,4 @@
"PACKAGE_NAME": "com.xcmg.app"
}
}
}
\ No newline at end of file
}
<!--
#
# 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.
#
-->
# Contributing to Apache Cordova
Anyone can contribute to Cordova. And we need your contributions.
There are multiple ways to contribute: report bugs, improve the docs, and
contribute code.
For instructions on this, start with the
[contribution overview](http://cordova.apache.org/contribute/).
The details are explained there, but the important items are:
- Check for Github issues that corresponds to your contribution and link or create them if necessary.
- Run the tests so your patch doesn't break existing functionality.
We look forward to your contributions!
This diff is collapsed.
Apache Cordova
Copyright 2012 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
This diff is collapsed.
This diff is collapsed.
{
"_from": "cordova-plugin-inappbrowser@~4.0.0",
"_id": "cordova-plugin-inappbrowser@4.0.0",
"_inBundle": false,
"_integrity": "sha512-w2LZzdF3R4G/EqVZ9aWch9Pksk76uw6/S5wFP1sgn7zjsSDpJBb/JhazLnioN1NZmZiCUBbROv1S4+9JCkeCgA==",
"_location": "/cordova-plugin-inappbrowser",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "cordova-plugin-inappbrowser@~4.0.0",
"name": "cordova-plugin-inappbrowser",
"escapedName": "cordova-plugin-inappbrowser",
"rawSpec": "~4.0.0",
"saveSpec": null,
"fetchSpec": "~4.0.0"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.npmjs.org/cordova-plugin-inappbrowser/-/cordova-plugin-inappbrowser-4.0.0.tgz",
"_shasum": "081e125b3ece05e30dd00e5f9396160926832a2a",
"_spec": "cordova-plugin-inappbrowser@~4.0.0",
"_where": "/Users/mjc/Desktop/workspace/xcmg/hls-xcmg-vue-app",
"author": {
"name": "Apache Software Foundation"
},
"bugs": {
"url": "https://github.com/apache/cordova-plugin-inappbrowser/issues"
},
"bundleDependencies": false,
"cordova": {
"id": "cordova-plugin-inappbrowser",
"platforms": [
"android",
"browser",
"ios",
"osx",
"windows"
]
},
"deprecated": false,
"description": "Cordova InAppBrowser Plugin",
"devDependencies": {
"eslint": "^4.0.0",
"eslint-config-semistandard": "^11.0.0",
"eslint-config-standard": "^10.2.1",
"eslint-plugin-import": "^2.3.0",
"eslint-plugin-node": "^5.0.0",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-standard": "^3.0.1"
},
"engines": {
"cordovaDependencies": {
"0.2.3": {
"cordova": ">=3.1.0"
},
"4.0.0": {
"cordova": ">=3.1.0",
"cordova-ios": ">=4.0.0"
},
"5.0.0": {
"cordova": ">100"
}
}
},
"homepage": "https://github.com/apache/cordova-plugin-inappbrowser#readme",
"keywords": [
"cordova",
"in",
"app",
"browser",
"inappbrowser",
"ecosystem:cordova",
"cordova-android",
"cordova-browser",
"cordova-ios",
"cordova-osx",
"cordova-windows"
],
"license": "Apache-2.0",
"name": "cordova-plugin-inappbrowser",
"repository": {
"type": "git",
"url": "git+https://github.com/apache/cordova-plugin-inappbrowser.git"
},
"scripts": {
"eslint": "node node_modules/eslint/bin/eslint www && node node_modules/eslint/bin/eslint src && node node_modules/eslint/bin/eslint tests",
"test": "npm run eslint"
},
"types": "./types/index.d.ts",
"version": "4.0.0"
}
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
id="cordova-plugin-inappbrowser"
version="4.0.0">
<name>InAppBrowser</name>
<description>Cordova InAppBrowser Plugin</description>
<license>Apache 2.0</license>
<keywords>cordova,in,app,browser,inappbrowser</keywords>
<repo>https://github.com/apache/cordova-plugin-inappbrowser</repo>
<issue>https://github.com/apache/cordova-plugin-inappbrowser/issues</issue>
<engines>
<engine name="cordova" version=">=3.1.0" /><!-- Needs cordova/urlutil -->
<engine name="cordova-ios" version=">=4.0.0" />
</engines>
<!-- android -->
<platform name="android">
<js-module src="www/inappbrowser.js" name="inappbrowser">
<clobbers target="cordova.InAppBrowser.open" />
</js-module>
<config-file target="res/xml/config.xml" parent="/*">
<feature name="InAppBrowser">
<param name="android-package" value="org.apache.cordova.inappbrowser.InAppBrowser"/>
</feature>
</config-file>
<source-file src="src/android/InAppBrowser.java" target-dir="src/org/apache/cordova/inappbrowser" />
<source-file src="src/android/InAppBrowserDialog.java" target-dir="src/org/apache/cordova/inappbrowser" />
<source-file src="src/android/InAppChromeClient.java" target-dir="src/org/apache/cordova/inappbrowser" />
<!-- drawable src/android/resources -->
<resource-file src="src/android/res/drawable-hdpi/ic_action_next_item.png" target="res/drawable-hdpi/ic_action_next_item.png" />
<resource-file src="src/android/res/drawable-mdpi/ic_action_next_item.png" target="res/drawable-mdpi/ic_action_next_item.png" />
<resource-file src="src/android/res/drawable-xhdpi/ic_action_next_item.png" target="res/drawable-xhdpi/ic_action_next_item.png" />
<resource-file src="src/android/res/drawable-xxhdpi/ic_action_next_item.png" target="res/drawable-xxhdpi/ic_action_next_item.png" />
<resource-file src="src/android/res/drawable-hdpi/ic_action_previous_item.png" target="res/drawable-hdpi/ic_action_previous_item.png" />
<resource-file src="src/android/res/drawable-mdpi/ic_action_previous_item.png" target="res/drawable-mdpi/ic_action_previous_item.png" />
<resource-file src="src/android/res/drawable-xhdpi/ic_action_previous_item.png" target="res/drawable-xhdpi/ic_action_previous_item.png" />
<resource-file src="src/android/res/drawable-xxhdpi/ic_action_previous_item.png" target="res/drawable-xxhdpi/ic_action_previous_item.png" />
<resource-file src="src/android/res/drawable-hdpi/ic_action_remove.png" target="res/drawable-hdpi/ic_action_remove.png" />
<resource-file src="src/android/res/drawable-mdpi/ic_action_remove.png" target="res/drawable-mdpi/ic_action_remove.png" />
<resource-file src="src/android/res/drawable-xhdpi/ic_action_remove.png" target="res/drawable-xhdpi/ic_action_remove.png" />
<resource-file src="src/android/res/drawable-xxhdpi/ic_action_remove.png" target="res/drawable-xxhdpi/ic_action_remove.png" />
</platform>
<!-- ios -->
<platform name="ios">
<js-module src="www/inappbrowser.js" name="inappbrowser">
<clobbers target="cordova.InAppBrowser.open" />
</js-module>
<config-file target="config.xml" parent="/*">
<feature name="InAppBrowser">
<param name="ios-package" value="CDVWKInAppBrowser" />
<param name="onload" value="true" />
</feature>
</config-file>
<header-file src="src/ios/CDVInAppBrowserOptions.h" />
<source-file src="src/ios/CDVInAppBrowserOptions.m" />
<header-file src="src/ios/CDVInAppBrowserNavigationController.h" />
<source-file src="src/ios/CDVInAppBrowserNavigationController.m" />
<header-file src="src/ios/CDVWKInAppBrowser.h" />
<source-file src="src/ios/CDVWKInAppBrowser.m" />
<header-file src="src/ios/CDVWKInAppBrowserUIDelegate.h" />
<source-file src="src/ios/CDVWKInAppBrowserUIDelegate.m" />
<framework src="CoreGraphics.framework" />
</platform>
<!-- osx -->
<platform name="osx">
<js-module src="www/inappbrowser.js" name="inappbrowser">
<clobbers target="cordova.InAppBrowser.open" />
</js-module>
<config-file target="config.xml" parent="/*">
<feature name="InAppBrowser">
<param name="osx-package" value="CDVInAppBrowser" />
</feature>
</config-file>
<header-file src="src/osx/CDVInAppBrowser.h" />
<source-file src="src/osx/CDVInAppBrowser.m" />
</platform>
<!-- windows -->
<platform name="windows">
<js-module src="www/inappbrowser.js" name="inappbrowser">
<clobbers target="cordova.InAppBrowser.open" />
</js-module>
<js-module src="src/windows/InAppBrowserProxy.js" name="InAppBrowserProxy">
<runs />
</js-module>
<asset src="www/inappbrowser.css" target="css/inappbrowser.css" />
</platform>
<!-- browser -->
<platform name="browser">
<js-module src="www/inappbrowser.js" name="inappbrowser">
<clobbers target="cordova.InAppBrowser.open" />
</js-module>
<js-module src="src/browser/InAppBrowserProxy.js" name="InAppBrowserProxy">
<runs />
</js-module>
</platform>
</plugin>
/*
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.
*/
package org.apache.cordova.inappbrowser;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import org.json.JSONException;
import org.json.JSONObject;
/**
* Created by Oliver on 22/11/2013.
*/
public class InAppBrowserDialog extends Dialog {
Context context;
InAppBrowser inAppBrowser = null;
public InAppBrowserDialog(Context context, int theme) {
super(context, theme);
this.context = context;
}
public void setInAppBroswer(InAppBrowser browser) {
this.inAppBrowser = browser;
}
public void onBackPressed () {
if (this.inAppBrowser == null) {
this.dismiss();
} else {
// better to go through the in inAppBrowser
// because it does a clean up
if (this.inAppBrowser.hardwareBack() && this.inAppBrowser.canGoBack()) {
this.inAppBrowser.goBack();
} else {
this.inAppBrowser.closeDialog();
}
}
}
}
/*
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.
*/
package org.apache.cordova.inappbrowser;
import org.apache.cordova.CordovaWebView;
import org.apache.cordova.LOG;
import org.apache.cordova.PluginResult;
import org.json.JSONArray;
import org.json.JSONException;
import android.webkit.JsPromptResult;
import android.webkit.WebChromeClient;
import android.webkit.WebStorage;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.webkit.GeolocationPermissions.Callback;
public class InAppChromeClient extends WebChromeClient {
private CordovaWebView webView;
private String LOG_TAG = "InAppChromeClient";
private long MAX_QUOTA = 100 * 1024 * 1024;
public InAppChromeClient(CordovaWebView webView) {
super();
this.webView = webView;
}
/**
* Handle database quota exceeded notification.
*
* @param url
* @param databaseIdentifier
* @param currentQuota
* @param estimatedSize
* @param totalUsedQuota
* @param quotaUpdater
*/
@Override
public void onExceededDatabaseQuota(String url, String databaseIdentifier, long currentQuota, long estimatedSize,
long totalUsedQuota, WebStorage.QuotaUpdater quotaUpdater)
{
LOG.d(LOG_TAG, "onExceededDatabaseQuota estimatedSize: %d currentQuota: %d totalUsedQuota: %d", estimatedSize, currentQuota, totalUsedQuota);
quotaUpdater.updateQuota(MAX_QUOTA);
}
/**
* Instructs the client to show a prompt to ask the user to set the Geolocation permission state for the specified origin.
*
* @param origin
* @param callback
*/
@Override
public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) {
super.onGeolocationPermissionsShowPrompt(origin, callback);
callback.invoke(origin, true, false);
}
/**
* Tell the client to display a prompt dialog to the user.
* If the client returns true, WebView will assume that the client will
* handle the prompt dialog and call the appropriate JsPromptResult method.
*
* The prompt bridge provided for the InAppBrowser is capable of executing any
* oustanding callback belonging to the InAppBrowser plugin. Care has been
* taken that other callbacks cannot be triggered, and that no other code
* execution is possible.
*
* To trigger the bridge, the prompt default value should be of the form:
*
* gap-iab://<callbackId>
*
* where <callbackId> is the string id of the callback to trigger (something
* like "InAppBrowser0123456789")
*
* If present, the prompt message is expected to be a JSON-encoded value to
* pass to the callback. A JSON_EXCEPTION is returned if the JSON is invalid.
*
* @param view
* @param url
* @param message
* @param defaultValue
* @param result
*/
@Override
public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result) {
// See if the prompt string uses the 'gap-iab' protocol. If so, the remainder should be the id of a callback to execute.
if (defaultValue != null && defaultValue.startsWith("gap")) {
if(defaultValue.startsWith("gap-iab://")) {
PluginResult scriptResult;
String scriptCallbackId = defaultValue.substring(10);
if (scriptCallbackId.matches("^InAppBrowser[0-9]{1,10}$")) {
if(message == null || message.length() == 0) {
scriptResult = new PluginResult(PluginResult.Status.OK, new JSONArray());
} else {
try {
scriptResult = new PluginResult(PluginResult.Status.OK, new JSONArray(message));
} catch(JSONException e) {
scriptResult = new PluginResult(PluginResult.Status.JSON_EXCEPTION, e.getMessage());
}
}
this.webView.sendPluginResult(scriptResult, scriptCallbackId);
result.confirm("");
return true;
}
else {
// Anything else that doesn't look like InAppBrowser0123456789 should end up here
LOG.w(LOG_TAG, "InAppBrowser callback called with invalid callbackId : "+ scriptCallbackId);
result.cancel();
return true;
}
}
else {
// Anything else with a gap: prefix should get this message
LOG.w(LOG_TAG, "InAppBrowser does not support Cordova API calls: " + url + " " + defaultValue);
result.cancel();
return true;
}
}
return false;
}
}
/*
*
* 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 modulemapper = require('cordova/modulemapper');
var browserWrap,
popup,
navigationButtonsDiv,
navigationButtonsDivInner,
backButton,
forwardButton,
closeButton;
function attachNavigationEvents (element, callback) {
var onError = function () {
try {
callback({ type: 'loaderror', url: this.contentWindow.location.href }, {keepCallback: true}); // eslint-disable-line standard/no-callback-literal
} catch (err) {
// blocked by CORS :\
callback({ type: 'loaderror', url: null }, {keepCallback: true}); // eslint-disable-line standard/no-callback-literal
}
};
element.addEventListener('pageshow', function () {
try {
callback({ type: 'loadstart', url: this.contentWindow.location.href }, {keepCallback: true}); // eslint-disable-line standard/no-callback-literal
} catch (err) {
// blocked by CORS :\
callback({ type: 'loadstart', url: null }, {keepCallback: true}); // eslint-disable-line standard/no-callback-literal
}
});
element.addEventListener('load', function () {
try {
callback({ type: 'loadstop', url: this.contentWindow.location.href }, {keepCallback: true}); // eslint-disable-line standard/no-callback-literal
} catch (err) {
// blocked by CORS :\
callback({ type: 'loadstop', url: null }, {keepCallback: true}); // eslint-disable-line standard/no-callback-literal
}
});
element.addEventListener('error', onError);
element.addEventListener('abort', onError);
}
var IAB = {
close: function (win, lose) {
if (browserWrap) {
// use the "open" function callback so that the exit event is fired properly
if (IAB._win) IAB._win({ type: 'exit' });
browserWrap.parentNode.removeChild(browserWrap);
browserWrap = null;
popup = null;
}
},
show: function (win, lose) {
if (browserWrap) {
browserWrap.style.display = 'block';
}
},
open: function (win, lose, args) {
var strUrl = args[0];
var target = args[1];
var features = args[2];
IAB._win = win;
if (target === '_self' || !target) {
window.location = strUrl;
} else if (target === '_system') {
modulemapper.getOriginalSymbol(window, 'window.open').call(window, strUrl, '_blank');
} else {
// "_blank" or anything else
if (!browserWrap) {
browserWrap = document.createElement('div');
browserWrap.style.position = 'absolute';
browserWrap.style.top = '0';
browserWrap.style.left = '0';
browserWrap.style.boxSizing = 'border-box';
browserWrap.style.borderWidth = '40px';
browserWrap.style.width = '100vw';
browserWrap.style.height = '100vh';
browserWrap.style.borderStyle = 'solid';
browserWrap.style.borderColor = 'rgba(0,0,0,0.25)';
browserWrap.onclick = function () {
setTimeout(function () {
IAB.close();
}, 0);
};
document.body.appendChild(browserWrap);
}
if (features.indexOf('hidden=yes') !== -1) {
browserWrap.style.display = 'none';
}
popup = document.createElement('iframe');
popup.style.borderWidth = '0px';
popup.style.width = '100%';
browserWrap.appendChild(popup);
if (features.indexOf('location=yes') !== -1 || features.indexOf('location') === -1) {
popup.style.height = 'calc(100% - 60px)';
popup.style.marginBottom = '-4px';
navigationButtonsDiv = document.createElement('div');
navigationButtonsDiv.style.height = '60px';
navigationButtonsDiv.style.backgroundColor = '#404040';
navigationButtonsDiv.style.zIndex = '999';
navigationButtonsDiv.onclick = function (e) {
e.cancelBubble = true;
};
navigationButtonsDivInner = document.createElement('div');
navigationButtonsDivInner.style.paddingTop = '10px';
navigationButtonsDivInner.style.height = '50px';
navigationButtonsDivInner.style.width = '160px';
navigationButtonsDivInner.style.margin = '0 auto';
navigationButtonsDivInner.style.backgroundColor = '#404040';
navigationButtonsDivInner.style.zIndex = '999';
navigationButtonsDivInner.onclick = function (e) {
e.cancelBubble = true;
};
backButton = document.createElement('button');
backButton.style.width = '40px';
backButton.style.height = '40px';
backButton.style.borderRadius = '40px';
backButton.innerHTML = '←';
backButton.addEventListener('click', function (e) {
if (popup.canGoBack) { popup.goBack(); }
});
forwardButton = document.createElement('button');
forwardButton.style.marginLeft = '20px';
forwardButton.style.width = '40px';
forwardButton.style.height = '40px';
forwardButton.style.borderRadius = '40px';
forwardButton.innerHTML = '→';
forwardButton.addEventListener('click', function (e) {
if (popup.canGoForward) { popup.goForward(); }
});
closeButton = document.createElement('button');
closeButton.style.marginLeft = '20px';
closeButton.style.width = '40px';
closeButton.style.height = '40px';
closeButton.style.borderRadius = '40px';
closeButton.innerHTML = '✖';
closeButton.addEventListener('click', function (e) {
setTimeout(function () {
IAB.close();
}, 0);
});
// iframe navigation is not yet supported
backButton.disabled = true;
forwardButton.disabled = true;
navigationButtonsDivInner.appendChild(backButton);
navigationButtonsDivInner.appendChild(forwardButton);
navigationButtonsDivInner.appendChild(closeButton);
navigationButtonsDiv.appendChild(navigationButtonsDivInner);
browserWrap.appendChild(navigationButtonsDiv);
} else {
popup.style.height = '100%';
}
// start listening for navigation events
attachNavigationEvents(popup, win);
popup.src = strUrl;
}
},
injectScriptCode: function (win, fail, args) {
var code = args[0];
var hasCallback = args[1];
if (browserWrap && popup) {
try {
popup.contentWindow.eval(code);
if (hasCallback) {
win([]);
}
} catch (e) {
console.error('Error occured while trying to injectScriptCode: ' + JSON.stringify(e));
}
}
},
injectScriptFile: function (win, fail, args) {
var msg = 'Browser cordova-plugin-inappbrowser injectScriptFile is not yet implemented';
console.warn(msg);
if (fail) {
fail(msg);
}
},
injectStyleCode: function (win, fail, args) {
var msg = 'Browser cordova-plugin-inappbrowser injectStyleCode is not yet implemented';
console.warn(msg);
if (fail) {
fail(msg);
}
},
injectStyleFile: function (win, fail, args) {
var msg = 'Browser cordova-plugin-inappbrowser injectStyleFile is not yet implemented';
console.warn(msg);
if (fail) {
fail(msg);
}
}
};
module.exports = IAB;
require('cordova/exec/proxy').add('InAppBrowser', module.exports);
/*
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.
*/
#import <Cordova/CDVScreenOrientationDelegate.h>
@interface CDVInAppBrowserNavigationController : UINavigationController
@property (nonatomic, weak) id <CDVScreenOrientationDelegate> orientationDelegate;
@end
/*
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.
*/
#import "CDVInAppBrowserNavigationController.h"
@implementation CDVInAppBrowserNavigationController : UINavigationController
- (void) dismissViewControllerAnimated:(BOOL)flag completion:(void (^)(void))completion {
if ( self.presentedViewController) {
[super dismissViewControllerAnimated:flag completion:completion];
}
}
- (void) viewDidLoad {
[super viewDidLoad];
}
- (CGRect) invertFrameIfNeeded:(CGRect)rect {
if (UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])) {
CGFloat temp = rect.size.width;
rect.size.width = rect.size.height;
rect.size.height = temp;
}
rect.origin = CGPointZero;
return rect;
}
#pragma mark CDVScreenOrientationDelegate
- (BOOL)shouldAutorotate
{
if ((self.orientationDelegate != nil) && [self.orientationDelegate respondsToSelector:@selector(shouldAutorotate)]) {
return [self.orientationDelegate shouldAutorotate];
}
return YES;
}
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
{
if ((self.orientationDelegate != nil) && [self.orientationDelegate respondsToSelector:@selector(supportedInterfaceOrientations)]) {
return [self.orientationDelegate supportedInterfaceOrientations];
}
return 1 << UIInterfaceOrientationPortrait;
}
@end
/*
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.
*/
@interface CDVInAppBrowserOptions : NSObject {}
@property (nonatomic, assign) BOOL location;
@property (nonatomic, assign) BOOL toolbar;
@property (nonatomic, copy) NSString* closebuttoncaption;
@property (nonatomic, copy) NSString* closebuttoncolor;
@property (nonatomic, assign) BOOL lefttoright;
@property (nonatomic, copy) NSString* toolbarposition;
@property (nonatomic, copy) NSString* toolbarcolor;
@property (nonatomic, assign) BOOL toolbartranslucent;
@property (nonatomic, assign) BOOL hidenavigationbuttons;
@property (nonatomic, copy) NSString* navigationbuttoncolor;
@property (nonatomic, assign) BOOL cleardata;
@property (nonatomic, assign) BOOL clearcache;
@property (nonatomic, assign) BOOL clearsessioncache;
@property (nonatomic, assign) BOOL hidespinner;
@property (nonatomic, copy) NSString* presentationstyle;
@property (nonatomic, copy) NSString* transitionstyle;
@property (nonatomic, assign) BOOL enableviewportscale;
@property (nonatomic, assign) BOOL mediaplaybackrequiresuseraction;
@property (nonatomic, assign) BOOL allowinlinemediaplayback;
@property (nonatomic, assign) BOOL hidden;
@property (nonatomic, assign) BOOL disallowoverscroll;
@property (nonatomic, copy) NSString* beforeload;
+ (CDVInAppBrowserOptions*)parseOptions:(NSString*)options;
@end
/*
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.
*/
#import "CDVInAppBrowserOptions.h"
@implementation CDVInAppBrowserOptions
- (id)init
{
if (self = [super init]) {
// default values
self.location = YES;
self.toolbar = YES;
self.closebuttoncaption = nil;
self.toolbarposition = @"bottom";
self.cleardata = NO;
self.clearcache = NO;
self.clearsessioncache = NO;
self.hidespinner = NO;
self.enableviewportscale = NO;
self.mediaplaybackrequiresuseraction = NO;
self.allowinlinemediaplayback = NO;
self.hidden = NO;
self.disallowoverscroll = NO;
self.hidenavigationbuttons = NO;
self.closebuttoncolor = nil;
self.lefttoright = false;
self.toolbarcolor = nil;
self.toolbartranslucent = YES;
self.beforeload = @"";
}
return self;
}
+ (CDVInAppBrowserOptions*)parseOptions:(NSString*)options
{
CDVInAppBrowserOptions* obj = [[CDVInAppBrowserOptions alloc] init];
// NOTE: this parsing does not handle quotes within values
NSArray* pairs = [options componentsSeparatedByString:@","];
// parse keys and values, set the properties
for (NSString* pair in pairs) {
NSArray* keyvalue = [pair componentsSeparatedByString:@"="];
if ([keyvalue count] == 2) {
NSString* key = [[keyvalue objectAtIndex:0] lowercaseString];
NSString* value = [keyvalue objectAtIndex:1];
NSString* value_lc = [value lowercaseString];
BOOL isBoolean = [value_lc isEqualToString:@"yes"] || [value_lc isEqualToString:@"no"];
NSNumberFormatter* numberFormatter = [[NSNumberFormatter alloc] init];
[numberFormatter setAllowsFloats:YES];
BOOL isNumber = [numberFormatter numberFromString:value_lc] != nil;
// set the property according to the key name
if ([obj respondsToSelector:NSSelectorFromString(key)]) {
if (isNumber) {
[obj setValue:[numberFormatter numberFromString:value_lc] forKey:key];
} else if (isBoolean) {
[obj setValue:[NSNumber numberWithBool:[value_lc isEqualToString:@"yes"]] forKey:key];
} else {
[obj setValue:value forKey:key];
}
}
}
}
return obj;
}
@end
/*
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.
*/
#import <Cordova/CDVPlugin.h>
#import <Cordova/CDVInvokedUrlCommand.h>
#import <Cordova/CDVScreenOrientationDelegate.h>
#import "CDVWKInAppBrowserUIDelegate.h"
#import "CDVInAppBrowserOptions.h"
#import "CDVInAppBrowserNavigationController.h"
@class CDVWKInAppBrowserViewController;
@interface CDVWKInAppBrowser : CDVPlugin {
UIWindow * tmpWindow;
@private
NSString* _beforeload;
BOOL _waitForBeforeload;
}
@property (nonatomic, retain) CDVWKInAppBrowser* instance;
@property (nonatomic, retain) CDVWKInAppBrowserViewController* inAppBrowserViewController;
@property (nonatomic, copy) NSString* callbackId;
@property (nonatomic, copy) NSRegularExpression *callbackIdPattern;
+ (id) getInstance;
- (void)open:(CDVInvokedUrlCommand*)command;
- (void)close:(CDVInvokedUrlCommand*)command;
- (void)injectScriptCode:(CDVInvokedUrlCommand*)command;
- (void)show:(CDVInvokedUrlCommand*)command;
- (void)hide:(CDVInvokedUrlCommand*)command;
- (void)loadAfterBeforeload:(CDVInvokedUrlCommand*)command;
@end
@interface CDVWKInAppBrowserViewController : UIViewController <CDVScreenOrientationDelegate,WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler>{
@private
CDVInAppBrowserOptions *_browserOptions;
NSDictionary *_settings;
}
@property (nonatomic, strong) IBOutlet WKWebView* webView;
@property (nonatomic, strong) IBOutlet WKWebViewConfiguration* configuration;
@property (nonatomic, strong) IBOutlet UIBarButtonItem* closeButton;
@property (nonatomic, strong) IBOutlet UILabel* addressLabel;
@property (nonatomic, strong) IBOutlet UIBarButtonItem* backButton;
@property (nonatomic, strong) IBOutlet UIBarButtonItem* forwardButton;
@property (nonatomic, strong) IBOutlet UIActivityIndicatorView* spinner;
@property (nonatomic, strong) IBOutlet UIToolbar* toolbar;
@property (nonatomic, strong) IBOutlet CDVWKInAppBrowserUIDelegate* webViewUIDelegate;
@property (nonatomic, weak) id <CDVScreenOrientationDelegate> orientationDelegate;
@property (nonatomic, weak) CDVWKInAppBrowser* navigationDelegate;
@property (nonatomic) NSURL* currentURL;
- (void)close;
- (void)navigateTo:(NSURL*)url;
- (void)showLocationBar:(BOOL)show;
- (void)showToolBar:(BOOL)show : (NSString *) toolbarPosition;
- (void)setCloseButtonTitle:(NSString*)title : (NSString*) colorString : (int) buttonIndex;
- (id)initWithBrowserOptions: (CDVInAppBrowserOptions*) browserOptions andSettings:(NSDictionary*) settings;
@end
/*
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.
*/
#import <WebKit/WebKit.h>
@interface CDVWKInAppBrowserUIDelegate : NSObject <WKUIDelegate>{
@private
UIViewController* _viewController;
}
@property (nonatomic, copy) NSString* title;
- (instancetype)initWithTitle:(NSString*)title;
-(void) setViewController:(UIViewController*) viewController;
@end
/*
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.
*/
#import "CDVWKInAppBrowserUIDelegate.h"
@implementation CDVWKInAppBrowserUIDelegate
- (instancetype)initWithTitle:(NSString*)title
{
self = [super init];
if (self) {
self.title = title;
}
return self;
}
- (void) webView:(WKWebView*)webView runJavaScriptAlertPanelWithMessage:(NSString*)message
initiatedByFrame:(WKFrameInfo*)frame completionHandler:(void (^)(void))completionHandler
{
UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
message:message
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
style:UIAlertActionStyleDefault
handler:^(UIAlertAction* action)
{
completionHandler();
[alert dismissViewControllerAnimated:YES completion:nil];
}];
[alert addAction:ok];
[[self getViewController] presentViewController:alert animated:YES completion:nil];
}
- (void) webView:(WKWebView*)webView runJavaScriptConfirmPanelWithMessage:(NSString*)message
initiatedByFrame:(WKFrameInfo*)frame completionHandler:(void (^)(BOOL result))completionHandler
{
UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
message:message
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
style:UIAlertActionStyleDefault
handler:^(UIAlertAction* action)
{
completionHandler(YES);
[alert dismissViewControllerAnimated:YES completion:nil];
}];
[alert addAction:ok];
UIAlertAction* cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel")
style:UIAlertActionStyleDefault
handler:^(UIAlertAction* action)
{
completionHandler(NO);
[alert dismissViewControllerAnimated:YES completion:nil];
}];
[alert addAction:cancel];
[[self getViewController] presentViewController:alert animated:YES completion:nil];
}
- (void) webView:(WKWebView*)webView runJavaScriptTextInputPanelWithPrompt:(NSString*)prompt
defaultText:(NSString*)defaultText initiatedByFrame:(WKFrameInfo*)frame
completionHandler:(void (^)(NSString* result))completionHandler
{
UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
message:prompt
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
style:UIAlertActionStyleDefault
handler:^(UIAlertAction* action)
{
completionHandler(((UITextField*)alert.textFields[0]).text);
[alert dismissViewControllerAnimated:YES completion:nil];
}];
[alert addAction:ok];
UIAlertAction* cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel")
style:UIAlertActionStyleDefault
handler:^(UIAlertAction* action)
{
completionHandler(nil);
[alert dismissViewControllerAnimated:YES completion:nil];
}];
[alert addAction:cancel];
[alert addTextFieldWithConfigurationHandler:^(UITextField* textField) {
textField.text = defaultText;
}];
[[self getViewController] presentViewController:alert animated:YES completion:nil];
}
-(UIViewController*) getViewController
{
return _viewController;
}
-(void) setViewController:(UIViewController*) viewController
{
_viewController = viewController;
}
@end
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -318,6 +318,7 @@ export default {
vm.$refs.scroll.update(false)
}
vm.showLists = vm.submitLists
vm.allChoose(false)
} else {
hlsPopup.showLongCenter(res.message)
......
......@@ -2,8 +2,8 @@
<h-view id="contract-details" class="public-style">
<h-header :proportion="[5, 1, 1]" class="bar-custom">
<div slot="left" class="h-header-btn" @click="$routeGo()">
<img src="@/assets/userBind/arrow.png" >
<div slot="left" class="h-header-btn">
<img src="@/assets/userBind/arrow.png" @click="$routeGo()">
<span>融租申请审批明细</span>
</div>
</h-header>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment