mirror of
https://github.com/MatMoul/quickdial-webext.git
synced 2025-12-16 17:03:12 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 09e279e892 | |||
| 15310d57af | |||
| b458d78fd0 | |||
| 1431c5edfe | |||
| f13b16d94b | |||
| 5f6d1df70d | |||
| f1036e3a46 |
48
makerelease
Executable file
48
makerelease
Executable file
@@ -0,0 +1,48 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ "$1" == "" ]; then
|
||||||
|
echo "Error: No version provided"
|
||||||
|
echo "./makerelease 0.0.1"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
ssh -T git@github.com
|
||||||
|
if [ ! "$?" = "1" ]; then
|
||||||
|
echo "No Github ssh key loaded exiting..."
|
||||||
|
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 release...";;
|
||||||
|
* )
|
||||||
|
echo "Cancel !"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Ready to update :
|
||||||
|
|
||||||
|
version=$1
|
||||||
|
|
||||||
|
sed -i "/\"version\":/c\ \ \"version\": \"$version\"," src/manifest.json
|
||||||
|
|
||||||
|
git commit -a -m "Version $version"
|
||||||
|
git push
|
||||||
|
|
||||||
|
git checkout master
|
||||||
|
git merge develop
|
||||||
|
git push
|
||||||
|
|
||||||
|
git tag -a "v$version" -m "Version $version"
|
||||||
|
git push --tags
|
||||||
|
|
||||||
|
git checkout $branch
|
||||||
BIN
screenshots/contextmenu.png
Normal file
BIN
screenshots/contextmenu.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 296 KiB |
BIN
screenshots/page.png
Normal file
BIN
screenshots/page.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 187 KiB |
BIN
screenshots/page_with_bg.png
Normal file
BIN
screenshots/page_with_bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 335 KiB |
BIN
screenshots/settings_cells.png
Normal file
BIN
screenshots/settings_cells.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 203 KiB |
BIN
screenshots/settings_grid.png
Normal file
BIN
screenshots/settings_grid.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 197 KiB |
BIN
screenshots/settings_page.png
Normal file
BIN
screenshots/settings_page.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 232 KiB |
@@ -125,7 +125,7 @@ core.SiteInfos.fromTab = function(callback){ // Retrieve infos from current tab.
|
|||||||
setTimeout(whaitLoaded, 300);
|
setTimeout(whaitLoaded, 300);
|
||||||
}, function(){ if(callback) callback(); });
|
}, function(){ if(callback) callback(); });
|
||||||
}
|
}
|
||||||
core.SiteInfos.fromNewTab = function(url, callback){ // Retrieve infos from a new tab. callback( { url, title, icon, screenshot } || error: callback() )
|
core.SiteInfos.fromNewTab1 = function(url, callback){ // Retrieve infos from a new tab. callback( { url, title, icon, screenshot } || error: callback() )
|
||||||
browser.tabs.create({url: url, active: false}).then(function(tab){
|
browser.tabs.create({url: url, active: false}).then(function(tab){
|
||||||
browser.tabs.update(tab.id, {muted: true}).then();
|
browser.tabs.update(tab.id, {muted: true}).then();
|
||||||
function whaitLoaded(){
|
function whaitLoaded(){
|
||||||
@@ -133,9 +133,32 @@ core.SiteInfos.fromNewTab = function(url, callback){ // Retrieve infos from a n
|
|||||||
if(tab.status == 'loading') setTimeout(whaitLoaded, 300);
|
if(tab.status == 'loading') setTimeout(whaitLoaded, 300);
|
||||||
else {
|
else {
|
||||||
browser.tabs.update(tab.id, {active: true}).then(function(){
|
browser.tabs.update(tab.id, {active: true}).then(function(){
|
||||||
|
console.log('Hello');
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
browser.tabs.captureVisibleTab().then(function(img){
|
browser.tabs.captureVisibleTab().then(function(img){
|
||||||
browser.tabs.remove(tab.id);
|
browser.tabs.remove(tab.id);
|
||||||
|
|
||||||
|
var previewWidth = 1200; // Need to be linked to settings
|
||||||
|
var previewHeight = 710; // Need to be linked to settings
|
||||||
|
var imgObj = new Image;
|
||||||
|
imgObj.src = img;
|
||||||
|
|
||||||
|
var canvas = document.createElement('canvas');
|
||||||
|
canvas.style.width = previewWidth.toString() + 'px';
|
||||||
|
canvas.style.height = previewHeight.toString() + 'px';
|
||||||
|
canvas.width = previewWidth / 2;
|
||||||
|
canvas.height = previewHeight / 2;
|
||||||
|
var ctx = canvas.getContext('2d');
|
||||||
|
ctx.clearRect(0, 0, previewWidth, previewHeight);
|
||||||
|
ctx.save();
|
||||||
|
ctx.scale(0.5, 0.5);
|
||||||
|
//ctx.drawImage(img, 0, 0, previewWidth, previewHeight, 'rgb(255, 255, 255)');
|
||||||
|
console.log(img);
|
||||||
|
ctx.drawImage(imgObj, 0, 0, 0, 0, 'rgb(255, 255, 255)');
|
||||||
|
ctx.restore();
|
||||||
|
img = canvas.toDataURL();
|
||||||
|
|
||||||
|
|
||||||
if(callback) callback( { url: tab.url, title: tab.title, icon: tab.favIconUrl, screenshot: img } );
|
if(callback) callback( { url: tab.url, title: tab.title, icon: tab.favIconUrl, screenshot: img } );
|
||||||
}, function(){
|
}, function(){
|
||||||
browser.tabs.remove(tab.id);
|
browser.tabs.remove(tab.id);
|
||||||
|
|||||||
@@ -196,7 +196,10 @@ dial.initGrid = function(name, settings, container){
|
|||||||
link.onmousedown = function(){ dial._selectedItem = this; };
|
link.onmousedown = function(){ dial._selectedItem = this; };
|
||||||
|
|
||||||
function dragstart_handler(ev) {
|
function dragstart_handler(ev) {
|
||||||
ev.dataTransfer.setData("text/plain", ev.target.parentElement.getAttribute('gridindex'));
|
var index = (dial.page - 1) * (app.settings.grid.rows * app.settings.grid.columns) + +(ev.target.parentElement.getAttribute('gridindex'));
|
||||||
|
if(settings.cells.backPanel && dial.path) index -= dial.page;
|
||||||
|
console.log(index);
|
||||||
|
ev.dataTransfer.setData("text/plain", index);
|
||||||
}
|
}
|
||||||
function dragover_handler(ev) {
|
function dragover_handler(ev) {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
@@ -208,14 +211,11 @@ dial.initGrid = function(name, settings, container){
|
|||||||
var StartIndex = ev.dataTransfer.getData("text");
|
var StartIndex = ev.dataTransfer.getData("text");
|
||||||
var EndIndex = 0;
|
var EndIndex = 0;
|
||||||
if(ev.target.tagName == 'DIV'){
|
if(ev.target.tagName == 'DIV'){
|
||||||
EndIndex = ev.target.parentElement.parentElement.getAttribute('gridindex')
|
EndIndex = (dial.page - 1) * (app.settings.grid.rows * app.settings.grid.columns) + +(ev.target.parentElement.parentElement.getAttribute('gridindex'));
|
||||||
} else{
|
} else{
|
||||||
EndIndex = ev.target.getAttribute('gridindex');
|
EndIndex =(dial.page - 1) * (app.settings.grid.rows * app.settings.grid.columns) + +(ev.target.getAttribute('gridindex'));
|
||||||
}
|
|
||||||
if(settings.cells.backPanel && dial.path){
|
|
||||||
StartIndex-=1;
|
|
||||||
EndIndex-=1;
|
|
||||||
}
|
}
|
||||||
|
if(settings.cells.backPanel && dial.path) EndIndex -= dial.page;
|
||||||
app.setNodeIndex(dial.Node, StartIndex, EndIndex);
|
app.setNodeIndex(dial.Node, StartIndex, EndIndex);
|
||||||
}
|
}
|
||||||
link.draggable = true;
|
link.draggable = true;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "Quick Dial",
|
"name": "Quick Dial",
|
||||||
"version": "0.0.1",
|
"version": "0.0.2",
|
||||||
"author": "MatMoul",
|
"author": "MatMoul",
|
||||||
"homepage_url": "https://github.com/MatMoul/quickdial-webext",
|
"homepage_url": "https://github.com/MatMoul/quickdial-webext",
|
||||||
"developer": {
|
"developer": {
|
||||||
|
|||||||
Reference in New Issue
Block a user