You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

55 lines
2.5 KiB

  1. if (opener != null && opener.CKEDITOR !== undefined) {
  2. window.onload = function () {
  3. var _action = '?ns=&edid=wiki__text&onselect=ckg_edit_mediaman_insert&ckg_media=img&CKEditor=wiki__text&CKEditorFuncNum=1&langCode=en';
  4. if ((location.search.split("ckg_media=")[1]||"").split("&")[0] == "link") {
  5. _action = '?ns=&edid=wiki__text&onselect=ckg_edit_mediaman_insertlink&ckg_media=link&CKEditor=wiki__text&CKEditorFuncNum=1&langCode=en';
  6. jQuery(".select").on("click", function(event) {
  7. var $link, id;
  8. event.preventDefault();
  9. $link = jQuery(this);
  10. id = $link.attr("id").substr(2);
  11. dw_mediamanager.insert(id);
  12. return;
  13. });
  14. } else if ((location.search.split("ckg_media=")[1]||"").split("&")[0] == "img") {
  15. jQuery("#media__linkbtn4").css("display", "none");
  16. ckg_nonimage_overlay();
  17. }
  18. /* update search form action */
  19. var valu = jQuery("#dw__mediasearch input[type='text").val();
  20. if(valu == ""){
  21. var url = jQuery("form#dw__mediasearch").attr('action');
  22. jQuery("form#dw__mediasearch").attr('action', url+_action);
  23. };
  24. jQuery(document).ajaxComplete(function() {
  25. ckg_nonimage_overlay();
  26. jQuery("form[action]").each(function(index, val){
  27. var url = jQuery(this).attr('action');
  28. url = url + _action;
  29. jQuery(this).attr('action',url);
  30. });
  31. });
  32. };
  33. if(!opener.oDokuWiki_FCKEditorInstanceInLinkDialog) {
  34. jQuery( ".odd, .even" ).each( function( index, element ){
  35. if(!this.title.match(/\.(jpg|jpeg|png|tiff?|gif)$/)){
  36. jQuery( this ).html(LANG.plugins.ckgedit.mediamgr_notice+": <b>" + this.title +"</b>");
  37. }
  38. });
  39. }
  40. }
  41. function ckg_nonimage_overlay() {
  42. if ((location.search.split("ckg_media=")[1]||"").split("&")[0] !== "img") {
  43. return;
  44. }
  45. }