forked from forcedotcom/mobile-ui-elements
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
71 lines (64 loc) · 3.65 KB
/
index.html
File metadata and controls
71 lines (64 loc) · 3.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width">
<!-- Importing Google Polymer framework -->
<script src="dependencies/webcomponentsjs/webcomponents.min.js"></script>
<!-- Include cordova script. Will be available when we create SDK project -->
<script src="cordova.js"></script>
<!-- START_MOCK: Scripts for local testing with mock cordova plugins -->
<script src="dependencies/mobilesdk-shared/test/MockCordova.js"></script>
<script src="dependencies/mobilesdk-shared/libs/cordova.force.js"></script>
<script src="dependencies/mobilesdk-shared/test/MockSmartStore.js"></script>
<!-- End of mock scripts :END_MOCK -->
<!-- Place your HTML imports here -->
<link rel="import" href="elements/mobile-ui-elements.html">
<link rel="import" href="dependencies/core-icons/core-icons.html">
<!-- Font-face imports. Bug in chrome -->
<link rel="stylesheet" href="elements/css/ratcheticons.css">
</head>
<body touch-action="auto">
<polymer-element name="mobile-app">
<template>
<force-signin consumerkey="3MVG9QDx8IX8nP5TwrwtRg53zXgW0xeFBfLMzPRJ4aNy8z7MsSSDjNj.NLu4pSY4B8V3sbYSLrhAMJWxs39jB" callbackurl="http://localhost:9000" proxyurl="{{proxy}}"></force-signin>
<force-ui-app id="force_app" multipage="true">
<h1 class="title">Accounts</h1>
<force-ui-list id="force_ui_list" sobject="Account" class="page content" on-core-activate="{{showDetail}}"></force-ui-list>
<force-ui-detail flex id="force_ui_detail" sobject="Account" recordid="{{$.force_ui_list.selected}}" class="page content">
<force-sobject-relatedlists id="force_relatedlists" sobject="Account" recordid="{{$.force_ui_list.selected}}"></force-sobject-relatedlists>
<template repeat="{{related in $.force_relatedlists.relatedLists}}">
<force-ui-relatedlist related="{{related}}"></force-ui-relatedlist>
</template>
</force-ui-detail>
</force-ui-app>
<core-icon id="network_icon" icon="{{cloudicon}}" class="bottomright" style="position: fixed; bottom: 0; right: 0; margin: 10px; zoom: 2; fill: green; -webkit-tap-highlight-color: rgba(0,0,0,0);" on-tap="{{toggleStatus}}"></core-icon>
</template>
<script type="text/javascript">
Polymer('mobile-app', {
_onlineStatus: true,
cloudicon: 'cloud-done',
proxy: (location.protocol === 'file:') ? null : location.origin,
showDetail: function(e) {
this.$.force_app.navigateTo('#force_ui_detail');
},
get onlineStatus() {
return this._onlineStatus;
},
set onlineStatus(status) {
SFDC.isOnline = function() { return status };
this._onlineStatus = status;
this.$.force_ui_list.querytype = (status ? "mru" : "cache");
this.cloudicon = status ? "cloud-done" : "cloud-off";
this.$.network_icon.style.fill = status ? 'green' : 'red';
},
toggleStatus: function() {
this.onlineStatus = !this.onlineStatus;
},
});
</script>
</polymer-element>
<mobile-app></mobile-app>
</body>
</html>