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
e171d97d
Commit
e171d97d
authored
Nov 20, 2012
by
Tom Giannattasio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upload process; basic lms styles
parent
af908104
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
142 additions
and
21 deletions
+142
-21
cms/static/css/html-editor.css
+5
-0
cms/static/js/base.js
+16
-2
cms/static/js/html-editor.js
+27
-4
cms/static/sass/_assets.scss
+27
-6
cms/static/sass/_lms.scss
+56
-0
cms/static/sass/_unit.scss
+8
-8
cms/static/sass/base-style.scss
+3
-1
cms/templates/unit.html
+0
-0
No files found.
cms/static/css/html-editor.css
View file @
e171d97d
...
@@ -33,6 +33,11 @@ h2 {
...
@@ -33,6 +33,11 @@ h2 {
text-transform
:
uppercase
;
text-transform
:
uppercase
;
}
}
h3
{
font-size
:
19px
;
font-weight
:
400
;
}
code
{
code
{
margin
:
0
2px
;
margin
:
0
2px
;
padding
:
0px
5px
;
padding
:
0px
5px
;
...
...
cms/static/js/base.js
View file @
e171d97d
...
@@ -463,11 +463,25 @@ function displayFinishedUpload(xhr) {
...
@@ -463,11 +463,25 @@ function displayFinishedUpload(xhr) {
}
}
var resp = JSON.parse(xhr.responseText);
var resp = JSON.parse(xhr.responseText);
$('
.
upload
-
modal
.
embeddable
-
xml
-
input
').val('
<
img
src
=
"' + xhr.getResponseHeader('asset_url') + '"
/>
');
var extension = resp.url.match(/
\
.([0-9a-z]+)(?:[
\
?#]|$)/i);
var embedMarkup;
switch(extension[1]) {
case '
png
':
case '
jpg
':
case '
jpeg
':
case '
gif
':
embedMarkup = '
<
img
src
=
"' + xhr.getResponseHeader('asset_url') + '"
/>
';
break;
default:
embedMarkup = '
<
a
href
=
"' + xhr.getResponseHeader('asset_url') + '"
>
' + resp.displayname + '
<
/a>'
;
break
;
}
$
(
'.upload-modal .embeddable-xml-input'
).
val
(
embedMarkup
);
$
(
'.asset-library.widget .insert-asset-button'
).
attr
(
'data-markup'
,
embedMarkup
);
$
(
'.upload-modal .embeddable'
).
show
();
$
(
'.upload-modal .embeddable'
).
show
();
$
(
'.upload-modal .file-name'
).
hide
();
$
(
'.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'
).
addClass
(
'another'
).
show
();
$
(
'.upload-modal .progress-fill'
).
width
(
'100%'
);
$
(
'.upload-modal .progress-fill'
).
width
(
'100%'
);
// see if this id already exists, if so, then user must have updated an existing piece of content
// see if this id already exists, if so, then user must have updated an existing piece of content
...
...
cms/static/js/html-editor.js
View file @
e171d97d
...
@@ -17,13 +17,13 @@ function initHTMLEditor($editor, $prev) {
...
@@ -17,13 +17,13 @@ function initHTMLEditor($editor, $prev) {
theme
:
"advanced"
,
theme
:
"advanced"
,
skin
:
'studio'
,
skin
:
'studio'
,
// we may want to add "styleselect" when we collect all styles used throught the lms
// we may want to add "styleselect" when we collect all styles used through
ou
t the lms
theme_advanced_buttons1
:
"formatselect,bold,italic,underline,bullist,numlist,outdent,indent,blockquote,studio.asset,link,unlink"
,
theme_advanced_buttons1
:
"formatselect,bold,italic,underline,bullist,numlist,outdent,indent,blockquote,studio.asset,link,unlink"
,
theme_advanced_toolbar_location
:
"top"
,
theme_advanced_toolbar_location
:
"top"
,
theme_advanced_toolbar_align
:
"left"
,
theme_advanced_toolbar_align
:
"left"
,
theme_advanced_statusbar_location
:
"none"
,
theme_advanced_statusbar_location
:
"none"
,
theme_advanced_resizing
:
true
,
theme_advanced_resizing
:
true
,
theme_advanced_blockformats
:
"p,code,h2,h3,
h4,h5,h6,
blockquote"
,
theme_advanced_blockformats
:
"p,code,h2,h3,blockquote"
,
content_css
:
"/static/css/html-editor.css"
,
content_css
:
"/static/css/html-editor.css"
,
width
:
'100%'
,
width
:
'100%'
,
height
:
'400px'
,
height
:
'400px'
,
...
@@ -32,11 +32,12 @@ function initHTMLEditor($editor, $prev) {
...
@@ -32,11 +32,12 @@ function initHTMLEditor($editor, $prev) {
title
:
'Add Asset'
,
title
:
'Add Asset'
,
image
:
'/static/img/visual-editor-image-icon.png'
,
image
:
'/static/img/visual-editor-image-icon.png'
,
onclick
:
function
()
{
onclick
:
function
()
{
$assetWidget
=
$
(
$
(
'#asset-library-widget'
).
html
());
$assetWidget
=
$
(
$
(
'#asset-library-widget'
).
html
());
$assetWidget
.
find
(
'.close-button'
).
bind
(
'click'
,
closeAssetWidget
);
$modalCover
.
unbind
(
'click'
);
$modalCover
.
unbind
(
'click'
);
$modalCover
.
bind
(
'click'
,
closeAssetWidget
);
$modalCover
.
bind
(
'click'
,
closeAssetWidget
);
$modalCover
.
css
(
'z-index'
,
'99999'
);
$modalCover
.
css
(
'z-index'
,
'99999'
);
$
(
'.upload-button'
,
$assetWidget
).
bind
(
'click'
,
uploadFromWidget
);
$
(
'.close-button'
,
$assetWidget
).
bind
(
'click'
,
closeAssetWidget
);
$
(
'.insert-asset-button'
,
$assetWidget
).
bind
(
'click'
,
{
editor
:
ed
},
insertAsset
);
$
(
'.insert-asset-button'
,
$assetWidget
).
bind
(
'click'
,
{
editor
:
ed
},
insertAsset
);
$body
.
append
(
$assetWidget
);
$body
.
append
(
$assetWidget
);
}
}
...
@@ -54,6 +55,28 @@ function initHTMLEditor($editor, $prev) {
...
@@ -54,6 +55,28 @@ function initHTMLEditor($editor, $prev) {
$editor
.
find
(
'.save-button, .cancel-button'
).
bind
(
'click'
,
updateHTMLPreview
);
$editor
.
find
(
'.save-button, .cancel-button'
).
bind
(
'click'
,
updateHTMLPreview
);
}
}
function
uploadFromWidget
(
e
)
{
$
(
'.library'
,
$assetWidget
).
hide
();
$
(
'.upload-form'
,
$assetWidget
).
show
();
$
(
'.choose-file-button'
,
$assetWidget
).
bind
(
'click'
,
function
(
e
)
{
e
.
preventDefault
();
$
(
'.file-input'
,
$assetWidget
).
click
();
$
(
'.file-input'
,
$assetWidget
).
bind
(
'change'
,
startUpload
);
});
}
function
startUploadFromWidget
(
e
)
{
$
(
'.upload-modal h1'
).
html
(
'Uploading…'
);
$
(
'.upload-modal .file-name'
).
html
(
$
(
'.file-input'
).
val
().
replace
(
'C:
\\
fakepath
\
\'
, ''));
$('
.
upload
-
modal
.
file
-
chooser
').ajaxSubmit({
beforeSend: resetUploadBar,
uploadProgress: showUploadFeedback,
complete: displayFinishedUpload
});
$('
.
upload
-
modal
.
choose
-
file
-
button
').hide();
$('
.
upload
-
modal
.
progress
-
bar
').removeClass('
loaded
').show();
}
function insertAsset(e) {
function insertAsset(e) {
closeAssetWidget();
closeAssetWidget();
var editor = e.data.editor;
var editor = e.data.editor;
...
...
cms/static/sass/_assets.scss
View file @
e171d97d
...
@@ -37,6 +37,12 @@
...
@@ -37,6 +37,12 @@
@include
blue-button
;
@include
blue-button
;
padding
:
10px
82px
12px
;
padding
:
10px
82px
12px
;
font-size
:
17px
;
font-size
:
17px
;
&
.another
{
@include
white-button
;
padding
:
6px
22px
8px
;
font-size
:
13px
;
}
}
}
.progress-bar
{
.progress-bar
{
...
@@ -149,7 +155,7 @@
...
@@ -149,7 +155,7 @@
margin-top
:
2px
;
margin-top
:
2px
;
background-color
:
#fff
;
background-color
:
#fff
;
background-position
:
12px
8px
;
background-position
:
12px
8px
;
font-size
:
1
4
px
;
font-size
:
1
3
px
;
}
}
.thumb-col
{
.thumb-col
{
...
@@ -198,6 +204,21 @@
...
@@ -198,6 +204,21 @@
.upload-form
{
.upload-form
{
display
:
none
;
display
:
none
;
width
:
auto
!
important
;
margin
:
60px
30px
80px
!
important
;
text-align
:
center
;
h1
{
float
:
none
;
font-size
:
34px
;
font-weight
:
300
;
text-align
:
center
;
}
.insert-asset-button
{
padding
:
8px
40px
10px
;
font-size
:
17px
;
}
}
}
}
}
...
@@ -258,11 +279,6 @@
...
@@ -258,11 +279,6 @@
width
:
100px
;
width
:
100px
;
}
}
.insert-asset-button
{
@include
blue-button
;
font-size
:
12px
;
}
.embeddable-xml-input
{
.embeddable-xml-input
{
@include
box-shadow
(
none
);
@include
box-shadow
(
none
);
width
:
100%
;
width
:
100%
;
...
@@ -279,6 +295,11 @@
...
@@ -279,6 +295,11 @@
}
}
}
}
.insert-asset-button
{
@include
blue-button
;
font-size
:
12px
;
}
.pagination
{
.pagination
{
float
:
right
;
float
:
right
;
margin
:
15px
10px
;
margin
:
15px
10px
;
...
...
cms/static/sass/_lms.scss
0 → 100644
View file @
e171d97d
.components
li
{
font-family
:
'Open Sans'
,
Verdana
,
Arial
,
Helvetica
,
sans-serif
;
font-size
:
16px
;
line-height
:
1
.6
;
color
:
#3c3c3c
;
a
{
color
:
#1d9dd9
;
text-decoration
:
none
;
}
p
{
font-size
:
16px
;
line-height
:
1
.6
;
}
h2
{
color
:
#646464
;
font-size
:
19px
;
font-weight
:
300
;
letter-spacing
:
1px
;
margin-bottom
:
15px
;
text-transform
:
uppercase
;
}
h3
{
font-size
:
19px
;
font-weight
:
400
;
}
code
{
margin
:
0
2px
;
padding
:
0px
5px
;
border-radius
:
3px
;
border
:
1px
solid
#eaeaea
;
white-space
:
nowrap
;
font-family
:
Monaco
,
monospace
;
font-size
:
14px
;
background-color
:
#f8f8f8
;
}
p
+
h2
,
ul
+
h2
,
ol
+
h2
,
p
+
h3
{
margin-top
:
40px
;
}
p
+
p
,
ul
+
p
,
ol
+
p
{
margin-top
:
20px
;
}
p
{
color
:
#3c3c3c
;
font
:
normal
1em
/
1
.6em
;
margin
:
0px
;
}
}
\ No newline at end of file
cms/static/sass/_unit.scss
View file @
e171d97d
...
@@ -40,14 +40,14 @@
...
@@ -40,14 +40,14 @@
}
}
}
}
h2
{
//
h2 {
margin
:
30px
0
;
//
margin: 30px 0;
color
:
#646464
;
//
color: #646464;
font-size
:
19px
;
//
font-size: 19px;
font-weight
:
300
;
//
font-weight: 300;
letter-spacing
:
1px
;
//
letter-spacing: 1px;
text-transform
:
uppercase
;
//
text-transform: uppercase;
}
//
}
.components
{
.components
{
>
li
{
>
li
{
...
...
cms/static/sass/base-style.scss
View file @
e171d97d
...
@@ -24,9 +24,10 @@
...
@@ -24,9 +24,10 @@
@import
"modal"
;
@import
"modal"
;
@import
"alerts"
;
@import
"alerts"
;
@import
"login"
;
@import
"login"
;
@import
"lms"
;
@import
'jquery-ui-calendar'
;
@import
'jquery-ui-calendar'
;
@import
'content-types'
;
@import
'content-types'
;
@import
'module/module-styles.scss'
;
@import
'module/module-styles.scss'
;
@import
'descriptor/module-styles.scss'
;
@import
'descriptor/module-styles.scss'
;
\ No newline at end of file
cms/templates/unit.html
View file @
e171d97d
This diff is collapsed.
Click to expand it.
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