Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
1470045b
Commit
1470045b
authored
Aug 17, 2012
by
Bridger Maxwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed wiki circuit editor modal to be a little better styled.
parent
a4b97c5f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
9 deletions
+67
-9
common/static/js/vendor/CodeMirror/mitx_markdown.js
+12
-7
lms/static/sass/course/wiki/_wiki.scss
+55
-2
No files found.
common/static/js/vendor/CodeMirror/mitx_markdown.js
View file @
1470045b
...
...
@@ -10,9 +10,17 @@ $(function(){
$
(
document
).
ready
(
function
()
{
//$("a[rel*=leanModal]").leanModal(); //TODO: Make this work with the new modal library. Try and integrate this with the "slices"
$
(
"body"
).
append
(
'<div id="circuit_editor" class="leanModal_box"><div align="center">'
+
'<input class="schematic" height="'
+
schematic_editor_height
+
'" width="'
+
schematic_editor_width
+
'" id="schematic_editor" name="schematic" type="hidden" value=""/>'
+
'<button type="button" id="circuit_save_btn" class="btn-primary">save</button></div></div>'
);
$
(
"body"
).
append
(
'
\
<div id="circuit_editor_modal" class="modal hide fade">
\
<div class="modal-body">
\
<input class="schematic" height="'
+
schematic_editor_height
+
'" width="'
+
schematic_editor_width
+
'" id="schematic_editor" name="schematic" type="hidden" value=""/>
\
</div>
\
<div class="modal-footer">
\
<button type="button" id="circuit_save_btn" class="btn btn-primary" data-dismiss="modal">
\
Save circuit
\
</button>
\
</div>
\
</div>'
);
//This is the editor that pops up as a modal
var
editorCircuit
=
$
(
"#schematic_editor"
).
get
(
0
);
...
...
@@ -47,8 +55,6 @@ $(function(){
if
(
editingCircuit
.
codeMirrorLine
)
{
editingCircuit
.
codeMirrorLine
.
replace
(
0
,
null
,
"circuit-schematic:"
+
saving_circuit
);
}
$
(
".modal_close"
).
first
().
click
();
});
});
});
...
...
@@ -117,7 +123,7 @@ CodeMirror.defineMode("mitx_markdown", function(cmCfg, modeCfg) {
circuit_value
=
escapeHtml
(
circuit_value
);
var
html
=
"<div style='display:block;line-height:0;' class='schematic_container'><a href='#circuit_editor
' rel='leanM
odal' class='schematic_open' style='display:inline-block;'>"
+
var
html
=
"<div style='display:block;line-height:0;' class='schematic_container'><a href='#circuit_editor
_modal' data-toggle='m
odal' class='schematic_open' style='display:inline-block;'>"
+
"<input type='hidden' parts='' value='"
+
circuit_value
+
"' width='"
+
schematic_width
+
"' height='"
+
schematic_height
+
"' analyses='' class='schematic ctrls'/></a></div>"
;
return
html
;
...
...
@@ -135,7 +141,6 @@ CodeMirror.defineMode("mitx_markdown", function(cmCfg, modeCfg) {
schmInput
.
schematic
.
always_draw_grid
=
true
;
schmInput
.
schematic
.
redraw_background
();
}
$
(
node
.
firstChild
).
leanModal
();
}
catch
(
err
)
{
console
.
log
(
"Error in mitx_markdown callback: "
+
err
);
}
...
...
lms/static/sass/course/wiki/_wiki.scss
View file @
1470045b
...
...
@@ -790,4 +790,58 @@ section.wiki {
.modal-preview
.main-article
{
width
:
100%
!
important
;
margin-left
:
0
;
}
\ No newline at end of file
}
#circuit_editor_modal
.modal
{
width
:
648px
;
z-index
:
9999
;
margin-left
:
-325px
;
top
:
150px
;
.modal-header
{
h1
,
p
{
color
:
#fff
;
}
h1
{
margin
:
3px
12px
8px
;
font-size
:
1
.1em
;
}
p
{
font-size
:
0
.9em
;
margin
:
5px
12px
20px
;
line-height
:
1em
;
}
}
.modal-body
{
padding-bottom
:
8px
;
}
.modal-footer
{
margin
:
12px
;
}
.modal-footer
.btn
{
@include
button
(
simple
,
#eee
);
font-size
:
0
.8em
;
margin-right
:
5px
;
line-height
:
1
.2em
;
text-transform
:
none
!
important
;
letter-spacing
:
0
!
important
;
&
:hover
{
color
:
$base-font-color
;
text-decoration
:
none
;
}
&
.btn-primary
{
@include
button
;
font-size
:
0
.8em
;
}
margin-right
:
10px
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment