Page 8 of 8 FirstFirst ... 678
Results 71 to 80 of 80

Thread: Turn simple javascript code to a button

  1. #71
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,497
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    OK, I tried on that forum (http://scooterdoc.proboards.com) in both Opera and Safari Win, worked fine. If they are still having problems, find out the OS and the browser version number and try to get specifics about the problem.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  2. #72
    Join Date
    Oct 2013
    Posts
    169
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Question John? Now with all the changes of this code do we still need this code that is in my global header? I think we put this in way back for the Quick Reply, would have to go back to the beginning of this thread to see?


    Code:
    <style type="text/css">
    a[href="javascript:postimage_upload(0);"]{
    	display: none;
    }
    </style>

  3. #73
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,497
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Right, get rid of that. As I've been saying, as long as you have the removeEvent (etc.) code:

    Code:
    <script type="text/javascript">
    if(window.addEventListener){window.removeEventListener('DOMContentLoaded',postimage_insert,false);}else if(window.attachEvent){window.detachEvent('onload',postimage_insert);}
    </script>
    You don't need any css to hide the default postimage link or that stupid dot because now they are never created in the first place. We also more recently added styles as i think you summarized here:

    http://www.dynamicdrive.com/forums/s...079#post312079

    I don't think any of those are needed any longer either.

    The only styles we added that we want to keep are from the other thread, these ones for helping in timing out the editor for non-staff:

    Code:
    #nav-tree li, .container.new-area.wysiwyg-area, .container.posts.summary {display: none;}
    #nav-tree li:first-child {display: inline-block;}
    But don't use those unless you are also using the scripts that go with them, otherwise no one will be able to edit anything.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #74
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,497
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    One other thing for now with this code, we can combine two of the scripts - change:

    Code:
    		<script type="text/javascript" src="http://mod.postimage.org/website-english-family.js" charset="utf-8"></script>
    <script type="text/javascript">
    if(window.addEventListener){window.removeEventListener('DOMContentLoaded',postimage_insert,false);}else if(window.attachEvent){window.detachEvent('onload',postimage_insert);}
    </script>
    		<script type="text/javascript">
    if(/postimage_id/.test(location.href)){location.href = 'about:blank';}
    </script>
    to (remove highlighted from above):

    Code:
    		<script type="text/javascript" src="http://mod.postimage.org/website-english-family.js" charset="utf-8"></script>
    <script type="text/javascript">
    if(window.addEventListener){window.removeEventListener('DOMContentLoaded',postimage_insert,false);}else if(window.attachEvent){window.detachEvent('onload',postimage_insert);}
    if(/postimage_id/.test(location.href)){location.href = 'about:blank';}
    </script>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #75
    Join Date
    Oct 2013
    Posts
    169
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    All is well John, removed the unnecessary code and I had already took out all the style sheet codes. Made the changes you said to in that last code and the image posting is perfect on QR and NR!

    Can't thank you enough!

  6. #76
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,497
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Here's one more style rule we added that you can get rid of if you haven't already:

    Code:
    div.message div span, div.message div br {
    	display: none;
    }
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #77
    Join Date
    Oct 2013
    Posts
    169
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Got it! Thanks

  8. #78
    Join Date
    Oct 2013
    Posts
    169
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Hello John long time no talk to. I'm having a little glitch with this code. Please look at the image:

    http://www.jr-richscooterdoc.com/Rich/Ridepic.png

    Notice the " P Add Image To Post " in blue letters on the left side? Also take note of the button you created on the bottom right hand corner of "Insert Image". This button doesn't work but the other does and somehow this was added later on and discontinued our button from working? Please help
    Last edited by JRR; 03-01-2018 at 05:46 AM.

  9. #79
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,497
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Can't tell you much from the image. Guess the image host changed their code. I'll need a link to the page to see if there's anything to be done.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  10. #80
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,497
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I may have spoken too soon. you can likely get rid of their button by changing our code:

    Code:
    <script type="text/javascript">
    if(window.addEventListener){window.removeEventListener('DOMContentLoaded',postimage.init,false);}else if(window.attachEvent){window.detachEvent('onload',postimage.init);}
    if(/postimage_id/.test(location.href)){location.href = 'about:blank';}
    </script>
    To make our button work again you have to change:

    Code:
    postimage_upload
    to:

    Code:
    postimage.upload
    This must be done on the link for our button as well as in the code that changes the editor. Any questions, just let me know
    Last edited by jscheuer1; 03-12-2018 at 04:11 PM. Reason: saw button needed update
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Similar Threads

  1. Please write a simple javascript code for me
    By laperashvili in forum JavaScript
    Replies: 2
    Last Post: 06-18-2012, 03:10 PM
  2. adding rollover button to javascript code
    By Repatilian in forum JavaScript
    Replies: 6
    Last Post: 12-04-2011, 10:28 AM
  3. Help with javascript code to make next and previous button dissapear
    By ajmancilla in forum Looking for such a script or service
    Replies: 1
    Last Post: 02-07-2011, 03:00 PM
  4. Looking for a simple Javascript code for a web board
    By donelian in forum Looking for such a script or service
    Replies: 1
    Last Post: 08-15-2007, 10:24 PM
  5. How to turn a menu into a javascript file?
    By Eternal_Howl in forum JavaScript
    Replies: 4
    Last Post: 07-23-2007, 07:16 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •