Permalink
Browse files

Issue 5931: Integrate SelectBug extension into Firebug

  • Loading branch information...
janodvarko committed Sep 19, 2012
1 parent 068aef5 commit 34c8d8a18050537cbc1b322e267d868621fb695a
@@ -0,0 +1,59 @@
+/* See license.txt for terms of usage */
+
+define([
+ "firebug/firebug",
+ "firebug/lib/domplate",
+ "firebug/lib/locale",
+],
+function(Firebug, Domplate, Locale) {
+with (Domplate) {
+
+// ********************************************************************************************* //
+// Constants
+
+const Cc = Components.classes;
+const Ci = Components.interfaces;
+
+// ********************************************************************************************* //
+// CSS Selector Editor
+
+function SelectorEditor(panel)
+{
+ var doc = panel.document;
+
+ this.panel = panel;
+ this.box = this.tag.replace({}, doc, this);
+ this.input = this.box;
+
+ this.tabNavigation = false;
+ this.tabCompletion = true;
+ this.completeAsYouType = false;
+ this.fixedWidth = true;
+}
+
+SelectorEditor.prototype = domplate(Firebug.InlineEditor.prototype,
+{
+ tag:
+ INPUT({"class": "fixedWidthEditor a11yFocusNoTab",
+ type: "text",
+ title: Locale.$STR("Selector"),
+ oninput: "$onInput",
+ onkeypress: "$onKeyPress"}
+ ),
+
+ endEditing: function(target, value, cancel)
+ {
+ if (cancel || value == "")
+ return;
+
+ this.panel.setTrialSelector(target, value);
+ },
+});
+
+// ********************************************************************************************* //
+// Registration
+
+return SelectorEditor;
+
+// ********************************************************************************************* //
+}});
Oops, something went wrong.

0 comments on commit 34c8d8a

Please sign in to comment.