Finding and Highlighting Text in Dreamweaver Code View - javascript

I'm working on an extension and I would like to add some functionality so that I can search for a chunk of code and highlight it so that I can then call collapseSelectedCodeFragment on it and automatically collapse said code (just to keep everything organized).
However, I'm not sure how to go about finding and highlighting the code chunk in the code viewer.

This is how I ended up doing this for anyone wondering:
dreamweaver.setUpFind({searchString: newString, searchWhat: "document", searchSource: true});
dreamweaver.canFindNext(true);
dreamweaver.findNext();
dom.collapseSelectedCodeFragment(false);

Related

ReadSpeaker broken webpage in Chrome

We're using ReadSpeaker component for the web.
We have a button for start to read, we call it to a function of Readspeaker called readpage()) the problem starts when we make click on this button the whole web it breaks, is as if the web changes to pdf file without CSS and the button disappear.
Know What is happen? Sorry for can't explain it well I don't know what'sh happen exactly.
Just find the solution!
http://hldev.readspeaker.com/?faq=how-can-i-prevent-javascript-from-breaking-when-readspeaker-is-active
If you have Javascript content inside the reading area these objects can break when ReadSpeaker is active.
This is because we add temporary HTML code to be able to highlight the content that is going to be read.

How to make the HTML page view source UNREADABLE?

We have an option of disabling the right click event on the HTML page at same user can click on view menu > source and can get a copy of the content displayed.
How do i make it into unreadable format? Just like when you do a google search and see the source of page very similar to it? How can this be done?
You can't. You can obfuscate the scripting and minify the html (remove all unnecesary whitespace) that's what google does). So, making the readability of the html (by obfuscation, minification) more difficult is the best option (if you must).
You can also go flash ofcourse, like in this website
How do i make it into unreadable format? well you can't change the format, its plaintext, this is how the browser expects AFAIK, when gmail first came out, its source code was sort of hidden, what they did actually is have the entire source of the page rendered using hidden iframes and JS, as such users would right click and get <!DOCTYPE html><html><head></head><body><div></div></body></html> but this is no longer the case.
how does Gmail hide its source
Try to compress the code using this site http://www.textfixer.com/html/compress-html-compression.php
It will remove all the whitespace and compress the code to make it unreadable.

Sorting a table with PHP

Alright, I'm ready to take the PHP plunge. I've got an HTML5 animation with table sorting tools (a button for "by date," another for "by title"), and I wanted to have these sort a table on the same page. I've Googled around and haven't found any suitably customizable ready-made table sorters, so I've learned some PHP basics as well as a bit of jQuery, and wanted to do this.
The HTML5 animation was compiled in Hype, and is technically an HTML document referring to a .js file.
If this is possible, any help is appreciated.
EDIT
Alright, I've got some code for you. There's more than a bit of it, so brace yourselves. This first one is from the "Hype.js" file, which is the file in question. Once again, this was completely compiled by Hype.
(dead link removed)
Now here's headeranimated_hype_generated_script.js. The second part of the link (starting with http://) is a link to the page I intend to put the table on, but since I've got less than 10 reputation, I'm limited to 2 links.
(dead links removed)
(I figure it's easier to view them in-browser as a standalone page rather than a comment box here)
My concrete question is, is it possible to use PHP or possible jQuery to use custom buttons to sort a table?
You can use the JQuery Table Sorter Plugin.

Micro Javascript templates not rendering correct in IE, but works fine without javascript?

This is a bit of an odd issue I'm having. I've been using John Resig' micro-templates for a meeting minutes application, and it seemed to work well, but lately I've been having an issue.
Basically the application fetches some JSON from an ajax call, and then uses the templating engine to generate a table with various actions like so:
This works fine, its a little slow in IE (javascript rendering) but it works. However randomly I'll get a stuff up in the display:
notice the gap there, its pushed it out wide, also, its made the rest of the rows squish up. I've tried every CSS/HTML trick I can think of to try and get IE to render it properly, but I'm out of ideas (any suggestions would be great!) . I'm using JQuery Sortable so you can drag each of those rows around, I noticed that when you drag it and place it again, it displays correctly. It's as if it thinks theres an extra TD there, when there isn't.
So I opened the IE developer tools and copied the inner HTML of the HTML element. Pasted this into a HTML file and put it on the server, turned off the JS so it wouldn't reload the elements and ran the page. It displays perfectly, just as in my first image.
So I'm confused as to why IE will render the page fine if the HTML is present from the start, but the templating engine causes odd stuff ups.
I'll probably look at rendering that part of the HTML on the server, and only use the templating where I need to. But has anyone come across this sort of issue before? is there any trick I can do to make it render it as it should?
we had similar problem in our company and our designer solved it. Solution was in concatenating tags one after another without spaces and/or without new line. Code is not looking great after that but still solves problem.
Thanks,
Nikola

Eclipse keeps jumping to the start of the document

I have been using Eclipse for some weeks now and I start getting used to it.
However, one thing really annoys me:
When editing JavaScript (I didn't try any other language yet), the editor window keeps jumping to the start of the document I am editing.
This mostly happens when the code currently contains syntax errors and mostly while / after deleting lines.
Especially constructs like { = and sometimes unterminated strings / comments seem to cause this problem.
When it happens, only the view scrolls to the top of the document - the cursor stays where it was before the "jump" occurred.
Anyone having an idea on how to fix this?
I believe the problem described above is related to this bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=318095
The work around is to disable the "Link with Editor" option from the Project Explorer. Which is to say make sure the icon with two arrows facing in opposite directions at the top of the file tree is not enabled. Disabling this option resolved the issue for me.
Looks like a problem with the implementation of the JavaScript editor. Most probably the jump occurs when the JavaScript-Parser is not able to parse your document and throws an exception. You might consider to report a bug to the eclipse project (maybe there is already such a report?).
As a workaround you might consider to adapt your way of typing the code a bit. Try to write the code in a way that does not confuse the parser (for example it might help to immediately close a newly created comment and THEN write the content instead of open the comment, write the content and finally close the commend). Same for strings, blocks ...
I am having the same problem. I had this line of code in my file and I could consistently reproduce the issue:
$.preload(preloadImages
, {
base:assetsUrl+'b/images/',
ext:'.png'
});
I changed it to the following and I no longer have the problem.
$.preload(preloadImages, {
base:assetsUrl+'b/images/',
ext:'.png'
});
I get this Phenomenon, when i'm editing in a Java-Class while still residing in a Debug-Process. The Debugger recognises the Change and reevaluates the Code and jumps back in order to be able to reexecute only the changed Code.
Hii i got solution goto
Window->Preferences->search autosave
and disble it and hit apply and close button.
this worked for me !

Categories