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
1c886b33
Commit
1c886b33
authored
Jan 03, 2013
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get buttons working again (with old behavior).
parent
b5b11c69
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
256 deletions
+15
-256
cms/static/coffee/src/views/unit.coffee
+1
-31
cms/templates/unit.html
+14
-225
No files found.
cms/static/coffee/src/views/unit.coffee
View file @
1c886b33
class
CMS
.
Views
.
UnitEdit
extends
Backbone
.
View
class
CMS
.
Views
.
UnitEdit
extends
Backbone
.
View
events
:
events
:
# 'click .new-component .new-component-type a': 'showComponentTemplates'
'click .new-component .new-component-type a'
:
'showComponentTemplates'
'click .new-component .new-component-type a'
:
'addNewComponent'
'click .new-component .cancel-button'
:
'closeNewComponent'
'click .new-component .cancel-button'
:
'closeNewComponent'
'click .new-component-templates .new-component-template a'
:
'saveNewComponent'
'click .new-component-templates .new-component-template a'
:
'saveNewComponent'
'click .new-component-templates .cancel-button'
:
'closeNewComponent'
'click .new-component-templates .cancel-button'
:
'closeNewComponent'
...
@@ -69,35 +68,6 @@ class CMS.Views.UnitEdit extends Backbone.View
...
@@ -69,35 +68,6 @@ class CMS.Views.UnitEdit extends Backbone.View
@
$newComponentItem
.
removeClass
(
'adding'
)
@
$newComponentItem
.
removeClass
(
'adding'
)
@
$newComponentItem
.
find
(
'.rendered-component'
).
remove
()
@
$newComponentItem
.
find
(
'.rendered-component'
).
remove
()
addNewComponent
:
(
event
)
=>
event
.
preventDefault
()
@
$componentItem
=
$
(
'<li>'
).
addClass
(
'editing'
)
type
=
$
(
event
.
currentTarget
).
data
(
'type'
)
switch
type
when
'problem'
@
$editor
=
$
(
$
(
'#problem-editor'
).
html
())
$preview
=
$
(
$
(
'#problem-preview'
).
html
())
initProblemEditors
(
@
$editor
,
$preview
)
@
$editor
.
find
(
'.save-button, .cancel-button'
).
bind
(
'click'
,
=>
@
$componentItem
.
removeClass
(
'editing'
)
@
closeEditor
()
)
$componentActions
=
$
(
$
(
'#component-actions'
).
html
())
@
$componentItem
.
append
(
@
$editor
)
@
$componentItem
.
append
(
$preview
)
@
$componentItem
.
append
(
$componentActions
)
@
$componentItem
.
hide
()
@
$newComponentItem
.
before
(
@
$componentItem
)
@
$componentItem
.
show
()
$modalCover
.
fadeIn
(
200
)
$modalCover
.
bind
(
'click'
,
@
closeEditor
)
closeEditor
:
(
event
)
=>
closeEditor
:
(
event
)
=>
@
$editor
.
slideUp
(
150
)
@
$editor
.
slideUp
(
150
)
$modalCover
.
fadeOut
(
150
)
$modalCover
.
fadeOut
(
150
)
...
...
cms/templates/unit.html
View file @
1c886b33
...
@@ -13,8 +13,6 @@
...
@@ -13,8 +13,6 @@
})
})
});
});
$body
=
$
(
'body'
);
$body
.
on
(
'click'
,
'.editor-tabs .tab'
,
setEditorTab
);
function
setEditorTab
(
e
)
{
function
setEditorTab
(
e
)
{
e
.
preventDefault
();
e
.
preventDefault
();
...
@@ -53,229 +51,6 @@
...
@@ -53,229 +51,6 @@
}
}
</script>
</script>
<script
src=
"/static/js/speed-editor.js"
></script>
<script
type=
"text/template"
id=
"asset-library-widget"
>
<
article
class
=
"asset-library widget"
>
<
a
href
=
"#"
class
=
"close-button"
>
<
span
class
=
"close-icon"
><
/span
>
<
/a
>
<
div
class
=
"upload-form"
>
<
h1
>
Upload
New
File
<
/h1
>
<
p
class
=
"file-name"
><
/p
>
<
div
class
=
"progress-bar"
>
<
div
class
=
"progress-fill"
><
/div
>
<
/div
>
<
div
class
=
"embeddable"
>
<
label
>
Embeddable
XML
:
<
/label
>
<
input
type
=
"text"
class
=
"embeddable-xml-input"
value
=
"<img src=""/>"
>
<
/div
>
<
form
class
=
"file-chooser"
action
=
"/Giannattasio/313/course/Photoshop_for_Monkeys/upload_asset"
method
=
"post"
enctype
=
"multipart/form-data"
>
<
a
href
=
"#"
class
=
"choose-file-button"
>
Choose
File
<
/a
>
<
input
type
=
"file"
class
=
"file-input"
name
=
"file"
>
<
/form
>
<
/div
>
<
header
>
<
a
href
=
"#"
class
=
"upload-button"
>
Upload
New
File
<
/a
>
<
input
type
=
"text"
class
=
"search"
>
<
/header
>
<
table
class
=
"library-list"
>
<
thead
>
<
tr
>
<
th
class
=
"thumb-col"
><
/th
>
<
th
class
=
"name-col"
><
a
href
=
"#"
>
Name
<
span
class
=
"sort-icon down"
><
/span></
a
><
/th
>
<
th
class
=
"date-col"
><
a
href
=
"#"
>
Date
Added
<
/a></
th
>
<
th
class
=
"insert-col"
><
/th
>
<
/tr
>
<
/thead
>
<
tbody
id
=
"asset_table_body"
>
<
tr
data
-
id
=
"id"
>
<
td
class
=
"thumb-col"
>
<
div
class
=
"thumb"
>
<
img
src
=
"/"
>
<
/div
>
<
/td
>
<
td
class
=
"name-col"
>
<
a
href
=
"#"
class
=
"filename"
>
ut
-
logo
-
350
-
150
.
png
<
/a
>
<
div
class
=
"embeddable-xml"
><
/div
>
<
/td
>
<
td
class
=
"date-col"
>
30
October
,
2012
at
07
:
17
PM
<
/td
>
<
td
class
=
"insert-col"
>
<
a
href
=
"#"
class
=
"insert-asset-button"
data
-
markup
=
"<img src='/c4x/Giannattasio/313/asset/ut-logo-350-150.png'/>"
>
Insert
<
/a
>
<
/td
>
<
/tr
>
<
tr
data
-
id
=
"id"
>
<
td
class
=
"thumb-col"
>
<
div
class
=
"thumb"
>
<
img
src
=
"/"
>
<
/div
>
<
/td
>
<
td
class
=
"name-col"
>
<
a
href
=
"#"
class
=
"filename"
>
ut
-
logo
-
350
-
150
.
png
<
/a
>
<
div
class
=
"embeddable-xml"
><
/div
>
<
/td
>
<
td
class
=
"date-col"
>
30
October
,
2012
at
07
:
17
PM
<
/td
>
<
td
class
=
"insert-col"
>
<
a
href
=
"#"
class
=
"insert-asset-button"
data
-
markup
=
"<img src='/c4x/Giannattasio/313/asset/ut-logo-350-150.png'/>"
>
Insert
<
/a
>
<
/td
>
<
/tr
>
<
tr
data
-
id
=
"id"
>
<
td
class
=
"thumb-col"
>
<
div
class
=
"thumb"
>
<
img
src
=
"/"
>
<
/div
>
<
/td
>
<
td
class
=
"name-col"
>
<
a
href
=
"#"
class
=
"filename"
>
ut
-
logo
-
350
-
150
.
png
<
/a
>
<
div
class
=
"embeddable-xml"
><
/div
>
<
/td
>
<
td
class
=
"date-col"
>
30
October
,
2012
at
07
:
17
PM
<
/td
>
<
td
class
=
"insert-col"
>
<
a
href
=
"#"
class
=
"insert-asset-button"
data
-
markup
=
"<img src='/c4x/Giannattasio/313/asset/ut-logo-350-150.png'/>"
>
Insert
<
/a
>
<
/td
>
<
/tr
>
<
tr
data
-
id
=
"id"
>
<
td
class
=
"thumb-col"
>
<
div
class
=
"thumb"
>
<
img
src
=
"/"
>
<
/div
>
<
/td
>
<
td
class
=
"name-col"
>
<
a
href
=
"#"
class
=
"filename"
>
ut
-
logo
-
350
-
150
.
png
<
/a
>
<
div
class
=
"embeddable-xml"
><
/div
>
<
/td
>
<
td
class
=
"date-col"
>
30
October
,
2012
at
07
:
17
PM
<
/td
>
<
td
class
=
"insert-col"
>
<
a
href
=
"#"
class
=
"insert-asset-button"
data
-
markup
=
"<img src='/c4x/Giannattasio/313/asset/ut-logo-350-150.png'/>"
>
Insert
<
/a
>
<
/td
>
<
/tr
>
<
tr
data
-
id
=
"id"
>
<
td
class
=
"thumb-col"
>
<
div
class
=
"thumb"
>
<
img
src
=
"/"
>
<
/div
>
<
/td
>
<
td
class
=
"name-col"
>
<
a
href
=
"#"
class
=
"filename"
>
ut
-
logo
-
350
-
150
.
png
<
/a
>
<
div
class
=
"embeddable-xml"
><
/div
>
<
/td
>
<
td
class
=
"date-col"
>
30
October
,
2012
at
07
:
17
PM
<
/td
>
<
td
class
=
"insert-col"
>
<
a
href
=
"#"
class
=
"insert-asset-button"
data
-
markup
=
"<img src='/c4x/Giannattasio/313/asset/ut-logo-350-150.png'/>"
>
Insert
<
/a
>
<
/td
>
<
/tr
>
<
tr
data
-
id
=
"id"
>
<
td
class
=
"thumb-col"
>
<
div
class
=
"thumb"
>
<
img
src
=
"/"
>
<
/div
>
<
/td
>
<
td
class
=
"name-col"
>
<
a
href
=
"#"
class
=
"filename"
>
ut
-
logo
-
350
-
150
.
png
<
/a
>
<
div
class
=
"embeddable-xml"
><
/div
>
<
/td
>
<
td
class
=
"date-col"
>
30
October
,
2012
at
07
:
17
PM
<
/td
>
<
td
class
=
"insert-col"
>
<
a
href
=
"#"
class
=
"insert-asset-button"
data
-
markup
=
"<img src='/c4x/Giannattasio/313/asset/ut-logo-350-150.png'/>"
>
Insert
<
/a
>
<
/td
>
<
/tr
>
<
tr
data
-
id
=
"id"
>
<
td
class
=
"thumb-col"
>
<
div
class
=
"thumb"
>
<
img
src
=
"/"
>
<
/div
>
<
/td
>
<
td
class
=
"name-col"
>
<
a
href
=
"#"
class
=
"filename"
>
ut
-
logo
-
350
-
150
.
png
<
/a
>
<
div
class
=
"embeddable-xml"
><
/div
>
<
/td
>
<
td
class
=
"date-col"
>
30
October
,
2012
at
07
:
17
PM
<
/td
>
<
td
class
=
"insert-col"
>
<
a
href
=
"#"
class
=
"insert-asset-button"
data
-
markup
=
"<img src='/c4x/Giannattasio/313/asset/ut-logo-350-150.png'/>"
>
Insert
<
/a
>
<
/td
>
<
/tr
>
<
tr
data
-
id
=
"id"
>
<
td
class
=
"thumb-col"
>
<
div
class
=
"thumb"
>
<
img
src
=
"/"
>
<
/div
>
<
/td
>
<
td
class
=
"name-col"
>
<
a
href
=
"#"
class
=
"filename"
>
ut
-
logo
-
350
-
150
.
png
<
/a
>
<
div
class
=
"embeddable-xml"
><
/div
>
<
/td
>
<
td
class
=
"date-col"
>
30
October
,
2012
at
07
:
17
PM
<
/td
>
<
td
class
=
"insert-col"
>
<
a
href
=
"#"
class
=
"insert-asset-button"
data
-
markup
=
"<img src='/c4x/Giannattasio/313/asset/ut-logo-350-150.png'/>"
>
Insert
<
/a
>
<
/td
>
<
/tr
>
<
tr
data
-
id
=
"id"
>
<
td
class
=
"thumb-col"
>
<
div
class
=
"thumb"
>
<
img
src
=
"/"
>
<
/div
>
<
/td
>
<
td
class
=
"name-col"
>
<
a
href
=
"#"
class
=
"filename"
>
ut
-
logo
-
350
-
150
.
png
<
/a
>
<
div
class
=
"embeddable-xml"
><
/div
>
<
/td
>
<
td
class
=
"date-col"
>
30
October
,
2012
at
07
:
17
PM
<
/td
>
<
td
class
=
"insert-col"
>
<
a
href
=
"#"
class
=
"insert-asset-button"
data
-
markup
=
"<img src='/c4x/Giannattasio/313/asset/ut-logo-350-150.png'/>"
>
Insert
<
/a
>
<
/td
>
<
/tr
>
<
tr
data
-
id
=
"id"
>
<
td
class
=
"thumb-col"
>
<
div
class
=
"thumb"
>
<
img
src
=
"/"
>
<
/div
>
<
/td
>
<
td
class
=
"name-col"
>
<
a
href
=
"#"
class
=
"filename"
>
ut
-
logo
-
350
-
150
.
png
<
/a
>
<
div
class
=
"embeddable-xml"
><
/div
>
<
/td
>
<
td
class
=
"date-col"
>
30
October
,
2012
at
07
:
17
PM
<
/td
>
<
td
class
=
"insert-col"
>
<
a
href
=
"#"
class
=
"insert-asset-button"
data
-
markup
=
"<img src='/c4x/Giannattasio/313/asset/ut-logo-350-150.png'/>"
>
Insert
<
/a
>
<
/td
>
<
/tr
>
<
/tbody
>
<
/table
>
<
nav
class
=
"pagination wip-box"
>
Page
:
<
ol
class
=
"pages"
>
<
li
>
1
<
/li
>
<
li
><
a
href
=
"#"
>
2
<
/a></
li
>
<
li
><
a
href
=
"#"
>
3
<
/a></
li
>
<
li
><
a
href
=
"#"
>
4
<
/a></
li
>
<
li
><
a
href
=
"#"
>
5
<
/a></
li
>
<
/ol
>
<
a
href
=
"#"
class
=
"next"
>
»
<
/a
>
<
/nav
>
<
/article
>
</script>
<script
type=
"text/template"
id=
"simple-editor-cheatsheet"
>
<script
type=
"text/template"
id=
"simple-editor-cheatsheet"
>
<
article
class
=
"simple-editor-cheatsheet"
>
<
article
class
=
"simple-editor-cheatsheet"
>
...
@@ -374,6 +149,20 @@
...
@@ -374,6 +149,20 @@
% endfor
% endfor
</ul>
</ul>
</div>
</div>
% for type, templates in sorted(component_templates.items()):
<div
class=
"new-component-templates new-component-${type}"
>
<ul
class=
"new-component-template"
>
% for name, location in templates:
<li>
<a
href=
"#"
data-location=
"${location}"
>
<span
class=
"name"
>
${name}
</span>
</a>
</li>
%endfor
</ul>
<a
href=
"#"
class=
"cancel-button"
>
Cancel
</a>
</div>
% endfor
</li>
</li>
</ol>
</ol>
</article>
</article>
...
...
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