Sha256: e7b71d7cad11ff019884da010c17144fd4bbb84aa72c1264de6c0a07fd65769d

Contents?: true

Size: 963 Bytes

Versions: 17

Compression:

Stored size: 963 Bytes

Contents

/**
 * highlight.js: Highlighting the element jumped from other pages. 
 *
 * Copyright (C) 2003 by Ryuji SAKAI
 * Copyright (C) 2003 by Kazuhiro NISHIYAMA
 * Copyright (C) 2011 by MATSUOKA Kohei <kmachu@gmail.com>
 * You can distribute it under GPL2 or any later version.
 */

$(function() {
  function highlight(anchor) {
    // clear current highlight
    $(".highlight").removeClass("highlight");

    // change document title
    var target = $(anchor).parent();
    if (target.filter('h3').size() > 0) {
      document.title = target.children("a").attr("title") + " - " + $tDiary.title;
    }

    target.addClass("highlight");
  }

  // bind click event to anchors
  $(document.anchors)
    .filter(function() {
      return $(this).attr("name").match(/^[pc]/);
    })
    .bind("click", function() {
      highlight(this);
    })

  if (document.location.hash) {
    highlight($('[name=' + document.location.hash.replace(/[^\w]/g, "") + ']')[0]);
  }
});

Version data entries

17 entries across 13 versions & 1 rubygems

Version Path
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/tdiary-5.0.3/js/highlight.js
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/js/highlight.js
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.3/js/highlight.js
tdiary-5.0.4 vendor/bundle/gems/tdiary-5.0.3/js/highlight.js
tdiary-5.0.4 js/highlight.js
tdiary-5.0.3 js/highlight.js
tdiary-5.0.2 js/highlight.js
tdiary-5.0.1 js/highlight.js
tdiary-5.0.0 js/highlight.js
tdiary-4.2.1 vendor/bundle/ruby/2.3.0/gems/tdiary-4.2.0/js/highlight.js
tdiary-4.2.1 js/highlight.js
tdiary-4.2.0 js/highlight.js
tdiary-4.1.3 js/highlight.js
tdiary-4.1.2 js/highlight.js
tdiary-4.1.1 js/highlight.js
tdiary-4.1.0 js/highlight.js
tdiary-4.1.0.20141126 js/highlight.js