You are not logged in.
Hi, I modified the Linker plugin to access links from a database.
The links are in the format: http://www.whatever.com/some.php?blah=meh&moo=ma
Upon hitting OK the appropriate link is created, but in the href all the '&' are turned into '&', as is appropriate for text... the only problem is that since they are in a link, the link breaks.
Is there a way to avoid the transformation without modifyin the function htmlEncode in htmlarea.js?
Thanks...
Offline
if you have your doctype set to XTHML (either strict or transitional), then & in URL's will be parsed correctly, your document won't even verify as valid XHTML without it...
Offline
How can I disable or remove individual controls (color buttons, font selector) from the tool bar?
Thanks
Offline
Foxx: Thanks, I'll try that.
Goober: To disable or remove individual controls you have to define which buttons you actually want, as part of javascript. So, for example,I include a file called "myInclude.js" in the HTML that contains Xinha, which consists of the following code:
// This file needs to be invoked from the HTML file initializing HTMLArea
//
xinha_editors = null;
xinha_init = null;
xinha_config = null;
xinha_plugins = null;
// This contains the names of textareas we will make into Xinha editors
xinha_init = xinha_init ? xinha_init : function() {
/** STEP 1 ***************************************************************
* First, what are the plugins you will be using in the editors on this
* page. List all the plugins you will need, even if not all the editors
* will use all the plugins.
************************************************************************/
xinha_plugins = xinha_plugins ? xinha_plugins :
[
'FullScreen',
'ListType',
'ImageManager',
'Linker'
]
/*[
'CharacterMap',
'ContextMenu',
'FullScreen',
'ListType',
'SpellChecker',
'Stylist',
'SuperClean',
'TableOperations'
];*/
// THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING :)
if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return;
/** STEP 2 ***************************************************************
* Now, what are the names of the textareas you will be turning into
* editors?
************************************************************************/
xinha_editors = xinha_editors ? xinha_editors :
[
'myTextArea'
];
/** STEP 3 ***************************************************************
* We create a default configuration to be used by all the editors.
* If you wish to configure some of the editors differently this will be
* done in step 4.
*
* If you want to modify the default config you might do something like this.
*
* xinha_config = new HTMLArea.Config();
* xinha_config.width = 640;
* xinha_config.height = 350;
*
*************************************************************************/
//xinha_config = xinha_config ? xinha_config : new HTMLArea.Config();
xinha_config = new HTMLArea.Config();
xinha_config.width = 620;
xinha_config.height = 300;
// *****************************************************************
// *****************************************************************
// ***** THIS IS WHAT DEFINES WHICH BUTTONS YOU SHOW ***************
// *****************************************************************
// *****************************************************************
xinha_config.toolbar =
[
[ "popupeditor","separator","formatblock", "space",
"bold", "italic", "underline", "strikethrough", "separator",
"subscript", "superscript", "separator",
"copy", "cut", "paste", "space", "undo", "redo", "separator",
"popupeditor", "separator", "showhelp", "about"
],
[ "linebreak",
"killword", "removeformat", "separator",
"justifyleft", "justifycenter","justifyright", "separator",
"insertorderedlist", "insertunorderedlist", "outdent", "indent", "separator",
"inserthorizontalrule", "createlink", "insertimage", "inserttable", "separator",
"htmlmode"
]
]
/*Possible options
[
["popupeditor","separator"],
["formatblock","fontname","fontsize","bold","italic","underline","strikethrough","separator"],
["forecolor","hilitecolor","textindicator","separator"],
["subscript","superscript"],
["linebreak","justifyleft","justifycenter","justifyright","justifyfull","separator"],
["insertorderedlist","insertunorderedlist","outdent","indent","separator"],
["inserthorizontalrule","createlink","insertimage","inserttable","separator"],
["killword","removeformat","toggleborders","lefttoright", "righttoleft", "separator","htmlmode"]
];
*/
//styles taken from pfp <<- this is for my own benefit, you can get rid of it.
xinha_config.pageStyle =
'table { font-size: 1em; } ' +
'pfContentTable { border-top: 1px solid black; border-bottom: 1px solid black; } ' +
'th { font-style:none; font-style: italic; text-align: left; } ' +
'h1 { text-decoration:none; font-size: 1.3em; font-weight:700; text-align:center; } ' +
'h2 { text-decoration:none; font-size: 1em; font-weight:700; text-align:center; } ' +
'h3 { text-decoration:none; font-size: 1em; font-weight:700; } ' +
'h4 { text-decoration:none; font-size: 1em; font-style:italic; } ' +
'h5, h6, h7, h8, h9 { text-decoration:none;font-size: 1em;font-style:italic; display:inline; }'
;
xinha_config.formatblock = {
"Heading 1": "h1",
"Heading 2": "h2",
"Heading 3": "h3",
"Heading 4": "h4",
"Heading 5": "h5",
"Heading 6": "h6",
"Normal": "p",
"Formatted": "pre"
};
/*
xinha_config.formatblock = {
"— Überschrift —" : '',
"Absatz gross/h1": 'h1',
"Absatz mittel/h2": 'h2',
"Absatz grau/h3": 'h3',
"Normal" : 'p'
};
xinha_config.fontsize = {
"— Grösse —" : '',
"1 (8 pt)" : '1',
"2 (10 pt)": '2',
"3 (12 pt)": '3',
"4 (14 pt)": '4'
};
xinha_config.fontname = {
"— Schriftart —" : '',
"Arial/ Helvetica" : 'arial,helvetica,sans-serif',
"Courier New" : 'courier new,courier,monospace',
"Verdana" : 'verdana,arial,helvetica,sans-serif'
};*/
/** STEP 3 ***************************************************************
* We first create editors for the textareas.
*
* You can do this in two ways, either
*
* xinha_editors = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);
*
* if you want all the editor objects to use the same set of plugins, OR;
*
* xinha_editors = HTMLArea.makeEditors(xinha_editors, xinha_config);
* xinha_editors['myTextArea'].registerPlugins(['Stylist','FullScreen']);
* xinha_editors['anotherOne'].registerPlugins(['CSS','SuperClean']);
*
* if you want to use a different set of plugins for one or more of the
* editors.
************************************************************************/
xinha_editors = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);
/** STEP 4 ***************************************************************
* If you want to change the configuration variables of any of the
* editors, this is the place to do that, for example you might want to
* change the width and height of one of the editors, like this...
*
* xinha_editors.myTextArea.config.width = 640;
* xinha_editors.myTextArea.config.height = 480;
*
************************************************************************/
/** STEP 5 ***************************************************************
* Finally we "start" the editors, this turns the textareas into
* Xinha editors.
************************************************************************/
HTMLArea.startEditors(xinha_editors);
}
window.onload = xinha_init;
//EOF
Last edited by g2010a (2005-05-06 16:01:33)
Offline
...having just & in an url is even invalid, it must be &
(don't know for which doctype this is true)
Niko
Offline
Almost true, this is correct :
<a href="sompage.php?a=b&c=d">Link</a>
However this is very wrong :
<script>
document.write('location: sompage.php?a=b&c=d');
</script>
Passing urls with javascript needs it to be a & not a &, probably since the URL is passed directly as is with javascript while the HTML is translated by the browser or something. However, javascript works pretty bad in this editor anyways so my problem shouldt appear,
Offline