1
0
mirror of https://github.com/MatMoul/quickdial-webext.git synced 2025-12-15 16:33:13 +00:00

7 Commits

Author SHA1 Message Date
09e279e892 Merge branch 'develop' 2017-10-05 22:07:38 +02:00
15310d57af Version 0.0.2 2017-10-05 22:07:35 +02:00
b458d78fd0 update makerelease 2017-10-05 22:06:35 +02:00
1431c5edfe Bug: drag-drop on second and next page 2017-10-05 22:06:09 +02:00
f13b16d94b Version 0.0.2 2017-10-05 21:42:59 +02:00
5f6d1df70d Add makerelease script 2017-10-05 17:02:32 +02:00
f1036e3a46 Add screenshots 2017-10-04 02:52:16 +02:00
10 changed files with 80 additions and 9 deletions

48
makerelease Executable file
View 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 KiB

BIN
screenshots/page.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

View File

@@ -125,7 +125,7 @@ core.SiteInfos.fromTab = function(callback){ // Retrieve infos from current tab.
setTimeout(whaitLoaded, 300);
}, 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.update(tab.id, {muted: true}).then();
function whaitLoaded(){
@@ -133,9 +133,32 @@ core.SiteInfos.fromNewTab = function(url, callback){ // Retrieve infos from a n
if(tab.status == 'loading') setTimeout(whaitLoaded, 300);
else {
browser.tabs.update(tab.id, {active: true}).then(function(){
console.log('Hello');
setTimeout(function(){
browser.tabs.captureVisibleTab().then(function(img){
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 } );
}, function(){
browser.tabs.remove(tab.id);

View File

@@ -196,7 +196,10 @@ dial.initGrid = function(name, settings, container){
link.onmousedown = function(){ dial._selectedItem = this; };
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) {
ev.preventDefault();
@@ -208,14 +211,11 @@ dial.initGrid = function(name, settings, container){
var StartIndex = ev.dataTransfer.getData("text");
var EndIndex = 0;
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{
EndIndex = ev.target.getAttribute('gridindex');
}
if(settings.cells.backPanel && dial.path){
StartIndex-=1;
EndIndex-=1;
EndIndex =(dial.page - 1) * (app.settings.grid.rows * app.settings.grid.columns) + +(ev.target.getAttribute('gridindex'));
}
if(settings.cells.backPanel && dial.path) EndIndex -= dial.page;
app.setNodeIndex(dial.Node, StartIndex, EndIndex);
}
link.draggable = true;

View File

@@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "Quick Dial",
"version": "0.0.1",
"version": "0.0.2",
"author": "MatMoul",
"homepage_url": "https://github.com/MatMoul/quickdial-webext",
"developer": {