Skip to content

Commit 5a753af

Browse files
committed
finish live preview
1 parent 9cdc4e1 commit 5a753af

File tree

6 files changed

+1057
-13
lines changed

6 files changed

+1057
-13
lines changed

README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ to get ``IMGUR_CLIENT_ID`` and ``IMGUR_API_KEY``.
113113
'imgur': 'true', # to enable/disable imgur/custom uploader.
114114
'mention': 'false', # to enable/disable mention
115115
'jquery': 'true', # to include/revoke jquery (require for admin default django)
116+
'living': 'true', # to enable/disable live updates in preview
116117
}
117118

118119
# To setup the martor editor with label or not (default is False)

martor/static/martor/css/martor.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,3 +233,10 @@ body.overflow {
233233
.no-border {
234234
border: none!important;
235235
}
236+
/* live preview */
237+
.enable-living .martor-preview {
238+
display: block !important;
239+
}
240+
.enable-living a[data-tab$=tab-description] {
241+
display: none !important;
242+
}
Lines changed: 242 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,242 @@
1-
/**
2-
* Name : Martor v1.2.7
3-
* Created by : Agus Makmun (Summon Agus)
4-
* Release date : 18-Sep-2017
5-
* License : GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
6-
* Repository : https://github.com/agusmakmun/django-markdown-editor
7-
**/
8-
.submit-row a{box-sizing:content-box}body.overflow{overflow:hidden!important}.section-martor ::-webkit-scrollbar-track{-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);border-radius:10px;background-color:#F5F5F5}.section-martor ::-webkit-scrollbar{height:6px;width:6px;background-color:#F5F5F5}.section-martor ::-webkit-scrollbar-thumb{border-radius:10px;-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);background-color:#555}.ace_scrollbar-v{cursor:ns-resize}.martor-toolbar{padding:0 .85714286em!important;padding-bottom:4px!important}.martor-toolbar .ui.icon .markdown-image-upload{position:relative;overflow:hidden}.martor-toolbar .ui.icon .markdown-image-upload input[type=file]{position:absolute;top:0;right:0;min-width:100%;min-height:100%;font-size:25px;padding:0;padding-left:35px;text-align:right;filter:alpha(opacity=0);opacity:0;outline:none;cursor:inherit;display:block}.emoji-loader-init{min-height:200px!important}.insert-emoji{cursor:pointer}.main-martor-fullscreen{background:#fff;position:fixed;z-index:999;max-height:100%;height:100%;width:100%;margin:0;left:0;top:0}.main-martor-fullscreen .fields.martor-toolbar{border-bottom:1px solid #ddd;margin:0}.main-martor-fullscreen .section-martor{height:90%;position:relative}.marked-emoji,.martor-preview .marked-emoji{max-width:20px}.martor-preview{font-size:14px;line-height:1.6}.martor-preview>*:first-child{margin-top:0!important}.martor-preview>*:last-child{margin-bottom:20px!important}.martor-preview a.absent{color:#c00}.martor-preview a.anchor{display:block;padding-left:30px;margin-left:-30px;cursor:pointer;position:absolute;top:0;left:0;bottom:0}.martor-preview h1,.martor-preview h2,.martor-preview h3,.martor-preview h4,.martor-preview h5,.martor-preview h6{margin:20px 0 10px;padding:0;font-weight:700;-webkit-font-smoothing:antialiased;cursor:text;position:relative}.martor-preview h1:hover a.anchor,.martor-preview h2:hover a.anchor,.martor-preview h3:hover a.anchor,.martor-preview h4:hover a.anchor,.martor-preview h5:hover a.anchor,.martor-preview h6:hover a.anchor{text-decoration:none;line-height:1;padding-left:0;margin-left:-22px;top:15%}.martor-preview h1 tt,.martor-preview h1 code,.martor-preview h2 tt,.martor-preview h2 code,.martor-preview h3 tt,.martor-preview h3 code,.martor-preview h4 tt,.martor-preview h4 code,.martor-preview h5 tt,.martor-preview h5 code,.martor-preview h6 tt,.martor-preview h6 code{font-size:inherit}.martor-preview h1{font-size:28px;color:#000}.martor-preview h2{font-size:24px;border-bottom:1px solid #ccc;color:#000}.martor-preview h3{font-size:18px}.martor-preview h4{font-size:16px}.martor-preview h5{font-size:14px}.martor-preview h6{color:#777;font-size:14px}.martor-preview p,.martor-preview blockquote,.martor-preview ul,.martor-preview ol,.martor-preview dl,.martor-preview table,.martor-preview pre{margin:15px 0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ieG1wLmRpZDo4Q0NGM0E3OTY1NkExMUUwQjdCNEE4Mzg3MkMyOUY0OCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PqqezsUAAAAfSURBVHjaYmRABcYwBiM2QSA4y4hNEKYDQxAEAAIMAHNGAzhkPOlYAAAAAElFTkSuQmCC) repeat-x 0 0;border:0 none;color:#ccc;height:4px;padding:0}.martor-preview>h2:first-child,.martor-preview>h1:first-child,.martor-preview>h1:first-child+h2,.martor-preview>h3:first-child,.martor-preview>h4:first-child,.martor-preview>h5:first-child,.martor-preview>h6:first-child{margin-top:0;padding-top:0}.martor-preview a:first-child h1,.martor-preview a:first-child h2,.martor-preview a:first-child h3,.martor-preview a:first-child h4,.martor-preview a:first-child h5,.martor-preview a:first-child h6{margin-top:0;padding-top:0}.martor-preview h1+p,.martor-preview h2+p,.martor-preview h3+p,.martor-preview h4+p,.martor-preview h5+p,.martor-preview h6+p{margin-top:0}.martor-preview li p.first{display:inline-block}.martor-preview ul li{list-style:disc}.martor-preview ul,.martor-preview ol{padding-left:30px}.martor-preview ul.no-list,.martor-preview ol.no-list{list-style-type:none;padding:0}.martor-preview ul li>:first-child,.martor-preview ul li ul:first-of-type,.martor-preview ol li>:first-child,.martor-preview ol li ul:first-of-type{margin-top:0}.martor-preview ul ul,.martor-preview ul ol,.martor-preview ol ol,.martor-preview ol ul{margin-bottom:0}.martor-preview dl{padding:0}.martor-preview dl dt{font-size:14px;font-weight:700;font-style:italic;padding:0;margin:15px 0 5px}.martor-preview dl dt:first-child{padding:0}.martor-preview dl dt>:first-child{margin-top:0}.martor-preview dl dt>:last-child{margin-bottom:0}.martor-preview dl dd{margin:0 0 15px;padding:0 15px}.martor-preview dl dd>:first-child{margin-top:0}.martor-preview dl dd>:last-child{margin-bottom:0}.martor-preview blockquote{border-left:4px solid #DDD;padding:5px 15px;color:#777;background-color:#fff}.martor-preview blockquote>:first-child{margin-top:0}.martor-preview blockquote>:last-child{margin-bottom:0}.martor-preview table th{font-weight:700}.martor-preview table th,.martor-preview table td{border:1px solid #ccc;padding:6px 13px}.martor-preview table tr{border-top:1px solid #ccc;background-color:#fff}.martor-preview table tr:nth-child(2n){background-color:#f8f8f8}.martor-preview img{max-width:100%;-moz-box-sizing:border-box;box-sizing:border-box}.martor-preview span.frame{display:block;overflow:hidden}.martor-preview span.frame>span{border:1px solid #ddd;display:block;float:left;overflow:hidden;margin:13px 0 0;padding:7px;width:auto}.martor-preview span.frame span img{display:block;float:left}.martor-preview span.frame span span{clear:both;color:#333;display:block;padding:5px 0 0}.martor-preview span.align-center{display:block;overflow:hidden;clear:both}.martor-preview span.align-center>span{display:block;overflow:hidden;margin:13px auto 0;text-align:center}.martor-preview span.align-center span img{margin:0 auto;text-align:center}.martor-preview span.align-right{display:block;overflow:hidden;clear:both}.martor-preview span.align-right>span{display:block;overflow:hidden;margin:13px 0 0;text-align:right}.martor-preview span.align-right span img{margin:0;text-align:right}.martor-preview span.float-left{display:block;margin-right:13px;overflow:hidden;float:left}.martor-preview span.float-left span{margin:13px 0 0}.martor-preview span.float-right{display:block;margin-left:13px;overflow:hidden;float:right}.martor-preview span.float-right>span{display:block;overflow:hidden;margin:13px auto 0;text-align:right}.martor-preview code,.martor-preview tt{margin:0 2px;padding:0 5px;border:1px solid #eaeaea;background-color:#f8f8f8;border-radius:3px}.martor-preview code{white-space:nowrap}.martor-preview pre>code{margin:0;padding:0;white-space:pre;border:none;background:transparent}.martor-preview .highlight pre,.martor-preview pre{border:1px solid #f0f0f0;padding:16px;overflow:auto;font-size:85%;line-height:1.45;background-color:#f6f8fa;border-radius:3px}.martor-preview pre code,.martor-preview pre tt{margin:0;padding:0;background-color:transparent;border:none}.martor{height:500px;max-height:500px}.martor-field{width:100%;height:250px;min-height:100px}.martor-preview{padding:1rem;overflow:auto;background:#F9F9F9}.icon.expand-editor{position:absolute;bottom:.8em;right:0}.no-border{border:none!important}
1+
/* This if inside django admin */
2+
.submit-row a {
3+
box-sizing: content-box;
4+
}
5+
body.overflow {
6+
overflow: hidden!important;
7+
}
8+
9+
/* Scroll Bar */
10+
.section-martor ::-webkit-scrollbar-track {
11+
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
12+
border-radius: 10px;
13+
background-color: #F5F5F5;
14+
}
15+
.section-martor ::-webkit-scrollbar {
16+
height: 6px;
17+
width: 6px;
18+
background-color: #F5F5F5;
19+
}
20+
.section-martor ::-webkit-scrollbar-thumb {
21+
border-radius: 10px;
22+
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3);
23+
background-color: #555;
24+
}
25+
.ace_scrollbar-v {
26+
cursor: ns-resize;
27+
}
28+
29+
.main-martor {}
30+
.martor-toolbar {
31+
padding: 0 .85714286em!important;
32+
padding-bottom: 4px!important;
33+
}
34+
.martor-toolbar .ui.icon .markdown-image-upload {
35+
position: relative;
36+
overflow: hidden;
37+
}
38+
.martor-toolbar .ui.icon .markdown-image-upload input[type=file] {
39+
position: absolute;
40+
top: 0;
41+
right: 0;
42+
min-width: 100%;
43+
min-height: 100%;
44+
font-size: 25px;
45+
padding: 0;
46+
padding-left: 35px;
47+
text-align: right;
48+
filter: alpha(opacity=0);
49+
opacity: 0;
50+
outline: none;
51+
cursor: inherit;
52+
display: block;
53+
}
54+
.emoji-loader-init {
55+
min-height: 200px!important;
56+
}
57+
.insert-emoji {cursor: pointer}
58+
59+
/* Full Screen Mode */
60+
.main-martor-fullscreen {
61+
background: #fff;
62+
position: fixed;
63+
z-index: 999;
64+
max-height: 100%;
65+
height: 100%;
66+
width: 100%;
67+
margin: 0;
68+
left: 0;
69+
top: 0;
70+
}
71+
.main-martor-fullscreen .fields.martor-toolbar {
72+
border-bottom: 1px solid #ddd;
73+
margin: 0;
74+
}
75+
.main-martor-fullscreen .section-martor {
76+
height: 90%;
77+
position: relative;
78+
}
79+
/* EOF */
80+
81+
.marked-emoji,
82+
.martor-preview .marked-emoji {max-width: 20px}
83+
.martor-preview{font-size:14px;line-height:1.6;}
84+
.martor-preview>*:first-child{margin-top:0 !important}
85+
.martor-preview>*:last-child{margin-bottom:20px !important}
86+
.martor-preview a.absent{color:#c00}
87+
.martor-preview a.anchor{display:block;padding-left:30px;margin-left:-30px;cursor:pointer;position:absolute;top:0;left:0;bottom:0}
88+
.martor-preview h1,
89+
.martor-preview h2,
90+
.martor-preview h3,
91+
.martor-preview h4,
92+
.martor-preview h5,
93+
.martor-preview h6{margin:20px 0 10px;padding:0;font-weight:bold;-webkit-font-smoothing:antialiased;cursor:text;position:relative}
94+
95+
.martor-preview h1:hover a.anchor,
96+
.martor-preview h2:hover a.anchor,
97+
.martor-preview h3:hover a.anchor,
98+
.martor-preview h4:hover a.anchor,
99+
.martor-preview h5:hover a.anchor,
100+
.martor-preview h6:hover a.anchor{text-decoration:none;line-height:1;padding-left:0;margin-left:-22px;top:15%}
101+
102+
.martor-preview h1 tt,
103+
.martor-preview h1 code,
104+
.martor-preview h2 tt,
105+
.martor-preview h2 code,
106+
.martor-preview h3 tt,
107+
.martor-preview h3 code,
108+
.martor-preview h4 tt,
109+
.martor-preview h4 code,
110+
.martor-preview h5 tt,
111+
.martor-preview h5 code,
112+
.martor-preview h6 tt,
113+
.martor-preview h6 code{font-size:inherit}
114+
115+
.martor-preview h1{font-size:28px;color:#000}
116+
.martor-preview h2{font-size:24px;border-bottom:1px solid #ccc;color:#000}
117+
.martor-preview h3{font-size:18px}
118+
.martor-preview h4{font-size:16px}
119+
.martor-preview h5{font-size:14px}
120+
.martor-preview h6{color:#777;font-size:14px}
121+
.martor-preview p,
122+
.martor-preview blockquote,
123+
.martor-preview ul,
124+
.martor-preview ol,
125+
.martor-preview dl,
126+
.martor-preview table,
127+
.martor-preview pre{margin:15px 0}
128+
.martor-preview hr{
129+
background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAECAYAAACtBE5DAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJb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8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PqqezsUAAAAfSURBVHjaYmRABcYwBiM2QSA4y4hNEKYDQxAEAAIMAHNGAzhkPOlYAAAAAElFTkSuQmCC) repeat-x 0 0;
130+
border:0 none;
131+
color:#ccc;
132+
height:4px;
133+
padding:0
134+
}
135+
.martor-preview>h2:first-child,
136+
.martor-preview>h1:first-child,
137+
.martor-preview>h1:first-child+h2,
138+
.martor-preview>h3:first-child,
139+
.martor-preview>h4:first-child,
140+
.martor-preview>h5:first-child,
141+
.martor-preview>h6:first-child{margin-top:0;padding-top:0}
142+
.martor-preview a:first-child h1,
143+
.martor-preview a:first-child h2,
144+
.martor-preview a:first-child h3,
145+
.martor-preview a:first-child h4,
146+
.martor-preview a:first-child h5,
147+
.martor-preview a:first-child h6{margin-top:0;padding-top:0}
148+
.martor-preview h1+p,
149+
.martor-preview h2+p,
150+
.martor-preview h3+p,
151+
.martor-preview h4+p,
152+
.martor-preview h5+p,
153+
.martor-preview h6+p{margin-top:0}
154+
.martor-preview li p.first{display:inline-block}
155+
.martor-preview ul li {list-style: disc;}
156+
.martor-preview ul,
157+
.martor-preview ol{padding-left:30px}
158+
.martor-preview ul.no-list,
159+
.martor-preview ol.no-list{list-style-type:none;padding:0}
160+
.martor-preview ul li>:first-child,
161+
.martor-preview ul li ul:first-of-type,
162+
.martor-preview ol li>:first-child,
163+
.martor-preview ol li ul:first-of-type{margin-top:0px}
164+
.martor-preview ul ul,
165+
.martor-preview ul ol,
166+
.martor-preview ol ol,
167+
.martor-preview ol ul{margin-bottom:0}
168+
.martor-preview dl{padding:0}
169+
.martor-preview dl dt{font-size:14px;font-weight:bold;font-style:italic;padding:0;margin:15px 0 5px}
170+
.martor-preview dl dt:first-child{padding:0}
171+
.martor-preview dl dt>:first-child{margin-top:0px}
172+
.martor-preview dl dt>:last-child{margin-bottom:0px}
173+
.martor-preview dl dd{margin:0 0 15px;padding:0 15px}
174+
.martor-preview dl dd>:first-child{margin-top:0px}
175+
.martor-preview dl dd>:last-child{margin-bottom:0px}
176+
.martor-preview blockquote{border-left:4px solid #DDD;padding:5px 15px;color:#777;background-color: #fff}
177+
.martor-preview blockquote>:first-child{margin-top:0px}
178+
.martor-preview blockquote>:last-child{margin-bottom:0px}
179+
.martor-preview table th{font-weight:bold}
180+
.martor-preview table th,
181+
.martor-preview table td{border:1px solid #ccc;padding:6px 13px}
182+
.martor-preview table tr{border-top:1px solid #ccc;background-color:#fff}
183+
.martor-preview table tr:nth-child(2n){background-color:#f8f8f8}
184+
.martor-preview img{max-width:100%;-moz-box-sizing:border-box;box-sizing:border-box}
185+
.martor-preview span.frame{display:block;overflow:hidden}
186+
.martor-preview span.frame>span{border:1px solid #ddd;display:block;float:left;overflow:hidden;margin:13px 0 0;padding:7px;width:auto}
187+
.martor-preview span.frame span img{display:block;float:left}
188+
.martor-preview span.frame span span{clear:both;color:#333;display:block;padding:5px 0 0}
189+
.martor-preview span.align-center{display:block;overflow:hidden;clear:both}
190+
.martor-preview span.align-center>span{display:block;overflow:hidden;margin:13px auto 0;text-align:center}
191+
.martor-preview span.align-center span img{margin:0 auto;text-align:center}
192+
.martor-preview span.align-right{display:block;overflow:hidden;clear:both}
193+
.martor-preview span.align-right>span{display:block;overflow:hidden;margin:13px 0 0;text-align:right}
194+
.martor-preview span.align-right span img{margin:0;text-align:right}
195+
.martor-preview span.float-left{display:block;margin-right:13px;overflow:hidden;float:left}
196+
.martor-preview span.float-left span{margin:13px 0 0}
197+
.martor-preview span.float-right{display:block;margin-left:13px;overflow:hidden;float:right}
198+
.martor-preview span.float-right>span{display:block;overflow:hidden;margin:13px auto 0;text-align:right}
199+
.martor-preview code,
200+
.martor-preview tt{margin:0 2px;padding:0px 5px;border:1px solid #eaeaea;background-color:#f8f8f8;border-radius:3px}
201+
.martor-preview code{white-space:nowrap}
202+
.martor-preview pre>code{margin:0;padding:0;white-space:pre;border:none;background:transparent}
203+
.martor-preview .highlight pre,
204+
.martor-preview pre{border: 1px solid #f0f0f0;padding: 16px;overflow: auto;font-size: 85%;line-height: 1.45;background-color: #f6f8fa;border-radius: 3px}
205+
.martor-preview pre code,
206+
.martor-preview pre tt{margin:0;padding:0;background-color:transparent;border:none}
207+
208+
209+
.section-martor {
210+
211+
}
212+
.martor {
213+
height: 500px;
214+
max-height: 500px;
215+
}
216+
.martor-field {
217+
width: 100%;
218+
height: 250px;
219+
min-height: 100px;
220+
}
221+
222+
.martor-preview {
223+
padding: 1rem;
224+
overflow: auto;
225+
background: #F9F9F9;
226+
}
227+
228+
.icon.expand-editor {
229+
position: absolute;
230+
bottom: .8em;
231+
right: 0;
232+
}
233+
.no-border {
234+
border: none!important;
235+
}
236+
/* live preview */
237+
.enable-living .martor-preview {
238+
display: block !important;
239+
}
240+
.enable-living a[data-tab$=tab-description] {
241+
display: none !important;
242+
}

martor/static/martor/js/martor.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@
5656
enableMultiselect: false
5757
});
5858

59+
if (editorConfig.living) {
60+
$(obj).addClass('enable-living');
61+
}
62+
5963
var emojiWordCompleter = {
6064
getCompletions: function(editor, session, pos, prefix, callback) {
6165
var wordList = emojis; // from `atwho/emojis.min.js`

0 commit comments

Comments
 (0)