-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy patheditable-text-demo.html
56 lines (54 loc) · 3.21 KB
/
editable-text-demo.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
<head>
<title>editable-text-example</title>
</head>
<body>
<a href="https://github.com/JackAdams/editable-text-demo"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/652c5b9acfaddf3a9c326fa6bde407b87f7be0f4/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6f72616e67655f6666373630302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png"></a>
<div class="container">
<div style="float:right;margin-top:10px;">{{> undoRedoButtons}}</div>
<ul style="list-style-type:none;margin: 10px 0 0 0;padding: 0;display:inline-block;">{{> loginButtons}}</ul>
{{> posts}}
</div>
</body>
<template name="posts">
<div style="margin-top:10px;">
<span class="btn btn-warning editable-text-trigger">
<i class="fa fa-plus"></i> New post{{> editableText context=newCommentDoc collection="posts" field="title" autoInsert=true beforeInsert="addTimestampToDoc"}}
</span>
</div>
{{#each posts}}
<div class="post">
<h2 class="editable-text-trigger">
{{> editableText options=postOptions emptyText="No title" beforeUpdate="callMethod"}}
</h2>
<!--<div class="btn-group" style="float: right;">
<button class="btn froala {{#if selected 'froala'}}btn-default{{/if}}">Froala</button>
<button class="btn default {{#if selected 'default'}}btn-default{{/if}}">Default</button>
</div>-->
<span style="color:grey;"><strong>{{#if user}}{{> editableText collection="posts" field="user"}}{{else}}Anonymous{{/if}}</strong> - {{timestamp}}</span>
<hr />
<div class="editable-text-trigger">
<!--{{#if selected 'froala'}}
{{> editableText collection="posts" field="body" editor="froala" class="post-body"}}
{{else}}-->
{{> editableText collection="posts" field="body" wysiwyg=true acceptEmpty=true substitute='<i class="fa fa-pencil"></i>' class="post-body" inputClass="post-body-wysiwyg"}}
<!--{{/if}}-->
</div>
<div class="editable-list-reveal" style="margin-top:10px;color:grey;">
{{#with tags}}Tags: {{/with}}{{> editableList collection="posts" field="tags" placeholder="New tag" horizontal=true hideInput=true class="list-item" liStyle="margin-top:10px;" inputStyle="color:#000;" editStyle="height:18px;border:0;" objectTypeText="tag" allowPasteMultiple=true}}
</div>
<hr />
<h4>Comments</h4>
{{#each comments}}
<div class="comment editable-text-trigger">
<div class="comment-info"><strong>{{#if user}}{{user}}{{else}}Anonymous{{/if}}</strong> commented on {{timestamp}}</div>
{{> editableText collection="comments" field="text" textarea=true removeEmpty=true acceptEmpty=true trustHTML=true substitute='<i class="fa fa-pencil"></i>' class="comment-text" inputClass="comment-input"}}
</div>
{{/each}}
{{#with post_id=_id}}
<span class="btn btn-default editable-text-trigger">
<i class="fa fa-plus"></i>{{> editableText collection="comments" field="text" autoInsert=true beforeInsert="addTimestampToDoc"}}
</span>
{{/with}}
</div>
{{/each}}
</template>