Skip to content
This repository has been archived by the owner on May 30, 2021. It is now read-only.

Commit

Permalink
HTTPS + projectStuff/autophosphorus
Browse files Browse the repository at this point in the history
I changed links to HTTPS as needed and added an autophosphorus option to projectStuff, which will automatically change the player to phosphorus.
  • Loading branch information
uyjulian committed Apr 24, 2017
1 parent 3b9f115 commit 2c1ae1f
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 47 deletions.
6 changes: 3 additions & 3 deletions IDEAS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Ideas to be added #

- ~~Notification bootcamp http://scratch.mit.edu/discuss/topic/65472/~~ *complete*
- ~~CookieVars extension http://scratch.mit.edu/discuss/topic/65698/~~ *complete*
- ~~http://scratch.mit.edu/discuss/topic/63938/?page=1#post-544466~~ *complete*
- ~~Notification bootcamp https://scratch.mit.edu/discuss/topic/65472/~~ *complete*
- ~~CookieVars extension https://scratch.mit.edu/discuss/topic/65698/~~ *complete*
- ~~https://scratch.mit.edu/discuss/topic/63938/?page=1#post-544466~~ *complete*
- Add a chat for collabs https://github.com/MegaScratchUserscript/Mega-Scratch-Userscript/issues/21
- Add more ideas here if you have them...
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
![logo](http://bluemod.webatu.com/img/MegaScratchUserscript65.png) Mega-Scratch-Userscript
![logo](https://cdn.rawgit.com/MegaScratchUserscript/Mega-Scratch-Userscript/master/resources/icon.png) Mega-Scratch-Userscript
=======================

A mega userscript containing a lot of useful features (eventually, hopefully...)
See http://scratch.mit.edu/discuss/topic/57450/
See https://scratch.mit.edu/discuss/topic/57450/

A collab with:

Expand All @@ -14,7 +14,7 @@ A collab with:
- [GRA0007](https://github.com/GRA0007)
- [-PRO-](https://github.com/Krett12)
- [davidkt](https://github.com/davidkt)
- [NickyNouse](http://scratch.mit.edu/users/NickyNouse/)
- [NickyNouse](https://scratch.mit.edu/users/NickyNouse/)
- [GrannyCookies](https://github.com/GrannyCookies)
- [SzAmmi](https://github.com/SzAmmi)
- [andrewjcole](https://github.com/andrewjcole)
Expand Down
4 changes: 1 addition & 3 deletions msu-base.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// @name Mega Scratch Userscript
// @author MegaScratchUserscript (collab with some Scratch ATers: https://github.com/MegaScratchUserscript/Mega-Scratch-Userscript#-mega-scratch-userscript)
// @description A mega userscript with tons of epic uses!
// @include http://scratch.mit.edu/*
// @include https://scratch.mit.edu/*
// @include http://wiki.scratch.mit.edu/*
// @include https://wiki.scratch.mit.edu/*
// @version 1.2.0
// @website https://megascratchuserscript.github.io
Expand Down Expand Up @@ -124,7 +122,7 @@ var ScratchUserscript = {
* @param settings HTML for the part's settings page, if any
*/
registerPart: function(name, description, settings){
// almost verbatim copied from my test JSFiddle: http://jsfiddle.net/a8cewv3u/
// almost verbatim copied from my test JSFiddle: https://jsfiddle.net/a8cewv3u/
// very messy, should be cleaned up

var qualifiedName = name.replace(/[^a-zA-Z\d]/g, "").toLowerCase();
Expand Down
6 changes: 3 additions & 3 deletions parts/profileenhancer.part.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,16 @@ msuParts["profileEnhancer"] = function (ScratchUserscript) {
$('.stage div').css('height', '211px');
$(this).css('margin-top', '-14px');
$(this).attr('height', '239');
$(this).attr('src', 'http://phosphorus.github.io/app.html?id=' + projID);
$(this).attr('src', 'https://phosphorus.github.io/app.html?id=' + projID);
}
else if($(this).attr('src').indexOf('http://scratch.mit.edu/projects/embed/') > -1) {
else if($(this).attr('src').indexOf('https://scratch.mit.edu/projects/embed/') > -1) {
setInterval(function(){
$('.stage iframe').attr('height', '239');
$('.stage iframe').attr('height', '238');
}, 500);
}
});
$('.stage iframe').attr("src", "http://scratch.mit.edu/projects/embed/" + projID + "/?autostart=true");
$('.stage iframe').attr("src", "https://scratch.mit.edu/projects/embed/" + projID + "/?autostart=true");
}
}
};
11 changes: 8 additions & 3 deletions parts/projectStuff.part.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ msuParts["projectStuff"] = function (ScratchUserscript) {

var settings = {
phosphorus: true,
autophosphorus: true,
sb2: true,
diff: true
};
var labels = {
phosphorus: "Enable phosphorus button",
autophosphorus: "Automatically switch to phosphorus",
sb2: "Enable scratchblocks2 generator button",
diff: "Enable scratchblocks2 diff button"
};
Expand Down Expand Up @@ -55,7 +57,7 @@ msuParts["projectStuff"] = function (ScratchUserscript) {
var iframe = document.createElement('iframe');
iframe.setAttribute('allowfullscreen', true);
iframe.setAttribute('allowtransparency', true);
iframe.src = 'http://phosphorus.github.io/embed.html?id=' + Scratch.INIT_DATA.PROJECT.model.id + '&auto-start=true&light-content=false';
iframe.src = 'https://phosphorus.github.io/embed.html?id=' + Scratch.INIT_DATA.PROJECT.model.id + '&auto-start=true&light-content=false';
iframe.width = 482;
iframe.height = 393;
iframe.style.border = '0';
Expand All @@ -72,14 +74,17 @@ msuParts["projectStuff"] = function (ScratchUserscript) {
$("#msu-ps-phosphorus-tool").htmk("<span class='arrow'></span>Switch to phosphorus");
}
});
if(settings.autophosphorus){
$("#msu-ps-phosphorus").click();
}
}
if(settings.sb2){
var btn = $('<div id="msu-ps-sb2" class="action tooltip bottom isflash">'+
'<span class="hovertext"><span class="arrow"></span>Generate scratchblocks2 code</span>'+
'<span>Generate code</span></div>');
$(".active").append(btn);
$("#msu-ps-sb2").click(function(){
window.open('http://scratchblocks.github.io/generator/#project='+Scratch.INIT_DATA.PROJECT.model.id, "_blank");
window.open('https://scratchblocks.github.io/generator/#project='+Scratch.INIT_DATA.PROJECT.model.id, "_blank");
});
}
if(settings.diff){
Expand All @@ -90,7 +95,7 @@ msuParts["projectStuff"] = function (ScratchUserscript) {
$("#msu-ps-diff").click(function(){
var diff2 = prompt("Other project ID?");
if(diff2 == null || diff2 == "") return;
window.open('http://scratchblocks.github.io/diff/#'+Scratch.INIT_DATA.PROJECT.model.id+"+"+diff2, "_blank");
window.open('https://scratchblocks.github.io/diff/#'+Scratch.INIT_DATA.PROJECT.model.id+"+"+diff2, "_blank");
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion parts/scratchtheme.part.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msuParts["themeEffects"] = function(ScratchUserscript){

var isEnabled = ScratchUserscript.isPartEnabled("themeEffects");

var settings = {scrollEffect: false, background: false, bgUrl:"http://i.imgur.com/ra8F49A.jpg"};
var settings = {scrollEffect: false, background: false, bgUrl:"https://i.imgur.com/ra8F49A.jpg"};
settings = ScratchUserscript.readSetting("themeEffects", "settings", settings);

updateChanges = function(){
Expand Down
10 changes: 5 additions & 5 deletions parts/scratchystuff.part.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ msuParts["scratchyStuff"] = function(ScratchUserscript){
var assetURL = prompt('What URL?');
if (!assetURL) return;
var fileName = assetURL.slice(assetURL.lastIndexOf('/') + 1);
assetURL = 'http://www.corsproxy.com/' + assetURL.replace(/^https?:\/\//, '');
assetURL = 'https://www.crossorigin.me/' + assetURL;
var xhr = new XMLHttpRequest();
xhr.onload = function() {
var scratchData = ',' + btoa(String.fromCharCode.apply(null, new Uint8Array(this.response)));
Expand All @@ -116,7 +116,7 @@ msuParts["scratchyStuff"] = function(ScratchUserscript){
// Download Button
if(settings.download){
$('#see-inside').parent().before($(
'<div class="button" style="width:100px;line-height:0px;"><img src="http://i.imgur.com/INmHsg1.png"><span style="left:90px;top:11px;position:absolute;">Download</span></div>'
'<div class="button" style="width:100px;line-height:0px;"><img src="https://i.imgur.com/INmHsg1.png"><span style="left:90px;top:11px;position:absolute;">Download</span></div>'
).click(unsafeWindow.JSdownloadProject));
$('#see-inside').parent().css('display', 'inline-block');
}
Expand All @@ -126,11 +126,11 @@ msuParts["scratchyStuff"] = function(ScratchUserscript){
if(settings.scratchblocks){
/****** PHOSPHORUS & SCRATCHBLOCKS ******/
var phosp = $('<a/>');
phosp.attr('href', 'http://phosphorus.github.io/#' + currenthref);
phosp.attr('href', 'https://phosphorus.github.io/#' + currenthref);
phosp.append('<div class="button" style="padding: 0 10px;">Phosphorus</div>');

var sblocks = $('<a/>');
sblocks.attr('href', 'http://blob8108.github.io/scratchblocks2/generator/#project=' + currenthref);
sblocks.attr('href', 'https://blob8108.github.io/scratchblocks2/generator/#project=' + currenthref);
sblocks.append('<div class="button" style="padding: 0 10px;">Scratchblocks</div>');

var pbuttons = $('<div/>');
Expand All @@ -146,7 +146,7 @@ msuParts["scratchyStuff"] = function(ScratchUserscript){
$('#remix-history li').each(function (index, value) {
var link2 = $(value).find('a').attr('href').slice(10, -1);
var difflink = $('<a/>');
difflink.attr('href', 'http://blob8108.github.io/scratchblocks2/diff/#' + currenthref + '+' + link2);
difflink.attr('href', 'https://blob8108.github.io/scratchblocks2/diff/#' + currenthref + '+' + link2);
difflink.append('(diff)');
$('#remix-history li').eq(index).find('.attribute').append(' ').append(difflink);
});
Expand Down
4 changes: 2 additions & 2 deletions parts/wikilink.part.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ msuParts["wikilink"] = function(ScratchUserscript){

if(isEnabled) {
settings = ScratchUserscript.readSetting("wikilink", "settings", settings); //Update settings
$(".site-nav li a[href='http://wiki.scratch.mit.edu/']").html(settings.name); //Auto-update button
$(".site-nav li a[href='https://wiki.scratch.mit.edu/']").html(settings.name); //Auto-update button
}
};

Expand All @@ -28,5 +28,5 @@ msuParts["wikilink"] = function(ScratchUserscript){
if(!isEnabled) return;

// begin actual script
$('.site-nav li:nth-of-type(3)').after("<li><a href='http://wiki.scratch.mit.edu/'>" + settings.name + "</a></li>");
$('.site-nav li:nth-of-type(3)').after("<li><a href='https://wiki.scratch.mit.edu/'>" + settings.name + "</a></li>");
};
48 changes: 24 additions & 24 deletions resources/extensions.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2c1ae1f

Please sign in to comment.