Skip to content

Commit

Permalink
numerous issue fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown authored and unknown committed Sep 20, 2013
1 parent fefbbd5 commit df30387
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 7 deletions.
12 changes: 10 additions & 2 deletions src/its.assignment.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,25 @@ if(chrome.extension)
chrome.extension.sendRequest({}, function(response) {});

$(function () {


markPage();
fixColors();
toggleRows();
//alert(localStorage.toggleOn);
if(localStorage.toggleOff!='false')
toggleRows();


var icon = 'https://statics.itslearning.com/v3.42.1.195/icons/xp/search_no_shadow16.png';
$('.toolbar').append('<ul style=float:right><li style=background-color:orange><img src="' + icon + '" /><a id=btnToggle href=#><b>Toggle See All</b></a></li></ul>');

$('#btnToggle').click(function (e) {
e.preventDefault();

toggleRows();
if(localStorage.toggleOff=='false')
localStorage.toggleOff=true;
else
localStorage.toggleOff=false;
});


Expand All @@ -31,6 +38,7 @@ $(function () {

function toggleRows() {
$("#EssayAnswers_EssayAnswers .remove").slideToggle();

}

function markRows(text) {
Expand Down
3 changes: 2 additions & 1 deletion src/its.assignmentReport.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ $(function () {
if(isColumnAdded)
return;
$(".tablelisting table tr:lt(1)").prepend("<th>Personnummer</th>");
$(".tablelisting table tr:gt(0)").prepend("<td>"+missingPersonalNumber+"</td>");
$(".tablelisting table tr:gt(0)").prepend("<td>"+missingPersonalNumberText+"</td>");
addPeopleToList(); //needs to be done once.. so here is a good place... (since the column needs to be added)
isColumnAdded=true;
}
Expand Down Expand Up @@ -134,6 +134,7 @@ $(function () {
for(var index=0; index<textsToReplaceWithG.length;index++)
{
var text = $(this).text().replace(textsToReplaceWithG[index], 'G');
text=$.trim(text); //Trim white spaces
$(this).text(text);
}
});
Expand Down
14 changes: 11 additions & 3 deletions src/its.dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ if(chrome.extension)
chrome.extension.sendRequest({}, function(response) {});

$(function(){

var swedish=false;

var courseWidget = getWidget(document, "Courses");

if(courseWidget.length==0)
courseWidget = getWidget(document, "Kurser");
swedish=true;
init();

function init(){
Expand All @@ -25,6 +27,8 @@ $(function(){
.click(btnTasks_clicked);

var newsWidget = getWidget(document, "News").hide();
var newsWidget = getWidget(document, "Nyheter").hide();

}

function btnTasks_clicked(e)
Expand All @@ -51,7 +55,11 @@ $(function(){

function getTasksFromCoursePage(html)
{
var taskWidget = getWidget(html, "Follow up tasks");
var taskWidget;
if(!swedish)
taskWidget= getWidget(html, "Follow up tasks");
else
taskWidget= getWidget(html, "Följ upp uppgifter");
var list = taskWidget.find('.il-widget-bottom ul li');

var tasks = $.map(list, function(li, i){
Expand Down
3 changes: 2 additions & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"update_url": "https://github.com/dogbrain/Its-Learning-Reformer/raw/master/release/update.xml",

"permissions": [
"https://mah.itslearning.com/"
"https://mah.itslearning.com/",
"storage"
],

"page_action": {
Expand Down

0 comments on commit df30387

Please sign in to comment.