This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 228565 - Offer files from the CDNJS repository in code completion for the script tag
Summary: Offer files from the CDNJS repository in code completion for the script tag
Status: NEW
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.3.1
Hardware: All All
: P2 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-15 12:38 UTC by Petr Jiricka
Modified: 2013-08-28 11:55 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Jiricka 2013-04-15 12:38:19 UTC
1. In a html file, type <script src=""></script> 
2. Press Ctrl+Space between the quotes (i.e. in the value of the src attribute)

You get code completion for directories and files contained in the project, but it would be nice to also offer scripts that are available on cdnjs. In particular, I can imagine we could do two things:

a) offer protocol-relative URLs to remote hosted files, e.g. //cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js

b) offer relative URLs to local files that do not exist, while adhering to file naming/location conventions, e.g. offer js/libs/require.js-2.1.4/require.min.js, which would also download the library from the repository and placed it in the appropriate directory (possibly following a confirmation dialog)

Cc'ing Tomas and David - I guess they could advise about how to get the CDNJS repository information from the JS libraries functionality, or how to expose this through some APIs.
Comment 1 Petr Pisl 2013-04-18 18:29:08 UTC
This has to be tread in the html editor.
Comment 2 Marek Fukala 2013-08-28 11:55:45 UTC
(In reply to Petr Pisl from comment #1)
> This has to be tread in the html editor.
No it doesn't - just implement and register an instance of o.n.m.html.editor.api.gsf.HtmlExtension, resp. the completeAttributeValue() method.