-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Want to help #174
Comments
The main idea is that each page has 1 script that contains the features targeting that page. Additionally, there is one script that runs on every page (name "global"). These scripts are loaded by the "manager.js" located at "/source/core/". The manager script runs with "extensions rights", while the scripts it imports run with "web-page rights" (injected inside the page). At the bottom of each page script you will find a loader snippet that waits for the page to load. At the top of the code you will find the script's object. For example the overview script, defines the gca_overview object. As soon as the DOM is ready, the inject function of the script's object is fired (e.g. gca_overview.inject() ). Some scripts also feature a preinject function that runs as soon as possible, usually to apply CSS on the HTML tag, in order to avoid bad visual experience. Some scripts are special and are injected on the page before any other script. For example the gca_tools script, that holds functions need by many pages. Also, gca_data that is the local storage manager and of course the gca_info script that does the page url analysis, like gca_section.mod and gca_section.submod and also gca_getPage.link(parameters). Adding a feature: gca_overview.makeTitleRed = function () { This function should then be called from gca_overview.inject. After debugging we enable an option to turn it on and off. We define the default value inside the gca_data.js script, at the gca_options.data.overview.red_title = false (default turned off) Now we can add it to the call code we added on inject with a (gca_options.bool('overview', 'red_tile' && this.makeTitleRed()); Then we will have to place the options at the settings page, inside the settings.js (search for overview), the format there is like the gca_data.js but supports functions as values. It is automatic for known types like booleans. Lastly, you need to add at least the English translation of the item you just added on the settings page. To do so, you can go to the settings page (on browser) at the overview category, there will be an "undefined translation" id instead of a text, copy it and add it at the /source/core/locale/en.js (you will understand where it goes... all the settings related translations are together). |
You can request an pull request, I'll have a look at it. Also there is this #175, talk about open sourcing, you can read I know, but to sum it up, they are willing to share the code only if someone will actually contribute to it. The goal here is to create a little FAQ for developers, and you don't have to look for it everywhere in different Issues.
|
From now on, refer to: Closing. |
Hi! I've just found this repo and it looks amazing! I would like to help you somehow. I'm a frontend developer (mostly React) as well as backend developer + some devops things. I've looked at the code and it's quite complex and your developer docs are in progress. Is there any way that you could introduce me how this works? Thanks!
The text was updated successfully, but these errors were encountered: