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
e9b42d7a
Commit
e9b42d7a
authored
Oct 17, 2012
by
Tom Giannattasio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added embeddable xml input text to modal
parent
edacd22c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
17 deletions
+28
-17
cms/static/js/base.js
+5
-15
cms/static/sass/_assets.scss
+19
-0
cms/templates/asset_index.html
+4
-2
No files found.
cms/static/js/base.js
View file @
e9b42d7a
...
@@ -21,13 +21,12 @@ $(document).ready(function() {
...
@@ -21,13 +21,12 @@ $(document).ready(function() {
$
(
'.unit-history ol a'
).
bind
(
'click'
,
showHistoryModal
);
$
(
'.unit-history ol a'
).
bind
(
'click'
,
showHistoryModal
);
$modal
.
bind
(
'click'
,
hideModal
);
$modal
.
bind
(
'click'
,
hideModal
);
$modalCover
.
bind
(
'click'
,
hideHistoryModal
);
$modalCover
.
bind
(
'click'
,
hideHistoryModal
);
$modalCover
.
bind
(
'click'
,
hideModal
);
$
(
'.assets .upload-button'
).
bind
(
'click'
,
showUploadModal
);
$
(
'.assets .upload-button'
).
bind
(
'click'
,
showUploadModal
);
$
(
'.upload-modal .close-button'
).
bind
(
'click'
,
hideModal
);
$
(
'.upload-modal .close-button'
).
bind
(
'click'
,
hideModal
);
$
(
'a.show-xml'
).
toggle
(
showEmbeddableXML
,
hideEmbeddableXML
);
$
(
'.embeddable-xml-input'
).
bind
(
'click'
,
function
(){
$
(
this
).
select
();
});
$
(
'.embeddable-xml-input'
).
bind
(
'click'
,
function
(){
$
(
this
).
select
();
});
$
(
'a.copy-button'
).
toggle
(
showEmbeddableXML
,
hideEmbeddableXML
);
$
(
'.unit .item-actions .delete-button'
).
bind
(
'click'
,
deleteUnit
);
$
(
'.unit .item-actions .delete-button'
).
bind
(
'click'
,
deleteUnit
);
$
(
'.new-unit-item'
).
bind
(
'click'
,
createNewUnit
);
$
(
'.new-unit-item'
).
bind
(
'click'
,
createNewUnit
);
$
(
'.save-subsection'
).
bind
(
'click'
,
saveSubsection
);
$
(
'.save-subsection'
).
bind
(
'click'
,
saveSubsection
);
...
@@ -119,18 +118,6 @@ function removePolicyMetadata(e) {
...
@@ -119,18 +118,6 @@ function removePolicyMetadata(e) {
_parent_el
.
appendTo
(
"#policy-to-delete"
);
_parent_el
.
appendTo
(
"#policy-to-delete"
);
}
}
function
showEmbeddableXML
(
e
)
{
$ceiling
=
$
(
this
).
parents
(
'tr'
);
if
(
$ceiling
.
length
===
0
)
$ceiling
=
$
(
this
).
parents
(
'.upload-modal'
);
$ceiling
.
find
(
'.embeddable-xml'
).
html
(
'<img src="'
+
$
(
this
).
attr
(
'href'
)
+
'"/>'
);
}
function
hideEmbeddableXML
(
e
)
{
$ceiling
=
$
(
this
).
parents
(
'tr'
);
console
.
log
(
$ceiling
.
length
)
if
(
$ceiling
.
length
===
0
)
$ceiling
=
$
(
this
).
parents
(
'.upload-modal'
);
$ceiling
.
find
(
'.embeddable-xml'
).
html
(
""
);
}
// This method only changes the ordering of the child objects in a subsection
// This method only changes the ordering of the child objects in a subsection
function
onUnitReordered
()
{
function
onUnitReordered
()
{
...
@@ -342,8 +329,11 @@ function displayFinishedUpload(xhr) {
...
@@ -342,8 +329,11 @@ function displayFinishedUpload(xhr) {
if
(
xhr
.
status
=
200
){
if
(
xhr
.
status
=
200
){
markAsLoaded
();
markAsLoaded
();
}
}
var
resp
=
JSON
.
parse
(
xhr
.
responseText
);
var
resp
=
JSON
.
parse
(
xhr
.
responseText
);
$
(
'.upload-modal .copy-button'
).
attr
(
'href'
,
xhr
.
getResponseHeader
(
'asset_url'
));
$
(
'.upload-modal .embeddable-xml-input'
).
val
(
'<img src="'
+
xhr
.
getResponseHeader
(
'asset_url'
)
+
'"/>'
);
$
(
'.upload-modal .embeddable'
).
show
();
$
(
'.upload-modal .file-name'
).
hide
();
$
(
'.upload-modal .progress-fill'
).
html
(
resp
.
msg
);
$
(
'.upload-modal .progress-fill'
).
html
(
resp
.
msg
);
$
(
'.upload-modal .choose-file-button'
).
html
(
'Load Another File'
).
show
();
$
(
'.upload-modal .choose-file-button'
).
html
(
'Load Another File'
).
show
();
$
(
'.upload-modal .progress-fill'
).
width
(
'100%'
);
$
(
'.upload-modal .progress-fill'
).
width
(
'100%'
);
...
...
cms/static/sass/_assets.scss
View file @
e9b42d7a
...
@@ -47,6 +47,10 @@
...
@@ -47,6 +47,10 @@
}
}
}
}
.name-col
{
font-size
:
14px
;
}
.date-col
{
.date-col
{
font-size
:
12px
;
font-size
:
12px
;
}
}
...
@@ -165,6 +169,21 @@
...
@@ -165,6 +169,21 @@
text-align
:
center
;
text-align
:
center
;
}
}
.embeddable
{
display
:
none
;
margin
:
30px
0
130px
;
label
{
display
:
block
;
margin-bottom
:
10px
;
font-weight
:
700
;
}
}
.embeddable-xml-input
{
width
:
400px
;
}
.copy-button
{
.copy-button
{
@include
white-button
;
@include
white-button
;
display
:
none
;
display
:
none
;
...
...
cms/templates/asset_index.html
View file @
e9b42d7a
...
@@ -97,8 +97,10 @@
...
@@ -97,8 +97,10 @@
<div
class=
"progress-bar"
>
<div
class=
"progress-bar"
>
<div
class=
"progress-fill"
></div>
<div
class=
"progress-fill"
></div>
</div>
</div>
<div
class=
"embeddable-xml"
></div>
<div
class=
"embeddable"
>
<a
href=
"#"
class=
"copy-button"
>
Show Embeddable XML
</a>
<label>
Embeddable XML:
</label>
<input
type=
"text"
class=
"embeddable-xml-input"
value=
'<img src="${asset['
url
']}"
/>
'>
</div>
<form
class=
"file-chooser"
action=
"${upload_asset_callback_url}"
<form
class=
"file-chooser"
action=
"${upload_asset_callback_url}"
method=
"post"
enctype=
"multipart/form-data"
>
method=
"post"
enctype=
"multipart/form-data"
>
<a
href=
"#"
class=
"choose-file-button"
>
Choose File
</a>
<a
href=
"#"
class=
"choose-file-button"
>
Choose File
</a>
...
...
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