Joomla 1.5 Web サイトを Joomla 2.5 に移行しました。
Joomla 1.5 Web サイトは Mootools 1.11 を使用しています。
Joomla 2.5 Web サイトは Mootools 1.4.5 を使用しています。
Web サイトには、annuary という名前の特定の機能が含まれています。
annuary には、Mootools 1.11 に基づくいくつかの JavaScript ファイルが必要です。
これらのファイルのいくつかの指示を Mootools 1.4.5 に適合させる必要があります。
これらの JavaScript ファイルの 1 つが Autocompleter.js です。
以下は Autocompleter.js からの抜粋です。
var Autocompleter = {};
Autocompleter.Base = new Class({
...
initialize: function(el, options) {
this.setOptions(options);
this.element = $(el);
this.build();
this.observer = new Observer(this.element, this.prefetch.bind(this), $merge({
delay: 400
}, this.options.observerOptions));
this.value = this.observer.value;
this.queryValue = null;
},
...
});
Autocompleter.Base.implement(new Events);
Autocompleter.Base.implement(new Options);
Autocompleter.Local = Autocompleter.Base.extend({
...
initialize: function(el, tokens, options) {
this.parent(el, options);
this.tokens = tokens;
if (this.options.filterTokens) this.filterTokens = this.options.filterTokens.bind(this);
},
...
});
年次に関する次の JavaScript 命令が期待どおりに機能しないことに気付きました。
new Autocompleter.Local(idChamp, tabValues, {
'delay': 100,
'injectChoice': function(choice) {
var el = new Element('li')
.setHTML(this.markQueryValue(choice[0]))
.adopt(new Element('span', {'class': 'example-info'}).setHTML(this.markQueryValue(choice[1])));
el.inputValue = choice[0];
this.addChoiceEvents(el).injectInside(this.choices);
}
});
Autocompleter.Base の初期化関数が実行されます。
しかし、Autocompleter.Local の初期化関数はそうではありません。
誰かが私に理由を説明できますか?
この問題は Mootools 1.4.5 の使用が原因であると確信しています。