Re: How to debug javascript in Plone 5 ?
Rodrigo Ferreira de Souza <[email protected]>
| Newsgroups | gmane.comp.web.zope.plone.devel |
|---|---|
| Message-ID | <CAOdJJ2d4UR+Nm4yGprqq72FaHdp8wQVXv_+nS4S0cT9qvgeyWQ@mail.gmail.com> |
I always add the debugger in the desired line (like we do with pdb at
python):
require([
'jquery',
'ace'
], function($) {
'use strict';
var init = function(){
if (!window.ace){
// XXX hack...
// wait, try loading later
setTimeout(function() {
init();
}, 200);
return;
}
var editor = ace.edit("modelEditor"),
session = editor.getSession(),
myform = $("#saveform"),
doc_changed = false;
debugger;
// editor tuneup
editor.setTheme("ace/theme/monokai");
It just stop when you have the browser tools opened.
Atenciosamente,
Rodrigo Ferreira de Souza
python -c "n='H+6(13+zT5((51(9z65zG+%
9';s=len(n)-1;i=list(range(s+1))[::-1]+list(range(1,s+1));print('\n'.join(['
'.join([chr(154-ord(n[(x if x > y else y)])) for y in i]) for x in i]))"
On Fri, Sep 18, 2015 at 11:05 AM, Nathan Van Gheem <[email protected]>
wrote:
> What do you mean by prevent cooking?
>
> If you want to explore/debug the structure pattern, here are your steps:
>
> - go to resource registries control panel
> - activate debug mode
> - enable debugging the "plone-logged-in" bundle
> - click save
>
> Now javascript for the plone-logged-in bundle(where the structure pattern
> is included) will not use the compiled javascript.
>
> Now you can edit the mockup package resources and the changes will take
> immediately.
>
> Other things to look at:
>
> -
> https://github.com/plone/Products.CMFPlone/blob/master/Products/CMFPlone/static/plone-logged-in.js
> is the bundle file which specifies which patterns it is including
> - https://github.com/plone/mockup/tree/master/mockup/patterns/structure
> is the structure pattern code
>
> Let me know if you have any further questions.
>
> On Fri, Sep 18, 2015 at 8:24 AM, Franz Gerhard Reinisch <[email protected]>
> wrote:
>
>> Are there any useful links or suggestions how to prevent “cooking “ of
>> javascript in debug mode? I need to explore /debug e.g.:
>> mockup-pattern-structure. After hours of trial an googling im somewhat
>> lost (plone 5 /current coredev …).
>>
>> Thanks in advance for any help.
>>
>> Franz
>>
>>
>> ------------------------------------------------------------------------------
>>
>> _______________________________________________
>> Plone-developers mailing list
>> Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>> https://lists.sourceforge.net/lists/listinfo/plone-developers
>>
>>
>
>
> --
> Nathan Van Gheem
> Solutions Architect
> Wildcard Corp
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Plone-developers mailing list
> Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/plone-developers
>
>
------------------------------------------------------------------------------
_______________________________________________
Plone-developers mailing list
Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/plone-developers