WebStorm 10 v Dreamweaver library Items - dreamweaver

When managing large sites its useful in Dreamweaver to create library items which are snippets of HTML, usual headers or footers, that once embedded in a file can be updated and those changes are propagated throughout the site pages. Is there anything similar with WebStorm 10? I know there is File and Code Templates and #parse directives but that seems to be only insert into a new file... Any pointers appreciated.

Related

How can I remove Un-used CSS, Images & JS codes in Sublime Text 3

How can I remove un-used CSS, Images & JS codes from my project?
If a project is bigger; usually there are lots of trash codes specifically if the project is built based on another similar project.
May be its late for this answer but, i have the same thinking an i can just tell you to few options.
There is NodeJS powered libraries doing the cleaning unused css selectors. Some of them really smart even if you used merged class name parts in javascript.
You can find those just by google it like "remove unused css"
And, i find the few videos on youtube about same topic. One of them using Visual Studio for this job but i dont tried this. Link here: Youtube Link
Another option is Chrome Dev Tool. Just use chrome developer tools audits tab.
Sorry for little confusing text but i have only those.
I hope it will fix your problem or satisfy expectations.

Unwanted chars appended while rendering partial view in nodejs and expressjs

I'm trying to use nested view with DustJS (linkedin fork) with ExpressJS. While rendering the response system generates some escape chars in response. Which disturb the style and theme.
The same code renders fine as one view file, but when split code into two view files (one load as partial) than the problem arise.
Interesting thing is, it happens with two view engines I tried, the same issue, ECT and DustJS. Development on minimal components, Twitter Bootstrap 3.0 and express are additional component added so far.
My machine is running windows as operating system and development tool is visual studio. What could be reasons, has anyone find same trouble with these view engines?
View in Google Chrome Developer Tool.
Response-Text View
I tried to fiddle and tried to map the extra chars.
You have an UTF-8 BOM in one of the files you are using, usually in the first 3 bytes. Normally, a text editor will not show you these characters. Examine your used files with a hex editor (or write a script that examines those files for you) & store the offending file without that UTF-8 BOM, and configure all your editors to omit the BOM in future.
In addition to Wrikken's answer, if you are using Visual studio than it cab be fixed by advance save option.

Visual Studio 2012 not recognising Javascript in .js file

I have a number of my own .js files containing javascript code in a MVC4 project in Visual Studio 2012. The intellisense does not work in these .js files and the error checking is showing spurious errors such as 'Too many characters in character literal' and 'a namespace cannot directly contain members such as field'.
I think what is happening is that it is not identifying the code as javascript (including the jquery files auto added by the mvc4 template). Possibly the file type .js is not associated to Javascript. I've tried Tools -> Optioins -> Text Editor -> File Extension & added js as Script Editor but that didn't work.
If I put a script block in a cshtml page it identifies my Javascript code perfectly but I need to separate my js into separate files.
Any help would be much appreciated :-)
It sounds like you set the Build Action to Compile, which treats it as C#.
Set it to Content instead.

SharePoint Designer: how do I disable auto insertion of image size attributes?

I'm hand-editing HTML files in a plain text editor (vim) via SharePoint Designer. Problem is, as soon as I save the files, SharePoint automatically adds width and height attributes to all the img-tags.
Anyone know if it's possible to disable this "feature"?
I don't want it to mess around with my code. Yeah, shouldn't be using SharePoint Designer then, I know - problem is that's not an option.
Sorry, that's a bug and as far as I know there's nothing you can do about it. The only way I found around it is by actually packaging up the (.aspx) files in a wsp solution, deploying them ready made to the site collection.
For regular Html editing, SP designer sucks balls.

Displaying code snippets in Sharepoint wiki

Is there a way to get SharePoint to display code snippets in a pre-formatted way?
Currently if you insert any code, it just looks exactly like the rest of the text. Anything would be better than nothing.
I found hilite.me which produces html styled code which you can insert into a sharpoint wiki.
It supports a number of languages and styles and is an online app.
No because MOSS's wiki is just a new page with the word "wiki" attached to the link.
Even though this is an old question, I have yet another solution that possibly didn't exist at the time the question was asked:
You can create a GitHub Gist and use the embed code for the Gist on the SharePoint wiki page. This is especially useful if you are already using Gist, want to share the code snippet in multiple places aside from the wiki, and/or want to keep a history of the code snippet separate from the rest of the wiki page.
To use an embed code without the script tags being stripped, go to Insert > Embed Code in the ribbon when editing the page:
This solution assumes that you are using an IDE that already formats the code for you.
Some of the other answers would be better if you have a raw text file.
While editing a Sharepoint Wiki page:
Copy code from IDE to new MS Word doc
Highlight all in MS Word: Ctrl+A
Copy again inside MS Word
Switch to wiki page, Paste
Continue editing wiki or save
Works fine with Eclipse as IDE. Might be able to paste straight from VS to SharePoint.
If you have code snippets you will reuse in multiple pages, Use a similar copy/paste technique to save or upload htm files into a SharePoint document library and then insert a "Page Viewer Web Part" to view the htm inside a different page.
Not that I'm aware of if you're specifically using the Wiki feature. Your wiki entries are stored like rows in a table as far as I know. If you're not using the wiki you can use the syntax highlighter tool. It's all javascript. http://code.google.com/p/syntaxhighlighter/
For several weeks we are using Telerik Rad Editor
One of the tools is "Format Code Block"
You may see it here : http://demos.telerik.com/aspnet-ajax/Editor/Examples/Default/DefaultCS.aspx
If you install the RadEditor for MOSS .. we will get this amazing tool in Wiki pages too.
So this is not a great answer but for us it was better then the default. You can write your wiki in a tool like Windows Live writer (WLW). WLW has an add in for a code formatter. If you write your wiki page via WLW with the code formatter you can then go to the Wiki page and select "edit HTML source." You can then copy from WLW to the wiki page and get good styling.
Best way I have found is to use tohtml.com
You can cut and paste your code into it and it will generate html that you can past into your sharepoint wiki
you can use prisimjs to show code snippets. When you add prisimjs and css you can use like this;
p { color: red }
if you want easier solution to use prisimjs, you can check this:
http://yasingokhanyuksel.blogspot.com.tr/2017/07/sharepoint-code-syntax-highlighting.html
If you want this for modern pages, there is the Source code content webpart from Qualitem.
https://spfxhub.com/packages/qualitem-source-code-content-web-part
Disclaimer: I am a co-developer.

Resources