BackPort D6 JS Library Function

Wolfflow - July 28, 2008 - 06:47
Project:BUEditor
Version:5.x-1.x-dev
Component:User interface
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

Hi, have just tryed to port a D6 Js Library Function to the D5 Js Library version.

What I have done meanwhile:

Transform D6 JS Library Function: eDefTagChooser

function eDefTagChooser(tags, applyTag, wrapEach, wrapAll, effect) {
  var content = '';
  var choice = eDefHTML(wrapEach, '<a href="javascript:void(0)" class="choice" onclick="eDefClickChoice(\'%tag\', \'%esc\')">%html</a>') +'\n';
  for (var i in tags) {
    var html = eDefHTML(tags[i][0], tags[i][1], tags[i][2]);
    content += choice.replace('%html', applyTag ? html : tags[i][1]).replace('%tag', tags[i][0]).replace('%esc', escape(html));
  }
  BUE.quickPop.open(eDefHTML(wrapAll, content, {'class': 'chooser'}), effect);
}
function eDefClickChoice(tag, html) {
  var html = unescape(html), partA = html.substr(0, html.indexOf('>')+1), E = BUE.active;
  eDefNoEnd(tag) ? E.replaceSelection(partA) : E.tagSelection(partA, html.substr(html.lastIndexOf('<')));
  E.focus();
}

in d5

function eDefTagChooser(tags, applyTag, wrapEach, wrapAll, effect) {
  var content = '';
  var choice = eDefHTML(wrapEach, '<a href="javascript:void(0)" class="choice" onclick="eDefClickChoice(\'%tag\', \'%esc\')">%html</a>') +'\n';
  for (var i in tags) {
    var html = eDefHTML(tags[i][0], tags[i][1], tags[i][2]);
    content += choice.replace('%html', applyTag ? html : tags[i][1]).replace('%tag', tags[i][0]).replace('%esc', escape(html));
  }
  editor.dialog.open(eDefHTML(wrapAll, content, {'class': 'chooser'}), effect);
}
function eDefClickChoice(tag, html) {
  var html = unescape(html), partA = html.substr(0, html.indexOf('>')+1), E = editor.active;
  eDefNoEnd(tag) ? E.replaceSelection(partA) : E.tagSelection(partA, html.substr(html.lastIndexOf('<')));
  E.focus();
}

Status: Popup Windows open but TAG choise will not be inserted. :-(
Surely I have miss something.

Can you give me a Hint? Of course I'm not a JS programmer but a Beginner who try to hack!
Help very much appreciate.

#1

Wolfflow - July 28, 2008 - 06:56
Title:Port D6 Library Function» BackPort D6 JS Library Function

Correct Title

#2

Wolfflow - September 23, 2008 - 03:25
Priority:critical» normal

No one interest in back-porting this to Drupal 5?

 
 

Drupal is a registered trademark of Dries Buytaert.