liberosoft / luyawysiwyg

Wysiwyg text editor for luya

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

missing bower depencies in composer.json

nadar opened this issue · comments

commented

Missing packages in composer.json:

public $sourcePath = '@bower';

public $js = [
        'tinymce/tinymce.js',
        'angular-ui-tinymce/src/tinymce.js'
];

you are including those libraries from bower, but they are missing in composer.json defintion. could you please fix that? Or at lest tell me the packages to integration trough bower?

There is information in Readme -> installation:
bower install angular-ui-tinymce --save

commented

I started working on the fork: https://github.com/nadar/luyawysiwyg/commit/82e8a5a630538e7e0f34c8d6ca036aac7ca03286

Indeed there is a problem with lazyloading / inject angularjs modules from an external script. I was not aware of this and i am currently not sure how to fix.

The only solution i see so far is to integrate something like this in the admin: https://github.com/ocombe/ocLazyLoad

commented

The problem is that angular modules must be loaded in the main application (https://github.com/luyadev/luya-module-admin/blob/master/src/resources/js/zaa.js#L49) which of course won't work for tinymce.ui module.

Ok, I'll have a look at https://github.com/ocombe/ocLazyLoad, somehow I need to make it work.

During tests I added to template in zaa.directive a function call that started tinymce. Well, tinymce started but no data was send to server after saving. When I tried to run it again without page refresh I got pure textarea, no errors in console.

commented

I think oc lazy load must be implemented in luya admin, otherwise it won't work.

sure you can render the tinymce by calling the javascript function, but this wont work in angular context. So loading the module is an absolute must - which does not work from a script - at least i could not find a way, but i am strong intrested in finding a solution for this problem!

@nadar I've fixed my code, added your suggestions. I also fixed the problem with tinymce and angular, adding this:
angular.module("zaa").requires.push('ui.tinymce');
solved the problem :)

Have a look at your free time, maybe this module is worth publishing on luya website?

commented

Hey @liberosoft this sounds perfect! Where did you found the requires.push information? I could not find anything on angularjs docs or was looking in the wrong direction. Thank you very much - i will add this to the luya.io docs, because this can be very useful.

is worth publishing on luya website?

Of course! Just publish your package on packagist (https://packagist.org/packages/submit) and as its type: luya-module it will automatically appear on luya.io