Upgrade to Xinha 0.931. Xinha has been optimized for size and dozens of issues have been closed

out since the last upgrade . Add Firefox and Xinha buttons to main page to show our support.
This commit is contained in:
Chris Morgan
2007-05-31 22:43:05 +00:00
committed by WineHQ
parent ff46a4485d
commit 2d4b27530d
354 changed files with 19793 additions and 21419 deletions

View File

@@ -1,155 +1,97 @@
/*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:--
-- Xinha example logic. This javascript is used to auto-generate examples
-- as controlled by the options set in full_example-menu.html. it's called
-- from full_example-body.html.
--
-- $HeadURL: http://svn.xinha.python-hosting.com/trunk/examples/full_example.js $
-- $LastChangedDate: 2005-10-29 12:28:08 -0400 (Sat, 29 Oct 2005) $
-- $LastChangedRevision: 416 $
-- $LastChangedBy: gogo $
--------------------------------------------------------------------------*/
var num = 1;
if(window.parent && window.parent != window)
{
var f = window.parent.menu.document.forms[0];
_editor_lang = f.lang[f.lang.selectedIndex].value;
_editor_skin = f.skin[f.skin.selectedIndex].value;
num = parseInt(f.num.value);
if(isNaN(num))
{
num = 1;
f.num.value = 1;
}
xinha_plugins = [ ];
for(var x = 0; x < f.plugins.length; x++)
{
if(f.plugins[x].checked) xinha_plugins.push(f.plugins[x].value);
}
}
xinha_editors = [ ]
for(var x = 0; x < num; x++)
{
var ta = 'myTextarea' + x;
xinha_editors.push(ta);
}
xinha_config = function()
{
var config = new HTMLArea.Config();
if(typeof CSS != 'undefined')
{
config.pageStyle = "@import url(custom.css);";
}
if(typeof Stylist != 'undefined')
{
// We can load an external stylesheet like this - NOTE : YOU MUST GIVE AN ABSOLUTE URL
// otherwise it won't work!
config.stylistLoadStylesheet(document.location.href.replace(/[^\/]*\.html/, 'stylist.css'));
// Or we can load styles directly
config.stylistLoadStyles('p.red_text { color:red }');
// If you want to provide "friendly" names you can do so like
// (you can do this for stylistLoadStylesheet as well)
config.stylistLoadStyles('p.pink_text { color:pink }', {'p.pink_text' : 'Pretty Pink'});
}
if(typeof DynamicCSS != 'undefined')
{
config.pageStyle = "@import url(dynamic.css);";
}
if(typeof InsertWords != 'undefined')
{
// Register the keyword/replacement list
var keywrds1 = new Object();
var keywrds2 = new Object();
keywrds1['-- Dropdown Label --'] = '';
keywrds1['onekey'] = 'onevalue';
keywrds1['twokey'] = 'twovalue';
keywrds1['threekey'] = 'threevalue';
keywrds2['-- Insert Keyword --'] = '';
keywrds2['Username'] = '%user%';
keywrds2['Last login date'] = '%last_login%';
config.InsertWords = {
combos : [ { options: keywrds1, context: "body" },
{ options: keywrds2, context: "li" } ]
}
}
if (typeof ListType != 'undefined')
{
if(window.parent && window.parent != window)
{
var f = window.parent.menu.document.forms[0];
config.ListType.mode = f.elements['ListTypeMode'].options[f.elements['ListTypeMode'].selectedIndex].value;
}
}
if (typeof CharacterMap != 'undefined')
{
if(window.parent && window.parent != window)
{
var f = window.parent.menu.document.forms[0];
config.CharacterMap.mode = f.elements['CharacterMapMode'].options[f.elements['CharacterMapMode'].selectedIndex].value;
}
}
if(typeof Filter != 'undefined') {
xinha_config.Filters = ["Word", "Paragraph"]
}
return config;
}
var f = document.forms[0];
f.innerHTML = '';
var lipsum = document.getElementById('lipsum').innerHTML;
for(var x = 0; x < num; x++)
{
var ta = 'myTextarea' + x;
var div = document.createElement('div');
div.className = 'area_holder';
var txta = document.createElement('textarea');
txta.id = ta;
txta.name = ta;
txta.value = lipsum;
txta.style.width="100%";
txta.style.height="420px";
div.appendChild(txta);
f.appendChild(div);
}
//check submitted values
var submit = document.createElement('input');
submit.type = "submit";
submit.id = "submit";
submit.value = "submit";
f.appendChild(submit);
var _oldSubmitHandler = null;
if (document.forms[0].onsubmit != null) {
_oldSubmitHandler = document.forms[0].onsubmit;
}
function frame_onSubmit(){
alert(document.getElementById("myTextarea0").value);
if (_oldSubmitHandler != null) {
_oldSubmitHandler();
}
}
document.forms[0].onsubmit = frame_onSubmit;
var num=1;
if(window.parent&&window.parent!=window){
var f=window.parent.menu.document.forms[0];
_editor_lang=f.lang[f.lang.selectedIndex].value;
_editor_skin=f.skin[f.skin.selectedIndex].value;
num=parseInt(f.num.value);
if(isNaN(num)){
num=1;
f.num.value=1;
}
xinha_plugins=[];
for(var x=0;x<f.plugins.length;x++){
if(f.plugins[x].checked){
xinha_plugins.push(f.plugins[x].value);
}
}
}
xinha_editors=[];
for(var x=0;x<num;x++){
var ta="myTextarea"+x;
xinha_editors.push(ta);
}
xinha_config=function(){
var _1=new HTMLArea.Config();
if(typeof CSS!="undefined"){
_1.pageStyle="@import url(custom.css);";
}
if(typeof Stylist!="undefined"){
_1.stylistLoadStylesheet(document.location.href.replace(/[^\/]*\.html/,"stylist.css"));
_1.stylistLoadStyles("p.red_text { color:red }");
_1.stylistLoadStyles("p.pink_text { color:pink }",{"p.pink_text":"Pretty Pink"});
}
if(typeof DynamicCSS!="undefined"){
_1.pageStyle="@import url(dynamic.css);";
}
if(typeof InsertWords!="undefined"){
var _2=new Object();
var _3=new Object();
_2["-- Dropdown Label --"]="";
_2["onekey"]="onevalue";
_2["twokey"]="twovalue";
_2["threekey"]="threevalue";
_3["-- Insert Keyword --"]="";
_3["Username"]="%user%";
_3["Last login date"]="%last_login%";
_1.InsertWords={combos:[{options:_2,context:"body"},{options:_3,context:"li"}]};
}
if(typeof ListType!="undefined"){
if(window.parent&&window.parent!=window){
var f=window.parent.menu.document.forms[0];
_1.ListType.mode=f.elements["ListTypeMode"].options[f.elements["ListTypeMode"].selectedIndex].value;
}
}
if(typeof CharacterMap!="undefined"){
if(window.parent&&window.parent!=window){
var f=window.parent.menu.document.forms[0];
_1.CharacterMap.mode=f.elements["CharacterMapMode"].options[f.elements["CharacterMapMode"].selectedIndex].value;
}
}
if(typeof Filter!="undefined"){
xinha_config.Filters=["Word","Paragraph"];
}
return _1;
};
var f=document.forms[0];
f.innerHTML="";
var lipsum=document.getElementById("lipsum").innerHTML;
for(var x=0;x<num;x++){
var ta="myTextarea"+x;
var div=document.createElement("div");
div.className="area_holder";
var txta=document.createElement("textarea");
txta.id=ta;
txta.name=ta;
txta.value=lipsum;
txta.style.width="100%";
txta.style.height="420px";
div.appendChild(txta);
f.appendChild(div);
}
var submit=document.createElement("input");
submit.type="submit";
submit.id="submit";
submit.value="submit";
f.appendChild(submit);
var _oldSubmitHandler=null;
if(document.forms[0].onsubmit!=null){
_oldSubmitHandler=document.forms[0].onsubmit;
}
function frame_onSubmit(){
alert(document.getElementById("myTextarea0").value);
if(_oldSubmitHandler!=null){
_oldSubmitHandler();
}
}
document.forms[0].onsubmit=frame_onSubmit;