summaryrefslogtreecommitdiff
path: root/public/js/cover.js
blob: fea51f6a8ff1e07f09cf1d83ebf63ed0227faae4 (plain)
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
$(".masthead-nav li").click(function () {
    $(this).siblings().removeClass("active");
    $(this).addClass("active");
});

$(".ui-home").click(function () {
    $(".section").hide();
    $("#home").fadeIn();
});

$(".ui-history").click(function () {
    $(".section").hide();
    $("#history").fadeIn();
});

$(".ui-releasenotes").click(function () {
    $(".section").hide();
    $("#releasenotes").fadeIn();
});

function checkHistoryList() {
    if ($("#history-list").children().length > 0)
        $(".ui-nohistory").hide();
    else if ($("#history-list").children().length == 0) {
        $(".ui-nohistory").slideDown();
        var cookienotehistory = JSON.parse($.cookie('notehistory'));
        if (login && cookienotehistory && cookienotehistory.length > 0) {
            $(".ui-import-from-cookie").slideDown();
        }
    }
}

function parseHistoryCallback() {
    checkHistoryList();
    $(".ui-history-close").click(function (e) {
        e.preventDefault();
        var id = $(this).closest("a").attr("href").split('/')[1];
        getHistory(function (notehistory) {
            var newnotehistory = removeHistory(id, notehistory);
            saveHistory(newnotehistory);
        });
        $(this).closest("li").remove();
        checkHistoryList();
    });
}

var login = false;

checkIfAuth(
    function (data) {
        $('.ui-signin').hide();
        $('.ui-or').hide();
        $('.ui-welcome').show();
        $('.ui-name').html(data.name);
        $('.ui-signout').show();
        $(".ui-history").click();
        login = true;
    },
    function () {
        $('.ui-signin').slideDown();
        $('.ui-or').slideDown();
        login = false;
    }
);

parseHistory(parseHistoryCallback);

$(".ui-import-from-cookie").click(function () {
    saveCookieHistoryToServer(function() {
        parseCookieToHistory(parseHistoryCallback);
        $(".ui-import-from-cookie").hide();
    });
});

var source = $("#template").html();
var template = Handlebars.compile(source);
var context = {
    release: [
        {
            version: "0.2.7",
            tag: "fuel",
            date: moment("201505031200", 'YYYYMMDDhhmm').fromNow(),
            detail: [
                {
                    title: "Features",
                    item: [
                            "+ Support facebook, twitter, github, dropbox login",
                            "+ Support own history"
                        ]
                    },
                {
                    title: "Enhancements",
                    item: [
                            "* Adjust history ui",
                            "* Upgrade realtime package",
                            "* Upgrade editor package, now support composition input better"
                        ]
                    },
                {
                    title: "Fixes",
                    item: [
                            "* Partial update might not render properly",
                            "* Cursor focus might not at correct position"
                        ]
                    }
                ]
            },
        {
            version: "0.2.6",
            tag: "zippo",
            date: moment("201504241600", 'YYYYMMDDhhmm').fromNow(),
            detail: [
                {
                    title: "Features",
                    item: [
                            "+ Support sync scroll",
                            "+ Support partial update"
                        ]
                    },
                {
                    title: "Enhancements",
                    item: [
                            "* Added feedback ui",
                            "* Adjust animations and delays",
                            "* Adjust editor viewportMargin for performance",
                            "* Adjust emit refresh event occasion",
                            "* Added editor fallback fonts",
                            "* Index page auto focus at history if valid"
                        ]
                    },
                {
                    title: "Fixes",
                    item: [
                            "* Server might not disconnect client properly",
                            "* Resume connection might restore wrong info"
                        ]
                    }
                ]
            },
        {
            version: "0.2.5",
            tag: "lightning",
            date: moment("201504142110", 'YYYYMMDDhhmm').fromNow(),
            detail: [
                {
                    title: "Features",
                    item: [
                            "+ Support import from dropbox and clipboard",
                            "+ Support more code highlighting",
                            "+ Support mathjax, sequence diagram and flow chart"
                        ]
                    },
                {
                    title: "Enhancements",
                    item: [
                            "* Adjust toolbar and layout style",
                            "* Adjust mobile layout style",
                            "* Adjust history layout style",
                            "* Server using heartbeat to gain accuracy of online users"
                        ]
                    },
                {
                    title: "Fixes",
                    item: [
                            "* Virtual keyboard might broken the navbar",
                            "* Adjust editor viewportMargin for preloading content"
                        ]
                    }
                ]
            },
        {
            version: "0.2.4",
            tag: "flint",
            date: moment("201504101240", 'YYYYMMDDhhmm').fromNow(),
            detail: [
                {
                    title: "Features",
                    item: [
                            "+ Support save to dropbox",
                            "+ Show other users' cursor with light color"
                        ]
                    },
                {
                    title: "Enhancements",
                    item: [
                            "* Adjust toolbar layout style for future"
                        ]
                    },
                {
                    title: "Fixes",
                    item: [
                            "* Title might not render properly",
                            "* Code border style might not show properly",
                            "* Server might not connect concurrent client properly"
                        ]
                    }
                ]
            },
        {
            version: "0.2.3",
            tag: "light",
            date: moment("201504062030", 'YYYYMMDDhhmm').fromNow(),
            detail: [
                {
                    title: "Features",
                    item: [
                            "+ Support youtube, vimeo",
                            "+ Support gist",
                            "+ Added quick link in pretty",
                            "+ Added font-smoothing style"
                        ]
                    },
                {
                    title: "Enhancements",
                    item: [
                            "* Change the rendering engine to remarkable",
                            "* Adjust view, todo list layout style for UX",
                            "+ Added responsive layout check",
                            "+ Auto reload if client version mismatch",
                            "+ Keep history stack after reconnect if nothing changed",
                            "+ Added features page"
                        ]
                    },
                {
                    title: "Fixes",
                    item: [
                            "* Closetags auto input might not have proper origin",
                            "* Autofocus on editor only if it's on desktop",
                            "+ Prevent using real script and iframe tags",
                            "* Sorting in history by time not percise"
                        ]
                    }
                ]
            },
        {
            version: "0.2.2",
            tag: "fire",
            date: moment("201503272110", 'YYYYMMDDhhmm').fromNow(),
            detail: [
                {
                    title: "Features",
                    item: [
                            "+ Support smartLists, smartypants",
                            "+ Support line number on code block",
                            "+ Support tags and search or sort history"
                        ]
                    },
                {
                    title: "Enhancements",
                    item: [
                            "+ Added delay on socket change",
                            "+ Updated markdown-body width to match github style",
                            "+ Socket changes now won't add to editor's history",
                            "* Reduce redundant server events"
                        ]
                    },
                {
                    title: "Fixes",
                    item: [
                            "* Toolbar links might get wrong",
                            "* Wrong action redirections"
                        ]
                    }
                ]
            },
        {
            version: "0.2.1",
            tag: "spark",
            date: moment("201503171340", 'YYYYMMDDhhmm').fromNow(),
            detail: [
                {
                    title: "Features",
                    item: [
                            "+ Support github-like todo-list",
                            "+ Support emoji"
                        ]
                    },
                {
                    title: "Enhancements",
                    item: [
                            "+ Added more effects on transition",
                            "+ Reduced rendering delay",
                            "+ Auto close and match brackets",
                            "+ Auto close and match tags",
                            "+ Added code fold and fold gutters",
                            "+ Added continue listing of markdown"
                        ]
                    }
                ]
            },
        {
            version: "0.2.0",
            tag: "launch-day",
            date: moment("201503142020", 'YYYYMMDDhhmm').fromNow(),
            detail: [
                {
                    title: "Features",
                    item: [
                            "+ Markdown editor",
                            "+ Preview html",
                            "+ Realtime collaborate",
                            "+ Cross-platformed",
                            "+ Recently used history"
                        ]
                    }
                ]
            }
        ]
};
var html = template(context);
$("#releasenotes").html(html);