Permalink
Browse files

Added Eclipse plugin resource

  • Loading branch information...
1 parent f5f1921 commit aa89e4734bad94be4f37adde8451271bc6c28a1c @sergeche committed May 22, 2011
Showing with 69 additions and 2 deletions.
  1. +15 −1 build/build.xml
  2. +25 −0 eclipse.html
  3. +1 −1 extensions/chrome/controller.js
  4. +28 −0 src/clipboard.js
View
@@ -25,6 +25,7 @@
<file name="outline_ui.js"/>
<file name="controller.js"/>
<file name="selection-notifier.js"/>
+ <file name="clipboard.js"/>
</filelist>
<target name="compile.js" depends="init">
@@ -85,7 +86,20 @@
</copy>
</target>
- <target name="compile" depends="compile.css, compile.js, chrome.extension, browser.stylesheet, safari.extension">
+ <target name="eclipse.extension" depends="compile.css, compile.js" description="Build Eclipse extension resource">
+ <loadfile property="browser.compiled-css" srcFile="${dist.css.dir}/main.css"/>
+ <loadfile property="browser.compiled-js" srcFile="${dist.js.dir}/xv.js"/>
+ <copy file="${basedir}/eclipse.html" todir="${dist.dir}" overwrite="true">
+ <filterchain>
+ <replacetokens>
+ <token key="CSS" value="${browser.compiled-css}"/>
+ <token key="JS" value="${browser.compiled-js}"/>
+ </replacetokens>
+ </filterchain>
+ </copy>
+ </target>
+
+ <target name="compile" depends="compile.css, compile.js, chrome.extension, browser.stylesheet, safari.extension, eclipse.extension">
<copy file="${basedir}/xml-pretty-print.xslt" tofile="${dist.dir}/xmlview.xsl"/>
<echo>Build done</echo>
</target>
View
@@ -0,0 +1,25 @@
+<!doctype html>
+<html lang="en-US">
+ <head>
+ <meta charset="UTF-8"/>
+ <style type="text/css">
+ @CSS@
+ </style>
+ </head>
+ <body>
+ <div class="xv-search-panel">
+ <input type="search" class="xv-search-field" spellcheck="false" placeholder="Search by name or XPath" />
+ <span class="xv-search-xpath-result"></span>
+ </div>
+ <div class="xv-source-pane">
+ <div class="xv-source-pane-inner"></div>
+ </div>
+
+ <div id="xv-source-data">@SOURCE@</div>
+
+ <script type="text/javascript">
+ @JS@
+ ;xv_controller.process(document.getElementById('xv-source-data').textContent);
+ </script>
+ </body>
+</html>
@@ -62,7 +62,7 @@ var xv_dnd_feedback = {
fn(response.image);
});
}
-}
+};
// intercept XML document while it is not replaced by Chrome's XML Tree
if (!('_doc' in this)) {
View
@@ -0,0 +1,28 @@
+/**
+ * Module for copying Quick XPath values to clipboard on click where available
+ * (in IDE mostly)
+ */
+(function(GLOBAL) {
+ var is_dnd_mode = false,
+ copy_text = '';
+
+ xv_signals.dndModeEntered.add(function() {
+ is_dnd_mode = true;
+ });
+
+ xv_signals.dndModeQuit.add(function() {
+ is_dnd_mode = false;
+ });
+
+ xv_signals.dndMessageChanged.add(function(message) {
+ copy_text = message;
+ });
+
+ xv_dom.addEvent(document, 'click', function(evt) {
+ if (is_dnd_mode && copy_text && 'copyToClipboard' in GLOBAL) {
+ GLOBAL.copyToClipboard(copy_text);
+ evt.preventDefault();
+ evt.stopPropagation();
+ }
+ });
+})(this);

0 comments on commit aa89e47

Please sign in to comment.