-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
163 lines (151 loc) · 5.63 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Simple Editor: Fundly</title>
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Roboto:100,100italic,300,300italic,400,400italic,500,500italic,700,700italic,900,900italic|Roboto+Condensed:700,700italic,400,400italic,300,300italic|Roboto+Slab:100,300,400,700">
<link rel="stylesheet" href="bower_components/fundly-style-guide/dist/fundly-style.css">
<link href="//doapv6pcsx1wa.cloudfront.net/assets/favicon_heart-a320686c4520c1eb2ac76c32181c1787.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript" src="simple_editor.js"></script>
<style>
.f-content-section {
text-align: left;
color: black;
line-height: 1.35em;
font-family: "Roboto Condensed", Helvetica, Arial, sans-serif;
font-size: 18px;
font-weight: 300;
}
.f-content-section h2 {
font-size: 24px;
line-height: 1.35em;
padding-top: 0px;
padding-bottom: 30px;
}
.f-content-section ul {
margin-left: 14px;
padding-left: 36px; }
.f-content-section div, .f-content-section p, .f-content-section ul {
margin-top: 0px;
margin-bottom: 20px;
}
.f-content-section div, .f-content-section p, .f-content-section li {
line-height: inherit;
font-family: inherit;
font-size: inherit;
font-weight: inherit;
}
.f-content-section li {
list-style: disc; }
.f-content-section a {
font-weight: 300;
color: #59CAE9; }
.f-content-section a:hover {
text-decoration: underline; }
.f-content-section strong, .f-content-section b {
font-weight: 700; }
.f-content-section i, .f-content-section em {
font-style: italic;
font-weight: 300; }
</style>
</head>
<body>
<div class="f-p-xlarge">
<ul class="f-list-inline f-font-condensed f-fc-black f-m-b-medium">
<li class="hint--top" data-hint="Bold">
<a href="#" class="js-bold"><span class="fa fa-bold"></span></a>
</li>
<li class="hint--top" data-hint="Italic">
<a href="#" class="js-italic"><span class="fa fa-italic"></span></a>
</li>
<li class="hint--top" data-hint="Add Link">
<a href="#" class="js-link"><span class="fa fa-link"></span></a>
</li>
<li class="hint--top" data-hint="Remove Link">
<a href="#" class="js-unlink"><span class="fa fa-unlink"></span></a>
</li>
<li class="hint--top" data-hint="Create List">
<a href="#" class="js-list"><span class="fa fa-list-ul"></span></a>
</li>
<li class="hint--top" data-hint="Insert Image">
<a href="#" class="js-image"><span class="fa fa-picture-o"></span></a>
</li>
<li class="f-m-l-large"><a href="#" class="js-heading">Heading</a></li>
<li><a href="#" class="js-paragraph">Paragraph</a></li>
</ul>
<div class="f-m-t-medium f-b-xlight f-p-medium">
<!-- <div id="editable" placeholder="This is a placeholder">
<h2>This is a sample header</h2>
<p>This is a sample paragraph with a <a>link</a>.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laboriosam, molestiae, fugit esse quos tenetur voluptates tempora amet praesentium explicabo aliquam illum ut necessitatibus nisi voluptas ab facilis perferendis vitae voluptate.</p>
</div> -->
<div id="editable" placeholder="This is a placeholder!"></div>
</div>
</div>
<script>
$(function(){
window.editor = new SimpleEditor( '#editable', {
minHeight: 600,
css: {
target: 'f-content-section',
placeholder: 'f-fc-medium f-font-italic f-fs-large'
},
attributeWhiteList: {
img: ['src', 'data-src', 'style']
}
});
$('.js-bold').click(function(e){
e.preventDefault();
editor.bold();
});
$('.js-italic').click(function(e){
e.preventDefault();
editor.italic();
});
$('.js-list').click(function(e){
e.preventDefault();
editor.unorderedList();
});
$('.js-heading').click(function(e){
e.preventDefault();
editor.heading();
});
$('.js-paragraph').click(function(e){
e.preventDefault();
editor.paragraph();
});
$('.js-link').click(function(e){
e.preventDefault();
editor.link('http://fundly.com', function(newLink){
$(newLink).attr('target', '_blank');
console.log('newLink', newLink);
});
});
$('.js-unlink').click(function(e){
e.preventDefault();
editor.unlink();
});
$('.js-image').click(function(e){
e.preventDefault();
var imgs = [
'https://d8dkyqrw18ein.cloudfront.net/s/977bd995b8a84531cf7d01b9813381bc_ar_w600_h400.jpg',
'https://d8dkyqrw18ein.cloudfront.net/s/310a960d189bf7f71c233a1306f42060_ar_w600_h400.jpg',
'https://d8dkyqrw18ein.cloudfront.net/s/0037cae3920426df83a501817ac598b9_as_w150_h150.jpg',
'https://pbs.twimg.com/media/BijA2RxIQAEfp5N.jpg:medium'
];
var imgLink = imgs[editor.$target.find('img').length];
editor.img(imgLink, function(newImg){
var $newImg = $(newImg);
if (newImg.parentNode === editor.target){
$newImg.wrap('<p></p>');
}
$newImg
.css({ 'maxHeight': '200px' })
.attr('data-src', $(newImg).attr('src'));
});
});
});
</script>
</body>
</html>