Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dwinn committed Nov 23, 2017
2 parents 59cdec4 + 3a2ba33 commit edef1c5
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 16 deletions.
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
### Date: 2017-October-30
### Release: v2017103001
### Date: 2017-November-23
### Release: v2017112301

Support for Moodle 3.4

After lots of tests against the release of Moodle 3.4, we're pleased to announce that Turnitin's Moodle Direct V2 plugin now supports it.

---

### Date: 2017-October-30
### Release: v2017103001

V1 to V2 Moodle Migration Tool

Expand Down
2 changes: 1 addition & 1 deletion classes/v1migration/v1migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ public function migrate_modal($courseid, $turnitintoolid) {
$PAGE->requires->css($cssurl);
$cssurl = new moodle_url('/mod/turnitintooltwo/css/font-awesome.min.css');
$PAGE->requires->css($cssurl);
$PAGE->requires->jquery_plugin('turnitintooltwo-migration_tool', 'mod_turnitintooltwo');
$PAGE->requires->jquery_plugin('turnitintooltwo-colorbox', 'mod_turnitintooltwo');
$PAGE->requires->jquery_plugin('turnitintooltwo-turnitintooltwo', 'mod_turnitintooltwo');
$PAGE->requires->jquery_plugin('turnitintooltwo-migration_tool', 'mod_turnitintooltwo');

$PAGE->requires->string_for_js('closebutton', 'turnitintooltwo');

Expand Down
26 changes: 16 additions & 10 deletions jquery/turnitintooltwo_migration_tool.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,49 @@ $(document).ready(function(){
window.location.href = M.cfg.wwwroot + "/mod/turnitintooltwo/view.php?id="+data.v2id;
} else {
displayMigrationModal();

$('.dontmigrate_link').click($.proxy(dontmigrate, null, $.colorbox));
}
}
});
});

$('.migrate_link').click(function() {
$('.migrate_link').on('click', function() {
$('#asktomigrate').hide();
$('#migrating').show();
migrate($(this).data("courseid"), $(this).data("turnitintoolid"));
});

$('.dontmigrate_link').click(function () {
$.colorbox.close();
function dontmigrate(cb) {
$('#migration_alert').hide();
});
cb.close();
}

function lightBoxCloseButton(cb) {
$('body').append('<div id="tii_close_bar"><a class="tii_close_link" href="#">' + M.str.turnitintooltwo.closebutton + '</a></div>');
}


function displayMigrationModal() {
// Only display the modal during a manual migration.
if ($("#migrate_type").data("turnitintoolid") != $("#migrate_type").data("lastasked")) {
if ($('#migrate_type').data("turnitintoolid") != $("#migrate_type").data("lastasked")) {
$.colorbox({width: 550, height: 600, inline:true, opacity: "0.7", href:"#migration_alert",
onLoad: function() {
$('#asktomigrate').show();
lightBoxCloseButton();

$('.tii_close_link').click($.proxy(dontmigrate, null, $.colorbox));
},
onCleanup:function() {
$('#tii_close_bar').remove();
$('#migration_alert').hide();
}
});

$('#migration_alert').show();
}

if ($("#migrate_type").data("migratetype") == 2) {
if ($('#migrate_type').data("migratetype") == 2) {
$('#asktomigrate').hide();
$('#migrating').show();

Expand Down Expand Up @@ -85,7 +95,3 @@ function migrate(courseid, turnitintoolid) {
}
});
}

function lightBoxCloseButton() {
$('body').append('<div id="tii_close_bar"><a href="#" onclick="$.colorbox.close(); return false;">' + M.str.turnitintooltwo.closebutton + '</a></div>');
}
Loading

0 comments on commit edef1c5

Please sign in to comment.