mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2025-01-31 06:22:50 +08:00
add example
This commit is contained in:
parent
8f2fda0d46
commit
8cdb2ba437
BIN
example/.DS_Store
vendored
Normal file
BIN
example/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
example/css/.DS_Store
vendored
Normal file
BIN
example/css/.DS_Store
vendored
Normal file
Binary file not shown.
115
example/css/index.css
Executable file
115
example/css/index.css
Executable file
@ -0,0 +1,115 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
* {
|
||||
-webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */
|
||||
}
|
||||
|
||||
body {
|
||||
-webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */
|
||||
-webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */
|
||||
-webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */
|
||||
background-color:#E4E4E4;
|
||||
background-image:linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
|
||||
background-image:-webkit-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
|
||||
background-image:-ms-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
|
||||
background-image:-webkit-gradient(
|
||||
linear,
|
||||
left top,
|
||||
left bottom,
|
||||
color-stop(0, #A7A7A7),
|
||||
color-stop(0.51, #E4E4E4)
|
||||
);
|
||||
background-attachment:fixed;
|
||||
font-family:'HelveticaNeue-Light', 'HelveticaNeue', Helvetica, Arial, sans-serif;
|
||||
font-size:12px;
|
||||
height:100%;
|
||||
margin:0px;
|
||||
padding:0px;
|
||||
text-transform:uppercase;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
/* Portrait layout (default) */
|
||||
.app {
|
||||
background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */
|
||||
position:absolute; /* position in the center of the screen */
|
||||
left:50%;
|
||||
top:50%;
|
||||
height:50px; /* text area height */
|
||||
width:225px; /* text area width */
|
||||
text-align:center;
|
||||
padding:180px 0px 0px 0px; /* image height is 200px (bottom 20px are overlapped with text) */
|
||||
margin:-115px 0px 0px -112px; /* offset vertical: half of image height and text area height */
|
||||
/* offset horizontal: half of text area width */
|
||||
}
|
||||
|
||||
/* Landscape layout (with min-width) */
|
||||
@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) {
|
||||
.app {
|
||||
background-position:left center;
|
||||
padding:75px 0px 75px 170px; /* padding-top + padding-bottom + text area = image height */
|
||||
margin:-90px 0px 0px -198px; /* offset vertical: half of image height */
|
||||
/* offset horizontal: half of image width and text area width */
|
||||
}
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size:24px;
|
||||
font-weight:normal;
|
||||
margin:0px;
|
||||
overflow:visible;
|
||||
padding:0px;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.event {
|
||||
border-radius:4px;
|
||||
-webkit-border-radius:4px;
|
||||
color:#FFFFFF;
|
||||
font-size:12px;
|
||||
margin:0px 30px;
|
||||
padding:2px 0px;
|
||||
}
|
||||
|
||||
.event.listening {
|
||||
background-color:#333333;
|
||||
display:block;
|
||||
}
|
||||
|
||||
.event.received {
|
||||
background-color:#4B946A;
|
||||
display:none;
|
||||
}
|
||||
|
||||
@keyframes fade {
|
||||
from { opacity: 1.0; }
|
||||
50% { opacity: 0.4; }
|
||||
to { opacity: 1.0; }
|
||||
}
|
||||
|
||||
@-webkit-keyframes fade {
|
||||
from { opacity: 1.0; }
|
||||
50% { opacity: 0.4; }
|
||||
to { opacity: 1.0; }
|
||||
}
|
||||
|
||||
.blink {
|
||||
animation:fade 3000ms infinite;
|
||||
-webkit-animation:fade 3000ms infinite;
|
||||
}
|
2140
example/css/jquery.mobile-1.1.1.css
Executable file
2140
example/css/jquery.mobile-1.1.1.css
Executable file
File diff suppressed because it is too large
Load Diff
276
example/css/mobiscroll.core-2.0.1.css
Executable file
276
example/css/mobiscroll.core-2.0.1.css
Executable file
@ -0,0 +1,276 @@
|
||||
/* Datewheel overlay */
|
||||
.dw {
|
||||
min-width:170px;
|
||||
padding: 0 10px;
|
||||
position: absolute;
|
||||
top: 5%;
|
||||
left: 0;
|
||||
z-index: 1001;
|
||||
color: #000;
|
||||
font-family: arial, verdana, sans-serif;
|
||||
font-size: 12px;
|
||||
text-shadow: none;
|
||||
}
|
||||
.dwi {
|
||||
position: static;
|
||||
margin: 5px;
|
||||
display: inline-block;
|
||||
}
|
||||
.dwwr {
|
||||
zoom: 1;
|
||||
}
|
||||
/* Datewheel overlay background */
|
||||
.dwo {
|
||||
width: 100%;
|
||||
background: #000;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
opacity: .7;
|
||||
filter:Alpha(Opacity=70);
|
||||
}
|
||||
/* Datewheel wheel container wrapper */
|
||||
.dwc {
|
||||
float: left;
|
||||
margin: 0 2px 5px 2px;
|
||||
padding-top: 30px;
|
||||
}
|
||||
.dwcc {
|
||||
clear: both;
|
||||
}
|
||||
/* Datewheel label */
|
||||
.dwl {
|
||||
/*margin: 0 2px;*/
|
||||
text-align: center;
|
||||
line-height: 30px;
|
||||
height: 30px;
|
||||
white-space: nowrap;
|
||||
position: absolute;
|
||||
top: -30px;
|
||||
width: 100%;
|
||||
}
|
||||
/* Datewheel value */
|
||||
.dwv {
|
||||
padding: 10px 0;
|
||||
border-bottom: 1px solid #000;
|
||||
}
|
||||
/* Datewheel wheel container */
|
||||
.dwrc {
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.dwwc {
|
||||
margin: 0;
|
||||
padding: 0 2px;
|
||||
position: relative;
|
||||
background: #000;
|
||||
zoom:1;
|
||||
}
|
||||
/* Datewheel wheels */
|
||||
.dwwl {
|
||||
margin: 4px 2px;
|
||||
position: relative;
|
||||
background: #888;
|
||||
background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #000),color-stop(0.35, #333),color-stop(0.50, #888),color-stop(0.65, #333),color-stop(1, #000));
|
||||
background: -moz-linear-gradient(#000 0%,#333 35%, #888 50%,#333 65%,#000 100%);
|
||||
background: -ms-linear-gradient(#000 0%,#333 35%, #888 50%,#333 65%,#000 100%);
|
||||
background: -o-linear-gradient(#000 0%,#333 35%, #888 50%,#333 65%,#000 100%);
|
||||
}
|
||||
.dww {
|
||||
margin: 0 2px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
/*top: -30px;*/
|
||||
}
|
||||
.dwsc .dww {
|
||||
color: #fff;
|
||||
background: #444;
|
||||
background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #000),color-stop(0.45, #444),color-stop(0.55, #444),color-stop(1, #000));
|
||||
background: -moz-linear-gradient(#000 0%,#444 45%, #444 55%, #000 100%);
|
||||
background: -ms-linear-gradient(#000 0%,#444 45%, #444 55%, #000 100%);
|
||||
background: -o-linear-gradient(#000 0%,#444 45%, #444 55%, #000 100%);
|
||||
}
|
||||
.dww ul {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
/*display: block;
|
||||
width: 100%;*/
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
.dww li {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0 5px;
|
||||
display: block;
|
||||
text-align: center;
|
||||
line-height: 40px;
|
||||
font-size: 26px;
|
||||
white-space: nowrap;
|
||||
text-shadow: 0 1px 1px #000;
|
||||
opacity: .3;
|
||||
filter: Alpha(Opacity=30);
|
||||
}
|
||||
/* Valid entry */
|
||||
.dww li.dw-v {
|
||||
opacity: 1;
|
||||
filter: Alpha(Opacity=100);
|
||||
}
|
||||
/* Hidden entry */
|
||||
.dww li.dw-h {
|
||||
visibility: hidden;
|
||||
}
|
||||
/* Wheel +/- buttons */
|
||||
.dwwb {
|
||||
position: absolute;
|
||||
z-index: 4;
|
||||
left: 0;
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
.dwwbp {
|
||||
top: 0;
|
||||
-webkit-border-radius: 3px 3px 0 0;
|
||||
-moz-border-radius: 3px 3px 0 0;
|
||||
border-radius: 3px 3px 0 0;
|
||||
font-size: 40px;
|
||||
}
|
||||
.dwwbm {
|
||||
bottom: 0;
|
||||
-webkit-border-radius: 0 0 3px 3px;
|
||||
-moz-border-radius: 0 0 3px 3px;
|
||||
border-radius: 0 0 3px 3px;
|
||||
font-size: 32px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.dwpm .dwwc {
|
||||
background: transparent;
|
||||
}
|
||||
.dwpm .dww {
|
||||
margin: -1px;
|
||||
}
|
||||
.dwpm .dww li {
|
||||
text-shadow: none;
|
||||
}
|
||||
.dwpm .dwwol {
|
||||
display: none;
|
||||
}
|
||||
/* Datewheel wheel overlay */
|
||||
.dwwo {
|
||||
position: absolute;
|
||||
z-index: 3;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #000),color-stop(0.52, rgba(44,44,44,0)),color-stop(0.48, rgba(44,44,44,0)),color-stop(1, #000));
|
||||
background: -moz-linear-gradient(#000 0%,rgba(44,44,44,0) 52%, rgba(44,44,44,0) 48%, #000 100%);
|
||||
background: -ms-linear-gradient(#000 0%,rgba(44,44,44,0) 52%, rgba(44,44,44,0) 48%, #000 100%);
|
||||
background: -o-linear-gradient(#000 0%,rgba(44,44,44,0) 52%, rgba(44,44,44,0) 48%, #000 100%);
|
||||
}
|
||||
/* Background line */
|
||||
.dwwol {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 50%;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 0;
|
||||
margin-top: -1px;
|
||||
border-top: 1px solid #333;
|
||||
border-bottom: 1px solid #555;
|
||||
}
|
||||
/* Datewheel button */
|
||||
.dwbg .dwb {
|
||||
display: block;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 15px;
|
||||
margin: 0 2px;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
text-shadow:0 -1px 1px #000;
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius:5px;
|
||||
box-shadow:0 1px 3px rgba(0,0,0,0.5);
|
||||
-moz-box-shadow:0 1px 3px rgba(0,0,0,0.5);
|
||||
-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.5);
|
||||
color: #fff;
|
||||
background:#000;
|
||||
background:-webkit-gradient(linear,left bottom,left top,color-stop(0.5, #000),color-stop(0.5, #6e6e6e));
|
||||
background:-moz-linear-gradient(#6e6e6e 50%,#000 50%);
|
||||
background:-ms-linear-gradient(#6e6e6e 50%,#000 50%);
|
||||
background:-o-linear-gradient(#6e6e6e 50%,#000 50%);
|
||||
}
|
||||
/* Datewheel button container */
|
||||
.dwbc {
|
||||
/*margin-top: 5px;*/
|
||||
padding: 5px 0;
|
||||
text-align: center;
|
||||
clear: both;
|
||||
}
|
||||
/* Datewheel button wrapper */
|
||||
.dwbw {
|
||||
display: inline-block;
|
||||
width: 50%;
|
||||
}
|
||||
/* Hidden label */
|
||||
.dwhl {
|
||||
padding-top: 10px;
|
||||
}
|
||||
.dwhl .dwl {
|
||||
display: none;
|
||||
}
|
||||
/* Backgrounds */
|
||||
.dwbg {
|
||||
background: #fff;
|
||||
border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
}
|
||||
.dwbg .dwpm .dww {
|
||||
color: #000;
|
||||
background: #fff;
|
||||
border: 1px solid #AAA;
|
||||
}
|
||||
.dwbg .dwwb {
|
||||
background: #ccc;
|
||||
color: #888;
|
||||
text-shadow: 0 -1px 1px #333;
|
||||
box-shadow: 0 0 5px #333;
|
||||
-webkit-box-shadow: 0 0 5px #333;
|
||||
-moz-box-shadow: 0 0 5px #333;
|
||||
}
|
||||
.dwbg .dwwbp {
|
||||
background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #bdbdbd),color-stop(1, #f7f7f7));
|
||||
background: -moz-linear-gradient(#f7f7f7,#bdbdbd);
|
||||
background: -ms-linear-gradient(#f7f7f7,#bdbdbd);
|
||||
background: -o-linear-gradient(#f7f7f7,#bdbdbd);
|
||||
}
|
||||
.dwbg .dwwbm {
|
||||
background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #f7f7f7),color-stop(1, #bdbdbd));
|
||||
background: -moz-linear-gradient(#bdbdbd,#f7f7f7);
|
||||
background: -ms-linear-gradient(#bdbdbd,#f7f7f7);
|
||||
background: -o-linear-gradient(#bdbdbd,#f7f7f7);
|
||||
}
|
||||
.dwbg .dwb-a {
|
||||
background:#3c7500;
|
||||
background:-webkit-gradient(linear,left bottom,left top,color-stop(0.5, #3c7500),color-stop(0.5, #94c840));
|
||||
background:-moz-linear-gradient(#94c840 50%,#3c7500 50%);
|
||||
background:-ms-linear-gradient(#94c840 50%,#3c7500 50%);
|
||||
background:-o-linear-gradient(#94c840 50%,#3c7500 50%);
|
||||
}
|
||||
.dwbg .dwwl .dwb-a {
|
||||
background:#3c7500;
|
||||
background:-webkit-gradient(linear,left bottom,left top,color-stop(0, #3c7500),color-stop(1, #94c840));
|
||||
background:-moz-linear-gradient(#94c840,#3c7500);
|
||||
background:-ms-linear-gradient(#94c840,#3c7500);
|
||||
background:-o-linear-gradient(#94c840,#3c7500);
|
||||
}
|
47
example/css/mobiscroll.jqm-2.0.1.css
Executable file
47
example/css/mobiscroll.jqm-2.0.1.css
Executable file
@ -0,0 +1,47 @@
|
||||
/* jQuery Mobile Theme */
|
||||
.jqm .dwo {
|
||||
background: none;
|
||||
}
|
||||
.jqm .dw {
|
||||
padding: 6px;
|
||||
z-index: 1003;
|
||||
}
|
||||
.jqm .dwv {
|
||||
position: static;
|
||||
width: auto;
|
||||
padding: .7em 15px .7em 15px;
|
||||
border: 0;
|
||||
}
|
||||
.jqm .dwwr {
|
||||
border: 0;
|
||||
}
|
||||
.jqm .dwpm .dwwo {
|
||||
background: none;
|
||||
}
|
||||
.jqm .dwc {
|
||||
margin: 0;
|
||||
padding: 30px 5px 5px 5px;
|
||||
}
|
||||
.jqm .dwhl {
|
||||
padding: 5px;
|
||||
}
|
||||
.jqm .dwwb {
|
||||
margin: 0;
|
||||
border: 0;
|
||||
}
|
||||
.jqm .dwwb span {
|
||||
padding: 0;
|
||||
}
|
||||
.jqm .dwwbp .ui-btn-inner {
|
||||
-webkit-border-radius: 3px 3px 0 0;
|
||||
-moz-border-radius: 3px 3px 0 0;
|
||||
border-radius: 3px 3px 0 0;
|
||||
}
|
||||
.jqm .dwwbm .ui-btn-inner {
|
||||
-webkit-border-radius: 0 0 3px 3px;
|
||||
-moz-border-radius: 0 0 3px 3px;
|
||||
border-radius: 0 0 3px 3px;
|
||||
}
|
||||
.jqm .dwwbp span {
|
||||
font-weight: normal;
|
||||
}
|
81
example/index.html
Normal file
81
example/index.html
Normal file
@ -0,0 +1,81 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Phonegap Sample App</title>
|
||||
|
||||
<link href="css/jquery.mobile-1.1.1.css" rel="stylesheet" type="text/css"/>
|
||||
|
||||
<script type="text/javascript" src="js/jquery.js"></script>
|
||||
<script type="text/javascript" src="js/jquery.mobile-1.1.1.js"></script>
|
||||
|
||||
<script type="text/javascript" src="cordova.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
var onDeviceReady = function() {
|
||||
console.log("Device ready!")
|
||||
initiateUI();
|
||||
}
|
||||
var initiateUI = function() {
|
||||
$("#setAliasButton").click(function(ev) {
|
||||
console.log("setAliasButton");
|
||||
try{window.plugins.jPushPlugin.setAlias("myAlias");}
|
||||
catch(exception){console.log(exception);}
|
||||
|
||||
})
|
||||
$("#setTagButton").click(function(ev) {
|
||||
console.log("setTagButton");
|
||||
try{window.plugins.jPushPlugin.setTags("myAlias");}
|
||||
catch(exception){console.log(exception);}
|
||||
|
||||
})
|
||||
$("#setTagWithAliasButton").click(function(ev) {
|
||||
console.log("setTagWithAliasButton");
|
||||
try{window.plugins.jPushPlugin.setTagsWithAlias("myTags","myTags1","myTags2","myAlias");}
|
||||
catch(exception){console.log(exception);}
|
||||
|
||||
})
|
||||
}
|
||||
document.addEventListener("deviceready", onDeviceReady, false)
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div data-role="page" id="page">
|
||||
|
||||
<div data-role="header" class="ui-bar ui-bar-b">
|
||||
<center>
|
||||
<img border="0" src="img/logo.png" alt="Urban Airship" align="center" />
|
||||
</center>
|
||||
</div>
|
||||
<div data-role="content">
|
||||
<form>
|
||||
<div class="ui-body ui-body-b">
|
||||
|
||||
<div data-role="fieldcontain">
|
||||
<center><h3>JPushPlugin Example</h3></center>
|
||||
<span name="alias" id="alias"></span><hr />
|
||||
<label>Alias: </label>
|
||||
<input type="button" id="setAliasButton" value="Set alias" />
|
||||
</div>
|
||||
<div data-role="fieldcontain">
|
||||
<label>Tags: </label>
|
||||
<input type="button" id="setTagButton" value="Add tag" />
|
||||
<div id="tags"></div>
|
||||
</div>
|
||||
<div data-role="fieldcontain">
|
||||
<label>Tags and Alias: </label>
|
||||
<input type="button" id="setTagWithAliasButton" value="Add tag and alias" />
|
||||
<div id="tags"></div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
BIN
example/js/.DS_Store
vendored
Normal file
BIN
example/js/.DS_Store
vendored
Normal file
Binary file not shown.
9404
example/js/jquery.js
vendored
Executable file
9404
example/js/jquery.js
vendored
Executable file
File diff suppressed because it is too large
Load Diff
7690
example/js/jquery.mobile-1.1.1.js
Executable file
7690
example/js/jquery.mobile-1.1.1.js
Executable file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user