Created
August 12, 2016 04:26
-
-
Save ZhangYiJiang/e89503477c68b38342b457213079b31e to your computer and use it in GitHub Desktop.
Reorder CORS tutorial ranking using drag and drop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name CORS Tutorial Reordering | |
// @namespace yijiang | |
// @description Reorder CORS tutorial ranking using drag and drop | |
// @include https://myaces.nus.edu.sg/cors/RankTutorialServlet | |
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js | |
// @require https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
$('form[name="FrmRankClass"] table').sortable({ | |
items: 'tr.tablerecord', | |
update: function(){ | |
$('form[name="FrmRankClass"] table tr.tablerecord').each(function(i) { | |
$(this).find('select option:nth-child(' + (i+1) + ')').prop('selected', true); | |
}); | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment