Closed GoogleCodeExporter closed 9 years ago
Hmmm....it's not suit for external usage rightnow :( Only inside of controls.
Will
try to add this in next release.
Original comment by plandem
on 31 Jan 2009 at 10:14
[deleted comment]
[deleted comment]
it is possible to slightly modify the code to make it return editor object on
creation:
extension function inside jquery.rte.js (replace with following):
jQuery.fn.rte = function(options)
{
editors = new Array();
$(this).each( function() {
editors.push(new lwRTE (this, options));
});
return editors;
}
the you will be able to use smth like:
eds = $('.rte').rte({
css: 'default.css',
width: '99%',
height: 200,
controls_rte: rte_toolbar
});
eds[0].set_content('test content from outside');
in your code (eds wil be an arry of editor objects, that were created).
Original comment by Psychode...@gmail.com
on 1 Feb 2009 at 9:35
Perhaps is better to declare a global object of editors ... currently created,
and ad them by ID..
if(!rte) var rte = {};
rte.instances = []
jQuery.fn.rte = function(options)
{
$(this).each( function() {
rte.instances[this.id] = new lwRTE (this, options);
});
return editors;
}
With this form, you can gain access from everywhere.
Or if you want, you can't add them by textarea name....
Original comment by jor...@gmail.com
on 2 Feb 2009 at 4:30
don't like global scope alot. first variant will be implemented :)
Original comment by plandem
on 6 Feb 2009 at 4:00
It's also may come handy not to create array for objects each time we convert
anything to editor, but add it to the previous, to collect. And to implement
method
to get those from rte object.
Original comment by Psychode...@gmail.com
on 6 Feb 2009 at 4:57
[deleted comment]
next issue will be used. in that case you will be able to collect rte.
for example:
var arr = $('.rte1').rte();
$('.rte2').rte({}, arr);
rte's without ID will be accessed via arr[0....N], but rte's with ID will be
accessed
via arr['ID']
---
jQuery.fn.rte = function(options, editors) {
if(!editors || editors.constructor != Array) {
editors = new Array();
}
$(this).each( function(i) {
var id = (this.id) ? this.id : editors.length;
editors[id] = new lwRTE (this, options || {});
});
return editors;
}
return editors;
Original comment by plandem
on 5 Mar 2009 at 8:20
Original issue reported on code.google.com by
yusufnb
on 29 Jan 2009 at 4:22