-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathk-viewer-doc.html
69 lines (60 loc) · 1.84 KB
/
k-viewer-doc.html
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
<link rel="import" href="../polymer/polymer.html">
<!--
## Doc Sample
- dev-builds.libreoffice.org/tmp/test.docx (Writer)
- dev-builds.libreoffice.org/tmp/test.xlsx (Spreadsheets)
- dev-builds.libreoffice.org/tmp/test.pptx (Presentation)
@demo demo/index.html basic demo
-->
<dom-module id="k-viewer-doc">
<template>
<style>
.char {
font-family: monospace;
font-size: 22px;
}
.container {
width: 100%;
height: 400px;
}
.label{
font-family: Roboto,sans-serif;
background-color: #263238;
padding: 5px;
color: #fff;
}
</style>
<template is="dom-if" if="{{__ifNull(source)}}">
<div align="center" style="padding: 50px;">
<span class="char">Document not found!</span>
</div>
</template>
<template is="dom-if" if="{{__ifNotNull(source)}}">
<div class="label">[[label]]</div>
<iframe class="container" src="{{__loader}}{{source}}"></iframe>
</template>
</template>
<script>
Polymer({
is: 'k-viewer-doc',
properties:
{
label: {
type: String,
value: null
},
/* ONLY URL */
source: {
type: String,
value: null
},
__loader: {
type: String,
value: 'https://view.officeapps.live.com/op/embed.aspx?src='
}
},
__ifNull: function(s){ return s === null; },
__ifNotNull: function(s){ return s !== null; }
});
</script>
</dom-module>