From 855a52c8389508abeb61e6bda537844489f12d1e Mon Sep 17 00:00:00 2001 From: eri451 <hans.orter@gmx.de> Date: Sun, 1 Apr 2012 22:59:22 +0200 Subject: [PATCH] no more _groups --- penta-sessions.js | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/penta-sessions.js b/penta-sessions.js index 978c733..1c8977c 100644 --- a/penta-sessions.js +++ b/penta-sessions.js @@ -94,22 +94,30 @@ group.commands.add(['sessions[ave]','mkses[sion]'], cmds = array.flatten(cmds); lines = lines.concat(cmds); } - + if (/tabs/.test(sesop)) { - tabs._groups.GroupItems.groupItems.forEach( function (group, k) { - lines.push('js let newGroup = tabs._groups.GroupItems.newGroup()'); - if (!(group.getTitle() === "")) - lines.push('js newGroup.setTitle('+group.getTitle()+')'); - lines.push('js tabs._groups.GroupItems.setActiveGroupItem(newGroup)'); + tabs.getGroups( function ({ GroupItems }) { + GroupItems.groupItems.forEach( function (group, k) { + + lines.push('js <<EOF'); + lines.push('tabs.getGroups(function ({ GroupItems }) {'); + lines.push('\tlet newGroup = GroupItems.newGroup();'); + if (!(group.getTitle() === "")) + lines.push('\tnewGroup.setTitle('+group.getTitle()+');'); + lines.push('\tGroupItems.setActiveGroupItem(newGroup);'); - group._children.forEach(function (tab, i) { - let loc = tab.tab.linkedBrowser.contentDocument.location.href; - if (/^dactyl:\/\/help\//.test(loc) && !/help/.test(sesop)) - return; - if (loc == 'about:blank' && !/blank/.test(sesop)) - return; - lines.push('tabopen '+loc); - }); + let children = group.getChildren(); + children.forEach(function (tab, i) { + let loc = tab.tab.linkedBrowser.contentDocument.location.href; + if (/^dactyl:\/\/help\//.test(loc) && !/help/.test(sesop)) + return; + if (loc == 'about:blank' && !/blank/.test(sesop)) + return; + lines.push('\tex.tabopen(\''+loc+'\');'); + }); + lines.push('});'); + lines.push('EOF'); + }); }); } -- GitLab