codeex said
thanks, removing that fixed my issue… 
Sorry about the late reply, been away all weekend.
Here is the fix for the editor, the whole code:
Php side:
function ubl_add_tinymce() {
global $typenow;
if(!in_array($typenow, array('post', 'page'))) return ;
add_filter( 'mce_external_plugins', 'ubl_add_tinymce_plugin' );
add_filter( 'mce_buttons', 'ubl_add_tinymce_button' );
}
// inlcude the js for tinymce
function ubl_add_tinymce_plugin( $plugin_array ) {
$plugin_array['ubl_location'] = get_template_directory_uri() . '/js/Shortcodes_js-3.9.js';
return $plugin_array;
}
// Add the button key for address via JS
function ubl_add_tinymce_button( $buttons ) {
array_push( $buttons, 'shortcodes' );
return $buttons;
}
add_action( 'admin_head', 'ubl_add_tinymce' );
Javascript:
/*global tinyMCE, tinymce*/
/*jshint forin:true, noarg:true, noempty:true, eqeqeq:true, bitwise:true, strict:true, undef:true, unused:true, curly:true, browser:true, devel:true, maxerr:50 */
(function() {
"use strict";
document.getElementById("content-tmce").onclick = function(){
document.getElementById("mce_30").style.display = "block";
document.getElementById("wp-content-wrap").classList.remove("html-active");
document.getElementById("wp-content-wrap").className += " tmce-active";
}
document.getElementById("content-html").onclick = function(){
document.getElementById("mce_30").style.display = "none";
document.getElementById("wp-content-wrap").classList.remove("tmce-active");
document.getElementById("wp-content-wrap").className += " html-active";
}
tinymce.init({
selector: ".wp-editor-area",
toolbar: "shortcodes",
setup: function(editor) {
tinymce.PluginManager.add( 'ubl_location', function( editor, url ) {
editor.addButton( 'shortcodes', {
type: 'listbox',
text: 'Shortcodes',
icon: false,
tooltip: 'Editor Shortcodes',
classes: 'ublnewlist',
onselect: function(e) {
},
values: [
//SHORTCODE STARTS
{text: 'H1 Title', onclick : function() {
var selected = tinyMCE.activeEditor.selection.getContent();
var content = '';
var h1titleclass = prompt("Would you like a custom class?", "");
if(h1titleclass != ''){
h1titleclass = ' class="'+h1titleclass+'"';
}
if (selected !== '') {
content = '[h1'+h1titleclass+']' + selected + '[/h1]';
} else {
content = '[h1'+h1titleclass+'][/h1]';
}
tinymce.execCommand('mceInsertContent', false, content);
}},
// END SHORTCODE
/*
Keep adding adding shortcodes as shown on the tutorial here
*/
]
});
});
}
});
})();
I hope this helps guys 