Skip to content
Open
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
22 changes: 22 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,27 @@ $(document).ready(function(){
else if((idx = (txt.toLowerCase()).indexOf("arrange heading".toLowerCase())) !==-1)
{
Speech("Arranging the headings of the tab");

// Code to arrange tabs alphabetically
// MEDIUM: 3
var move = function(tabs){
tabs.sort(function(a,b){
if(a.title<b.title)
return -1;
else if(a.title.toLowerCase()===b.title.toLowerCase())
return 0;
else
return 1;
});
for ( var i = 0 ; i < tabs.length ; i++ )
{
var moveProperties = {index : i};
chrome.tabs.move(tabs[i].id,moveProperties);
}
}
chrome.tabs.query({ currentWindow: true}, move);

=======
chrome.tabs.query({},function(tabs){
tabs.sort(function(a,b){
if(a.title<b.title) return -1;
Expand All @@ -577,6 +598,7 @@ $(document).ready(function(){
for(var i=0 ;i< tabs.length;i++)
chrome.tabs.move(tabs[i].id, {index: i});
});

}
else if((idx = (txt.toLowerCase()).indexOf("group content".toLowerCase())) !==-1)
{
Expand Down