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 8104953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:02:23+00:00 2026-06-06T00:02:23+00:00

How do I adding new aloha-button in aloha-multisplit-expanded box. (I want the ability to

  • 0

How do I adding new aloha-button in aloha-multisplit-expanded box. (I want the ability to add unlimted number of styles. of course, not via administrator, but hard coded)

  • 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-06T00:02:25+00:00Added an answer on June 6, 2026 at 12:02 am

    Adding style to aloha editor:
    I will show here how to add simple style named “meg”

    1. Add define to “root” for the button in sites\all\libraries\aloha\aloha\plugins\common\format\nls files.
      “button.meg.tooltip”:”Meg format desctiption”
    2. At sites\all\libraries\aloha\aloha\plugins\common\format\lib\format-plugin.js add to “default button configuration” in “config” array, the name of the class, this way:

      config: [‘strong’, ‘meg’, ‘em’….]

    3. Add implementation for initialize style button in “initButtons” function:
      Under switch(button), add ‘case’ for the new style:

      Notice: ‘span’ tag used for implement ordinary css class with neutral tag.

    4. Define the class “span.meg” as special style:
      Add within your css main file (drupal site theme’s css) “span.meg” class:

      span.meg {
      color: green; }
      
    5. Refresh your site for rebuild, and use the new style in floating aloha

    Sample Code

    // Additional special styles
    case 'charm-meg':
        that.multiSplitItems.push({
            'name' : button,
            'tooltip' : i18n.t('button.' + button + '.tooltip'),
            'iconClass' : 'aloha-button ' + i18n.t('aloha-button-' + button),
            'markup' : jQuery('<span class=' + button + '></span>'),
            'click' : function () {
                var
                    markup = jQuery('<span class=' + button + '></span>'),
                    rangeObject = Aloha.Selection.rangeObject,
                    foundMarkup,
                    selectedCells = jQuery('.aloha-cell-selected');
    
                // formating workaround for table plugin
                if ( selectedCells.length > 0 ) {
                    var cellMarkupCounter = 0;
                    selectedCells.each( function () {
                        var cellContent = jQuery(this).find('div'),
                            cellMarkup = cellContent.find(button);
    
                        if ( cellMarkup.length > 0 ) {
                            // unwrap all found markup text
                            // <td><b>text</b> foo <b>bar</b></td>
                            // and wrap the whole contents of the <td> into <b> tags
                            // <td><b>text foo bar</b></td>
                            cellMarkup.contents().unwrap();
                            cellMarkupCounter++;
                        }
                        cellContent.contents().wrap('<span class=' + button + '></span>');
                    });
    
                    // remove all markup if all cells have markup
                    if ( cellMarkupCounter == selectedCells.length ) {
                        selectedCells.find(button).contents().unwrap();
                    }
                    return false;
                }
                // formating workaround for table plugin
    
                // check whether the markup is found in the range (at the start of the range)
                foundMarkup = rangeObject.findMarkup(function() {
                    return this.nodeName.toLowerCase() == markup.get(0).nodeName.toLowerCase();
                }, Aloha.activeEditable.obj);
    
                if ( foundMarkup ) {
                    // remove the markup
                    if (rangeObject.isCollapsed()) {
                        // when the range is collapsed, we remove exactly the one DOM element
                        GENTICS.Utils.Dom.removeFromDOM(foundMarkup, rangeObject, true);
                    } else {
                        // the range is not collapsed, so we remove the markup from the range
                        GENTICS.Utils.Dom.removeMarkup(rangeObject, markup, Aloha.activeEditable.obj);
                    }
                } else {
                    // when the range is collapsed, extend it to a word
                    if (rangeObject.isCollapsed()) {
                        GENTICS.Utils.Dom.extendToWord(rangeObject);
                    }
    
                    // add the markup
                    GENTICS.Utils.Dom.addMarkup(rangeObject, markup);
                }
                // select the modified range
                rangeObject.select();
                return false;
            },
            'tooltip' : i18n.t('<span class=' + button + '></span>'),
            'toggle' : true
        });
        break;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some problems adding new pages. I want to add new pages only
I have an add button for adding new tabs. The tab list is also
Grabbing delimited dates from database and adding new ones to the list, then want
I have a jqgrid with the add dialog enabled for adding new rows. The
So I am constantly adding new points to a graph and I want all
I'm adding new method 'editpass' to existing REST based User controller. I want to
When adding new DB records to a ListView, I want to update the date/time
I tried following codes for adding new contact which is not working in my
I do not know why after adding new input, Masked Input Plugin does not
I'm adding new element through html() function of jQuery. Then I want to handel

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.