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
5013ee34
Commit
5013ee34
authored
Oct 17, 2012
by
chrisndodge
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #931 from MITx/feature/cas/tomg/embed-links
Feature/cas/tomg/embed links
parents
24faac4f
005cf66e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
23 deletions
+45
-23
cms/static/js/base.js
+7
-17
cms/static/sass/_assets.scss
+32
-2
cms/templates/asset_index.html
+6
-4
No files found.
cms/static/js/base.js
View file @
5013ee34
...
@@ -21,12 +21,12 @@ $(document).ready(function() {
...
@@ -21,12 +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
);
$
body
.
on
(
'click'
,
'.embeddable-xml-input'
,
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
);
...
@@ -127,18 +127,6 @@ function removePolicyMetadata(e) {
...
@@ -127,18 +127,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
()
{
...
@@ -354,8 +342,11 @@ function displayFinishedUpload(xhr) {
...
@@ -354,8 +342,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%'
);
...
@@ -672,4 +663,4 @@ function saveSetSectionScheduleDate(e) {
...
@@ -672,4 +663,4 @@ function saveSetSectionScheduleDate(e) {
alert
(
'Your changes have been saved.'
);
alert
(
'Your changes have been saved.'
);
location
.
reload
();
location
.
reload
();
});
});
}
}
\ No newline at end of file
cms/static/sass/_assets.scss
View file @
5013ee34
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
@include
blue-button
;
@include
blue-button
;
float
:
left
;
float
:
left
;
margin-right
:
20px
;
margin-right
:
20px
;
padding
:
8px
30px
10px
;
font-size
:
12px
;
font-size
:
12px
;
}
}
...
@@ -45,6 +46,14 @@
...
@@ -45,6 +46,14 @@
border-top
:
none
;
border-top
:
none
;
}
}
}
}
.name-col
{
font-size
:
14px
;
}
.date-col
{
font-size
:
12px
;
}
}
}
.thumb-col
{
.thumb-col
{
...
@@ -52,11 +61,16 @@
...
@@ -52,11 +61,16 @@
}
}
.date-col
{
.date-col
{
width
:
2
0
0px
;
width
:
2
2
0px
;
}
}
.embed-col
{
.embed-col
{
width
:
70px
;
width
:
250px
;
}
.embeddable-xml-input
{
@include
box-shadow
(
none
);
width
:
100%
;
}
}
.thumb
{
.thumb
{
...
@@ -156,6 +170,22 @@
...
@@ -156,6 +170,22 @@
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
{
@include
box-shadow
(
none
);
width
:
400px
;
}
.copy-button
{
.copy-button
{
@include
white-button
;
@include
white-button
;
display
:
none
;
display
:
none
;
...
...
cms/templates/asset_index.html
View file @
5013ee34
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
{{
uploadDate
}}
{{
uploadDate
}}
<
/td
>
<
/td
>
<
td
class
=
"embed-col"
>
<
td
class
=
"embed-col"
>
<
a
class
=
"show-xml"
href
=
"{{url}}"
>
XML
<
/a
>
<
input
type
=
"text"
class
=
"embeddable-xml-input"
value
=
'<img src="{{url}}"/>'
>
<
/td
>
<
/td
>
<
/tr
>
<
/tr
>
</script>
</script>
...
@@ -68,7 +68,7 @@
...
@@ -68,7 +68,7 @@
${asset['uploadDate']}
${asset['uploadDate']}
</td>
</td>
<td
class=
"embed-col"
>
<td
class=
"embed-col"
>
<
a
class=
"show-xml"
href=
"${asset['url']}"
>
XML
</a
>
<
input
type=
"text"
class=
"embeddable-xml-input"
value=
'<img src="${asset['
url
']}"
/>
'
>
</td>
</td>
</tr>
</tr>
% endfor
% endfor
...
@@ -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