/*
autoEdit, paperEditing D&D from transcript to paperEdit.
Two lists multiSelectable, sortable, draggable.
Using unstyled list, with non draggable Questions, and Headings in the lists.
https://github.com/shvetsgroup/jquery.multisortable
Should be changed from ul li to p span tags, to allow for HTML5 compatibility
*/
jQuery(function ($) {
var papercuts = document.getElementById("transcription1").getElementsByClassName("child");
//initialise multisortable lists, for transcriptions and paperedit list
$('ul.sortable#transcription2,ul.sortable#transcription1,ul.sortable#paperedit').multisortable({
//excluding Question and Heading section from d&d
items: "li:not(.question,.heading)",
//selectedClass: "child",
//click: function(e){ console.log("I'm selected."); },
stop: function (e) {
//console.log("I've been sorted.");
//make ajax call to save paperCuts server side.
//on drop in paperEdit, an ajax request needs to update the papercuts on the server side.
//in order to do do that it needs to get paperCuts elements from paperEdit list
//with an on drop event listener to save list everytime things moved about in paper edit.
console.log(papercuts);
}
});
//connecting multiple of transcriptions to the paperEdit.
$('ul#transcription1').sortable('option', 'connectWith', 'ul#paperedit');
$('ul#transcription2').sortable('option', 'connectWith', 'ul#paperedit');
$('ul#paperedit').sortable('option', 'connectWith', 'ul#paperedit');
//keyboard shortcut using mouse trap to make selection transcript to paperEdit
//select words shift+click to select multiple faster.
//cmd+right, be default they are dropped, at end of Main heading
//https://craig.is/killing/mice
Mousetrap.bind('command+right', function (e) {
//need to select transcript in focus for shortcut to work properly
...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Fiddle Pages
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Get Fiddle Pages with PRO
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.