Skip to content

Commit

Permalink
Merge pull request #67 from kaltura/MOODLE_29_STABLE_merge_with_DEV
Browse files Browse the repository at this point in the history
Moodle 29 stable merge with dev
  • Loading branch information
muli committed Nov 24, 2015
2 parents d7a7af7 + ff96c0a commit 89e629e
Show file tree
Hide file tree
Showing 24 changed files with 468 additions and 393 deletions.
21 changes: 20 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
/nbproject
# ignore all files
*

# except our plugins':

!mod/kalvidassign/*
!mod/kalvidpres/*
!mod/kalvidres/*

!filter/kaltura/*

!local/kaltura/*
!local/kalturamediagallery/*
!local/mymedia/*

!lib/editor/atto/plugins/kalturamedia/*
!lib/editor/tinymce/plugins/kalturamedia/*

!createPackage.sh
!incrementVersion.sh
6 changes: 3 additions & 3 deletions filter/kaltura/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
*/
defined('MOODLE_INTERNAL') || die();

$plugin->version = 2015091609;
$plugin->release = 'Kaltura release 4.0.07';
$plugin->version = 2015101809;
$plugin->release = 'Kaltura release 4.0.08';
$plugin->requires = 2014050800;
$plugin->maturity = MATURITY_STABLE;
$plugin->dependencies = array(
'local_kaltura' => 2015091609
'local_kaltura' => 2015101809
);
1 change: 1 addition & 0 deletions lib/editor/atto/plugins/kalturamedia/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ function atto_kalturamedia_params_for_js($elementid, $options, $fpoptions) {
return array(
'kalturauritoken' => KALTURA_URI_TOKEN,
'contextid' => $context->id,
'kafuri' => local_kaltura_get_config()->kaf_uri
);
}
6 changes: 3 additions & 3 deletions lib/editor/atto/plugins/kalturamedia/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2015091609; // The current plugin version (Date: YYYYMMDDXX).
$plugin->release = 'Kaltura release 4.0.07';
$plugin->version = 2015101809; // The current plugin version (Date: YYYYMMDDXX).
$plugin->release = 'Kaltura release 4.0.08';
$plugin->requires = 2014050800; // Requires this Moodle version.
$plugin->component = 'atto_kalturamedia'; // Full name of the plugin (used for diagnostics).
$plugin->dependencies = array(
'local_kaltura' => 2015091609
'local_kaltura' => 2015101809
);
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,17 @@ Y.namespace('M.atto_kalturamedia').Button = Y.Base.create('button', Y.M.editor_a

return courseId;
},


_replaceKafUriWithToken: function(sourceUrl, kafUri, kalturaToken) {
sourceUrl = this._removeProtocolFromUrl(sourceUrl);
kafUri = this._removeProtocolFromUrl(kafUri);
return sourceUrl.replace(kafUri, kalturaToken);
},

_removeProtocolFromUrl: function(fullUrl) {
return fullUrl.replace(/^https?:\/\//,'');
},

embedItem: function(what) {
var dialogue = this.getDialogue({
focusAfterHide: null
Expand All @@ -137,17 +147,13 @@ Y.namespace('M.atto_kalturamedia').Button = Y.Base.create('button', Y.M.editor_a
}
}

var token = this.get('kalturauritoken');
var url = '';
var token = this.get('kalturauritoken');
var kafUri = this.get('kafuri');
var sourceUrl = embedInfo.url;
var url = this._replaceKafUriWithToken(sourceUrl, kafUri, token);
var parser = document.createElement('a');
parser.href = embedInfo.url;
var basePathName = parser.pathname;
// IE fix because parser.pathname does not return with trailing slash
if(basePathName.indexOf('/') != 0)
{
basePathName = '/' + basePathName;
}
url = token + basePathName + parser.search;
parser.href = sourceUrl;
url += parser.search;

var content = '<a href="http://'+url+'">tinymce-kalturamedia-embed||'+embedInfo.title+'||'+embedInfo.width+'||'+embedInfo.height+'</a>';

Expand All @@ -156,7 +162,6 @@ Y.namespace('M.atto_kalturamedia').Button = Y.Base.create('button', Y.M.editor_a
host.insertContentAtFocusPoint(content);
this.markUpdated();
dialogue.set('bodyContent', "").hide();

}

} , {
Expand All @@ -176,6 +181,13 @@ Y.namespace('M.atto_kalturamedia').Button = Y.Base.create('button', Y.M.editor_a
*/
kalturauritoken: {
value: null
},

/**
* The KAF URI, as configured in Kaltura's plugin settings.
*/
kafuri: {
value: null
}
}}
);
Expand Down
Loading

0 comments on commit 89e629e

Please sign in to comment.