Skip to content

Instantly share code, notes, and snippets.

class="[a-zA-Z\w0-9:;\.\s\(\)\-\,]*"
@henriqueog
henriqueog / capture_courses_as_objects
Created November 1, 2017 10:41
captures the courses of a certain list in the blackboard and structures them as objects. trimString function required
//pegar lista de disciplinas criadas
_rootList=document.getElementById('listContainer_databody');
_rootListCount=0;
while(_rootListCount<_rootList.children.length)
{
_element = document.getElementById('listContainer_row:'+String(_rootListCount));
if(_element.children[1].childElementCount <=0){
_regExpCommunityID= new RegExp('[0-9]{1,5}','gi');
_regexpmodelID =new RegExp('\\([A-Z]{2,6}[0-9]{2,5}[A-Z]{1,3}\\)');
_urlComm =trimString(_element.children[2].children[1].children[0].getAttribute('href'));
@henriqueog
henriqueog / uncheckFields.js
Last active October 26, 2017 11:20
uncheck checkboxes into of element
$parent=document.getElementById('blockAttributes_table_jsListFULL_Instructor_249_1_body');
for (var $i = 0; $i < $parent.length; $i++) {
$rows = $parent.children[$i];
$rows.children[1].children[0].checked=false;
}
@henriqueog
henriqueog / moodle_upload_method.js
Created August 5, 2015 20:18
method that works with the upload on Moodle being used by Automation
_click(_image("add_file"));
_click(_file("repo_upload_file"));
_wait(2000);
var mkSimulation = new java.awt.Robot();
mkSimulation.delay(2000);
var clipboard = java.awt.Toolkit.getDefaultToolkit().getSystemClipboard();
var stringSelection = new java.awt.datatransfer.StringSelection('[path_of_file]');
clipboard.setContents(stringSelection,null);
mkSimulation.keyPress(java.awt.event.KeyEvent.VK_CONTROL);
mkSimulation.delay(200);
@henriqueog
henriqueog / captureInfo.js
Last active January 22, 2018 19:54
Capture video file name and data-id
//classe dos elementos DIV que contem o vídeo
//k-u-P-m
//o attribute que precisamos para pegar o id do vídeo
//data-id
//pegando os vídeos
VideoElements = document.getElementsByClassName('k-u-P-m');
for (var i = 0, total = VideoElements.length; i < total; i++) {