-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Media plugin #25
base: master
Are you sure you want to change the base?
Media plugin #25
Changes from 59 commits
e4ccd64
4453e6f
a12590e
2c7147a
94cec3c
928c345
c24ea9f
aa83893
4ae23bb
3d8bd43
ed34c32
bb77393
f4d4116
b79c846
822602d
3efe96e
ef1287b
2f6e794
a93794e
4fc87f3
6bf9610
460bb25
962bee1
9c6c1b9
bd81dc5
d2c7c74
e795066
f577cfc
47ac2d3
c902bea
4b8d323
873fc86
f5d307e
711814d
d892a3d
80c10d8
7cec7ae
6e50e57
29a7534
bdea849
ed875e8
b55b9fb
37dcf83
a265609
f1583f9
4378ff8
c98e6c0
e335f4b
d13095d
d66484e
a4990e1
485d5ce
c77283a
0a1146a
3a0f1f0
c871515
a9c0b45
61456c1
a7109a9
473a538
aed3e80
fec2d88
0a7559a
8c8b77b
74a0f18
ef45dc5
c201c40
f4a46d5
dc4f0a3
27743e4
2aa9e08
bbdf69d
4f61c87
3876401
193eb54
cac374e
9b917ee
84a3e6c
85c2e3b
32e8d38
2032acc
f01ee81
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
// Google Picker for uploading images | ||
function newImagePicker() { | ||
console.log("Creating new image Picker"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should these log lines be added to Aloha? (more log lines below). And should the videoPicker be in the imageribbon demo? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably not. This is probably just for debugging, Gbenga and I haven't made a cleanup/commenting pass through the code yet. |
||
google.load('picker', '1', {"callback" : createImagePicker}); | ||
} | ||
|
||
|
@@ -34,25 +35,15 @@ function ImagePickerCallback(data) { | |
|
||
var img = Aloha.jQuery("<img />").attr("src", image_url); | ||
AlohaInsertIntoDom(img); | ||
console.log("Inserting into Dom from ImagePickerCallback"); | ||
} | ||
} | ||
|
||
// Google Picker for uploading videos | ||
function newVideoPicker() { | ||
console.log("Creating new video Picker in newVideoPicker"); | ||
google.load('picker', '1', {"callback" : createVideoPicker}); | ||
} | ||
|
||
function createVideoPicker() { | ||
var picker = new google.picker.PickerBuilder(). | ||
addView(new google.picker.VideoSearchView(). | ||
setSite(google.picker.VideoSearchView.YOUTUBE)). | ||
addView(google.picker.ViewId.YOUTUBE). | ||
addView(new google.picker.WebCamView()). | ||
setCallback(VideoPickerCallback). | ||
build(); | ||
picker.setVisible(true); | ||
} | ||
|
||
// A simple callback implementation for Picker. | ||
function VideoPickerCallback(data) { | ||
if(data.action == google.picker.Action.PICKED){ | ||
|
@@ -62,6 +53,20 @@ function VideoPickerCallback(data) { | |
embed_url = doc[google.picker.Document.EMBEDDABLE_URL]; | ||
var embed_code_template = Aloha.jQuery('<object width="420" height="236"><param name="movie" value="http://www.youtube.com/v/Rj8JoAAytyg?version=3&hl=de_DE"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>'); | ||
var embed_code = Aloha.jQuery(embed_code_template).find('embed').attr('src', embed_url); | ||
console.log("Inserting into Dom from VideoPickerCallback"); | ||
AlohaInsertIntoDom(embed_code); | ||
} | ||
} | ||
|
||
function createVideoPicker() { | ||
console.log("Creating new video Picker"); | ||
var picker = new google.picker.PickerBuilder(). | ||
addView(new google.picker.VideoSearchView(). | ||
setSite(google.picker.VideoSearchView.YOUTUBE)). | ||
addView(google.picker.ViewId.YOUTUBE). | ||
addView(new google.picker.WebCamView()). | ||
setCallback(VideoPickerCallback). | ||
build(); | ||
console.log("Created video Picker and set call back"); | ||
picker.setVisible(true); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Insert custom HTML into dom tree at the current cursor position of Aloha editor | ||
// used this as template: https://github.com/michaelperrin/sfAlohaPlugin/blob/cc320dcc984bcf7a2b54bb0191276679eb951742/web/js/aloha-plugins/image-upload/lib/image-upload-plugin.js#L106 | ||
function AlohaInsertIntoDom(code) { | ||
console.log("Trying to insert into the DOM"); | ||
var range = Aloha.Selection.getRangeObject(); | ||
|
||
GENTICS.Utils.Dom.insertIntoDOM( | ||
code, | ||
range, | ||
Aloha, | ||
true | ||
); | ||
range.select(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these log lines be added to Aloha?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope.