mirror of
https://gitee.com/shuto/customCamera.git
synced 2026-05-02 00:07:24 +08:00
Changement du nom du plugin customCamera en GeneanetCustomCamera.
This commit is contained in:
+3
-3
@@ -5,12 +5,12 @@
|
||||
id="org.geneanet.customCamera"
|
||||
version="0.0.1"
|
||||
>
|
||||
<name>customCamera</name>
|
||||
<name>GeneanetCustomCamera</name>
|
||||
<description>customCamera by Geneanet</description>
|
||||
<license>undefined</license>
|
||||
<keywords>custom,camera,geneanet</keywords>
|
||||
<js-module src="www/customCamera.js" name="customCamera">
|
||||
<clobbers target="customCamera" />
|
||||
<js-module src="www/customCamera.js" name="GeneanetCustomCamera">
|
||||
<clobbers target="GeneanetCustomCamera" />
|
||||
</js-module>
|
||||
|
||||
<hook type="after_plugin_install" src="hooks/after_plugin_install/npminstall.js" />
|
||||
|
||||
+46
-45
@@ -1,54 +1,55 @@
|
||||
"use strict";
|
||||
|
||||
// Get cordova plugin.
|
||||
var exec = require("cordova/exec");
|
||||
(function(require, module) {
|
||||
// Get cordova plugin.
|
||||
var exec = require("cordova/exec");
|
||||
|
||||
// constructor.
|
||||
var customCameraExport = function() {
|
||||
};
|
||||
// constructor.
|
||||
function CustomCameraExport() {}
|
||||
|
||||
/**
|
||||
* Start custom camera.
|
||||
*
|
||||
* @param {object} options Options to plugin.
|
||||
* @param {function} successFct Callback function to success action.
|
||||
* @param {function} failFct Callback function to fail action.
|
||||
*/
|
||||
customCameraExport.prototype.startCamera = function(options, successFct, failFct) {
|
||||
var defaultOptions = {
|
||||
imgBackgroundBase64: null, // background picture in base64.
|
||||
miniature: true, // active or disable the miniature function.
|
||||
cameraBackgroundColor: "#e26760", // color of the camera button.
|
||||
cameraBackgroundColorPressed: "#dc453d" // color of the pressed camera button.
|
||||
// To get supported color formats, go to see method parseColor : http://developer.android.com/reference/android/graphics/Color.html#parseColor(java.lang.String)
|
||||
};
|
||||
/**
|
||||
* Start custom camera.
|
||||
*
|
||||
* @param {object} options Options to plugin.
|
||||
* @param {function} successFct Callback function to success action.
|
||||
* @param {function} failFct Callback function to fail action.
|
||||
*/
|
||||
CustomCameraExport.prototype.startCamera = function(options, successFct, failFct) {
|
||||
var defaultOptions = {
|
||||
imgBackgroundBase64: null, // background picture in base64.
|
||||
miniature: true, // active or disable the miniature function.
|
||||
cameraBackgroundColor: "#e26760", // color of the camera button.
|
||||
cameraBackgroundColorPressed: "#dc453d" // color of the pressed camera button.
|
||||
// To get supported color formats, go to see method parseColor : http://developer.android.com/reference/android/graphics/Color.html#parseColor(java.lang.String)
|
||||
};
|
||||
|
||||
for (var nameOption in defaultOptions) {
|
||||
if (options[nameOption] === undefined) {
|
||||
options[nameOption] = defaultOptions[nameOption];
|
||||
for (var nameOption in defaultOptions) {
|
||||
if (options[nameOption] === undefined) {
|
||||
options[nameOption] = defaultOptions[nameOption];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var successFctCallback = function(data) {
|
||||
successFct(data);
|
||||
var successFctCallback = function(data) {
|
||||
successFct(data);
|
||||
};
|
||||
|
||||
var failFctCallback = function(data) {
|
||||
failFct(data.code, data.message);
|
||||
};
|
||||
|
||||
exec(
|
||||
successFctCallback,
|
||||
failFctCallback,
|
||||
"CustomCamera",
|
||||
"startCamera",
|
||||
[
|
||||
options.imgBackgroundBase64,
|
||||
options.miniature,
|
||||
options.cameraBackgroundColor,
|
||||
options.cameraBackgroundColorPressed
|
||||
]
|
||||
);
|
||||
};
|
||||
|
||||
var failFctCallback = function(data) {
|
||||
failFct(data.code, data.message);
|
||||
};
|
||||
|
||||
exec(
|
||||
successFctCallback,
|
||||
failFctCallback,
|
||||
"CustomCamera",
|
||||
"startCamera",
|
||||
[
|
||||
options.imgBackgroundBase64,
|
||||
options.miniature,
|
||||
options.cameraBackgroundColor,
|
||||
options.cameraBackgroundColorPressed
|
||||
]
|
||||
);
|
||||
};
|
||||
|
||||
module.exports = new customCameraExport();
|
||||
module.exports = new CustomCameraExport();
|
||||
})(require, module);
|
||||
Reference in New Issue
Block a user