Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Load alloyeditor only once and apply module configuration #492

Closed
wants to merge 11 commits into from
Commits on Jul 14, 2014
  1. @sergiogonzalez @jbalsas

    wip

    sergiogonzalez authored jbalsas committed
  2. @jbalsas

    Update build.xml

    authored jbalsas committed
  3. @jbalsas
  4. @jbalsas

    Update alloy.jsp

    authored jbalsas committed
  5. @jbalsas

    Rename alloy editor

    authored jbalsas committed
  6. @jbalsas

    Add init, focus, blur, etc. methods to Alloy Editor

    authored jbalsas committed
  7. @jbalsas

    Get placeholder value from data-placeholder attribute

    authored jbalsas committed
  8. @jbalsas

    Fix editor placeholder class

    authored jbalsas committed
Commits on Jul 16, 2014
  1. @jbalsas

    Create skin

    jbalsas authored
  2. @jbalsas
  3. @jbalsas
This page is out of date. Refresh to see the latest.
View
1  .gitignore
@@ -152,6 +152,7 @@ cobertura.ser
/portal-web/docroot/html/js/aui
+/portal-web/docroot/html/js/editor/alloyeditor
/portal-web/docroot/html/js/editor/ckeditor
/portal-web/docroot/html/js/editor/codepress
/portal-web/docroot/html/js/editor/tiny_mce
View
2  portal-impl/src/portal.properties
@@ -5214,7 +5214,7 @@
#
editor.wysiwyg.default=ckeditor
editor.wysiwyg.portal-web.docroot.html.portlet.announcements.edit_entry.jsp=ckeditor
- editor.wysiwyg.portal-web.docroot.html.portlet.blogs.edit_entry.jsp=ckeditor
+ editor.wysiwyg.portal-web.docroot.html.portlet.blogs.edit_entry.jsp=alloyeditor
editor.wysiwyg.portal-web.docroot.html.portlet.mail.edit.jsp=ckeditor
editor.wysiwyg.portal-web.docroot.html.portlet.mail.edit_message.jsp=ckeditor
editor.wysiwyg.portal-web.docroot.html.portlet.message_boards.edit_message.bb_code.jsp=ckeditor_bbcode
View
57 portal-web/build.xml
@@ -7,6 +7,7 @@
<property name="alloy.version" value="3.0.0pr1" />
<property name="alloy-font-awesome.version" value="1.0.0" />
+ <property name="alloyeditor.version" value="0.1.0" />
<property name="ckeditor.file" value="ckeditor_4.3.5_liferay.zip" />
<property name="scayt.file" value="scayt_4.3.5.zip" />
<property name="tinymce.file" value="tinymce_3.5.6.zip" />
@@ -78,6 +79,8 @@
<delete dir="docroot/html/js/aui" />
<delete dir="docroot/html/themes/_unstyled/images/aui" />
+ <echo>${alloy.file}</echo>
+
<unzip src="third-party/${alloy.file}" dest="docroot/html/ALLOY_ZIP" />
<!-- CSS -->
@@ -221,6 +224,59 @@
</antcall>
</target>
+ <target name="build-alloy-editor">
+ <path id="alloyeditor.zip.path">
+ <fileset dir="third-party">
+ <include name="alloy-editor-${alloyeditor.version}.zip" />
+ </fileset>
+ </path>
+
+ <property name="alloyeditor.zip.path" refid="alloyeditor.zip.path" />
+
+ <basename file="${alloyeditor.zip.path}" property="alloyeditor.file" />
+
+ <if>
+ <not>
+ <uptodate
+ srcfile="third-party/${alloyeditor.file}"
+ targetfile="docroot/html/js/editor/alloyeditor"
+ />
+ </not>
+ <then>
+ <delete dir="docroot/html/js/editor/alloyeditor" />
+
+ <echo>${alloyeditor.file}</echo>
+
+ <unzip src="third-party/${alloyeditor.file}" dest="docroot/html/js/editor/_tmp" />
+
+ <copy todir="docroot/html/js/editor/alloyeditor" overwrite="true" preservelastmodified="true">
+ <fileset dir="docroot/html/js/editor/_tmp/alloy-editor-${alloyeditor.version}/alloy-editor" />
+ </copy>
+
+ <copy todir="docroot/html/js/editor/alloyeditor" overwrite="true" preservelastmodified="true">
+ <fileset dir="docroot/html/js/editor/alloyeditor_diffs" />
+ </copy>
+
+ <concat destfile="docroot/html/js/editor/alloyeditor/assets/lfr-alloy-editor.css" append="true">
+ <fileset file="docroot/html/js/editor/alloyeditor/assets/alloy-editor.css" />
+ <fileset dir="docroot/html/js/editor/alloyeditor_diffs" includes="**/*.css" />
+ </concat>
+
+ <delete dir="docroot/html/js/editor/_tmp" />
+ </then>
+ <else>
+ <copy todir="docroot/html/js/editor/alloyeditor" preservelastmodified="true">
+ <fileset dir="docroot/html/js/editor/alloyeditor_diffs" />
+ </copy>
+
+ <concat destfile="docroot/html/js/editor/alloyeditor/assets/lfr-alloy-editor.css" append="true">
+ <fileset file="docroot/html/js/editor/alloyeditor/assets/alloy-editor.css" />
+ <fileset dir="docroot/html/js/editor/alloyeditor_diffs" includes="**/*.css" />
+ </concat>
+ </else>
+ </if>
+ </target>
+
<target name="build-alloy-font-awesome">
<path id="alloy-font-awesome.zip.path">
<fileset dir="third-party">
@@ -1043,6 +1099,7 @@ Please set the property "jdk.6.home" in build.properties.
<target name="deploy">
<antcall target="build-alloy" />
+ <antcall target="build-alloy-editor" />
<antcall target="build-ckeditor" />
<antcall target="build-dtd" />
<antcall target="build-tinymce" />
View
231 portal-web/docroot/html/js/editor/alloyeditor.jsp
@@ -0,0 +1,231 @@
+<%--
+/**
+ * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ */
+--%>
+
+<%@ include file="/html/taglib/init.jsp" %>
+
+<%
+String portletId = portletDisplay.getRootPortletId();
+
+String mainPath = themeDisplay.getPathMain();
+
+String doAsUserId = themeDisplay.getDoAsUserId();
+
+if (Validator.isNull(doAsUserId)) {
+ doAsUserId = Encryptor.encrypt(company.getKeyObj(), String.valueOf(themeDisplay.getUserId()));
+}
+
+long doAsGroupId = themeDisplay.getDoAsGroupId();
+
+String alloyEditorConfigFileName = ParamUtil.getString(request, "ckEditorConfigFileName");
+
+if (!_alloyEditorConfigFileNames.contains(alloyEditorConfigFileName)) {
+ alloyEditorConfigFileName = "alloyconfig.jsp";
+}
+
+Map<String, String> configParamsMap = (Map<String, String>)request.getAttribute("liferay-ui:input-editor:configParams");
+
+String configParams = marshallParams(configParamsMap);
+
+String contentsLanguageId = (String)request.getAttribute("liferay-ui:input-editor:contentsLanguageId");
+String cssClasses = GetterUtil.getString((String)request.getAttribute("liferay-ui:input-editor:cssClasses"));
+String editorImpl = (String)request.getAttribute("liferay-ui:input-editor:editorImpl");
+String name = namespace + GetterUtil.getString((String)request.getAttribute("liferay-ui:input-editor:name"));
+String initMethod = (String)request.getAttribute("liferay-ui:input-editor:initMethod");
+boolean inlineEdit = GetterUtil.getBoolean((String)request.getAttribute("liferay-ui:input-editor:inlineEdit"));
+
+String onBlurMethod = (String)request.getAttribute("liferay-ui:input-editor:onBlurMethod");
+
+if (Validator.isNotNull(onBlurMethod)) {
+ onBlurMethod = namespace + onBlurMethod;
+}
+
+String onChangeMethod = (String)request.getAttribute("liferay-ui:input-editor:onChangeMethod");
+
+if (Validator.isNotNull(onChangeMethod)) {
+ onChangeMethod = namespace + onChangeMethod;
+}
+
+String onFocusMethod = (String)request.getAttribute("liferay-ui:input-editor:onFocusMethod");
+
+if (Validator.isNotNull(onFocusMethod)) {
+ onFocusMethod = namespace + onFocusMethod;
+}
+
+boolean resizable = GetterUtil.getBoolean((String)request.getAttribute("liferay-ui:input-editor:resizable"));
+boolean skipEditorLoading = GetterUtil.getBoolean((String)request.getAttribute("liferay-ui:input-editor:skipEditorLoading"));
+%>
+
+<c:if test="<%= !skipEditorLoading %>">
+ <liferay-util:html-top outputKey="js_editor_alloyeditor_skip_editor_loading">
+ <link href="<%= PortalUtil.getStaticResourceURL(request, themeDisplay.getCDNHost() + themeDisplay.getPathJavaScript() + "/editor/alloyeditor/assets/lfr-alloy-editor.css") %>" rel="stylesheet" type="text/css" />
+
+ <%
+ long javaScriptLastModified = ServletContextUtil.getLastModified(application, "/html/js/", true);
+ %>
+
+ <script src="<%= HtmlUtil.escape(PortalUtil.getStaticResourceURL(request, themeDisplay.getCDNHost() + themeDisplay.getPathJavaScript() + "/editor/alloyeditor/ckeditor/ckeditor.js", javaScriptLastModified)) %>" type="text/javascript"></script>
+
+ <script src="<%= HtmlUtil.escape(PortalUtil.getStaticResourceURL(request, themeDisplay.getCDNHost() + themeDisplay.getPathJavaScript() + "/editor/alloyeditor/core.js", javaScriptLastModified)) %>" type="text/javascript"></script>
+
+ <script type="text/javascript">
+ Liferay.namespace('EDITORS')['<%= editorImpl %>'] = true;
+ </script>
+ </liferay-util:html-top>
+</c:if>
+
+<script type="text/javascript">
+ CKEDITOR.disableAutoInline = true;
+
+ CKEDITOR.env.isCompatible = true;
+</script>
+
+<aui:script use="aui-base">
+ YUI.applyConfig({
+ groups: {
+ AlloyEditor: {
+ base: Liferay.AUI.getJavaScriptRootPath() + '/editor/alloyeditor/',
+ combine: true,
+ comboBase: Liferay.AUI.getComboPath(),
+ root: Liferay.AUI.getJavaScriptRootPath() + '/editor/alloyeditor/'
+ }
+ }
+ });
+
+ window['<%= name %>'] = {
+ destroy: function() {
+ CKEDITOR.instances['<%= name %>'].destroy();
+
+ window['<%= name %>'] = null;
+ },
+
+ focus: function() {
+ CKEDITOR.instances['<%= name %>'].focus();
+ },
+
+ getCkData: function() {
+ var data;
+
+ if (!window['<%= name %>'].instanceReady && window['<%= HtmlUtil.escapeJS(namespace + initMethod) %>']) {
+ data = window['<%= HtmlUtil.escapeJS(namespace + initMethod) %>']();
+ }
+ else {
+ data = CKEDITOR.instances['<%= name %>'].getData();
+
+ if (CKEDITOR.env.gecko && (CKEDITOR.tools.trim(data) == '<br />')) {
+ data = '';
+ }
+ }
+
+ return data;
+ },
+
+ getHTML: function() {
+ return window['<%= name %>'].getCkData();
+ },
+
+ getText: function() {
+ return window['<%= name %>'].getCkData();
+ },
+
+ instanceReady: false,
+
+ <c:if test="<%= Validator.isNotNull(onBlurMethod) %>">
+ onBlurCallback: function() {
+ window['<%= HtmlUtil.escapeJS(onBlurMethod) %>'](CKEDITOR.instances['<%= name %>']);
+ },
+ </c:if>
+
+ <c:if test="<%= Validator.isNotNull(onChangeMethod) %>">
+ onChangeCallback: function() {
+ var ckEditor = CKEDITOR.instances['<%= name %>'];
+ var dirty = ckEditor.checkDirty();
+
+ if (dirty) {
+ window['<%= HtmlUtil.escapeJS(onChangeMethod) %>'](window['<%= name %>'].getText());
+
+ ckEditor.resetDirty();
+ }
+ },
+ </c:if>
+
+ <c:if test="<%= Validator.isNotNull(onFocusMethod) %>">
+ onFocusCallback: function() {
+ window['<%= HtmlUtil.escapeJS(onFocusMethod) %>'](CKEDITOR.instances['<%= name %>']);
+ },
+ </c:if>
+
+ setHTML: function(value) {
+ CKEDITOR.instances['<%= name %>'].setData(value);
+ }
+ };
+
+ CKEDITOR.inline(
+ '<%= name %>',
+ {
+ customConfig: '<%= PortalUtil.getPathContext() %>/html/js/editor/alloyeditor/<%= HtmlUtil.escapeJS(alloyEditorConfigFileName) %>?p_p_id=<%= HttpUtil.encodeURL(portletId) %>&p_main_path=<%= HttpUtil.encodeURL(mainPath) %>&contentsLanguageId=<%= HttpUtil.encodeURL(contentsLanguageId) %>&colorSchemeCssClass=<%= HttpUtil.encodeURL(themeDisplay.getColorScheme().getCssClass()) %>&cssClasses=<%= HttpUtil.encodeURL(cssClasses) %>&cssPath=<%= HttpUtil.encodeURL(themeDisplay.getPathThemeCss()) %>&doAsGroupId=<%= HttpUtil.encodeURL(String.valueOf(doAsGroupId)) %>&doAsUserId=<%= HttpUtil.encodeURL(doAsUserId) %>&imagesPath=<%= HttpUtil.encodeURL(themeDisplay.getPathThemeImages()) %>&inlineEdit=<%= inlineEdit %><%= configParams %>&languageId=<%= HttpUtil.encodeURL(LocaleUtil.toLanguageId(locale)) %>&name=<%= name %>&resizable=<%= resizable %>',
+ }
+ );
+
+ if (window['<%= name %>Config']) {
+ window['<%= name %>Config']();
+ }
+
+ var destroyInstance = function(event) {
+ if (event.portletId === '<%= portletId %>') {
+ try {
+ var ckeditorInstances = window.CKEDITOR.instances;
+
+ A.Object.each(
+ ckeditorInstances,
+ function(value, key) {
+ var inst = ckeditorInstances[key];
+
+ delete ckeditorInstances[key];
+
+ inst.destroy();
+ }
+ );
+ }
+ catch(error) {
+ }
+
+ Liferay.detach('destroyPortlet', destroyInstance);
+ }
+ };
+
+ Liferay.on('destroyPortlet', destroyInstance);
+</aui:script>
+
+<%!
+public String marshallParams(Map<String, String> params) {
+ if (params == null) {
+ return StringPool.BLANK;
+ }
+
+ StringBundler sb = new StringBundler(4 * params.size());
+
+ for (Map.Entry<String, String> configParam : params.entrySet()) {
+ sb.append(StringPool.AMPERSAND);
+ sb.append(configParam.getKey());
+ sb.append(StringPool.EQUAL);
+ sb.append(HttpUtil.encodeURL(configParam.getValue()));
+ }
+
+ return sb.toString();
+}
+
+private static Set<String> _alloyEditorConfigFileNames = SetUtil.fromArray(new String[] {"alloyconfig.jsp"});
+%>
View
78 portal-web/docroot/html/js/editor/alloyeditor_diffs/alloyconfig.jsp
@@ -0,0 +1,78 @@
+<%--
+/**
+ * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ */
+--%>
+
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+
+<%@ page import="com.liferay.portal.kernel.language.LanguageUtil" %>
+<%@ page import="com.liferay.portal.kernel.util.ContentTypes" %>
+<%@ page import="com.liferay.portal.kernel.util.HtmlUtil" %>
+<%@ page import="com.liferay.portal.kernel.util.LocaleUtil" %>
+<%@ page import="com.liferay.portal.kernel.util.ParamUtil" %>
+
+<%@ page import="java.util.Locale" %>
+
+<%
+String contentsLanguageId = ParamUtil.getString(request, "contentsLanguageId");
+
+Locale contentsLocale = LocaleUtil.fromLanguageId(contentsLanguageId);
+
+contentsLanguageId = LocaleUtil.toLanguageId(contentsLocale);
+
+String languageId = ParamUtil.getString(request, "languageId");
+
+Locale locale = LocaleUtil.fromLanguageId(languageId);
+
+languageId = LocaleUtil.toLanguageId(locale);
+
+String name = ParamUtil.getString(request, "name");
+
+response.setContentType(ContentTypes.TEXT_JAVASCRIPT);
+%>
+
+;window['<%= HtmlUtil.escapeJS(name) %>Config'] = function() {
+ var alloyEditor = CKEDITOR.instances['<%= HtmlUtil.escapeJS(name) %>'];
+
+ var config = alloyEditor.config;
+
+ config.allowedContent = true;
+
+ <%
+ String contentsLanguageDir = LanguageUtil.get(contentsLocale, "lang.dir");
+ %>
+
+ config.contentsLangDirection = '<%= HtmlUtil.escapeJS(contentsLanguageDir) %>';
+
+ config.contentsLanguage = '<%= contentsLanguageId.replace("iw_", "he_") %>';
+
+ alloyEditor.config.removePlugins = 'contextmenu,toolbar,elementspath,resize,liststyle,tabletools,link';
+ alloyEditor.config.extraPlugins = 'uicore,selectionregion,dropimages,placeholder,linktooltip,uiloader';
+
+ alloyEditor.config.title = false;
+
+ alloyEditor.config.placeholderClass = 'alloy-editor-placeholder';
+
+ alloyEditor.config.bodyClass = 'alloy-editor';
+
+ config.language = '<%= languageId.replace("iw_", "he_") %>';
+
+ alloyEditor.config.toolbars = {
+ add: ['image', 'code'],
+ image: ['left', 'right'],
+ styles: ['strong', 'em', 'u', 'h1', 'h2', 'a', 'twitter']
+ };
+};
+
+window['<%= HtmlUtil.escapeJS(name) %>Config']();
View
76 portal-web/docroot/html/js/editor/alloyeditor_diffs/assets/font.css
@@ -0,0 +1,76 @@
+@font-face {
+ font-family: 'alloyeditor';
+ src:url('fonts/alloyeditor.eot?-pjq331');
+ src:url('fonts/alloyeditor.eot?#iefix-pjq331') format('embedded-opentype'),
+ url('fonts/alloyeditor.woff?-pjq331') format('woff'),
+ url('fonts/alloyeditor.ttf?-pjq331') format('truetype'),
+ url('fonts/alloyeditor.svg?-pjq331#alloyeditor') format('svg');
+ font-weight: normal;
+ font-style: normal;
+}
+
+[class^="alloy-editor-icon-"], [class*=" alloy-editor-icon-"] {
+ font-family: 'alloyeditor';
+ speak: none;
+ font-style: normal;
+ font-weight: normal;
+ font-variant: normal;
+ text-transform: none;
+ line-height: 1;
+
+ /* Better Font Rendering =========== */
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.alloy-editor-icon-bold:before {
+ content: "\e600";
+}
+.alloy-editor-icon-italic:before {
+ content: "\e601";
+}
+.alloy-editor-icon-underline:before {
+ content: "\e602";
+}
+.alloy-editor-icon-h1:before {
+ content: "\e603";
+}
+.alloy-editor-icon-h2:before {
+ content: "\e604";
+}
+.alloy-editor-icon-unlink:before {
+ content: "\e605";
+}
+.alloy-editor-icon-twitter:before {
+ content: "\e606";
+}
+.alloy-editor-icon-font:before {
+ content: "\e607";
+}
+.alloy-editor-icon-image:before {
+ content: "\e608";
+}
+.alloy-editor-icon-add:before {
+ content: "\e609";
+}
+.alloy-editor-icon-code:before {
+ content: "\e60a";
+}
+.alloy-editor-icon-ok:before {
+ content: "\e60b";
+}
+.alloy-editor-icon-remove-small:before {
+ content: "\e60c";
+}
+.alloy-editor-icon-link:before {
+ content: "\e60d";
+}
+.alloy-editor-icon-align-left:before {
+ content: "\e60e";
+}
+.alloy-editor-icon-align-center:before {
+ content: "\e60f";
+}
+.alloy-editor-icon-align-right:before {
+ content: "\e610";
+}
View
BIN  portal-web/docroot/html/js/editor/alloyeditor_diffs/assets/fonts/alloyeditor.eot
Binary file not shown
View
27 portal-web/docroot/html/js/editor/alloyeditor_diffs/assets/fonts/alloyeditor.svg
@@ -0,0 +1,27 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata>Generated by IcoMoon</metadata>
+<defs>
+<font id="alloyeditor: 2014" horiz-adv-x="512">
+<font-face units-per-em="512" ascent="480" descent="-32" />
+<missing-glyph horiz-adv-x="512" />
+<glyph unicode="&#x20;" d="" horiz-adv-x="256" />
+<glyph unicode="&#xe600;" d="M56.889 377.6v91.022h398.222v-91.022h-147.911v-398.222h-105.245v398.222h-145.066z" />
+<glyph unicode="&#xe601;" d="M281.6 417.422l-91.022-440.889h-68.266l93.867 440.889h-167.822l11.378 56.889h401.067l-11.378-56.889h-167.822z" />
+<glyph unicode="&#xe602;" d="M88.178 423.111v48.356h335.644v-48.356h-139.378v-372.622h-56.889v372.622h-139.378zM88.178-23.466v28.445h338.489v-28.445h-338.489z" />
+<glyph unicode="&#xe603;" d="M59.733 471.466v-190.578c5.689 11.378 11.378 19.911 19.911 28.444s17.067 14.222 28.445 19.911c11.378 5.689 19.911 8.534 31.289 11.378s22.756 2.844 31.289 2.844c22.756 0 42.666-2.844 56.889-8.534s28.445-14.222 36.978-28.444c14.222-11.378 19.911-25.6 25.6-39.822 2.844-17.067 5.689-34.134 5.689-54.045v-236.089h-56.889v241.778c0 22.756-5.689 39.822-19.911 54.044-14.222 11.378-31.289 19.911-54.044 19.911-17.066 0-34.133-2.845-45.511-8.534-14.222-5.689-25.6-14.222-34.133-25.6-8.534-8.534-14.222-19.911-19.911-34.134s-5.689-28.445-5.689-45.511v-201.955h-56.889v494.933h56.889zM452.267-23.466v352.711h-125.156v45.511c17.067 0 31.289 0 48.356 2.845 14.222 2.844 28.445 8.534 42.666 14.222 11.378 5.689 22.755 17.067 31.289 28.445s14.222 28.445 17.067 45.511h45.511v-492.089h-59.733z" />
+<glyph unicode="&#xe604;" d="M65.422 451.555v-176.356c5.689 14.222 11.378 22.756 19.911 28.445s17.067 14.222 25.6 17.067 19.911 8.534 28.445 8.534c11.378 2.844 19.911 2.844 28.445 2.844 19.911 0 39.822-2.844 54.044-8.534 14.222-2.844 25.6-11.378 34.133-22.756s14.222-22.755 17.067-36.978c2.844-14.222 5.689-31.289 5.689-48.356v-219.022h-51.2v221.867c0 19.911-5.689 36.978-17.066 48.356-14.222 14.222-28.445 19.911-48.356 19.911-17.066 0-31.289-2.844-42.666-8.534s-22.755-11.378-28.445-22.756c-11.378-8.534-17.067-19.911-19.911-31.289s-5.689-25.6-5.689-42.666v-184.889h-54.044v455.111h54.044zM352.711 352c5.689 19.911 14.222 36.978 28.445 51.2s28.445 25.6 45.511 34.134c17.067 8.534 39.822 11.378 62.578 11.378 19.911 0 36.978-2.844 54.044-8.534s31.289-14.222 42.667-25.6c11.378-11.378 22.755-25.6 28.444-39.822 8.534-17.066 11.378-34.133 11.378-56.889 0-19.911-2.845-36.978-8.534-54.044-5.689-14.222-14.222-28.445-22.755-42.666-11.378-11.378-22.755-22.755-34.134-34.133-14.222-8.534-25.6-19.911-39.822-28.445s-28.445-17.067-39.822-25.6c-14.222-8.534-25.6-17.067-36.978-25.6s-19.911-19.911-28.445-31.289c-8.534-11.378-14.222-22.755-17.067-36.978h227.556v-42.666h-290.134c2.844 25.6 5.689 51.2 14.222 68.267 8.534 19.911 17.067 36.978 28.445 48.356 11.378 14.222 22.755 25.6 36.978 36.978s28.445 19.911 45.511 31.289c19.911 11.378 34.133 22.755 48.356 34.133s25.6 19.911 34.133 31.289c8.534 11.378 17.067 22.755 19.911 34.134 5.689 11.378 8.534 25.6 8.534 42.666 0 11.378-2.845 22.756-5.689 34.133-5.689 11.378-11.378 19.911-17.067 25.6-8.534 8.534-17.067 14.222-28.444 17.067s-22.755 5.689-34.134 5.689c-14.222 0-28.445-2.844-39.822-8.534s-19.911-14.222-28.445-25.6c-8.534-11.378-11.378-22.756-14.222-36.978s-5.689-28.445-2.844-39.822h-54.044c0 17.067 0 36.978 5.689 56.889z" horiz-adv-x="637" />
+<glyph unicode="&#xe605;" d="M475.022 269.511c48.355 48.356 48.355 125.156 0 173.511s-125.156 48.356-173.511 0l-59.733-62.578-93.867 93.867-36.978-36.978 361.245-361.245 36.978 36.978-93.867 93.867 59.733 62.578zM349.866 391.822c19.911 19.911 54.044 19.911 73.956 0s19.911-54.044 0-73.956l-62.578-62.578-73.956 73.956 62.578 62.578zM162.133 56.178c-19.911-19.911-54.044-19.911-73.956 0s-19.911 54.044 0 73.956l93.867 93.867-51.2 48.355-93.867-93.866c-48.355-48.356-48.355-125.156 0-173.511s125.155-48.356 173.511 0l93.867 93.866-48.356 51.2-93.867-93.867z" />
+<glyph unicode="&#xe606;" d="M659.911 411.733c0 0-2.845 0-2.845 0-19.911-8.534-39.822-14.222-59.734-17.066 22.755 17.066 39.822 36.978 48.356 62.578 0 0 0 2.844 0 2.844s-2.845 0-2.845 0c-25.6-14.222-51.2-22.755-79.644-28.445-25.6 25.6-59.733 39.822-96.711 39.822-73.956 0-133.689-56.889-133.689-128 0-8.534 0-17.066 2.844-25.6-108.089 5.689-204.8 54.045-270.222 128 0 0-2.844 0-2.844 0s-2.844 0-2.844-2.844c-11.378-14.222-17.067-36.978-17.067-59.734 0-39.822 19.911-73.955 51.2-99.555-17.067 2.844-31.289 5.689-48.355 14.222 0 0-2.845 0-2.845 0s-2.844-2.845-2.844-2.845v-2.844c0-56.889 39.822-105.245 93.867-122.311-14.222-2.844-28.445-2.844-45.511 0 0 0-2.844 0-2.844 0s0-2.844 0-2.844c17.067-48.356 62.578-82.489 116.622-88.178-45.511-31.289-96.711-48.356-153.6-48.356-11.378 0-19.911 0-31.289 2.844-2.845 0-2.845 0-2.845-2.844 0 0 0-2.844 0-2.844 59.733-36.978 130.845-56.889 201.956-56.889 236.089 0 375.466 182.044 375.466 355.555 0 5.689 0 8.534 0 14.222 25.6 17.066 48.356 39.822 65.422 62.578 2.845 5.689 2.845 8.534 2.845 8.534z" horiz-adv-x="674" />
+<glyph unicode="&#xe607;" d="M14.222 411.733v54.045h386.844v-54.045h-162.133v-429.511h-62.578v429.511h-162.133zM395.378 235.378l-54.045-253.156h-36.978l54.045 253.155h-96.711l5.689 31.289h230.4l-8.534-31.289h-93.866z" />
+<glyph unicode="&#xe608;" d="M19.911-12.089v472.178h472.178v-472.178h-472.178zM449.422 417.422h-386.844v-287.289h389.689v287.289h-2.844zM182.044 215.466l45.511 73.956 45.511-48.356 65.422 96.711 68.267-167.822h-298.666l36.978 76.8 36.978-31.289zM153.6 295.111c-17.066 0-31.289 14.222-31.289 31.289s14.222 31.289 31.289 31.289 31.289-14.222 31.289-31.289c0-17.067-14.222-31.289-31.289-31.289v0z" />
+<glyph unicode="&#xe609;" d="M204.8 468.622h105.245v-196.267h179.2v-108.089h-179.2v-184.889h-105.245v179.2h-182.044v113.778h182.044v196.267z" />
+<glyph unicode="&#xe60a;" d="M344.178 400.356l-54.044-54.044 125.156-122.311-125.156-125.156 54.044-54.045 159.289 179.2-159.289 176.356zM167.822 400.356l-159.289-176.356 159.289-176.356 54.044 54.044-125.156 122.311 125.156 125.156-54.044 51.2z" />
+<glyph unicode="&#xe60b;" d="M8.534 224c0 8.534 2.845 17.066 8.534 22.756l42.666 42.667c5.689 5.689 14.222 8.534 22.756 8.534s17.067-2.845 22.755-8.534l93.866-93.866 210.489 210.489c5.689 5.689 14.222 8.534 22.755 8.534s17.067-2.845 22.755-8.534l42.666-42.667c5.689-5.689 8.534-14.222 8.534-22.755s-2.844-17.067-8.534-22.755l-273.067-273.067c-5.689-5.689-14.222-8.534-22.756-8.534s-17.066 2.844-22.756 8.534l-162.133 156.445c-5.689 5.689-8.534 14.222-8.534 22.756z" />
+<glyph unicode="&#xe60c;" d="M72.534 343.466l64 68.267 123.733-123.733 110.933 110.933 68.267-68.267-110.933-110.933 115.2-115.2-68.267-64-110.933 110.933-115.2-115.2-68.266 72.534 110.933 110.933-119.466 123.733z" />
+<glyph unicode="&#xe60d;" d="M457.955 428.8v0c-45.511 45.511-116.622 45.511-159.289 2.844l-99.555-99.555c-45.511-45.511-45.511-116.622 0-159.289l2.845-2.844c2.845-2.844 5.689-5.689 8.534-8.534l39.822 34.134c-8.534 2.844-8.534 5.689-14.222 8.534l-2.845 2.844c-22.756 22.756-22.756 59.733 0 82.489l102.4 99.556c22.755 22.755 59.733 22.755 85.334 0v0c22.755-22.756 22.755-59.734 0-82.489l-45.511-45.511c5.689-19.911 14.222-42.667 8.534-59.734l71.111 71.111c48.356 39.822 48.356 113.778 2.844 156.445zM310.045 283.733c-2.844 2.844-5.689 5.689-8.534 8.534l-39.822-34.133c8.534-2.845 8.534-5.689 14.222-8.534l2.844-2.845c22.755-22.755 22.755-59.733 0-82.489l-102.4-99.555c-22.756-22.755-59.733-22.755-85.334 0v0c-22.755 22.755-22.755 59.733 0 82.489l45.511 45.511c-8.534 17.067-14.222 39.822-11.378 59.733l-71.111-71.111c-45.511-45.511-45.511-116.622 0-159.289l2.844-2.844c45.511-45.511 116.622-45.511 159.289 0l99.555 99.555c39.822 51.2 39.822 116.622-5.689 164.978v0z" />
+<glyph unicode="&#xe60e;" d="M0 448h512v-64h-512zM0 352h320v-64h-320zM0 160h320v-64h-320zM0 256h512v-64h-512zM0 64h512v-64h-512z" />
+<glyph unicode="&#xe60f;" d="M0 448h512v-64h-512zM96 352h320v-64h-320zM96 160h320v-64h-320zM0 256h512v-64h-512zM0 64h512v-64h-512z" />
+<glyph unicode="&#xe610;" d="M0 448h512v-64h-512zM192 352h320v-64h-320zM192 160h320v-64h-320zM0 256h512v-64h-512zM0 64h512v-64h-512z" />
+</font></defs></svg>
View
BIN  portal-web/docroot/html/js/editor/alloyeditor_diffs/assets/fonts/alloyeditor.ttf
Binary file not shown
View
BIN  portal-web/docroot/html/js/editor/alloyeditor_diffs/assets/fonts/alloyeditor.woff
Binary file not shown
View
183 portal-web/docroot/html/js/editor/alloyeditor_diffs/skin/main.css
@@ -0,0 +1,183 @@
+@import "compass";
+@import "mixins";
+
+.cke_editable.cke_editable_inline {
+ outline: 0;
+}
+
+.alloy-editor-toolbar {
+ border: solid 1px;
+
+ .alloy-editor-toolbar-content {
+ .alloy-editor-button {
+ @include transition-property(color);
+
+ border: none;
+ border-left: solid 1px;
+ border-right: solid 1px;
+
+ &:hover {
+ border-left: solid 1px;
+ border-right: solid 1px;
+ }
+
+ &:first-child {
+ border-left: none;
+ }
+
+ &:last-child {
+ border-right: none;
+ }
+ }
+
+ .link-wrapper {
+ .alloy-editor-button {
+ border: none;
+ }
+
+ .input-wrapper {
+ margin: 3px 0;
+
+ .input-container {
+ padding: 1px;
+
+ input {
+ border: none;
+ margin: 0;
+ padding: 2px 5px;
+ }
+
+ .input-clear {
+ margin: 0 6px;
+ }
+ }
+ }
+
+ .switch-to-edit {
+ margin-left: 2px;
+ }
+
+ .show-buttons-container, .input-close-container {
+ margin-top: 2px;
+ }
+ }
+ }
+}
+
+.alloy-editor-tooltip-link {
+ border: solid 1px;
+ padding: 3px 2px;
+
+ .link-container {
+ .icon-link-container {
+ vertical-align: middle;
+ }
+ }
+}
+
+/* Skin */
+
+.cke_editable.cke_editable_inline {
+ $prefixes: ("-webkit-", "-moz-", "-o-", "");
+ @each $prefix in $prefixes {
+ ::#{$prefix}selection {
+ background: #E1EDF9 !important;
+ color: #000;
+
+ @include text-shadow(none);
+ }
+ }
+}
+
+.alloy-editor-toolbar {
+ @include background-image(linear-gradient(#278FE2, #1B7BC8));
+ @include border-radius(3px);
+ @include opacity(0.95);
+
+ border-color: #327CB4;
+
+ &.alloy-editor-arrow-box-bottom {
+ &:before {
+ border-top-color: #327CB4;
+ }
+
+ &:after {
+ border-top-color: #1B7BC8;
+ }
+ }
+
+ &.alloy-editor-arrow-box-top {
+ &:before {
+ border-bottom-color: #327CB4;
+ }
+
+ &:after {
+ border-bottom-color: #278FE2;
+ }
+ }
+
+ .alloy-editor-toolbar-content {
+ .alloy-editor-button {
+ @include box-shadow(none);
+
+ background-color: transparent;
+ background-image: none;
+ border-left-color: #348BD3;
+ border-right-color: #2C83CD;
+ color: #124E8D;
+
+ &:focus, &:active {
+ color: #124E8D;
+ }
+
+ &:hover {
+ @include box-shadow(none);
+
+ background-image: none;
+ border-left-color: #348BD3;
+ border-right-color: #2C83CD;
+ color: #FFF;
+ }
+
+ &.yui3-button-selected {
+ color: #FFF;
+ }
+ }
+
+ .link-wrapper {
+ .input-wrapper {
+ .input-container {
+ border-color: #DDD;
+
+ .input-clear {
+ color: #CCC;
+ font-size: 1.1em;
+ }
+ }
+ }
+
+ .input-close-container {
+ background: transparent;
+
+ .alloy-editor-button {
+ color: #FFF;
+ }
+ }
+ }
+ }
+}
+
+.alloy-editor-tooltip-link {
+ @include background-image(linear-gradient(#278FE2, #1B7BC8));
+ @include border-radius(3px);
+ @include opacity(0.95);
+
+ border-color: #327CB4;
+ color: #FFF;
+
+ .link-container {
+ .link-preview {
+ color: #FFF;
+ }
+ }
+}
View
2  portal-web/docroot/html/portlet/blogs/edit_entry.jsp
@@ -119,6 +119,8 @@ boolean showHeader = ParamUtil.getBoolean(request, "showHeader", true);
<aui:field-wrapper label="content">
<liferay-ui:input-editor editorImpl="<%= EDITOR_WYSIWYG_IMPL_KEY %>" />
+ <div class="alloy-editor-placeholder" contenteditable="true" id="<portlet:namespace />editor" data-placeholder="Write blog content here" style="min-height: 300px; min-width: 300px">Write blog content here</div>
+
<aui:input name="content" type="hidden" />
</aui:field-wrapper>
View
BIN  portal-web/third-party/alloy-editor-0.1.0.zip
Binary file not shown
Something went wrong with that request. Please try again.