1

嘿,我正在尝试将 Aloha-Editor 集成到我的 Yii 框架中,但我有一个小问题。Yii 给了我一个 jQuery (v 1.8.3) 的实例,Aloha 包括了 jQuery (v 1.7.2)。现在我想给 Aloha 来自 Yii 的 jQuery。我仍然尝试过本指南,但它不起作用。我希望你能帮助我。

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="language" content="de" />
<link rel="stylesheet" type="text/css" href="/CMS/assets/e5e98a0c/css/aloha.css" />
<link rel="stylesheet" type="text/css" href="/CMS/css/bootstrap/css/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="/CMS/themes/wood/css/bootstrap-theme.css" />
<script type="text/javascript" src="/CMS/assets/bd973420/jquery.js"></script>
<script type="text/javascript" src="/CMS/assets/bd973420/jui/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="/CMS/assets/e5e98a0c/js/require.js"></script>
<script type="text/javascript" src="/CMS/assets/e5e98a0c/js/aloha.js" data-aloha-plugins="custom/save,common/ui,common/format,common/highlighteditables"></script>
... 
</head>
<body>
...
<script type="text/javascript">
/*<![CDATA[*/
Aloha.settings = {"saveUrl":"http:\/\/localhost\/CMS\/index.php\/site\/updateContent","locale":"de","plugins":{"format":{"config":["b","i","sub","sup","p","h2","h3","h4","h5","h6"]}},"baseUrl":"\/CMS\/assets\/e5e98a0c\/","sidebar":{"disabled":true}}
Aloha.ready( function() {
Aloha.jQuery('.edit').aloha();
});

Aloha.ready( function() {setTimeout('Aloha.Sidebar.right.hide();', 10);});
/*]]>*/
</script>

我希望你能帮助我解决这个问题。

4

1 回答 1

0

尝试使用这个:

//Yii-Framework jQuery
<script src="<path to Yii-Framework jQuery>/jquery-1.8.3.js"></script>
//Aloha jQuery
<script src="/CMS/assets/e5e98a0c/js/lib/vendor/jquery-1.7.2.js"></script>
    <script>
        Aloha = window.Aloha || {};
        Aloha.settings = Aloha.settings || {};
        // Restore the global $ and jQuery variables of your project's jQuery
        Aloha.settings.jQuery = window.jQuery.noConflict(true);
    </script>
    <link rel="stylesheet" href="/CMS/assets/e5e98a0c/css/aloha.css" type="text/css">
    <script src="/CMS/assets/e5e98a0c/js/require.js"></script>
    <script type="text/javascript" src="/CMS/assets/e5e98a0c/js/aloha.js" data-aloha-plugins="custom/save,common/ui,common/format,common/highlighteditables"></script>

检查http://www.aloha-editor.org/guides/dependencies.html

于 2014-01-21T17:39:32.923 回答