• Hi,
    I was wondering if someone could help me do a custom edit to my quicktags.js file.
    What I’d like is for the “img” button to act a bit differently.
    Now when I press it, it asks me for an image name and description.
    Say I put “myphoto.jpg” and no description, I get the following code inserted:
    <img src=”myphoto.jpg” alt=”” />
    What I’d LIKE is for the code to spit out:
    <img src=”photos/myphoto.jpg” />
    Anyone have any ideas what code to put in quicktags.js to make this happen?
    THANKS!!!

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter friend_of_grommit

    (@friend_of_grommit)

    I appreciate your response, but my question was different than that.
    But now that I look at my original post, I see what happened!
    I meant to ask how to make the code spit out:

    <img src="photos/myphoto.jpg"/>

    I forgot to put my request within the code html so the a href part was hidden. Whoops. 🙂
    Anyhow, I’d like the “IMG” button to spit out the href and all.
    Any ideas what I need to add/change in quicktags.js?
    Thanks!

    Thread Starter friend_of_grommit

    (@friend_of_grommit)

    It did it again! I don’t know how to post my question without the href= part from being literally interpretted and applied to my text.
    how about this: {lt} = < and {gt} = >
    I want the img tag to put out:
    {lt}a href=”/photos/hi-res/myphoto.jpg” target=”_blank”{gt}{lt}img src=”photos/myphoto.jpg” /{gt}{lt}/a{gt}

    Thread Starter friend_of_grommit

    (@friend_of_grommit)

    This looks like it SHOULD work, but when I try to use it, no code is inserted.
    i wonder if it’s the double use of + myValue? I only say that because when I remove one of them, then it inserts code (but then I have to type in the image name again. 🙁
    I’m not advanced enough with js to know how to make this work. 🙁

    I actaully tried this code before pasting it here so I know it works. myValue is just a variable that holds the image name, it can be re-used as many times as you wish when making the final string.
    If you have an email address, I can email you the code I have and see if that works better than cutting and pasting.
    Regards

    Thread Starter friend_of_grommit

    (@friend_of_grommit)

    hmm, I don’t like posting my email address on websites because of spambots. I do however want to get help on this…
    you can email me at:
    m a r k at nopam s o h m e r dot n e t
    remove spaces and “nospam”
    THANKS! 🙂

    Thread Starter friend_of_grommit

    (@friend_of_grommit)

    I got your email. I uploaded your file and it does the SAME thing mine does: nothing.
    It prompts me for the name of the file and for the description, but when I put it in no code is entered. 🙁

    Which browser are you using? I’m using FireFox..it might have something to do with your browser’s JS support.
    Regards

    Thread Starter friend_of_grommit

    (@friend_of_grommit)

    I’m also using Firefox, but have teted with IE as well. The other tags all work, just the img doesn’t. 🙁

    Then I’m really at a loss here as to why things aren’t working as they do on my local installation here.

    Cached ?
    Delete the old file – deliberately generate an error.
    Upload new file ?

    Thread Starter friend_of_grommit

    (@friend_of_grommit)

    I clear the cache each time before I re-try. I will try again.

    Thread Starter friend_of_grommit

    (@friend_of_grommit)

    Whoops, okay, I feel a bit sheepish…
    After sleeping on it, I looked at the code again and I saw that in cutting and pasting I left out the part that says:
    edInsertContent(myField, myValue);
    Whoops!
    Code is working EXACTLY as I wanted it to now! 🙂
    THANK YOU THANK YOU.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘changing quicktags.js’ is closed to new replies.