2014-01-09 17 views
1

嘿,我試圖將Aloha編輯器集成到我的Yii-Framework中,但我遇到了一些問題。 Yii給我一個jQuery實例(v 1.8.3),而Aloha包含jQuery(v 1.7.2)。現在我想從Yii給Aloha jQuery。我仍然嘗試this Guide,但它不起作用。我希望你能幫助我。Aloha使用現有的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> 

我希望你能幫助我解決這個問題。

+0

http://www.aloha-editor.org/guides/dependencies.html – ineersa

+0

我checkt這已經出來了,但沒有奏效爲了我 – mrbirne

回答

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