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

Commit 3b10e00

Browse files
committed
Merge pull request #23 from Felizolinha/master
URLs Clean Up
2 parents 11fa88d + 75d09cc commit 3b10e00

File tree

2 files changed

+41
-24
lines changed

2 files changed

+41
-24
lines changed

originals/GRA0007/scratchultimate.user.js

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
// @version 0.2.1
44
// @description Useful Stuff
55
// @author GRA0007
6+
// @contributor TheGameBuilder
67
// @match http://scratch.mit.edu/*
78
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
89
// @grant none
910
// ==/UserScript==
10-
1111
if(document.URL.indexOf("mystuff/") >= 0){
1212
waitForKeyElements ("#tabs", appendSidebarItems);
1313
}
1414

15-
if(document.URL.indexOf("users/") >= 0){
15+
if(document.URL.indexOf("users/") >= 0){
1616
waitForKeyElements ("#featured-project", liveFeaturedProject);
1717
}
1818

@@ -21,8 +21,26 @@ function appendSidebarItems(jNode) {
2121
}
2222

2323
function liveFeaturedProject(jNode) {
24+
var $projName = $('.project-name'),
25+
projID = Scratch.INIT_DATA.PROFILE.featuredProject.id;
26+
$('.player .title').css('text-align', 'center');
27+
$projName.html($projName.html().trim()); //Make sure no whitespaces interefere with centering
28+
2429
jNode.remove();
25-
var projID = Scratch.INIT_DATA.PROFILE.featuredProject.id
26-
var usid = Scratch.INIT_DATA.PROFILE.featuredProject.creator
27-
$( ".stage" ).append( "<iframe allowtransparency='true' width='282' height='210' src='http://scratch.mit.edu/projects/embed/" + projID + "/?autostart=true' frameborder='0' allowfullscreen=''></iframe>" );
30+
31+
$( ".stage" ).append( "<div style='overflow: hidden; height: 216px;' id='applet'><iframe style='margin-top: -25px;' allowtransparency='true' width='282' height='237' frameborder='0' allowfullscreen=''></iframe></div>" );
32+
33+
$('.stage iframe').load(function(){
34+
var is404 = $(this).contents().find('#page-404').length > 0;
35+
if(is404) {
36+
$('.stage div').css('height', '211px');
37+
$(this).css('margin-top', '-14px');
38+
$(this).attr('height', '239');
39+
$(this).attr('src', 'http://phosphorus.github.io/app.html?id=' + projID);
40+
}
41+
else if($(this).attr('src').indexOf('http://scratch.mit.edu/projects/embed/') > -1) {
42+
setTimeout(function(){$('.stage iframe').attr('height', '238');}, 200);
43+
}
44+
});
45+
$('.stage iframe').attr("src", "http://scratch.mit.edu/projects/embed/" + projID + "/?autostart=true");
2846
}

originals/djdolphin/scratchystuff.user.js

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,30 @@ window.location.search.replace(/([^?=&]+)(=([^&]*))?/g, function($0, $1, $2, $3)
1212
var username = Scratch.INIT_DATA.LOGGED_IN_USER.model ? Scratch.INIT_DATA.LOGGED_IN_USER.model.username : null;
1313

1414
var extPresets = {
15-
'Mesh': {url: 'https://raw.githubusercontent.com/bobbybee/mesh-2.0/master/ext.js', author: 'bobbybee'},
15+
'Mesh': {url: 'https://cdn.rawgit.com/bobbybee/mesh-2.0/master/ext.js', author: 'bobbybee'},
1616
'Scratch Cloud': {url: 'https://dl.dropboxusercontent.com/u/6274273/web/scratchcloud/icon.js', author: 'MathWizz'},
17-
'Image Stuff': {url: 'http://scratch.cf/extensions/imagestuff.js', author: 'djdolphin'},
17+
//'Image Stuff': {url: 'http://scratch.cf/extensions/imagestuff.js', author: 'djdolphin'},
1818
'Cool helpful things extension': {url: 'http://textuploader.com/07bg/raw', author: 'PullJosh'},
1919
'More Math': {url: 'http://savakamyimages00000.weebly.com/uploads/6/4/5/3/6453739/more_math.js', author: 'savaka'},
20-
'Debugging': {url: 'http://savakamyimages00000.weebly.com/uploads/6/4/5/3/6453739/javascript_dialogs.js', author: 'savaka'},
2120
'Javascript Dialogs': {url: 'http://savakamyimages00000.weebly.com/uploads/6/4/5/3/6453739/javascript_dialogs.js', author: 'savaka'},
2221
'Link Opener': {url: 'http://savakamyimages00000.weebly.com/uploads/6/4/5/3/6453739/link_opener.js', author: 'savaka'},
23-
'littleBits': {url: 'https://raw.githubusercontent.com/khanning/scratch-littlebits-extension/master/littlebits_extension.js', author: 'khanning'},
24-
'Data Blocks': {url: 'https://raw.githubusercontent.com/Thepuzzlegame/My-Scratch-Extensions/master/data_extension.js', author: 'Thepuzzlegame'},
25-
'Infinity Reporter': {url: 'https://raw.githubusercontent.com/Thepuzzlegame/My-Scratch-Extensions/master/infinity_reporter.js', author: 'Thepuzzlegame'},
26-
'Extension Loader': {url: 'https://raw.githubusercontent.com/Thepuzzlegame/My-Scratch-Extensions/master/extension_loader.js', author: 'Thepuzzlegame'},
27-
'Alarm extension': {url: 'https://raw.githubusercontent.com/LLK/scratch-extension-docs/master/alarm_extension.js', author: 'sdg1'},
28-
'Browser Stuff': {url: 'https://raw.githubusercontent.com/LLK/scratch-extension-docs/master/browser_extension.js', author: 'grokblah'},
29-
'Joystick': {url: 'https://raw.githubusercontent.com/LLK/scratch-extension-docs/master/joystickExtension.js', author: 'sdg1'},
30-
'Local Storage': {url: 'https://raw.githubusercontent.com/LLK/scratch-extension-docs/master/localstorage_extension.js', author: 'sdg1'},
31-
'PicoBoard': {url: 'https://raw.githubusercontent.com/LLK/scratch-extension-docs/master/picoExtension.js', author: 'grokblah'},
22+
'littleBits': {url: 'https://cdn.rawgit.com/khanning/scratch-littlebits-extension/master/littlebits_extension.js', author: 'khanning'},
23+
//'Data Blocks': {url: 'https://raw.githubusercontent.com/Thepuzzlegame/My-Scratch-Extensions/master/data_extension.js', author: 'Thepuzzlegame'},
24+
//'Infinity Reporter': {url: 'https://raw.githubusercontent.com/Thepuzzlegame/My-Scratch-Extensions/master/infinity_reporter.js', author: 'Thepuzzlegame'},
25+
//'Extension Loader': {url: 'https://raw.githubusercontent.com/Thepuzzlegame/My-Scratch-Extensions/master/extension_loader.js', author: 'Thepuzzlegame'},
26+
'Alarm extension': {url: 'https://cdn.rawgit.com/LLK/scratch-extension-docs/master/alarm_extension.js', author: 'sdg1'},
27+
'Browser Stuff': {url: 'https://cdn.rawgit.com/LLK/scratch-extension-docs/master/browser_extension.js', author: 'grokblah'},
28+
'Joystick': {url: 'https://cdn.rawgit.com/LLK/scratch-extension-docs/master/joystickExtension.js', author: 'sdg1'},
29+
'Local Storage': {url: 'https://cdn.rawgit.com/LLK/scratch-extension-docs/master/localstorage_extension.js', author: 'sdg1'},
30+
'PicoBoard': {url: 'https://cdn.rawgit.com/LLK/scratch-extension-docs/master/picoExtension.js', author: 'grokblah'},
3231
'PicoBoard Fixed': {url: 'http://www.picaxe.com/downloads/scratch/scraxepicoextension.js', 'author': 'SCRAXE'},
33-
'Power Extension': {url: 'https://raw.githubusercontent.com/LLK/scratch-extension-docs/master/power_extension.js', author: 'sdg1'},
34-
'Random wait extension': {url: 'https://raw.githubusercontent.com/LLK/scratch-extension-docs/master/random_wait_extension.js', author: 'sdg1'},
35-
'Speech to Text': {url: 'https://raw.githubusercontent.com/LLK/scratch-extension-docs/master/speech_to_text_extension.js', author: 'sdg1'},
36-
'Text to Speech': {url: 'https://raw.githubusercontent.com/LLK/scratch-extension-docs/master/text_to_speech_extension.js', author: 'sdg1'},
37-
'Text to Speech Simple': {url: 'https://raw.githubusercontent.com/LLK/scratch-extension-docs/master/text_to_speech_simple_extension.js', author: 'sdg1'},
38-
'Weather Extension': {url: 'https://raw.githubusercontent.com/LLK/scratch-extension-docs/master/weather_extension.js', author: 'sdg1'},
39-
'ScratchExt': {url: 'http://stefanbates.com/library/import.js', author: 'GrannyCookies, Yoda3D, Thistleeverfreen'}
32+
'Power Extension': {url: 'https://cdn.rawgit.com/LLK/scratch-extension-docs/master/power_extension.js', author: 'sdg1'},
33+
'Random wait extension': {url: 'https://cdn.rawgit.com/LLK/scratch-extension-docs/master/random_wait_extension.js', author: 'sdg1'},
34+
'Speech to Text': {url: 'https://cdn.rawgit.com/LLK/scratch-extension-docs/master/speech_to_text_extension.js', author: 'sdg1'},
35+
'Text to Speech': {url: 'https://cdn.rawgit.com/LLK/scratch-extension-docs/master/text_to_speech_extension.js', author: 'sdg1'},
36+
'Text to Speech Simple': {url: 'https://cdn.rawgit.com/LLK/scratch-extension-docs/master/text_to_speech_simple_extension.js', author: 'sdg1'},
37+
'Weather Extension': {url: 'https://cdn.rawgit.com/LLK/scratch-extension-docs/master/weather_extension.js', author: 'sdg1'},
38+
'ScratchExt': {url: 'http://stefanbates.com/library/install.js', author: 'GrannyCookies, Yoda3D, Thistleeverfreen'}
4039
};
4140
//Thanks, Thepuzzlegame!
4241

0 commit comments

Comments
 (0)