Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var LangClass = Class.create({
- langlist: null
- ,catlist: null
- ,phraselist: null
- ,initialize: function()
- {
- this.langlist = $('langlist');
- this.catlist = $('catlist');
- this.phraselist = $('phraselist');
- this.loadPhraseList();
- }
- ,loadPhraseList: function()
- {
- new Ajax.Request('editor.ajax.php?action=getphraselist', {
- method: 'post'
- ,parameters: {
- categoryid: this.catlist.getValue()
- }
- ,onComplete: (function(transport) {
- var data = transport.responseJSON;
- this.phraselist.options.length = 0;
- $H(data).each(function(i) {
- console.warn('stuff');
- var opt = new Element('option', {value: i.id}).update('stuff');
- this.phraselist.insert(opt);
- var v = 0 / 0;
- });
- }).bind(this)
- });
- }
- });
- var lang = null;
- Event.observe(window, 'load', function() {
- lang = new LangClass();
- });
Add Comment
Please, Sign In to add comment