DefTagsList with special characters?

-Shaman- - March 20, 2009 - 15:11
Project:BUEditor
Version:6.x-2.x-dev
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

I'm planning to make list with special characters (like it's now with h1, h2, h3, h4), but instead &something; I'm getting <&something;> I know that's though for the html tags not special characters, so how can I change this to get &something; without < > ?

Here's my code:

js: eDefTagChooser([
['&Omega;', '&Omega;'],
['&copy;', '&copy;'],
['&gt;', '&gt;'],
['&lt;', '&lt;']
], true, 'li', 'ul', 'slideDown');//choose among tags

#1

ufku - March 21, 2009 - 00:11

that's not ver likely with eDefTagChooser. try this:

js:
var chars = ['&Omega;', '&copy;', '&gt;', '&lt;'];//extend if you like
var content = $('.cnt', BUE.quickPop).empty();
$.each(chars, function(i, char) {
  $('<a href="#"></a>').click(function(){
    BUE.active.replaceSelection(char);
    BUE.active.focus();
    return false;
  }).html(char).css({margin: '10px', fontSize: '1.2em'}).appendTo(content);
});
BUE.quickPop.open(null, 'slideDown');

#2

-Shaman- - March 21, 2009 - 14:31
Status:active» fixed

Thank U very much, that's exactly what I needed! I think that this could be implemented into module, since it's really useful, it's wikipedia edit page-like list of special characters.

#3

System Message - April 4, 2009 - 14:40
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

#4

-Shaman- - October 24, 2009 - 16:55
Version:6.x-1.2» 6.x-2.x-dev
Status:closed» active

It doesn't works with 2x version anymore…

The same is with smileys button: http://ufku.com/drupal/bueditor/contributions/smileys

#5

ufku - October 25, 2009 - 15:02

Popup structure changed in 2.x and it now allows to open popups using jquery objects as the content.

js:
var chars = ['&Omega;', '&copy;', '&gt;', '&lt;'];//extend if you like
var links = [];
$.each(chars, function(i, char) {
  links[i] = $('<a href="#"></a>').click(function(){
    E.replaceSelection(char).focus();
    return false;
  }).html(char).css({margin: '10px', fontSize:
'1.2em'})[0];
});
E.quickPop.open(links, 'slideDown');

For smileys

php:
$L = drupal_to_js(_smileys_list());
$P = base_path();
drupal_add_js("(function($){
var click = function() {
  BUE.dialog.close();
  BUE.active.replaceSelection(this.firstChild.alt, 'end');
  return false;
};
var map = function(s) {
return $('<a href=\"#\" title=\"'+ s.description +'\"><img src=\"$P'+ s.image +'\" alt=\" '+ s.acronyms.split(' ')[0] +' \" /></a>').css('margin', '0.5em').click(click)[0];
};
var links = $.map($L, map);
BUE.smlyWrap = function() {
  return $('<div style=\"width:200px\"></div>').append(links);
};
})(jQuery);
", 'inline');
return 'js: E.dialog.open("Smileys", BUE.smlyWrap());';

#6

-Shaman- - October 25, 2009 - 13:09

My list of special characters works as charm, but smileys not, I'm getting such a error when click on it: ReferenceError: smlyWrap is not defined

#7

ufku - October 25, 2009 - 15:03
Status:active» fixed

Smiley code was updated.
I tested it with Smileys 6.x-1.0-alpha5 and it works.

#8

-Shaman- - October 25, 2009 - 19:42

OK, I checked this again and it works, my fault.

Many thanks for help!

#9

System Message - November 8, 2009 - 19:50
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.