File tree 3 files changed +23
-7
lines changed
3 files changed +23
-7
lines changed Original file line number Diff line number Diff line change 1
1
## next
2
2
3
+ * Embed SVG icon directly as GitHub no longer uses an icon font.
4
+
3
5
## [ 0.3.0] [ 0.3.0 ] - 2015-09-02
4
6
5
7
* Now available for Firefox!
Original file line number Diff line number Diff line change 17
17
}
18
18
19
19
.gitique-icon {
20
- color : # bdbdbd ;
20
+ fill : # bdbdbd ;
21
+ }
22
+
23
+ .gitique-icon svg {
24
+ display : inline-block;
25
+ vertical-align : bottom;
21
26
}
22
27
23
28
.gitique-icon .gitique-reviewed {
24
- color : # 999 ;
29
+ fill : # 999 ;
25
30
}
26
31
27
32
.gitique-icon .gitique-basis {
28
- color : # 000 ;
33
+ fill : # 000 ;
29
34
}
30
35
31
36
.gitique-icon .gitique-new {
32
- color : # 6cc644 ;
37
+ fill : # 6cc644 ;
33
38
}
34
39
35
40
.gitique-icon .gitique-head {
36
- color : # 48a220 ;
41
+ fill : # 48a220 ;
37
42
}
38
43
39
44
.gitique-icon : not (.gitique-initial ): not (.gitique-head ) {
Original file line number Diff line number Diff line change 174
174
(util/add-class element " gitique-hidden" ))))))
175
175
176
176
(defn- select-commit [event]
177
- (swap! state assoc :base-commit (commit-sha (.-parentElement (.-target event)))))
177
+ (swap! state assoc :base-commit (commit-sha (.-parentElement (.-currentTarget event)))))
178
178
179
179
(defn- add-icon! [element override-class]
180
180
(let [parent (.-parentElement (.-parentElement element))]
181
181
(when-not (util/qs " .gitique-icon" parent)
182
- (let [icon (dom/createDom " span" #js[" octicon octicon-diff-added gitique-icon" ])]
182
+ ; ; This is kind of a hack, but it works fine for now. If this extension used more
183
+ ; ; than one icon then it would be better to include them as actual files.
184
+ (let [svg-ns " http://www.w3.org/2000/svg"
185
+ svg (js/document.createElementNS svg-ns " svg" )
186
+ path (js/document.createElementNS svg-ns " path" )
187
+ icon (dom/createDom " span" #js[" gitique-icon" ] svg)]
188
+ (.setAttributeNS svg nil " width" " 14" )
189
+ (.setAttributeNS svg nil " height" " 16" )
190
+ (.setAttributeNS path nil " d" " M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM6 9H3V7h3V4h2v3h3v2H8v3H6V9z" )
191
+ (.appendChild svg path)
183
192
(if override-class
184
193
(util/add-class icon override-class)
185
194
(.addEventListener icon " click" select-commit))
You can’t perform that action at this time.
0 commit comments