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
9613f92f
Commit
9613f92f
authored
Nov 16, 2012
by
Tom Giannattasio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asset widget inserts into tiny
parent
f16e7b2e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
53 deletions
+35
-53
cms/static/js/html-editor.js
+8
-2
cms/static/sass/_assets.scss
+19
-0
cms/templates/unit.html
+8
-8
cms/templates/widgets/asset-library-widget.html
+0
-43
No files found.
cms/static/js/html-editor.js
View file @
9613f92f
...
...
@@ -32,9 +32,8 @@ function initHTMLEditor($editor, $prev) {
title
:
'Add Asset'
,
image
:
'/static/img/visual-editor-image-icon.png'
,
onclick
:
function
()
{
ed
.
focus
();
ed
.
selection
.
setContent
(
'This should open the studio asset picker.'
);
$assetWidget
=
$
(
$
(
'#asset-library-widget'
).
html
());
$
(
'.insert-asset-button'
,
$assetWidget
).
bind
(
'click'
,
{
editor
:
ed
},
insertAsset
);
$body
.
append
(
$assetWidget
);
}
});
...
...
@@ -51,6 +50,13 @@ function initHTMLEditor($editor, $prev) {
$editor
.
find
(
'.save-button, .cancel-button'
).
bind
(
'click'
,
updatePreview
);
}
function
insertAsset
(
e
)
{
$assetWidget
.
remove
();
var
editor
=
e
.
data
.
editor
;
editor
.
focus
();
editor
.
selection
.
setContent
(
$
(
this
).
attr
(
'data-markup'
));
}
function
convertVisualToHTML
()
{
htmlEditor
.
setValue
(
$visualEditor
.
html
());
}
...
...
cms/static/sass/_assets.scss
View file @
9613f92f
...
...
@@ -111,9 +111,19 @@
&
.widget
{
position
:
absolute
;
left
:
50%
;
width
:
900px
;
margin-left
:
-450px
;
z-index
:
99999
;
.thumb-col
{
width
:
50px
;
}
.thumb
{
width
:
50px
;
max-height
:
50px
;
}
}
table
{
...
...
@@ -168,6 +178,14 @@
width
:
250px
;
}
.insert-col
{
width
:
80px
;
}
.insert-asset-button
{
@include
blue-button
;
}
.embeddable-xml-input
{
@include
box-shadow
(
none
);
width
:
100%
;
...
...
@@ -176,6 +194,7 @@
.thumb
{
width
:
100px
;
max-height
:
80px
;
overflow
:
hidden
;
img
{
width
:
100%
;
...
...
cms/templates/unit.html
View file @
9613f92f
...
...
@@ -61,7 +61,7 @@
<
th
class
=
"thumb-col"
><
/th
>
<
th
class
=
"name-col"
>
Name
<
/th
>
<
th
class
=
"date-col"
>
Date
Added
<
/th
>
<
th
class
=
"
embed-col"
>
Embed
<
/th
>
<
th
class
=
"
insert-col"
>
<
/th
>
<
/tr
>
<
/thead
>
<
tbody
id
=
"asset_table_body"
>
...
...
@@ -72,14 +72,14 @@
<
/div
>
<
/td
>
<
td
class
=
"name-col"
>
<
a
href
=
"#"
class
=
"filename"
>
asset
name
<
/a
>
<
a
href
=
"#"
class
=
"filename"
>
my
-
image
.
jpg
<
/a
>
<
div
class
=
"embeddable-xml"
><
/div
>
<
/td
>
<
td
class
=
"date-col"
>
date
<
/td
>
<
td
class
=
"
embed
-col"
>
<
input
type
=
"text"
class
=
"embeddable-xml-input"
value
=
'<img src="#"/>'
>
<
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"
>
...
...
@@ -95,8 +95,8 @@
<
td
class
=
"date-col"
>
date
<
/td
>
<
td
class
=
"
embed
-col"
>
<
input
type
=
"text"
class
=
"embeddable-xml-input"
value
=
'<img src="#"/>'
>
<
td
class
=
"
insert
-col"
>
<
a
href
=
"#"
class
=
"insert-asset-button"
>
Insert
<
/a
>
<
/td
>
<
/tr
>
<
tr
data
-
id
=
"id"
>
...
...
@@ -112,8 +112,8 @@
<
td
class
=
"date-col"
>
date
<
/td
>
<
td
class
=
"
embed
-col"
>
<
input
type
=
"text"
class
=
"embeddable-xml-input"
value
=
'<img src="#"/>'
>
<
td
class
=
"
insert
-col"
>
<
a
href
=
"#"
class
=
"insert-asset-button"
>
Insert
<
/a
>
<
/td
>
<
/tr
>
<
/tbody
>
...
...
cms/templates/widgets/asset-library-widget.html
deleted
100644 → 0
View file @
f16e7b2e
<article
class=
"asset-library widget"
>
<table>
<thead>
<tr>
<th
class=
"thumb-col"
></th>
<th
class=
"name-col"
>
Name
</th>
<th
class=
"date-col"
>
Date Added
</th>
<th
class=
"embed-col"
>
Embed
</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"
>
asset name
</a>
<div
class=
"embeddable-xml"
></div>
</td>
<td
class=
"date-col"
>
date
</td>
<td
class=
"embed-col"
>
<input
type=
"text"
class=
"embeddable-xml-input"
value=
'<img src="#"/>'
>
</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>
\ No newline at end of file
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