Sha256: fcfc5178c80038c315eca179f3a24fa1580fbc09f55dc4e7d9a81ae76a6131f8
Contents?: true
Size: 829 Bytes
Versions: 20
Compression:
Stored size: 829 Bytes
Contents
/* category.js: javascript for category.rb plugin of tDiary Copyright (C) 2011 by TADA Tadashi <t@tdtds.jp> You can redistribute it and/or modify it under GPL2 or any later version. */ $(function(){ // insert clicked category item into textarea of update form function insertCategoryItem(item) { $('#body').insertAtCaret( '[' + item.text() + ']' ); } $('.category-item') .hover(function(){ $(this).css('cursor', 'pointer'); }, function(){ $(this).css('cursor', 'default'); }) .click(function(){ insertCategoryItem($(this)); }); $('#category-candidate').change(function(){ $('option:selected', this).each(function(){ insertCategoryItem($(this)); }); }); // reverse list of category $('ul.category').each(function(){ var ul = $(this); ul.append(ul.children().toArray().reverse()); }); });
Version data entries
20 entries across 11 versions & 1 rubygems