Dojo script type parsing

Hello, I'm a french trying to get PHPStorm to work as I would like to :)

I'm using Dojo 1.8 as JS library and I would like PHPStorm to parse HTML <script> tag as Javascript event if I define it the Dojo way.

For example :

<script type="dojo/on" data-dojo-event="submit" data-dojo-args="evt">
     dojo.stopEvent(evt);
     if (this.validate()) {
          return true;
     }
</script>



It would be really nice if PHPStorm acted like if I typed "javascript". It works if I use "javascript:dojo/on" but now Dojo does not recognize it anymore.

Thanks for your help !
1 comment

Hello, i also had such problem.

And I've found the way :)

You can add some injection settings, see attachment

I added XPath condition: not(@type="dojo/require")

It's done because <Script type="dojo/require"> has not JavaScript sintax



Attachment(s):
Inject.jpg
0

Please sign in to leave a comment.