Skip to content

Commit

Permalink
Add some documentations
Browse files Browse the repository at this point in the history
  • Loading branch information
fjwntut committed Jun 3, 2021
1 parent 5b4981c commit 75c9a16
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 7 deletions.
Binary file added admit20210604.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added button20210604.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions language_support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Multi language support

## Why Auto Admit is limited to several languages:
1. Auto Admit find a button with a keyword such as 'admit' and '接受' then click on it.
![](admit20210604.jpg)
2. Auto Admit also find the button with 'Present now' or '立即分享螢幕畫面' label and add a admit button to it.
![](button20210604.jpg)
3. Auto Admit will detect your **browser language** and decide which set of keywords should be used. The keywords need to be added using JSON files in the `_locales` folder.
4. Hence, if your browser language is not supported, Auto Admit will try to look for the 'admit' button. If no button is found, things will not works!

## Edit the bookmarklet for your own use:
This is the content of the bookmarklet:
```javascript
javascript:
var admit = 'ADMIT_KEYWORD';
button_added = document.getElementById('auto-admit-div');
var toggle;
if(button_added == null){
Initialize();
}else{
Toggle();
}
function Initialize(){
var newdiv = document.createElement('div');
newdiv.id = 'auto-admit-div';
newdiv.style.display = 'none';
button_added = document.body.appendChild(newdiv);
Toggle();
setInterval(Update, 500);
}
function Update() {
if(toggle){
for (let element of document.getElementsByTagName('span')) {
if (element.innerHTML === admit){
element.click();
}
}
}
}
function Toggle(){
button_added.classList.toggle('on');
toggle = button_added.classList.contains('on');
alert('Auto admit turned '+(toggle?'on':'off'));
}
```
Simply replace the `ADMIT_KEYWORD` with the display text in your language☺.

## Help me to support other languages!
Everyone is welcome to translate Auto Admit to other languages. If you want to do so, simply add issues, or make pull requests if you know how to edit the locales file.
16 changes: 9 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
## Auto admit for Google meet

### Chrome Extension:
![](screenshot.png)
- ONLY support chinese traditional and english! Please add issues to let me know if you need any other language supported.
- Make sure that your browser and google meet ui is both set to ZH-TW/EN otherwise the extension will not work.
![](screenshot20210604.jpg)
- ONLY support Chinese traditional and English! If you need any other languages supported, please read [HERE](language_support.md).
- Make sure that your browser and google meet UI are both set to ZH-TW/EN, otherwise, the extension will not work.
- <a href="https://github.com/fjwntut/auto-admit-extension/raw/main/AutoAdmit.zip" Download>Download Auto Admit</a>
- Installation:
1. Extract the zip
2. Go to [chrome://extensions/](chrome://extensions/)
3. open developer mode
4. load unpack.
- When a meeting is started, the extension generates a button in the bottom bar. You could use the button to toggle auto admit on/off.
- This extension only work when the google meet tab is opened.
- When you started a meeting, the extension generates a button in the bottom bar. You could use the button to toggle auto admit on/off.
- You can also click on the extension icon to toggle it on/off.
- This extension only works when you keep the Google Meet tab opened.

### Bookmarklet:
- English: <a href="javascript:button_added = document.getElementById('auto-admit-div');var toggle;if(button_added == null){ Initialize();}else{ Toggle();}function Initialize(){ var newdiv = document.createElement('div'); newdiv.id = 'auto-admit-div'; newdiv.style.display = 'none'; button_added = document.body.appendChild(newdiv); Toggle(); setInterval(Update, 500);}function Update() { if(toggle){ for (let element of document.getElementsByTagName('span')) { if (element.innerHTML === 'Admit') { console.log('There is someone waiting to join this meeting, automatically admitting them...'); element.click(); } } }}function Toggle(){ button_added.classList.toggle('on'); toggle = button_added.classList.contains('on'); alert('Auto admit turned '+(toggle?'on':'off'))}">Auto Admit</a>
- Chinese: <a href="javascript:button_added = document.getElementById('auto-admit-div');var toggle;if(button_added == null){ Initialize();}else{ Toggle();}function Initialize(){ var newdiv = document.createElement('div'); newdiv.id = 'auto-admit-div'; newdiv.style.display = 'none'; button_added = document.body.appendChild(newdiv); Toggle(); setInterval(Update, 500);}function Update() { if(toggle){ for (let element of document.getElementsByTagName('span')) { if (element.innerHTML === '接受') { console.log('There is someone waiting to join this meeting, automatically admitting them...'); element.click(); } } }}function Toggle(){ button_added.classList.toggle('on'); toggle = button_added.classList.contains('on'); alert('Auto admit turned '+(toggle?'on':'off'))}">Auto Admit</a>
- English: <a href="javascript:var admit = 'admit';button_added = document.getElementById('auto-admit-div');var toggle;if(button_added == null){ Initialize();}else{ Toggle();}function Initialize(){ var newdiv = document.createElement('div'); newdiv.id = 'auto-admit-div'; newdiv.style.display = 'none'; button_added = document.body.appendChild(newdiv); Toggle(); setInterval(Update, 500);}function Update() { if(toggle){ for (let element of document.getElementsByTagName('span')) { if (element.innerHTML === admit) { console.log('There is someone waiting to join this meeting, automatically admitting them...'); element.click(); } } }}function Toggle(){ button_added.classList.toggle('on'); toggle = button_added.classList.contains('on'); alert('Auto admit turned '+(toggle?'on':'off'))}">Auto Admit</a>
- Chinese: <a href="javascript:var admit = '接受';button_added = document.getElementById('auto-admit-div');var toggle;if(button_added == null){ Initialize();}else{ Toggle();}function Initialize(){ var newdiv = document.createElement('div'); newdiv.id = 'auto-admit-div'; newdiv.style.display = 'none'; button_added = document.body.appendChild(newdiv); Toggle(); setInterval(Update, 500);}function Update() { if(toggle){ for (let element of document.getElementsByTagName('span')) { if (element.innerHTML === admit) { console.log('There is someone waiting to join this meeting, automatically admitting them...'); element.click(); } } }}function Toggle(){ button_added.classList.toggle('on'); toggle = button_added.classList.contains('on'); alert('Auto admit turned '+(toggle?'on':'off'))}">Auto Admit</a>
- If you need any other languages supported, please read [HERE](language_support.md).
- Installation: Drag the link above to your bookmark bar to use.
- To toggle Auto Admit on / off simply click the bookmark.
- The script only work when the google meet tab is opened.
Expand Down
Binary file added screenshot20210604.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 75c9a16

Please sign in to comment.