标签: aloha-editor

Selection.addRange()已弃用,将从Chrome中删除

我最近在chrome的控制台日志中注意到以下消息,同时使用aloha编辑器:

aloha.js:14579 - 不推荐使用Selection.addRange()合并现有Range和指定Range的行为,并将于2017年4月左右在M58中删除.有关详细信息,请参阅https://www.chromestatus.com/features/6680566019653632细节.

在尝试寻找替代品时,除了他们要删除它之外我找不到任何东西,所以我想知道Selection.addRange()的替代方法是什么来摆脱这个消息.

javascript google-chrome editor deprecated aloha-editor

13
推荐指数
1
解决办法
7399
查看次数

如何禁用Aloha Editor工具栏?

有没有办法以与侧边栏相同的方式禁用Aloha的ExtJS工具栏?

Aloha.settings =
    modules: ['aloha', 'aloha/jquery']
    editables: '.editable'
    jQuery: $
    sidebar:
        disabled: true
    toolbar:
        disabled: true # does not work
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

javascript jquery wysiwyg aloha-editor

6
推荐指数
1
解决办法
2649
查看次数

听Aloha编辑"aloha-smart-content-changed"活动?

根据Aloha Editor文档,您可以听取"aloha-smart-content-changed"事件的帮助,比如将数据保存到您正在使用的任何持久性机制中.这是我想要做的一个例子:

<html>
  <head>
    <title>Aloha Event Testing</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script src="http://cdn.aloha-editor.org/current/lib/aloha.js" data-aloha-plugins="common/format, common/list, common/link, common/highlighteditables"></script>
    <link href="http://cdn.aloha-editor.org/current/css/aloha.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
      Aloha.ready( function() {
        var $ = Aloha.jQuery;
        $('.editable').aloha();
      });
      $(document).ready(function() {
        $('.editable').bind('aloha-smart-content-changed', function() {
          console.log('Aloha smart event handled.');
        });
      });
    </script>
  </head>
  <body>
    <div class="editable"></div>
  </body>
</html>
Run Code Online (Sandbox Code Playgroud)

但处理程序永远不会触发.与Aloha合作的任何人都知道如何正确地听取这个事件吗?

javascript events aloha-editor

6
推荐指数
1
解决办法
1567
查看次数

如何将Aloha HTML5编辑器修复到页面上的特定位置?

我需要将Aloha编辑器固定到特定位置,而不是在整个页面上弹跳.

那有配置选项吗?有一个"附加"选项用于配置Aloha但我无法弄清楚如何申请,或者即使它能解决我的问题......

如果没有配置选项,也可以打开黑客来覆盖该位置.

html5 aloha-editor

6
推荐指数
1
解决办法
816
查看次数

是否有与Aloha编辑器(或hallo-js)一起使用的wiki?

我有一个DokuWiki的维基设置我的服务器上,我很想能够编辑与行内编辑,一拉阿罗哈编辑器或喂编辑维基.在Aloha编辑主页上,他们提到你可以在传递中使用它作为wiki,但没有更多细节.

我知道我可以通过我的dokuwiki设置完成实现Aloha或Hallo或其他类似编辑器的所有工作,但我想我真正想知道的是,是否有人已经使用任何wiki(dokuwiki或其他)完成此操作.

我正在寻找的最终结果是:你去一个wiki页面,点击内容,用Aloha编辑器等编辑它,然后将新内容保存回服务器.这将允许通过插入链接到尚未创建的页面创建新的wiki页面(通过单击链接按钮或输入,例如:[[新页面链接]].

这是否以某种形式存在于某个地方?

谢谢!

wiki contenteditable aloha-editor hallo-js

6
推荐指数
1
解决办法
595
查看次数

阿罗哈编辑:插入图片/图片

我正在使用Aloha编辑器在由PHP和MySQL支持的网站上编辑内容.它工作正常,但我需要能够插入图像/图片.我找到了一个Aloha编辑器插件.以下是一些链接:

第一个链接中一个例子.但是,我无法在最新版本的Aloha编辑器和jQuery上运行该插件.它无法加载,Chrome说:

image.js:30 Uncaught TypeError: Cannot read property 'fn' of undefined
Run Code Online (Sandbox Code Playgroud)

我没有血腥的线索这意味着什么.

理想情况下,用户应该能够从服务器上的图像列表中选择图像.它们位于一个目录中,并且还有一个MySQL表.我怀疑这是存储库的用武之地,但我无法理解如何实现它.

有没有人在Aloha编辑器中使用这个插件有运气,或者找到任何其他插入图像的方法?

javascript php mysql jquery aloha-editor

5
推荐指数
1
解决办法
5431
查看次数

禁用Aloha Editor侧栏

我想禁用Aloha Editor侧栏.我在各个地方看过以下代码,这对我不起作用:

Aloha.settings = {
  sidebar: { disabled: true }
};
Run Code Online (Sandbox Code Playgroud)

如果我在调用添加它aloha(),没有任何反应,侧边栏仍然存在.如果我调用aloha()元素之前添加它,我会收到以下错误:

Uncaught TypeError: Cannot read property 'getContents' of undefined
Run Code Online (Sandbox Code Playgroud)

Aloha.ready如果我将代码移到我的调用之上,所有这一切都发生在并且没有修复Aloha.ready.

如果它有用,这里是我正在加载的文件<head>:

<script src="http://cdn.aloha-editor.org/latest/lib/require.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://cdn.aloha-editor.org/latest/lib/aloha.js" data-aloha-plugins="common/ui, common/format, common/list, common/link, common/highlighteditables, common/horizontalruler, common/undo, common/paste"></script>
<link href="http://cdn.aloha-editor.org/latest/css/aloha.css" rel="stylesheet" type="text/css" />
Run Code Online (Sandbox Code Playgroud)

(我现在正在添加一些CSS,感觉不对.我更喜欢更好的解决方案.)

javascript aloha-editor

2
推荐指数
1
解决办法
1434
查看次数

jQuery val()在使用Aloha Editor的动态<select>上无法正常工作

我正在<select>通过jQuery append()函数创建一个动态元素,但我似乎无法获得正确的选定值.我总是得到第一个选项,即1.我正在尝试配置Aloha编辑器,这可能与问题有关.

这是附加在侧栏中的select元素.

$('.aloha-sidebar-inner').append('<select id="columns"><option value="1">1 Column</option><option value="2">2 Columns</option><option value="3">3 Columns</option><option value="4">4 Columns</option></select>').trigger('create');
Run Code Online (Sandbox Code Playgroud)

如上所述,我使用Aloha Editor,因此jquery看起来像这样:

    Aloha.ready(function() {
          $('.aloha-sidebar-inner').append('<button id="add-section" class="btn aloha-sidebar-btn sidebar-item" type="button" onclick="addSection(document.getElementById(\'articles\').value);">Add Section</button>');
          $('.aloha-sidebar-inner').append('<p>Number of Columns:</p>');
          $('.aloha-sidebar-inner').append('<select id="articles" class="sidebar-item"><option>1</option><option>2</option><option>3</option><option>4</option></select>');
    });

        function addSection() {     
          var idCounter = 0;
          alert($('#articles').val());
};
Run Code Online (Sandbox Code Playgroud)

警报窗口保持返回值1.可能存在问题,因为我动态创建了select元素?

我尝试过使用$( "#columns option:selected" ).val();但仍然没有.我甚至尝试过使用text(),但仍然没有; alert继续返回第一个选项.

我也试过使用$('#add-section').click$('#articles').change听众,但他们似乎没有回应.

html javascript jquery select aloha-editor

1
推荐指数
1
解决办法
5373
查看次数

Aloha编辑器定制

可以配置Aloha编辑器,使其仅显示粗体,斜体和下划线按钮,这样整个工具栏就不会超过它需要的大小吗?

aloha-editor

0
推荐指数
1
解决办法
2650
查看次数