Permalink
Browse files

initial code

  • Loading branch information...
1 parent 2ea07e0 commit 9963626eda589b0ba445d4b37489e11a68562265 @invalid-email-address invalid-email-address committed Dec 26, 2012
Showing with 94 additions and 0 deletions.
  1. +40 −0 src/contentscript.js
  2. +33 −0 src/contentstyle.css
  3. +21 −0 src/manifest.json
View
@@ -0,0 +1,40 @@
+/**
+ * Copyright (c) 2011 Dennis Hall <https://github.com/dennishall>.
+ * All rights reserved. Use of this source code is governed by the MIT license.
+**/
+
+
+function $(s){
+ return document.querySelectorAll(s);
+}
+
+function prepend(child){
+ this.insertBefore(child, this.firstChild);
+}
+
+
+var tt = document.createElement('div');
+tt.className = "graph-tooltip";
+document.body.appendChild(tt);
+
+
+function over(){
+ var parent = this;
+ var img = parent.getElementsByTagName('img')[0];
+ var rect = parent.getBoundingClientRect();
+ tt.innerText = img.alt;
+ tt.style.display = "block";
+ tt.style.top = window.scrollY + rect.top - rect.height - 28 + 'px'; // 30 is the height of the tooltip
+ tt.style.left = window.scrollX + rect.left + (rect.width/2) - 100 + 'px'; // 100 is half of the width of the tooltip
+ // console.log(window.scrollY + rect.top - rect.height - 30, window.scrollX + rect.left - rect.width);
+}
+
+function out(){
+ tt.style.display = "none";
+}
+
+[].forEach.call($('table.tt_graph img'), function(el){
+ var parent = el.parentNode;
+ parent.onmouseover = over;
+ parent.onmouseout = out;
+});
View
@@ -0,0 +1,33 @@
+.alertHeader { display: none; }
+
+table.tt_graph,
+table.tt_graph td,
+table.tt_graph img { height:8px !important; font-size: 8px/8px arial; }
+table.tt_graph img { display:block; }
+
+.graph-tooltip {
+ display:none;
+ position:absolute;
+ width:200px;
+ height:18px;
+ text-align: center;
+ font:13px arial;
+ background:#000;
+ color:#fff;
+ padding:5px 0;
+ top:0;
+ left:0;
+}
+
+.graph-tooltip:after{
+ content:" ";
+ display: block;
+ position: relative;
+ top:7px;
+ left:90px;
+ width:0;
+ border:10px solid #000;
+ border-left-color:transparent;
+ border-right-color:transparent;
+ border-bottom:0;
+}
View
@@ -0,0 +1,21 @@
+{
+ "name" : "Jira Helper",
+ "version" : "1.0",
+ "manifest_version": 2,
+ "description" : "todo",
+ "permissions" : [
+ "clipboardRead",
+ "clipboardWrite"
+ ],
+ "content_scripts" : [
+ {
+ "matches" : [
+ "http://issues.ngptools.com/*",
+ "https://issues.ngptools.com/*"
+ ],
+ "js" : ["contentscript.js"],
+ "css" : ["contentstyle.css"],
+ "all_frames" : false
+ }
+ ]
+}

0 comments on commit 9963626

Please sign in to comment.