Advertise Here

Author Topic: [Code] Save Headers/Footers to Admin Notepad Button  (Read 2575 times)

0 Members and 1 Guest are viewing this topic.

Offline Agent Moose

  • Moderator
  • *****
  • Posts: 836
  • Do not PM me for Code Support or Request
    • View Profile

  • Total Badges: 32
    Badges: (View All)
    Search Level 6 Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary
[Code] Save Headers/Footers to Admin Notepad Button
« on: November 23, 2009, 03:23:06 pm »
Footers:
Code: [Select]
<script type="text/javascript">
//Created by Agent Moose (http://www.revolution-x.org)
$("input[name*='cmdS']").after(" <input type='button' id='Save2ANotes' value='Save Headers/Footers to Admin Notepad' />"); (document.getElementById("Save2ANotes")) ? document.getElementById("Save2ANotes").onclick = function(){$.post(smf_scripturl + "?action=savenote",{txtnotes: "HEADERS:\n" + $('[name*=txth]').val() + "\n\nFOOTERS:\n" + $('[name*=txtf]').val()}); document.forms[3].submit();} : void(0);
</script>

NOTE:  This code uses Ad Free Credits!

The title says it all.  This adds a button next to the "Save Headers Footers" button labeled "Save Headers/Footers to Admin Notepad".  It's pretty much a way to backup your headers and footers with the press of a button :)

When you click the button, it saves the Headers and Footers, and it saves all the information you have in them into the Admin Notepad.

Enjoy :)

Check out Revolution X's Brand new Code Index!

Offline Jntg4

  • SMF For Free Sr. Member
  • *
  • Posts: 250
    • View Profile

  • Total Badges: 14
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [Code] Save Headers/Footers to Admin Notepad Button
« Reply #1 on: November 23, 2009, 05:00:18 pm »
Why does it use Ad Free credits?

Offline Andrew

  • Helpers
  • *
  • Posts: 2060
  • Andrew at your service
    • View Profile
    • Alabama Weather Prediction

  • Total Badges: 32
    Badges: (View All)
    10 Poll Votes Level 6 Eighth year Anniversary Seventh year Anniversary Sixth year Anniversary
Re: [Code] Save Headers/Footers to Admin Notepad Button
« Reply #2 on: November 23, 2009, 05:20:33 pm »
When you click the Save Headers And Footers to Admin Notepad it will use an ad free credit.

Offline Seldom Fail

  • Helpers
  • *
  • Posts: 2082
  • Helping for 3 years! :)
    • View Profile
    • My Site!

  • Total Badges: 26
    Badges: (View All)
    Sixth year Anniversary Fifth year Anniversary Apple User Search Poll Voter
Re: [Code] Save Headers/Footers to Admin Notepad Button
« Reply #3 on: November 23, 2009, 08:15:42 pm »
Andrew - That didn't answer his question.

Jntg - I think it's because it refreshes the page when you click it.
<--- Donate to SMF For Free! :D

Offline Agent Moose

  • Moderator
  • *****
  • Posts: 836
  • Do not PM me for Code Support or Request
    • View Profile

  • Total Badges: 32
    Badges: (View All)
    Search Level 6 Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary
Re: [Code] Save Headers/Footers to Admin Notepad Button
« Reply #4 on: November 23, 2009, 09:40:32 pm »
Why does it use Ad Free credits?
Because of this:
Code: [Select]
$.post(smf_scripturl + "?action=savenote",{txtnotes: "HEADERS:\n" + $('[name*=txth]').val() + "\n\nFOOTERS:\n" + $('[name*=txtf]').val()});
When you press the button, it opens a page in the background that you can't see.  So its just like loading another page...that you can't see.
« Last Edit: November 23, 2009, 09:42:30 pm by Agent Moose »
Check out Revolution X's Brand new Code Index!

 

Related Topics

  Subject / Started by Replies Last post
4 Replies
1197 Views
Last post June 18, 2007, 04:20:35 am
by never returnz
2 Replies
832 Views
Last post March 22, 2008, 09:46:52 pm
by Aname
3 Replies
1924 Views
Last post April 03, 2008, 06:29:48 am
by Crasy
4 Replies
996 Views
Last post April 05, 2008, 09:43:32 pm
by Abstract
1 Replies
700 Views
Last post January 01, 2009, 01:52:35 pm
by Tuberavens