1
0
mirror of https://github.com/MatMoul/quickdial-webext.git synced 2025-04-04 20:41:44 +00:00

Compare commits

...

116 Commits

Author SHA1 Message Date
806e134b52 Version 0.1.20 2021-01-30 15:12:34 +01:00
633c5756a1 Patch Context Menu 2021-01-30 15:09:03 +01:00
MatMoul
d2ea81d2ca
Merge pull request #165 from tamiros/locale/hebrew
Locale/hebrew
2021-01-27 20:04:19 +01:00
Tamir
86f8063b11 missed one 2021-01-27 10:53:56 +02:00
Tamir
95a1ca420d added heberw translation 2021-01-27 10:46:09 +02:00
41fc29660f Version 0.1.19 2019-03-17 19:05:31 +01:00
725ad53d92
Merge pull request #122 from WaldiSt/patch-1
Translation to Polish language
2019-01-23 00:08:02 +01:00
Waldemar Stoczkowski
929431e66f
Translation to Polish language
Added translation to Polish language
2019-01-20 11:46:47 +01:00
75a6649b6c Version 0.1.18 2019-01-03 21:09:25 +01:00
941772844a Add startpage timeout settings 2019-01-03 21:06:23 +01:00
cc1006042d
Merge pull request #117 from de-es/de-es-patch-1
Remove pt from font-family
2018-12-26 00:15:15 +01:00
f992b75f45
Merge pull request #114 from Gonimy-Vetrom/patch-1
Add Ukrainian
2018-12-26 00:14:53 +01:00
de-es
3a3337b19c
Remove pt from font-family 2018-12-11 00:16:55 +01:00
Gonimy-Vetrom
ab3072cc21
Create messages.json 2018-11-13 17:21:31 +02:00
5bc78f7da6 Version 0.1.17 2018-10-21 23:27:31 +02:00
67fea9aa9c Bug Can move tile when this is the first added item 2018-10-21 22:47:59 +02:00
c68d2d4cfb Version 0.1.16 2018-10-21 16:04:55 +02:00
f07e530446 Bug Startpage not loaded 2018-10-21 16:03:50 +02:00
8abd79bc5f Version 0.1.15 2018-10-21 04:37:05 +02:00
723724f50b Bug White page on first install 2018-10-21 04:36:25 +02:00
ddd081672f Update makebeta 2018-10-21 04:11:04 +02:00
e03e684fb7 Version 0.1.14 2018-10-21 02:07:08 +02:00
14ed1f4dd6 Patch Quick Dial as start page 2018-10-21 02:01:02 +02:00
7ccd9be787
Merge pull request #69 from eridanired/patch-1
Add Spanish translation
2017-12-11 19:51:41 +01:00
Eridani
67d950bfea
Add Spanish translation 2017-12-09 11:30:43 -06:00
ff0eebed69 Version 0.1.13 2017-11-26 19:02:25 +01:00
9fdcc91ec6 Project: Remove description from manifest 2017-11-26 18:52:07 +01:00
39ab845d58 Feature: Toolbar button can now open Quick Dial on current dial 2017-11-26 16:33:47 +01:00
6815551c8c Feature: Add open in new tab for tiles 2017-11-26 15:47:22 +01:00
ce82a4c67e Version 0.1.12 2017-11-26 15:04:11 +01:00
72ab3e5f6b Bug: Convert separator to empty cell 2017-11-26 13:20:10 +01:00
beb52273a2 Bug: Can't set cutom image on folder 2017-11-26 13:04:14 +01:00
2e5bbce72f Version 0.1.11 2017-11-24 22:50:35 +01:00
ddbd2f40c8 Feature: Lock settings for image on tiles 2017-11-24 22:36:53 +01:00
63569851d8 Feature: Option to diable context menu items 2017-11-24 21:54:08 +01:00
88b6a8d45d
Merge pull request #61 from fernandosantucci/develop
Add Brazilian Portuguese translation
2017-11-22 19:16:26 +00:00
fernandosantucci
7b6e112038 Add Brazilian Portuguese translation 2017-11-22 12:21:55 -02:00
ee310a9546
Merge pull request #49 from Faenriis/develop
Add Serbian translation
2017-11-19 18:22:34 +01:00
Xabre
e400d07f01 Add Serbian translation 2017-11-19 14:19:49 +01:00
d8620464a3 Version 0.1.10 2017-11-19 01:05:43 +01:00
1a71f96a91 Feature disabled: Auto ratio dont provide a stable solution 2017-11-19 00:56:00 +01:00
45f7e60fb8 Improvement: Invert Ratio X,Y field in settings 2017-11-18 23:59:39 +01:00
190d54a0f1 Bug: Settings page save problem 2017-11-18 23:47:05 +01:00
05a78e2d63 Feature: Add custom ratio settings 2017-11-18 23:16:49 +01:00
1ba60232f2 Version 0.1.9 2017-11-18 01:42:13 +01:00
eaf451c957 Code: Remove TODO, look now at issue 2017-11-18 01:02:32 +01:00
b2bb50d95e Feature: Add snapshot delay setting 2017-11-18 00:17:36 +01:00
a9a4212299 Improvement: Tile and snapshot relative to grid size 2017-11-18 00:06:49 +01:00
7b0ac506d8 Bug: Transparent hover tile background doesn't has effect 2017-11-17 23:34:44 +01:00
93a384b765 Version 0.1.8 2017-11-12 20:26:12 +01:00
6cad651ee4 Improvement: Update default title height 2017-11-12 19:48:30 +01:00
178627aa51 Project: Update git ignore 2017-11-12 17:04:00 +01:00
0eae0a9919 Project: Update build scripts 2017-11-12 16:46:24 +01:00
66418995b8 Project: Update build scripts 2017-11-12 16:39:37 +01:00
17739110ff Bug: Updating bookmark url don't refresh tile 2017-11-12 16:13:13 +01:00
a64561835c Bug: Prevent drag drop from unmanaged data 2017-11-12 16:03:01 +01:00
0be3f1df96 Bug: Editing bookmark url don't update tile url 2017-11-12 15:01:26 +01:00
71df90fad4 Version 0.1.7 2017-11-11 15:53:28 +01:00
e300ae2142 Bug: Data not correclty upgraded 2017-11-11 15:34:34 +01:00
accb853a85 Bug: Tile instable when resizing to speed 2017-11-11 15:30:03 +01:00
2a12e35320 Data: Version upgrade 2017-11-11 15:10:58 +01:00
827680c906 Improvement: Handle Bookmark large change or restore 2017-11-11 14:19:41 +01:00
dedd421b85 Feature: Add stretch mode to each tiles 2017-11-11 02:59:25 +01:00
f3285e790d Feature: Add stretch mode for back and folder icon 2017-11-11 01:13:34 +01:00
2aebed015f Feature: Add stretch mode for back and folder icon 2017-11-11 01:11:08 +01:00
07dfa858e8 Feature: Add stretch mode for background 2017-11-11 00:44:56 +01:00
5e07132316 Improvement: Bookmarks sync 2017-11-10 23:40:13 +01:00
63c06fe5a5 Improvement: Bookmarks sync 2017-11-10 23:32:53 +01:00
dd95e95b20 Improvement: Update bookmark when setting tile parameters 2017-11-10 22:48:12 +01:00
7f719497dc Feature Disabled: Capture here has too poor quality 2017-11-10 22:26:42 +01:00
1592569ada Feature: Add support of default and hover state of all properties 2017-11-10 21:56:36 +01:00
3156068ca7 Improvement: Add limit to input number 2017-11-10 20:55:12 +01:00
1a608b634f Feature: Add opacity setting for tiles 2017-11-10 20:45:52 +01:00
356bf74e8d Feature: Add border size setting for tiles 2017-11-10 20:34:19 +01:00
0b59809758 Version 0.1.6 2017-11-03 21:21:12 +01:00
f387c3662f Feature: Add page up and page down to change page 2017-11-03 21:11:57 +01:00
dbbf5ff718 Feature: Add page up and page down to change page 2017-11-03 21:02:57 +01:00
33c227a5a4 Merge branch 'patch-1' of https://github.com/Alexey71/quickdial-webext into Alexey71-patch-1 2017-11-03 20:54:11 +01:00
351d043094 Improvement: Limit sync bookmark surcharge 2017-11-03 20:52:41 +01:00
Alexey
b99ee356f0
Add Russian string 2017-11-01 15:35:47 +03:00
340a84730e Merge pull request #22 from mrprobot/develop
add german translation
2017-10-26 21:10:41 +02:00
mrprobot
ddd57dd446 add german translation 2017-10-25 13:04:20 +02:00
mrprobot
4a510a1a86 add german translation 2017-10-25 12:55:37 +02:00
170b1a7dc6 Improvement: Add new capture method (Capture here) 2017-10-22 16:36:06 +02:00
3c79e9e38f Version 0.1.5 2017-10-21 18:13:26 +02:00
5e61b65e82 Bug: (Properties) Image is lost when clicking OK and Unlock title don't work 2017-10-21 18:03:30 +02:00
cebdb32c35 Feature: Add a setting to lock title from update 2017-10-21 17:51:35 +02:00
1e5e450565 Improvement: Add escape support on popup 2017-10-21 17:10:51 +02:00
5a2c30e00f Feature: Root folder path customization 2017-10-21 16:53:39 +02:00
938f1a0fde Improvement: Don't send setNodeIndex if new index is the same than older index 2017-10-21 16:08:38 +02:00
4019c0cf77 Improvement: Use backgroundpage for data if possible 2017-10-21 14:43:56 +02:00
152506f463 Merge branch 'acolombo25-master' into develop 2017-10-18 20:12:17 +02:00
Andrea Colombo
cf0ed2bf69 Add Italian translation 2017-10-18 12:07:29 +02:00
121da31400 Version 0.1.4 2017-10-15 13:58:41 +02:00
7c9a1bb624 Project: Update TODO, README, Screenshots 2017-10-15 13:42:06 +02:00
550757a186 Bug: Prevent dragdrop on back node 2017-10-15 13:20:18 +02:00
dbe7751b77 Improvement: Old styles and old grid are removed after redrawing the new 2017-10-15 12:18:10 +02:00
957f468c59 Improvement: Add bookmark without sheme add http:// 2017-10-15 12:04:40 +02:00
325fdc8c83 Bug: Add to Quick Dial menu is missing 2017-10-15 11:53:33 +02:00
245d70a6eb Bug: Somme node are empty and make data unusable 2017-10-15 11:28:21 +02:00
4a3072bbdc Version 0.1.3 2017-10-15 01:14:23 +02:00
9c907f37e0 Improvement: Update thumbnails when url has changed 2017-10-15 00:51:50 +02:00
39f96b015b Feature: Add Default button on node properties 2017-10-15 00:25:12 +02:00
d3cc6cf68f Bug: Custom image are not displayed in properties window 2017-10-15 00:10:53 +02:00
b91255375f Bug: Custom image are not displayed in properties window 2017-10-15 00:02:41 +02:00
c00b227599 Version 0.1.2 2017-10-14 23:12:38 +02:00
73152dedd0 Feature: Add settings to set custom image on nodes 2017-10-14 23:11:33 +02:00
0f956667a0 Code: Rename var core to app 2017-10-14 22:43:48 +02:00
feafd8449e Feature: Add first support to editing nodes 2017-10-14 22:41:28 +02:00
20ca231945 Feature: Add Capture in a new Tab support for folder 2017-10-14 20:51:38 +02:00
30b432d1b8 Features: Add toolbar button 2017-10-14 19:33:20 +02:00
7e11b0b7da Stability: Encode url path 2017-10-14 19:00:15 +02:00
420f356136 Bug reported by Scienmind: Background color flickering on subfolder 2017-10-14 18:53:59 +02:00
d6ee45da30 Version 0.1.1 2017-10-14 17:20:59 +02:00
45a5bd5d44 Bug: Sync from bookmark is disabed 2017-10-14 17:13:57 +02:00
55521d2d53 Improvement: Speed start 2017-10-14 16:51:39 +02:00
30 changed files with 2436 additions and 630 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
**/src.zip
/*.zip

View File

@ -1,2 +1,9 @@
# quickdial-webext
QuickDial is a WebExt Dial page for Firefox
[QuickDial on addons.mozilla.org](https://addons.mozilla.org/fr/firefox/addon/quick-dial/?src=search)
## Contribute and evolution :</br>
* [CONTRIBUTING.md](https://github.com/MatMoul/quickdial-webext/blob/develop/CONTRIBUTING.md)

6
TODO
View File

@ -1,6 +0,0 @@
Add node settings popup
Add custom image (thumbnails)
Create style for popup
Need a best solution to update folder and bookmark when it are updated from Firefox
Improve screenshot result
Add favicon support

44
makebeta Executable file
View File

@ -0,0 +1,44 @@
#!/bin/bash
if [ "$1" == "" ]; then
echo "Error: No version provided"
echo "./makebeta 0.0.1b1"
exit 1
fi
clear
branch=$(git rev-parse --abbrev-ref HEAD)
read -p "Current branch is $branch. Continue ? (y/N)" choice
case "$choice" in
n|N|'' )
echo "Cancel !"
exit 1
;;
y|Y ) echo "Make beta...";;
* )
echo "Cancel !"
exit 1
;;
esac
# Ready to update :
git branch beta
git checkout beta
version=$1
sed -i "/\"version\":/c\ \ \"version\": \"$version\"," src/manifest.json
sed -i 's/quickdial@matmoul.com/quickdialtest@matmoul.com/' src/manifest.json
git commit -a -m "Beta Version $version"
cd src
zip -r ../quickdial-beta-$version.zip . -x src.zip
cd ..
git checkout $branch
git branch -D beta

View File

@ -46,3 +46,7 @@ git tag -a "v$version" -m "Version $version"
git push --tags
git checkout $branch
cd src
zip -r ../quickdial-$version.zip . -x src.zip
cd ..

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 KiB

After

Width:  |  Height:  |  Size: 535 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 187 KiB

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 335 KiB

After

Width:  |  Height:  |  Size: 532 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 KiB

After

Width:  |  Height:  |  Size: 369 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 242 KiB

After

Width:  |  Height:  |  Size: 364 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 KiB

After

Width:  |  Height:  |  Size: 430 KiB

View File

@ -0,0 +1,67 @@
{
"menuAddToQuickDial": {
"message": "Zu Quick Dial hinzufügen",
"description": "Text of add bookmark menu item."
},
"menuNew": {
"message": "Neu",
"description": "Text of new menu item."
},
"menuNewBookmark": {
"message": "Lesezeichen",
"description": "Text of add bookmark menu item."
},
"AddBookmarkPrompt": {
"message": "Neue Lesezeichen URL eingeben:",
"description": "Text of the add bookmark prompt."
},
"menuNewFolder": {
"message": "Ordner",
"description": "Text of add folder menu item."
},
"AddFolderPrompt": {
"message": "Neuen Ordner Namen eingeben:",
"description": "Text of the add folder prompt."
},
"menuProperties": {
"message": "Bearbeiten",
"description": "Text of properties menu item."
},
"menuRefreshItem": {
"message": "Neu laden",
"description": "Text of refresh menu item."
},
"menuCaptureHere": {
"message": "Hier aufnehmen",
"description": "Text of capture here menu item."
},
"menuCapturePage": {
"message": "In einem neuen Tab aufnehmen",
"description": "Text of capture menu item."
},
"menuDeleteItem": {
"message": "Löschen",
"description": "Text of delete menu item."
},
"deleteItemConfimation": {
"message": "Löschen $1?",
"description": "Text of delete confirmation."
},
"menuSettings": {
"message": "Quick Dial Einstellungen",
"description": "Text of settings menu item."
}
}

View File

@ -1,9 +1,4 @@
{
"extensionDescription": {
"message": "Quick Dial, a dial page inspired from fast dial.",
"description": "Description of the extension."
},
"menuAddToQuickDial": {
"message": "Add to Quick Dial",
"description": "Text of add bookmark menu item."
@ -34,11 +29,21 @@
"description": "Text of the add folder prompt."
},
"menuProperties": {
"message": "Properties",
"description": "Text of properties menu item."
},
"menuRefreshItem": {
"message": "Refresh",
"description": "Text of refresh menu item."
},
"menuCaptureHere": {
"message": "Capture here",
"description": "Text of capture here menu item."
},
"menuCapturePage": {
"message": "Capture in a new tab",
"description": "Text of capture menu item."

View File

@ -0,0 +1,67 @@
{
"menuAddToQuickDial": {
"message": "Agregar a Quick Dial",
"description": "Text of add bookmark menu item."
},
"menuNew": {
"message": "Nuevo",
"description": "Text of new menu item."
},
"menuNewBookmark": {
"message": "Marcador",
"description": "Text of add bookmark menu item."
},
"AddBookmarkPrompt": {
"message": "Dirección del nuevo marcador:",
"description": "Text of the add bookmark prompt."
},
"menuNewFolder": {
"message": "Carpeta",
"description": "Text of add folder menu item."
},
"AddFolderPrompt": {
"message": "Nombre de la nueva carpeta:",
"description": "Text of the add folder prompt."
},
"menuProperties": {
"message": "Propiedades",
"description": "Text of properties menu item."
},
"menuRefreshItem": {
"message": "Actualizar",
"description": "Text of refresh menu item."
},
"menuCaptureHere": {
"message": "Capturar aquí",
"description": "Text of capture here menu item."
},
"menuCapturePage": {
"message": "Capturar en una nueva pestaña",
"description": "Text of capture menu item."
},
"menuDeleteItem": {
"message": "Eliminar",
"description": "Text of delete menu item."
},
"deleteItemConfimation": {
"message": "¿Eliminar $1 ?",
"description": "Text of delete confirmation."
},
"menuSettings": {
"message": "Propiedades de Quick Dial",
"description": "Text of settings menu item."
}
}

View File

@ -1,9 +1,4 @@
{
"extensionDescription": {
"message": "Quick Dial, page dial inspirée de fast dial.",
"description": "Description of the extension."
},
"menuAddToQuickDial": {
"message": "Ajouter à Quick Dial",
"description": "Text of add bookmark menu item."
@ -34,11 +29,21 @@
"description": "Text of the add folder prompt."
},
"menuProperties": {
"message": "Propriétés",
"description": "Text of properties menu item."
},
"menuRefreshItem": {
"message": "Actualiser",
"description": "Text of refresh menu item."
},
"menuCaptureHere": {
"message": "Capturer ici",
"description": "Text of capture here menu item."
},
"menuCapturePage": {
"message": "Capturer dans un nouvel onglet",
"description": "Text of capture menu item."

View File

@ -0,0 +1,67 @@
{
"menuAddToQuickDial": {
"message": "הוסף לחיוג מהיר",
"description": "Text of add bookmark menu item."
},
"menuNew": {
"message": "חדש",
"description": "Text of new menu item."
},
"menuNewBookmark": {
"message": "מועדף",
"description": "Text of add bookmark menu item."
},
"AddBookmarkPrompt": {
"message": "הכנס קישור חדש למועדף :",
"description": "Text of the add bookmark prompt."
},
"menuNewFolder": {
"message": "תיקייה",
"description": "Text of add folder menu item."
},
"AddFolderPrompt": {
"message": "הכנס שם חדש לתיקייה :",
"description": "Text of the add folder prompt."
},
"menuProperties": {
"message": "מאפיינים",
"description": "Text of properties menu item."
},
"menuRefreshItem": {
"message": "רענן",
"description": "Text of refresh menu item."
},
"menuCaptureHere": {
"message": "צלם מסך כאן",
"description": "Text of capture here menu item."
},
"menuCapturePage": {
"message": "צלם מסך בלשונית חדשה",
"description": "Text of capture menu item."
},
"menuDeleteItem": {
"message": "מחק",
"description": "Text of delete menu item."
},
"deleteItemConfimation": {
"message": "האם למחוק $1 ?",
"description": "Text of delete confirmation."
},
"menuSettings": {
"message": "הגדרות חיוג מהיר",
"description": "Text of settings menu item."
}
}

View File

@ -0,0 +1,62 @@
{
"menuAddToQuickDial": {
"message": "Aggiungi a Quick Dial",
"description": "Text of add bookmark menu item."
},
"menuNew": {
"message": "Nuovo",
"description": "Text of new menu item."
},
"menuNewBookmark": {
"message": "Segnalibro",
"description": "Text of add bookmark menu item."
},
"AddBookmarkPrompt": {
"message": "Scrivi l'url del nuovo segnalibro:",
"description": "Text of the add bookmark prompt."
},
"menuNewFolder": {
"message": "Cartella",
"description": "Text of add folder menu item."
},
"AddFolderPrompt": {
"message": "Scrivi il nome della nuova cartella:",
"description": "Text of the add folder prompt."
},
"menuProperties": {
"message": "Proprietà",
"description": "Text of properties menu item."
},
"menuRefreshItem": {
"message": "Aggiorna",
"description": "Text of refresh menu item."
},
"menuCapturePage": {
"message": "Cattura in una nuova scheda",
"description": "Text of capture menu item."
},
"menuDeleteItem": {
"message": "Elimina",
"description": "Text of delete menu item."
},
"deleteItemConfimation": {
"message": "Eliminare $1?",
"description": "Text of delete confirmation."
},
"menuSettings": {
"message": "Impostazioni Quick Dial",
"description": "Text of settings menu item."
}
}

View File

@ -0,0 +1,67 @@
{
"menuAddToQuickDial": {
"message": "Dodaj do Quick Dial",
"description": "Text of add bookmark menu item."
},
"menuNew": {
"message": "Nowy",
"description": "Text of new menu item."
},
"menuNewBookmark": {
"message": "Zakładka",
"description": "Text of add bookmark menu item."
},
"AddBookmarkPrompt": {
"message": "Wprowadź nowy adres URL zakładki:",
"description": "Text of the add bookmark prompt."
},
"menuNewFolder": {
"message": "Folder",
"description": "Text of add folder menu item."
},
"AddFolderPrompt": {
"message": "Wprowadź nazwę nowego folderu:",
"description": "Text of the add folder prompt."
},
"menuProperties": {
"message": "Właściwości",
"description": "Text of properties menu item."
},
"menuRefreshItem": {
"message": "Odśwież",
"description": "Text of refresh menu item."
},
"menuCaptureHere": {
"message": "Zdjęcie tutaj",
"description": "Text of capture here menu item."
},
"menuCapturePage": {
"message": "Zdjęcie na nowej karcie",
"description": "Text of capture menu item."
},
"menuDeleteItem": {
"message": "Usuń",
"description": "Text of delete menu item."
},
"deleteItemConfimation": {
"message": "Usuń $1 ?",
"description": "Text of delete confirmation."
},
"menuSettings": {
"message": "Ustawienia Quick Dial",
"description": "Text of settings menu item."
}
}

View File

@ -0,0 +1,67 @@
{
"menuAddToQuickDial": {
"message": "Adicionar ao Quick Dial",
"description": "Texto do iten de menu adicionar ao Quick Dial."
},
"menuNew": {
"message": "Novo",
"description": "Texto do item de menu novo."
},
"menuNewBookmark": {
"message": "Favorito",
"description": "Texto do iten de menu adicionar favorito."
},
"AddBookmarkPrompt": {
"message": "Entre com a url do novo favorito :",
"description": "Texto do rótulo adicionar favorito."
},
"menuNewFolder": {
"message": "Pasta",
"description": "Texto do item de menu adicionar pasta."
},
"AddFolderPrompt": {
"message": "Entre com o nome da nova pasta :",
"description": "Texto do rótulo adicionar pasta."
},
"menuProperties": {
"message": "Propriedades",
"description": "Texto do item de menu propriedades."
},
"menuRefreshItem": {
"message": "Atualizar",
"description": "Texto do item de menu atualizar."
},
"menuCaptureHere": {
"message": "Capturar aqui",
"description": "Texto do item de menu capturar aqui."
},
"menuCapturePage": {
"message": "Capturar em uma nova guia",
"description": "Texto do item de menu capturar em uma nova guia."
},
"menuDeleteItem": {
"message": "Excluir",
"description": "Texto do item de menu excluir."
},
"deleteItemConfimation": {
"message": "Excluir $1 ?",
"description": "Texto de confirmação da exclusão."
},
"menuSettings": {
"message": " Configurações do Quick Dial",
"description": "Texto do item de menu configurações."
}
}

View File

@ -0,0 +1,67 @@
{
"menuAddToQuickDial": {
"message": "Добавить в Quick Dial",
"description": "Text of add bookmark menu item."
},
"menuNew": {
"message": "Добавить",
"description": "Text of new menu item."
},
"menuNewBookmark": {
"message": "Закладку",
"description": "Text of add bookmark menu item."
},
"AddBookmarkPrompt": {
"message": "Введите URL-адрес новой закладки:",
"description": "Text of the add bookmark prompt."
},
"menuNewFolder": {
"message": "Папку",
"description": "Text of add folder menu item."
},
"AddFolderPrompt": {
"message": "Введите имя новой папки:",
"description": "Text of the add folder prompt."
},
"menuProperties": {
"message": "Свойства",
"description": "Text of properties menu item."
},
"menuRefreshItem": {
"message": "Обновить",
"description": "Text of refresh menu item."
},
"menuCaptureHere": {
"message": "Захватить здесь",
"description": "Text of capture here menu item."
},
"menuCapturePage": {
"message": "Захватить на новой вкладке",
"description": "Text of capture menu item."
},
"menuDeleteItem": {
"message": "Удалить",
"description": "Text of delete menu item."
},
"deleteItemConfimation": {
"message": "Удалить $1?",
"description": "Text of delete confirmation."
},
"menuSettings": {
"message": "Настройки Quick Dial",
"description": "Text of settings menu item."
}
}

View File

@ -0,0 +1,67 @@
{
"menuAddToQuickDial": {
"message": "Додај у брзо бирање",
"description": "Text of add bookmark menu item."
},
"menuNew": {
"message": "Нова",
"description": "Text of new menu item."
},
"menuNewBookmark": {
"message": "Забелешка",
"description": "Text of add bookmark menu item."
},
"AddBookmarkPrompt": {
"message": "Унесите УРЛ нове забелешке :",
"description": "Text of the add bookmark prompt."
},
"menuNewFolder": {
"message": "Фасцикла",
"description": "Text of add folder menu item."
},
"AddFolderPrompt": {
"message": "Унесите име нове фасцикле :",
"description": "Text of the add folder prompt."
},
"menuProperties": {
"message": "Својства",
"description": "Text of properties menu item."
},
"menuRefreshItem": {
"message": "Обнови",
"description": "Text of refresh menu item."
},
"menuCaptureHere": {
"message": "Ухвати овде",
"description": "Text of capture here menu item."
},
"menuCapturePage": {
"message": "Ухвати у новом језичку",
"description": "Text of capture menu item."
},
"menuDeleteItem": {
"message": "Обриши",
"description": "Text of delete menu item."
},
"deleteItemConfimation": {
"message": "Обрисати $1 ?",
"description": "Text of delete confirmation."
},
"menuSettings": {
"message": "Подешавање брзог бирања",
"description": "Text of settings menu item."
}
}

View File

@ -0,0 +1,67 @@
{
"menuAddToQuickDial": {
"message": "Додати до Quick Dial",
"description": "Text of add bookmark menu item."
},
"menuNew": {
"message": "Додати",
"description": "Text of new menu item."
},
"menuNewBookmark": {
"message": "Закладку",
"description": "Text of add bookmark menu item."
},
"AddBookmarkPrompt": {
"message": "Введіть URL-адресу нової закладки:",
"description": "Text of the add bookmark prompt."
},
"menuNewFolder": {
"message": "Папку",
"description": "Text of add folder menu item."
},
"AddFolderPrompt": {
"message": "Введіть им'я нової папки:",
"description": "Text of the add folder prompt."
},
"menuProperties": {
"message": "Властивості",
"description": "Text of properties menu item."
},
"menuRefreshItem": {
"message": "Оновити",
"description": "Text of refresh menu item."
},
"menuCaptureHere": {
"message": "Захватити тут",
"description": "Text of capture here menu item."
},
"menuCapturePage": {
"message": "Захватити на новій вкладці",
"description": "Text of capture menu item."
},
"menuDeleteItem": {
"message": "Видалити",
"description": "Text of delete menu item."
},
"deleteItemConfimation": {
"message": "Видалити $1?",
"description": "Text of delete confirmation."
},
"menuSettings": {
"message": "Налаштування Quick Dial",
"description": "Text of settings menu item."
}
}

81
src/html/properties.html Normal file
View File

@ -0,0 +1,81 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="shortcut icon" type="image/png" href="img/24.png" />
<title id="title">Quick Dial Node Propoerties</title>
<script type="text/javascript" src="/js/properties.js"></script>
<style>
body { margin: 0px; padding: 4px; font-family: Arial, Helvetica, sans-serif; font-size: 10pt; }
h1 { font-size: 11pt; text-decoration: underline; }
input[type=number] { width: 56px; }
input[type=color] { width: 60px; }
.hidden { display: none; }
.Tab>table { width: 100%; border-collapse: collapse; }
.Tab .TabSpace { width: 100%; border-bottom: solid 1px #505050; }
.Tab .TabButton { border: solid 1px #505050; padding: 2px 6px 2px 6px; cursor: default; }
.Tab .TabButtonActive { border: solid 1px #505050; border-bottom: none; padding: 2px 6px 2px 6px; cursor: default; }
.Tab>div { padding: 8px; height: 330px; border-left: solid 1px #505050; border-bottom: solid 1px #505050; border-right: solid 1px #505050; }
</style>
</head>
<body>
<div id="Tabs" class="Tab">
<table>
<tr>
<td class="TabButtonActive">Main</td>
<td class="TabButton" style="display:none">Temp</td>
<td class="TabSpace"></td>
</tr>
</table>
<div>
<div>
<table style="width:100%">
<tr>
<td><span>Title :</span></td>
<td><input id="Title" type="text" style="width:100%"></td>
<td style="width:20px"><input id="TitleLocked" type="checkbox" title="Lock title"></td>
</tr>
<tr>
<td><span>Url :</span></td>
<td colspan="2"><input id="Url" type="text" style="width:100%"></td>
</tr>
<tr>
<td><span>Image :</span></td>
<td>
<select id="ImageMode">
<option value="-1">Default</option>
<option value="0">Stretch</option>
<option value="1">Cover</option>
<option value="2">Contain</option>
<option value="3">Center</option>
</select>
<button id="ImageReset">Reset</button>
<button id="ImageDefault">Default</button>
<button class="hidden" id="ImageRefresh">Refresh</button>
<button class="hidden" id="ImageCapture">Capture</button>
<input id="ImageFile" type="file" style="width:180px;">
</td>
<td style="width:20px"><input id="ImageLocked" type="checkbox" title="Lock image"></td>
</tr>
<tr>
<td></td>
<td colspan="2"><div id="ImagePreview" style="width: 300px; height: 180px;"></div></td>
</tr>
</table>
</div>
<div class="hidden">
</div>
</div>
</div>
<div style="text-align: right; margin-top: 14px;">
<button id="BtnOk">OK</button>
<button id="BtnApply">Apply</button>
<button id="BtnCancel">Cancel</button>
</div>
</body>
</html>

View File

@ -12,10 +12,11 @@
input[type=color] { width: 60px; }
.hidden { display: none; }
.Tab>table { width: 100%; border-collapse: collapse; }
.Tab>div { overflow: auto; }
.Tab .TabSpace { width: 100%; border-bottom: solid 1px #505050; }
.Tab .TabButton { border: solid 1px #505050; padding: 2px 6px 2px 6px; cursor: default; }
.Tab .TabButtonActive { border: solid 1px #505050; border-bottom: none; padding: 2px 6px 2px 6px; cursor: default; }
.Tab>div { padding: 8px; height: 330px; border-left: solid 1px #505050; border-bottom: solid 1px #505050; border-right: solid 1px #505050; }
.Tab>div { padding: 8px; height: 350px; border-left: solid 1px #505050; border-bottom: solid 1px #505050; border-right: solid 1px #505050; }
</style>
</head>
<body id="body">
@ -35,6 +36,17 @@
<td><span>Background Color :</span></td>
<td><input id="BackgroundColor" type="color"></td>
</tr>
<tr>
<td><span>Background Mode :</span></td>
<td>
<select id="BackgroundMode">
<option value="0">Stretch</option>
<option value="1">Cover</option>
<option value="2">Contain</option>
<option value="3">Center</option>
</select>
</td>
</tr>
<tr>
<td><span>Background Image :</span></td>
<td>
@ -46,6 +58,22 @@
<td>Preview :</td>
<td><div id="BackgroundPreview" style="width: 300px; height: 180px;"></div></td>
</tr>
<tr>
<td>Show "Add to ..." :</td>
<td><input id="MenuShowAdd" type="checkbox"></td>
</tr>
<tr>
<td>Open QD in new page :</td>
<td><input id="ButtonOpenInNewPage" type="checkbox"></td>
</tr>
<tr>
<td>Startpage timeout :</td>
<td><input id="StartupTimeout" type="number"></td>
</tr>
</table>
</div>
<div class="hidden">
@ -53,13 +81,38 @@
<tr>
<td><span>Rows x Columns :</span></td>
<td>
<input id="GridRows" type="number">
<input id="GridColumns" type="number">
<input id="GridRows" type="number" min="1">
<input id="GridColumns" type="number" min="1">
</td>
</tr>
<tr>
<td><span>Ratio (X/Y) :</span></td>
<td>
<input id="GridRatioX" type="number" min="1">
<input id="GridRatioY" type="number" min="1">
</td>
</tr>
<tr>
<td><span>Margins :</span></td>
<td><input id="GridMargins" type="number"></td>
<td><input id="GridMargins" type="number" min="0"></td>
</tr>
<tr>
<td><span>Open Bookmarks In :</span></td>
<td>
<select id="GridOpenBookmarksIn">
<option value="0">Default</option>
<option value="1">New Tab</option>
</select>
</td>
</tr>
<tr>
<td><span>Open Folders In :</span></td>
<td>
<select id="GridOpenFoldersIn">
<option value="0">Default</option>
<option value="1">New Tab</option>
</select>
</td>
</tr>
<tr>
<td><span>Back Button :</span></td>
@ -70,18 +123,40 @@
<tr>
<td>
<div>Back :</div>
<div>
<select id="GridBackMode">
<option value="0">Stretch</option>
<option value="1">Cover</option>
<option value="2">Contain</option>
<option value="3">Center</option>
</select>
</div>
<button id="GridBackImageReset">Reset</button>
<input id="GridBackImageFile" type="file" style="width:220px;">
<div id="GridBackPreview" style="width: 220px; height: 150px; border: 1px solid #000000"></div>
</td>
<td>
<div>Folder :</div>
<div>
<select id="GridFolderMode">
<option value="0">Stretch</option>
<option value="1">Cover</option>
<option value="2">Contain</option>
<option value="3">Center</option>
</select>
</div>
<button id="GridFolderImageReset">Reset</button>
<input id="GridFolderImageFile" type="file" style="width:220px;">
<div id="GridFolderPreview" style="width: 220px; height: 150px; border: 1px solid #000000"></div>
</td>
</tr>
</table>
<table style="width:100%;">
<tr>
<td><span>Root Folder :</span></td>
<td><input id="GridRoot" type="text" style="width:100%;"></td>
</tr>
</table>
</div>
<div class="hidden">
<table>
@ -92,13 +167,23 @@
</tr>
<tr>
<td><span>Margins :</span></td>
<td><input id="GridCellsMargins" type="number"></td>
<td><input id="GridCellsMarginsHover" type="number" style="display: none;"></td>
<td><input id="GridCellsMargins" type="number" min="0"></td>
<td><input id="GridCellsMarginsHover" type="number" min="0"></td>
</tr>
<tr>
<td><span>Opacity :</span></td>
<td><input id="GridCellsOpacity" type="number" min="0" max="100"></td>
<td><input id="GridCellsOpacityHover" type="number" min="0" max="100"></td>
</tr>
<tr>
<td><span>Border Size :</span></td>
<td><input id="GridCellsBorderSize" type="number" min="0"></td>
<td><input id="GridCellsBorderSizeHover" type="number" min="0"></td>
</tr>
<tr>
<td><span>Border Radius :</span></td>
<td><input id="GridCellsBorderRadius" type="number"></td>
<td><input id="GridCellsBorderRadiusHover" type="number"></td>
<td><input id="GridCellsBorderRadius" type="number" min="0"></td>
<td><input id="GridCellsBorderRadiusHover" type="number" min="0"></td>
</tr>
<tr>
<td><span>Background Transparent :</span></td>
@ -118,17 +203,22 @@
<tr>
<td><span>Title :</span></td>
<td><input id="GridCellsTitle" type="checkbox"></td>
<td></td>
<td><input id="GridCellsTitleHover" type="checkbox"></td>
</tr>
<tr>
<td><span>Title Height :</span></td>
<td><input id="GridCellsTitleHeight" type="number"></td>
<td></td>
<td><input id="GridCellsTitleHeight" type="number" min="0"></td>
<td><input id="GridCellsTitleHeightHover" type="number" min="0"></td>
</tr>
<tr>
<td><span>Title Font Size :</span></td>
<td><input id="GridCellsTitleFontSize" type="number"></td>
<td></td>
<td><input id="GridCellsTitleFontSize" type="number" min="0"></td>
<td><input id="GridCellsTitleFontSizeHover" type="number" min="0"></td>
</tr>
<tr>
<td><span>Title Border Size :</span></td>
<td><input id="GridCellsTitleBorderSize" type="number" min="0"></td>
<td><input id="GridCellsTitleBorderSizeHover" type="number" min="0"></td>
</tr>
<tr>
<td><span>Title Text Color :</span></td>
@ -145,6 +235,10 @@
<td><input id="GridCellsTitleBackgroundColor" type="color"></td>
<td><input id="GridCellsTitleBackgroundColorHover" type="color"></td>
</tr>
<tr>
<td><span>Snapshot Delay :</span></td>
<td colspan="2"><input id="GridCellsSnapshotDelay" type="number" min="300" max="10000"></td>
</tr>
</table>
</div>
</div>
@ -156,4 +250,4 @@
<button id="BtnCancel">Cancel</button>
</div>
</body>
</html>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -2,89 +2,143 @@ var utils = {};
var app = {};
var dial = {
page: 1,
maxpage: 1
maxpage: 1,
capture: 0
};
window.onload = function(){
document.addEventListener("DOMContentLoaded", function(event) {
document.body.style.backgroundColor = utils.getBackgroundColor();
app.init();
dial.init();
};
window.onresize = function(){
window.setTimeout(function(){
if(! app.settings) app.init();
}, 500);
});
window.addEventListener('resize', function(){
if(app && app.settings) dial.updateGridLayout();
}
window.onwheel = function(ev){
});
window.addEventListener('wheel', function(e){
if(app && app.settings){
if(ev.deltaY > 0){
if(e.deltaY > 0){
if(dial.page < dial.maxpage){
dial.page += 1;
dial.populateGrid();
}
} else if(ev.deltaY < 0){
} else if(e.deltaY < 0){
if(dial.page > 1){
dial.page -= 1;
dial.populateGrid();
}
}
}
}
});
window.addEventListener('keyup', function(e){
switch(e.key){
case 'PageDown':
if(dial.page < dial.maxpage){
dial.page += 1;
dial.populateGrid();
}
break;
case 'PageUp':
if(dial.page > 1){
dial.page -= 1;
dial.populateGrid();
}
break;
}
});
utils.getBackgroundColor = function(){
return new URL(window.location).searchParams.get('bg');
};
utils.getPath = function(){
var path = new URL(window.location).searchParams.get('path');
if(path) return path + '/';
else return '/';
};
app.init = function(){
dial.path = utils.getPath();
app.Messages.getSettings(app.Settings._changed);
app.Messages.getNode(dial.path, app.GridNodes._changed);
app.Messages.init();
app.Messages.getSettings(function(settings){
if(settings && settings.grid) app.Settings._changed(settings);
dial.path = utils.getPath();
app.Messages.getNode(dial.path, app.GridNodes._changed);
app.Messages.init();
});
};
app.Messages = {};
app.Messages.Commands = {
getSettings: 0,
setSettings: 1,
getNode: 2,
getNodeByID: 3,
updateNode: 4,
setNodeIndex: 5,
createBookmark: 6,
createFolder: 7,
deleteNode: 8,
refreshNode: 9,
capturePage: 10,
settingsChanged: 100,
gridNodesLoaded: 101
};
app.Messages.init = function(){
browser.runtime.onMessage.addListener(function(request, sender, sendResponse){
switch(request.cmd){
case 'SettingsChanged':
case app.Messages.Commands.settingsChanged:
app.Messages.getSettings(app.Settings._changed);
break;
case 'GridNodesLoaded':
app.Messages.getNode(dial.path, app.GridNodes._changed);
case app.Messages.Commands.gridNodesLoaded:
if(dial.skipUpdate!=true) app.Messages.getNode(dial.path, app.GridNodes._changed);
break;
}
});
};
app.Messages.getSettings = function(callback){
browser.runtime.sendMessage({ cmd: 'GetSettings' }).then(callback);
browser.runtime.getBackgroundPage().then(function(page){
if(page){
if(callback) callback(page.app.settings);
} else {
browser.runtime.sendMessage({ cmd: app.Messages.Commands.getSettings }).then(callback, callback);
}
}, callback);
};
app.Messages.getNode = function(path, callback){
browser.runtime.sendMessage({ cmd: 'GetNode', path: path }).then(callback);
browser.runtime.getBackgroundPage().then(function(page){
if(page){
if(callback) callback(page.app.GridNodes.getNode(page.app.node, dial.path.substr(1)));
} else {
browser.runtime.sendMessage({ cmd: app.Messages.Commands.getNode, path: path }).then(callback);
}
});
};
app.Messages.updateNode = function(id, value, callback){
browser.runtime.sendMessage({ cmd: app.Messages.Commands.updateNode, id: id, value: value }).then(callback);
};
app.Messages.setNodeIndex = function(index, newIndex, callback){
browser.runtime.sendMessage({ cmd: 'SetNodeIndex', path: dial.path, index: index, newIndex: newIndex }).then(callback);
browser.runtime.sendMessage({ cmd: app.Messages.Commands.setNodeIndex, path: dial.path, index: index, newIndex: newIndex }).then(callback);
};
app.Messages.createBookmark = function(url, callback){
browser.runtime.sendMessage({ cmd: 'CreateBookmark', path: dial.path, url: url, title: url }).then(callback);
browser.runtime.sendMessage({ cmd: app.Messages.Commands.createBookmark, path: dial.path, url: url, title: url }).then(callback);
};
app.Messages.createFolder = function(name, callback){
browser.runtime.sendMessage({ cmd: 'CreateFolder', path: dial.path, name: name }).then(callback);
browser.runtime.sendMessage({ cmd: app.Messages.Commands.createFolder, path: dial.path, name: name }).then(callback);
};
app.Messages.deleteNode = function(id, callback){
browser.runtime.sendMessage({ cmd: 'DeleteNode', path: dial.path, id: id }).then(callback);
browser.runtime.sendMessage({ cmd: app.Messages.Commands.deleteNode, path: dial.path, id: id }).then(callback);
};
app.Messages.refreshNode = function(id, callback){
browser.runtime.sendMessage({ cmd: 'RefreshNode', path: dial.path, id: id }).then(callback);
browser.runtime.sendMessage({ cmd: app.Messages.Commands.refreshNode, path: dial.path, id: id }).then(callback);
}
app.Messages.capturePage = function(id, callback){
browser.runtime.sendMessage({ cmd: 'CapturePage', path: dial.path, id: id }).then(callback);
browser.runtime.sendMessage({ cmd: app.Messages.Commands.capturePage, path: dial.path, id: id }).then(callback);
}
app.Settings = {};
app.Settings._changed = function(settings){
app.settings = settings;
@ -107,11 +161,13 @@ app.GridNodes._changed = function(node){
dial.init = function(){
dial.initMenus();
//dial.initMenus();
dial.Title = document.createElement('title');
document.head.appendChild(dial.Title);
};
/*
dial.initMenus = function(){
document.body.setAttribute('contextmenu', 'page');
dial.PageMenu = document.createElement('menu');
@ -149,17 +205,25 @@ dial.initMenus = function(){
dial.ItemMenuCreateFolder = document.createElement('menuitem');
dial.ItemMenuCreateFolder.label = browser.i18n.getMessage("menuNewFolder");
dial.ItemMenuCreateFolder.onclick = dial.createFolder;
/*
dial.ItemMenuEdit = document.createElement('menuitem');
dial.ItemMenuEdit.label = 'Edit';
//dial.ItemMenuEdit.onclick = dial.test;
*/
dial.ItemMenuProperties = document.createElement('menuitem');
dial.ItemMenuProperties.label = browser.i18n.getMessage("menuProperties");
dial.ItemMenuProperties.onclick = function(){
dial.editProperties(dial._selectedItem);
};
dial.ItemMenuRefresh = document.createElement('menuitem');
dial.ItemMenuRefresh.label = browser.i18n.getMessage("menuRefreshItem");
dial.ItemMenuRefresh.onclick = function(){
dial.refreshNode(dial._selectedItem);
};
dial.ItemMenuCaptureHere = document.createElement('menuitem');
dial.ItemMenuCaptureHere.label = browser.i18n.getMessage("menuCaptureHere");
dial.ItemMenuCaptureHere.onclick = function(){
dial.captureHere(dial._selectedItem);
};
dial.ItemMenuCapture = document.createElement('menuitem');
dial.ItemMenuCapture.label = browser.i18n.getMessage("menuCapturePage");
dial.ItemMenuCapture.onclick = function(){
@ -178,43 +242,75 @@ dial.initMenus = function(){
dial.ItemMenuNew.appendChild(dial.ItemMenuCreateBookmark);
dial.ItemMenuNew.appendChild(dial.ItemMenuCreateFolder);
dial.ItemMenu.appendChild(document.createElement('hr'));
//dial.ItemMenu.appendChild(dial.ItemMenuEdit);
dial.ItemMenu.appendChild(dial.ItemMenuProperties);
dial.ItemMenu.appendChild(dial.ItemMenuRefresh);
dial.ItemMenu.appendChild(dial.ItemMenuCaptureHere);
dial.ItemMenu.appendChild(dial.ItemMenuCapture);
dial.ItemMenu.appendChild(dial.ItemMenuDelete);
dial.ItemMenu.appendChild(document.createElement('hr'));
dial.ItemMenu.appendChild(dial.ItemMenuSettings);
document.body.appendChild(dial.ItemMenu);
}
*/
dial.initStyles = function(){
if(dial.Style) document.head.removeChild(dial.Style);
function applyImageMode(imageMode, target){
switch(imageMode){
case 0:
target.backgroundRepeat = 'no-repeat';
target.backgroundSize = '100% 100%';
break;
case 1:
target.backgroundRepeat = 'no-repeat';
target.backgroundSize = 'cover';
target.backgroundPosition = 'center';
break;
case 2:
target.backgroundRepeat = 'no-repeat';
target.backgroundSize = 'contain';
target.backgroundPosition = 'center';
break;
case 3:
target.backgroundRepeat = 'no-repeat';
target.backgroundPosition = 'center';
break;
}
}
var oldStyle = dial.Style;
dial.Style = document.createElement('style'), StyleSheet;
document.head.appendChild(dial.Style);
dial.styles = {};
dial.styles.html = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('html { height: 100%; }')].style;
dial.styles.body = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('body { user-select: none; -moz-user-select: none; display: flex; width: 100%; height: 100%; margin: 0px; padding: 0px; background-color: ' + app.settings.backgroundColor + '; background-image: ' + app.settings.backgroundImage + '; background-repeat: no-repeat; background-size: 100% 100%; }')].style;
dial.styles.body = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('body { user-select: none; -moz-user-select: none; display: flex; width: 100%; height: 100%; margin: 0px; padding: 0px; background-color: ' + app.settings.backgroundColor + '; background-image: ' + app.settings.backgroundImage + '; }')].style;
applyImageMode(app.settings.backgroundMode, dial.styles.body);
dial.styles.grid = {};
dial.styles.grid.grid = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid { border-collapse: collapse; margin: auto; }')].style;
dial.styles.grid.cell = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid td { margin: 0px; padding: 0px; }')].style;
dial.styles.grid.link = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid td>a { display: block; outline: none; overflow: hidden; text-decoration: none; margin: ' + app.settings.grid.cells.margin + 'px; border: 1px solid ' + app.settings.grid.cells.borderColor + '; border-radius: ' + app.settings.grid.cells.borderRadius + 'px; }')].style;
//dial.styles.grid.linkHover = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid td>a:hover { border-color: ' + app.settings.grid.cells.borderColorHover + '; border-radius: ' + app.settings.grid.cells.borderRadiusHover + 'px; }')].style;
dial.styles.grid.linkHover = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid td>a:hover { border-color: ' + app.settings.grid.cells.borderColorHover + '; margin: ' + app.settings.grid.cells.marginHover + 'px; border-radius: ' + app.settings.grid.cells.borderRadiusHover + 'px; }')].style;
dial.styles.grid.cellHover = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid td:hover {}')].style;
dial.styles.grid.link = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid td>a { display: block; outline: none; overflow: hidden; text-decoration: none; margin: ' + app.settings.grid.cells.margin + 'px; opacity: ' + app.settings.grid.cells.opacity + '; border: ' + app.settings.grid.cells.borderSize + 'px solid ' + app.settings.grid.cells.borderColor + '; border-radius: ' + app.settings.grid.cells.borderRadius + 'px; }')].style;
dial.styles.grid.linkHover = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid td>a:hover { border-color: ' + app.settings.grid.cells.borderColorHover + '; border-width: ' + app.settings.grid.cells.borderSizeHover + 'px; margin: ' + app.settings.grid.cells.marginHover + 'px; opacity: ' + app.settings.grid.cells.opacityHover + '; border-radius: ' + app.settings.grid.cells.borderRadiusHover + 'px; }')].style;
dial.styles.grid.linkPanel = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid td>a>div:first-child { background-repeat: no-repeat; }')].style;
if(app.settings.grid.cells.backgroundColor) dial.styles.grid.linkPanel.backgroundColor = app.settings.grid.cells.backgroundColor;
dial.styles.grid.linkPanelHover = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid td>a:hover>div:first-child { }')].style;
if(app.settings.grid.cells.backgroundColorHover) dial.styles.grid.linkPanelHover.backgroundColor = app.settings.grid.cells.backgroundColorHover;
dial.styles.grid.linkTitle = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid td>a>div:last-child { height: ' + app.settings.grid.cells.titleHeight + 'px; font-size: ' + app.settings.grid.cells.titleFontSize + 'pt; font-family: ' + app.settings.grid.cells.titleFont + 'pt; text-align: center; overflow: hidden; color: ' + app.settings.grid.cells.titleColor + '; border-top: 1px solid ' + app.settings.grid.cells.borderColor + '; }')].style;
else dial.styles.grid.linkPanelHover.backgroundColor = 'transparent';
dial.styles.grid.linkTitle = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid td>a>div:last-child { height: ' + app.settings.grid.cells.titleHeight + 'px; font-size: ' + app.settings.grid.cells.titleFontSize + 'pt; font-family: ' + app.settings.grid.cells.titleFont + '; text-align: center; overflow: hidden; color: ' + app.settings.grid.cells.titleColor + '; border-top: ' + app.settings.grid.cells.titleBorderSize + 'px solid ' + app.settings.grid.cells.borderColor + '; }')].style;
if(app.settings.grid.cells.titleBackgroundColor) dial.styles.grid.linkTitle.backgroundColor = app.settings.grid.cells.titleBackgroundColor;
dial.styles.grid.linkTitleHover = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid td>a:hover>div:last-child { color: ' + app.settings.grid.cells.titleColorHover + '; border-top-color: ' + app.settings.grid.cells.borderColorHover + ' }')].style;
else dial.styles.grid.linkTitle.backgroundColor = 'transparent';
dial.styles.grid.linkTitleHover = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid td>a:hover>div:last-child { font-size: ' + app.settings.grid.cells.titleFontSizeHover + 'pt; color: ' + app.settings.grid.cells.titleColorHover + '; border-top-width: ' + app.settings.grid.cells.titleBorderSizeHover + 'px; border-top-color: ' + app.settings.grid.cells.borderColorHover + ' }')].style;
if(app.settings.grid.cells.titleBackgroundColorHover) dial.styles.grid.linkTitleHover.backgroundColor = app.settings.grid.cells.titleBackgroundColorHover;
else dial.styles.grid.linkTitleHover.backgroundColor = 'transparent';
dial.styles.grid.linkEmpty = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid td>a.Empty { display: none; }')].style;
dial.styles.grid.linkBack = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid td>a.Back :first-child { background-image: ' + app.settings.grid.backIcon + '; background-repeat: no-repeat; background-position: center center; }')].style;
dial.styles.grid.linkBack = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid td>a.Back :first-child { background-image: ' + app.settings.grid.backIcon + '; }')].style;
applyImageMode(app.settings.grid.backIconMode, dial.styles.grid.linkBack);
dial.styles.grid.linkFolder = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid td>a.Folder :first-child { background-image: ' + app.settings.grid.folderIcon + '; background-repeat: no-repeat; background-size: 100% 100%; }')].style;
applyImageMode(app.settings.grid.folderIconMode, dial.styles.grid.linkFolder);
dial.styles.grid.linkBookmark = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid td>a.Bookmark :first-child { background-repeat: no-repeat; background-size: 100% 100%; }')].style;
dial.styles.grid.linkBookmarkLoading = dial.Style.sheet.cssRules[dial.Style.sheet.insertRule('.Grid td>a.BookmarkLoading :first-child { background-image: url("' + app.settings.grid.cells.loadingIcon + '"); background-repeat: no-repeat; background-position: center center; }')].style;
if(oldStyle) document.head.removeChild(oldStyle);
};
dial.initGrid = function(){
if(dial.Grid) document.body.removeChild(dial.Grid);
var oldGrid = dial.Grid;
dial.Grid = document.createElement('table');
var grid = document.createElement('table');
dial.Grid.className = 'Grid';
@ -232,21 +328,70 @@ dial.initGrid = function(){
link.className = 'Empty';
link.appendChild(document.createElement('div'));
link.appendChild(document.createElement('div'));
link.onmousedown = function(){ dial._selectedItem = this; };
link.onmousedown = function(){
dial._selectedItem = this;
/*
if(dial._selectedItem.Node){
switch(dial._selectedItem.Node.type){
case app.GridNodes.GridNodeType.folder:
dial.ItemMenuCaptureHere.hidden = true;
break;
case app.GridNodes.GridNodeType.bookmark:
//dial.ItemMenuCaptureHere.hidden = false;
dial.ItemMenuCaptureHere.hidden = true;
break;
}
}
*/
};
function dragstart_handler(ev) {
if(!ev.target.Node){
ev.preventDefault();
return;
}
if(dial.page == 0) dial.page = 1;
var index = (dial.page - 1) * (app.settings.grid.rows * app.settings.grid.columns) + +(ev.target.parentElement.getAttribute('gridindex'));
if(app.settings.grid.backNode && dial.path != '/') index -= dial.page;
ev.dataTransfer.setData("text/plain", index);
}
function dragover_handler(ev) {
ev.dataTransfer.setData("text/plain", JSON.stringify({parentId: app.node.id, index: index}));
}
function dragover_handler(ev) {
ev.preventDefault();
ev.dataTransfer.dropEffect = "move"
var data = ev.dataTransfer.getData("text");
try {
data = JSON.parse(data);
} catch(e) {
data = null;
}
if(!data){
ev.dataTransfer.dropEffect = "none";
return;
} else if(data.parentId != app.node.id){
ev.dataTransfer.dropEffect = "none";
return;
}
if(app.settings.grid.backNode && dial.path != '/'){
var gridIndex = 0;
if(ev.target.tagName == 'DIV') gridIndex = +(ev.target.parentElement.parentElement.getAttribute('gridindex'));
else gridIndex = +(ev.target.getAttribute('gridindex'));
if(gridIndex==0) ev.dataTransfer.dropEffect = "none";
else ev.dataTransfer.dropEffect = "move";
} else {
ev.dataTransfer.dropEffect = "move";
}
}
function drop_handler(ev) {
ev.preventDefault();
if(ev.buttons == 1) return;
var StartIndex = ev.dataTransfer.getData("text");
var data = ev.dataTransfer.getData("text");
try {
data = JSON.parse(data);
} catch(e) {
data = null;
}
if(!data) return;
else if(data.parentId != app.node.id) return;
var StartIndex = data.index;
var EndIndex = 0;
if(ev.target.tagName == 'DIV'){
EndIndex = (dial.page - 1) * (app.settings.grid.rows * app.settings.grid.columns) + +(ev.target.parentElement.parentElement.getAttribute('gridindex'));
@ -254,7 +399,7 @@ dial.initGrid = function(){
EndIndex = (dial.page - 1) * (app.settings.grid.rows * app.settings.grid.columns) + +(ev.target.getAttribute('gridindex'));
}
if(app.settings.grid.backNode && dial.path != '/') EndIndex -= dial.page;
app.Messages.setNodeIndex(StartIndex, EndIndex);
if(StartIndex != EndIndex) app.Messages.setNodeIndex(StartIndex, EndIndex);
}
link.draggable = true;
link.ondragstart = dragstart_handler;
@ -264,32 +409,83 @@ dial.initGrid = function(){
}
document.body.appendChild(dial.Grid);
dial.updateGridLayout();
if(oldGrid) document.body.removeChild(oldGrid);
return dial.Grid;
};
dial.updateGridLayout = function(){
var fullWidth = dial.Grid.parentElement.offsetWidth - 2 * app.settings.grid.margin;
var fullHeight = dial.Grid.parentElement.offsetHeight - 2 * app.settings.grid.margin;
var linkWidth = fullWidth / app.settings.grid.columns;
var linkHeight = fullHeight / app.settings.grid.rows;
if(linkWidth <= linkHeight * 4 / 3) linkHeight = linkWidth / 4 * 3;
else linkWidth = linkHeight / 3 * 4;
var parentWidth = dial.Grid.parentElement.offsetWidth;
var parentHeight = dial.Grid.parentElement.offsetHeight;
dial.styles.grid.cell.width = linkWidth.toString() + 'px';
dial.styles.grid.cell.height = linkHeight.toString() + 'px';
function calc(gridMargin, cellsMargin, borderSize, titleBorderSize){
var fullWidth = parentWidth - 2 * gridMargin;
var fullHeight = parentHeight - 2 * gridMargin;
var cellWidth = fullWidth / app.settings.grid.columns;
var cellHeight = fullHeight / app.settings.grid.rows;
var linkWidth = 0;
var linkHeight = 0;
if(cellWidth <= cellHeight * app.settings.grid.ratioX / app.settings.grid.ratioY) cellHeight = cellWidth / app.settings.grid.ratioX * app.settings.grid.ratioY;
else cellWidth = cellHeight / app.settings.grid.ratioY * app.settings.grid.ratioX;
linkWidth = cellWidth - 2 * (cellsMargin + 1) - 2 * borderSize;
linkHeight = cellHeight - 2 * (cellsMargin + 1) - 2 * borderSize - titleBorderSize;
return {
cellWidth: cellWidth,
cellHeight: cellHeight,
linkWidth: linkWidth,
linkHeight: linkHeight
};
}
linkWidth = linkWidth - 2 * (app.settings.grid.cells.margin + 1);
linkHeight = linkHeight - 2 * (app.settings.grid.cells.margin + 1);
dial.styles.grid.link.width = linkWidth.toString() + 'px';
dial.styles.grid.link.height = linkHeight.toString() + 'px';
if(app.settings.grid.cells.title) dial.styles.grid.linkPanel.height = (linkHeight - app.settings.grid.cells.titleHeight - 1).toString() + 'px';
else dial.styles.grid.linkPanel.height = linkHeight.toString() + 'px';
var values = calc(app.settings.grid.margin, app.settings.grid.cells.margin, app.settings.grid.cells.borderSize, app.settings.grid.cells.titleBorderSize);
dial.styles.grid.cell.width = values.cellWidth.toString() + 'px';
dial.styles.grid.cell.height = values.cellHeight.toString() + 'px';
dial.styles.grid.link.width = values.linkWidth.toString() + 'px';
dial.styles.grid.link.height = values.linkHeight.toString() + 'px';
if(app.settings.grid.cells.title) dial.styles.grid.linkPanel.height = (values.linkHeight - app.settings.grid.cells.titleHeight - 1 - app.settings.grid.cells.titleBorderSize).toString() + 'px';
else dial.styles.grid.linkPanel.height = values.linkHeight.toString() + 'px';
values = calc(app.settings.grid.margin, app.settings.grid.cells.marginHover, app.settings.grid.cells.borderSizeHover, app.settings.grid.cells.titleBorderSizeHover);
dial.styles.grid.cellHover.width = values.cellWidth.toString() + 'px';
dial.styles.grid.cellHover.height = values.cellHeight.toString() + 'px';
dial.styles.grid.linkHover.width = values.linkWidth.toString() + 'px';
dial.styles.grid.linkHover.height = values.linkHeight.toString() + 'px';
if(app.settings.grid.cells.titleHover) dial.styles.grid.linkPanelHover.height = (values.linkHeight - app.settings.grid.cells.titleHeightHover - 1 - app.settings.grid.cells.titleBorderSizeHover).toString() + 'px';
else dial.styles.grid.linkPanelHover.height = values.linkHeight.toString() + 'px';
};
dial.populateGrid = function(){
function applyImageMode(imageMode, target){
switch(imageMode){
case -1:
target.backgroundRepeat = '';
target.backgroundSize = '';
target.backgroundPosition = '';
break;
case 0:
target.backgroundRepeat = 'no-repeat';
target.backgroundSize = '100% 100%';
target.backgroundPosition = '';
break;
case 1:
target.backgroundRepeat = 'no-repeat';
target.backgroundSize = 'cover';
target.backgroundPosition = 'center';
break;
case 2:
target.backgroundRepeat = 'no-repeat';
target.backgroundSize = 'contain';
target.backgroundPosition = 'center';
break;
case 3:
target.backgroundRepeat = 'no-repeat';
target.backgroundSize = 'auto auto';
target.backgroundPosition = 'center';
break;
}
}
populateEmpty = function(link){
link.Node = null;
link.className = 'Empty';
link.childNodes[0].style.backgroundImage = '';
if(link.target) delete link.target;
link.href = null;
link.onclick = null;
link.removeAttribute('contextmenu');
@ -299,6 +495,7 @@ dial.populateGrid = function(){
link.className = 'Back';
link.childNodes[0].style.backgroundImage = '';
link.childNodes[1].innerText = 'Back';
if(link.target) delete link.target;
link.href = '#';
link.onclick = function(){ window.history.back(); }
link.removeAttribute('contextmenu');
@ -306,24 +503,48 @@ dial.populateGrid = function(){
populateFolder = function(link, node){
link.Node = node;
link.className = 'Folder';
link.childNodes[0].style.backgroundImage = '';
if(node.imageMode || node.imageMode == 0) applyImageMode(node.imageMode, link.childNodes[0].style);
else applyImageMode(-1, link.childNodes[0].style);
if(node.image){
if(node.image.indexOf('url(')>=0) link.childNodes[0].style.backgroundImage = node.image;
else link.childNodes[0].style.backgroundImage = 'url(' + node.image + ')';
} else link.childNodes[0].style.backgroundImage = '';
link.childNodes[1].innerText = node.title;
if(dial.path) link.href = '?path=' + dial.path + node.title;
else link.href = '?path=' + node.title;
switch(app.settings.grid.openFolderMethod){
case 0:
if(link.target) delete link.target;
break;
case 1:
link.target = '_blank';
break;
}
if(dial.path) link.href = '?' + 'bg=' + encodeURIComponent(app.settings.backgroundColor) + '&path=' + encodeURIComponent(dial.path + node.title);
else link.href = '?' + 'bg=' + encodeURIComponent(app.settings.backgroundColor) + '&path=' + encodeURIComponent(node.title);
link.onclick = null;
link.setAttribute('contextmenu', 'item');
}
populateBookmark = function(link, node){
link.Node = node;
if(node.imageMode || node.imageMode == 0) applyImageMode(node.imageMode, link.childNodes[0].style);
else applyImageMode(-1, link.childNodes[0].style);
if(node.image){
link.className = 'Bookmark';
link.childNodes[0].style.backgroundImage = 'url(' + node.image + ')';
if(node.image.indexOf('url(')>=0) link.childNodes[0].style.backgroundImage = node.image;
else link.childNodes[0].style.backgroundImage = 'url(' + node.image + ')';
} else {
link.className = 'BookmarkLoading';
link.childNodes[0].style.backgroundImage = '';
dial.refreshNode(link);
}
link.childNodes[1].innerText = node.title;
switch(app.settings.grid.openBookmarkMethod){
case 0:
if(link.target) delete link.target;
break;
case 1:
link.target = '_blank';
break;
}
link.href = node.url;
link.onclick = null;
link.setAttribute('contextmenu', 'item');
@ -378,6 +599,88 @@ dial.refreshNode = function(selectedItem){
selectedItem.childNodes[0].style.backgroundImage = app.settings.grid.loadingIcon;
app.Messages.refreshNode(selectedItem.Node.id);
}
dial.captureHere = function(selectedItem){
function headersReceived(e){
for (let i = e.responseHeaders.length - 1; i >= 0; i--) {
switch(e.responseHeaders[i].name.toLowerCase()){
case 'x-frame-options':
case 'frame-options':
case 'content-security-policy':
e.responseHeaders.splice(i, 1);
break;
}
}
return { responseHeaders: e.responseHeaders };
};
function pageLoaded(){
if(!iframe) return;
function clean(){
if(!iframe) return;
selectedItem.children[0].removeChild(iframe);
dial.capture -= 1;
if(dial.capture == 0){
browser.webRequest.onHeadersReceived.removeListener(headersReceived);
browser.tabs.update(tab.id, {muted: false}).then();
}
iframe = null;
}
setTimeout(function(){
browser.tabs.captureVisibleTab().then(function(img){
var imgObj = new Image;
imgObj.src = img;
var canvas = document.createElement('canvas');
canvas.style.width = rect.width.toString() + 'px';
canvas.style.height = rect.height.toString() + 'px';
canvas.width = rect.width;
canvas.height = rect.height;
var ctx = canvas.getContext('2d');
ctx.clearRect(0, 0, rect.width, rect.height);
ctx.save();
setTimeout(function(){
ctx.drawImage(imgObj, rect.left, rect.top, rect.width, rect.height, 0, 0, rect.width, rect.height);
ctx.restore();
img = canvas.toDataURL();
selectedItem.children[0].style.backgroundImage = 'url(' + img + ')';
clean();
app.Messages.updateNode(selectedItem.Node.id, { image: img }, function(){
setTimeout(function(){
if(dial.capture == 0) dial.skipUpdate = false;
}, 500);
});
}, 500);
}, clean);
}, 3000);
};
var tab = null;
var previewWidth = 1200; // Need to be linked to settings
var previewHeight = 710; // Need to be linked to settings
var iframe = document.createElement('iframe');
var rect = selectedItem.children[0].getBoundingClientRect();
browser.tabs.getCurrent().then(function(currentTab){
tab = currentTab;
var ratioX = previewWidth / selectedItem.children[0].offsetWidth;
var ratioY = previewHeight / selectedItem.children[0].offsetHeight;
iframe.style.width = ratioX * selectedItem.children[0].offsetWidth + 'px';
iframe.style.height = ratioY * selectedItem.children[0].offsetHeight + 'px';
iframe.style.position = 'absolute';
iframe.style.MozTransform = 'scale(' + (1/ratioX) + ', ' + (1/ratioY) + ')';
iframe.style.MozTransformOrigin = 'top left';
iframe.sandbox = 'allow-scripts allow-same-origin';
iframe.onload = function(){ pageLoaded(); }
dial.capture += 1;
if(dial.capture == 1){
dial.skipUpdate = true;
browser.webRequest.onHeadersReceived.addListener(headersReceived, { urls:['*://*/*'], types:['sub_frame'] }, ['blocking', 'responseHeaders']);
browser.tabs.update(tab.id, {muted: true}).then();
}
iframe.src = selectedItem.Node.url;
selectedItem.children[0].appendChild(iframe);
//setTimeout(function(){ pageLoaded(); }, 6000);
});
}
dial.capturePage = function(selectedItem){
selectedItem.className = 'BookmarkLoading';
selectedItem.childNodes[0].style.backgroundImage = app.settings.grid.loadingIcon;
@ -434,7 +737,7 @@ dial.PopupPanel = function(width, height, modal){ // PopupPanel Object
}
dial.editSettings = function(){
var popup = new dial.PopupPanel(500, 420, true);
var popup = new dial.PopupPanel(500, 440, true);
var iframe = document.createElement('iframe');
iframe.style.width = '100%';
iframe.style.height = '100%';
@ -446,4 +749,21 @@ dial.editSettings = function(){
iframe.src = '/html/settings.html';
iframe.popup = popup;
popup.popup();
iframe.focus();
}
dial.editProperties = function(selectedItem){
var popup = new dial.PopupPanel(500, 420, true);
var iframe = document.createElement('iframe');
iframe.style.width = '100%';
iframe.style.height = '100%';
iframe.style.backgroundColor = 'transparent';
iframe.style.border = '0px none transparent';
iframe.style.padding = '0px';
iframe.style.overflow = 'hidden';
popup.frame.appendChild(iframe);
iframe.src = '/html/properties.html?id=' + selectedItem.Node.id;
iframe.popup = popup;
popup.popup();
iframe.focus();
}

165
src/js/properties.js Normal file
View File

@ -0,0 +1,165 @@
var app = {};
var Image = null;
document.addEventListener("DOMContentLoaded", function(event) {
app.init();
});
app.init = function(){
document.addEventListener('keyup', function(e){
switch(e.key){
case 'Escape':
window.frameElement.popup.close();
break;
}
});
app.Messages.getSettings(function(settings){
app.settings = settings;
app.Messages.getNodeByID(new URL(window.location).searchParams.get('id'), function(node){
app.node = node;
Title.value = node.title;
if(node.imageMode == 0) ImageMode.value = 0;
else if(node.imageMode) ImageMode.value = node.imageMode;
ImagePreview.style.backgroundRepeat = 'no-repeat';
ImagePreview.style.backgroundSize = '100% 100%';
switch(node.type){
case app.GridNodes.GridNodeType.folder:
TitleLocked.parentNode.style.display = 'none';
ImageLocked.parentNode.style.display = 'none';
Url.parentNode.parentNode.style.display = 'none';
if(node.image){
if(node.image.indexOf('url(')>=0) Image = node.image;
else Image = 'url(' + node.image + ')';
} else Image = null;
if(Image==null) ImagePreview.style.backgroundImage = app.settings.grid.folderIcon;
else ImagePreview.style.backgroundImage = Image;
break;
case app.GridNodes.GridNodeType.bookmark:
TitleLocked.checked = (node.titleLocked==true);
ImageLocked.checked = (node.imageLocked==true);
ImageDefault.style.display = 'none';
Url.value = node.url;
if(node.image.indexOf('url(')>=0) Image = node.image;
else Image = 'url(' + node.image + ')';
ImagePreview.style.backgroundImage = Image;
break;
}
ImageReset.onclick = function(){
switch(node.type){
case app.GridNodes.GridNodeType.folder:
if(node.image){
Image = node.image;
ImagePreview.style.backgroundImage = 'url(' + Image + ')';
} else {
Image = null;
ImagePreview.style.backgroundImage = app.settings.grid.folderIcon;
}
break;
case app.GridNodes.GridNodeType.bookmark:
Image = node.image;
ImagePreview.style.backgroundImage = 'url(' + Image + ')';
break;
}
};
ImageDefault.onclick = function(){
switch(node.type){
case app.GridNodes.GridNodeType.folder:
Image = null;
ImagePreview.style.backgroundImage = app.settings.grid.folderIcon;
break;
case app.GridNodes.GridNodeType.bookmark:
break;
}
};
ImageFile.onclick = function(){
this.value = null;
}
ImageFile.onchange = function(){
var fileReader = new FileReader();
fileReader.onload = function(e){
Image = e.target.result;
ImageFile.value = null;
ImagePreview.style.backgroundImage = 'url(' + Image + ')';
}
fileReader.readAsDataURL(ImageFile.files[0]);
}
});
});
BtnOk.onclick = function(){
BtnApply.onclick();
window.frameElement.popup.close();
}
BtnApply.onclick = function(){
switch(app.node.type){
case app.GridNodes.GridNodeType.folder:
app.Messages.updateNode(app.node.id, { title: Title.value, image: Image, imageMode: +(ImageMode.value) })
break;
case app.GridNodes.GridNodeType.bookmark:
app.Messages.updateNode(app.node.id, { title: Title.value, titleLocked: TitleLocked.checked, imageLocked: ImageLocked.checked, url: Url.value, image: Image, imageMode: +(ImageMode.value) })
break;
}
}
BtnCancel.onclick = function(){
window.frameElement.popup.close();
}
var tabButtons = Tabs.children[0].children[0].children[0];
for(var i=0; i<tabButtons.children.length-1; i++){
tabButtons.children[i].index = i;
tabButtons.children[i].onclick = function(){
for(var j=0; j<tabButtons.children.length-1; j++){
if(j==this.index){
tabButtons.children[j].className = 'TabButtonActive';
Tabs.children[1].children[j].className = '';
} else {
tabButtons.children[j].className = 'TabButton';
Tabs.children[1].children[j].className = 'hidden';
}
}
}
}
};
app.Messages = {};
app.Messages.Commands = {
getSettings: 0,
setSettings: 1,
getNode: 2,
getNodeByID: 3,
updateNode: 4,
setNodeIndex: 5,
createBookmark: 6,
createFolder: 7,
deleteNode: 8,
refreshNode: 9,
capturePage: 10,
settingsChanged: 100,
gridNodesLoaded: 101
};
app.Messages.getSettings = function(callback){
browser.runtime.sendMessage({ cmd: app.Messages.Commands.getSettings }).then(callback);
};
app.Messages.getNodeByID = function(id, callback){
browser.runtime.sendMessage({ cmd: app.Messages.Commands.getNodeByID, id: id }).then(callback);
};
app.Messages.updateNode = function(id, value, callback){
browser.runtime.sendMessage({ cmd: app.Messages.Commands.updateNode, id: id, value: value }).then(callback);
};
app.GridNodes = {};
app.GridNodes.GridNodeType = { // GridNodeType
back: -1,
empty: 0,
folder: 1,
bookmark: 2
}

View File

@ -4,29 +4,56 @@ var BackgroundImage = null;
var GridBackImage = null;
var GridFolderImage = null;
document.addEventListener("DOMContentLoaded", function(event) {
app.init();
});
app.init = function(){
document.addEventListener('keyup', function(e){
switch(e.key){
case 'Escape':
window.frameElement.popup.close();
break;
}
});
app.Messages.getSettings(function(settings){
app.settings = settings;
MenuShowAdd.checked = app.settings.menuShowAdd;
BackgroundColor.value = app.settings.backgroundColor;
BackgroundImage = app.settings.backgroundImage;
BackgroundMode.value = app.settings.backgroundMode;
BackgroundPreview.style.backgroundColor = app.settings.backgroundColor;
BackgroundPreview.style.backgroundImage = app.settings.backgroundImage;
BackgroundPreview.style.backgroundRepeat = 'no-repeat';
BackgroundPreview.style.backgroundSize = '100% 100%';
ButtonOpenInNewPage.checked = app.settings.openQuickDialInNewPage;
StartupTimeout.value = app.settings.startpageTimeout;
GridRoot.value = app.settings.grid.root;
GridRows.value = app.settings.grid.rows;
GridRatioX.value = app.settings.grid.ratioX;
GridRatioY.value = app.settings.grid.ratioY;
GridMargins.value = app.settings.grid.margin;
GridColumns.value = app.settings.grid.columns;
GridOpenBookmarksIn.value = app.settings.grid.openBookmarkMethod;
GridOpenFoldersIn.value = app.settings.grid.openFolderMethod;
GridBackNode.checked = app.settings.grid.backNode;
GridBackMode.value = app.settings.grid.backIconMode;
GridBackImage = app.settings.grid.backIcon;
GridBackPreview.style.backgroundImage = app.settings.grid.backIcon;
GridBackPreview.style.backgroundRepeat = 'no-repeat';
GridBackPreview.style.backgroundPosition = '50% 50%';
GridFolderMode.value = app.settings.grid.folderIconMode;
GridFolderImage = app.settings.grid.folderIcon;
GridFolderPreview.style.backgroundImage = app.settings.grid.folderIcon;
GridFolderPreview.style.backgroundRepeat = 'no-repeat';
GridFolderPreview.style.backgroundSize = '100% 100%';
GridCellsMargins.value = app.settings.grid.cells.margin;
GridCellsMarginsHover.value = app.settings.grid.cells.marginHover;
GridCellsOpacity.value = app.settings.grid.cells.opacity * 100;
GridCellsOpacityHover.value = app.settings.grid.cells.opacityHover * 100;
GridCellsBorderSize.value = app.settings.grid.cells.borderSize;
GridCellsBorderSizeHover.value = app.settings.grid.cells.borderSizeHover;
GridCellsBackgroundTransparent.checked = (app.settings.grid.cells.backgroundColor == null);
GridCellsBackgroundColor.value = app.settings.grid.cells.backgroundColor;
GridCellsBackgroundTransparentHover.checked = (app.settings.grid.cells.backgroundColorHover == null);
@ -36,14 +63,20 @@ app.init = function(){
GridCellsBorderColor.value = app.settings.grid.cells.borderColor;
GridCellsBorderColorHover.value = app.settings.grid.cells.borderColorHover;
GridCellsTitle.checked = app.settings.grid.cells.title;
GridCellsTitleHover.checked = app.settings.grid.cells.titleHover;
GridCellsTitleHeight.value = app.settings.grid.cells.titleHeight;
GridCellsTitleHeightHover.value = app.settings.grid.cells.titleHeightHover;
GridCellsTitleFontSize.value = app.settings.grid.cells.titleFontSize;
GridCellsTitleFontSizeHover.value = app.settings.grid.cells.titleFontSizeHover;
GridCellsTitleBorderSize.value = app.settings.grid.cells.titleBorderSize;
GridCellsTitleBorderSizeHover.value = app.settings.grid.cells.titleBorderSizeHover;
GridCellsTitleColor.value = app.settings.grid.cells.titleColor;
GridCellsTitleColorHover.value = app.settings.grid.cells.titleColorHover;
GridCellsTitleBackgroundTransparent.checked = (app.settings.grid.cells.titleBackgroundColor == null);
GridCellsTitleBackgroundColor.value = app.settings.grid.cells.titleBackgroundColor;
GridCellsTitleBackgroundColorHover.value = app.settings.grid.cells.titleBackgroundColorHover;
GridCellsTitleBackgroundTransparentHover.checked = (app.settings.grid.cells.titleBackgroundColorHover == null);
GridCellsSnapshotDelay.value = app.settings.grid.cells.snapshotDelay;
});
BtnOk.onclick = function(){
@ -51,17 +84,30 @@ app.init = function(){
window.frameElement.popup.close();
}
BtnApply.onclick = function(){
app.settings.menuShowAdd = MenuShowAdd.checked;
app.settings.backgroundColor = BackgroundColor.value;
app.settings.backgroundImage = BackgroundImage;
app.settings.backgroundMode = +(BackgroundMode.value);
app.settings.openQuickDialInNewPage = ButtonOpenInNewPage.checked;
app.settings.startpageTimeout = StartupTimeout.value;
app.settings.grid.rows = +(GridRows.value);
app.settings.grid.margin = +(GridMargins.value);
app.settings.grid.columns = +(GridColumns.value);
app.settings.grid.ratioX = GridRatioX.value;
app.settings.grid.ratioY = GridRatioY.value;
app.settings.grid.openBookmarkMethod = +(GridOpenBookmarksIn.value);
app.settings.grid.openFolderMethod = +(GridOpenFoldersIn.value);
app.settings.grid.backNode = GridBackNode.checked;
app.settings.grid.backIconMode = +(GridBackMode.value);
app.settings.grid.backIcon = GridBackImage;
app.settings.grid.folderIconMode = +(GridFolderMode.value);
app.settings.grid.folderIcon = GridFolderImage;
app.settings.grid.cells.margin = +(GridCellsMargins.value);
//app.settings.grid.cells.marginHover = +(GridCellsMarginsHover.value);
app.settings.grid.cells.marginHover = +(GridCellsMargins.value);
app.settings.grid.cells.marginHover = +(GridCellsMarginsHover.value);
app.settings.grid.cells.opacity = +(GridCellsOpacity.value) / 100;
app.settings.grid.cells.opacityHover = +(GridCellsOpacityHover.value) / 100;
app.settings.grid.cells.borderSize = +(GridCellsBorderSize.value);
app.settings.grid.cells.borderSizeHover = +(GridCellsBorderSizeHover.value);
if(GridCellsBackgroundTransparent.checked == true) app.settings.grid.cells.backgroundColor = null;
else app.settings.grid.cells.backgroundColor = GridCellsBackgroundColor.value;
if(GridCellsBackgroundTransparentHover.checked == true) app.settings.grid.cells.backgroundColorHover = null;
@ -71,15 +117,22 @@ app.init = function(){
app.settings.grid.cells.borderColor = GridCellsBorderColor.value;
app.settings.grid.cells.borderColorHover = GridCellsBorderColorHover.value;
app.settings.grid.cells.title = GridCellsTitle.checked;
app.settings.grid.cells.titleHover = GridCellsTitleHover.checked;
app.settings.grid.cells.titleHeight = GridCellsTitleHeight.value;
app.settings.grid.cells.titleHeightHover = GridCellsTitleHeightHover.value;
app.settings.grid.cells.titleFontSize = GridCellsTitleFontSize.value;
app.settings.grid.cells.titleFontSizeHover = GridCellsTitleFontSizeHover.value;
app.settings.grid.cells.titleBorderSize = GridCellsTitleBorderSize.value;
app.settings.grid.cells.titleBorderSizeHover = GridCellsTitleBorderSizeHover.value;
app.settings.grid.cells.titleColor = GridCellsTitleColor.value;
app.settings.grid.cells.titleColorHover = GridCellsTitleColorHover.value;
if(GridCellsTitleBackgroundTransparent.checked == true) app.settings.grid.cells.titleBackgroundColor = null;
else app.settings.grid.cells.titleBackgroundColor = GridCellsTitleBackgroundColor.value;
if(GridCellsTitleBackgroundTransparentHover.checked == true) app.settings.grid.cells.titleBackgroundColorHover = null;
else app.settings.grid.cells.titleBackgroundColorHover = GridCellsTitleBackgroundColorHover.value;
browser.runtime.sendMessage( { cmd: 'SetSettings', settings: app.settings } );
app.settings.grid.cells.snapshotDelay = GridCellsSnapshotDelay.value;
app.settings.grid.root = GridRoot.value;
browser.runtime.sendMessage( { cmd: app.Messages.Commands.setSettings, settings: app.settings } );
}
BtnCancel.onclick = function(){
window.frameElement.popup.close();
@ -121,6 +174,19 @@ app.init = function(){
fileReader.readAsDataURL(BackgroundImageFile.files[0]);
}
GridRows.onchange = function(){
if(GridRatioAuto.checked){
GridRatioX.value = GridColumns.value;
GridRatioY.value = GridRows.value;
}
}
GridColumns.onchange = function(){
if(GridRatioAuto.checked){
GridRatioX.value = GridColumns.value;
GridRatioY.value = GridRows.value;
}
}
GridBackImageReset.onclick = function(){
GridBackImage = 'url(/img/back.png)';
GridBackPreview.style.backgroundImage = GridBackImage;
@ -157,14 +223,25 @@ app.init = function(){
};
app.Messages = {};
app.Messages.Commands = {
getSettings: 0,
setSettings: 1,
getNode: 2,
getNodeByID: 3,
updateNode: 4,
setNodeIndex: 5,
createBookmark: 6,
createFolder: 7,
deleteNode: 8,
refreshNode: 9,
capturePage: 10,
settingsChanged: 100,
gridNodesLoaded: 101
};
app.Messages.getSettings = function(callback){
browser.runtime.sendMessage({ cmd: 'GetSettings' }).then(callback);
browser.runtime.sendMessage({ cmd: app.Messages.Commands.getSettings }).then(callback);
};
window.onload = function(){
app.init();
};

View File

@ -2,14 +2,13 @@
"manifest_version": 2,
"name": "Quick Dial",
"version": "0.1.0",
"version": "0.1.20",
"author": "MatMoul",
"homepage_url": "https://github.com/MatMoul/quickdial-webext",
"developer": {
"name": "MatMoul",
"url": "https://github.com/MatMoul/quickdial-webext"
},
"description": "__MSG_extensionDescription__",
"icons": {
"24": "img/24.png",
@ -21,6 +20,8 @@
"bookmarks",
"contextMenus",
"tabs",
"webRequest",
"webRequestBlocking",
"<all_urls>"
],
@ -28,6 +29,13 @@
"scripts": ["js/background.js"]
},
"browser_action": {
"default_icon": {
"24": "img/24.png",
"32": "img/32.png"
}
},
"chrome_url_overrides" : {
"newtab": "dial"
},
@ -35,7 +43,7 @@
"applications": {
"gecko": {
"id": "quickdial@matmoul.com",
"strict_min_version": "52.0"
"strict_min_version": "70.0"
}
},