mirror of
https://github.com/MatMoul/quickdial-webext.git
synced 2025-12-15 16:33:13 +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);
|
||||
}, 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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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": {
|
||||
|
||||
Reference in New Issue
Block a user