Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7993647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:54:55+00:00 2026-06-04T13:54:55+00:00

Have been trying to add a custom button for about 2 hours and I

  • 0

Have been trying to add a custom button for about 2 hours and I just can’t get it to work. I don’t know much about javascript maybe that’s why. I did manage to get the button to show up and open a popup, but that’s as far as I got.

I want the button to insert t he following into the HTML section of tinymce:

‘

Here is my dialog.js file:

tinyMCEPopup.requireLangPack();

var InsertQuoteDialog = {
    init: function () {
        var s = tinyMCEPopup.editor.selection.getContent({ format: 'text' });
        if (s.trim().length > 0) {
            document.forms[0].blizzQuote.value = s.trim();
        }
    },

    insert: function () {
        var s1 = '<p class="blizzardQuote" ';
        s1 += Encoder.htmlEncode(document.forms[0].blizzQuote.value.trim()) + '</p>';

        tinyMCEPopup.editor.execCommand('mceInsertContent', false, s1);
        tinyMCEPopup.close();
    }
};

String.prototype.trim = function () {
    return this.replace(/^\s*/, "").replace(/\s*$/, "");
}

tinyMCEPopup.onInit.add(InsertQuoteDialog.init, InsertQuoteDialog);

And my Dialog.htm file:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>{#example_dlg.title}</title>
    <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
    <script type="text/javascript" src="js/dialog.js"></script>
</head>
<body>

<form onsubmit="InsertQuoteDialog.insert();return false;" action="#">
    <p>Blizzard Quote</p>
    <p>Blizzard Quote: <input id="blizzQuote" name="blizzQuote" type="text" class="text" /></p>

    <div class="mceActionPanel">
    <div style="float: left">
        <input type="button" id="insert" name="insert" value="{#insert}" onclick="InsertQuoteDialog.insert();" />
    </div>
    <div style="float: right">
        <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
    </div>
    </div>
</form>

</body>
</html>

Basically when I click on insert nothing happens.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T13:54:57+00:00Added an answer on June 4, 2026 at 1:54 pm

    A quick look at the javaScript console should show you that you are getting a JavaScript error on the dialog with the Encoder object not being known.

    Simply include the JS file that defines Encoder on your dialog and it should all be good.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to get a custom inventory script working in unrealscript. I
I have been trying to add to the Watch window a Java Date object
At www.euroworker.no/order I have been trying to add a tooltip function but it seems
I have been trying and trying and looking for ways/tutorials on how to add
I want to add a thumbnail picture viewer to my application.I have been trying
I have been trying all afternoon to get the jQuery Sifr Plugin ( http://jquery.thewikies.com/sifr/
I've been trying to add HTML content to a web view, but can't seem
Been trying to add custom post type which was successful the problem i am
I have been trying to add/implement this example to my existing Split View app
I have been trying to build a custom uitableview swipe. I am successful in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.