From 2480f8d237102b2b1bd9a3962ab85ebfeb13a901 Mon Sep 17 00:00:00 2001 From: Pawel Andruszkiewicz Date: Thu, 7 Apr 2016 13:47:38 +0200 Subject: [PATCH] [Dialog] Code structure changed to match cordova architecture. Change-Id: Ia862a78e1508b61d7a9cbb117a6bebc3004e0da7 Signed-off-by: Pawel Andruszkiewicz --- src/cordova-api.gyp | 1 - src/dialog/cordova_dialog.gyp | 25 ------------ src/dialog/cordova_dialog_extension.cc | 39 ------------------- src/dialog/cordova_dialog_extension.h | 36 ----------------- src/lib/cordova_plugins.js | 5 +++ .../tizen/Notification.js} | 4 -- 6 files changed, 5 insertions(+), 105 deletions(-) delete mode 100644 src/dialog/cordova_dialog.gyp delete mode 100755 src/dialog/cordova_dialog_extension.cc delete mode 100755 src/dialog/cordova_dialog_extension.h rename src/{dialog/cordova_dialog_api.js => lib/plugins/cordova-plugin-dialogs/tizen/Notification.js} (98%) diff --git a/src/cordova-api.gyp b/src/cordova-api.gyp index 9741543..21eb766 100644 --- a/src/cordova-api.gyp +++ b/src/cordova-api.gyp @@ -9,7 +9,6 @@ 'type': 'none', 'dependencies': [ 'cordova/cordova.gyp:*', - 'dialog/cordova_dialog.gyp:*', 'events/cordova_events.gyp:*', 'file/cordova_file.gyp:*', 'globalization/cordova_globalization.gyp:*', diff --git a/src/dialog/cordova_dialog.gyp b/src/dialog/cordova_dialog.gyp deleted file mode 100644 index 8f13ec3..0000000 --- a/src/dialog/cordova_dialog.gyp +++ /dev/null @@ -1,25 +0,0 @@ -{ - 'includes':[ - '/usr/include/webapi-plugins/src/common/common.gypi', - ], - 'targets': [ - { - 'target_name': 'tizen_cordova_dialog', - 'type': 'loadable_module', - 'sources': [ - 'cordova_dialog_api.js', - 'cordova_dialog_extension.cc', - 'cordova_dialog_extension.h', - ], - 'include_dirs': [ - '../', - '<(SHARED_INTERMEDIATE_DIR)', - ], - 'variables': { - 'packages': [ - 'webapi-plugins', - ], - }, - }, - ], -} diff --git a/src/dialog/cordova_dialog_extension.cc b/src/dialog/cordova_dialog_extension.cc deleted file mode 100755 index a375d3a..0000000 --- a/src/dialog/cordova_dialog_extension.cc +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved - * - * 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. - */ - -#include "dialog/cordova_dialog_extension.h" - -// This will be generated from cordova_dialog_api.js -extern const char kSource_cordova_dialog_api[]; - -common::Extension* CreateExtension() { - return new extension::cordova::dialog::CordovaDialogExtension(); -} - -namespace extension { -namespace cordova { -namespace dialog { - -CordovaDialogExtension::CordovaDialogExtension() { - SetExtensionName("tizen.cordova.dialog"); - SetJavaScriptAPI(kSource_cordova_dialog_api); -} - -CordovaDialogExtension::~CordovaDialogExtension() {} - -} // dialog -} // cordova -} // extension diff --git a/src/dialog/cordova_dialog_extension.h b/src/dialog/cordova_dialog_extension.h deleted file mode 100755 index 613653b..0000000 --- a/src/dialog/cordova_dialog_extension.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved - * - * 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. - */ - -#ifndef DIALOG_CORDOVA_DIALOG_EXTENSION_H_ -#define DIALOG_CORDOVA_DIALOG_EXTENSION_H_ - -#include - -namespace extension { -namespace cordova { -namespace dialog { - -class CordovaDialogExtension : public common::Extension { - public: - CordovaDialogExtension(); - virtual ~CordovaDialogExtension(); -}; - -} // dialog -} // cordova -} // extension - -#endif // DIALOG_CORDOVA_DIALOG_EXTENSION_H_ diff --git a/src/lib/cordova_plugins.js b/src/lib/cordova_plugins.js index 7c2cb1d..c2ef0cf 100644 --- a/src/lib/cordova_plugins.js +++ b/src/lib/cordova_plugins.js @@ -52,6 +52,11 @@ module.exports = [ "navigator.notification" ] }, + { + "file": "plugins/cordova-plugin-dialogs/tizen/Notification.js", + "id": "cordova-plugin-dialogs.tizen.Notification", + "runs": true + }, { "file": "plugins/cordova-plugin-events/www/register.js", "id": "cordova-plugin-events.register", diff --git a/src/dialog/cordova_dialog_api.js b/src/lib/plugins/cordova-plugin-dialogs/tizen/Notification.js similarity index 98% rename from src/dialog/cordova_dialog_api.js rename to src/lib/plugins/cordova-plugin-dialogs/tizen/Notification.js index 67fc46f..044e5df 100755 --- a/src/dialog/cordova_dialog_api.js +++ b/src/lib/plugins/cordova-plugin-dialogs/tizen/Notification.js @@ -355,8 +355,4 @@ console.log('Loaded cordova.dialog API'); // TODO: remove when added to public cordova repository -> begin }); - -exports = function(require) { - require('cordova-tizen').addPlugin('cordova-plugin-dialogs.notification', plugin_name, 'runs'); -}; // TODO: remove -> end -- 2.34.1