I have two templates, regular and mobile. I want to unset bueditor for mobile version. In the comment form I inspect with dsm($form);, but I can't seem to find element to unset. I can easily spot notify or attachments to unset, but not bueditor.

I guess this has to be done via js, but no idea to make it.

Any help would be very much appreciated.

Comments

ufku’s picture

Status: Active » Fixed

Try this
drupal_add_js('if (Drupal.settings.BUE) Drupal.settings.BUE.preset = {};', 'inline');

gausarts’s picture

Status: Active » Fixed

Thanks. It works.

So sorry to reopen, but I have the rest of inline javascripts to clean up as well. They are produced by smiley markups, I guess. The below code is not rendered here if I pasted it all, so I have cut it up:

var click = function() {
  BUE.active.replaceSelection(this.firstChild.alt, 'end');
  return false;
};
var map = function(s) {
return $('<a href="#" title="'+ s.description +'"><img src="/test/'+ s.image +'" alt=" '+ s.acronyms.split(' ')[0] +' " /></a>').css('margin', '0.5em').click(click)[0];
};
var links = $.map([ { "id": "1", "acronyms": ":) :-) :smile:", "image": .........................................., map);
BUE.smlyWrap = function() {
  return $('<div style="width:200px"></div>').append($(links).clone(true));
};

Any idea how to clean it up as well? Thanks again for great support.

gausarts’s picture

Status: Fixed » Active
ufku’s picture

Status: Fixed » Active

That's the smileys button.
It must be starting with php:

Change the first line to php: if ($GLOBALS['theme_key'] == 'YOUR-THEME-NAME') return; in order to disable it for your theme.

If you want to alter all inline javascript for your theme, you should consider implementing THEME_preprocess_page(&$vars) and change the $vars['javascript'] in it.

ufku’s picture

Status: Active » Closed (fixed)