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
a5be4e1c
Commit
a5be4e1c
authored
Dec 03, 2014
by
Martyn James
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some tweaks to style and javascript loading
parent
2fcd892c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
26 deletions
+26
-26
google_drive/public/css/google_docs.css
+1
-3
google_drive/public/js/google_docs.js
+25
-23
No files found.
google_drive/public/css/google_docs.css
View file @
a5be4e1c
.google-docs-xblock-wrapper
iframe
{
max-width
:
100%
;
max-height
:
100%
;
display
:
block
;
margin
:
0
auto
;
}
iframe
.no-width-height
{
.google-docs-xblock-wrapper
iframe
.no-width-height
{
top
:
0
;
left
:
0
;
width
:
100%
;
...
...
@@ -16,7 +15,6 @@ iframe.no-width-height{
width
:
auto
;
height
:
auto
;
max-width
:
100%
;
max-height
:
100%
;
}
#validation_alert
{
...
...
google_drive/public/js/google_docs.js
View file @
a5be4e1c
/* Javascript for GoogleDocumentBlock. */
function
GoogleDocumentBlock
(
runtime
,
element
)
{
var
iframe
=
$
(
'iframe'
,
element
);
var
iframe_src
=
iframe
.
attr
(
'src'
);
$
(
function
(
$
)
{
var
iframe
=
$
(
'iframe'
,
element
);
if
(
iframe
.
length
>
0
){
var
iframe_src
=
iframe
.
attr
(
'src'
);
if
((
iframe_src
.
indexOf
(
"document"
)
>=
0
)
||
(
iframe_src
.
indexOf
(
"spreadsheets"
)
>=
0
)){
/* add class to iframe containing Google document or spreadsheet*/
iframe
.
addClass
(
'no-width-height'
);
}
if
((
iframe_src
.
indexOf
(
"document"
)
>=
0
)
||
(
iframe_src
.
indexOf
(
"spreadsheets"
)
>=
0
)){
/* add class to iframe containing Google document or spreadsheet*/
iframe
.
addClass
(
'no-width-height'
);
}
}
$
(
'iframe'
,
element
).
load
(
function
(){
var
iframe_url
=
$
(
this
).
attr
(
'src'
);
$
.
ajax
({
type
:
"POST"
,
url
:
runtime
.
handlerUrl
(
element
,
'iframe_loaded'
),
data
:
JSON
.
stringify
({
url
:
iframe_url
})
$
(
'iframe'
,
element
).
load
(
function
(){
var
iframe_url
=
$
(
this
).
attr
(
'src'
);
$
.
ajax
({
type
:
"POST"
,
url
:
runtime
.
handlerUrl
(
element
,
'iframe_loaded'
),
data
:
JSON
.
stringify
({
url
:
iframe_url
})
});
});
});
$
(
'img'
,
element
).
load
(
function
(){
var
image_url
=
$
(
this
).
attr
(
'src'
);
$
.
ajax
({
type
:
"POST"
,
url
:
runtime
.
handlerUrl
(
element
,
'image_loaded'
),
data
:
JSON
.
stringify
({
url
:
image_url
})
$
(
'img'
,
element
).
load
(
function
(){
var
image_url
=
$
(
this
).
attr
(
'src'
);
$
.
ajax
({
type
:
"POST"
,
url
:
runtime
.
handlerUrl
(
element
,
'image_loaded'
),
data
:
JSON
.
stringify
({
url
:
image_url
})
});
});
});
$
(
function
(
$
)
{
/* Here's where you'd do things on page load. */
});
}
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