Open GaurangTandon opened 8 years ago
And I will upload the files as well - files.zip
@GaurangTandon I'll do this in just a few minutes. I've made it as simple as I know how, the file structure for Chrome is:
- manifest.json
- site-updater.js
- site-updater.css
- forum-updater.js
- forum-updater.css
Then for Firefox, it's:
- package.json
- index.js
- data
- site-updater.js
- site-updater.css
- forum-updater.js
- forum-updater.css
And to update it, you change the version in package.json
and you might have to change stuff in index.js
, but unlikely. And after that, the only difference between Chrome and Firefox is in the *.js
files, Chrome is:
function siteUpdater() { // or forumUpdater()
// do stuff
}
var script = document.createElement("script");
script.textContent = "$(document).ready(" + siteUpdater.toString() + ")";
document.documentElement.appendChild(script);
but in Firefox, it's just the // do stuff
part, because Firefox automatically runs the code without us injecting it into the page (although I'm surprised Chrome needs us to manually put the code into the page).
@GaurangTandon Do you mind if I change a few things in your code? I think that
img.width = "whatever"
cluttering up the JSI don't mind changing those myself, but since it's your code I want to make sure you're OK with it :)
@zystvan
And by the way, I never had to inject js files in webpages, Chrome offers content scripts which run automatically in the context of each webpage. I think the only need when you have to inject your script is when you are using a background page. I think you are in the latter case, because if you'll see the the js file I sent you, I am using a content script, and I don't need to inject it. You too might want to use content scripts :)
Btw, @A-J-C had experimented with the new courses and he got this bit URL += href[2] + "/lessons/"+href[3]+"/resume";
which seems to be working for new courses as well :) However, I tried it and it doesn't seem to be working for Pro content posts (for normal posts it worked fine). Perhaps, you could check it out since you are a Pro subscriber :) In case it works, then we will have to update the necessary statements in the js file and push new update :tada:
@GaurangTandon If we give the external link icon thing a unique id
, I'm pretty sure that won't be too much of a problem :)
Yeah, that sounds more like what should happen. Is it because you're wrapping it in a (function() {})(window)
thing? Because if we can make the code for the Firefox and Chrome versions identical, that'd be great.
I'll play with that & see if you can get it working, thanks for letting me know.
Using gitHub is a bit hard for me to manage the code properly. As it's always not on the right version and a pain to update files. So if neither of you mind I'm going to make a Shared folder on Dropbox and share it with both of you so we can all upload/download to the same place :) then once we have a new version I'll just take everything off Dropbox zip it and upload. Should make everything easier for us all.
Do you both have email addresses you use for Dropbox that I could add? :) On 24 Dec 2015 14:21, "Zeke Y" notifications@github.com wrote:
@GaurangTandon https://github.com/GaurangTandon If we give the external link icon thing a unique id, I'm pretty sure that won't be too much of a problem :)
Yeah, that sounds more like what should happen. Is it because you're wrapping it in a (function() {})(window) thing? Because if we can make the code for the Firefox and Chrome versions identical, that'd be great.
I'll play with that & see if you can get it working, thanks for letting me know.
— Reply to this email directly or view it on GitHub https://github.com/zystvan/codecademy-redesigned-firefox/issues/3#issuecomment-167117826 .
@A-J-C Git is supposed to make managing code easier! But my email address is zeke@zystvan.com :)
I know it is! But it just doesnt for me right now :') Maybe once I've learnt how to use it properly, but for not dropbox would be great :).
On Thu, Dec 24, 2015 at 2:28 PM, Zeke Y notifications@github.com wrote:
@A-J-C https://github.com/A-J-C Git is supposed to make managing code easier! But my email address is zeke@zystvan.com :)
— Reply to this email directly or view it on GitHub https://github.com/zystvan/codecademy-redesigned-firefox/issues/3#issuecomment-167118362 .
I think before moving on with any major new code we should clean up everything we currently have. I had a few ideas. Feel free to comment on them or suggest different things :+1:
1) We have 3 different "run ats" this could maybe be reduced to 2 by combining the 2 discuss ones, not sure what affect it would have though. 2) Do we need permission for "tabs"? 3) JQuery @GaurangTandon mentioned this. Is it worth converting everything so it doesn't use jQuery? 4) A lot of my scripts inject css files and script files, as this is the way Joah told me to do everything. We could update it to run in a content script so nothing is injected. 5) Use one css styling sheet rather than 2. And move all styling from in-line to the styling sheet. I really want this one because inline styling gets a bit messy. And if we specify things right and use our own id's and classes then it should work fine. 6) We have 5 different js files. These could probably be reduced to one for codecadmey and one for discuss. We just need to make sure everything is in them and will run at the right time. We can also move the injected scripts into these sheets to make everything a bit nicer. 7) We need to work on "branding". If you guys look on line you can include everything in an extensions gooogle page from Banners & logos to videos and descriptions. We need to work on the descriptions and also make better looking screenshots and banners to properly show off what it does. 8) I was also thinking of adding a 'paypal donation' button in somewhere so that if anyone particularly wanted to they could give some money :) Just an idea not sure how it would work yet.
Write a comment on your thoughts about the points :) And maybe come up with some more!
@A-J-C
@zystvan 2. I'm saying we currently have permissions for tabs. Not sure why, I didnt add it.
@A-J-C Weird. Probably should be removed, but I'll check the code & see if there was a reason for it.
I have written the JS code for Chrome. Could you, if I share the files with you, translate it so that Firefox understands it well, because I have never made a Firefox extension so I don't know much about it (and am a little scared as well) :P