Skip to content
This repository was archived by the owner on Jan 7, 2020. It is now read-only.

Commit 018eb12

Browse files
author
Viv Rajkumar
committed
Merge branch 'master' of github.com:maidsafe/safe_examples_private
2 parents a8e9455 + 8cae6b2 commit 018eb12

File tree

8 files changed

+1120
-0
lines changed

8 files changed

+1120
-0
lines changed

comments_plugin/README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Comments Plugin Tutorial
2+
3+
The plugin works on safe_browser. This provides ability to add comments to any html page.
4+
5+
## Usage instructions:
6+
7+
### Dependencies
8+
9+
The plugin depends on **bootstrap v3.3.7** for UI and also **jquery v3.1.1.**
10+
The dependencies are included in this repository itself.
11+
12+
13+
### Getting Started
14+
15+
#### Include dependencies
16+
`<link href="./bootstrap-v3.3.7.min.css" rel="stylesheet">`
17+
`<script type="application/javascript" src="./jquery-3.1.1.min.js"/>`
18+
19+
#### Include tutorial plugin
20+
Add the stylesheet to your html page:
21+
`<link href="./comments-tutorial.css" rel="stylesheet">`
22+
23+
Add the script to your html page:
24+
`<script type="application/javascript" src="./comments-tutorial.js"/>`
25+
26+
### Initialise
27+
28+
The library must be initialised by invoking the `commentsTutorial.loadComments();` function.
29+
30+
The library will add comments UI to the `#comments` `div` element or the UI can be added to
31+
a specific DOM element by passing it's selector to the `init` method.
32+
33+
Example, `commentsTutorial.loadComments('#myDiv')`
34+
35+
36+
## Enabling Comments for page
37+
38+
The admin must enable the comments on a page by visiting the page and clicking on the `Enable Comments` Button.
39+
40+
This step is need at this time to make sure the admin becomes the owner of the `AppendableData` used to hold the comments.
41+
42+
## Example
43+
44+
An sample usage is demonstrated in the [example](./example) folder.
45+
46+
A simple static page with comments integrated is demonstrated.
47+
48+
# Limitations
49+
- Can not edit comments
50+
- AppendableData has a size limitation of 100Kb. Comments can not be added if the size of the appendable data has reached the max

comments_plugin/bootstrap-v3.3.7.min.css

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
.comment-block {
2+
width: 80%;
3+
font-family: 'Open Sans';
4+
padding-bottom: 120px;
5+
position: relative;
6+
min-height: 150px;
7+
margin-top: 24px;
8+
}
9+
10+
.comment-block .comment-enable, .comment-block .comments {
11+
display: none;
12+
}
13+
14+
.comment-block .comment-opt {
15+
display: none;
16+
margin-bottom: 16px;
17+
}
18+
19+
.comment-block .comment-spinner {
20+
display: none;
21+
position: absolute;
22+
top: 0;
23+
left: 0;
24+
width: 100%;
25+
height: 100%;
26+
margin-bottom: 30px;
27+
background-color: rgba(0, 0, 0, 0.5);
28+
}
29+
30+
.comment-block .comment-spinner .comment-spinner-b {
31+
padding: 60px 0 0;
32+
text-align: center;
33+
}
34+
35+
.comment-block .comment-spinner .comment-spinner-b i {
36+
font-size: 80px;
37+
color: #FFF;
38+
}
39+
40+
.media .media-heading {
41+
text-transform: capitalize;
42+
}
43+
44+
.media .media-heading small {
45+
margin-left: 8px;
46+
}
47+
48+
.media .media-options {
49+
margin: 0;
50+
text-align: right;
51+
}
52+
53+
.media .media-options button {
54+
margin-left: 8px;
55+
}
56+
57+
.spinner {
58+
margin: 30px auto;
59+
font-size: 10px;
60+
position: relative;
61+
text-indent: -9999em;
62+
border-top: 5px solid rgba(255, 255, 255, 0.2);
63+
border-right: 5px solid rgba(255, 255, 255, 0.2);
64+
border-bottom: 5px solid rgba(255, 255, 255, 0.2);
65+
border-left: 5px solid #ffffff;
66+
-webkit-transform: translateZ(0);
67+
-ms-transform: translateZ(0);
68+
transform: translateZ(0);
69+
-webkit-animation: spin 1.1s infinite linear;
70+
animation: spin 1.1s infinite linear;
71+
}
72+
.spinner,
73+
.spinner:after {
74+
border-radius: 50%;
75+
width: 50px;
76+
height: 50px;
77+
display: inline-block;
78+
}
79+
80+
@-webkit-keyframes spin {
81+
0% {
82+
-webkit-transform: rotate(0deg);
83+
transform: rotate(0deg);
84+
}
85+
100% {
86+
-webkit-transform: rotate(360deg);
87+
transform: rotate(360deg);
88+
}
89+
}
90+
@keyframes spin {
91+
0% {
92+
-webkit-transform: rotate(0deg);
93+
transform: rotate(0deg);
94+
}
95+
100% {
96+
-webkit-transform: rotate(360deg);
97+
transform: rotate(360deg);
98+
}
99+
}
100+
101+
.popup {
102+
width: 100%;
103+
height: 100%;
104+
position: fixed;
105+
top: 0;
106+
left: 0;
107+
display: none;
108+
background-color: rgba(0, 0, 0, 0.5);
109+
}
110+
.popup .popup-container {
111+
width: 585px;
112+
min-height: 200px;
113+
margin: 150px auto 0;
114+
background-color: #FFF;
115+
border-radius: 5px;
116+
overflow: hidden;
117+
}
118+
.popup .popup-container .head {
119+
margin: 0;
120+
font-size: 18px;
121+
line-height: 50px;
122+
padding: 0 16px;
123+
background-color: #EEE;
124+
}
125+
.popup .popup-container .content {
126+
padding-top: 16px;
127+
}
128+
.popup .popup-container .foot {
129+
padding: 16px;
130+
text-align: right;
131+
}
132+
.popup .popup-container .foot button {
133+
margin-left: 12px;
134+
}

0 commit comments

Comments
 (0)