Sha256: 1d3d7fc960e9462c0c3a4eb816d05991051dba816c382b4dd9f136ad8f186052

Contents?: true

Size: 961 Bytes

Versions: 38

Compression:

Stored size: 961 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').length > 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]/);
    })
    .on("click", function() {
      highlight(this);
    })

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

Version data entries

38 entries across 24 versions & 1 rubygems

Version Path
tdiary-5.3.0 js/highlight.js
tdiary-5.2.4 public/assets/highlight.js
tdiary-5.2.4 js/highlight.js
tdiary-5.2.3 js/highlight.js
tdiary-5.2.3 public/assets/highlight.js
tdiary-5.2.2 js/highlight.js
tdiary-5.2.2 public/assets/highlight.js
tdiary-5.2.1 public/assets/highlight.js
tdiary-5.2.1 js/highlight.js
tdiary-5.2.0 js/highlight.js
tdiary-5.1.7 js/highlight.js
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/js/highlight.js
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/js/highlight.js
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/public/assets/highlight.js
tdiary-5.1.6 js/highlight.js
tdiary-5.1.5 public/assets/highlight.js
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/js/highlight.js
tdiary-5.1.5 js/highlight.js
tdiary-5.1.4 js/highlight.js
tdiary-5.1.3 js/highlight.js