Dreamweaver CS5 crash when I open certain files - dreamweaver

I've been using CS4 for over a year without problems. Today I installed Dreamweaver CS5 and, well... I have not been able to do my work because it keeps crashing. When i try to open certain files (in this case: index.php) it crashes.
I also had a problem with the "upload on save" option untill I unchecked the "Use alternative FTP move method" option in the server settings.
I've tried googling for this problem without luck. Does anyone know a solution for this?
UPDATE:
After testing every line of code in index.php I finally found the source of the problem. If I add this line to the file:
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Reenie+Beanie">
Dreamweaver CS5 stops working. Could someone with CS5 installed try it?

It's definitely the external links that are the issue. The culprit in my case was a font file also being loaded from Google.
Problem:
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Reenie+Beanie">
Commenting or removing this line does work, but the problem is that I need this font to test the website as I'm developing. What I did instead (since I'm using PHP) was echo out the link so that DW can't try to crawl it.
Solution:
<link rel="stylesheet" type="text/css" href="<?php echo "http://fonts.googleapis.com/css?family=Reenie+Beanie"; ?>">
It's pointless code, but it works - DW will stop hanging and the font will still work when testing in a live environment.

Dreamweaver CS5 definitely has issues with externally sourced items. I just got the same type of failure when trying to include jquery from googleapi:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script>
Removing the line or commenting it out allows Dreamweaver to open and work with the file.

There was a problem with files reaching exactly a file size around 8KB and then Dreamweaver would crash until you went in and adding or removing a character from the file using a different text editor. It happened to me a few times hand coding and saving files.
You may also try saving that font as reenie-beanie.css locally to the site so you get something like:
<link rel="stylesheet" type="text/css" href="media/styles/reenieBeanie.css" />
It's possible that a firewall or something is scaring DW when it reaches out for that file live in the preview or split screen mode.

Great, this post helped me solve my problems of crashed on a specific file in Dreamweaver CS5.
It's indeed the external font that crashes DW.
I found an easy fix, omit the protocol part and it works:
<link href="//fonts.googleapis.com/css?family=Open+Sans:400,700" rel="stylesheet" type="text/css">
and NOT
<link href="http//fonts.googleapis.com/css?family=Open+Sans:400,700" rel="stylesheet" type="text/css">

FIX FOR ME IN LOCAL CSS FILE: I had to right click on each file and try to "Edit with Dreamweaver" until I found the one that really was behind the crashing on start up. I got the crash on index and a specifc css file (local).
I;m using Bootstrap 3. Works fine on my laptop running wamp, but not on my main PC using IIS7. I tried all the other registry cleaning and cache cleaning techniques, but no go until I removed this one piece of code from the local css file.
Hope it helps someone else.
This I removed this section of a css file:
#media (min-width: #screen-sm-min) {
.featured-box{
margin-top:5px;
}
}

First I put the comment tag around the jQuery link to see that it was as suggested above and no it was not.
The problem started after I started the media query in the CSS. I left it fragmented [I had not finished]
Here is the fragment with comment tags around it to disable it.
/*
#media screen and (max-width:
*/
The comment tags for html are different than the css ones they look like this: <!-- [line of html code] -->
For css use: /* [line of CSS code] */
Using the comment tags to disable suspect code is more handy than just deleting things.
Hope that helps somone/
-mack318

Related

FabricJS, How to implement touch controls in fabric js

I have tried the answer from:
https://stackoverflow.com/a/45131912/12114516
But, when I try to drag my canvas around, only blue box appear. So I tried to console log when touch even was registered, and that did not work. This blue drag box covers touch command
This is what I see when i try to drag:
ANSER IS HERE:
I digged around for a bit and found out that the demo:http://fabricjs.com/touch-events
IS USING ANOTHER JS FILE: http://fabricjs.com/lib/fabric_with_gestures.js so what I just go to that website, ctrl+a, ctrl+c, make a new script file, ctrl+v and link my default-fabric js file from html to the new js file instead so how my script src looks like this:
<script src="/script/fabric_with_touch.js"></script>
Remeber that "fabric_with_touch.js" is a file I created and copy and pasted the website contents into. And don't worry, it won't mess with your mouse or keyboard controls.
Welp, I digged around for a bit and found out that the demo:http://fabricjs.com/touch-events
IS USING ANOTHER JS FILE:
http://fabricjs.com/lib/fabric_with_gestures.js
so what I just go to that website, ctrl+a, ctrl+c, make a new script file, ctrl+v
and link my default-fabric js file from html to the new js file instead
so how my script src looks like this:
<script src="/script/fabric_with_touch.js"></script>
Remeber that "fabric_with_touch.js" is a file I created and copy and pasted the website contents into.
And don't worry, it won't mess with your mouse or keyboard controls, I have tried that too

How does restaurant website hide file extension in address bar and code in DevTools?

I really like the website for the restaurant Cafe Rio. However the developers have done 2 interesting things and I'm not sure how they accomplished them.
Effect 1:
Visit the menu page.
In the address bar of your browser you will see,
https://www.caferio.com/menu
Why isn't a file extension listed? For example menu.htm. Are they hiding the extension somehow? Is there some other obvious trick that can accomplish this?
Effect 2: On the same menu page click F12 to open DevTools.
I opened DevTools to see if I could figure out how they hid the file extension. Inside I found another mystery. Listed in order I see:
www.caferio.com
css
img
js
menu
I assume menu is the main document but inside of that doc I don't see any code whatsoever. All that I see is a yellow warning about the SSL certificate. WOW! How are they hiding their code? Thanks so much for any input!
--UPDATE--
For some reason I can now see the code inside menu and it's standard looking HTML. But I still don't see a file extension at the end of menu. How did they make that work? Thanks again!
Effect 1:
The extension isn't needed when you use a http-server like apache,
you can type "rewrite rules" in a special file (.htaccess) to specify the target of any links on your page to a specified target:
RewriteEngine on
RewriteRule ^.*$ index.php
In the entry-file "index.php" you code what the program should do with the request.
But in many cases you don't recreate the whole system, instead you install an CMS like wordpress to manage your page.
Effect 2:
They don't hide any code from you, the code for any effected file can be visited in the debugger tab. But it is minified with post-process-transformer like css-minifier and jsuglify.

Plugin for Indentation in Sublime Text 3 [duplicate]

I've got some poorly-formatted HTML code that I'd like to reformat. Is there a command that will automatically reformat HTML code in Sublime Text 2 so it looks better and is easier to read?
You don't need any plugins to do this.
Just select all lines (CTRL+A) and then from the menu select Edit → Line → Reindent.
This will work if your file is saved with an extension that contains HTML like .html or .php.
If you do this often, you may find this key mapping useful:
{ "keys": ["ctrl+shift+r"], "command": "reindent" , "args": { "single_line": false } }
If your file is not saved (e.g. you just pasted in a snippet to a new window), you can manually set the language for indentation by selecting the menu View → Syntax → language of choice before selecting the reindent option.
There are half a dozen or so ways to format HTML in Sublime. I've tested each of the most popular plugins (see the writeup I did on my blog for full details), but here's a quick overview of some of the most popular options:
Reindent command
Pros:
Ships with Sublime, so no plugin install needed
Cons:
Doesn't delete extra blank lines
Can't handle minified HTML, lines with multiple open tags
Doesn't properly format <script> blocks
Tag
Pros:
Supports ST2/ST3
Removes extra blank lines
No binary dependencies
Cons:
Chokes on PHP tags
Doesn't handle <script> blocks correctly
HTMLTidy
Pros:
Handles PHP tags
Some settings to tweak formatting
Cons:
Requires PHP (falls back to web service)
ST2 only
Abandoned?
HTMLBeautify
Pros:
Supports ST2/ST3
Simple and no binaray dependencies
Support for OS X, Win and Linux
Cons:
Chokes a bit with inline comments
Does not expand minimized or compressed code
HTML-CSS-JS Prettify
Pros:
Supports ST2/ST3
Handles HTML, CSS, JS
Great integration with Sublime's menus
Highly customizable
Per-project settings
Format on save option
Cons:
Requires Node.js
Not great for embedded PHP
Which is best?
HTML-CSS-JS Prettify is the winner in my book. Lots of great features, not much to complain about.
The only package I've been able to find is Tag.
You can install it using the package control. https://sublime.wbond.net
After installing package control. Go to package control (Preferences -> Package Control) then type install, hit enter. Then type tag and hit enter.
After installing Tag, highlight the text and press the shortcut Ctrl+Alt+F.
I recommend this plugin: HTML/CSS/JS Prettify, It really works.
After the installation, just select the code and press CTRL+SHIFT+H.
Done!
Just a general tip. What I did to auto-tidy up my HTML, was install the package HTML_Tidy, and then add the following keybinding to the default settings (which I use):
{ "keys": ["enter"], "command": "html_tidy" },
this runs HTML Tidy with every enter. There may be drawbacks to this, I'm quite new to Sublime myself, but it seems to do what I want :)
Altough the question is for HTML, I would also additionally like to give info about how to auto-format your Javascript code for Sublime Text 2;
You can select all your code(CTRL+A) and use the in-app functionality, reindent(Edit -> Line -> Reindent) or you can use JsFormat formatting plugin for Sublime Text 2 if you would like to have more customizable settings on how to format your code to addition to the Sublime Text's default tab/indent settings.
https://github.com/jdc0589/JsFormat
You can easily install JsFormat with using Package Control (Preferences -> Package Control) Open package control then type install, hit ENTER. Then type js format and hit ENTER, you're done.
(The package controller will show the status of the installation with success and errors on the bottom left bar of Sublime)
Add the following line to your key bindings (Preferences -> Key Bindings User)
{ "keys": ["ctrl+alt+2"], "command": "js_format"}
I'm using CTRL+ALT+2, you can change this shortcut key whatever you want to. So far, JsFormat is a good plugin, worth to try it!
Hope this will help someone.
For me, the HTML Prettify solution was extremely simple. I went to the HTML Prettify page.
Needed the Sublime Package Manager
Followed the Instructions for installing the package manager here
typed CMD+SHIFT+P to bring up the menu
Typed prettify
Chose the HTML prettify selection in the menu
Boom. Done. Looks great
There's a plugin called SublimeHtmlTidy which works pretty well
https://github.com/welovewordpress/SublimeHtmlTidy
Simply go to
Edit -> Tag -> Auto-format tags on document
I created a Package called HTMLBeautify that does a decent job of reformatting HTML. I based it off of a Perl script I found back in 1997—I updated it to work with all the new fangled modern tags. :)
Check it out and let me know what you think!
https://github.com/rareyman/HTMLBeautify
I think this is what you're looking for:
https://github.com/victorporof/Sublime-HTMLPrettify
I am yet to have the privilege to comment so this is simply additional information related to #peter's answer above answer.
I found HTML did not align as expected if IE conditional comments in the header were not completely in-line e.g. flush to the left:
<!--[if lt IE 7]>
<p class='chromeframe'>Your browser is <em>unsupported</em>. Upgrade to a different browser or install Google Chrome Frame to experience this site.</p>
<![endif]-->
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
There is a nice open source CodeFormatter plugin, which(along reindenting) can beautify dirty code even all of it is in single line.
I'm using tidy together with custom build system to prettify HTML.
I have HTMLTidy.sublime-build in my Packages/User/ directory:
{
"cmd": ["tidy", "-config", "$packages/User/tidy_config.cfg", "$file"]
}
and tidy_config.cfg file in the same directory:
indent: auto
tab-size: 4
show-warnings: no
write-back: yes
quiet: yes
indent-cdata: yes
tidy-mark: no
wrap: 0
And just select build system and press CTRL+B or CMD+B to reformat file content. One minor issue with that is that ST2 does not automatically reload the file so to see the results you have to switch to some other file and back (or to other application and back).
On Mac I've used macports to install tidy, on Windows you'd have to download it yourself and specify working directory in the build system, where tidy is located:
"working_dir": "c:\\HTMLTidy\\"
or add it to the PATH.
you can set shortcut key F12 easy!!!
{ "keys": ["f12"], "command": "reindent" , "args": { "single_line": false } }
see detail here.
HTML-CSS-JS Prettify - Hands down the best.
Install Package Control
⌘ + left shift + p (or ctrl + alt + left shift + p) -> Package Control: Install Package
Enter HTML-CSS-JS Prettify
Install node
Restart Sublime Text
Enjoy.

What is the Dreamweaver Shortcut code for adding PHP tags around a string of HTML?

Is it possible to write a php open and close tag around html tags in dreamweaver (as a shortcut), like it work with comments?
Example:
before:
<label>Demotext</label>
after:
<?php echo '<label>Demotext</label>'?>
EDIT: I guess i explained wrong what I want:
I have a lot of working html code. I have to pack every single line between <?php and ?>. Thats why I asked if there is a Dreamweaver Shortcut for this. For example there is a Shortcut for comments (via right click and use HTML Comment).
I hope now you understand me right.
Have you searched this site page:
http://www.dreamweavershortcuts.co.uk/pages/allshortcuts.htm

<!-- MENU-LOCATION=NONE --> dreamweaver cs5 error

when ever i try to insert image or swf file in dreamweaver cs5. i am getting this error
also getting this error within head tags
anyone knows about it ?
All other things being equal, it sounds like Dreamweaver has gone corrupt. You may want to follow the steps in this KB article to reset the preferences.
http://kb2.adobe.com/cps/839/cpsid_83912.html
If that doesn't fix it, an uninstall/reinstall usually does.

Resources