facebook

inline Javascript double click selection

  1. MyEclipse Archived
  2.  > 
  3. Web Development (HTML, CSS, etc.)
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #239163 Reply

    rogue_dev
    Member

    In the following snippet:

    <td onClick="doSomething('idname');">

    When I double click on doSomething, the editor selects doSomething(, that is it selects the function name and also the leading bracket.

    Ecplise 3.1, MyEcplise 4.0GA, using the classic JSP editor

    P.S. As a side issue, in this forum’s message composition, when I click on the Preview button, I get taken to http://www.myeclipseide.com/index.php.

    #239206 Reply

    Riyad Kalla
    Member

    rogue,
    I believe this issue is tied into the bounds-checking from your other lengthy post that we filed. Did you expect it to highlight the method name only (doSomething) exlcuding the opening brace?

    #239236 Reply

    rogue_dev
    Member

    @support-rkalla wrote:

    rogue,
    I believe this issue is tied into the bounds-checking from your other lengthy post that we filed. Did you expect it to highlight the method name only (doSomething) exlcuding the opening brace?

    Yes. I renamed (refactored) the function in an included .js file, then needed to rename the function in the JSP. In the .js file I double-clicked on the function name, which highlighted only the function name, pressed CRL-C, then switched o the JSP file, doubled-clicked on the functin name, and pressed CTRL-V.

    Then I tested, except I had JavaScript errors. Examining the JSP code, I saw that the bracket had disappeared. Some quick tests showed that double-clicking on the function name in the inline JavaScript hightlighted not only the function name, but also the opening bracket.

    I expect a double-click to highlight a function name (or variable), and NOT to include non-name characters. So A-z, 0-9, and the underscore, but not delimiting characters such as a period, bracket, space, etc.

    BTW, the double-click highlight in portions of MyEcplise is not consistent with the double-click highlight in the Eclipse Java editor.

    In a Java file, if I double-click in an import statement, only the characters between the periods are highlighted:
    import ca.abc.def.hij.MyClass

    Whereas the same mouse action in a JSP will highlite the text between the double quotes:
    <%@ page import=”ca.abc.def.hij.MyClass” %>

    The same action occurs in the web.xml file, that is the entire package path is highlighted rather than just the portion under the mouse cursor.

    Hmmm, I did a little experimenting. It seems that the bounds checker selects between quotes, so:

    onClick=”aFunction();” will highlight everything between the double quotes, but,
    onClick=”aFunction(‘abc’);” will highlight from the double quote on the left to the first single quote on the right, as both ” and ‘ are valid quoting characters in JavaScript.

    #239240 Reply

    rogue_dev
    Member

    And more highlighting.

    If I have:
    <%@ include file=”..\..\_include\_header.jspf” %>

    double clicking on include will highlight just include, double-clicking on header will highlight header.jspf, both missing the leading underscore.

    For
    <img src=”<%= Pages.getImageRoot() %>banner.gif”>

    double clicking on banner will highlight %>banner.gif

    However double clicking on getImageRoot will highlight just the method name, IMHO the correct action.

    #239252 Reply

    Riyad Kalla
    Member

    Thank you for the details rogue, I have added them to the issue I filed earlier.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: inline Javascript double click selection

You must be logged in to post in the forum log in