Commits

Shlomi Fish committed 1896864

Add self-links-to-headers properly.

Comments (0)

Files changed (5)

 
 run_compass: src/style.css src/jqui-override.css
 
-src/style.css: config.rb lib/sass/style.sass lib/sass/print.sass lib/sass/vim_syntax_highlighting.sass
+src/style.css: config.rb lib/sass/style.sass lib/sass/print.sass lib/sass/vim_syntax_highlighting.sass lib/sass/self_link.sass
 	compass compile
 
 src/jqui-override.css: lib/sass/jqui-override.sass

bin/html-check-spelling-xmlp.pl

 {
    my($tag, $num) = @_;
    $inside{$tag} += $num;
-   print " ";  # not for all tags
 }
 
 

lib/sass/self_link.sass

+body.self_link
+    .selfl
+        display: none
+
+    h1, h2, h3, h4, h5, h6
+        &:hover
+            .selfl
+                display: inline
+
+                a
+                    margin-left: 0.5em
+                    text-decoration: none
+                    color: black

lib/sass/style.sass

         padding-bottom: 1em
 
 @import "vim_syntax_highlighting"
+@import "self_link"
 
 /* From http://hyperpolyglot.org/scripting :
 .wiki-content-table
     var myclass = "self_link";
     if (! $("body").hasClass(myclass))
     {
-        $("h1[id],h2[id],h3[id],h4[id],h5[id],h6[id]").each(function(i){ $(this).append( ' <span class="selfl">[<a href="#' + this.id + '">link</a>]</span>' ) })
+        $("h1[id],h2[id],h3[id],h4[id],h5[id],h6[id]").each(function(i){ $(this).append( '<span class="selfl"> <a href="#' + this.id + '" title="Get an anchor to this part of the page">¶</a></span>' ) })
         $("body").addClass(myclass);
     }
 }
+
+$(function() {
+    add_self_links();
+});
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.