Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xblock-google-drive
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
xblock-google-drive
Commits
963019b3
Commit
963019b3
authored
Dec 10, 2014
by
Martyn James
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10 from edx-solutions/mjevtic/SOL-135
Added title attribute to iframe/img
parents
c5e6c708
7dc4e55b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
5 deletions
+13
-5
google_drive/google_calendar.py
+1
-1
google_drive/google_docs.py
+2
-1
google_drive/public/js/google_docs.js
+9
-2
google_drive/templates/html/google_docs.html
+1
-1
No files found.
google_drive/google_calendar.py
View file @
963019b3
...
@@ -51,7 +51,7 @@ class GoogleCalendarBlock(XBlock):
...
@@ -51,7 +51,7 @@ class GoogleCalendarBlock(XBlock):
view
=
"Week"
if
self
.
default_view
==
0
else
"Month"
if
self
.
default_view
==
1
else
"Agenda"
view
=
"Week"
if
self
.
default_view
==
0
else
"Month"
if
self
.
default_view
==
1
else
"Agenda"
iframe
=
"<iframe src=
\"
https://www.google.com/calendar/embed?mode={}&src={}&showCalendars=0
\"
></iframe>"
.
format
(
view
,
self
.
calendar_id
)
iframe
=
'<iframe src="https://www.google.com/calendar/embed?mode={}&src={}&showCalendars=0" title="{}"></iframe>'
.
format
(
view
,
self
.
calendar_id
,
self
.
display_name
)
context
.
update
({
context
.
update
({
"self"
:
self
,
"self"
:
self
,
...
...
google_drive/google_docs.py
View file @
963019b3
...
@@ -49,8 +49,9 @@ class GoogleDocumentBlock(XBlock):
...
@@ -49,8 +49,9 @@ class GoogleDocumentBlock(XBlock):
fragment
=
Fragment
()
fragment
=
Fragment
()
context
.
update
({
context
.
update
({
"self"
:
self
,
"self"
:
self
})
})
fragment
.
add_content
(
loader
.
render_template
(
'/templates/html/google_docs.html'
,
context
))
fragment
.
add_content
(
loader
.
render_template
(
'/templates/html/google_docs.html'
,
context
))
fragment
.
add_css
(
loader
.
load_unicode
(
'public/css/google_docs.css'
))
fragment
.
add_css
(
loader
.
load_unicode
(
'public/css/google_docs.css'
))
fragment
.
add_javascript
(
loader
.
load_unicode
(
'public/js/google_docs.js'
))
fragment
.
add_javascript
(
loader
.
load_unicode
(
'public/js/google_docs.js'
))
...
...
google_drive/public/js/google_docs.js
View file @
963019b3
...
@@ -2,6 +2,9 @@
...
@@ -2,6 +2,9 @@
function
GoogleDocumentBlock
(
runtime
,
element
)
{
function
GoogleDocumentBlock
(
runtime
,
element
)
{
var
iframe
=
$
(
'iframe'
,
element
);
var
iframe
=
$
(
'iframe'
,
element
);
var
image
=
$
(
'img'
,
element
);
var
display_name
=
$
(
'.google-docs-xblock-wrapper'
,
element
).
attr
(
'data-display-name'
);
if
(
iframe
.
length
>
0
){
if
(
iframe
.
length
>
0
){
var
iframe_src
=
iframe
.
attr
(
'src'
);
var
iframe_src
=
iframe
.
attr
(
'src'
);
...
@@ -10,6 +13,10 @@ function GoogleDocumentBlock(runtime, element) {
...
@@ -10,6 +13,10 @@ function GoogleDocumentBlock(runtime, element) {
/* add class to iframe containing Google document or spreadsheet*/
/* add class to iframe containing Google document or spreadsheet*/
iframe
.
addClass
(
'no-width-height'
);
iframe
.
addClass
(
'no-width-height'
);
}
}
iframe
.
attr
(
'title'
,
display_name
);
}
else
if
(
image
.
length
>
0
){
image
.
attr
(
'title'
,
display_name
);
}
}
function
SignalDocumentLoaded
(
ev
,
presented_within
){
function
SignalDocumentLoaded
(
ev
,
presented_within
){
...
@@ -23,7 +30,7 @@ function GoogleDocumentBlock(runtime, element) {
...
@@ -23,7 +30,7 @@ function GoogleDocumentBlock(runtime, element) {
})
})
});
});
}
}
$
(
'iframe'
,
element
)
.
load
(
function
(
e
){
SignalDocumentLoaded
(
e
,
'iframe'
);});
iframe
.
load
(
function
(
e
){
SignalDocumentLoaded
(
e
,
'iframe'
);});
$
(
'img'
,
element
)
.
load
(
function
(
e
){
SignalDocumentLoaded
(
e
,
'img'
);});
image
.
load
(
function
(
e
){
SignalDocumentLoaded
(
e
,
'img'
);});
}
}
google_drive/templates/html/google_docs.html
View file @
963019b3
<div
class=
"google-docs-xblock-wrapper"
>
<div
class=
"google-docs-xblock-wrapper"
data-display-name=
"{{self.display_name}}"
>
{{ self.embed_code|safe }}
{{ self.embed_code|safe }}
</div>
</div>
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