If each tab contained a single JScript Panel it would be easy enough. You could replace the tabs with a single panel and add this code...
// ==PREPROCESSOR==
// @author "marc2003"
// @name "Panel Receiver"
// ==/PREPROCESSOR==
var script = window.GetProperty('2K3.SCRIPT', 'user-components-x64\\foo_jscript_panel3\\samples\\JS Playlist.txt');
var pre = '';
var text = utils.ReadUTF8(fb.ProfilePath + script);
var lines = text.split('\r\n');
if (lines[0].indexOf('// ==PREPROCESSOR==') == 0) {
for (var i = 0; i < lines.length; i++) {
if (lines[i].indexOf('// @import') == 0) {
var fq = lines[i].indexOf('"') + 1;
var lq = lines[i].lastIndexOf('"') - fq;
var file = lines[i].substr(fq, lq).replace('%fb2k_profile_path%', fb.ProfilePath).replace('%fb2k_component_path%', fb.ComponentPath);
pre += utils.ReadUTF8(file) + '\n';
} else if (lines[i].indexOf('// ==/PREPROCESSOR==') == 0) {
break;
}
}
}
eval(pre + text);
(function (global) {
var original_callback = global.on_notify_data;
global.on_notify_data = function (name, info) {
if (name == 'load_script') {
window.SetProperty('2K3.SCRIPT', info);
window.Reload();
} else if (original_callback) {
original_callback(name, info);
}
}
})(this);
Now you need a secondary panel which contains a button/menu that would send notifications to this panel whenever it was clicked. You should just need to supply the full script path something like this...
// must be relative to fb.ProfilePath - do not make it absolute
window.NotifyOthers('load_script', 'user-components-x64\\foo_jscript_panel3\\samples\\smooth browser.txt');
edit: of course any current "state" would be lost each time new content is loaded.
Is it possible to do the same without a second panel and putting the button in the same panel ?
That's what are doing audio player in android ? The button is on the same panel .
Thanks marc2k3