You are not logged in.
Thanks to NoXi and adamp on #xinha, we got it figured out...
When making plugins, your plugin name must be like the following
PATH: /xinha/plugins/PluginName
.js FILE: /xinha/plugins/PluginName/plugin-name.js (where there is a dash before each capitalized letter in the plugin folder)
That was a pain to figure out.
Here's another idea for a Xinha logo. It reflects the application and fits nicely with the other icons I made/modified, including the new wysiwyg toggle icon. (http://xinha.gogo.co.nz/punbb/viewtopic.php?id=89)
I would like to propose a #xinha channel for developers/users to help with faster results to questions, etc. As a developer, I find IRC very helpful.
I suggest http://freenode.net/ to be the IRC network of choice as it is geared towards this.
Simply set your irc client to use the "irc.freenode.net" server. If you do not have a client, ChatZilla for Firefox, Trillian, and mIRC are all good options.
I will start the channel #xinha. Hope to see you there!
Well, I still have been unable to make this work correctly. For some reason, what I have below does not work for registering the plugin. The textarea remains just a textarea and xinha is not loaded.
This is the javascript in my form:
<script type="text/javascript">
_editor_url = "/admin/js/xinha/";
_editor_lang = "en";
</script>
<script type="text/javascript" src="/admin/js/xinha/htmlarea.js"></script>
<script type="text/javascript" src="/admin/js/xinha/lang/en.js"></script>
<script type="text/javascript">
xinha_editors = null;
xinha_init = null;
xinha_config = null;
xinha_plugins = null;
xinha_init = xinha_init ? xinha_init : function()
{
xinha_plugins = xinha_plugins ? xinha_plugins :
[
'CharacterMap',
'ContextMenu',
'FullScreen',
'SpellChecker',
'RDS_Macros',
'Linker',
'ImageManager',
'TableOperations'
];
// THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING :)
if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return;
xinha_editors = xinha_editors ? xinha_editors :
[
'Body'
];
xinha_config = xinha_config ? xinha_config : new HTMLArea.Config();
xinha_config.pageStyleSheets = ['/c/nobody.css'];
xinha_config.toolbar =
[
["popupeditor","separator"],
["undo","redo"], (HTMLArea.is_gecko ? [] : ["cut","copy","paste"]),["separator"],
["formatblock","separator","bold","italic","underline","strikethrough","separator"],
["subscript","superscript","separator"],
["forecolor","hilitecolor"],
["linebreak","justifyleft","justifycenter","justifyright","justifyfull","separator"],
["insertorderedlist","insertunorderedlist","outdent","indent","separator"],
["createlink","insertimage","inserttable","toggleborders","inserthorizontalrule","separator"],
["killword","removeformat","separator","htmlmode","about"]
];
xinha_editors = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);
HTMLArea.startEditors(xinha_editors);
}
window.onload = xinha_init;
</script>
</head>
<body onload="xinha_init()">This is the script of the plugin:
function RDS_Macros(editor) {
this.editor = editor;
var cfg = editor.config;
var toolbar = cfg.toolbar;
var self = this;
var i18n = RDS_Macros.I18N;
cfg.registerButton({
id : "insertrdsmacros",
tooltip : i18n["RDS_MacrosTooltip"],
image : editor.imgURL("ed_rds_macros.gif", "RDS_Macros"),
textMode : false,
action : function(editor) {
self.buttonPress(editor);
}
})
var a, i, j, found = false;
for (i = 0; !found && i < toolbar.length; ++i) {
a = toolbar[i];
for (j = 0; j < a.length; ++j) {
if (a[j] == "inserthorizontalrule") {
found = true;
break;
}
}
}
if (found)
a.splice(j, 0, "insertrdsmacros");
else{
toolbar[1].splice(0, 0, "separator");
toolbar[1].splice(0, 0, "insertrdsmacros");
}
};
RDS_Macros._pluginInfo = {
name : "RDSPlaceholders",
version : "1.0",
developer : "Rift Design Studio (RDS)",
developer_url : "http://www.riftdesign.com/",
c_owner : "Rift Design Studio",
sponsor : "Rift Design Studio",
sponsor_url : "http://www.riftdesign.com/",
license : "htmlArea"
};
RDS_Macros.prototype.buttonPress = function(editor) {
editor._popupDialog( "plugin://RDS_Macros/select_macro", function( entity )
{
if ( !entity )
{
//user must have pressed Cancel
return false;
}
editor.insertHTML( entity );
}, null);
}Here's the language javascript:
RDS_Macros.I18N = {
"RDS_MacrosTooltip" : "Insert RDS Macro",
"Insert RDS Macro" : "Insert RDS Macro",
"Cancel" : "Cancel"
};Any ideas out there?
Ok, I guess I missed a double-checked file that had CharacterMap mentioned, that has been taken care of, but IE still throws an error of "'RDSPlaceholders' is undefinded". RDSPlaceholders is the name of my plugin. Why would it be undefined?
So I have been trying to figure out how to write a plugin for a while for some specific CMS content I wish to add. It's pretty basic, so I thought I would start by using the CharacterMap plugin as a template for mine. This seemed great and fairly easy to understand. However, no matter what I have tried, I can't seem to get Xinha to load. In IE, it throws an error (although IE errors are useless):
Line: 11
Char: 1
Error: 'CharacterMap' is undefined
Code: 0
URL:However, Firefox throws no such error, but it isn't loading Xinha...it just shows the textarea.
So, now I am curious...In none of the plugin's files is the string 'CharacterMap' mentioned, I have updated the language files, etc. Why can't I get this thing to load? Is there a Plugin Developer's HOW-TO on making plugins? Any help would be great!
I updated the Toggle HTML View icon now to be a little more descriptive. Changes are in the original post or you can download the zip (http://riftdesign.com/downloads/xinhaIconSet.zip).
You could do something like this in PHP --
htmlentities($title, ENT_QUOTES);
I don't know why that slipped my mind...thanks for the reminder. It worked great.
After doing some testing, I keep having troubles with the actual text (outside of HTML tags) not escaping properly. Has anyone else had this problem? If so, what have you done to prepare it for database entry? Any help on this is appreciated!
As far as I can tell with making things like text color (forecolor) more HTML 4.0 complient, we would have to move away from using queryCommandValue("forecolor") to use a function to manual wrap the selected text in a <span style="...">...</span> method, which probably makes it more difficult to remove it. Any thoughts here?
FILE: htmlarea.js
LINE: 2191
<h1>This is a test</h1><p>This is a test
</p></p>This is what I have being submitted, although in the HTML mode, I do not see the last closing </p> tag. Does anyone else have this happening?
Could have a problem here...If the title has a single quote in the title (ie: Bob's Corner), it will not parse, and as mentioned earlier, there is no feedback as to the failure. I tried escaping the single quote with \' but that didn't seem to work either. Any thoughts here?
[
{url:'/',title:'Home', children:[{url:'/index.php',title:'Home'}, {url:'/calendar/',title:'Calendar'}, {url:'/contact.php',title:'Contact'}, {url:'/links/index.php',title:'Links'}]},
{url:'/ministry/children/',title:'Bob\'s Corner', children:[{url:'/ministry/children/',title:'Bob\'s Corner'}]}
]I still think there should be some kind of feedback if there is a malformed data source from scan.php. Maybe showing the dialog but with an error listed where the tree is would suffice.
And when accessing a ticket like http://xinha.python-hosting.com/cgi-bin … /ticket/67 it defaults to the front page. The new URI is http://xinha.python-hosting.com/ticket/67. Is there a way to have PunBB/MySQL update all the current ticket listings to reflect the new changes? Or have .htaccess forward them correctly?
Well, nevermind...the JS must have been cached. It's working now. Thanks for helping Niko!
I don't have any JS errors, but Linker cannot parse the data and therefore doesn't do anything. This might be another issue to address for Linker (no parser feedback). I used your example for data from scan.php and I got nothing. When I click on the create hyperlink button, nothing happens. The same thing will happen if scan.php returns ill-formed data.
plase take a look at this thicket:
http://xinha.gogo.co.nz/cgi-bin/trac.cgi/ticket/67
i wrote allready a little patch, and gogo had a better idea
(a patch for the new version from gogo hasn't been written yet i think)
I have applied the patch and have tried the methods described above without success. Are you currently using the same patch and the scan.php data that you mentioned?
One thing I still don't like is the "edit html" button because it really doesn't iconize editing. I would like to have an icon/button that allows for a more discriptive toggle. It wouldn't need an icon really...just a text button would be fine. I would propose "code view" and "wysiwyg view" if we had that option. What do you all think?
Also, per request, here's the icon set (main map and plugins) as a zip file.
http://riftdesign.com/downloads/xinhaIconSet.zip
There are a few things that I would like to suggest for XHTML and HTML compliancy and removal of depreciated tags.
1. /htmlarea.js create var isXHTML (boolean variable) for setting XHTML compliancy and latest HTML specs
* isXHTML = true;
2. /htmlarea.js commands for using span tags with styles
* font (style="font-family: arial,helvetica,sans-serif;")
* forecolor (style="color: #ccc;")
* hilitecolor (style="background-color: #ccc;")
* strike and underline could remain as is, although style="text-decoration: underline;" and style="text-decoration: line-through;" work great too
3. /popups/select_color.html HTML is pretty poor
* attributes not quoted
* style for curser doesn't work for Firefox
I added a ticket for this here:
http://xinha.gogo.co.nz/cgi-bin/trac.cgi/ticket/95
I have already uploaded a patch for /popups/select_color.html
This is for discussion on this issue.
My users want to be able to insert a carriage return in the wysiwyg editor (getting the effect as if a <BR/> was inserted.) Right now, when return is pressed, a new paragraph is started. I can go into textmode and tye in a <br/> and it renders correctly in wysisyg but my users are not ready to roll up their sleeves like that. Is there currently a way to insert a <br/> tag?
The tried and try method in most applications, including Xinha, is a Shift-Enter.
Yermo,
I implemented the changes you suggest and have had some success...here's the code I have at this time:
Linker.Dialog.prototype.makeNodes = function(files, parent)
{
for(var i = 0; i < files.length; i++)
{
if(typeof files[i] == 'string')
{
// the text to display is separated from the link by a ,
// file_args[0] == string to display
// file_args[1] == string to set in the URL.
var file_args = files[i].split(',');
this.dTree.add(Linker.nxtid++, parent,
file_args[1].replace(/^.*\//, ''),
'javascript:document.getElementsByName(\'' + this.dialog.id.href + '\')[0].value=unescape(\'' + escape(file_args[0]) + '\');document.getElementsByName(\'' + this.dialog.id.type + '\')[0].click();document.getElementsByName(\'' + this.dialog.id.href + '\')[0].focus();void(0);',
file_args[0]);
}
else
{
// this entry in files is an array, so we recurse.
var file_args = files[i][0].split(',');
var id = this.Dialog_nxtid++;
this.dTree.add(id, parent, file_args[0].replace(/^.*\//, ''), null, file_args[0]);
this.makeNodes(files[i][1], id);
}
}
}I have scan.php generating the following data scenarios:
SCENARIO 1:
['/,General']
SCENARIO 2:
['/,General'],[['/,Home'],['/contact.php,Contact Us'],['/staff/,Staff'],['/links/,Links']]In Scenario 1, things work as planned...but Scenario 2 borks the code...
Error: files has no properties
Source File: http://domain.com/js/xinha/plugins/Linker/linker.js
Line: 398
Line 398 is
for(var i = 0; i < files.length; i++)of the Linker.Dialog.prototype.makeNodes section.
Any thoughts?
turns out the idiots i inherited this project from had put the <form> inside of a <td>.
LOL...that is probably one of the funniest things I have heard in a while.
I am trying to re-create Linker with a few different options. First let me say I love it! Second, the sites I have using xinha use mod_rewrite extensively and to say the least, scan.php just doesn't cut it for making links to pages. So, I have been trying to change Linker to allow for scan.php to have not only the url, but also text (like a page title and url), but without much luck.
What I would like to do is something of the sort:
[
[
['/','General'],
[
['/','Home'],
['/contact.php','Contact Us'],
['/staff/','Staff'],
['/links/','Links']
]
['/article/','Articles']
[
['/article/','Article List'],
['/article/1/','Article Title 1'],
['/article/2/','Article Title 2'],
['/article/3/','Article Title 3'],
['/article/4/','Article Title 4'],
['/article/5/','Article Title 5']
]
]
]I hope that made some sense. Basically, instead of a file directory, it is a webpage directory tree. It would be easy to write scan.php to create the needed data, but I am totally lost in the Linker javascript.
I guess what I am asking for is an alternative focus for Linker, where I can choose between a file directory listing or a webpage directory listing, having the file directory accepting file path only while webpage directory accepting both title and url.
I would be glad to help, but I am really lost in the code. Sorry.
And the icons for TableOperations plugin:

















/plugins/TableOperations/img/cell-delete.gif
/plugins/TableOperations/img/cell-insert-after.gif
/plugins/TableOperations/img/cell-insert-before.gif
/plugins/TableOperations/img/cell-merge.gif
/plugins/TableOperations/img/cell-prop.gif
/plugins/TableOperations/img/cell-split.gif
/plugins/TableOperations/img/col-delete.gif
/plugins/TableOperations/img/col-insert-after.gif
/plugins/TableOperations/img/col-insert-before.gif
/plugins/TableOperations/img/col-prop.gif
/plugins/TableOperations/img/col-split.gif
/plugins/TableOperations/img/row-delete.gif
/plugins/TableOperations/img/row-insert-above.gif
/plugins/TableOperations/img/row-insert-under.gif
/plugins/TableOperations/img/row-prop.gif
/plugins/TableOperations/img/row-split.gif
/plugins/TableOperations/img/table-prop.gif
I just redid the icon map...changes are in the original post.
Here's a few more for the plugins:

Document Properties
\plugins\FullPage\img\docprop.gif

HTML-Tidy
\plugins\HtmlTidy\img\html-tidy.gif

Insert Anchor
\plugins\InsertAnchor\img\insert-anchor.gif

Spell Checker
\plugins\SpellChecker\img\spell-check.gif
Hope these help too!