PhpStorm 10 Download to Library issues (JS yes, CSS no) - phpstorm

I'm just wondering how I can customize the part where PhpStorm allows only to d/l jQuery or other related scripts into library, yet no CSS option to d/l into library.
Of course that the solution is to create a new file > copy the name of the filename > paste it into the name > copy the contents of the bootstrap.min link, paste it in the new created file.
I'm trying to get an automated "d/l into library" option working for CSS, which is pretty cardinal, considering the fact that no bootstrap class hinting will appear in PhpStorm until you have a local/cached library for bootstrap

This functionality is not yet implemented (latest stable is v2016.2).
https://youtrack.jetbrains.com/issue/WEB-10023 -- watch this ticket (star/vote/comment) to get notified on any progress.

Related

Create Vanila HTML / JS project inside PhpStorm where PHP has already been configured

I use Storm daily for PHP/Laravel, and hence have PHP configured. When I want to create a vanilla HTML / JS side project, Storm takes it upon itself to add the PHP libraries without asking. I don't want any PHP Libraries. When initially creating the project, I used "empty project".
Here is a screen shot to illustrate.
So, how to create an empty project without PHP libraries?
You are using PhpStorm, an IDE that supports PHP. That entry that you see there is a list of stubs for PHP (the stuff that IDE knows about core PHP and other common extensions: classes/functions/constants etc).
AFAIK it always will be there (as it's a PHP oriented IDE) and you cannot remove it. But you try this:
Settings (Preferences on macOS)
Languages & Frameworks | PHP
PHP Runtime tab
Uncheck ALL entries there.
If the above will not get rid of the whole node then you will have to ignore that entry. And I do not see any problems in having it here: it will not affect your JS/HTML in any way.
P.S. Whatever will be in a default/new project can be configured at File | New Projects Settings | Settings for New Projects...

PhpStorm - Create normal HTML, JS, CSS project

Is it possible to create a simple Project which only uses HTML, JavaScript and CSS, or do I have to use netbeans?
I tried to start a new project, but I have only these options:
and I am not sure what "HTML5 Boilerplate" is.
Just use the top most "PHP Empty Project" option.
If you do not have local or remote PHP -- just choose <no interpreter> option for "CLI Interpreter" field.
In the end you will get empty project.
Alternative solution:
Create empty project folder using your file manager/terminal.
Using PhpStorm use Open from Welcome screen (or File | Open Directory if you have some project already opened") and point to the project root folder -- IDE will create new project (or reuse existing one (if it finds .idea subfolder)) from those files.
I am not sure what "HTML5 Boilerplate
You may click on blue link on the top right corner of that screen and it will take you to the GitHub page for that project.
From there: https://github.com/h5bp/html5-boilerplate
HTML5 Boilerplate is a professional front-end template for building fast, robust, and adaptable web apps or sites.
This project is the product of many years of iterative development and combined community knowledge. It does not impose a specific development philosophy or framework, so you're free to architect your code in the way that you want.

Always include the latest version of custom Google Drive library

I'm trying to link a custom library to a document that will be copied and shared with many people. I want to have all documents link to the latest version of the library, so when I modify the library I don't have to access all the documents to change the link.
This is the scenario:
I created a simple single function library (e.g. library TestLib, function foo()), and saved a first version of it. Then I've created a SpreadSheet with a script that generates a user menu that calls function TestLib.foo(). I've linked version 1 of the library to the script. Now I want to make several copies of the document, one for each people who will need it. The problem is that these documents are linked to version 1 of the library. If I made a change to the library and create a version 2, I have to manually re-link all documents to the new version. That's gonna be lot of work...
Is there a way to have the script to always link to the latest version?
NOTE: the library project is shared in read-only mode (people won't collaborate with the code. They just call foo() from the menu when needed).
Thank!
MIX
I made a new test, trying to overtake the version "limitation" problem.
The idea is a little complicated, but promising. The spreadsheet calls a function in library LinkLib: this library will be saved in a single version and the source code will never modified. The library function simply calls a function on another library (MainLib), whom source code can change over time. Spreadsheet doesn't need to change the version of the linked library (there will never be new version of BaseLib source code), while BaseLib can change the version of MainLib linked if I made changes in MainLib's source code..
The problem is: changing the version of a linked resource is treated as a source code modification. So you need to save a new version of BaseLib to actually use an updated version of MainLib's function.
Hope this mess is somewhat clear...
It makes sense that the described version management behave like this. But damn, I'm still stuck with this problem...
this is possible but with a risk. simply use "development mode" for all documents using the library. whenever you update the library it will include the new code automatically.
the risks are that you will have to be careful to never save an intermediate/partial change as all changes need to not break anything. this can be tricky and is best to have a separate library copy to use when making and testing changes. once tested you may copy all files and "save all" together so the script doesnt have partial saves.
basically you lose the development facilities of using versions.
read more about library development mode in the official docs.

phpstorm unresolved function or method $()

I have the following problem: phpstorm do not recognize jquery methods and here and there I see
Unresolved function or method $()
This was bugging me for sometime but finally I tried to get rid of it with File->Settings->JavaScript->Libraries and adding jquery as a global / project.
My library setup looks like this:
But is has not changed anything. I still see those pesky notices. Does anyone know how to get rid of them?
There is a really stupid workaround,
Download the Library (in this case jQuery) from inside the IDE itself.
Open up settings (Ctrl + Alt + S on Linux)
Navigate to Languages & Frameworks -> Javascript -> Libraries
Click Download and choose jQuery
Hopefully the errors will vanish
EDIT:
After running the IDE through Fiddler, I realised this only solves the problem because of the version the IDE downloads.
So, the correct workaround is to Add older, non-AMD jQuery versions as a Global scoped Library and add the latest one as a Project scope library.
The latest non-AMD versions are:
1.10.2 for 1.x series. And, 2.0.0 for 2.x series.
I had the same issue with version 1.11.2, and resolved it simply by adding the uncompressed version into my js folder.
Just copy the uncompressed version of jQuery into your project folder.
you don't even need to import it into your project, just copy it to javascript folder.
The jQuery v1.11.0 shows exactly the same behaviour here as well. At the same time previous version 1.10.2 works fine in IDE (no warnings).
I think it has something to do with "AMD-fy jQuery source" ticket (http://bugs.jquery.com/ticket/14113) -- looks like IDE has some issues figuring out this style.
If you wish (and can) -- roll back to jQuery v1.10.2 (which is like half a year old, which means it's stable and still good to use).
Hopefully IDE will be able to properly parse this new jQuery style in next release.
Actual ticket: http://youtrack.jetbrains.com/issue/WEB-10908
If you import both 1.11.0 and 1.10.2 in phpstorm it will be resolved
You don't have to rollback your project.

Simple WYSIWYG HTML editpart for eclipse rcp?

I am looking for a Eclipse plugin which I could use to provide a WYSIWYG HTML editor in an Eclipse RCP application.
I need nothing fancy, something with similar functionality to the editor I am using to type this question would be sufficient.
Based on the answers to What is the best HTML editor for Eclipse? there should be one provided by the Web Tools Platform project: Web Page Editor. But I could not figure out its class name to use it inside a View.
A small code example on using it would be especially helpful.
Quick tutorial:
In eclipise:
-import project from cvs, host: dev.eclipse.org, repository path:/cvsroot/webtools, user:anonymous, connection type:pserver
-click next, find and choose plugin org.eclipse.jst.pagedesigner and import it to your workspace
-create Hello RCP
-in plugin.xml tab extension add new: org.eclipse.ui.editor
-in this extension point add new element, editor and set: id- no matter what, but remember it for future (e.g. "editorId"), extensions: xml,html,xhtml class:org.eclipse.jst.pagedesigner.editors.HTMLEditor, contributorClass: org.eclipse.jst.pagedesigner.editors.actions.PageDesignerActionBarContributor2, default: false.
-Now you have to open a file, "transform" to IEditorInput
-call method IWorkbenchPage.openEditor(iEditorInput,"editorId")
Should work!