実際、コンボボックス(ドロップダウン+入力テキスト)用の純粋なJavaScriptプラグインを作成しようとしています が、jqueryを使用せずに選択したプラグインを作成しようとしていましたが、次の部分で立ち往生しています:
(function() {
var $, Chosen, root, _ref,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
root = this;
$ = jQuery;
$.fn.extend({
chosen: function(options) {
if (!AbstractChosen.browser_is_supported()) {
return this;
}
return this.each(function(input_field) {
var $this;
$this = $(this);
if (!$this.hasClass("chzn-done")) {
return $this.data('chosen', new Chosen(this, options));
}
});
}
});
この jquery コードに対応する JavaScript コードは何でしょうか。誰かがこの種のプラグインまたは例を持っている場合は、リンクを提供してください。前もって感謝します