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

Version Path
tdiary-5.3.0 js/category.js
tdiary-5.2.4 public/assets/category.js
tdiary-5.2.4 js/category.js
tdiary-5.2.3 public/assets/category.js
tdiary-5.2.3 js/category.js
tdiary-5.2.2 js/category.js
tdiary-5.2.2 public/assets/category.js
tdiary-5.2.1 public/assets/category.js
tdiary-5.2.1 js/category.js
tdiary-5.2.0 js/category.js
tdiary-5.1.7 js/category.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/category.js
tdiary-5.1.6 js/category.js
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/public/assets/category.js
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/js/category.js
tdiary-5.1.5 public/assets/category.js
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/js/category.js
tdiary-5.1.5 js/category.js
tdiary-5.1.4 js/category.js
tdiary-5.1.3 js/category.js