From: Michael Dale Date: Mon, 7 Sep 2009 17:05:48 +0000 (+0000) Subject: quick hack for addMediaWiz compatibility with usability toolbar X-Git-Tag: 1.31.0-rc.0~39878 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=commitdiff_plain;h=8ef1e417388a072a32ccb9b47748df92abd69434;p=lhc%2Fweb%2Fwiklou.git quick hack for addMediaWiz compatibility with usability toolbar --- diff --git a/js2/editPage.js b/js2/editPage.js index e7055ba053..4deebbcb28 100644 --- a/js2/editPage.js +++ b/js2/editPage.js @@ -24,12 +24,21 @@ var mwEditPageHelper = { init:function(){ var _this = this; //@@todo check for new version of toolbar and via toolbar api: - - //add the add-media-wizard button for old toolbar: - $j('#toolbar').append(''); - $j('#btn-add-media-wiz').addMediaWiz( - mwAddMediaConfig - ); + + //kind of tricky would be nice to use a "loader" call here to avoid concurancy issues. + if( typeof $j.wikiEditor != 'undefined' ){ + setTimeout(function(){ + $j('.wikiEditor-ui [rel=file]').addMediaWiz( + mwAddMediaConfig + ); + },100 ); + }else{ + //add the add-media-wizard button for old toolbar: + $j('#toolbar').append(''); + $j('#btn-add-media-wiz').addMediaWiz( + mwAddMediaConfig + ); + } //add to new toolbar (need to use api) /*$j('[rel=insert] tool-file').addMediaWiz(