Very strange. I was in the midst of editing a new command when, after
making a particular change, Ubiquity's command window refused to pop
up with the usual alt-spacebar key combo. I restarted Firefox and it
still wouldn't appear. I switched to another tab, and the command
window came up fine. After some playing, I found out that it was the
Firebug window being open that was causing the situation... but I've
used Firebug to debug my Ubiquity commands before, so I know this is
not expected behavior.
Why would creating the following command cause Firebug, forever after,
to prevent the Ubiquity command window from working? I'm using FF
3.5.2 and Ubiquity 0.5.4.
CmdUtils.CreateCommand({
name: "read-it-fast",
author: {name: "Duane Johnson", email: "[email protected]"},
license: "GPL",
description: "Opens a speed-reading window above the currently
selected text.",
help: "Select some text, and then use the speed-read command to
start reading it.",
takes: {"input": /.*/},
preview: function(pblock, input) {
var t = input.text.substring(0, 20);
pblock.innerHTML = "Read <b>" + t + "</b>";
},
execute: function(input) {
// var body = CmdUtils.getDocument().body;
var make_popup = function($, timer_handle) {
var popup = $('<div id="rif-popup" style="position:fixed; left:
20%; top: 40px; width: 60%; height: 400px; border: 2px solid red;
background-color: white; -moz-corner-radius: 5px"></div>');
$(popup).append('<div style="text-align: right"><button id="rif-
close">Close</button></div>')
$(popup).append('<div id="rif-l1" style="margin: 75px auto 5px
auto; text-align: center; font-size: 45px; height: 45px;"></div>');
$(popup).append('<div id="rif-l2" style="margin: 5px auto; text-
align: center; font-size: 35px; height: 35px;"></div>');
$(popup).append('<div id="rif-l3" style="margin: 5px auto; text-
align: center; font-size: 25px; height: 25px;"></div>');
$(popup).append('<div id="rif-l4" style="margin: 5px auto; text-
align: center; font-size: 35px; height: 35px;"></div>');
$(popup).append('<div id="rif-l5" style="margin: 5px auto 30px
auto; text-align: center; font-size: 45px; height: 45px;"></div>');
var control = $(
'<div id="rif-control" class="center">' +
'<span id="rif-loading">Loading...</span>' +
'<div id="rif-slider" style="width: 100px"></div>' +
'<table align="center">' +
'<tr>' +
'<td><button id="rif-pause">Pause</button></td>' +
'<td align="right">WPM:</td>' +
'<td id="rif-wpm">0</td>' +
'</tr>' +
'</table>' +
'</div>'
);
$(popup).append(control);
$(body).append(popup);
$('#rif-pause').click(function() {
if (timer_handle) window.clearInterval(timer_handle);
});
$('#rif-close').click(function() {
if (timer_handle) window.clearInterval(timer_handle);
popup.remove();
});
return popup;
}
CmdUtils.loadJQuery(function($) {
CmdUtils.injectJavascript(
"http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-
ui.min.js",
function(){
var timer_handle;
make_popup($, timer_handle);
// $('div').draggable().css('outline', 'solid 2px #cfc');
});
});
}
});
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"ubiquity-firefox" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ubiquity-firefox?hl=en
-~----------~----~----~----~------~----~------~--~---