reckue / reckue-langs Goto Github PK
View Code? Open in Web Editor NEWIt's your vocabulary-book built-in any pages you visit.
It's your vocabulary-book built-in any pages you visit.
Now application can actualy work with english, but have problems in other languages.
As example - Chinese:
Plugin isnt work correctly with single page applications. Any content that produced after loading page at first - isnt parsing by extention. Need to find way to fix.
If you change level of some word, other same words on page still at previous level. Need to change them all at once.
After parsing page need to add all words in map. Where all same words will take one cell. So that you can take them and change everything at once.
Now when you click on word you add it into wordbook. Need to impruve logic and add popup menu before adding where user can change word before adding.
When click on word in popup menu user should be redirected to google translate page with selected word in textarea.
Loading worbooks from storage is the most complex part of application, becouse of async operations.
Wordbook just fails to load before we start to use it. In that case app continue to work without most part of content from storage.
At the moment, the only working solution of async problem i found was to create Timeout before use getWordbook method.
const wordbook = new Wordbook();
wordbook.loadWordbooks();
// We use getWorbooks method only after timeout.
setTimeout(() => { /* here we can use wordbook.getWordbooks()! */ }, 100);
Needs to find another way wait until ending acync opperation.
Or create method for calculate timer depending on the length of storage.
100 ms === ~120 wordbook parts. Now i used only 56, but its will shoot in a leg soon.
After change level and close menu - level in menu is still old value.
Reload page - level in menu change.
But if you open menu before reload page and change it - level will be set at old value and changing after it.
So for changing level now you need to reload page or every time start changing the level from the same place where it was at first time. It doesn't bother me much, but it's still uncomfortable.
See examples:
https://github.com/checkly/headless-recorder
Now its works alternately and heavily loads the page.
Need to create some virtual DOM for rerender and start processing only after certain condition.
Remove numbers from wordbook!
Remove blue links!
Develop architecture for chain of responsobilities.
start.js must be like this:
const wordbook = new Wordbook();
const application = new Application();
application.start();
Now it looks like:
const wordbook = new Wordbook();
wordbook.set({word: "vocabulary", level: Levels.ADVANCED.name});
wordbook.loadWordbooks().then();
setTimeout(() => {
chrome.storage.local.get(['enable'], function(app) {
window.console.log(`Reckue language app: Reach join point with app.enable=${app.enable}`);
if (app.enable) {
window.console.log(`Reckue language app: isServerSideParsingEnable=${IS_SERVER_SIDE_PARSING_ENABLE}`);
if (IS_SERVER_SIDE_PARSING_ENABLE) {
const htmlAfterParsing = prepareAndSendRequestToServerSideParser("userId", "collectionId");
updateDom(htmlAfterParsing);
} else {
const parser = new Parser();
const textNodesList = parser.parsePage();
const parsedTextNodesList = parser.textParsing(textNodesList);
// Возможность выгрузить текущий wordbook в файл.
// saveFile(mapToString(wordbook));
const builder = new DOMBuilder({sl: "en", tl: "ru"});
builder.rebuildPage(parsedTextNodesList);
}
}
});
}, 100);
After implementation, come back and finalize the ticket!
When you add word in wordbook sometimes it's wrong or you can use original version without suffix and postfix. The application can detect them (should at least). Need to add an option to edit it. The manipulation must be exactly the same as delete and create new word (two for one).
Clear words should be without numbers. It wasnt in high priority, but recently i found out that sometimes style markers merge with words and broke parser. Firstly need to fix markers, but also need to remove numers in clear words.
Already done for "-".
Do the same with .,/'" and other symbols.
When you open page and forget about it on some time (day or less maybie), updating levels algorithm could stop working.
Need to find out why its going on and fix.
After every rework of the parsing mechanism, something breaks. Need to add unit tests foreach part of parser.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.