Example usage for com.liferay.portal.kernel.parsers.bbcode BBCodeTranslatorUtil getEmoticonFiles

List of usage examples for com.liferay.portal.kernel.parsers.bbcode BBCodeTranslatorUtil getEmoticonFiles

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.parsers.bbcode BBCodeTranslatorUtil getEmoticonFiles.

Prototype

public static String[] getEmoticonFiles() 

Source Link

Usage

From source file:com.liferay.frontend.editor.alloyeditor.web.internal.editor.configuration.AlloyEditorBBCodeConfigContributor.java

License:Open Source License

@Override
public void populateConfigJSONObject(JSONObject jsonObject, Map<String, Object> inputEditorTaglibAttributes,
        ThemeDisplay themeDisplay, RequestBackedPortletURLFactory requestBackedPortletURLFactory) {

    super.populateConfigJSONObject(jsonObject, inputEditorTaglibAttributes, themeDisplay,
            requestBackedPortletURLFactory);

    jsonObject.put("allowedContent", Boolean.TRUE);
    jsonObject.put("enterMode", 1);

    String extraPlugins = jsonObject.getString("extraPlugins");

    extraPlugins = extraPlugins.concat(",bbcode,itemselector");

    jsonObject.put("extraPlugins", extraPlugins);

    jsonObject.put("forceEnterMode", Boolean.TRUE);
    jsonObject.put("format_tags", "p;pre");
    jsonObject.put("lang", getLangJSONObject(inputEditorTaglibAttributes));
    jsonObject.put("newThreadURL", MBThreadConstants.NEW_THREAD_URL);

    String removePlugins = jsonObject.getString("removePlugins");

    StringBundler sb = new StringBundler(4);

    sb.append("bidi,colorbutton,colordialog,div,flash,font,forms,");
    sb.append("indentblock,keystrokes,maximize,newpage,pagebreak,");
    sb.append("preview,print,save,showblocks,smiley,stylescombo,");
    sb.append("templates,video");

    jsonObject.put("removePlugins", removePlugins.concat(",").concat(sb.toString()));

    jsonObject.put("smiley_images", toJSONArray(BBCodeTranslatorUtil.getEmoticonFiles()));
    jsonObject.put("smiley_path", HtmlUtil.escape(themeDisplay.getPathThemeImages()) + "/emoticons/");
    jsonObject.put("smiley_symbols", toJSONArray(BBCodeTranslatorUtil.getEmoticonSymbols()));

    jsonObject.put("toolbars", getToolbarsJSONObject(themeDisplay.getLocale()));
}

From source file:com.liferay.frontend.editor.ckeditor.web.editor.configuration.CKEditorBBCodeConfigContributor.java

License:Open Source License

@Override
public void populateConfigJSONObject(JSONObject jsonObject, Map<String, Object> inputEditorTaglibAttributes,
        ThemeDisplay themeDisplay, RequestBackedPortletURLFactory requestBackedPortletURLFactory) {

    super.populateConfigJSONObject(jsonObject, inputEditorTaglibAttributes, themeDisplay,
            requestBackedPortletURLFactory);

    jsonObject.put("allowedContent", Boolean.TRUE);
    jsonObject.put("enterMode", 2);
    jsonObject.put("extraPlugins", "a11yhelpbtn,bbcode,itemselector,wikilink");
    jsonObject.put("fontSize_defaultLabel", "14");
    jsonObject.put("fontSize_sizes", "10/10px;12/12px;14/14px;16/16px;18/18px;24/24px;32/32px;48/48px");
    jsonObject.put("format_tags", "p;pre");
    jsonObject.put("imagesPath", HtmlUtil.escape(themeDisplay.getPathThemeImages()) + "/message_boards/");
    jsonObject.put("lang", getLangJSONObject(inputEditorTaglibAttributes));
    jsonObject.put("newThreadURL", MBThreadConstants.NEW_THREAD_URL);
    jsonObject.put("removePlugins", "bidi,div,elementspath,flash,forms,indentblock,keystrokes,link,"
            + "maximize,newpage,pagebreak,preview,print,save,showblocks," + "templates,video");
    jsonObject.put("smiley_descriptions", toJSONArray(BBCodeTranslatorUtil.getEmoticonDescriptions()));
    jsonObject.put("smiley_images", toJSONArray(BBCodeTranslatorUtil.getEmoticonFiles()));
    jsonObject.put("smiley_path", HtmlUtil.escape(themeDisplay.getPathThemeImages()) + "/emoticons/");
    jsonObject.put("smiley_symbols", toJSONArray(BBCodeTranslatorUtil.getEmoticonSymbols()));
    jsonObject.put("toolbar_bbcode", getToolbarsBBCodeJSONArray(inputEditorTaglibAttributes));
    jsonObject.put("toolbar_phone", getToolbarsPhoneJSONArray(inputEditorTaglibAttributes));
    jsonObject.put("toolbar_tablet", getToolbarsTabletJSONArray(inputEditorTaglibAttributes));
}