Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master 10dec #2059

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions src/background/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,20 @@ function start(browser) {
chrome.tabs.move(tab.id, {windowId, index: -1});
});
};

self.sortTabs = function(message, sender, sendResponse) {
const windowId = sender.tab.windowId;
var i=1;
console.log("Sorting tab")
message.tabs.forEach(function(tab) {
console.log("Sorting tab : " + i + " " + tab.url);
i=i+1
chrome.tabs.move(tab.id, {windowId, index: -1});
// RUNTIME('moveTab', { position: 1 });

});
};

self.getBookmarkFolders = function(message, sender, sendResponse) {
chrome.bookmarks.getTree(function(tree) {
bookmarkFolders = [];
Expand Down Expand Up @@ -1622,6 +1636,58 @@ function start(browser) {
chrome.tts.stop();
};

self.manageWindow = function(message, sender, sendResponse) {
console.log("hello");
var tabId;
// chrome.windows.getAll({
// populate: false
// }, function(windows) {
// windows.forEach(function(w) {
// console.log(w.id);
// });
// });

var wid;
// chrome.storage.local.set({ key: value }).then(() => {
// console.log("Value is set");
// });



if (message.bookmark)
{
// console.log("bookmarking current window: " + wid);
// return wid;
chrome.windows.getCurrent({
populate: false
}, function(w) {
console.log("getting current window: " + w.id);
// return w.id
// chrome.tabs.getCurrent(function (tab) {
// console.log(tab.id);
// tabId = tab.id;
// _response(message, sendResponse, {
// tabs: w.id,
// tabId: tab.id
// });
// });
_response(message, sendResponse, {
tabs: w.id
});

});
return
}
else {
console.log("opening bookmarked window: " + message.wid);
chrome.windows.update(message.wid, {
focused: true
});
console.log("opened bookmarked window: " + message.wid);
}
};


self.openIncognito = function(message, sender, sendResponse) {
chrome.windows.create({"url": message.url, "incognito": true});
};
Expand Down
9 changes: 9 additions & 0 deletions src/content_scripts/common/normal.js
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,15 @@ function createNormal(insert) {
}
});

self.mappings.add("q", {
annotation: "Find in current page cibin",
feature_group: 9,
repeatIgnore: true,
code: function() {
dispatchSKEvent('openFinderCibin');
}
});

self.mappings.add("E", {
annotation: "Go one tab left",
feature_group: 3,
Expand Down
28 changes: 26 additions & 2 deletions src/content_scripts/ui/frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,9 +461,20 @@ const Front = (function() {
setSanitizedContent(_omnibar.querySelector('style'), `#sk_omnibar {${style}}`);
};
self.openOmnibar = _actions['openOmnibar'];
_actions['openFinder'] = function() {

_actions['openFinder'] = function(arg) {
console.log("cibin.w4asdf")
Find.open();
};

_actions['openFinderCibin'] = function(arg) {
console.log("cibin.w4")
Find.openq("the");
};
document.addEventListener("surfingkeys:openFinderCibin", function(evt) {
Find.openq("the");
});

document.addEventListener("surfingkeys:openFinder", function(evt) {
Find.open();
});
Expand Down Expand Up @@ -775,7 +786,20 @@ var Find = (function() {
*
* @return {undefined}
*/
self.open = function() {
self.openq=function(arg) {
var query='the'
console.log("cibin find.open: ");
reset();
Front.visualCommand({
action: 'visualEnter',
query: query
});
runtime.updateHistory('find', query);
}

self.open = function(arg) {
console.log("arg: ");
console.log(arg);
historyInc = -1;
StatusBar.show(1, '<input id="sk_find" class="sk_theme"/>');
input = Front.statusBar.querySelector("input");
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"manifest_version": 2,
"name": "Surfingkeys",
"name": "Surfingkeys-Cibin",
"short_name": "Rich shortcuts in vim spirit for productivity with keyboard.",
"description": "Rich shortcuts to click links/switch tabs/scroll, capture pages, use your browser like vim for productivity.",
"icons": {
Expand Down
Loading