Skip to content
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

Open
wants to merge 82 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
e4ccd64
preliminary work on video plugin, based on image plugin
agrippa Feb 2, 2013
4453e6f
push visual changes to editor
agrippa Feb 2, 2013
a12590e
visual portion of the video plugin
agrippa Feb 2, 2013
2c7147a
Adding js for processing video urls
Iventio Feb 2, 2013
94cec3c
remove unused code from video dialog
agrippa Feb 2, 2013
928c345
add separate video plugin files
agrippa Feb 2, 2013
c24ea9f
video plugin setup
agrippa Feb 3, 2013
aa83893
remove badly placed video plugin, probably not what we need yet
agrippa Feb 3, 2013
4ae23bb
remove a couple of console prints
agrippa Feb 3, 2013
3d8bd43
Merge branch 'video-plugin' of git://github.com/wysiwhat/Aloha-Editor…
Iventio Feb 3, 2013
ed34c32
Updated the js to support rudimentary video inserts
Iventio Feb 3, 2013
bb77393
Removed debugging code
Iventio Feb 3, 2013
f4d4116
Gbenga's fix for youtube iframes covering toolbar
agrippa Feb 6, 2013
b79c846
input validation on url field while inserting video
agrippa Feb 6, 2013
822602d
changes to video plugin, not sure what
agrippa Feb 8, 2013
3efe96e
Stashing local changes( which the most recent version is a superset o…
Iventio Feb 8, 2013
ef1287b
Stashin changes
Iventio Feb 8, 2013
2f6e794
Merge branch 'video-plugin' of git://github.com/wysiwhat/Aloha-Editor…
Iventio Feb 8, 2013
a93794e
Added marvin's google picker code
Iventio Feb 8, 2013
4fc87f3
Added video plugin file to the newly created media-plugin branch
Iventio Mar 25, 2013
6bf9610
no idea what changes these are, but they're going to the defunct vide…
Mar 25, 2013
460bb25
update assorted-plugin with info on video plugin
Mar 25, 2013
962bee1
some CSS additions for the media plugin
Mar 25, 2013
9c6c1b9
Added video button to new branch
Iventio Mar 25, 2013
bd81dc5
Merge branch 'media-plugin' of github.com:wysiwhat/Aloha-Editor into …
Iventio Mar 25, 2013
d2c7c74
video plugin working in new media-plugin branch
Mar 25, 2013
e795066
Adding coffeescript which uses gpicker
Iventio Mar 25, 2013
f577cfc
The Google picker now pops up, however has incorrect z-index b/c of t…
Iventio Mar 25, 2013
47ac2d3
Google picker now inserting videos into Aloha
Iventio Mar 28, 2013
c902bea
Merge branch 'video-plugin' of github.com:wysiwhat/Aloha-Editor into …
Mar 28, 2013
4b8d323
Revert "Merge branch 'video-plugin' of github.com:wysiwhat/Aloha-Edit…
Mar 28, 2013
873fc86
Correct image for video button
Apr 3, 2013
f5d307e
CHECK: Committing current changes, Max doesn't see the changes
Iventio Apr 3, 2013
711814d
Merge branch 'media-plugin' of github.com:wysiwhat/Aloha-Editor into …
Iventio Apr 3, 2013
d892a3d
decrease toolbar z-index un poco to keep it behind google picker
agrippa Apr 3, 2013
80c10d8
Attempting to use iframe
Iventio Apr 3, 2013
7cec7ae
Video now the correct size
Iventio Apr 3, 2013
6e50e57
make video transparent
agrippa Apr 3, 2013
29a7534
Stashing changes which will be overwritten
Iventio Apr 6, 2013
bdea849
Merge branch 'media-plugin' of github.com:wysiwhat/Aloha-Editor into …
Iventio Apr 6, 2013
ed875e8
switch back to older picker
agrippa Apr 6, 2013
b55b9fb
pretty dialog for video
agrippa Apr 6, 2013
37dcf83
Merge branch 'media-plugin' of https://github.com/wysiwhat/Aloha-Edit…
Iventio Apr 6, 2013
a265609
working video insertion by search and selection
agrippa Apr 7, 2013
f1583f9
some highlighting in search results
agrippa Apr 9, 2013
4378ff8
add more information to videos in search results
agrippa Apr 10, 2013
c98e6c0
better video duration printing
agrippa Apr 10, 2013
e335f4b
starting to set up vimeo embedder, extract out embedders into separat…
agrippa Apr 10, 2013
d13095d
more separation of concerns (video embed code generation. still need …
agrippa Apr 10, 2013
d66484e
tried to get vimeo working, but looks like we might have to do oauth …
agrippa Apr 10, 2013
a4990e1
commented code for wrapping iframes in a div
agrippa Apr 11, 2013
485d5ce
working vimeo url validator
agrippa Apr 17, 2013
c77283a
support for vimeo URLs (though still not searches)
agrippa Apr 17, 2013
0a1146a
more robust vimeo url validator
agrippa Apr 17, 2013
3a0f1f0
working URL input for slideshare and vimeo
agrippa Apr 17, 2013
c871515
Merge branch 'media-plugin' of github.com:wysiwhat/Aloha-Editor into …
Iventio Apr 17, 2013
a9c0b45
remove old code
agrippa Apr 17, 2013
61456c1
Merge branch 'media-plugin' of github.com:wysiwhat/Aloha-Editor into …
Iventio Apr 17, 2013
a7109a9
support for concord labs embedding
agrippa Apr 17, 2013
473a538
fix chrome support
agrippa Apr 23, 2013
aed3e80
solve merge conflicts
therealmarv Apr 23, 2013
fec2d88
Merge branch 'oerpub-math-example-fix' into media-plugin
therealmarv Apr 23, 2013
0a7559a
resize vimeo videos the same size as youtube
therealmarv Apr 24, 2013
8c8b77b
deactivate Vimeo search option for now
therealmarv Apr 24, 2013
74a0f18
Merge branch 'media-plugin' of https://github.com/wysiwhat/Aloha-Edit…
Iventio May 2, 2013
ef45dc5
Cleaned up some of the extra code left over from our debugging
Iventio May 2, 2013
c201c40
Removed debugging comments
Iventio May 2, 2013
f4a46d5
Formatted url strings to look cuter
Iventio May 2, 2013
dc4f0a3
Updated the js to use css classes instead of hardcoding styling
Iventio May 3, 2013
27743e4
Removed unnecessary code and fixed youtube search results html - adde…
Iventio May 6, 2013
2aa9e08
Commented out all unnecessary code and now trying to fix error where …
Iventio May 7, 2013
bbdf69d
Merge branch 'master' into media-plugin
bnwest May 14, 2013
4f61c87
mod the coffee file to match the js file. create the js file using c…
bnwest May 14, 2013
3876401
Ensure .js and .coffee files for media plugin are up to date. Comment…
agrippa May 15, 2013
193eb54
Trying to fix invalid url highlight by adding more specific css rule
Iventio May 15, 2013
cac374e
Merge branch 'media-plugin' of github.com:wysiwhat/Aloha-Editor into …
Iventio May 15, 2013
9b917ee
Fixed input box highlighting issue, will now do full test before remo…
Iventio May 15, 2013
84a3e6c
Commiting updated css file
Iventio May 15, 2013
85c2e3b
Changed the ajax request for slideshare embedder to be async b/c requ…
Iventio May 15, 2013
32e8d38
Removed commented out code and changed concord url to reflect the cha…
Iventio May 15, 2013
2032acc
Adding js file
Iventio May 15, 2013
f01ee81
Use jquery to process ajax loaded html
izak May 25, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 6 additions & 21 deletions dev-workflow.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
# How we use branches and pull requests and redmine tickets:
## Branches
# How we use branches:
* We have two long lived branches -- master and dev.
* Dev is for integration testing. Feature and fix branches get merged here for immediate testing.
Dev can be deleted and rebuilt from master if needed.
* Pull requests go from feature and fix branches to master.
* Releases and gh-pages will run off of master.
* New features or bug fixes branch from master.
* Bug fix branches should use the redmine.oerpub.org ticket number in their name.

## Releases
* oerpub releases to remix.oerpub.org as close to immediately after new things are merged to master.
* Each release will be tagged. Major releases will get release branches.
* For releases that accumulate multiple features and fixes, a branch from master should be used to collect all the
changes that will be released together.

## Pull requests
* Pull requests go from feature and fix branches to master.
* Before merging to master, the pull request must be code reviewed and tested. When each is approved (code review, test)
a comment on the pull request should indicate the approval. When both approval comments are there, the pull request can
merged to master
* Dev is for integration testing. Feature and fix branches get merged here for immediate testing.

## Integration with redmine
# Integration with redmine
OERPUB is using [redmine.oerpub.org](http://redmine.oerpub.org) for tracking issues to the editor. When developers
are fixing bugs or adding ticketed features, they should reference the ticket in the commits as explained here:
[Referencing-issues-in-commit-messages](http://www.redmine.org/projects/redmine/wiki/RedmineSettings#Referencing-issues-in-commit-messages)
Expand All @@ -28,9 +14,8 @@ are fixing bugs or adding ticketed features, they should reference the ticket in
1. Make a feature-or-fix branch off of master.
2. Develop and test on the branch.
3. Merge to dev and build on testing.oerpub.org
4. Issue a pull request from the feature-or-fix branch to master. This can be after testing or simultaneous. If after
testing, be sure to indicate in a comment on the pull request that testing already passed.
5. Someone not-affiliated with the branch will review the request and ensure testing passes.
4. When testing passes, issue a pull request from the feature-or-fix branch to master.
5. Someone not-affiliated with the branch will review the request.
* 5A. Pull request is accepted
* merge pull-request into master
* merge master to gh-pages
Expand Down
13 changes: 12 additions & 1 deletion oerpub/css/toolbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ figure figcaption::before {
width: 100%;
padding-left: 1em;
box-shadow: 0 2px 3px 0 #CCC;
z-index: 1010;
z-index: 900;
}
.toolbar [class^="icon-"] {
margin: 0;
Expand Down Expand Up @@ -113,6 +113,9 @@ figure figcaption::before {
.toolbar .icon-image-insert {
background-position: -122px 0;
}
.toolbar .icon-video-insert {
background-position: -617px 0;
}
.toolbar .icon-link-insert {
background-position: -188px 0;
}
Expand Down Expand Up @@ -204,6 +207,13 @@ figure figcaption::before {
.toolbar .btn-group > .btn.active .icon-image-insert {
background-position: -122px -66px;
}
.toolbar .btn-group > .btn:hover .icon-video-insert,
.toolbar .btn-group > .btn:focus .icon-video-insert,
.toolbar .btn-group > .btn:active .icon-video-insert,
.toolbar .btn-group > .btn.active .icon-video-insert {
background-position: -617px -66px;
}

.toolbar .btn-group > .btn:hover .icon-link-insert,
.toolbar .btn-group > .btn:focus .icon-link-insert,
.toolbar .btn-group > .btn:active .icon-link-insert,
Expand Down Expand Up @@ -256,3 +266,4 @@ figure figcaption::before {
word-spacing: normal;
vertical-align: middle;
}

28 changes: 14 additions & 14 deletions oerpub/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
tal:attributes="src string:${request.static_url('oerpub.rhaptoslabs.swordpushweb:static/aloha-settings.js')}"> <!-- xhtml workaround --></script>
<script type="text/javascript" src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js"
tal:attributes="src string:${request.application_url}/bootstrap/docs/assets/js/bootstrap.js"> <!-- xhtml workaround --></script>

<script type="text/javascript" src="/Aloha-Editor/src/lib/aloha.js"
tal:attributes="src string:${request.application_url}/aloha/src/lib/aloha.js"
data-aloha-plugins="common/ui,
Expand All @@ -73,15 +74,20 @@
common/undo,
oer/undobutton,
oer/genericbutton"> <!-- xhtml workaround --></script>

<script type="text/javascript"
tal:content="string:var body_url = '${body_url}';">
var body_url = '/Aloha-Editor/oerpub/sandbox/index.html';</script>
<script type="text/javascript"
tal:content="string:var save_url = '${request.route_url('preview_save')}';">
var save_url = null;</script>
<!--Google Picker Includes -->
<script src="http://www.google.com/jsapi"></script>
<script type="text/javascript" src="/Aloha-Editor/src/plugins/oer/assorted/lib/image-dialog.js" tal:attributes="src string:${request.application_url}/aloha/src/plugins/oer/assorted/lib/image-dialog.js"></script>
<script type="text/javascript" src="/Aloha-Editor/src/plugins/oer/assorted/lib/aloha-helper.js" tal:attributes="src string:${request.application_url}/aloha/src/plugins/oer/assorted/lib/aloha-helper.js"></script>
<!--<script type="text/javascript" src="/Aloha-Editor/src/plugins/oer/assorted/lib/gpickerdialog.js"></script>-->
<script type="text/javascript">


// HTML elements which are the options in the heading drop down
var headingChoices = null;
// Element tags which are generated as headings
Expand Down Expand Up @@ -198,13 +204,6 @@
}
PubSub.pub('swordpushweb.saved');
});
} else {
$('#statusmessage').data('message')('Saved');
GenericButton.getButtons()["save"].enable(false);
$('.btn.save').html('Saved');
if (callback_function) {
callback_function();
}
}
}
}
Expand Down Expand Up @@ -256,14 +255,15 @@
// editor.isModified().
window.setInterval(savePreview, 30000);

setInterval(function() {
var editor = Aloha.getEditableById('canvas');
if (editor.isModified()) {

// Bind a handler for the changed event
var editor = Aloha.getEditableById('canvas');
Aloha.bind('aloha-smart-content-changed', function(){
if(editor.isModified()){
$('.btn.save').html('Save');
GenericButton.getButtons()["save"].enable(true);
}
}, 250);

});
// Binds the function to all headers, paragraphs, and pre tags
Aloha.jQuery(":header, p, pre").bind('click', headingFunc);
Aloha.jQuery('#canvas').bind('keyup', recursiveHeadingFunc);
Expand Down Expand Up @@ -337,7 +337,7 @@
<span class="separator"> </span>
<div class="btn-group">
<button class="btn action insertImage-oer" rel="tooltip" title="Insert Image"><i class="icon-image-insert"></i></button>
<button class="btn action insertVideo-oer" rel="tooltip" title="Insert Video"><i class="icon-image-insert"></i></button>
<button class="btn action insertVideo-oer" rel="tooltip" title="Insert Video"><i class="icon-video-insert"></i></button>
<button class="btn action createTable" rel="tooltip" title="Create Table"><i class="icon-table-insert"></i></button>
<button class="btn dropdown-toggle" data-toggle="dropdown" rel="tooltip" title="Table Operations">
<span class="caret"></span>
Expand Down
1 change: 1 addition & 0 deletions src/demo/imageribbon/aloha-helper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// 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");

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?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope.

var range = Aloha.Selection.getRangeObject();

GENTICS.Utils.Dom.insertIntoDOM(
Expand Down
29 changes: 17 additions & 12 deletions src/demo/imageribbon/gpickerdialog.js
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");

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? (more log lines below). And should the videoPicker be in the imageribbon demo?

Copy link

Choose a reason for hiding this comment

The 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});
}

Expand Down Expand Up @@ -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){
Expand All @@ -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&amp;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);
}
27 changes: 27 additions & 0 deletions src/plugins/oer/assorted/css/image.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ form#linkModal:focus {
outline: none;
}

.multimedia-video{
/*border: 10px solid #0000FF;*/
width: 500px;
height: 500px;
}

.placeholder.preview {
border: 1px solid #dddddd;
border-radius: 5px;
Expand All @@ -34,3 +40,24 @@ form#linkModal:focus {
.placeholder.preview h4 {
margin: 0 0 1em 0;
}

.search-result {
background: #fff;
width:100%;
border-bottom: 2px solid white;
cursor:pointer;
font-size:90%;
}

.search-result:hover {
background: #999;
}

.search-result-selected {
background:#888;
width:100%;
border-bottom: 2px solid white;
cursor:pointer;
font-size:90%;

}
14 changes: 14 additions & 0 deletions src/plugins/oer/assorted/lib/aloha-helper.js
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();
}
2 changes: 1 addition & 1 deletion src/plugins/oer/assorted/lib/assorted-plugin.coffee
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
###
Register a couple of assorted oer plugins
###
define [ 'aloha/plugin', 'jquery', 'popover', './link', './image', './figure', './title-figcaption', './list' ], (Plugin, $, Popover, linkConfig, imageConfig, figureConfig, figcaptionConfig) ->
define [ 'aloha/plugin', 'jquery', 'popover', './link', './image', './video', './figure', './title-figcaption', './list' ], (Plugin, $, Popover, linkConfig, imageConfig, videoConfig, figureConfig, figcaptionConfig) ->
Plugin.create 'assorted',
defaultSettings:
image:
Expand Down
4 changes: 1 addition & 3 deletions src/plugins/oer/assorted/lib/assorted-plugin.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
// Generated by CoffeeScript 1.3.3

/*
Register a couple of assorted oer plugins
*/


(function() {

define(['aloha/plugin', 'jquery', 'popover', './link', './image', './figure', './title-figcaption', './list'], function(Plugin, $, Popover, linkConfig, imageConfig, figureConfig, figcaptionConfig) {
define(['aloha/plugin', 'jquery', 'popover', './link', './image', './video', './gpickerdialog', './figure', './title-figcaption', './list'], function(Plugin, $, Popover, linkConfig, imageConfig, videoConfig, gpickerConfig, figureConfig, figcaptionConfig) {
return Plugin.create('assorted', {
defaultSettings: {
image: {
Expand Down
Loading