Third Party Contributions > API Based Plugins

[SOLVED] Howto use "rcube_splitter()"?

(1/2) > >>

Loguithat1955:
I would like to add a splitter between some divs in one of my plugins. After seeing how this is done in other plugins, i have found that there is special additional div added with the help of a javascript function "rcube_splitter()". I have tried to add this also to my plugin but the special "resize div" wan't added between my re-sizable divs. In the webconsole there is no error message and if i add a simple alert('test'); to the "rcube_splitter()" function in the original .js file, this alertbox appears also on my screen. So i assume the function is called. But the special div does not appear. Can anyone please give me some hints?

JohnDoh:
have you init'd the splitter? something like this https://github.com/roundcube/roundcubemail/blob/master/plugins/managesieve/skins/larry/templates/managesieve.html#L79

note: this example is for the Larry skin, as this is a skin function rather than a core one its dover slightly differently in the classic skin but if you look in the corresponding template for that skin you'll find a similar example

Loguithat1955:
Hi JohnDo, thx for your response. Just before the closing body tag, i have


--- Code: ---<script>
        new rcube_splitter({ id:'notessplitter', p1:'#sidebar', p2:'#main', orientation:'v', relative:true, start:400, min:300, size:12 }).init();
</script>
--- End code ---

In the body, i have of course both divs:


--- Code: ---<div id="sidebar" class="uibox listbox">
--- End code ---
and directly the next div is
--- Code: ---<div class="main uibox contentbox">
--- End code ---
. I have included the ui.js and ui.css files, both are found and loaded, since i get the small box from alert(); which i have inserted into the function rcube_splitter in ui.js. So i assume, the function is called correctly, but the div isnt inserted. The only difference is, that in managesieve plugin, the file is a template and in my case, i call it in a php file itself (which renders the html in my plugin currently). You can see the file at https://github.com/Offerel/roundcube_primitivenotes/blob/master/notes.php. Currently the changes for the splitter are not committed. If you want, i can commit them, but then i need to comment the relevant part, so that they arent executed, when a user calls them. or i make a new branch... i think a new branch could be useful for this. i will see, if i have the time for this tomorrow.

JohnDoh:
In the HTML in notes.php you do not include Larry's ui.js anywhere that I can see. Are you sure the alert() box is coming from inside the iframe rather than the parent?

Loguithat1955:
Sorry, i hadn't uploaded the branch as of yet: you can find the init in the new branch on line 581 and the reference to ui.js at line 513. I think the splitter should be inserted now directly between line 568 and 569, because the second div starts at line 569.

I hope i have committed this correctly...

Navigation

[0] Message Index

[#] Next page

Go to full version