[FIX] website_forum:

Remove useless document ready
   Add select2 to frontend to allow public user to use tags
This commit is contained in:
Jeremy Kersten
2014-11-18 16:20:58 +01:00
parent 60faccdcc3
commit c41109f2f0
2 changed files with 11 additions and 11 deletions
@@ -1,4 +1,3 @@
$(document).ready(function () {
openerp.website.if_dom_contains('.website_forum', function () {
$('.karma_required').on('click', function (ev) {
var karma = $(ev.currentTarget).data('karma');
@@ -218,7 +217,7 @@ $(document).ready(function () {
editor.on('instanceReady', CKEDITORLoadComplete);
}
IsKarmaValid = function(eventNumber, minKarma){
function IsKarmaValid(eventNumber, minKarma){
"use strict";
if(parseInt($("#karma").val()) >= minKarma){
CKEDITOR.tools.callFunction(eventNumber,this);
@@ -226,15 +225,12 @@ $(document).ready(function () {
} else {
alert("Sorry you need more than " + minKarma + " Karma.");
}
};
}
CKEDITORLoadComplete = function(){
function CKEDITORLoadComplete(){
"use strict";
$('.cke_button__link').attr('onclick','IsKarmaValid(33,30)');
$('.cke_button__unlink').attr('onclick','IsKarmaValid(37,30)');
$('.cke_button__image').attr('onclick','IsKarmaValid(41,30)');
};
$('.cke_button__link').on('click', function() { IsKarmaValid(33,30); });
$('.cke_button__unlink').on('click', function() { IsKarmaValid(37,30); });
$('.cke_button__image').on('click', function() { IsKarmaValid(41,30); });
}
});
});
@@ -25,6 +25,10 @@
<link rel='stylesheet' href='/website_forum/static/src/css/website_forum.css'/>
<script type="text/javascript" src="/website_forum/static/src/js/website_forum.js"/>
<script type="text/javascript" src="/web/static/lib/jquery.textext/jquery.textext.js"/>
<!-- TODO in master - add select2 in asset front_end from website and remove from asset_editor. -->
<script type="text/javascript" src="/web/static/lib/select2/select2.js"></script>
<link rel="stylesheet" href="/web/static/lib/select2/select2.css"/>
<link rel="stylesheet" href="/website/static/lib/select2-bootstrap-css/select2-bootstrap.css"/>
</xpath>
</template>