Permalink
Browse files

Working on quick outline

  • Loading branch information...
1 parent 342404e commit 906778df6ce5fa7653316a114aacccd12f927c90 @sergeche committed Feb 12, 2011
Showing with 49 additions and 4 deletions.
  1. +0 −1 .gitignore
  2. +1 −0 build/build.xml
  3. +8 −2 css/_quick-outline.css
  4. +1 −1 extensions/chrome/xv.css
  5. +39 −0 src/quick_outline_ui.js
View
@@ -1,4 +1,3 @@
/test
.DS_Store
-/ant-tools
/dist
View
@@ -57,6 +57,7 @@
<file name="dnd.js"/>
<file name="outline.js"/>
<file name="outline_ui.js"/>
+ <file name="quick_outline_ui.js"/>
<file name="controller.js"/>
</filelist>
</concat>
View
@@ -18,18 +18,24 @@ div[class~=xv-quick-outline] {
box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}
+div[class~=xv-quick-outline-hidden] {
+ display:none;
+}
+
div[class~=xv-quick-outline] h2 {
font-weight: normal;
padding: 10px;
border-bottom: 1px solid #c4c4c4;
}
-input[id=fld-xv-search] {
+input[id=fld-quick-outline-search] {
width:100%;
+ -webkit-user-modify: read-write-plaintext-only;
+ -webkit-appearance:searchfield;
}
div[class~=xv-quick-outline-content] {
- height:300px;
+ max-height:300px;
overflow: auto;
padding: 10px;
}
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -0,0 +1,39 @@
+/**
+ * UI for quick outline: open small window by keyboard shortcut, search for
+ * element and select it
+ * @author Sergey Chikuyonok (serge.che@gmail.com)
+ * @link http://chikuyonok.ru
+ *
+ * @include "dom.js"
+ * @include "controller.js"
+ * @include "outline.js"
+ * @include "signals.js"
+ */(function(){
+ var popup = xv_dom.fromHTML('<div class="xv-quick-outline">' +
+ '<span class="xv-quick-outline-close">×</span>' +
+ '<h2><input type="search" name="quick-outline-search" id="fld-quick-outline-search" /></h2>' +
+ '<div class="xv-quick-outline-content"></div>' +
+ '</div>'),
+ /** @type {Element} */
+ search_fld = popup.getElementsByTagName('input')[0];
+
+ function showPopup() {
+ xv_dom.removeClass(search_fld, 'xv-quick-outline-hidden');
+ }
+
+ function hidePopup() {
+ xv_dom.addClass(search_fld, 'xv-quick-outline-hidden');
+ }
+
+ function isVisible() {
+ xv_dom.hasClass(search_fld, 'xv-quick-outline-hidden');
+ }
+
+
+ xv_signals.documentProcessed.addOnce(function() {
+// hidePopup();
+ var source_pane = xv_dom.getOneByClass('xv-source-pane');
+ source_pane.parentNode.appendChild(popup);
+
+ });
+})();

0 comments on commit 906778d

Please sign in to comment.