• I cannot use the Visual Editor button within Posts or Pages. I also cannot add any media into my posts or pages using the Media insert button. The pictures are sitting in the media area, but when you click Insert into Page, it sends you back to the page without inserting the media.

    I have tried the following and still no luck: (each one of the following was performed one step at a time and rechecked to see if either function was working)
    Cleared Cache
    Switched browsers (I normally use Firefox 17.0.1, but tried Safari 6.0.2)
    Deactivated all plug-ins
    Deactivated all plug-ins and cleared cache
    Switched to twenty eleven theme
    Added define( ‘CONCATENATE_SCRIPTS’, false ); to wp-config
    Added define(‘WP_DEBUG’, false); to wp-config
    Changed define(‘WP_DEBUG’, true); to wp-config
    Reinstalled the WordPress Update

    I know this must be a problem because I’m seeing other threads with people experiencing a similar problems. And I’ve tried everything that I’ve seen other people suggest to try. I’ve spoken to my theme support and they’ve ruled out that it’s not on their end.

    I’m at a loss as to what I need to try next. Any help would be greatly appreciated.

    I’m not ‘hurting’ that these things aren’t working, it’s just creating more work on my part.

Viewing 15 replies - 1 through 15 (of 26 total)
  • If you haven’t discovered any PHP errors, and you’ve tried different browsers, maybe a javascript error could be causing the issues you’re seeing? If I disable javascript in my browser when I’m in the editor, I can’t switch tabs in the editor, either. Insert media still works, but without the pop-up, so I may be way off.

    If I were you, I would install the Firebug extension in Firefox, enable the Firebug console, and see if your site is throwing any javascript errors when you try to use the features that are broken for you. Almost any javascript error will keep other javascript from working correctly, and I don’t think it would show up in WordPress debugging since it’s client-side.

    Thread Starter skichic95

    (@skichic95)

    I’m getting the following error when I firebug the editor:
    TypeError: d is undefined
    I don’t know what else to provide to someone cause now this is language that I don’t understand.

    That may be it. Unfortunately, javascript errors aren’t as specific as PHP, but it tells you that you definitely have an error coming from somewhere.

    Does Firebug tell you what file and line number the error is coming from?

    Also, take a look at this thread.

    Thread Starter skichic95

    (@skichic95)

    wp-includes/js/quicktags.min.js.?ver=3.5 (line 1)

    is what it’s saying

    I am still having the same issue too. It happened after the 3.5 upgrade. I can’t follow the directions in that thread and am totally frustrated. I keep having to custom build links and insert images with HTML…. it’s taking forever!

    @alison – sorry to hear you are having difficulties, but these forums really work much better if you start your own thread per the guidelines.

    I’ve been following several threads related to the same issue. I can’t find one that has a resolution that I can actually follow or fix myself. I believe this is at least the second time that skichic95 has posted about this issue. Is another thread really going to fix it?

    i have the same issue, i have tried many different ways, now just realize that is related specified themes. the theme Twenty Eleven
    and Twenty Twelve do work, but the theme Max Magazine and Asteroid don’t work.

    Thread Starter skichic95

    (@skichic95)

    The theme does not matter on my end. Still have the same issue irregardless.

    Thread Starter skichic95

    (@skichic95)

    @alison this is the first post on this topic that I have made in this forum. I posted a similar post in the studiopress forums but it was finally ruled that it wasn’t anything related to studiopress…and that I should come post in the wordpress forums.

    @skichic95 let’s see if we can figure this out. I have a working version of 3.5 and it looks like you are using WordPress 3.5 so we may be able to figure out what is different. I’m willing if you are.

    When you get that kind of error in javascript it can mean:

    1. Another script is causing a conflict with it. This is the most common cause with core WP scripts in my experience.
    2. There is an error in the script itself.

    To rule out number one, we can compare the javascript scripts that you are loading with what one of my installs that’s working is loading. You could use a file-comparison program like Meld to do this quickly for the longer sections of code. To do this, go into the admin side and Posts -> Add New in Firefox. Then hit Ctrl + U to view the source code (or Tools -> Web Developer -> Page Source). Here’s the javascript on my site.

    Line 11:

    <script type="text/javascript">
    addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
    var ajaxurl = '/wp-admin/admin-ajax.php',
    	pagenow = 'post',
    	typenow = 'post',
    	adminpage = 'post-new-php',
    	thousandsSeparator = ',',
    	decimalPoint = '.',
    	isRtl = 0;
    </script>

    Line 28:

    <script type='text/javascript'>
    /* <![CDATA[ */
    var RevisionControl = {"deleterevisions":"Are you sure you wish to delete the selected Revisions?","unlockrevision":"Warning: Unlocking this post will cause the latest revision to be published!\\nContinue?","selectbothradio":"Please select a Left and Right revision to compare","revisioncompare":"Revision Compare"};
    /* ]]> */
    </script>

    Line 34: (I replaced a string of digits with <my UID>; the digits here will be different than mine, I think.)

    <script type='text/javascript'>
    /* <![CDATA[ */
    var userSettings = {"url":"\/","uid":"1","time":"<my UID>"};var wpAjax = {"noPerm":"You do not have permission to do that.","broken":"An unidentified error has occurred."};/* ]]> */
    </script>

    Line 38:

    <script type='text/javascript' src='https://www.yourdomain.com/wp-admin/load-scripts.php?c=1&load[]=jquery,utils,wp-ajax-response,plupload,plupload-html5,plupload-flash,plupload-silverlight,plupload-html4,json2&ver=3.5'></script>
    <script type='text/javascript' src='https://www.yourdomain.com/wp-content/plugins/revision-control/revision-control.js?ver=2.11356973151'></script>

    Line 51:

    <script type="text/javascript">
    	document.body.className = document.body.className.replace('no-js','js');
    </script>

    Line 758:

    <script type="text/javascript">
    try{document.post.title.focus();}catch(e){}
    </script>

    Line 771:

    <script type="text/javascript">
    //<![CDATA[
    	jQuery( '#ep_explain_more' ).hide();
    	jQuery( '#ep_toggle_more' ).click( function() {
    		jQuery( '#ep_explain_more' ).toggle();
    		return false;
    	} );
    //]]>
    </script>

    Line 1182:
    <script type='text/javascript'>list_args = {"class":"WP_Post_Comments_List_Table","screen":{"id":"post","base":"post"}};</script>

    Line 1185:

    <script type='text/javascript'>
    /* <![CDATA[ */
    var commonL10n = {"warnDelete":"You are about to permanently delete the selected items.\n  'Cancel' to stop, 'OK' to delete."};var thickboxL10n = {"next":"Next >","prev":"< Prev","image":"Image","of":"of","close":"Close","noiframes":"This feature requires inline frames. You have iframes disabled or your browser does not support them.","loadingAnimation":"https:\/\/www.trackitweb.com\/wp-includes\/js\/thickbox\/loadingAnimation.gif","closeImage":"https:\/\/www.trackitweb.com\/wp-includes\/js\/thickbox\/tb-close.png"};var autosaveL10n = {"autosaveInterval":"60","savingText":"Saving Draft\u2026","saveAlert":"The changes you made will be lost if you navigate away from this page."};var postL10n = {"ok":"OK","cancel":"Cancel","publishOn":"Publish on:","publishOnFuture":"Schedule for:","publishOnPast":"Published on:","showcomm":"Show more comments","endcomm":"No more comments found.","publish":"Publish","schedule":"Schedule","update":"Update","savePending":"Save as Pending","saveDraft":"Save Draft","private":"Private","public":"Public","publicSticky":"Public, Sticky","password":"Password Protected","privatelyPublished":"Privately Published","published":"Published","comma":","};var _wpMediaModelsL10n = {"settings":{"ajaxurl":"\/wp-admin\/admin-ajax.php","post":{"id":0}}};var pluploadL10n = {"queue_limit_exceeded":"You have attempted to queue too many files.","file_exceeds_size_limit":"%s exceeds the maximum upload size for this site.","zero_byte_file":"This file is empty. Please try another.","invalid_filetype":"This file type is not allowed. Please try another.","not_an_image":"This file is not an image. Please try another.","image_memory_exceeded":"Memory exceeded. Please try another smaller file.","image_dimensions_exceeded":"This is larger than the maximum size. Please try another.","default_error":"An error occurred in the upload. Please try again later.","missing_upload_url":"There was a configuration error. Please contact the server administrator.","upload_limit_exceeded":"You may only upload 1 file.","http_error":"HTTP error.","upload_failed":"Upload failed.","big_upload_failed":"Please try uploading this file with the %1$sbrowser uploader%2$s.","big_upload_queued":"%s exceeds the maximum upload size for the multi-file uploader when used in your browser.","io_error":"IO error.","security_error":"Security error.","file_cancelled":"File canceled.","upload_stopped":"Upload stopped.","dismiss":"Dismiss","crunching":"Crunching\u2026","deleted":"moved to the trash.","error_uploading":"\u201c%s\u201d has failed to upload."};
    var _wpPluploadSettings = {"defaults":{"runtimes":"html5,silverlight,flash,html4","file_data_name":"async-upload","multiple_queues":true,"max_file_size":"67108864b","url":"\/wp-admin\/async-upload.php","flash_swf_url":"https:\/\/www.trackitweb.com\/wp-includes\/js\/plupload\/plupload.flash.swf","silverlight_xap_url":"https:\/\/www.trackitweb.com\/wp-includes\/js\/plupload\/plupload.silverlight.xap","filters":[{"title":"Allowed Files","extensions":"*"}],"multipart":true,"urlstream_upload":true,"multipart_params":{"action":"upload-attachment","_wpnonce":"58c0c39045"}},"browser":{"mobile":false,"supported":true},"limitExceeded":false};var _wpMediaViewsL10n = {"url":"URL","addMedia":"Add Media","search":"Search","select":"Select","cancel":"Cancel","selected":"%d selected","dragInfo":"Drag and drop to reorder images.","uploadFilesTitle":"Upload Files","uploadImagesTitle":"Upload Images","mediaLibraryTitle":"Media Library","insertMediaTitle":"Insert Media","createNewGallery":"Create a new gallery","returnToLibrary":"\u2190 Return to library","allMediaItems":"All media items","noItemsFound":"No items found.","insertIntoPost":"Insert into post","uploadedToThisPost":"Uploaded to this post","warnDelete":"You are about to permanently delete this item.\n  'Cancel' to stop, 'OK' to delete.","insertFromUrlTitle":"Insert from URL","setFeaturedImageTitle":"Set Featured Image","setFeaturedImage":"Set featured image","createGalleryTitle":"Create Gallery","editGalleryTitle":"Edit Gallery","cancelGalleryTitle":"\u2190 Cancel Gallery","insertGallery":"Insert gallery","updateGallery":"Update gallery","addToGallery":"Add to gallery","addToGalleryTitle":"Add to Gallery","reverseOrder":"Reverse order","settings":{"tabs":[],"tabUrl":"https:\/\/www.trackitweb.com\/wp-admin\/media-upload.php?chromeless=1","mimeTypes":{"image":"Images","audio":"Audio","video":"Video"},"captions":true,"nonce":{"sendToEditor":"fdb14b6b34"},"post":{"id":479,"nonce":"d7faa60f2d","featuredImageId":-1}}};
    var _wpMediaViewsL10n = {"url":"URL","addMedia":"Add Media","search":"Search","select":"Select","cancel":"Cancel","selected":"%d selected","dragInfo":"Drag and drop to reorder images.","uploadFilesTitle":"Upload Files","uploadImagesTitle":"Upload Images","mediaLibraryTitle":"Media Library","insertMediaTitle":"Insert Media","createNewGallery":"Create a new gallery","returnToLibrary":"\u2190 Return to library","allMediaItems":"All media items","noItemsFound":"No items found.","insertIntoPost":"Insert into post","uploadedToThisPost":"Uploaded to this post","warnDelete":"You are about to permanently delete this item.\n  'Cancel' to stop, 'OK' to delete.","insertFromUrlTitle":"Insert from URL","setFeaturedImageTitle":"Set Featured Image","setFeaturedImage":"Set featured image","createGalleryTitle":"Create Gallery","editGalleryTitle":"Edit Gallery","cancelGalleryTitle":"\u2190 Cancel Gallery","insertGallery":"Insert gallery","updateGallery":"Update gallery","addToGallery":"Add to gallery","addToGalleryTitle":"Add to Gallery","reverseOrder":"Reverse order","settings":{"tabs":[],"tabUrl":"https:\/\/www.trackitweb.com\/wp-admin\/media-upload.php?chromeless=1","mimeTypes":{"image":"Images","audio":"Audio","video":"Video"},"captions":true,"nonce":{"sendToEditor":"fdb14b6b34"},"post":{"id":479,"nonce":"d7faa60f2d","featuredImageId":-1}}};var wordCountL10n = {"type":"w"};var quicktagsL10n = {"wordLookup":"Enter a word to look up:","dictionaryLookup":"Dictionary lookup","lookup":"lookup","closeAllOpenTags":"Close all open tags","closeTags":"close tags","enterURL":"Enter the URL","enterImageURL":"Enter the URL of the image","enterImageDescription":"Enter a description of the image","fullscreen":"fullscreen","toggleFullscreen":"Toggle fullscreen mode","textdirection":"text direction","toggleTextdirection":"Toggle Editor Text Direction"};var wpLinkL10n = {"title":"Insert\/edit link","update":"Update","save":"Add Link","noTitle":"(no title)","noMatchesFound":"No matches found."};/* ]]> */
    </script>

    Line 1191: (Pay special attention to this one because it loads additional scripts. If it’s not a verbatim copy of yours–except for the domain/path–let me know and include your site’s line.)
    <script type='text/javascript' src='https://www.yourdomain.com/wp-admin/load-scripts.php?c=1&load[]=admin-bar,hoverIntent,common,thickbox,schedule,autosave,suggest,jquery-color,wp-lists,jquery-ui-core,jquery-ui-widget,jquery-ui-&load[]=mouse,jquery-ui-sortable,postbox,post,underscore,shortcode,backbone,media-models,wp-plupload,media-views,media-editor,word-count&load[]=,editor,quicktags,jquery-ui-resizable,jquery-ui-draggable,jquery-ui-button,jquery-ui-position,jquery-ui-dialog,wpdialogs,wplink,&load[]=wpdialogs-popup,wp-fullscreen,media-upload&ver=3.5'></script>

    Line 1193:

    <script type="text/javascript">
    		tinyMCEPreInit = {
    			base : "https://www.yourdomain.com/wp-includes/js/tinymce",
    			suffix : "",
    			query : "ver=358-23156",
    			mceInit : {'content':{mode:"exact",width:"100%",theme:"advanced",skin:"wp_theme",language:"en",spellchecker_languages:"+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"left",theme_advanced_statusbar_location:"bottom",theme_advanced_resizing:true,theme_advanced_resize_horizontal:false,dialog_type:"modal",formats:{
    						alignleft : [
    							{selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'left'}},
    							{selector : 'img,table', classes : 'alignleft'}
    						],
    						aligncenter : [
    							{selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'center'}},
    							{selector : 'img,table', classes : 'aligncenter'}
    						],
    						alignright : [
    							{selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'right'}},
    							{selector : 'img,table', classes : 'alignright'}
    						],
    						strikethrough : {inline : 'del'}
    					},relative_urls:false,remove_script_host:false,convert_urls:false,remove_linebreaks:true,gecko_spellcheck:true,fix_list_elements:true,keep_styles:false,entities:"38,amp,60,lt,62,gt",accessibility_focus:true,media_strict:false,paste_remove_styles:true,paste_remove_spans:true,paste_strip_class_attributes:"all",paste_text_use_dialog:true,webkit_fake_resize:false,spellchecker_rpc_url:"https://www.yourdomain.com/wp-includes/js/tinymce/plugins/spellchecker/rpc.php",schema:"html5",wpeditimage_disable_captions:false,wp_fullscreen_content_css:"https://www.yourdomain.com/wp-includes/js/tinymce/plugins/wpfullscreen/css/wp-fullscreen.css",plugins:"inlinepopups,spellchecker,tabfocus,paste,media,fullscreen,wordpress,wpeditimage,wpgallery,wplink,wpdialogs,wpfullscreen",content_css:"https://www.yourdomain.com/wp-content/themes/twentyten/editor-style.css",elements:"content",wpautop:true,apply_source_formatting:false,theme_advanced_buttons1:"bold,italic,strikethrough,bullist,numlist,blockquote,justifyleft,justifycenter,justifyright,link,unlink,wp_more,spellchecker,wp_fullscreen,wp_adv",theme_advanced_buttons2:"formatselect,underline,justifyfull,forecolor,pastetext,pasteword,removeformat,charmap,outdent,indent,undo,redo,wp_help",theme_advanced_buttons3:"",theme_advanced_buttons4:"",tabfocus_elements:"sample-permalink,post-preview",body_class:"content post-type-post",theme_advanced_resizing_use_cookie:false}},
    			qtInit : {'content':{id:"content",buttons:"strong,em,link,block,del,ins,img,ul,ol,li,code,more,spell,close,fullscreen"},'replycontent':{id:"replycontent",buttons:"strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close"}},
    			ref : {plugins:"inlinepopups,spellchecker,tabfocus,paste,media,fullscreen,wordpress,wpeditimage,wpgallery,wplink,wpdialogs,wpfullscreen",theme:"advanced",language:"en"},
    			load_ext : function(url,lang){var sl=tinymce.ScriptLoader;sl.markDone(url+'/langs/'+lang+'.js');sl.markDone(url+'/langs/'+lang+'_dlg.js');}
    		};
    	</script>

    Line 1218:
    <script type='text/javascript' src='https://www.yourdomain.com/wp-includes/js/tinymce/wp-tinymce.php?c=1&ver=358-23156'></script>

    Line 1219:
    <script type='text/javascript' src='https://www.yourdomain.com/wp-includes/js/tinymce/langs/wp-langs-en.js?ver=358-23156'></script>

    Line 1221:

    <script type="text/javascript">
    		var wpActiveEditor;
    
    		(function(){
    			var init, ed, qt, first_init, DOM, el, i, mce = 1;
    
    			if ( typeof(tinymce) == 'object' ) {
    				DOM = tinymce.DOM;
    				// mark wp_theme/ui.css as loaded
    				DOM.files[tinymce.baseURI.getURI() + '/themes/advanced/skins/wp_theme/ui.css'] = true;
    
    				DOM.events.add( DOM.select('.wp-editor-wrap'), 'mousedown', function(e){
    					if ( this.id )
    						wpActiveEditor = this.id.slice(3, -5);
    				});
    
    				for ( ed in tinyMCEPreInit.mceInit ) {
    					if ( first_init ) {
    						init = tinyMCEPreInit.mceInit[ed] = tinymce.extend( {}, first_init, tinyMCEPreInit.mceInit[ed] );
    					} else {
    						init = first_init = tinyMCEPreInit.mceInit[ed];
    					}
    
    					if ( mce )
    						try { tinymce.init(init); } catch(e){}
    				}
    			} else {
    				if ( tinyMCEPreInit.qtInit ) {
    					for ( i in tinyMCEPreInit.qtInit ) {
    						el = tinyMCEPreInit.qtInit[i].id;
    						if ( el )
    							document.getElementById('wp-'+el+'-wrap').onmousedown = function(){ wpActiveEditor = this.id.slice(3, -5); }
    					}
    				}
    			}
    
    			if ( typeof(QTags) == 'function' ) {
    				for ( qt in tinyMCEPreInit.qtInit ) {
    					try { quicktags( tinyMCEPreInit.qtInit[qt] ); } catch(e){}
    				}
    			}
    		})();
    				</script>

    Line 1415:
    <script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script>

    If you’re loading any other javascript than those, or the javascript you’re loading corresponding to those differs other than in the UID or the domain name, then you may have found the source of a conflict. Let me know what you find.

    If that doesn’t find the culprit, the next thing to do would be to see if we can find an issue with the actual code. To troubleshoot that, rename your wp-includes/js/quicktags.min.js and save the following (the contents of my working file) as wp-includes/js/quicktags.min.js, then clear your browser cache and re-test:
    var QTags,edButtons=[],edCanvas,edAddTag=function(){},edCheckOpenTags=function(){},edCloseAllTags=function(){},edInsertImage=function(){},edInsertLink=function(){},edInsertTag=function(){},edLink=function(){},edQuickLink=function(){},edRemoveTag=function(){},edShowButton=function(){},edShowLinks=function(){},edSpell=function(){},edToolbar=function(){};function quicktags(a){return new QTags(a)}function edInsertContent(b,a){return QTags.insertContent(a)}function edButton(f,e,c,b,a,d){return QTags.addButton(f,e,c,b,a,"",-1)}(function(){var b=function(g){var f,e,d;if(typeof jQuery!="undefined"){jQuery(document).ready(g)}else{f=b;f.funcs=[];f.ready=function(){if(!f.isReady){f.isReady=true;for(e=0;e<f.funcs.length;e++){f.funcs[e]()}}};if(f.isReady){g()}else{f.funcs.push(g)}if(!f.eventAttached){if(document.addEventListener){d=function(){document.removeEventListener("DOMContentLoaded",d,false);f.ready()};document.addEventListener("DOMContentLoaded",d,false);window.addEventListener("load",f.ready,false)}else{if(document.attachEvent){d=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",d);f.ready()}};document.attachEvent("onreadystatechange",d);window.attachEvent("onload",f.ready);(function(){try{document.documentElement.doScroll("left")}catch(h){setTimeout(arguments.callee,50);return}f.ready()})()}}f.eventAttached=true}}},a=(function(){var d=new Date(),e;e=function(f){var g=f.toString();if(g.length<2){g="0"+g}return g};return d.getUTCFullYear()+"-"+e(d.getUTCMonth()+1)+"-"+e(d.getUTCDate())+"T"+e(d.getUTCHours())+":"+e(d.getUTCMinutes())+":"+e(d.getUTCSeconds())+"+00:00"})(),c;c=QTags=function(j){if(typeof(j)=="string"){j={id:j}}else{if(typeof(j)!="object"){return false}}var i=this,k=j.id,h=document.getElementById(k),g="qt_"+k,d,f,e;if(!k||!h){return false}i.name=g;i.id=k;i.canvas=h;i.settings=j;if(k=="content"&&typeof(adminpage)=="string"&&(adminpage=="post-new-php"||adminpage=="post-php")){edCanvas=h;e="ed_toolbar"}else{e=g+"_toolbar"}d=document.createElement("div");d.id=e;d.className="quicktags-toolbar";h.parentNode.insertBefore(d,h);i.toolbar=d;f=function(n){n=n||window.event;var m=n.target||n.srcElement,o=m.clientWidth||m.offsetWidth,l;if(!o){return}if(/ ed_button /.test(" "+m.className+" ")){i.canvas=h=document.getElementById(k);l=m.id.replace(g+"_","");if(i.theButtons[l]){i.theButtons[l].callback.call(i.theButtons[l],m,h,i)}}};if(d.addEventListener){d.addEventListener("click",f,false)}else{if(d.attachEvent){d.attachEvent("onclick",f)}}i.getButton=function(l){return i.theButtons[l]};i.getButtonElement=function(l){return document.getElementById(g+"_"+l)};c.instances[k]=i;if(!c.instances[0]){c.instances[0]=c.instances[k];b(function(){c._buttonsInit()})}};c.instances={};c.getInstance=function(d){return c.instances[d]};c._buttonsInit=function(){var p=this,g,e,h,o,m,l,n,f,k,d,j=",strong,em,link,block,del,ins,img,ul,ol,li,code,more,spell,close,";for(l in p.instances){if(l==0){continue}n=p.instances[l];g=n.canvas;e=n.name;h=n.settings;m="";o={};d="";if(h.buttons){d=","+h.buttons+","}for(k in edButtons){if(!edButtons[k]){continue}f=edButtons[k].id;if(d&&j.indexOf(","+f+",")!=-1&&d.indexOf(","+f+",")==-1){continue}if(!edButtons[k].instance||edButtons[k].instance==l){o[f]=edButtons[k];if(edButtons[k].html){m+=edButtons[k].html(e+"_")}}}if(d&&d.indexOf(",fullscreen,")!=-1){o.fullscreen=new c.FullscreenButton();m+=o.fullscreen.html(e+"_")}if("rtl"==document.getElementsByTagName("html")[0].dir){o.textdirection=new c.TextDirectionButton();m+=o.textdirection.html(e+"_")}n.toolbar.innerHTML=m;n.theButtons=o}p.buttonsInitDone=true};c.addButton=function(e,i,h,g,d,j,k,l){var f;if(!e||!i){return}k=k||0;g=g||"";if(typeof(h)==="function"){f=new c.Button(e,i,d,j,l);f.callback=h}else{if(typeof(h)==="string"){f=new c.TagButton(e,i,h,g,d,j,l)}else{return}}if(k==-1){return f}if(k>0){while(typeof(edButtons[k])!="undefined"){k++}edButtons[k]=f}else{edButtons[edButtons.length]=f}if(this.buttonsInitDone){this._buttonsInit()}};c.insertContent=function(g){var h,f,e,i,j,d=document.getElementById(wpActiveEditor);if(!d){return false}if(document.selection){d.focus();h=document.selection.createRange();h.text=g;d.focus()}else{if(d.selectionStart||d.selectionStart=="0"){j=d.value;f=d.selectionStart;e=d.selectionEnd;i=d.scrollTop;d.value=j.substring(0,f)+g+j.substring(e,j.length);d.focus();d.selectionStart=f+g.length;d.selectionEnd=f+g.length;d.scrollTop=i}else{d.value+=g;d.focus()}}return true};c.Button=function(i,g,e,h,d){var f=this;f.id=i;f.display=g;f.access=e;f.title=h||"";f.instance=d||""};c.Button.prototype.html=function(e){var d=this.access?' accesskey="'+this.access+'"':"";return'<input type="button" id="'+e+this.id+'"'+d+' class="ed_button" title="'+this.title+'" value="'+this.display+'" />'};c.Button.prototype.callback=function(){};c.TagButton=function(k,i,g,f,e,j,d){var h=this;c.Button.call(h,k,i,e,j,d);h.tagStart=g;h.tagEnd=f};c.TagButton.prototype=new c.Button();c.TagButton.prototype.openTag=function(g,d){var f=this;if(!d.openTags){d.openTags=[]}if(f.tagEnd){d.openTags.push(f.id);g.value="/"+g.value}};c.TagButton.prototype.closeTag=function(h,d){var g=this,f=g.isOpen(d);if(f!==false){d.openTags.splice(f,1)}h.value=g.display};c.TagButton.prototype.isOpen=function(d){var g=this,f=0,e=false;if(d.openTags){while(e===false&&f<d.openTags.length){e=d.openTags[f]==g.id?f:false;f++}}else{e=false}return e};c.TagButton.prototype.callback=function(o,h,p){var u=this,q,e,m,g,s=h.value,j,d,n,f,k=s?u.tagEnd:"";if(document.selection){h.focus();f=document.selection.createRange();if(f.text.length>0){if(!u.tagEnd){f.text=f.text+u.tagStart}else{f.text=u.tagStart+f.text+k}}else{if(!u.tagEnd){f.text=u.tagStart}else{if(u.isOpen(p)===false){f.text=u.tagStart;u.openTag(o,p)}else{f.text=k;u.closeTag(o,p)}}}h.focus()}else{if(h.selectionStart||h.selectionStart=="0"){q=h.selectionStart;e=h.selectionEnd;m=e;g=h.scrollTop;j=s.substring(0,q);d=s.substring(e,s.length);n=s.substring(q,e);if(q!=e){if(!u.tagEnd){h.value=j+n+u.tagStart+d;m+=u.tagStart.length}else{h.value=j+u.tagStart+n+k+d;m+=u.tagStart.length+k.length}}else{if(!u.tagEnd){h.value=j+u.tagStart+d;m=q+u.tagStart.length}else{if(u.isOpen(p)===false){h.value=j+u.tagStart+d;u.openTag(o,p);m=q+u.tagStart.length}else{h.value=j+k+d;m=q+k.length;u.closeTag(o,p)}}}h.focus();h.selectionStart=m;h.selectionEnd=m;h.scrollTop=g}else{if(!k){h.value+=u.tagStart}else{if(u.isOpen(p)!==false){h.value+=u.tagStart;u.openTag(o,p)}else{h.value+=k;u.closeTag(o,p)}}h.focus()}}};c.SpellButton=function(){c.Button.call(this,"spell",quicktagsL10n.lookup,"",quicktagsL10n.dictionaryLookup)};c.SpellButton.prototype=new c.Button();c.SpellButton.prototype.callback=function(h,g,d){var j="",i,f,e;if(document.selection){g.focus();i=document.selection.createRange();if(i.text.length>0){j=i.text}}else{if(g.selectionStart||g.selectionStart=="0"){f=g.selectionStart;e=g.selectionEnd;if(f!=e){j=g.value.substring(f,e)}}}if(j===""){j=prompt(quicktagsL10n.wordLookup,"")}if(j!==null&&/^\w[\w ]*$/.test(j)){window.open("https://www.answers.com/"+encodeURIComponent(j))}};c.CloseButton=function(){c.Button.call(this,"close",quicktagsL10n.closeTags,"",quicktagsL10n.closeAllOpenTags)};c.CloseButton.prototype=new c.Button();c._close=function(i,j,d){var g,f,h=d.openTags;if(h){while(h.length>0){g=d.getButton(h[h.length-1]);f=document.getElementById(d.name+"_"+g.id);if(i){g.callback.call(g,f,j,d)}else{g.closeTag(f,d)}}}};c.CloseButton.prototype.callback=c._close;c.closeAllTags=function(e){var d=this.getInstance(e);c._close("",d.canvas,d)};c.LinkButton=function(){c.TagButton.call(this,"link","link","","</a>","a")};c.LinkButton.prototype=new c.TagButton();c.LinkButton.prototype.callback=function(i,j,g,f){var d,h=this;if(typeof(wpLink)!="undefined"){wpLink.open();return}if(!f){f="https://"}if(h.isOpen(g)===false){d=prompt(quicktagsL10n.enterURL,f);if(d){h.tagStart='<a href="'+d+'">';c.TagButton.prototype.callback.call(h,i,j,g)}}else{c.TagButton.prototype.callback.call(h,i,j,g)}};c.ImgButton=function(){c.TagButton.call(this,"img","img","","","m")};c.ImgButton.prototype=new c.TagButton();c.ImgButton.prototype.callback=function(h,j,f,d){if(!d){d="https://"}var i=prompt(quicktagsL10n.enterImageURL,d),g;if(i){g=prompt(quicktagsL10n.enterImageDescription,"");this.tagStart='<img src="'+i+'" alt="'+g+'" />';c.TagButton.prototype.callback.call(this,h,j,f)}};c.FullscreenButton=function(){c.Button.call(this,"fullscreen",quicktagsL10n.fullscreen,"f",quicktagsL10n.toggleFullscreen)};c.FullscreenButton.prototype=new c.Button();c.FullscreenButton.prototype.callback=function(d,f){if(!f.id||typeof(fullscreen)=="undefined"){return}fullscreen.on()};c.TextDirectionButton=function(){c.Button.call(this,"textdirection",quicktagsL10n.textdirection,"",quicktagsL10n.toggleTextdirection)};c.TextDirectionButton.prototype=new c.Button();c.TextDirectionButton.prototype.callback=function(f,h){var d=("rtl"==document.getElementsByTagName("html")[0].dir),g=h.style.direction;if(!g){g=(d)?"rtl":"ltr"}h.style.direction=("rtl"==g)?"ltr":"rtl";h.focus()};edButtons[10]=new c.TagButton("strong","b","<strong>","</strong>","b");edButtons[20]=new c.TagButton("em","i","<em>","</em>","i"),edButtons[30]=new c.LinkButton(),edButtons[40]=new c.TagButton("block","b-quote","\n\n<blockquote>","</blockquote>\n\n","q"),edButtons[50]=new c.TagButton("del","del",'<del datetime="'+a+'">',"</del>","d"),edButtons[60]=new c.TagButton("ins","ins",'<ins datetime="'+a+'">',"</ins>","s"),edButtons[70]=new c.ImgButton(),edButtons[80]=new c.TagButton("ul","ul","<ul>\n","</ul>\n\n","u"),edButtons[90]=new c.TagButton("ol","ol","<ol>\n","</ol>\n\n","o"),edButtons[100]=new c.TagButton("li","li","\t<li>","</li>\n","l"),edButtons[110]=new c.TagButton("code","code","<code>","</code>","c"),edButtons[120]=new c.TagButton("more","more","<!--more-->","","t"),edButtons[130]=new c.SpellButton(),edButtons[140]=new c.CloseButton()})();

    If that doesn’t work, the next thing is to see if we can get a better idea of what the actual error is, which a minified file makes very difficult. To force WP to load the non-minified versions of the javascript files it uses, go back to your wp-config and add:
    define('SCRIPT_DEBUG', true);
    Log out of WP. Clear your browser cache (Ctrl + F5 in Firefox) and log back into the admin side of WP. Repeat the steps you use to see the javascript error in Firebug. If we’re really lucky, it won’t happen in the non-minified version of the script, but if it does, we should get a more helpful error message.

    Let us know what you find.

    Thread Starter skichic95

    (@skichic95)

    My codes aren’t lining up with your codes as far as line numbers. I’m running on a mac so Meld won’t work and the 2 Mac apps that they reference make no sense to me. Is there another way to go about doing this??

    I’m having the same problem. I apologize for not being codex literate. I don’t even know where to find those. I don’t understand the instructions for these fixes that are being described here. This is very frustrating. Is there some way to fix this that doesn’t involve rewriting complicated (to an idiot like me) codes?

    Don’t worry about the line numbers. I just included them for reference so you can more easily locate the similar blocks of code.

    I’m not a Mac person, but the program DiffMerge looks like it would be similar to Meld and allow you to do the comparisons; however, what I would do first is just use a simple text editor with line numbers (so you can get an approximate idea of which code block to compare to) and do a search for “text/javascript” to locate each block of javascript in your page source. See if there are any blocks of javascript that I didn’t list above. If there are not, then you can do the comparisons.

Viewing 15 replies - 1 through 15 (of 26 total)
  • The topic ‘Cannot switch to Visual Editor and Upload Media does not work’ is closed to new replies.