Skip to content

Commit 2f5edea

Browse files
committed
Refactoring site and iframes
1 parent 03e6c72 commit 2f5edea

File tree

6 files changed

+69
-96
lines changed

6 files changed

+69
-96
lines changed

00-getting-started.md

Lines changed: 27 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ Include the Following code in the <code>head</code> area of your HTML page.
4444
{% highlight html %}
4545
<!-- include libraries(jQuery, bootstrap) -->
4646
<link href="{{ site.bootstrap_css }}" rel="stylesheet">
47-
<script src="{{ site.jquery_js }}"></script>
48-
<script src="{{ site.bootstrap_js }}"></script>
47+
<script src="{{ site.jquery_js }}"></script>
48+
<script src="{{ site.bootstrap_js }}"></script>
4949

5050
<!-- include summernote css/js -->
5151
<link href="{{ site.summernote_css }}" rel="stylesheet">
@@ -99,8 +99,8 @@ You can also test running example. Save below code as `index.html` and open it w
9999
<meta charset="UTF-8">
100100
<title>Summernote</title>
101101
<link href="{{ site.bootstrap_css }}" rel="stylesheet">
102-
<script src="{{ site.jquery_js }}"></script>
103-
<script src="{{ site.bootstrap_js }}"></script>
102+
<script src="{{ site.jquery_js }}"></script>
103+
<script src="{{ site.bootstrap_js }}"></script>
104104
<link href="{{ site.summernote_css }}" rel="stylesheet">
105105
<script src="{{ site.summernote_js }}"></script>
106106
</head>
@@ -119,63 +119,36 @@ You can also test running example. Save below code as `index.html` and open it w
119119

120120
### For bootstrap 4
121121

122-
You can also use Summernote with Bootstrap 4 using `summernote-bs4.js` and `summernote-bs4.css`. This is also beta version, as Bootstrap 4 is in beta. Below is a code example using bootstrap 4.
122+
You can also use Summernote with Bootstrap 4 using `summernote-bs4.js` and `summernote-bs4.css`.
123123

124-
<iframe src="/bs4.html" width="100%" height="200" frameborder="0"></iframe>
124+
<iframe id="bs4-frame" width="100%" height="200" frameborder="0">
125+
{% include bs4.html %}
126+
</iframe>
127+
<script>
128+
var bs4_frame = document.querySelector('#bs4-frame');
129+
bs4_frame.contentDocument.write(bs4_frame.innerHTML);
130+
bs4_frame.innerHTML = '';
131+
</script>
125132

126133
{% highlight html %}
127-
<!DOCTYPE html>
128-
<html lang="en">
129-
<head>
130-
<meta charset="UTF-8">
131-
<title>bootstrap4</title>
132-
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css">
133-
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
134-
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script>
135-
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js"></script>
136-
<link href="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote-bs4.css" rel="stylesheet">
137-
<script src="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote-bs4.js"></script>
138-
</head>
139-
<body>
140-
<div id="summernote"></div>
141-
<script>
142-
$('#summernote').summernote({
143-
placeholder: 'Hello bootstrap 4',
144-
tabsize: 2,
145-
height: 100
146-
});
147-
</script>
148-
</body>
149-
</html>
134+
{% include bs4.html %}
150135
{% endhighlight %}
151136

152137
### Without Bootstrap
153138

154-
You can use Summernote without Bootstrap using `summernote-lite.js` and `summernote-lite.css`. The Lite version is currently in Beta. Please report bugs so we can improve it. Below is a code example using summernote lite.
139+
You can use Summernote without Bootstrap using `summernote-lite.js` and `summernote-lite.css`.
155140

156-
<iframe src="/lite.html" width="100%" height="200" frameborder="0"></iframe>
141+
<iframe id="lite-frame" width="100%" height="200" frameborder="0">
142+
{% include lite.html %}
143+
</iframe>
144+
<script>
145+
var lite_frame = document.querySelector('#lite-frame');
146+
lite_frame.contentDocument.write(lite_frame.innerHTML);
147+
lite_frame.innerHTML = '';
148+
</script>
157149

158150
{% highlight html %}
159-
<!DOCTYPE html>
160-
<html lang="en">
161-
<head>
162-
<meta charset="UTF-8">
163-
<title>Summernote Lite</title>
164-
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
165-
<link href="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote-lite.css" rel="stylesheet">
166-
<script src="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote-lite.js"></script>
167-
</head>
168-
<body>
169-
<div id="summernote"></div>
170-
<script>
171-
$('#summernote').summernote({
172-
placeholder: 'Hello stand alone ui',
173-
tabsize: 2,
174-
height: 100
175-
});
176-
</script>
177-
</body>
178-
</html>
151+
{% include lite.html %}
179152
{% endhighlight %}
180153

181154
## Basic API
@@ -261,9 +234,9 @@ for more detail api: [deep dive with api](/deep-dive/#api)
261234
Include libraries with lang file. eg) <code>summernote-ko-KR.js</code>.
262235

263236
{% highlight html %}
264-
<link href="{{ site.bootstrap_css }}" rel="stylesheet">
265-
<script src="{{ site.jquery_js }}"></script>
266-
<script src="{{ site.bootstrap_js }}"></script>
237+
<link href="{{ site.bootstrap_css }}" rel="stylesheet">
238+
<script src="{{ site.jquery_js }}"></script>
239+
<script src="{{ site.bootstrap_js }}"></script>
267240

268241
<link href="summernote.css" rel="stylesheet">
269242
<script src="summernote.min.js"></script>

_config.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ description: > # this means to ignore newlines until "baseurl:"
66
Summernote is a JavaScript library that helps you create WYSIWYG editors online.
77
author: https://github.com/summernote
88
baseurl: "" # the subpath of your site, e.g. /blog/
9-
url: "http://summernote.org" # the base hostname & protocol for your site
9+
url: "https://summernote.org" # the base hostname & protocol for your site
1010
github_username: summernote
1111

1212
# Summernote settings
13-
version: 0.8.12
13+
version: 0.8.15
1414
repository: "https://github.com/summernote/summernote"
15-
jquery_js: "http://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js"
16-
bootstrap_css: "http://netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.css"
17-
bootstrap_js: "http://netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.js"
18-
summernote_js: "http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote.js"
19-
summernote_css: "http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote.css"
15+
jquery_js: "https://code.jquery.com/jquery-3.4.1.min.js"
16+
bootstrap_css: "https://stackpath.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
17+
bootstrap_js: "https://stackpath.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
18+
summernote_css: "https://cdn.jsdelivr.net/npm/summernote@0.8.15/dist/summernote.min.css"
19+
summernote_js: "https://cdn.jsdelivr.net/npm/summernote@0.8.15/dist/summernote.min.js"
2020

2121
# Build settings
2222
markdown: kramdown

_includes/bs4.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<html lang="en">
2+
<head>
3+
<meta charset="UTF-8">
4+
<title>Summernote with Bootstrap 4</title>
5+
<script src="{{ site.jquery_js }}" crossorigin="anonymous"></script>
6+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
7+
8+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
9+
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
10+
11+
<link href="https://cdn.jsdelivr.net/npm/summernote@{{ site.version }}/dist/summernote-bs4.min.css" rel="stylesheet">
12+
<script src="https://cdn.jsdelivr.net/npm/summernote@{{ site.version }}/dist/summernote-bs4.min.js"></script>
13+
</head>
14+
<body>
15+
<div id="summernote"></div>
16+
<script>
17+
$('#summernote').summernote({
18+
placeholder: 'Hello Bootstrap 4',
19+
tabsize: 2,
20+
height: 100
21+
});
22+
</script>
23+
</body>
24+
</html>

_includes/head.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<meta name="twitter:description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
2424
<meta name="twitter:image" content="/img/icons/icon_200x200.png">
2525
<meta name="twitter:site" content="@hackerwins">
26-
<meta name="twitter:domain" content="http://summernote.org/">
26+
<meta name="twitter:domain" content="https://summernote.org/">
2727

2828
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
2929
<link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}" />
@@ -34,9 +34,9 @@
3434
<![endif]-->
3535

3636
<!-- jquery, bootstrap -->
37-
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
38-
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.css" />
39-
<script src="//netdna.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.js"></script>
37+
<script src="https://code.jquery.com/jquery-3.4.1.min.js" crossorigin="anonymous"></script>
38+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
39+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
4040

4141
<!-- codemirror -->
4242
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.41.0/codemirror.min.css" />
@@ -46,9 +46,9 @@
4646
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.41.0/mode/xml/xml.min.js"></script>
4747

4848
<!-- add summernote -->
49-
<link href="//cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote.css" rel="stylesheet">
50-
<script src="//cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote.min.js"></script>
51-
<script src="//cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/lang/summernote-ko-KR.min.js"></script>
49+
<link href="https://cdn.jsdelivr.net/npm/summernote@{{ site.version }}/dist/summernote.min.css" rel="stylesheet">
50+
<script src="https://cdn.jsdelivr.net/npm/summernote@{{ site.version }}/dist/summernote.min.js"></script>
51+
<script src="https://cdn.jsdelivr.net/npm/summernote@{{ site.version }}/dist/lang/summernote-ko-KR.min.js"></script>
5252

5353
<!-- for website -->
5454
<script src="/js/toc.js"></script>

lite.html renamed to _includes/lite.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
<!DOCTYPE html>
21
<html lang="en">
32
<head>
43
<meta charset="UTF-8">
54
<title>without bootstrap</title>
6-
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
7-
<link href="//cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote-lite.css" rel="stylesheet">
8-
<script src="//cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote-lite.js"></script>
5+
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
6+
<link href="https://cdn.jsdelivr.net/npm/summernote@{{ site.version }}/dist/summernote-lite.min.css" rel="stylesheet">
7+
<script src="https://cdn.jsdelivr.net/npm/summernote@{{ site.version }}/dist/summernote-lite.min.js"></script>
98
</head>
109
<body>
1110
<div id="summernote"></div>
1211
<script>
1312
$('#summernote').summernote({
1413
placeholder: 'Hello stand alone ui',
1514
tabsize: 2,
16-
height: 100,
15+
height: 120,
1716
toolbar: [
1817
['style', ['style']],
1918
['font', ['bold', 'underline', 'clear']],

bs4.html

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)