mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-27 04:42:51 +08:00
Adding the Apache Headers
This commit is contained in:
parent
5a40613ccc
commit
a35a33c05e
@ -1,9 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
|
* 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
|
||||||
*
|
*
|
||||||
* Copyright (c) 2005-2010, Nitobi Software Inc.
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* Copyright (c) 2010-2011, IBM Corporation
|
*
|
||||||
|
* 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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!PhoneGap.hasResource("accelerometer")) {
|
if (!PhoneGap.hasResource("accelerometer")) {
|
||||||
|
@ -1,9 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
|
* 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
|
||||||
*
|
*
|
||||||
* Copyright (c) 2005-2010, Nitobi Software Inc.
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* Copyright (c) 2010-2011, IBM Corporation
|
*
|
||||||
|
* 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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!PhoneGap.hasResource("app")) {
|
if (!PhoneGap.hasResource("app")) {
|
||||||
|
@ -1,9 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
|
* 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
|
||||||
*
|
*
|
||||||
* Copyright (c) 2005-2010, Nitobi Software Inc.
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* Copyright (c) 2010-2011, IBM Corporation
|
*
|
||||||
|
* 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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!PhoneGap.hasResource("battery")) {
|
if (!PhoneGap.hasResource("battery")) {
|
||||||
|
@ -1,9 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
|
* 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
|
||||||
*
|
*
|
||||||
* Copyright (c) 2005-2010, Nitobi Software Inc.
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* Copyright (c) 2010-2011, IBM Corporation
|
*
|
||||||
|
* 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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!PhoneGap.hasResource("camera")) {
|
if (!PhoneGap.hasResource("camera")) {
|
||||||
|
@ -1,9 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
|
* 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
|
||||||
*
|
*
|
||||||
* Copyright (c) 2005-2010, Nitobi Software Inc.
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* Copyright (c) 2010-2011, IBM Corporation
|
*
|
||||||
|
* 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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!PhoneGap.hasResource("capture")) {
|
if (!PhoneGap.hasResource("capture")) {
|
||||||
|
@ -1,9 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
|
* 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
|
||||||
*
|
*
|
||||||
* Copyright (c) 2005-2010, Nitobi Software Inc.
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* Copyright (c) 2010-2011, IBM Corporation
|
*
|
||||||
|
* 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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!PhoneGap.hasResource("compass")) {
|
if (!PhoneGap.hasResource("compass")) {
|
||||||
|
@ -1,9 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
|
* 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
|
||||||
*
|
*
|
||||||
* Copyright (c) 2005-2010, Nitobi Software Inc.
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* Copyright (c) 2010-2011, IBM Corporation
|
*
|
||||||
|
* 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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!PhoneGap.hasResource("contact")) {
|
if (!PhoneGap.hasResource("contact")) {
|
||||||
|
@ -1,9 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
|
* 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
|
||||||
*
|
*
|
||||||
* Copyright (c) 2005-2010, Nitobi Software Inc.
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* Copyright (c) 2010-2011, IBM Corporation
|
*
|
||||||
|
* 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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// TODO: Needs to be commented
|
// TODO: Needs to be commented
|
||||||
|
@ -1,9 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
|
* 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
|
||||||
*
|
*
|
||||||
* Copyright (c) 2005-2010, Nitobi Software Inc.
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* Copyright (c) 2010-2011, IBM Corporation
|
*
|
||||||
|
* 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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!PhoneGap.hasResource("device")) {
|
if (!PhoneGap.hasResource("device")) {
|
||||||
|
@ -1,9 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
|
* 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
|
||||||
*
|
*
|
||||||
* Copyright (c) 2005-2010, Nitobi Software Inc.
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* Copyright (c) 2010-2011, IBM Corporation
|
*
|
||||||
|
* 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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!PhoneGap.hasResource("file")) {
|
if (!PhoneGap.hasResource("file")) {
|
||||||
|
@ -1,9 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
|
* 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
|
||||||
*
|
*
|
||||||
* Copyright (c) 2005-2010, Nitobi Software Inc.
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* Copyright (c) 2010-2011, IBM Corporation
|
*
|
||||||
|
* 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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!PhoneGap.hasResource("filetransfer")) {
|
if (!PhoneGap.hasResource("filetransfer")) {
|
||||||
|
@ -1,9 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
|
* 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
|
||||||
*
|
*
|
||||||
* Copyright (c) 2005-2010, Nitobi Software Inc.
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* Copyright (c) 2010-2011, IBM Corporation
|
*
|
||||||
|
* 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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!PhoneGap.hasResource("geolocation")) {
|
if (!PhoneGap.hasResource("geolocation")) {
|
||||||
|
@ -1,7 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
|
* 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
|
||||||
*
|
*
|
||||||
* Copyright (c) 2005-2010, Nitobi Software Inc.
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* Copyright (c) 2010, IBM Corporation
|
*
|
||||||
|
* 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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -1,9 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
|
* 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
|
||||||
*
|
*
|
||||||
* Copyright (c) 2005-2010, Nitobi Software Inc.
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* Copyright (c) 2010-2011, IBM Corporation
|
*
|
||||||
|
* 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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!PhoneGap.hasResource("media")) {
|
if (!PhoneGap.hasResource("media")) {
|
||||||
|
@ -1,11 +1,23 @@
|
|||||||
/*
|
/*
|
||||||
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
|
* 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
|
||||||
*
|
*
|
||||||
* Copyright (c) 2005-2010, Nitobi Software Inc.
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* Copyright (c) 2010-2011, IBM Corporation
|
*
|
||||||
|
* 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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
if (!PhoneGap.hasResource("network")) {
|
if (!PhoneGap.hasResource("network")) {
|
||||||
PhoneGap.addResource("network");
|
PhoneGap.addResource("network");
|
||||||
|
|
||||||
|
@ -1,9 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
|
* 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
|
||||||
*
|
*
|
||||||
* Copyright (c) 2005-2010, Nitobi Software Inc.
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* Copyright (c) 2010-2011, IBM Corporation
|
*
|
||||||
|
* 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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!PhoneGap.hasResource("notification")) {
|
if (!PhoneGap.hasResource("notification")) {
|
||||||
|
@ -1,9 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
|
* 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
|
||||||
*
|
*
|
||||||
* Copyright (c) 2005-2010, Nitobi Software Inc.
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* Copyright (c) 2010-2011, IBM Corporation
|
*
|
||||||
|
* 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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (typeof PhoneGap === "undefined") {
|
if (typeof PhoneGap === "undefined") {
|
||||||
|
@ -1,9 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
|
* 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
|
||||||
*
|
*
|
||||||
* Copyright (c) 2005-2010, Nitobi Software Inc.
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* Copyright (c) 2010-2011, IBM Corporation
|
*
|
||||||
|
* 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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!PhoneGap.hasResource("position")) {
|
if (!PhoneGap.hasResource("position")) {
|
||||||
|
@ -1,9 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
* PhoneGap is available under *either* the terms of the modified BSD license *or* the
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
|
* 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
|
||||||
*
|
*
|
||||||
* Copyright (c) 2005-2010, Nitobi Software Inc.
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* Copyright (c) 2010-2011, IBM Corporation
|
*
|
||||||
|
* 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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -311,83 +322,83 @@ var DroidDB_openDatabase = function(name, version, display_name, size) {
|
|||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
var CupcakeLocalStorage = function() {
|
var CupcakeLocalStorage = function() {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
this.db = openDatabase('localStorage', '1.0', 'localStorage', 2621440);
|
this.db = openDatabase('localStorage', '1.0', 'localStorage', 2621440);
|
||||||
var storage = {};
|
var storage = {};
|
||||||
this.length = 0;
|
this.length = 0;
|
||||||
function setLength (length) {
|
function setLength (length) {
|
||||||
this.length = length;
|
this.length = length;
|
||||||
localStorage.length = length;
|
localStorage.length = length;
|
||||||
}
|
}
|
||||||
this.db.transaction(
|
this.db.transaction(
|
||||||
function (transaction) {
|
function (transaction) {
|
||||||
var i;
|
var i;
|
||||||
transaction.executeSql('CREATE TABLE IF NOT EXISTS storage (id NVARCHAR(40) PRIMARY KEY, body NVARCHAR(255))');
|
transaction.executeSql('CREATE TABLE IF NOT EXISTS storage (id NVARCHAR(40) PRIMARY KEY, body NVARCHAR(255))');
|
||||||
transaction.executeSql('SELECT * FROM storage', [], function(tx, result) {
|
transaction.executeSql('SELECT * FROM storage', [], function(tx, result) {
|
||||||
for(var i = 0; i < result.rows.length; i++) {
|
for(var i = 0; i < result.rows.length; i++) {
|
||||||
storage[result.rows.item(i)['id']] = result.rows.item(i)['body'];
|
storage[result.rows.item(i)['id']] = result.rows.item(i)['body'];
|
||||||
}
|
}
|
||||||
setLength(result.rows.length);
|
setLength(result.rows.length);
|
||||||
PhoneGap.initializationComplete("cupcakeStorage");
|
PhoneGap.initializationComplete("cupcakeStorage");
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
function (err) {
|
function (err) {
|
||||||
alert(err.message);
|
alert(err.message);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
this.setItem = function(key, val) {
|
this.setItem = function(key, val) {
|
||||||
if (typeof(storage[key])=='undefined') {
|
if (typeof(storage[key])=='undefined') {
|
||||||
this.length++;
|
this.length++;
|
||||||
}
|
}
|
||||||
storage[key] = val;
|
storage[key] = val;
|
||||||
this.db.transaction(
|
this.db.transaction(
|
||||||
function (transaction) {
|
function (transaction) {
|
||||||
transaction.executeSql('CREATE TABLE IF NOT EXISTS storage (id NVARCHAR(40) PRIMARY KEY, body NVARCHAR(255))');
|
transaction.executeSql('CREATE TABLE IF NOT EXISTS storage (id NVARCHAR(40) PRIMARY KEY, body NVARCHAR(255))');
|
||||||
transaction.executeSql('REPLACE INTO storage (id, body) values(?,?)', [key,val]);
|
transaction.executeSql('REPLACE INTO storage (id, body) values(?,?)', [key,val]);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
this.getItem = function(key) {
|
this.getItem = function(key) {
|
||||||
return storage[key];
|
return storage[key];
|
||||||
};
|
};
|
||||||
this.removeItem = function(key) {
|
this.removeItem = function(key) {
|
||||||
delete storage[key];
|
delete storage[key];
|
||||||
this.length--;
|
this.length--;
|
||||||
this.db.transaction(
|
this.db.transaction(
|
||||||
function (transaction) {
|
function (transaction) {
|
||||||
transaction.executeSql('CREATE TABLE IF NOT EXISTS storage (id NVARCHAR(40) PRIMARY KEY, body NVARCHAR(255))');
|
transaction.executeSql('CREATE TABLE IF NOT EXISTS storage (id NVARCHAR(40) PRIMARY KEY, body NVARCHAR(255))');
|
||||||
transaction.executeSql('DELETE FROM storage where id=?', [key]);
|
transaction.executeSql('DELETE FROM storage where id=?', [key]);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
this.clear = function() {
|
this.clear = function() {
|
||||||
storage = {};
|
storage = {};
|
||||||
this.length = 0;
|
this.length = 0;
|
||||||
this.db.transaction(
|
this.db.transaction(
|
||||||
function (transaction) {
|
function (transaction) {
|
||||||
transaction.executeSql('CREATE TABLE IF NOT EXISTS storage (id NVARCHAR(40) PRIMARY KEY, body NVARCHAR(255))');
|
transaction.executeSql('CREATE TABLE IF NOT EXISTS storage (id NVARCHAR(40) PRIMARY KEY, body NVARCHAR(255))');
|
||||||
transaction.executeSql('DELETE FROM storage', []);
|
transaction.executeSql('DELETE FROM storage', []);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
this.key = function(index) {
|
this.key = function(index) {
|
||||||
var i = 0;
|
var i = 0;
|
||||||
for (var j in storage) {
|
for (var j in storage) {
|
||||||
if (i==index) {
|
if (i==index) {
|
||||||
return j;
|
return j;
|
||||||
} else {
|
} else {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
alert("Database error "+e+".");
|
alert("Database error "+e+".");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
PhoneGap.addConstructor(function() {
|
PhoneGap.addConstructor(function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user