Technical 보관된 메일 그룹

technical@mail.odoo.com

Avatar

Re: Trying to embed xterm.js as Odoo widget

작성자
Jerome Sonnet
- 2017년 05월 16일 14시 32분 49초
Hi there,

I have not look into the details of this case but I had a similar issue while integrating another library into Polymer.

My finding was related to the use of Shadow DOM (or its equivalent) while the library is using plain old JQuery Global Selector and expect the real DOM elements to be present in the page. From time to time, depending of the loading sequence, the library cannot find the DOM element as expected and fail to load correctly.

From Odoo doc

"
  • Global selectors should be avoided. Because a component may be used several times in a single page (an example in Odoo is dashboards), queries should be restricted to a given component's scope. Unfiltered selections such as $(selector) or document.querySelectorAll(selector) will generally lead to unintended or incorrect behavior. Odoo Web's Widget() has an attribute providing its DOM root ($el), and a shortcut to select nodes directly ($()).
  • More generally, never assume your components own or controls anything beyond its own personal $el
"
It basically means that all libraries using global selector is not expected to work correctly.

Jerome

On Tue, May 16, 2017 at 7:15 PM Maxim Litnitskiy <litnimaxster@gmail.com> wrote:
Hi Axel!
Thanks for your support.
I decided for now to stop the battle.
I added a button to Launch Console :-)
When I release this product to the community probably somebody will do it :-)
Thanks all!


On Tue, May 16, 2017 at 5:46 PM, Axel Mendoza Pupo <aekroft@gmail.com> wrote:
Check the difference of css classes and styles between the terminal dom nodes, when it load ok and when it doesn't to see the difference since I see that xterm.open function is creating an style that could be the cause of the delay, also you could apply the proper styles by yourself if it doesn't get apply
It's Axel by the way

Best Regards
On Tue, May 16, 2017 at 3:20 AM, Maxim Litnitskiy <litnimaxster@gmail.com> wrote:
Thanks Juergen for your proposal.
But I need more control over terminal access.
Different Odoo roles will have different set of console commands.
So when Odoo app and Xterm app will be in different frames I guess it will be more complex to achive.
I think the idea with click on tab to open xterm and destroy it when tab is hidden shoud work.
Anyway thanks for proposal!

Regards,
Max.

On Tue, May 16, 2017 at 12:20 AM, Juergen Kienhoefer <juergen@aircable.net> wrote:
Guys, 
I did something very similar without the need of creating code. Our Web app runs in an iframe.
So, I just edit the page, and add an "embed video", which I used just a link to a static "image"
in my own "empty" module for Odoo. 
This would be the link for the "iframe video" I used: /aircable_images/static/app/preview.html
which contains the code for the app. Nicely the app then runs in the picture area of block structure.
The "aircable_images" is the name for my module, just to provide access to the files.
It may be not perfect, and I still have issues with the sizing, but at least it works.
Source code for the app is here: https://github.com/aircable/SmartMesh
Cheers
Juergen


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-framework-62
Post to: mailto:expert-framework@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-framework-62
Post to: mailto:expert-framework@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-framework-62
Post to: mailto:expert-framework@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

참조