Aloha use existing jQuery

316 Views Asked by At

Hey I'm trying to integrate the Aloha-Editor into my Yii-Framework, but I have a little problem. Yii is giving me an instance of jQuery (v 1.8.3) and Aloha is including jQuery (v 1.7.2). Now I want to give Aloha the jQuery from Yii. I've still tryed this Guide but it's not working. I hope you can help me.

<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>

I hope you can help me with this Problem.

1

There are 1 best solutions below

0
On

Try to use this:

//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>

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