We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

AddScript and AppendBody functions | Forum

Purusothaman Ramanujam
There seems to be a problem with how these 2 works in oxwall 1.5 version.

The plugin which worked with 1.4 does not work with 1.5 as how the javascript libraries are moved to the bottom of the page.

Any developers can have a look on this?
Purusothaman Ramanujam
OW::getDocument()->addScript() function add the JS script at the end of the html document for faster loading(I believe this is the reason for this change in 1.5)

But when the controller has some javascript function dependent on these JS library, they do not work.
Honsa
Honsa Dec 20 '12
I have the same problem. 


So I tried to use  OW::getDocument()->addOnloadScript() function. But I dont now hoe exactly to use, it works but still have problems with the new console.

Purusothaman Ramanujam
There was no mention about these changes in 1.5 any where. Its required that all changes that you make to the core should be informed to the developers not just the major ones.

Similarly, one of the newsfeed activity plugin function was changed to include second parameter. Even these kind of changes should be informed to us.
Michael I.
Michael I. Dec 20 '12
Do not use inline js. Make all libraries calls either via jQuery.ready event or via OW::getDocument()->addOnloadScript() - this is a wrapper for jQuery.ready.
The Forum post is edited by Michael I. Dec 20 '12
Purusothaman Ramanujam
Without these prior information, most of the time was spent on analysis.
Honsa
Honsa Dec 24 '12
I still have problems upgrading my tinymce plugin. I configured all right, I think but htmlarea is killing my tinymce input. I have no more ideas than looking for these lines:


(function(_scope) {            $('#post_body').get(0).htmlarea = function(){ $(this).htmlarea( {"toolbar":["image","video","html","bold","italic","underline","link","orderedlist","unorderedlist"],"size":170} );};            $('#post_body').get(0).htmlareaFocus = function(){this.jhtmlareaObject.iframe[0].contentWindow.focus();};            $('#post_body').get(0).htmlareaRefresh = function(){if(this.jhtmlareaObject){this.jhtmlareaObject.dispose();$(this).htmlarea( {"toolbar":["image","video","html","bold","italic","underline","link","orderedlist","unorderedlist"],"size":170} );}};        })(window);(function(_scope) {$('#post_body').htmlarea( {"toolbar":["image","video","html","bold","italic","underline","link","orderedlist","unorderedlist"],"size":170} );})(window);


and delete them using javascript. Without this lines it works, may some of you guys have a little tip for me to do it better.


just calling scripts and append the document.ready part:


OW::getDocument()->addScript($bbs);        OW::getDocument()->addScript($ccs);        OW::getDocument()->appendBody($tinymce);
thx for any little hint