You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2012/02/24 21:52:11 UTC
[19/26] qt commit: More on renaming from phonegap to cordova
More on renaming from phonegap to cordova
Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/commit/069265f0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/tree/069265f0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/diff/069265f0
Branch: refs/heads/master
Commit: 069265f01ff6ac6e2ce90184c4f377f96414e0ab
Parents: 343a2c7
Author: Denis Kormalev <dk...@ics.com>
Authored: Thu Feb 16 15:36:08 2012 +0400
Committer: Denis Kormalev <dk...@ics.com>
Committed: Thu Feb 16 15:36:08 2012 +0400
----------------------------------------------------------------------
mainwindow.cpp | 2 +-
mainwindow.ui | 2 +-
src/cordova.cpp | 4 +-
src/cplugin.cpp | 4 +-
src/plugins/compass.cpp | 2 +-
src/plugins/connection.cpp | 2 +-
src/plugins/console.cpp | 2 +-
src/plugins/device.cpp | 8 ++--
src/plugins/fileapi.cpp | 2 +-
src/plugins/geolocation.cpp | 2 +-
src/plugins/notification.cpp | 2 +-
www/index.html | 2 +-
www/index_qt5.html | 2 +-
www/js/compass.js | 6 +-
www/js/connection.js | 6 +-
www/js/console.js | 4 +-
www/js/cordova.js | 108 ++++++++++++++++++------------------
www/js/cordova.qt.js | 30 +++++-----
www/js/cordova.qt5.js | 14 +++---
www/js/device.js | 10 ++--
www/js/file.js | 38 +++++++-------
www/js/geolocation.js | 6 +-
www/js/notification.js | 6 +-
xml/plugins.xml | 34 ++++++------
24 files changed, 149 insertions(+), 149 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/069265f0/mainwindow.cpp
----------------------------------------------------------------------
diff --git a/mainwindow.cpp b/mainwindow.cpp
index f9b04ad..7fa51d8 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -125,7 +125,7 @@ void MainWindow::onPluginWantsToBeAdded(const QString &pluginName, QObject *plug
{
QString objectName = pluginShortName + "_native";
ui->webView->page()->mainFrame()->addToJavaScriptWindowObject( objectName, pluginObject );
- ui->webView->page()->mainFrame()->evaluateJavaScript( "PhoneGap.Qt.registerObject( '" + pluginName + "', " + objectName + " )" );
+ ui->webView->page()->mainFrame()->evaluateJavaScript( "Cordova.Qt.registerObject( '" + pluginName + "', " + objectName + " )" );
}
void MainWindow::onWebViewAttributeChanged(QWebSettings::WebAttribute attribute, bool on)
http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/069265f0/mainwindow.ui
----------------------------------------------------------------------
diff --git a/mainwindow.ui b/mainwindow.ui
index 4b947bc..27ae243 100644
--- a/mainwindow.ui
+++ b/mainwindow.ui
@@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
- <string>PhoneGap</string>
+ <string>Cordova</string>
</property>
<widget class="QWidget" name="centralWidget">
<layout class="QGridLayout" name="mainLayout">
http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/069265f0/src/cordova.cpp
----------------------------------------------------------------------
diff --git a/src/cordova.cpp b/src/cordova.cpp
index cbdf740..b33e5cf 100644
--- a/src/cordova.cpp
+++ b/src/cordova.cpp
@@ -84,7 +84,7 @@ void Cordova::loadFinished( bool ok ) {
if(currPlugin) {
currPlugin->init();
emit pluginWantsToBeAdded(attribValue, currPlugin, attribName);
- execJS( "PhoneGap.enablePlugin( '" + attribValue + "' )" );
+ execJS( "Cordova.enablePlugin( '" + attribValue + "' )" );
}
else {
qDebug() << "Unknown Plugin " << attribName;
@@ -95,7 +95,7 @@ void Cordova::loadFinished( bool ok ) {
}
// Device is now ready to rumble
- execJS( "PhoneGap.deviceready();" );
+ execJS( "Cordova.deviceready();" );
}
void Cordova::execJS(const QString &js)
http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/069265f0/src/cplugin.cpp
----------------------------------------------------------------------
diff --git a/src/cplugin.cpp b/src/cplugin.cpp
index ea29e66..e109260 100644
--- a/src/cplugin.cpp
+++ b/src/cplugin.cpp
@@ -36,10 +36,10 @@ void CPlugin::callback( int p_callbackId, QString p_jsParameters ) {
QString javascript;
if( p_jsParameters.length() > 0 ) {
- javascript = "PhoneGap.callback( " + QString::number( p_callbackId ) + ", " + p_jsParameters + " );";
+ javascript = "Cordova.callback( " + QString::number( p_callbackId ) + ", " + p_jsParameters + " );";
}
else {
- javascript = "PhoneGap.callback( " + QString::number( p_callbackId ) + " );";
+ javascript = "Cordova.callback( " + QString::number( p_callbackId ) + " );";
}
qDebug() << "Running: " << javascript;
http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/069265f0/src/plugins/compass.cpp
----------------------------------------------------------------------
diff --git a/src/plugins/compass.cpp b/src/plugins/compass.cpp
index 676cb68..53ef9e7 100644
--- a/src/plugins/compass.cpp
+++ b/src/plugins/compass.cpp
@@ -23,7 +23,7 @@ Compass* Compass::m_compass = new Compass();
Compass::Compass() :CPlugin()
{
- PluginRegistry::getRegistry()->registerPlugin( "com.phonegap.Compass", this );
+ PluginRegistry::getRegistry()->registerPlugin( "com.cordova.Compass", this );
}
void Compass::init() {
http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/069265f0/src/plugins/connection.cpp
----------------------------------------------------------------------
diff --git a/src/plugins/connection.cpp b/src/plugins/connection.cpp
index b305d21..7892a8f 100644
--- a/src/plugins/connection.cpp
+++ b/src/plugins/connection.cpp
@@ -27,7 +27,7 @@ Connection *Connection::m_connection = new Connection();
* Constructor - NOTE: Never do anything except registering the plugin
*/
Connection::Connection() : CPlugin() {
- PluginRegistry::getRegistry()->registerPlugin( "com.phonegap.Connection", this );
+ PluginRegistry::getRegistry()->registerPlugin( "com.cordova.Connection", this );
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/069265f0/src/plugins/console.cpp
----------------------------------------------------------------------
diff --git a/src/plugins/console.cpp b/src/plugins/console.cpp
index c11dbde..cdac8c0 100644
--- a/src/plugins/console.cpp
+++ b/src/plugins/console.cpp
@@ -27,7 +27,7 @@ Console *Console::m_console = new Console();
* Constructor - NOTE: Never do anything except registering the plugin
*/
Console::Console() : CPlugin() {
- PluginRegistry::getRegistry()->registerPlugin( "com.phonegap.Console", this );
+ PluginRegistry::getRegistry()->registerPlugin( "com.cordova.Console", this );
}
void Console::log( int scId, int ecId, QString p_message ) {
http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/069265f0/src/plugins/device.cpp
----------------------------------------------------------------------
diff --git a/src/plugins/device.cpp b/src/plugins/device.cpp
index 4e8f41a..9ceea93 100644
--- a/src/plugins/device.cpp
+++ b/src/plugins/device.cpp
@@ -28,7 +28,7 @@
#include <QDebug>
-#define PHONEGAP "1.3.0"
+#define CORDOVA "1.3.0"
#ifdef QTM_NAMESPACE
QTM_USE_NAMESPACE
@@ -41,7 +41,7 @@ Device* Device::m_device = new Device();
* Constructor - NOTE: Never do anything except registering the plugin
*/
Device::Device() : CPlugin() {
- PluginRegistry::getRegistry()->registerPlugin( "com.phonegap.Device", this );
+ PluginRegistry::getRegistry()->registerPlugin( "com.cordova.Device", this );
}
/**
@@ -72,8 +72,8 @@ void Device::getInfo( int scId, int ecId ) {
#endif
#if QT_VERSION < 0x050000
- this->callback( scId, "'" + systemDeviceInfo->model() + "', '" + PHONEGAP + "', '" + platform + "', '" + systemDeviceInfo->uniqueDeviceID() + "', '" + systemInfo->version( QSystemInfo::Os ) + "'" );
+ this->callback( scId, "'" + systemDeviceInfo->model() + "', '" + CORDOVA + "', '" + platform + "', '" + systemDeviceInfo->uniqueDeviceID() + "', '" + systemInfo->version( QSystemInfo::Os ) + "'" );
#else
- this->callback( scId, "'" + systemDeviceInfo->model() + "', '" + PHONEGAP + "', '" + platform + "', '" + systemDeviceInfo->uniqueDeviceID() + "', '" + systemInfo->version( QDeviceInfo::Os ) + "'" );
+ this->callback( scId, "'" + systemDeviceInfo->model() + "', '" + CORDOVA + "', '" + platform + "', '" + systemDeviceInfo->uniqueDeviceID() + "', '" + systemInfo->version( QDeviceInfo::Os ) + "'" );
#endif
}
http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/069265f0/src/plugins/fileapi.cpp
----------------------------------------------------------------------
diff --git a/src/plugins/fileapi.cpp b/src/plugins/fileapi.cpp
index 80dd3a4..9c5f8af 100644
--- a/src/plugins/fileapi.cpp
+++ b/src/plugins/fileapi.cpp
@@ -31,7 +31,7 @@ FileAPI* FileAPI::m_fileAPI = new FileAPI();
* Constructor - NOTE: Never do anything except registering the plugin
*/
FileAPI::FileAPI() : CPlugin() {
- PluginRegistry::getRegistry()->registerPlugin( "com.phonegap.File", this );
+ PluginRegistry::getRegistry()->registerPlugin( "com.cordova.File", this );
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/069265f0/src/plugins/geolocation.cpp
----------------------------------------------------------------------
diff --git a/src/plugins/geolocation.cpp b/src/plugins/geolocation.cpp
index 59b5352..da701cb 100644
--- a/src/plugins/geolocation.cpp
+++ b/src/plugins/geolocation.cpp
@@ -27,7 +27,7 @@ Geolocation* Geolocation::m_geolocation = new Geolocation();
* Constructor - NOTE: Never do anything except registering the plugin
*/
Geolocation::Geolocation() : CPlugin() {
- PluginRegistry::getRegistry()->registerPlugin( "com.phonegap.Geolocation", this );
+ PluginRegistry::getRegistry()->registerPlugin( "com.cordova.Geolocation", this );
}
void Geolocation::init() {
http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/069265f0/src/plugins/notification.cpp
----------------------------------------------------------------------
diff --git a/src/plugins/notification.cpp b/src/plugins/notification.cpp
index 12581fc..ef3d855 100644
--- a/src/plugins/notification.cpp
+++ b/src/plugins/notification.cpp
@@ -32,7 +32,7 @@ Notification* Notification::m_notification = new Notification();
* Constructor - NOTE: Never do anything except registering the plugin
*/
Notification::Notification() : CPlugin(){
- PluginRegistry::getRegistry()->registerPlugin( "com.phonegap.Notification", this );
+ PluginRegistry::getRegistry()->registerPlugin( "com.cordova.Notification", this );
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/069265f0/www/index.html
----------------------------------------------------------------------
diff --git a/www/index.html b/www/index.html
index 0866b96..3910318 100644
--- a/www/index.html
+++ b/www/index.html
@@ -2,7 +2,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title>Callback-Qt Test Page</title>
+ <title>Cordova-Qt Test Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script language="javascript" type="text/javascript" src="js/cordova.js"></script>
<script language="javascript" type="text/javascript" src="js/cordova.qt.js"></script>
http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/069265f0/www/index_qt5.html
----------------------------------------------------------------------
diff --git a/www/index_qt5.html b/www/index_qt5.html
index a40b336..0d1c271 100644
--- a/www/index_qt5.html
+++ b/www/index_qt5.html
@@ -2,7 +2,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title>PhoneGap-Qt Test Page</title>
+ <title>Cordova-Qt5 Test Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script language="javascript" type="text/javascript" src="js/cordova.js"></script>
<script language="javascript" type="text/javascript" src="js/cordova.qt5.js"></script>
http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/069265f0/www/js/compass.js
----------------------------------------------------------------------
diff --git a/www/js/compass.js b/www/js/compass.js
index f6a957c..4e9db83 100644
--- a/www/js/compass.js
+++ b/www/js/compass.js
@@ -85,11 +85,11 @@ Compass.prototype.getCurrentHeading = function( successCallback, errorCallback,
// Call the native function and query for a new heading
var me = this;
- PhoneGap.exec( function( p_heading ) {
+ Cordova.exec( function( p_heading ) {
received = true;
me.cachedHeading = p_heading;
successCallback( p_heading );
- }, errorCallback, "com.phonegap.Compass", "getCurrentHeading", [ headingOptions ] );
+ }, errorCallback, "com.cordova.Compass", "getCurrentHeading", [ headingOptions ] );
};
Compass.prototype.watchHeading = function( successCallback, errorCallback, options ) {
@@ -129,5 +129,5 @@ Compass.prototype.clearWatch = function( watchId ) {
/**
* Add the compass object to the navigator
*/
-PhoneGap.addConstructor( "com.phonegap.Compass", function () {
+Cordova.addConstructor( "com.cordova.Compass", function () {
navigator.compass = new Compass();} );
http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/069265f0/www/js/connection.js
----------------------------------------------------------------------
diff --git a/www/js/connection.js b/www/js/connection.js
index b0e750e..0f6ca7e 100644
--- a/www/js/connection.js
+++ b/www/js/connection.js
@@ -34,7 +34,7 @@ Connection.prototype.setChangeCallback = function() {
console.log( "connection - setChangeCallback" );
- PhoneGap.exec( function( p_type ) {
+ Cordova.exec( function( p_type ) {
// Save new type
me.type = p_type;
@@ -42,10 +42,10 @@ Connection.prototype.setChangeCallback = function() {
// Register new callback instance in order to receive future updates
setTimeout( navigator.network.connection.setChangeCallback, 100 );
- }, null, "com.phonegap.Connection", "setChangeCallback", [] );
+ }, null, "com.cordova.Connection", "setChangeCallback", [] );
}
-PhoneGap.addConstructor( "com.phonegap.Connection", function() {
+Cordova.addConstructor( "com.cordova.Connection", function() {
if( typeof navigator.network === "undefined" ) navigator.network = {};
navigator.network.connection = new Connection();
http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/069265f0/www/js/console.js
----------------------------------------------------------------------
diff --git a/www/js/console.js b/www/js/console.js
index 0a6c320..b2ca5cc 100644
--- a/www/js/console.js
+++ b/www/js/console.js
@@ -18,9 +18,9 @@ function Console() {
}
Console.prototype.log = function( p_message ) {
- PhoneGap.exec( null, null, "com.phonegap.Console", "log", [p_message] );
+ Cordova.exec( null, null, "com.cordova.Console", "log", [p_message] );
}
-PhoneGap.addConstructor( "com.phonegap.Console", function() {
+Cordova.addConstructor( "com.cordova.Console", function() {
window.console = new Console();
} );
http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/069265f0/www/js/cordova.js
----------------------------------------------------------------------
diff --git a/www/js/cordova.js b/www/js/cordova.js
index 8f07c1b..7e7f1ab 100644
--- a/www/js/cordova.js
+++ b/www/js/cordova.js
@@ -14,16 +14,16 @@
* limitations under the License.
*/
-PhoneGap = {
+Cordova = {
plugins: {},
constructors: {},
callbacks: [],
};
/*
- * Execute a callback function & remove it from the PhoneGap object
+ * Execute a callback function & remove it from the Cordova object
*/
-PhoneGap.callback = function() {
+Cordova.callback = function() {
var scId = arguments[0];
var callbackRef = null;
@@ -33,58 +33,58 @@ PhoneGap.callback = function() {
parameters[i-1] = arguments[i];
}
// Keep reference to callback
- callbackRef = PhoneGap.callbacks[scId];
+ callbackRef = Cordova.callbacks[scId];
// Even IDs are success-, odd are error-callbacks - make sure we remove both
if( (scId % 2) !== 0 ) {
scId = scId - 1;
}
// Remove both the success as well as the error callback from the stack
- PhoneGap.callbacks.splice( scId, 2 );
+ Cordova.callbacks.splice( scId, 2 );
// Finally run the callback
if( typeof callbackRef == "function" ) callbackRef.apply( this, parameters );
};
/*
- * Enable a plugin for use within PhoneGap
+ * Enable a plugin for use within Cordova
*/
-PhoneGap.enablePlugin = function( pluginName ) {
+Cordova.enablePlugin = function( pluginName ) {
// Enable the plugin
- PhoneGap.plugins[pluginName] = true;
+ Cordova.plugins[pluginName] = true;
// Run constructor for plugin if available
- if( typeof PhoneGap.constructors[pluginName] == "function" ) PhoneGap.constructors[pluginName]();
+ if( typeof Cordova.constructors[pluginName] == "function" ) Cordova.constructors[pluginName]();
}
/*
* Add a plugin-specific constructor function which is called once the plugin is loaded
*/
-PhoneGap.addConstructor = function( pluginName, constructor ) {
- PhoneGap.constructors[pluginName] = constructor;
+Cordova.addConstructor = function( pluginName, constructor ) {
+ Cordova.constructors[pluginName] = constructor;
}
/**
* Event interface - http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-Event
*/
-PhoneGap.Event = function() {
+Cordova.Event = function() {
};
-PhoneGap.Event.CAPTURING_PHASE = 1;
-PhoneGap.Event.AT_TARGET = 2;
-PhoneGap.Event.BUBBLING_PHASE = 3;
-
-PhoneGap.Event.prototype.type = "unknown";
-PhoneGap.Event.prototype.target = PhoneGap;
-PhoneGap.Event.prototype.currentTarget = PhoneGap;
-PhoneGap.Event.prototype.eventPhase = PhoneGap.Event.AT_TARGET;
-PhoneGap.Event.prototype.bubbles = false;
-PhoneGap.Event.prototype.cancelable = false;
-PhoneGap.Event.prototype.timeStamp = 0;
-
-PhoneGap.Event.prototype.stopPropagation = function() {};
-PhoneGap.Event.prototype.preventDefault = function() {};
-PhoneGap.Event.prototype.initEvent = function( eventTypeArg, canBubbleArg, cancelableArg ) {
+Cordova.Event.CAPTURING_PHASE = 1;
+Cordova.Event.AT_TARGET = 2;
+Cordova.Event.BUBBLING_PHASE = 3;
+
+Cordova.Event.prototype.type = "unknown";
+Cordova.Event.prototype.target = Cordova;
+Cordova.Event.prototype.currentTarget = Cordova;
+Cordova.Event.prototype.eventPhase = Cordova.Event.AT_TARGET;
+Cordova.Event.prototype.bubbles = false;
+Cordova.Event.prototype.cancelable = false;
+Cordova.Event.prototype.timeStamp = 0;
+
+Cordova.Event.prototype.stopPropagation = function() {};
+Cordova.Event.prototype.preventDefault = function() {};
+Cordova.Event.prototype.initEvent = function( eventTypeArg, canBubbleArg, cancelableArg ) {
this.type = eventTypeArg;
this.timeStamp = (new Date()).getMilliseconds();
};
@@ -93,13 +93,13 @@ PhoneGap.Event.prototype.initEvent = function( eventTypeArg, canBubbleArg, cance
* EventHandler interface - handles one type of event
* Not W3C defined, but required in order to handle our custom events
*/
-PhoneGap.EventHandler = function( p_type ) {
+Cordova.EventHandler = function( p_type ) {
this.type = p_type;
}
-PhoneGap.EventHandler.prototype.type = "unknown";
-PhoneGap.EventHandler.prototype.listeners = [];
-PhoneGap.EventHandler.prototype.addEventListener = function( p_listener, p_capture ) {
+Cordova.EventHandler.prototype.type = "unknown";
+Cordova.EventHandler.prototype.listeners = [];
+Cordova.EventHandler.prototype.addEventListener = function( p_listener, p_capture ) {
if( p_capture ) {
this.listeners.unshift( p_listener );
}
@@ -108,7 +108,7 @@ PhoneGap.EventHandler.prototype.addEventListener = function( p_listener, p_captu
}
};
-PhoneGap.EventHandler.prototype.removeEventListener = function( p_listener, p_capture ) {
+Cordova.EventHandler.prototype.removeEventListener = function( p_listener, p_capture ) {
// Try to find the event listener in our list
for( var i = 0; i < this.listeners.length; i++ ) {
if( this.listeners[i] == p_listener ) {
@@ -119,8 +119,8 @@ PhoneGap.EventHandler.prototype.removeEventListener = function( p_listener, p_ca
}
};
-PhoneGap.EventHandler.prototype.dispatchEvent = function() {
- var event = new PhoneGap.Event();
+Cordova.EventHandler.prototype.dispatchEvent = function() {
+ var event = new Cordova.Event();
event.initEvent( this.type, false, false );
// Translate arguments into an array including the custom event as first element
@@ -131,57 +131,57 @@ PhoneGap.EventHandler.prototype.dispatchEvent = function() {
// Notify all listeners about this event
for( var i = 0; i < this.listeners.length; i++ ) {
- this.listeners[i].apply(PhoneGap, parameters);
+ this.listeners[i].apply(Cordova, parameters);
}
};
/*
- * Create the custom phonegap events
+ * Create the custom Cordova events
*/
-PhoneGap.events = {
- deviceready: new PhoneGap.EventHandler( "deviceready" ),
- resume: new PhoneGap.EventHandler( "resume" ),
- pause: new PhoneGap.EventHandler( "pause" )
+Cordova.events = {
+ deviceready: new Cordova.EventHandler( "deviceready" ),
+ resume: new Cordova.EventHandler( "resume" ),
+ pause: new Cordova.EventHandler( "pause" )
};
/*
* EventTarget interface - http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventTarget
*/
//Keep references to the original EventTarget implementations
-PhoneGap.doc_addEventListener = document.addEventListener;
-PhoneGap.doc_removeEventListener = document.removeEventListener;
-PhoneGap.doc_dispatchEvent = document.dispatchEvent;
+Cordova.doc_addEventListener = document.addEventListener;
+Cordova.doc_removeEventListener = document.removeEventListener;
+Cordova.doc_dispatchEvent = document.dispatchEvent;
document.addEventListener = function( type, listener, useCapture ) {
- if( typeof PhoneGap.events[type] != "undefined" ) {
- PhoneGap.events[type].addEventListener( listener, useCapture );
+ if( typeof Cordova.events[type] != "undefined" ) {
+ Cordova.events[type].addEventListener( listener, useCapture );
}
else {
- PhoneGap.doc_addEventListener.call(document, type, listener, useCapture);
+ Cordova.doc_addEventListener.call(document, type, listener, useCapture);
}
};
document.removeEventListener = function( type, listener, useCapture ) {
- if( typeof PhoneGap.events[type] != "undefined" ) {
- PhoneGap.events[type].removeEventListener( listener, useCapture );
+ if( typeof Cordova.events[type] != "undefined" ) {
+ Cordova.events[type].removeEventListener( listener, useCapture );
}
else {
- PhoneGap.doc_removeEventListener.call(document, type, listener, useCapture);
+ Cordova.doc_removeEventListener.call(document, type, listener, useCapture);
}
};
document.dispatchEvent = function( evt ) {
- if( typeof PhoneGap.events[evt.type] != "undefined" ) {
- PhoneGap.events[evt.type].dispatchEvent();
+ if( typeof Cordova.events[evt.type] != "undefined" ) {
+ Cordova.events[evt.type].dispatchEvent();
}
else {
- PhoneGap.doc_dispatchEvent.call(document, evt);
+ Cordova.doc_dispatchEvent.call(document, evt);
}
};
/*
* Trigger the global deviceready event - fired from native code
*/
-PhoneGap.deviceready = function() {
- PhoneGap.events.deviceready.dispatchEvent();
+Cordova.deviceready = function() {
+ Cordova.events.deviceready.dispatchEvent();
}
http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/069265f0/www/js/cordova.qt.js
----------------------------------------------------------------------
diff --git a/www/js/cordova.qt.js b/www/js/cordova.qt.js
index f991792..9069995 100644
--- a/www/js/cordova.qt.js
+++ b/www/js/cordova.qt.js
@@ -14,38 +14,38 @@
* limitations under the License.
*/
-PhoneGap.Qt = {};
+Cordova.Qt = {};
/**
* Execute a call to a plugin function
* @return bool true on success, false on error (e.g. function doesn't exist)
*/
-PhoneGap.Qt.exec = function( successCallback, errorCallback, pluginName, functionName, parameters ) {
+Cordova.Qt.exec = function( successCallback, errorCallback, pluginName, functionName, parameters ) {
// Check if plugin is enabled
- if( PhoneGap.plugins[pluginName] !== true ) {
+ if( Cordova.plugins[pluginName] !== true ) {
return false;
}
// Check if we can find the function
- if( typeof PhoneGap.Qt.objects[pluginName][functionName] != "function" ) {
+ if( typeof Cordova.Qt.objects[pluginName][functionName] != "function" ) {
return false;
}
// Store a reference to the callback functions
- var scId = PhoneGap.callbacks.length;
+ var scId = Cordova.callbacks.length;
var ecId = scId + 1;
- PhoneGap.callbacks[scId] = successCallback;
- PhoneGap.callbacks[ecId] = errorCallback;
+ Cordova.callbacks[scId] = successCallback;
+ Cordova.callbacks[ecId] = errorCallback;
parameters.unshift( ecId );
parameters.unshift( scId );
// Call the function
/*debug.log( "Call: " + pluginName + " / " + functionName );
- debug.log( "P-Obj: " + (typeof PhoneGap.plugins[pluginName]) );
- debug.log( "P-Func: " + (typeof PhoneGap.plugins[pluginName][functionName]) );*/
- //PhoneGap.plugins[pluginName][functionName](scId, ecId, parameters);
- PhoneGap.Qt.objects[pluginName][functionName].apply(this, parameters);
+ debug.log( "P-Obj: " + (typeof Cordova.plugins[pluginName]) );
+ debug.log( "P-Func: " + (typeof Cordova.plugins[pluginName][functionName]) );*/
+ //Cordova.plugins[pluginName][functionName](scId, ecId, parameters);
+ Cordova.Qt.objects[pluginName][functionName].apply(this, parameters);
return true;
}
@@ -53,9 +53,9 @@ PhoneGap.Qt.exec = function( successCallback, errorCallback, pluginName, functio
/**
* Function which is called from the native bridge in order to register the QtWebKit bridge objects
*/
-PhoneGap.Qt.objects = {};
-PhoneGap.Qt.registerObject = function( pluginName, pluginObject ) {
- PhoneGap.Qt.objects[pluginName] = pluginObject;
+Cordova.Qt.objects = {};
+Cordova.Qt.registerObject = function( pluginName, pluginObject ) {
+ Cordova.Qt.objects[pluginName] = pluginObject;
}
-PhoneGap.exec = PhoneGap.Qt.exec;
+Cordova.exec = Cordova.Qt.exec;
http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/069265f0/www/js/cordova.qt5.js
----------------------------------------------------------------------
diff --git a/www/js/cordova.qt5.js b/www/js/cordova.qt5.js
index 210ffea..991d563 100644
--- a/www/js/cordova.qt5.js
+++ b/www/js/cordova.qt5.js
@@ -14,23 +14,23 @@
* limitations under the License.
*/
-PhoneGap.Qt = {};
+Cordova.Qt = {};
/**
* Execute a call to a plugin function
* @return bool true on success, false on error (e.g. function doesn't exist)
*/
-PhoneGap.Qt.exec = function( successCallback, errorCallback, pluginName, functionName, parameters ) {
+Cordova.Qt.exec = function( successCallback, errorCallback, pluginName, functionName, parameters ) {
// Check if plugin is enabled
- if( PhoneGap.plugins[pluginName] !== true ) {
+ if( Cordova.plugins[pluginName] !== true ) {
return false;
}
// Store a reference to the callback functions
- var scId = PhoneGap.callbacks.length;
+ var scId = Cordova.callbacks.length;
var ecId = scId + 1;
- PhoneGap.callbacks[scId] = successCallback;
- PhoneGap.callbacks[ecId] = errorCallback;
+ Cordova.callbacks[scId] = successCallback;
+ Cordova.callbacks[ecId] = errorCallback;
parameters.unshift( ecId );
parameters.unshift( scId );
@@ -40,7 +40,7 @@ PhoneGap.Qt.exec = function( successCallback, errorCallback, pluginName, functio
return true;
}
-PhoneGap.exec = PhoneGap.Qt.exec;
+Cordova.exec = Cordova.Qt.exec;
navigator.qt.onmessage = function(ev) {
var received = eval('('+ev.data+')')
http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/069265f0/www/js/device.js
----------------------------------------------------------------------
diff --git a/www/js/device.js b/www/js/device.js
index ca38f65..dd42393 100644
--- a/www/js/device.js
+++ b/www/js/device.js
@@ -16,21 +16,21 @@
function Device() {
var me = this;
- PhoneGap.exec( function( p_name, p_phonegap, p_platform, p_uuid, p_version ) {
+ Cordova.exec( function( p_name, p_cordova, p_platform, p_uuid, p_version ) {
me.name = p_name;
- me.phonegap = p_phonegap;
+ me.cordova = p_cordova;
me.platform = p_platform;
me.uuid = p_uuid;
me.version = p_version;
- }, null, "com.phonegap.Device", "getInfo", [] );
+ }, null, "com.cordova.Device", "getInfo", [] );
};
Device.prototype.name = "";
-Device.prototype.phonegap = "";
+Device.prototype.cordova = "";
Device.prototype.platform = "";
Device.prototype.uuid = "";
Device.prototype.version = "";
-PhoneGap.addConstructor( "com.phonegap.Device", function() {
+Cordova.addConstructor( "com.cordova.Device", function() {
window.device = new Device();
} );
http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/069265f0/www/js/file.js
----------------------------------------------------------------------
diff --git a/www/js/file.js b/www/js/file.js
index 6d2ee8b..068e7cc 100644
--- a/www/js/file.js
+++ b/www/js/file.js
@@ -92,7 +92,7 @@ Entry.prototype.fullPath = "";
Entry.prototype.filesystem = null;
Entry.prototype.getMetadata = function( successCallback, errorCallback ) {
// Get metadata for this entry
- PhoneGap.exec(successCallback, errorCallback, "com.phonegap.File", "getMetadata", [this.fullPath]);
+ Cordova.exec(successCallback, errorCallback, "com.cordova.File", "getMetadata", [this.fullPath]);
}
Entry.prototype.moveTo = function( parent, newName, successCallback, errorCallback ) {
}
@@ -103,11 +103,11 @@ Entry.prototype.toURL = function( mimeType ) {
}
Entry.prototype.remove = function( successCallback, errorCallback ) {
// Remove this entry
- PhoneGap.exec(successCallback, errorCallback, "com.phonegap.File", "remove", [this.fullPath]);
+ Cordova.exec(successCallback, errorCallback, "com.cordova.File", "remove", [this.fullPath]);
}
Entry.prototype.getParent = function( successCallback, errorCallback ) {
// Ask the system for our parent
- PhoneGap.exec(successCallback, errorCallback, "com.phonegap.File", "getParent", [this.fullPath]);
+ Cordova.exec(successCallback, errorCallback, "com.cordova.File", "getParent", [this.fullPath]);
}
/**
@@ -207,7 +207,7 @@ FileWriter.prototype.write = function( data ) {
// Finally do the writing
var me = this;
- PhoneGap.exec(function(p_position, p_length) {
+ Cordova.exec(function(p_position, p_length) {
// Update position & length for file
me.position = p_position;
me.length = p_length;
@@ -230,7 +230,7 @@ FileWriter.prototype.write = function( data ) {
// Dispatch missing events
if( typeof me.onerror === "function" ) me.onerror( FileWriter.createEvent("error", me) );
if( typeof me.onwriteend === "function" ) me.onwriteend( FileWriter.createEvent("writeend", me) );
- }, "com.phonegap.File", "write", [this.fullPath, this.position, data]);
+ }, "com.cordova.File", "write", [this.fullPath, this.position, data]);
}
FileWriter.prototype.seek = function( offset ) {
@@ -259,7 +259,7 @@ FileWriter.prototype.truncate = function( size ) {
// Finally do the writing
var me = this;
- PhoneGap.exec(function(p_position, p_length) {
+ Cordova.exec(function(p_position, p_length) {
// Update position & length for file
me.position = p_position;
me.length = p_length;
@@ -282,7 +282,7 @@ FileWriter.prototype.truncate = function( size ) {
// Dispatch missing events
if( typeof me.onerror === "function" ) me.onerror( FileSaver.createEvent("error", me) );
if( typeof me.onwriteend === "function" ) me.onwriteend( FileSaver.createEvent("writeend", me) );
- }, "com.phonegap.File", "truncate", [this.fullPath, size]);
+ }, "com.cordova.File", "truncate", [this.fullPath, size]);
}
/**
@@ -321,7 +321,7 @@ FileReader.prototype.readAsText = function( file ) {
var me = this;
// Lets read the file...
- PhoneGap.exec(function( p_data ) {
+ Cordova.exec(function( p_data ) {
me.readyState = FileReader.DONE;
me.result = atob( p_data );
@@ -334,7 +334,7 @@ FileReader.prototype.readAsText = function( file ) {
if( typeof me.onloadend === "function" ) me.onloadend( FileSaver.createEvent( "loadend", me) );
if( typeof me.onerror === "function" ) me.onerror( FileSaver.createEvent( "error", me) );
- }, "com.phonegap.File", "readAsDataURL", [file.fullPath]);
+ }, "com.cordova.File", "readAsDataURL", [file.fullPath]);
}
FileReader.prototype.readAsDataURL = function( file ) {
this.readyState = FileReader.EMPTY;
@@ -347,7 +347,7 @@ FileReader.prototype.readAsDataURL = function( file ) {
var me = this;
// Lets read the file...
- PhoneGap.exec(function( p_data ) {
+ Cordova.exec(function( p_data ) {
me.readyState = FileReader.DONE;
me.result = p_data;
@@ -359,7 +359,7 @@ FileReader.prototype.readAsDataURL = function( file ) {
if( typeof me.onloadend === "function" ) me.onloadend( FileSaver.createEvent( "loadend", me) );
if( typeof me.onerror === "function" ) me.onerror( FileSaver.createEvent( "error", me) );
- }, "com.phonegap.File", "readAsDataURL", [file.fullPath]);
+ }, "com.cordova.File", "readAsDataURL", [file.fullPath]);
}
FileReader.prototype.abort = function() {
this.readyState = FileReader.DONE;
@@ -398,7 +398,7 @@ FileEntry.prototype.createWriter = function( successCallback, errorCallback ) {
}
FileEntry.prototype.file = function( successCallback, errorCallback ) {
// Lets get the fileinfo
- PhoneGap.exec(successCallback, errorCallback, "com.phonegap.File", "file", [this.fullPath]);
+ Cordova.exec(successCallback, errorCallback, "com.cordova.File", "file", [this.fullPath]);
}
/**
@@ -418,7 +418,7 @@ DirectoryReader.cast = function( p_fullPath ) {
DirectoryReader.prototype.fullPath = ""; // Not W3C conform, but required
DirectoryReader.prototype.readEntries = function( successCallback, errorCallback ) {
// Get all entries for the directory
- PhoneGap.exec(successCallback, errorCallback, "com.phonegap.File", "readEntries", [this.fullPath]);
+ Cordova.exec(successCallback, errorCallback, "com.cordova.File", "readEntries", [this.fullPath]);
}
/**
@@ -450,7 +450,7 @@ DirectoryEntry.prototype.getFile = function( path, options, successCallback, err
if( requestPath.charAt(0) != '/' ) requestPath = this.fullPath + requestPath;
// Lets get the file
- PhoneGap.exec(successCallback, errorCallback, "com.phonegap.File", "getFile", [requestPath, options]);
+ Cordova.exec(successCallback, errorCallback, "com.cordova.File", "getFile", [requestPath, options]);
}
DirectoryEntry.prototype.getDirectory = function( path, options, successCallback, errorCallback ) {
var requestPath = path;
@@ -461,11 +461,11 @@ DirectoryEntry.prototype.getDirectory = function( path, options, successCallback
if( requestPath.charAt(requestPath.length - 1) != '/' ) requestPath = requestPath + "/";
// Lets get the directory
- PhoneGap.exec(successCallback, errorCallback, "com.phonegap.File", "getDirectory", [requestPath, options]);
+ Cordova.exec(successCallback, errorCallback, "com.cordova.File", "getDirectory", [requestPath, options]);
}
DirectoryEntry.prototype.removeRecursively = function( successCallback, errorCallback ) {
// Remove the directory
- PhoneGap.exec(successCallback, errorCallback, "com.phonegap.File", "removeRecursively", [this.fullPath]);
+ Cordova.exec(successCallback, errorCallback, "com.cordova.File", "removeRecursively", [this.fullPath]);
}
/**
@@ -497,16 +497,16 @@ LocalFileSystem.TEMPORARY = 0;
LocalFileSystem.PERSISTENT = 1;
LocalFileSystem.prototype.requestFileSystem = function( type, size, successCallback, errorCallback ) {
- PhoneGap.exec(successCallback, errorCallback, "com.phonegap.File", "requestFileSystem", [type, size]);
+ Cordova.exec(successCallback, errorCallback, "com.cordova.File", "requestFileSystem", [type, size]);
}
LocalFileSystem.prototype.resolveLocalFileSystemURL = function( url, successCallback, errorCallback ) {
- PhoneGap.exec(successCallback, errorCallback, "com.phonegap.File", "resolveLocalFileSystemURL", [url]);
+ Cordova.exec(successCallback, errorCallback, "com.cordova.File", "resolveLocalFileSystemURL", [url]);
}
/**
* Let window implement the localfilesystem
*/
-PhoneGap.addConstructor( "com.phonegap.File", function () {
+Cordova.addConstructor( "com.cordova.File", function () {
var localFileSystem = new LocalFileSystem();
window.requestFileSystem = localFileSystem.requestFileSystem;
window.resolveLocalFileSystemURI = localFileSystem.resolveLocalFileSystemURL;
http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/069265f0/www/js/geolocation.js
----------------------------------------------------------------------
diff --git a/www/js/geolocation.js b/www/js/geolocation.js
index dd6b3af..4365c82 100644
--- a/www/js/geolocation.js
+++ b/www/js/geolocation.js
@@ -148,7 +148,7 @@ Geolocation.prototype.getCurrentPosition = function( successCallback, errorCallb
// Call the native function and query for a new position
var me = this;
- PhoneGap.exec( function( p_position ) {
+ Cordova.exec( function( p_position ) {
received = true;
// Cancel timeout
@@ -161,7 +161,7 @@ Geolocation.prototype.getCurrentPosition = function( successCallback, errorCallb
// Execute the successCallback if not timed out
if( !timedOut ) successCallback( p_position );
- }, errorCallback, "com.phonegap.Geolocation", "getCurrentPosition", [ positionOptions ] );
+ }, errorCallback, "com.cordova.Geolocation", "getCurrentPosition", [ positionOptions ] );
};
Geolocation.prototype.watchPosition = function( successCallback, errorCallback, options ) {
@@ -204,6 +204,6 @@ Geolocation.prototype.clearWatch = function( watchId ) {
/**
* Add the geolocation object to the navigator
*/
-PhoneGap.addConstructor( "com.phonegap.Geolocation", function () {
+Cordova.addConstructor( "com.cordova.Geolocation", function () {
navigator.geolocation = new Geolocation();
} );
http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/069265f0/www/js/notification.js
----------------------------------------------------------------------
diff --git a/www/js/notification.js b/www/js/notification.js
index 5145b18..22ce934 100644
--- a/www/js/notification.js
+++ b/www/js/notification.js
@@ -38,16 +38,16 @@ Notification.prototype.confirm = function( message, confirmCallback, title, butt
}
Notification.prototype.beep = function( times ) {
- PhoneGap.exec( null, null, "com.phonegap.Notification", "beep", [times] );
+ Cordova.exec( null, null, "com.cordova.Notification", "beep", [times] );
}
Notification.prototype.vibrate = function( milliseconds ) {
- PhoneGap.exec( null, null, "com.phonegap.Notification", "vibrate", [milliseconds] );
+ Cordova.exec( null, null, "com.cordova.Notification", "vibrate", [milliseconds] );
}
/**
* Add the notification object to the navigator
*/
-PhoneGap.addConstructor( "com.phonegap.Notification", function () {
+Cordova.addConstructor( "com.cordova.Notification", function () {
navigator.notification = new Notification();
} );
http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/069265f0/xml/plugins.xml
----------------------------------------------------------------------
diff --git a/xml/plugins.xml b/xml/plugins.xml
index 9d653aa..67464b7 100644
--- a/xml/plugins.xml
+++ b/xml/plugins.xml
@@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<plugins>
- <plugin name="File" value="com.phonegap.File"/>
- <plugin name="Notification" value="com.phonegap.Notification"/>
- <plugin name="Geolocation" value="com.phonegap.Geolocation"/>
- <plugin name="Device" value="com.phonegap.Device"/>
- <plugin name="Console" value="com.phonegap.Console"/>
- <plugin name="Connection" value="com.phonegap.Connection"/>
- <plugin name="Compass" value="com.phonegap.Compass"/>
+ <plugin name="File" value="com.cordova.File"/>
+ <plugin name="Notification" value="com.cordova.Notification"/>
+ <plugin name="Geolocation" value="com.cordova.Geolocation"/>
+ <plugin name="Device" value="com.cordova.Device"/>
+ <plugin name="Console" value="com.cordova.Console"/>
+ <plugin name="Connection" value="com.cordova.Connection"/>
+ <plugin name="Compass" value="com.cordova.Compass"/>
-<!-- <plugin name="Compass" value="com.phonegap.CompassListener"/>
- <plugin name="Media" value="com.phonegap.AudioHandler"/>
- <plugin name="Contacts" value="com.phonegap.ContactManager"/>
- <plugin name="Crypto" value="com.phonegap.CryptoHandler"/>
- <plugin name="Network Status" value="com.phonegap.NetworkManager"/>
- <plugin name="Storage" value="com.phonegap.Storage"/>
- <plugin name="Temperature" value="com.phonegap.TempListener"/>
- <plugin name="FileTransfer" value="com.phonegap.FileTransfer"/>
- <plugin name="Capture" value="com.phonegap.Capture"/>
- <plugin name="Battery" value="com.phonegap.BatteryListener"/>-->
+<!-- <plugin name="Compass" value="com.cordova.CompassListener"/>
+ <plugin name="Media" value="com.cordova.AudioHandler"/>
+ <plugin name="Contacts" value="com.cordova.ContactManager"/>
+ <plugin name="Crypto" value="com.cordova.CryptoHandler"/>
+ <plugin name="Network Status" value="com.cordova.NetworkManager"/>
+ <plugin name="Storage" value="com.cordova.Storage"/>
+ <plugin name="Temperature" value="com.cordova.TempListener"/>
+ <plugin name="FileTransfer" value="com.cordova.FileTransfer"/>
+ <plugin name="Capture" value="com.cordova.Capture"/>
+ <plugin name="Battery" value="com.cordova.BatteryListener"/>-->
</plugins>