Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
58 changes: 58 additions & 0 deletions App_frontend/firebase_test/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<title>Firebase test</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="https://www.gstatic.com/firebasejs/3.7.0/firebase.js"></script>
<script>
$(document).ready(function(){
// Initialize Firebase
var config = {
apiKey: "AIzaSyDFvI4Wa2Re2F2OyWaqoGvw8lK1SjNXuBA",
authDomain: "savestyle-81bf4.firebaseapp.com",
databaseURL: "https://savestyle-81bf4.firebaseio.com",
storageBucket: "savestyle-81bf4.appspot.com",
messagingSenderId: "457015776359"
};
firebase.initializeApp(config);
var database = firebase.database();

//ADDING DATA TO FIREBASE
var ref = database.ref('styles/username2');
var data = {
source : "source_name",
colors : ['color1', 'color2'],
fonts : ['font1', 'font2']
}
// ref.push(data);

//RETREIVING DATA FROM FIREBASE
var refe = database.ref('styles/username');
refe.on('value', gotData, errData);
});

function gotData(data){
console.log(data.val());
var styles = data.val();
var keys = Object.keys(styles);
for(i = 0 ; i < keys.length ; i++){
var k = keys[i];
var colors = styles[k].colors;
var fonts = styles[k].fonts;
var source = styles[k].source;
console.log(colors, fonts, source);
}
}
function errData(err){
console.log(err);
}
</script>
</head>

<body>

</body>

</html>
32 changes: 32 additions & 0 deletions App_frontend/savestyles/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.cordova.hellocordova" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>HelloCordova</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="dev@cordova.apache.org" href="http://cordova.io">
Apache Cordova Team
</author>
<content src="index.html" />
<plugin name="cordova-plugin-whitelist" spec="1" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
</platform>
<allow-navigation href="*" />
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<preference name="CRIInjectFirstFiles" value="http://savestyle.mybluemix.net" />
<preference name="CRIPageLoadPromptInterval" value="5" />

</widget>
23 changes: 23 additions & 0 deletions App_frontend/savestyles/hooks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!--
#
# 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
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
-->
# Cordova Hooks

Cordova Hooks represent special scripts which could be added by application and plugin developers or even by your own build system to customize cordova commands. See Hooks Guide for more details: http://cordova.apache.org/docs/en/edge/guide_appdev_hooks_index.md.html#Hooks%20Guide.
Loading