cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mwbro...@apache.org
Subject [35/46] docs commit: storage
Date Wed, 12 Jun 2013 17:51:10 GMT
storage


Project: http://git-wip-us.apache.org/repos/asf/cordova-docs/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-docs/commit/efd1aa0b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-docs/tree/efd1aa0b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-docs/diff/efd1aa0b

Branch: refs/heads/master
Commit: efd1aa0b5c0909c3d2eab4ab5ddccaef7b71fab8
Parents: 44d1cb2
Author: Mike Sierra <letmespellitoutforyou@gmail.com>
Authored: Sun May 19 16:27:26 2013 -0400
Committer: Mike Sierra <letmespellitoutforyou@gmail.com>
Committed: Sun May 19 16:27:26 2013 -0400

----------------------------------------------------------------------
 .../edge/cordova/storage/database/database.md   |  9 +++--
 .../storage/localstorage/localstorage.md        | 26 ++++++++------
 .../cordova/storage/parameters/display_name.md  |  2 +-
 docs/en/edge/cordova/storage/parameters/name.md |  2 +-
 docs/en/edge/cordova/storage/parameters/size.md |  2 +-
 .../edge/cordova/storage/parameters/version.md  |  2 +-
 .../edge/cordova/storage/sqlerror/sqlerror.md   |  5 ++-
 .../storage/sqlresultset/sqlresultset.md        | 27 ++++++++++----
 .../sqlresultsetrowlist/sqlresultsetrowlist.md  | 38 +++++++++++---------
 .../storage/sqltransaction/sqltransaction.md    |  9 ++---
 docs/en/edge/cordova/storage/storage.md         | 11 ++++--
 .../cordova/storage/storage.opendatabase.md     |  9 +++--
 12 files changed, 84 insertions(+), 58 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/efd1aa0b/docs/en/edge/cordova/storage/database/database.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/storage/database/database.md b/docs/en/edge/cordova/storage/database/database.md
index 1d56823..7c78481 100644
--- a/docs/en/edge/cordova/storage/database/database.md
+++ b/docs/en/edge/cordova/storage/database/database.md
@@ -1,4 +1,4 @@
---- 
+---
 license: 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
@@ -20,18 +20,18 @@ license: Licensed to the Apache Software Foundation (ASF) under one
 Database
 =======
 
-Contains methods that allow the user to manipulate the Database
+Provides access to an SQL database.
 
 Methods
 -------
 
 - __transaction__: Runs a database transaction.
-- __changeVersion__: method allows scripts to atomically verify the version number and change
it at the same time as doing a schema update.
+- __changeVersion__: Allows scripts to automatically verify the version number and change
it when updating a schema.
 
 Details
 -------
 
-A Database object is returned from a call to `window.openDatabase()`.
+The `window.openDatabase()` method returns a `Database` object.
 
 Supported Platforms
 -------------------
@@ -118,4 +118,3 @@ Full Example
         <p>Database</p>
       </body>
     </html>
-

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/efd1aa0b/docs/en/edge/cordova/storage/localstorage/localstorage.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/storage/localstorage/localstorage.md b/docs/en/edge/cordova/storage/localstorage/localstorage.md
index 21ca8ff..3f4fcd6 100644
--- a/docs/en/edge/cordova/storage/localstorage/localstorage.md
+++ b/docs/en/edge/cordova/storage/localstorage/localstorage.md
@@ -1,4 +1,4 @@
---- 
+---
 license: 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
@@ -20,25 +20,26 @@ license: Licensed to the Apache Software Foundation (ASF) under one
 localStorage
 ===============
 
-Provides access to a W3C Storage interface (http://dev.w3.org/html5/webstorage/#the-localstorage-attribute)
+Provides access to a [W3C Storage interface](http://dev.w3.org/html5/webstorage/#the-localstorage-attribute)
 
     var storage = window.localStorage;
 
 Methods
 -------
 
-- __key__: Returns the name of the key at the position specified.
-- __getItem__: Returns the item identified by it's key.
-- __setItem__: Saves and item at the key provided.
-- __removeItem__: Removes the item identified by it's key.
-- __clear__: Removes all of the key value pairs.
+- __key__: Returns the name of the key at the specified position.
+- __getItem__: Returns the item identified by the specified key.
+- __setItem__: Assigns a keyed item's value.
+- __removeItem__: Removes the item identified by the specified key.
+- __clear__: Removes all of the key/value pairs.
 
 Details
 -----------
 
-localStorage provides an interface to a W3C Storage interface.  It allows one to save data
as key-value pairs.
-
-Note: window.sessionStorage provides the same interface, but is cleared between app launches.
+The `window.localStorage` interface is based on the W3C Web Storage
+interface.  An app can use it to save persistent data using key-value
+pairs.  The `window.sessionStorage` interface works the same way, but
+all data is cleared each time the app closes.
 
 Supported Platforms
 -------------------
@@ -117,4 +118,7 @@ Full Example
 Windows Phone 7 Quirks
 -------------
 
-- dot notation is _not_ available on Windows Phone 7. Be sure to use : window.localStorage.setItem/getItem,
and not the w3 spec defined calls to window.localStorage.someKey = 'someValue';
+Dot notation is _not_ available on Windows Phone 7. Be sure to use
+`setItem` or `getItem`, rather than accessing keys directly from the
+storage object, such as `window.localStorage.someKey`.
+

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/efd1aa0b/docs/en/edge/cordova/storage/parameters/display_name.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/storage/parameters/display_name.md b/docs/en/edge/cordova/storage/parameters/display_name.md
index 910a980..226a0c6 100644
--- a/docs/en/edge/cordova/storage/parameters/display_name.md
+++ b/docs/en/edge/cordova/storage/parameters/display_name.md
@@ -1,4 +1,4 @@
---- 
+---
 license: 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

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/efd1aa0b/docs/en/edge/cordova/storage/parameters/name.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/storage/parameters/name.md b/docs/en/edge/cordova/storage/parameters/name.md
index f77f967..b1c6a85 100644
--- a/docs/en/edge/cordova/storage/parameters/name.md
+++ b/docs/en/edge/cordova/storage/parameters/name.md
@@ -1,4 +1,4 @@
---- 
+---
 license: 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

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/efd1aa0b/docs/en/edge/cordova/storage/parameters/size.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/storage/parameters/size.md b/docs/en/edge/cordova/storage/parameters/size.md
index fd77dcd..7d9585e 100644
--- a/docs/en/edge/cordova/storage/parameters/size.md
+++ b/docs/en/edge/cordova/storage/parameters/size.md
@@ -1,4 +1,4 @@
---- 
+---
 license: 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

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/efd1aa0b/docs/en/edge/cordova/storage/parameters/version.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/storage/parameters/version.md b/docs/en/edge/cordova/storage/parameters/version.md
index 199cb3b..2e72923 100644
--- a/docs/en/edge/cordova/storage/parameters/version.md
+++ b/docs/en/edge/cordova/storage/parameters/version.md
@@ -1,4 +1,4 @@
---- 
+---
 license: 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

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/efd1aa0b/docs/en/edge/cordova/storage/sqlerror/sqlerror.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/storage/sqlerror/sqlerror.md b/docs/en/edge/cordova/storage/sqlerror/sqlerror.md
index ee06596..c6bce00 100644
--- a/docs/en/edge/cordova/storage/sqlerror/sqlerror.md
+++ b/docs/en/edge/cordova/storage/sqlerror/sqlerror.md
@@ -1,4 +1,4 @@
---- 
+---
 license: 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
@@ -20,7 +20,7 @@ license: Licensed to the Apache Software Foundation (ASF) under one
 SQLError
 ========
 
-A `SQLError` object is thrown when an error occurs.
+An `SQLError` object is thrown when an error occurs.
 
 Properties
 ----------
@@ -44,4 +44,3 @@ Description
 -----------
 
 The `SQLError` object is thrown when an error occurs when manipulating a database.
-

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/efd1aa0b/docs/en/edge/cordova/storage/sqlresultset/sqlresultset.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/storage/sqlresultset/sqlresultset.md b/docs/en/edge/cordova/storage/sqlresultset/sqlresultset.md
index 6f1d86c..7e9a4ed 100644
--- a/docs/en/edge/cordova/storage/sqlresultset/sqlresultset.md
+++ b/docs/en/edge/cordova/storage/sqlresultset/sqlresultset.md
@@ -1,4 +1,4 @@
---- 
+---
 license: 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
@@ -20,20 +20,33 @@ license: Licensed to the Apache Software Foundation (ASF) under one
 SQLResultSet
 =======
 
-When the `executeSql` method of a `SQLTransaction` is called it
-invokes its callback with a `SQLResultSet`.
+When a `SQLTransaction` object's `executeSql` method is called, the
+specified callback executes with a `SQLResultSet` parameter.
 
 Properties
 -------
 
-- __insertId__: the row ID of the row that the SQLResultSet object's SQL statement inserted
into the database
-- __rowsAffected__: the number of rows that were changed by the SQL statement.  If the statement
did not affect any rows then it is set to 0.
-- __rows__: a SQLResultSetRowList representing the rows returned.  If no rows are returned
the object will be empty.
+- __insertId__: The row ID of the row that the `SQLResultSet` object's SQL statement inserted
into the database.
+- __rowsAffected__: The number of rows changed by the SQL statement, zero if the statement
did not affect any rows.
+- __rows__: a `SQLResultSetRowList` representing the rows returned, empty if no rows are
returned.
 
 Details
 -------
 
-When you call the SQLTransaction executeSql method its callback methods is passed a SQLResultSet
object.  The result object has three properties.  The first is the `insertId` which will return
the row number of a success SQL insert statement.  If the SQL statement is not an insert then
the `insertId` is not set.  The `rowsAffected` is always 0 for a SQL select statement.  For
insert or update statements it returns the number of rows that have been modified.  The final
property is of type SQLResultSetList and it contains the data returned from a SQL select statement.
+When a `SQLTransaction` object's `executeSql` method is called, the
+specified callback executes with a `SQLResultSet` parameter containing
+three properties:
+
+* The `insertId` returns the row number of a successly SQL insertion
+  statement.  If the SQL does not insert any rows, the `insertId` is
+  not set.
+
+* The `rowsAffected` is always `0` for a SQL `select` statement.  For
+  `insert` or `update` statements it returns the number of modified
+  rows.
+
+* The final `SQLResultSetList` contains the data returned from a SQL
+  select statement.
 
 Supported Platforms
 -------------------

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/efd1aa0b/docs/en/edge/cordova/storage/sqlresultsetrowlist/sqlresultsetrowlist.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/storage/sqlresultsetrowlist/sqlresultsetrowlist.md b/docs/en/edge/cordova/storage/sqlresultsetrowlist/sqlresultsetrowlist.md
index 37587f2..f9ae524 100644
--- a/docs/en/edge/cordova/storage/sqlresultsetrowlist/sqlresultsetrowlist.md
+++ b/docs/en/edge/cordova/storage/sqlresultsetrowlist/sqlresultsetrowlist.md
@@ -1,4 +1,4 @@
---- 
+---
 license: 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
@@ -20,12 +20,13 @@ license: Licensed to the Apache Software Foundation (ASF) under one
 SQLResultSetRowList
 =======
 
-One of the properties of the SQLResultSet containing the rows returned from a SQL query.
+One of the properties of the `SQLResultSet` containing the rows
+returned from a SQL query.
 
 Properties
 -------
 
-- __length__: the number of rows returned by the SQL query
+- __length__: the number of rows returned by the SQL query.
 
 Methods
 -------
@@ -35,7 +36,12 @@ Methods
 Details
 -------
 
-The SQLResultSetRowList contains the data returned from a SQL select statement.  The object
contains a length property letting you know how many rows the select statement has been returned.
 To get a row of data you would call the `item` method specifying an index.  The item method
returns a JavaScript Object who's properties are the columns of the database the select statement
was executed against.
+The `SQLResultSetRowList` contains the data returned from a SQL
+`select` statement.  The object contains a `length` property
+indicating how many rows the `select` statement returns.  To get a row
+of data, call the `item` method to specify an index.  It returns a
+JavaScript `Object` whose properties are the database columns the
+`select` statement was executed against.
 
 Supported Platforms
 -------------------
@@ -49,18 +55,18 @@ Supported Platforms
 Execute SQL Quick Example
 ------------------
 
-	function queryDB(tx) {
-		tx.executeSql('SELECT * FROM DEMO', [], querySuccess, errorCB);
-	}
-
-	function querySuccess(tx, results) {
-		var len = results.rows.length;
-	   	console.log("DEMO table: " + len + " rows found.");
-	   	for (var i=0; i<len; i++){
-	        console.log("Row = " + i + " ID = " + results.rows.item(i).id + " Data =  " + results.rows.item(i).data);
-		}
-	}
-	
+    function queryDB(tx) {
+        tx.executeSql('SELECT * FROM DEMO', [], querySuccess, errorCB);
+    }
+
+    function querySuccess(tx, results) {
+        var len = results.rows.length;
+            console.log("DEMO table: " + len + " rows found.");
+            for (var i=0; i<len; i++){
+                console.log("Row = " + i + " ID = " + results.rows.item(i).id + " Data =
 " + results.rows.item(i).data);
+            }
+        }
+    
 	function errorCB(err) {
 		alert("Error processing SQL: "+err.code);
 	}

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/efd1aa0b/docs/en/edge/cordova/storage/sqltransaction/sqltransaction.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/storage/sqltransaction/sqltransaction.md b/docs/en/edge/cordova/storage/sqltransaction/sqltransaction.md
index ea61b30..9ba2836 100644
--- a/docs/en/edge/cordova/storage/sqltransaction/sqltransaction.md
+++ b/docs/en/edge/cordova/storage/sqltransaction/sqltransaction.md
@@ -1,4 +1,4 @@
---- 
+---
 license: 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
@@ -20,17 +20,18 @@ license: Licensed to the Apache Software Foundation (ASF) under one
 SQLTransaction
 =======
 
-Contains methods that allow the user to execute SQL statements against the Database.
+Allows execution of SQL statements against the Database.
 
 Methods
 -------
 
-- __executeSql__: executes a SQL statement
+- __executeSql__: executes a SQL statement.
 
 Details
 -------
 
-When you call a Database objects transaction method, its callback method is passed a SQLTransaction
object.  The user can build up a database transaction by calling the executeSql method multiple
times.
+Calling a `Database` object's transaction method, passes a
+`SQLTransaction` object to the specified callback method.
 
 Supported Platforms
 -------------------

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/efd1aa0b/docs/en/edge/cordova/storage/storage.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/storage/storage.md b/docs/en/edge/cordova/storage/storage.md
index cd679b2..c4d7a47 100644
--- a/docs/en/edge/cordova/storage/storage.md
+++ b/docs/en/edge/cordova/storage/storage.md
@@ -1,4 +1,4 @@
---- 
+---
 license: 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
@@ -20,9 +20,14 @@ license: Licensed to the Apache Software Foundation (ASF) under one
 Storage
 ==========
 
-> Provides access to the devices storage options.
+> Provides access to the device's storage options.
 
-This API is based on the [W3C Web SQL Database Specification](http://dev.w3.org/html5/webdatabase/)
and [W3C Web Storage API Specification](http://dev.w3.org/html5/webstorage/). Some devices
already provide an implementation of this spec. For those devices, the built-in support is
used instead of replacing it with Cordova's implementation. For devices that don't have storage
support, Cordova's implementation should be compatible with the W3C specification.
+This API is based on the [W3C Web SQL Database
+Specification](http://dev.w3.org/html5/webdatabase/) and [W3C Web
+Storage API Specification](http://dev.w3.org/html5/webstorage/). Some
+devices already provide an implementation of these specifications, in
+which case the built-in support applies.  Cordova's implementation
+offers compatible support for those that don't.
 
 Methods
 -------

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/efd1aa0b/docs/en/edge/cordova/storage/storage.opendatabase.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/storage/storage.opendatabase.md b/docs/en/edge/cordova/storage/storage.opendatabase.md
index 9d3d19a..399a79a 100644
--- a/docs/en/edge/cordova/storage/storage.opendatabase.md
+++ b/docs/en/edge/cordova/storage/storage.opendatabase.md
@@ -1,4 +1,4 @@
---- 
+---
 license: 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
@@ -20,16 +20,15 @@ license: Licensed to the Apache Software Foundation (ASF) under one
 openDatabase
 ===============
 
-Returns a new Database object.
+Returns a new `Database` object.
 
     var dbShell = window.openDatabase(database_name, database_version, database_displayname,
database_size);
 
 Description
 -----------
 
-window.openDatabase returns a new Database object.
-
-This method will create a new SQL Lite Database and return a Database object.  Use the Database
Object to manipulate the data.
+The method creates a new SQL Lite Database and returns a `Database`
+object that allows manipulation of the data.
 
 Supported Platforms
 -------------------


Mime
View raw message