forked from LanGuo/smartdown_vuegridlayout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
183 lines (164 loc) · 6.62 KB
/
index.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Smartdown Grid Layout (using vue-grid-layout) </title>
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="stylesheet" href="vuegridlayout.css">
<!-- <link rel="stylesheet" href="https://127.0.0.1:4000/lib/smartdown.css"> -->
<!-- <script src="https://127.0.0.1:4000/lib/smartdown.js"></script> -->
<link rel="stylesheet" href="https://smartdown.site/lib/fonts.css">
<link rel="stylesheet" href="https://smartdown.site/lib/smartdown.css">
<script src="https://smartdown.site/lib/smartdown.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<script src="https://unpkg.com/js-yaml/dist/js-yaml.min.js"></script>
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<script src="https://unpkg.com/vue-grid-layout/dist/vue-grid-layout.min.js"></script>
</head>
<body
class="container container-fluid"
id="bodyID">
<div
v-cloak
v-bind:class="{ 'disable-select': isDragging() }"
id="layoutApp">
<div
class="navigationArea">
<div class="row" v-if="tableaux.length > 0">
<div class="col-xs-10" style="padding:0;">
<button
v-for="t in tableaux"
class="btn btn-default btn-xs tableau-button"
v-bind:class="{ current: isCurrentTableau(t) }"
v-bind:disabled="isCurrentTableau(t)"
v-on:click="loadTableauByName(t)">
{{t}}
</button>
</div>
<div class="col-xs-2" style="padding:0;">
<button
class="btn btn-default btn-xs"
v-on:click="loadHomeTableau()">
Home
</button>
</div>
</div>
<div class="row">
<div class="col-xs-10" style="padding:0;">
<button
v-for="item in tableau.layout.cells"
class="btn btn-default btn-xs card-button"
v-bind:class="{ focused: isCardFocused(item.name) }"
v-on:click="toggleFocusOnCard(item.name)">
{{item.name}}
</button>
</div>
<div class="col-xs-2" style="padding:0;">
<button
class="btn btn-default btn-xs card-button"
v-on:click="focusOnCard('')">
None
</button>
</div>
</div>
</div>
<div
v-if="!kioskMode"
class="authorArea">
<div
class="toggle-author-area-button" @click="toggleAuthorMode()">
≡
</div>
<div class="row" v-if="authorMode">
<div class="col-xs-8">
<input
type="file"
id="selectedFiles"
accept=".md,.yaml"
v-on:change="filesSelected"
multiple/>
</div>
<div class="col-xs-4">
<button class="btn btn-default btn-xs" v-on:click="exportTableau">Export Tableau</button>
</div>
<div class="col-xs-12">
<button class="btn btn-default btn-xs" v-on:click="switchToColumnLayout">Column Layout</button>
<button class="btn btn-default btn-xs" v-on:click="switchToRowLayout">Row Layout</button>
<button class="btn btn-default btn-xs" v-on:click="switchToStaggeredLayout">Staggered Layout</button>
<button class="btn btn-default btn-xs" v-on:click="switchToXLayout">X Layout</button>
</div>
</div>
<div class="row" v-if="authorMode">
<div class="col-xs-12">
<div class="layoutItem" v-for="item in tableau.layout.cells">
<b>{{item.i}}</b>: [{{item.x}}, {{item.y}}, {{item.w}}, {{item.h}}]
</div>
</div>
</div>
</div>
<div id="content" class="smartdown-container">
<grid-layout ref="layout"
:layout="tableau.layout.cells"
:col-num="numCols"
:row-height="rowHeight"
:margin="[5, 5]"
:is-draggable="draggable"
:is-resizable="resizable"
:vertical-compact="true"
:use-css-transforms="true">
<grid-item
v-for="item in tableau.layout.cells"
:key="item.i"
:x="item.x"
:y="item.y"
:w="item.w"
:h="item.h"
:i="item.i"
v-bind:class="{ 'in-focus': isCardFocused(item.name) }"
@resized="resizedEvent"
drag-allow-from=".vue-draggable-handle"
drag-ignore-from=".no-drag">
<div
class="vue-draggable-handle"
v-bind:class="{ 'hide-draggable': !draggable }"
v-on:click="dragStart">
</div>
<!--
work in progress to create a smartdown component and simplify applySmartdown()
and fitContent(). See grid_helper.js for more info.
<smartdown
class="no-drag smartdown-tile"
v-bind:class="{ 'in-focus': isCardFocused(item.name) }"
v-bind:id="item.divID"
:content="item.content">
</smartdown>
-->
<div
class="no-drag smartdown-tile"
v-bind:id="item.divID">
</div>
</grid-item>
</grid-layout>
</div>
</div>
<script>
//
// The options below control how the grid_helper behaves.
// They are designed to support publishing via bl.ocks.org, a blog, or Wordpress
//
// kioskMode - 'true' means disable the Settings checkbox
// tableaux - A list of names of tableaux in the tableaux/ directory
// defaultTableauName - The tableau to load by default. Default is tableaux[0]
//
window.gridHelperOptions = {
kioskMode: false,
authorMode: false,
tableauxPrefix: 'tableaux/',
tableaux: ['Welcome', 'Comic', 'Gallery', 'WebGL'],
defaultTableauName: 'Welcome',
};
</script>
<script src="grid_helper.js"></script>
</body>
</html>