diff --git a/originals/SzAmmi/followMyself.js b/originals/SzAmmi/followMyself.js new file mode 100644 index 0000000..c6e1251 --- /dev/null +++ b/originals/SzAmmi/followMyself.js @@ -0,0 +1,19 @@ +//Run on: *//scratch.mit.edu/users/*/ + +url = window.location.href; +yourUsername = Scratch.INIT_DATA.LOGGED_IN_USER.model.username; +usernameFromURL = url.substring(url.lastIndexOf("users/")+6,url.lastIndexOf("/")); + +if (typeof(localStorage['following_myself']) === "undefined") { localStorage['following_myself'] = false; } +divClass = localStorage['following_myself'] == "false" ? "follow-button button notfollowing blue" : "follow-button button following grey"; +dataControl = localStorage['following_myself'] == "true" ? "unfollow" : "follow"; + +Scratch.changeStatusForMyself = function() { + if (localStorage['following_myself'] == "true") { + localStorage['following_myself'] = false; + return; + } + localStorage['following_myself'] = true; +} + +$(".header-text").after('
Unfollow
');