Sha256: 4677bcfd9d615ec7b83bddb0d51f0a6cb2461256123f8e83141a6a91f6d62fba

Contents?: true

Size: 989 Bytes

Versions: 30

Compression:

Stored size: 989 Bytes

Contents

#
# category_autocomplete.rb : Support the automatic input of the category
#                            using jQuery UI autocomplete.
#
# Copyright (C) 2010-2012, tamoot <tamoot+tdiary@gmail.com>
# You can redistribute it and/or modify it under GPL2 or any later version.
#

if /\A(?:form|preview|append|edit|update)\z/ =~ @mode
	add_header_proc do
		%Q|<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.min.css"/>|
	end

	enable_js('//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js')
	enable_js('caretposition.js')
	enable_js('category_autocomplete.js')

	if @categories.size > 0
		categories_json = @categories.map{ |c| "\"#{c}\"" }
		add_js_setting('$tDiary.plugin.category_autocomplete')
		add_js_setting('$tDiary.plugin.category_autocomplete.candidates',
			"[#{categories_json.join(",")}]")
	end
end

# Local Variables:
# mode: ruby
# indent-tabs-mode: t
# tab-width: 3
# ruby-indent-level: 3
# End:
# vim: ts=3

Version data entries

30 entries across 24 versions & 1 rubygems

Version Path
tdiary-5.3.0 misc/plugin/category_autocomplete.rb
tdiary-5.2.4 misc/plugin/category_autocomplete.rb
tdiary-5.2.3 misc/plugin/category_autocomplete.rb
tdiary-5.2.2 misc/plugin/category_autocomplete.rb
tdiary-5.2.1 misc/plugin/category_autocomplete.rb
tdiary-5.2.0 misc/plugin/category_autocomplete.rb
tdiary-5.1.7 misc/plugin/category_autocomplete.rb
tdiary-5.1.6 misc/plugin/category_autocomplete.rb
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/misc/plugin/category_autocomplete.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/misc/plugin/category_autocomplete.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/misc/plugin/category_autocomplete.rb
tdiary-5.1.5 misc/plugin/category_autocomplete.rb
tdiary-5.1.4 misc/plugin/category_autocomplete.rb
tdiary-5.1.3 misc/plugin/category_autocomplete.rb
tdiary-5.1.2 vendor/bundle/ruby/2.6.0/gems/tdiary-5.0.14/misc/plugin/category_autocomplete.rb
tdiary-5.1.2 misc/plugin/category_autocomplete.rb
tdiary-5.1.1 misc/plugin/category_autocomplete.rb
tdiary-5.1.1 vendor/bundle/ruby/2.6.0/gems/tdiary-5.0.14/misc/plugin/category_autocomplete.rb
tdiary-5.1.0 misc/plugin/category_autocomplete.rb
tdiary-5.0.14 misc/plugin/category_autocomplete.rb