Skip to content

Commit

Permalink
Disable material design added.
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulkapoor90 committed May 9, 2017
1 parent d768fbc commit 7e25457
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 10 deletions.
Binary file modified Extension for chrome.zip
Binary file not shown.
7 changes: 3 additions & 4 deletions Extension for chrome/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@
"matches": [ "*://vtop.vit.ac.in/student/home.asp" ]
}, {
"all_frames": true,
"css": ["css/materialize.min.css","css/home/spotlight_modified.css"],
"js": [ "scripts/jquery.min.js", "scripts/home/msgNew.js", "scripts/home/modify_spotlight.js","scripts/materialize.min.js" ],
"js": [ "scripts/jquery.min.js", "scripts/home/msgNew.js", "scripts/home/modify_spotlight.js"],
"matches": [ "*://vtop.vit.ac.in/student/stud_home.asp" ]
}, {
"all_frames": true,
Expand All @@ -116,6 +115,6 @@
},
"permissions": [ "activeTab", "https://ajax.googleapis.com/", "http://*/*", "storage", "webRequestBlocking", "webRequest", "downloads", "*://vtop.vit.ac.in/*", "notifications", "contextMenus", "https://vitacademics-rel.herokuapp.com/*", "identity", "gcm", "https://raw.githubusercontent.com/VaTz88/VES-API/master/*" ],
"short_name": "VES",
"version": "1.8.1",
"web_accessible_resources": [ "scripts/*", "https://storage.googleapis.com/code.getmdl.io/1.0.0/material.indigo-pink.min.css", "https://fonts.googleapis.com/icon?family=Material+Icons", "calc.js", "http://code.tidio.co" ]
"version": "1.8.2",
"web_accessible_resources": [ "scripts/*", "css/*", "https://storage.googleapis.com/code.getmdl.io/1.0.0/material.indigo-pink.min.css", "https://fonts.googleapis.com/icon?family=Material+Icons", "calc.js", "http://code.tidio.co" ]
}
7 changes: 6 additions & 1 deletion Extension for chrome/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ <h1>Enter Credentials for Pronto Auto Login</h1>
<input type="password" id="password" placeholder="Password">
<br>
<br>
<button id="save">Save</button>
<h1>New Material UI Design</h1>
<input type="radio" id="material_topbar" name="top_bar" value="Yes"> Yes
<input type="radio" id="material_topbar" name="top_bar" value="No"> No
<br>
<br>
<button id="save">Save</button><br><br>
<div id="status"></div>
<script src="scripts/jquery.min.js"></script>
<script src="scripts/options.js"></script>
Expand Down
34 changes: 33 additions & 1 deletion Extension for chrome/scripts/home/modify_spotlight.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
chrome.storage.sync.get({
material : ""
}, function(items) {
var material = items.material;
console.log(material);
if(material == "Yes"){

var a = chrome.extension.getURL("css/home/spotlight_modified.css");
var b = chrome.extension.getURL("css/materialize.min.css");
var c = chrome.extension.getURL("scripts/materialize.min.js");

var css = document.createElement('link');
css.type = 'text/css';
css.rel = 'stylesheet';
css.href = a;
document.getElementsByTagName('head')[0].appendChild(css);

var css1 = document.createElement('link');
css1.type = 'text/css';
css1.rel = 'stylesheet';
css1.href = b;
document.getElementsByTagName('head')[0].appendChild(css1);

var scr = document.createElement('script');
scr.type = 'text/javascript';
scr.src = c;
document.getElementsByTagName('head')[0].appendChild(scr);

$(function () {
//Attendence
$("<div class='card-panel'><div class='row' id='attendenceCard'></div></div>").insertBefore(".main_content");
Expand All @@ -17,4 +45,8 @@ $(function () {
}

$(".main_content").remove();
});
});

}

});
18 changes: 14 additions & 4 deletions Extension for chrome/scripts/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@ function save_options() {
var username = $('#username').val()
//var password = document.getElementById('password').value;
var password = $('#password').val()
var material = $('input[name=top_bar]:checked').val()
//Insted the above 2 calls we can use .next() method without again traversing
//var password = username.nextElementSibling.val()

chrome.storage.sync.set({
username: username,
password: password
password: password,
material: material
}, function () {
// Update status to let user know options were saved.
//var status = document.getElementById('status');
var status = $('#status')[0]
status.textContent = 'Credentials saved.';
status.textContent = 'Credentials & settings saved.';
setTimeout(function () {
status.style.display = 'none';
}, 750);
}, 800);
});
}

Expand All @@ -28,11 +30,19 @@ jQuery(document).ready(
// Use default value color = 'red' and likesColor = true.
chrome.storage.sync.get({
username: "",
password: ""
password: "",
material: ""
}, function (items) {
//document.getElementById('username').value = items.username;
//document.getElementById('password').value = items.password;

if(items.material == "Yes"){
$('input[value="Yes"]').attr('checked',true);
}
else {
$('input[value="No"]').attr('checked',true);
}

//Using jquery
$('#username').val(items.username)
$('#password').val(items.password)
Expand Down

0 comments on commit 7e25457

Please sign in to comment.