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
d5134130
Commit
d5134130
authored
Mar 29, 2012
by
Bridger Maxwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed some css properties for proper sizing of elements.
parent
b2fbf537
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
static/js/CodeMirror/mitx_markdown.js
+16
-6
No files found.
static/js/CodeMirror/mitx_markdown.js
View file @
d5134130
var
schematic_height
=
153
;
var
schematic_width
=
400
;
$
(
function
(){
$
(
function
(){
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
$
(
"a[rel*=leanModal]"
).
leanModal
();
$
(
"a[rel*=leanModal]"
).
leanModal
();
$
(
"body"
).
append
(
'<div id="circuit_editor" class="leanModal_box" style="z-index: 11000; left: 50%; margin-left: -250px; position: absolute; top: 100px; opacity: 1; "><div align="center"> <input class="schematic" height="150" width="150" id="schematic_editor" name="schematic" type="hidden" value=""/> <button type="button" id="circuit_save_btn">save</button></div></div>'
);
$
(
"body"
).
append
(
'<div id="circuit_editor" class="leanModal_box" style="z-index: 11000; left: 50%; margin-left: -250px; position: absolute; top: 100px; opacity: 1; "><div align="center">'
+
'<input class="schematic" height="'
+
schematic_height
+
'" width="'
+
schematic_width
+
'" id="schematic_editor" name="schematic" type="hidden" value=""/>'
+
'<button type="button" id="circuit_save_btn">save</button></div></div>'
);
//This is the editor that pops up as a modal
//This is the editor that pops up as a modal
var
editorCircuit
=
$
(
"#schematic_editor"
).
get
(
0
);
var
editorCircuit
=
$
(
"#schematic_editor"
).
get
(
0
);
...
@@ -43,6 +48,7 @@ $(function(){
...
@@ -43,6 +48,7 @@ $(function(){
});
});
});
});
CodeMirror
.
defineMode
(
"mitx_markdown"
,
function
(
cmCfg
,
modeCfg
)
{
CodeMirror
.
defineMode
(
"mitx_markdown"
,
function
(
cmCfg
,
modeCfg
)
{
var
htmlMode
=
CodeMirror
.
getMode
(
cmCfg
,
{
name
:
'xml'
,
htmlMode
:
true
});
var
htmlMode
=
CodeMirror
.
getMode
(
cmCfg
,
{
name
:
'xml'
,
htmlMode
:
true
});
...
@@ -73,24 +79,28 @@ CodeMirror.defineMode("mitx_markdown", function(cmCfg, modeCfg) {
...
@@ -73,24 +79,28 @@ CodeMirror.defineMode("mitx_markdown", function(cmCfg, modeCfg) {
circuit_value
=
escapeHtml
(
circuit_value
);
circuit_value
=
escapeHtml
(
circuit_value
);
var
html
=
"
<a href='#circuit_editor' rel='leanModal' class='schematic_open' style='display:inline-block;'>"
+
var
html
=
"<div style='display:block;line-height:0;' class='schematic_container'>
<a href='#circuit_editor' rel='leanModal' class='schematic_open' style='display:inline-block;'>"
+
"<input type='hidden' parts='' value='"
+
circuit_value
+
"' width='150' height='148' analyses='' class='schematic ctrls'/></a
>"
;
"<input type='hidden' parts='' value='"
+
circuit_value
+
"' width='"
+
schematic_width
+
"' height='"
+
schematic_height
+
"' analyses='' class='schematic ctrls'/></a></div
>"
;
return
html
;
return
html
;
},
},
size
:
function
(
text
)
{
size
:
function
(
text
)
{
return
{
width
:
150
,
height
:
152
};
return
{
width
:
schematic_width
,
height
:
schematic_height
};
},
},
callback
:
function
(
node
,
line
)
{
callback
:
function
(
node
,
line
)
{
update_schematics
();
update_schematics
();
var
schmInput
=
node
.
firstChild
;
var
schmInput
=
node
.
firstChild
.
firstChild
;
schmInput
.
codeMirrorLine
=
line
;
schmInput
.
codeMirrorLine
=
line
;
if
(
schmInput
.
schematic
)
{
//This is undefined if there was an error making the schematic
schmInput
.
schematic
.
canvas
.
style
.
display
=
"block"
;
//Otherwise, it gets line height and is a weird size
schmInput
.
schematic
.
always_draw_grid
=
true
;
schmInput
.
schematic
.
always_draw_grid
=
true
;
schmInput
.
schematic
.
redraw_background
();
schmInput
.
schematic
.
redraw_background
();
$
(
node
).
leanModal
();
}
$
(
node
.
firstChild
).
leanModal
();
}
}
};
};
var
hrRE
=
/^
[
*-=_
]
/
var
hrRE
=
/^
[
*-=_
]
/
,
ulRE
=
/^
[
*-+
]\s
+/
,
ulRE
=
/^
[
*-+
]\s
+/
,
olRE
=
/^
[
0-9
]
+
\.\s
+/
,
olRE
=
/^
[
0-9
]
+
\.\s
+/
...
...
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