''Com actualitzar la versió de TiddlyWiki en català'':\n\nEs recomana treballar sempre amb la darrera versió de CatalanLingo.\n\n!Instruccions\n* Copia el [[contingut d'aquest tiddler|CatalanLingo]], al tiddler ''~CatalanLingo'' del teu TiddlyWiki i ''desa els canvis''.\n* Només cal seguir aquestes instruccions si ja has afegit continguts (tiddlers) al teu TiddlyWiki. Per començar un nou TiddlyWiki clica [[aquí|BaixaElProgramari]].\n\n!Nota tècnica\nLa versió catalana de TiddlyWiki està formada per dues entitats separades, el que facilita l'actualizació del codi i de la traducció de forma independent:\n* El codi (en anglés) que es troba aquí: http://www.tiddlywiki.com/empty.html\n* La traducció al català, que es troba aquí: http://pacoriviere.googlepages.com/TiddlyWiki.html#CatalanLingo\nPer disposar de la darrera versió en anglés traduïda al català, només cal baixar els dos arxius anteriors i combinar-los seguint les Instruccions anteriors.\n\n!Versions\n1.0.0 5-5-2006 - Primera versió pública\n1.0.1 13-5-2006 - Petites correccions\n1.0.2 14-5-2006 - Connector Calendari\n1.0.3 15-5-2006 - Connector TriaTema i com ActualitzarCatalanLingo
{{{\nversion.extensions.CatalanLingo = {\n major: 1, minor: 0, revision: 3,\n date: new Date(2006, 5, 16), \n type: 'translation',\n source: "http://pacoriviere.googlepages.com/index.htm#CatalanLingo"\n};\nconfig.shadowTiddlers.Copyright = "CatalanLingo - Localització de TiddlyWiki versió 1.0.3 (c) Paco Rivière, 2006. \sn\snSi ''feu servir CatalanLingo públicament'' apreciaria un enllaç cap a (http://pacoriviere.cat/).\sn\sn''L'ús comercial'' requireix permís previ escrit. Contacteu Paco Rivière a (friviere [a] palmcat [punt] cat).\sn\sn!LLICÈNCIA\sn\snCopyright (c) Paco Rivière 2006\sn\snEs permet la distribució del codi font i binari, amb o sense modificacions, sempre que es compleixin les següents condicions:\sn\snLa distribució del codi font ha de mantenir el copyright anterior, aquesta llista de condicions i el següent avís.\sn\snLa distribució del codi binari ha de mantenir el copyright anterior, aquesta llista de condicions i el següent avís a la documentació i/o altres materials subministrats amb la distribució.\sn\snEl nom de Paco Rivière ni els dels seus col·laboradors no es poden fer servir per recolçar o promoure productes derivats d'aquest programari, sense el seu permís explícit previ per escrit.\sn\snELS POSSEÏDORS DEL COPYRIGHT I/O ALTRES PARTS FACILITEN EL PROGRAMARI &quot;TAL QUAL&quot; SENSE CAP MENA DE GARANTIA, NI EXPLÍCITA NI IMPLÍCITA, INCLOSES, ENTRE ALTRES, LES GARANTIES IMPLÍCITES DE COMERCIALITZABILITAT I APTITUD PER A PROPÒSITS DETERMINATS. EN CAP CAS EL POSSEÏDOR DEL COPYRIGHT I/O ALTRES PARTS, TRET DEL QUE REQUEREIXIN ELS ACORDS PER ESCRIT, NO US HAURÀ DE RESPONDRE PER PERJUDICIS, INCLOSOS ELS DIRECTES, INDIRECTES, ESPECIALS, EXEMPLARS, O DANYS CONSEQÜENTS (INCLOSES ENTRE D'ALTRES LES PÈRDUES DE DADES, O BENEFICIS; O INTERRUPCIO DEL NEGOCI), COM SIGUI QUE S'HAGIN PRODUÏT I EN QUALSEVOL TEORIA DE FIABILITAT, TAN SI ÉS EN CONTRACTE, FIABILITAT ESTRICTE, O ALTRES (INCLOSES LA NEGLIGÈNCIA O ALTRES), QUE ES DERIVIN DE L'ÚS DEL PROGRAMA, EN QUALSEVOL FORMA, FINS I TOT SI AQUEST POSSEÏDOR O ALTRA PART HA ESTAT ADVERTIDA DE LA POSSIBILITAT D'AQUESTS PERJUDICIS.";\n\nconfig.commands.closeTiddler.text = "tanca";\nconfig.commands.closeTiddler.tooltip = "Tanca aquest tiddler";\nconfig.commands.closeOthers.text = "tanca altres";\nconfig.commands.closeOthers.tooltip = "Tanca tots els altres tiddlers";\nconfig.commands.editTiddler.text = "edita";\nconfig.commands.editTiddler.tooltip = "Canvia aquest tiddler";\nconfig.commands.editTiddler.readOnlyText = "mostra";\nconfig.commands.editTiddler.readOnlyTooltip = "Mostra el codi d'aquest tiddler";\nconfig.commands.saveTiddler.text = "desa";\nconfig.commands.saveTiddler.tooltip = "Desa els canvis a aquest tiddler";\nconfig.commands.saveTiddler.readOnlyText = "fet";\nconfig.commands.saveTiddler.readOnlyTooltip = "Torna a l'aspecte normal";\nconfig.commands.cancelTiddler.text = "anul·la";\nconfig.commands.cancelTiddler.tooltip = "Anul·la els canvis a aquest tiddler";\nconfig.commands.deleteTiddler.text = "suprimeix";\nconfig.commands.deleteTiddler.tooltip = "Suprimeix aquest tiddler";\nconfig.commands.deleteTiddler.warning = "Segur que voleu que suprimir '%0'?";\nconfig.commands.permalink.text = "enllaç permanent";\nconfig.commands.permalink.tooltip = "Enllaç permanent d'aquest tiddler";\nconfig.commands.references.text = "referències";\nconfig.commands.references.tooltip = "Mostra els tiddlers que enllacen a aquest";\nconfig.commands.references.popupNone = "Sense referències";\nconfig.commands.jump.text = "salta";\nconfig.commands.jump.tooltip = "Salta a un altre tiddler obert";\n\nconfig.macros.allTags.noTags = "No hi ha tiddlers amb etiquetes";\nconfig.macros.allTags.tooltip = "Mostra els tiddlers amb l'etiqueta ";\nconfig.macros.closeAll.label = "tanca tots";\nconfig.macros.closeAll.prompt = "Tanca tots el tiddlers que es mostren (excepte els que s'estàn editant)";\nconfig.macros.list.all.prompt = "Todos els tiddlers por ordre alfabètic";\nconfig.macros.list.missing.prompt = "Tiddlers que tenen enllaços cap a ells però no estàn definits";\nconfig.macros.list.orphans.prompt = "Tiddlers sense enllaços des de cap altre";\nconfig.macros.list.shadowed.prompt = "Tiddlers amb ombres amb contingut per omisió";\nconfig.macros.newJournal.label = "nou diari";\nconfig.macros.newJournal.months = ["de gener de", "de febrer de", "de març de", "d'abril de", "de maig de", "de juny de", "de juliol de", "d'agost de", "de setembre de", "d'octubre de", "de novembre de","de desembre de"];\nconfig.macros.newJournal.prompt = "Fes un tiddler nou amb la data i hora actuals";\nconfig.macros.newTiddler.label = "nou tiddler";\nconfig.macros.newTiddler.title = "Nou tiddler";\nconfig.macros.newTiddler.prompt = "Obre un nou tiddler";\nconfig.macros.permaview.label = "torna vista";\nconfig.macros.permaview.prompt = "Enllaça a una URL que torni tots els tiddlers que es mostren ara";\nconfig.macros.saveChanges.label = "desa els canvis";\nconfig.macros.saveChanges.prompt = "Desa tots els canvis a un arxiu";\nconfig.macros.search.label = "cerca";\nconfig.macros.search.prompt = "Cerca en aquest TiddlyWiki";\nconfig.macros.search.successMsg = "S'han trobat %0 tiddlers que contenent: '%1'";\nconfig.macros.search.failureMsg = "No s'ha trobat cap tiddler amb: '%0'";\nconfig.macros.timeline.dateFormat = "DD MMM YYYY";\nconfig.macros.tagging.label = "etiquetes:";\nconfig.macros.tagging.labelNotTag = "cap etiqueta:";\nconfig.macros.tagging.tooltip = "Llista de tiddlers etiquetats amb '%0'";\n\nconfig.messages.backupFailed = "No ha estat possible desar la còpia de l'arxiu";\nconfig.messages.backupSaved = "S'ha desat la còpia";\nconfig.messages.cantSaveError = "No es poden desar els canvis. Pot ser que el vostre navegador no permeti desar (Podeu fer servir Firefox, en lloc), o degut a que el nom de la ruta de l'arxiu TiddlyWiki té algun caràcter incorrecte";\nconfig.messages.confirmExit = "--------------------------------\sn\snHi ha canvis que no s'han desat al TiddlyWiki. Si continueu perdreu aquests canvis\sn\sn--------------------------------";\nconfig.messages.customConfigError = "Error del tiddler systemConfig '%1' - '%0'";\nconfig.messages.emptyFailed = "No ha estat possible desar la plantilla buida";\nconfig.messages.emptySaved = "S'ha desat la plantilla buida";\nconfig.messages.externalLinkTooltip = "Enllaç extern cap a '%0'";\nconfig.messages.invalidFileError = "Sembla que l'arxiu original '%0' no és un TiddlyWiki vàlid";\nconfig.messages.macroError = "Hi ha un error a la macro <<%0>>";\nconfig.messages.macroErrorDetails = "Hi ha hagut un error a l'executar la macro <<%0>>:\sn%1";\nconfig.messages.missingMacro = "No es troba la macro";\nconfig.messages.mainFailed = "No ha estat possible desar l'arxiu principal de TiddlyWiki. Els vostres canvis no s'han desat";\nconfig.messages.mainSaved = "S'ha desat l'arxiu principal de TiddlyWiki";\nconfig.messages.noTags = "No hi ha tiddlers amb etiquetes";\nconfig.messages.notFileUrlError = "Cal desar aquest TiddlyWiki a un arxiu per poder desar els canvis";\nconfig.messages.overwriteWarning = "Ja hi ha un tiddler amb el nom '%0'. Trieu D'acord si el voleu sobreescriure";\nconfig.messages.rssFailed = "No ha estat possible desar el fil RSS";\nconfig.messages.rssSaved = "S'ha desat el fil RSS";\nconfig.messages.savedSnapshotError = "Sembla que aquest TiddlyWiki s'ha desat malament. Veieu el detalls a http://www.tiddlywiki.com/#DownloadSoftware";\nconfig.messages.subtitleUnknown = "(desconegut)";\nconfig.messages.undefinedTiddlerToolTip = "El tiddler '%0' encara no existeix";\nconfig.messages.shadowedTiddlerToolTip = "El tiddler '%0' encara no existeix, però té un valor d'ombra predefinit";\nconfig.messages.unsavedChangesWarning = "ATENCIÓ! Hi ha canvis que no s'han desat al TiddlyWiki\sn\snTrieu D'acord per desar\snTrieu ANUL·LA per descartar-los";\nconfig.messages.messageClose.text = "tanca";\nconfig.messages.messageClose.tooltip = "Tanca aquest quadre";\nconfig.messages.dates.months = ["de gener de", "de febrer de", "de març de", "d'abril de", "de maig de", "de juny de", "de juliol de", "d'agost de", "de setembre de", "d'octubre de", "de novembre de","de desembre de"];\nconfig.messages.dates.days = ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"];\n\nconfig.views.editor.defaultText = "Entreu el text per a '%0'.";\nconfig.views.editor.tagChooser.popupNone = "No hi ha etiquetes definides";\nconfig.views.editor.tagChooser.tagTooltip = "Afegeix etiqueta ";\nconfig.views.editor.tagChooser.text = "afegeix etiquetes";\nconfig.views.editor.tagChooser.tooltip = "Tria entre les etiquetes actuals per afegir a aquest tiddler";\nconfig.views.editor.tagPrompt = "Afegiu les etiquetes separades per espais, [[feu servir corxets]] si cal, o afegiu-ne";\n\nconfig.shadowTiddlers.OpcionsAvançades = "<<option chkGenerateAnRssFeed>> [[GeneraFilRSS|FilRss]]\sn<<option chkOpenInNewWindow>> ObreEnllaçosEnNovaFinestra\sn<<option chkSaveEmptyTemplate>> DesaPlantillaBuida\sn<<option chkToggleLinks>> Clicant als enllaços a tiddlers ja oberts els tanca\sn^^(s'ignora amb la tecla Control o altre tecla modificadora)^^\sn<<option chkHttpReadOnly>> AmagaBotonsDEdicio al veure's com a HTTP\sn<<option chkForceMinorUpdate>> Tracta les edicions com a CanvisMenors conservant la data i hora\sn^^(s'ignora amb la tecla Shift al clicar 'fet' o amb Ctrl-Shift-Enter^^\sn<<option chkConfirmDelete>> ConfirmaAbansDeSuprimir\snMàxim nombre de línies d'una capsa d'edició tiddler: <<option txtMaxEditRows>>\snNom de la carpeta per als arxius de còpia: <<option txtBackupFolder>>\sn";\nconfig.shadowTiddlers.ActualitzarCatalanLingo = "''Com actualitzar la versió de TiddlyWiki en català'':\sn\snEs recomana treballar sempre amb la darrera versió de CatalanLingo.\sn\sn!Instruccions\sn* Copia el [[contingut d'aquest tiddler|CatalanLingo]], al tiddler ''~CatalanLingo'' del teu TiddlyWiki i ''desa els canvis''.\sn* Només cal seguir aquestes instruccions si ja has afegit continguts (tiddlers) al teu TiddlyWiki. Per començar un nou TiddlyWiki clica [[aquí|BaixaElProgramari]].\sn\sn!Nota tècnica\snLa versió catalana de TiddlyWiki està formada per dues entitats separades, el que facilita l'actualizació del codi i de la traducció de forma independent:\sn* El codi (en anglés) que es troba aquí: http://www.tiddlywiki.com/empty.html\sn* La traducció al català, que es troba aquí: http://pacoriviere.googlepages.com/TiddlyWiki.html#CatalanLingo\snPer disposar de la darrera versió en anglés traduïda al català, només cal baixar els dos arxius anteriors i combinar-los seguint les Instruccions anteriors.\sn\sn!Versions\sn1.0.0 5-5-2006 - Primera versió pública\sn1.0.1 13-5-2006 - Petites correccions\sn1.0.2 14-5-2006 - Connector Calendari\sn1.0.3 15-5-2006 - Connector TriaTema i com ActualitzarCatalanLingo";\nconfig.shadowTiddlers.BaixaElProgramari = "Anem a baixar una còpia de TiddlyWiki que tú podràs modificar al teu ordinador.\sn\snClica [[aquí|http://pacoriviere.googlepages.com/TiddlyWiki.html]] amb el botó dret del ratolí i tria ''Desa l'enllaç al disc''. (No obris la pàgina).\sn\snA partir d'aquí ja pots obrir la pàgina al teu navegador, modificar-la i omplir-la de contingut. Pots fer-la servir al teu ordinador o pujar-la a internet i compartir-la.\sn\snAquí trobaràs una [[èxplicació més detallada|http://pacoriviere.googlepages.com/20minuts.html]]\snActualitzarCatalanLingo";\nconfig.shadowTiddlers.ComComençar = "Per començar amb aquest TiddlyWiki en blanc, heu de modificar els següents tiddlers:\sn* [[TitolDelLloc|SiteTitle]] & [[SubtitolDelLloc|SiteSubtitle]]: El títol i el subtítol del lloc, com es mostra a sobre (un cop desats, també apareixeran a la barra de títols del navegador)\sn* [[MenuPrincipal|MainMenu]]: El menú (normalment a l'esquerra)\sn* [[TiddlersPerOmisio|DefaultTiddlers]]: Conté els noms dels tiddlers que voleu que apareguin quan s'obre el TiddlyWiki\snTambé heu d'entrar el vostre nom d'usuari per signar les vostres edicions: <<option txtUserName>>";\nconfig.shadowTiddlers.Connectors = "Els connectors (plugins) permeten ampliar les funcions de [[TiddlyWiki]]:\sn\sn* ''En català'':\sn** [[Calendari|http://pacoriviere.googlepages.com/CalendariPlugin.html]] Calendari i agenda.\sn** [[Tria el Tema|http://pacoriviere.googlepages.com/TriaTema.html]] Tria l'aspecte de TiddlyWiki entre diversos fulls d'estil.\sn** [[Presentació|http://pacoriviere.googlepages.com/PresentacioPlugin.html]] Fes presentacions amb TiddlyWiki.\sn\sn* ''En anglés'': http://www.tiddlywiki.com/index.html#Plugins";\nconfig.shadowTiddlers.MainMenu = "ComComençar\snTiddlyWiki\sn[[BaixaElProgramari]]\sn[[Connectors]]\sn[[Donacions]]\sn[[RSS|FilRss]]\sn\sn© 2006 [[osmosoft|http://www.osmosoft.com]]\sn[[©|Copyright]] 2006 [[frivière|http://pacoriviere.cat/]]\sn\sn\sn^^TiddlyWiki versió <<version>>^^";\nconfig.shadowTiddlers.DefaultTiddlers = "ComComençar";\nconfig.shadowTiddlers.Donacions = "La localització de TiddlyWiki al català és programari lliure, disponible gratuitament per tothom i sempre ho serà. Si feu servir TiddlyWiki de forma regular i us resulta útil, podeu [[contribuïr amb una donació|https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=web%40pacoriviere%2ecat&item_name=Donaci%c3%b3%20per%20la%20localitzaci%c3%b3%20de%20TiddlyWiki%20al%20catal%c3%a0&amount=10%2e00&no_shipping=1&return=http%3a%2f%2fpacoriviere%2egooglepages%2ecom%2fTiddlyWiki%2ehtml&no_note=1&tax=0¤cy_code=EUR&lc=ES&bn=PP%2dDonationsBF&charset=UTF%2d8]] encara que sigui modesta a PayPal (com ara 10 Euros)";\nconfig.shadowTiddlers.FilRss = "El fill RSS es troba [[aquí|index.xml]]. L'opció de generar un fil RSS encara està en desenvolupament, i s'ha d'acabar de polir en les properes versions. Només incorpora el text sense enllaços ni format, però permet seguir els canvis fàcilment. Podeu crear un fil RSS al vostre propi TiddlyWiki amb l'[[Opció Avançada|AdvancedOptions]] GeneraFilRSS.\sn\snMés informació sobre el fil RSS (en anglés):\sn\snhttp://www.tiddlywiki.com/index.html#RssFeed";\nconfig.shadowTiddlers.SiteTitle = "El meu TiddlyWiki";\nconfig.shadowTiddlers.SiteSubtitle = "bloc web personal no lineal, reutilitzable";\nconfig.shadowTiddlers.TiddlyWiki = "TiddlyWiki en català:\sn\snhttp://pacoriviere.googlepages.com/TiddlyWiki.html\sn[[Guia ràpida en català|http://pacoriviere.googlepages.com/20minuts.html]]\sn\snLloc web original de TiddlyWiki (en anglés):\sn\snhttp://www.tiddlywiki.com/";\n\nconfig.shadowTiddlers.OptionsPanel = "Aquestes [[Opcions d'Interficie|OptionsPanel]] per personalitzar TiddlyWiki es desen al vostre navegador\sn\snEl vostre nom per signar les vostres edicions. Escribiu-lo com una ParaulaWiki (com ara MartiCliment)\sn<<option txtUserName>>\sn<<option chkSaveBackups>> DesaCòpies\sn<<option chkAutoSave>> AutoDesa\sn<<option chkRegExpSearch>> CercaExpReg\sn<<option chkCaseSensitiveSearch>> CercaSensibleACaixa\sn<<option chkAnimate>> ActivaAnimacions\sn\snMostra les OpcionsAvançades";\n\nconfig.shadowTiddlers.SideBarOptions = "<<search>><<closeAll>><<permaview>><<newTiddler>><<newJournal '0DD MMM YYYY' 'diari'>><<saveChanges>><<slider chkSliderOptionsPanel OptionsPanel opcions 'Canvia les opcions avançades del TiddlyWiki'>>";\n\nconfig.shadowTiddlers.SideBarTabs = "<<tabs txtMainTab 'Data' 'Tiddlers per ordre cronològic' TabTimeline 'Títol' 'Tiddlers per ordre alfabètic' TabAll 'Etiquetes' 'Tiddlers etiquetats' TabTags 'Més' 'Més opcions' TabMore>>";\n\nconfig.shadowTiddlers.TabMore = "<<tabs txtMoreTab 'Falten' 'Tiddlers que no existeixen' TabMoreMissing 'Orfes' 'Tiddlers orfes' TabMoreOrphans Ombres 'Tiddlers amb ombra' TabMoreShadowed>>";\n\nconfig.views.wikified.defaultText = "El tiddler '%0' no existeix. Cliqueu dos cops per començar-lo.";\nconfig.views.wikified.defaultModifier = "(falta)";\nconfig.views.wikified.shadowModifier = "(ombra)";\nconfig.views.wikified.tag.tooltip = "Obre tiddlers marcats amb ";\nconfig.views.wikified.tag.labelTags = "Etiquetes: ";\nconfig.views.wikified.tag.openTag = "Obre l'etiqueta '%0'";\nconfig.views.wikified.tag.labelNoTags = "Sense etiquetes";\nconfig.views.wikified.tag.openAllText = "Obre tots els tiddlers marcats amb '%0'";\nconfig.views.wikified.tag.openAllTooltip = "Obre tots aquests tiddlers";\nconfig.views.wikified.tag.popupNone = "No hi ha altres tiddlers marcats amb '%0'";\n}}}\n
WikiBarDemo
/***\n|''Name:''|WikiBar|\n|''Version:''|2.0.0 beta3|\n|''Source:''|[[AiddlyWiki|http://aiddlywiki.sourceforge.net]]|\n|''Author:''|[[Arphen Lin|mailto:arphenlin@gmail.com]]|\n|''Type:''|toolbar macro command extension|\n|''Required:''|TiddlyWiki 2.0.0 beta6|\n!Description\nWikiBar is a toolbar that gives access to most of TiddlyWiki's formatting features with a few clicks. It's a handy tool for people who are not familiar with TiddlyWiki syntax.\nBesides, with WikiBar-addons, users can extend the power of WikiBar.\n!Support browser\n*Firefox 1.5\n!Revision history\n*v2.0.0 beta3 (2005/12/30)\n** remove macros (replaced by TWMacro addon)\n** add wikibar command in toolbar automatically\n** rename DOIT to HANDLER\n** rename TIP to TOOLTIP\n*v2.0.0 beta2 (2005/12/21)\n** re-design Wikibar addon framework\n*v2.0.0 beta1 (2005/12/14)\n** Note:\n*** WikiBarPlugin is renamed to WikiBar\n** New Features:\n*** support TiddlyWiki 2.0.0 template mechanism\n*** new wikibar data structure\n*** new wikibar-addon framework for developers\n**** support dynamic popup menu generator\n*** support most new macros added in TiddlyWiki 2.0.0\n*** multi-level popup menu\n*** fix wikibar tab stop\n*** remove paletteSelector\n** Known Bugs:\n*** popup-menu and color-picker can't be closed correctly\n*** some macros can't be displayed correctly in previewer\n*** text in previewer will be displayed italic\n*v1.2.0 (2005/11/21)\n**New Features:\n***User defined color palettes supported\n####Get color palettes from [[ColorZilla Palettes|http://www.iosart.com/firefox/colorzilla/palettes.html]].\n####Save the palette file(*.gpl) as a new tiddler and tag it with 'ColorPalettes', then you can use it in WikiBar.\n***WikiBar style sheet supported\n***Click on document to close current colorPicker, paletteSelector or aboutWikibar\n*v1.1.1 (2005/11/03)\n**Bugs fixed:\n***'Not enough parameters!' message is displayed when the parameter includes '%+number', ex: 'hello%20world!'\n*v1.1.0 (2005/11/01)\n**Bugs fixed:\n***WikiBar overruns (reported by by GeoffS <gslocock@yahoo.co.uk>)\n**New features:\n***Insert a color code at the cursor. (Thanks to RunningUtes <RunningUtes@gmail.com>)\n***Enable gradient macro. (Thanks to RunningUtes <RunningUtes@gmail.com>)\n***Insert tiddler comment tags {{{/% ... %/}}}. (new feature supported by TiddlyWiki 1.2.37)\n***Insert DateFormatString for {{{<<today>>}}} macro. (new feature supported by TiddlyWiki 1.2.37)\n**Enhanced:\n***Allow optional parameters in syntax.\n**Bugs:\n***'Not enough parameters!' message is displayed when the parameter includes '%+number', ex: 'hello%20world!'\n*v1.0.0 (2005/10/30)\n**Initial release\n!Code\n***/\n//{{{\nconfig.macros.wikibar = {major: 2, minor: 0, revision: 0, beta: 3, date: new Date(2005,12,30)};\nconfig.macros.wikibar.handler = function(place,macroName,params,wikifier,paramString,tiddler){\n if(!(tiddler instanceof Tiddler)) {return;}\n story.setDirty(tiddler.title,true);\n place.id = 'wikibar'+tiddler.title;\n place.className = 'toolbar wikibar';\n};\nfunction wikibar_install(){\n config.commands.wikibar = {\n text: 'wikibar',\n tooltip: 'wikibar on/off',\n handler: function(e,src,title) {\n if(!e){ e = window.event; }\n var theButton = resolveTarget(e);\n theButton.id = 'wikibarButton'+title;\n wikibarPopup.remove();\n wikibar_installAddons(theButton, title);\n wikibar_createWikibar(title);\n return(false);\n }\n };\n config.shadowTiddlers['EditTemplate'] = wikibar_addWikibarCommand(config.shadowTiddlers['EditTemplate']);\n var tiddler = store.getTiddler('EditTemplate');\n if(tiddler){\n tiddler.text = wikibar_addWikibarCommand(tiddler.text);\n }\n}\nfunction wikibar_installAddons(theButton, title){\n var tiddlers = store.getTaggedTiddlers('wikibarAddons');\n if(!tiddlers) { return; }\n theButton.addons=[];\n for(var i=0; i<tiddlers.length; i++){\n try{\n eval(tiddlers[i].text);\n try{\n wikibar_addonInstall(title);\n wikibar_addonInstall = null;\n theButton.addons.push({ok:true, name:tiddlers[i].title});\n }catch(ex){\n theButton.addons.push({ok:false, name:tiddlers[i].title, error:ex});\n }\n }catch(ex){\n theButton.addons.push({ok:false, name:tiddlers[i].title, error:ex});\n }\n }\n}\nfunction wikibar_addWikibarCommand(tiddlerText){\n var div = document.createElement('div');\n div.style.display = 'none';\n div.innerHTML = tiddlerText;\n for(var i=0; i<div.childNodes.length; i++){\n var o=div.childNodes[i];\n if(o.tagName==='DIV'){\n if(o.className=='toolbar'){\n var macroText = o.getAttribute('macro').trim();\n if(macroText.search('wikibar')<=0){\n macroText += ' wikibar';\n o.setAttribute('macro', macroText);\n }\n break;\n }\n }\n }\n return div.innerHTML.replace(/\s"/g, "\s'");\n}\nfunction wikibar_processSyntaxParams(theSyntax, params){\n try{\n var pcr = 'AplWikibarPcr';\n var rx=null;\n var allParams=null;\n if(params){\n if(typeof(params)=='object'){\n for(var i=0; i<params.length; i++){\n if(params[i]){\n params[i] = params[i].replace(new RegExp('%','g'), pcr).trim();\n rx = '(\s\s[%'+(i+1)+'\s\s])' + '|' + '(%'+(i+1)+')';\n theSyntax = theSyntax.replace(new RegExp(rx,'g'), params[i] );\n }\n }\n allParams = params.join(' ').trim();\n }else{\n allParams = params.replace(new RegExp('%','g'), pcr).trim();\n rx = /(\s[%1{1}\s])|(%1{1})/g;\n theSyntax = theSyntax.replace(rx, allParams);\n }\n }\n if(allParams){\n theSyntax = theSyntax.replace(new RegExp('%N{1}','g'), allParams);\n }\n rx=/\s[%(([1-9]{1,}[0-9]{0,})|(N{1}))\s]/g;\n theSyntax = theSyntax.replace(rx, '');\n rx=/%(([1-9]{1,}[0-9]{0,})|(N{1}))/g;\n if( theSyntax.match(rx) ){\n throw 'Not enough parameters! ' + theSyntax;\n }\n theSyntax=theSyntax.replace(new RegExp(pcr,'g'), '%');\n return theSyntax;\n } catch(ex){\n return null;\n }\n}\nfunction wikibar_resolveEditItem(tiddlerWrapper, itemName){\n if(tiddlerWrapper.hasChildNodes()){\n var c=tiddlerWrapper.childNodes;\n for(var i=0; i<c.length; i++){\n var txt=wikibar_resolveEditItem(c[i], itemName);\n if(!txt){\n continue;\n }else{\n return txt;\n }\n }\n }\n return ((tiddlerWrapper.getAttribute && tiddlerWrapper.getAttribute('edit')==itemName)? tiddlerWrapper : null);\n}\nfunction wikibar_resolveEditItemValue(tiddlerWrapper, itemName){\n var o = wikibar_resolveEditItem(tiddlerWrapper, itemName);\n return (o? o.value.replace(/\sr/mg,'') : null);\n}\nfunction wikibar_resolveTiddlerEditorWrapper(obj){\n if(obj.id=='tiddlerDisplay'){return null;}\n if((obj.getAttribute && obj.getAttribute('macro')=='edit text')){return obj;}\n return wikibar_resolveTiddlerEditorWrapper(obj.parentNode);\n}\nfunction wikibar_resolveTiddlerEditor(obj){\n if(obj.hasChildNodes()){\n var c = obj.childNodes;\n for(var i=0; i<c.length; i++){\n var o=wikibar_resolveTiddlerEditor(c[i]);\n if(o){ return o;}\n }\n }\n return ((obj.getAttribute && obj.getAttribute('edit')=='text')? obj : null);\n}\nfunction wikibar_resolveTargetButton(obj){\n if(obj.id && obj.id.substring(0,7)=='wikibar'){ return null; }\n if(obj.tiddlerTitle){\n return obj;\n }else{\n return wikibar_resolveTargetButton(obj.parentNode);\n }\n}\nfunction wikibar_isValidMenuItem(tool){\n if(!tool){ return false; }\n if(tool.TYPE=='MENU' || tool.TYPE=='MAIN_MENU'){\n for(var key in tool){\n if(key.substring(0,8)=='DYNAITEM'){ return true; }\n if(wikibar_isValidMenuItem(tool[key])){ return true; }\n }\n return false;\n }else{\n return (tool.HANDLER? true : false);\n }\n}\nfunction wikibar_editFormat(param){\n var editor = param.button.editor;\n var params = param.params;\n clearMessage();\n if(!editor){ return; }\n var repText = wikibar_processSyntaxParams(this.syntax, params);\n if(repText===null){ return; }\n var st = editor.scrollTop;\n var ss = editor.selectionStart;\n var se = editor.selectionEnd;\n var frontText= '';\n var endText = '';\n var fullText = editor.value;\n if(se>ss && ss>=0){\n frontText = fullText.substring(0, ss);\n endText = fullText.substring(se, fullText.length);\n }\n else if(ss===0 && (se===0 || se == fullText.length) ){\n endText = fullText;\n }\n else if(se==ss && ss>0){\n frontText = fullText.substring(0, ss);\n endText = fullText.substring(se, fullText.length);\n }\n if(repText.indexOf('user_text')>=0 && this.hint){\n repText = repText.replace('user_text', this.hint);\n }\n editor.value = frontText + repText + endText;\n editor.selectionStart = ss;\n editor.selectionEnd = ss + repText.length;\n editor.scrollTop = st;\n editor.focus();\n}\nfunction wikibar_editFormatByWord(param){\n var editor = param.button.editor;\n var params = param.params;\n clearMessage();\n if(!editor){return;}\n var repText = wikibar_processSyntaxParams(this.syntax, params);\n if(repText===null){ return; }\n var st = editor.scrollTop;\n var ss = editor.selectionStart;\n var se = editor.selectionEnd;\n var frontText= '';\n var selText = '';\n var endText = '';\n var fullText = editor.value;\n if(se>ss && ss>=0){\n frontText = fullText.substring(0, ss);\n selText = fullText.substring(ss,se);\n endText = fullText.substring(se, fullText.length);\n }\n else if(ss===0 && (se===0 || se == fullText.length) ){\n endText = fullText;\n }\n else if(se==ss && ss>0){\n frontText = fullText.substring(0, ss);\n endText = fullText.substring(se, fullText.length);\n if(!( fullText.charAt(ss-1).match(/\sW/gi) || fullText.charAt(ss).match(/\sW/gi) )){\n var m = frontText.match(/\sW/gi);\n if(m){\n ss = frontText.lastIndexOf(m[m.length-1])+1;\n }\n else{\n ss = 0;\n }\n m = endText.match(/\sW/gi);\n if(m){\n se += endText.indexOf(m[0]);\n }\n else{\n se = fullText.length;\n }\n frontText = fullText.substring(0, ss);\n endText = fullText.substring(se, fullText.length);\n selText = fullText.substring(ss,se);\n }\n }\n if(selText.length>0){\n repText = repText.replace('user_text', selText);\n }\n if(repText.indexOf('user_text')>=0 && this.hint){\n repText = repText.replace('user_text', this.hint);\n }\n editor.value = frontText + repText + endText;\n editor.selectionStart = ss;\n editor.selectionEnd = ss + repText.length;\n editor.scrollTop = st;\n editor.focus();\n}\nfunction wikibar_editFormatByCursor(param){\n var editor = param.button.editor;\n var params = param.params;\n clearMessage();\n if(!editor){ return; }\n var repText = wikibar_processSyntaxParams(this.syntax, params);\n if(repText===null){ return; }\n var st = editor.scrollTop;\n var ss = editor.selectionStart;\n var se = editor.selectionEnd;\n var frontText= '';\n var endText = '';\n var fullText = editor.value;\n if(se>ss && ss>=0){\n frontText = fullText.substring(0, ss);\n endText = fullText.substring(se, fullText.length);\n }\n else if(ss===0 && (se===0 || se == fullText.length) ){\n endText = fullText;\n }\n else if(se==ss && ss>0){\n frontText = fullText.substring(0, ss);\n endText = fullText.substring(se, fullText.length);\n }\n if(repText.indexOf('user_text')>=0 && this.hint){\n repText = repText.replace('user_text', this.hint);\n }\n editor.value = frontText + repText + endText;\n editor.selectionStart = ss;\n editor.selectionEnd = ss + repText.length;\n editor.scrollTop = st;\n editor.focus();\n}\nfunction wikibar_editFormatByLine(param){\n var editor = param.button.editor;\n var params = param.params;\n clearMessage();\n if(!editor){ return; }\n var repText = wikibar_processSyntaxParams(this.syntax, params);\n if(repText===null){ return; }\n var st = editor.scrollTop;\n var ss = editor.selectionStart;\n var se = editor.selectionEnd;\n var frontText= '';\n var selText = '';\n var endText = '';\n var fullText = editor.value;\n if(se>ss && ss>=0){\n if(this.byBlock){\n frontText = fullText.substring(0, ss);\n selText = fullText.substring(ss,se);\n endText = fullText.substring(se, fullText.length);\n }\n else{\n se = ss;\n }\n }\n if(ss===0 && (se===0 || se == fullText.length) ){\n var m=fullText.match(/(\sn|\sr)/g);\n if(m){\n se = fullText.indexOf(m[0]);\n }else{\n se = fullText.length;\n }\n selText = fullText.substring(0, se);\n endText = fullText.substring(se, fullText.length);\n }\n else if(se==ss && ss>0){\n frontText = fullText.substring(0, ss);\n endText = fullText.substring(se, fullText.length);\n m = frontText.match(/(\sn|\sr)/g);\n if(m){\n ss = frontText.lastIndexOf(m[m.length-1])+1;\n }\n else{\n ss = 0;\n }\n m = endText.match(/(\sn|\sr)/g);\n if(m){\n se += endText.indexOf(m[0]);\n }\n else{\n se = fullText.length;\n }\n frontText = fullText.substring(0, ss);\n selText = fullText.substring(ss,se);\n endText = fullText.substring(se, fullText.length);\n }\n if(selText.length>0){\n repText = repText.replace('user_text', selText);\n }\n if(repText.indexOf('user_text')>=0 && this.hint){\n repText = repText.replace('user_text', this.hint);\n }\n if(this.byBlock){\n if( (frontText.charAt(frontText.length-1)!='\sn') && ss>0 ){\n repText = '\sn' + repText;\n }\n if( (endText.charAt(0)!='\sn') || se==fullText.length){\n repText += '\sn';\n }\n }\n editor.value = frontText + repText + endText;\n editor.selectionStart = ss;\n editor.selectionEnd = ss + repText.length;\n editor.scrollTop = st;\n editor.focus();\n}\nfunction wikibar_editFormatByTableCell(param){\n var editor = param.button.editor;\n var params = param.params;\n clearMessage();\n if(!editor){ return; }\n var repText = wikibar_processSyntaxParams(this.syntax, params);\n if(repText===null){ return; }\n var st = editor.scrollTop;\n var ss = editor.selectionStart;\n var se = editor.selectionEnd;\n var frontText= '';\n var selText = '';\n var endText = '';\n var fullText = editor.value;\n if(ss===0 || ss==fullText.length){\n throw 'not valid cell!';\n }\n se=ss;\n frontText = fullText.substring(0, ss);\n endText = fullText.substring(se, fullText.length);\n i=frontText.lastIndexOf('\sn');\n j=frontText.lastIndexOf('|');\n if(i>j || j<0){\n throw 'not valid cell!';\n }\n ss = j+1;\n i=endText.indexOf('\sn');\n j=endText.indexOf('|');\n if(i<j || j<0){\n throw 'not valid cell!';\n }\n se += j;\n frontText = fullText.substring(0, ss-1);\n selText = fullText.substring(ss,se);\n endText = fullText.substring(se+1, fullText.length);\n if(this.key.substring(0,5)=='align'){\n selText = selText.trim();\n if( selText=='>' || selText=='~' || selText.substring(0,8)=='bgcolor(') {return; }\n }\n if(selText.length>0){\n repText = repText.replace('user_text', selText);\n }\n if(repText.indexOf('user_text')>=0 && this.hint){\n repText = repText.replace('user_text', this.hint);\n }\n editor.value = frontText + repText + endText;\n editor.selectionStart = ss;\n editor.selectionEnd = ss + repText.length - 2;\n editor.scrollTop = st;\n editor.focus();\n}\nfunction wikibar_editSelectAll(param){\n var editor = param.button.editor;\n editor.selectionStart = 0;\n editor.selectionEnd = editor.value.length;\n editor.scrollTop = 0;\n editor.focus();\n}\nfunction wikibar_doPreview(param){\n var theButton = param.button;\n var editor = param.button.editor;\n var wikibar = theButton.parentNode;\n if(!wikibar) { return; }\n title = theButton.tiddlerTitle;\n var editorWrapper = wikibar_resolveTiddlerEditorWrapper(editor);\n var tiddlerWrapper = editorWrapper.parentNode;\n var previewer = document.getElementById('previewer'+title);\n if(previewer){\n previewer.parentNode.removeChild(previewer);\n editorWrapper.style.display = 'block';\n visible=true;\n }else{\n previewer = document.createElement('div');\n previewer.id = 'previewer'+title;\n previewer.className = 'viewer previewer';\n previewer.style.height = (editor.offsetHeight) + 'px';\n wikify(editor.value, previewer);\n tiddlerWrapper.insertBefore(previewer, editorWrapper);\n editorWrapper.style.display = 'none';\n visible=false;\n }\n var pv=null;\n for(var i=0; i<wikibar.childNodes.length; i++){\n try{\n var btn = wikibar.childNodes[i];\n if(btn.toolItem.key == 'preview'){ pv=btn; }\n if(btn.toolItem.key != 'preview'){\n btn.style.display = visible ? '': 'none';\n }\n }catch(ex){}\n }\n if(!pv) { return; }\n if(visible){\n pv.innerHTML = '<font face=\s"verdana\s">&infin;</font>';\n pv.title = 'preview current tiddler';\n }\n else{\n pv.innerHTML = '<font face=\s"verdana\s">&larr;</font>';\n pv.title = 'back to editor';\n }\n}\nfunction wikibar_doListAddons(param){\n clearMessage();\n var title = param.button.tiddlerTitle;\n var wikibarButton = document.getElementById('wikibarButton'+title);\n var ok=0, fail=0;\n for(var i=0; i<wikibarButton.addons.length; i++){\n var addon=wikibarButton.addons[i];\n if(addon.ok){\n displayMessage('[ o ] '+addon.name);\n ok++;\n }\n else{\n displayMessage('[ x ] '+addon.name + ': ' + addon.error);\n fail++;\n }\n }\n displayMessage('---------------------------------');\n displayMessage(ok + ' ok ; ' + fail + ' failed');\n}\nfunction wikibar_getColorCode(param){\n var cbOnPickColor = function(colorCode, param){\n param.params = colorCode;\n param.button.toolItem.doMore(param);\n };\n wikibarColorTool.openColorPicker(param.button, cbOnPickColor, param);\n}\nfunction wikibar_getLinkUrl(param){\n var url= prompt('Please enter the link target', (this.param? this.param : ''));\n if (url && url.trim().length>0){\n param.params = url;\n this.doMore(param);\n }\n}\nfunction wikibar_getTableRowCol(param){\n var rc= prompt('Please enter (rows x cols) of the table', '2 x 3');\n if (!rc || (rc.trim()).length<=0){ return; }\n var arr = rc.toUpperCase().split('X');\n if(arr.length != 2) { return; }\n for(var i=0; i<arr.length; i++){\n if(isNaN(arr[i].trim())) { return; }\n }\n var rows = parseInt(arr[0].trim(), 10);\n var cols = parseInt(arr[1].trim(), 10);\n var txtTable='';\n for(var r=0; r<rows; r++){\n for(var c=0; c<=cols; c++){\n if(c===0){\n txtTable += '|';\n }else{\n txtTable += ' |';\n }\n }\n txtTable += '\sn';\n }\n if(txtTable.trim().length>0){\n param.params = txtTable.trim();\n this.doMore(param);\n }\n}\nfunction wikibar_getMacroParam(param){\n var p = prompt('Please enter the parameters of macro \s"' + this.key + '\s":' +\n '\snSyntax: ' + this.syntax +\n '\sn\snNote: '+\n '\sn%1,%2,... - parameter needed'+\n '\sn[%1] - optional parameter'+\n '\sn%N - more than one parameter(1~n)'+\n '\sn[%N] - any number of parameters(0~n)'+\n '\sn\snPS:'+\n '\sn1. Parameters should be seperated with space character'+\n '\sn2. Use \s" to wrap the parameter that includes space character, ex: \s"hello world\s"'+\n '\sn3. Input the word(null) for the optional parameter ignored',\n (this.param? this.param : '') );\n if(!p) { return; }\n p=p.readMacroParams();\n for(var i=0; i<p.length; i++){\n var s=p[i].trim();\n if(s.indexOf(' ')>0){ p[i]="'"+s+"'"; }\n if(s.toLowerCase()=='null'){ p[i]=null; }\n }\n param.params = p;\n this.doMore(param);\n}\nfunction wikibar_getMorePalette(unused){\n clearMessage();\n displayMessage('Get more color palettes(*.gpl) from ColorZilla Palettes site', 'http:\s/\s/www.iosart.com/firefox/colorzilla/palettes.html');\n displayMessage('Save it as a new tiddler with \s"ColorPalettes\s" tag');\n}\nfunction wikibar_createWikibar(title){\n var theWikibar = document.getElementById('wikibar' + title);\n if(theWikibar){\n if(theWikibar.hasChildNodes()){\n theWikibar.style.display = (theWikibar.style.display=='block'? 'none':'block');\n return;\n }\n }\n var tiddlerWrapper = document.getElementById('tiddler'+title);\n var theTextarea = wikibar_resolveTiddlerEditor(tiddlerWrapper);\n if(!theTextarea){\n clearMessage();\n displayMessage('WikiBar only works in tiddler edit mode now');\n return;\n }else{\n if(!theTextarea.id){ theTextarea.id = 'editor'+title; }\n if(!theTextarea.parentNode.id){ theTextarea.parentNode.id='editorWrapper'+title; }\n }\n if(theWikibar){\n theWikibar = document.getElementById('wikibar'+title);\n }else{\n var editorWrapper = wikibar_resolveTiddlerEditorWrapper(theTextarea);\n theWikibar = createTiddlyElement(tiddlerWrapper, 'div', 'wikibar'+title, 'toolbar');\n addClass(theWikibar, 'wikibar');\n var previewer = document.getElementById('previewer'+title);\n if(previewer){\n tiddlerWrapper.insertBefore(theWikibar, previewer);\n }else{\n tiddlerWrapper.insertBefore(theWikibar, editorWrapper);\n }\n }\n wikibar_createMenu(theWikibar,wikibarStore,title,theTextarea);\n if(config.options['chkWikibarSetEditorHeight'] && config.options['txtWikibarEditorRows']){\n theTextarea.rows = config.options['txtWikibarEditorRows'];\n }\n setStylesheet(\n '.wikibar{text-align:left;visibility:visible;margin:2px;padding:1px;}.previewer{overflow:auto;display:block;border:1px solid;}#colorPicker{position:absolute;display:none;z-index:10;margin:0px;padding:0px;}#colorPicker table{margin:0px;padding:0px;border:2px solid #000;border-spacing:0px;border-collapse:collapse;}#colorPicker td{margin:0px;padding:0px;border:1px solid;font-size:11px;text-align:center;cursor:auto;}#colorPicker .header{background-color:#fff;}#colorPicker .button{background-color:#fff;cursor:pointer;cursor:hand;}#colorPicker .button:hover{padding-top:3px;padding-bottom:3px;color:#fff;background-color:#136;}#colorPicker .cell{padding:4px;font-size:7px;cursor:crosshair;}#colorPicker .cell:hover{padding:10px;}.wikibarPopup{position:absolute;z-index:10;border:1px solid #014;color:#014;background-color:#cef;}.wikibarPopup table{margin:0;padding:0;border:0;border-spacing:0;border-collapse:collapse;}.wikibarPopup .button:hover{color:#eee;background-color:#014;}.wikibarPopup .disabled{color:#888;}.wikibarPopup .disabled:hover{color:#888;background-color:#cef;}.wikibarPopup tr .seperator hr{margin:0;padding:0;background-color:#cef;width:100%;border:0;border-top:1px dashed #014;}.wikibarPopup tr .icon{font-family:verdana;font-weight:bolder;}.wikibarPopup tr .marker{font-family:verdana;font-weight:bolder;}.wikibarPopup td{font-size:0.9em;padding:2px;}.wikibarPopup input{border:0;border-bottom:1px solid #014;margin:0;padding:0;font-family:arial;font-size:100%;background-color:#fff;}',\n 'WikiBarStyleSheet');\n}\nfunction wikibar_createMenu(place,toolset,title,editor){\n if(!wikibar_isValidMenuItem(toolset)){return;}\n if(!(toolset.TYPE=='MAIN_MENU' || toolset.TYPE=='MENU')){ return; }\n for(var key in toolset){\n if(key.substring(0,9)=='SEPERATOR'){\n wikibar_createMenuSeperator(place);\n continue;\n }\n if(key.substring(0,8)=='DYNAITEM'){\n var dynaTools = toolset[key](title,editor);\n if(dynaTools.TYPE && dynaTools.TYPE=='MENU'){\n wikibar_createMenuItem(place,dynaTools,null,editor,title);\n }else{\n dynaTools.TYPE = 'MENU';\n wikibar_createMenu(place, dynaTools, title, editor);\n }\n continue;\n }\n if((toolset[key].TYPE!='MENU' && toolset[key].TYPE!='MAIN_MENU') && !toolset[key].HANDLER){continue;}\n wikibar_createMenuItem(place,toolset,key,editor,title);\n }\n}\nfunction wikibar_createMenuItem(place,toolset,key,editor,title){\n if(!key){\n var tool = toolset;\n }else{\n tool = toolset[key];\n tool.key = key;\n }\n if(!wikibar_isValidMenuItem(tool)){return;}\n var toolIsOnMainMenu = (toolset.TYPE=='MAIN_MENU');\n var toolIsMenu = (tool.TYPE=='MENU');\n var theButton;\n if(toolIsOnMainMenu){\n theButton = createTiddlyButton(\n place,\n '',\n (tool.TOOLTIP? tool.TOOLTIP : ''),\n (toolIsMenu? wikibar_onClickMenuItem : wikibar_onClickItem),\n 'button');\n theButton.innerHTML = (tool.CAPTION? tool.CAPTION : key);\n theButton.isOnMainMenu = true;\n addClass(theButton, (toolIsMenu? 'menu' : 'item'));\n place.appendChild( document.createTextNode('\sn') );\n if(!toolIsMenu){\n if(config.options['chkWikibarPopmenuOnMouseOver']){\n theButton.onmouseover = function(e){ wikibarPopup.remove(); };\n }\n }\n }else{\n theButton=createTiddlyElement(place, 'tr',key,'button');\n theButton.title = (tool.TOOLTIP? tool.TOOLTIP : '');\n theButton.onclick = (toolIsMenu? wikibar_onClickMenuItem : wikibar_onClickItem);\n var tdL = createTiddlyElement(theButton, 'td','','marker');\n var td = createTiddlyElement(theButton, 'td');\n var tdR = createTiddlyElement(theButton, 'td','','marker');\n td.innerHTML = (tool.CAPTION? tool.CAPTION : key);\n if(toolIsMenu){\n tdR.innerHTML='&nbsp;&nbsp;&rsaquo;';\n }\n if(tool.SELECTED){\n tdL.innerHTML = '&radic; ';\n addClass(theButton, 'selected');\n }\n if(tool.DISABLED){\n addClass(theButton, 'disabled');\n }\n }\n theButton.tiddlerTitle = title;\n theButton.toolItem = tool;\n theButton.editor = editor;\n theButton.tabIndex = 999;\n if(toolIsMenu){\n if(config.options['chkWikibarPopmenuOnMouseOver']){\n theButton.onmouseover = wikibar_onClickMenuItem;\n }\n }\n}\nfunction wikibar_createMenuSeperator(place){\n if(place.id.substring(0,7)=='wikibar') { return; }\n var onclickSeperator=function(e){\n if(!e){ e = window.event; }\n e.cancelBubble = true;\n if (e.stopPropagation){ e.stopPropagation(); }\n return(false);\n };\n var theButton=createTiddlyElement(place,'tr','','seperator');\n var td = createTiddlyElement(theButton, 'td','','seperator');\n td.colSpan=3;\n theButton.onclick=onclickSeperator;\n td.innerHTML = '<hr>';\n}\nfunction wikibar_genWikibarAbout(){\n var toolset={};\n toolset.version = {\n CAPTION: '<center>WikiBar ' +\n config.macros.wikibar.major + '.' +\n config.macros.wikibar.minor + '.' +\n config.macros.wikibar.revision +\n (config.macros.wikibar.beta? ' beta '+config.macros.wikibar.beta : '') +\n '</center>',\n HANDLER: function(){}\n };\n toolset.SEPERATOR = {};\n toolset.author = {\n CAPTION: '<center>Arphen Lin<br>arphenlin@gmail.com</center>',\n TOOLTIP: 'send mail to the author',\n HANDLER: function(){ window.open('mailto:arphenlin@gmail.com'); }\n };\n toolset.website = {\n CAPTION: '<center>aiddlywiki.sourceforge.net</center>',\n TOOLTIP: 'go to the web site of WikiBar',\n HANDLER: function(){ window.open('http:\s/\s/aiddlywiki.sourceforge.net/'); }\n };\n return toolset;\n}\nfunction wikibar_genWikibarOptions(title, editor){\n var toolset={};\n toolset.popOnMouseOver = {\n CAPTION:'popup menu on mouse over',\n SELECTED: config.options['chkWikibarPopmenuOnMouseOver'],\n HANDLER: function(param){\n config.options['chkWikibarPopmenuOnMouseOver'] = !config.options['chkWikibarPopmenuOnMouseOver'];\n saveOptionCookie('chkWikibarPopmenuOnMouseOver');\n var title = param.button.tiddlerTitle;\n var wikibar = document.getElementById('wikibar'+title);\n if(wikibar){ wikibar.parentNode.removeChild(wikibar); }\n wikibar_createWikibar(title);\n }\n };\n toolset.setEditorSize = {\n CAPTION:'set editor height: <input id=\s"txtWikibarEditorRows\s" type=text size=1 MAXLENGTH=3 value=\s"' +\n (config.options['txtWikibarEditorRows']? config.options['txtWikibarEditorRows']:editor.rows) + '\s"> ok',\n HANDLER: function(param){\n var input = document.getElementById('txtWikibarEditorRows');\n if(input){\n var rows = parseInt(input.value, 10);\n if(!isNaN(rows)){\n var editor = param.button.editor;\n editor.rows = rows;\n }else{\n rows=config.maxEditRows;\n }\n config.options['txtWikibarEditorRows'] = rows;\n saveOptionCookie('txtWikibarEditorRows');\n config.maxEditRows = rows;\n }\n }\n };\n toolset.setEditorSizeOnLoadingWikibar = {\n CAPTION:'set editor height on loading wikibar',\n SELECTED: config.options['chkWikibarSetEditorHeight'],\n HANDLER: function(param){\n config.options['chkWikibarSetEditorHeight'] = !config.options['chkWikibarSetEditorHeight'];\n saveOptionCookie('chkWikibarSetEditorHeight');\n if(config.options['chkWikibarSetEditorHeight']){\n var rows = config.options['txtWikibarEditorRows'];\n if(!isNaN(rows)){ rows = 15; }\n var editor = param.button.editor;\n editor.rows = rows;\n config.options['txtWikibarEditorRows'] = rows;\n saveOptionCookie('txtWikibarEditorRows');\n }\n }\n };\n toolset.SEPERATOR = {};\n toolset.update = {\n CAPTION: 'check for updates',\n DISABLED: true,\n HANDLER: function(){}\n };\n return toolset;\n}\nfunction wikibar_genPaletteSelector(){\n try{\n var cpTiddlers = store.getTaggedTiddlers('ColorPalettes');\n if(!cpTiddlers) { return; }\n var palettes=[];\n palettes.push(wikibarColorTool.defaultPaletteName);\n for(var i=0; i<cpTiddlers.length; i++){\n palettes.push(cpTiddlers[i].title.trim());\n }\n var toolset={};\n for(i=0; i<palettes.length; i++){\n toolset[palettes[i]] = {\n TOOLTIP: palettes[i],\n SELECTED: (palettes[i]==wikibarColorTool.paletteName),\n HANDLER: wikibar_doSelectPalette\n };\n }\n return toolset;\n }catch(ex){ return null; }\n}\nfunction wikibar_onClickItem(e){\n if(!e){ e = window.event; }\n var theTarget = resolveTarget(e);\n if(theTarget.tagName=='INPUT'){\n e.cancelBubble = true;\n if (e.stopPropagation){ e.stopPropagation(); }\n return;\n }\n var theButton = wikibar_resolveTargetButton(theTarget);\n if(!theButton){ return(false); }\n var o = theButton.toolItem;\n if(!o) { return; }\n var param = {\n event: e,\n button: theButton\n };\n if(o.HANDLER){ o.HANDLER(param); }\n if(o.DISABLED){\n e.cancelBubble = true;\n if (e.stopPropagation){ e.stopPropagation(); }\n }\n return(false);\n}\nfunction wikibar_onClickMenuItem(e){\n if(!e){ e = window.event; }\n var theButton = wikibar_resolveTargetButton(resolveTarget(e));\n if(!theButton){ return(false); }\n e.cancelBubble = true;\n if (e.stopPropagation){ e.stopPropagation(); }\n var title = theButton.tiddlerTitle;\n var editor = theButton.editor;\n var tool = theButton.toolItem;\n if(!tool) { return; }\n var popup = wikibarPopup.create(this);\n if(popup){\n wikibar_createMenu(popup,tool,title,editor);\n if(!popup.hasChildNodes()){\n wikibarPopup.remove();\n }else{\n wikibarPopup.show(popup, false);\n }\n }\n return(false);\n}\nvar wikibarColorTool = {\n defaultPaletteName : 'default',\n defaultColumns : 16,\n defaultPalette : [\n '#FFF','#DDD','#CCC','#BBB','#AAA','#999','#666','#333','#111','#000','#FC0','#F90','#F60','#F30','#C30','#C03',\n '#9C0','#9D0','#9E0','#E90','#D90','#C90','#FC3','#FC6','#F96','#F63','#600','#900','#C00','#F00','#F36','#F03',\n '#CF0','#CF3','#330','#660','#990','#CC0','#FF0','#C93','#C63','#300','#933','#C33','#F33','#C36','#F69','#F06',\n '#9F0','#CF6','#9C3','#663','#993','#CC3','#FF3','#960','#930','#633','#C66','#F66','#903','#C39','#F6C','#F09',\n '#6F0','#9F6','#6C3','#690','#996','#CC6','#FF6','#963','#630','#966','#F99','#F39','#C06','#906','#F3C','#F0C',\n '#3F0','#6F3','#390','#6C0','#9F3','#CC9','#FF9','#C96','#C60','#C99','#F9C','#C69','#936','#603','#C09','#303',\n '#0C0','#3C0','#360','#693','#9C6','#CF9','#FFC','#FC9','#F93','#FCC','#C9C','#969','#939','#909','#636','#606',\n '#060','#3C3','#6C6','#0F0','#3F3','#6F6','#9F9','#CFC','#9CF','#FCF','#F9F','#F6F','#F3F','#F0F','#C6C','#C3C',\n '#030','#363','#090','#393','#696','#9C9','#CFF','#39F','#69C','#CCF','#C9F','#96C','#639','#306','#90C','#C0C',\n '#0F3','#0C3','#063','#396','#6C9','#9FC','#9CC','#06C','#369','#99F','#99C','#93F','#60C','#609','#C3F','#C0F',\n '#0F6','#3F6','#093','#0C6','#3F9','#9FF','#699','#036','#039','#66F','#66C','#669','#309','#93C','#C6F','#90F',\n '#0F9','#6F9','#3C6','#096','#6FF','#6CC','#366','#069','#36C','#33F','#33C','#339','#336','#63C','#96F','#60F',\n '#0FC','#6FC','#3C9','#3FF','#3CC','#399','#033','#39C','#69F','#00F','#00C','#009','#006','#003','#63F','#30F',\n '#0C9','#3FC','#0FF','#0CC','#099','#066','#3CF','#6CF','#09C','#36F','#0CF','#09F','#06F','#03F','#03C','#30C'\n ],\n colorPicker : null,\n pickColorHandler: null,\n userData: null\n};\nwikibarColorTool.paletteName = wikibarColorTool.defaultPaletteName;\nwikibarColorTool.columns = wikibarColorTool.defaultColumns;\nwikibarColorTool.palette = wikibarColorTool.defaultPalette;\nwikibarColorTool.onPickColor = function(e){\n if (!e){ e = window.event; }\n var theCell = resolveTarget(e);\n if(!theCell){ return(false); }\n color = theCell.bgColor.toLowerCase();\n if(!color) { return; }\n wikibarColorTool.displayColorPicker(false);\n if(wikibarColorTool.pickColorHandler){\n wikibarColorTool.pickColorHandler(color, wikibarColorTool.userData);\n }\n return(false);\n};\nwikibarColorTool.onMouseOver = function(e){\n if (!e){ e = window.event; }\n var theButton = resolveTarget(e);\n if(!theButton){ return(false); }\n if(!wikibarColorTool) { return; }\n color = theButton.bgColor.toUpperCase();\n if(!color) { return; }\n td=document.getElementById('colorPickerInfo');\n if(!td) { return; }\n td.bgColor = color;\n td.innerHTML = '<span style=\s"color:#000;\s">'+color+'</span>&nbsp;&nbsp;&nbsp;' +\n '<span style=\s"color:#fff;\s">'+color+'</span>';\n e.cancelBubble = true;\n if (e.stopPropagation){ e.stopPropagation(); }\n return(false);\n};\nwikibarColorTool.openColorPicker = function(theTarget, pickColorHandler, userData){\n wikibarColorTool.skipClickDocumentEvent = true;\n wikibarColorTool.pickColorHandler = pickColorHandler;\n wikibarColorTool.userData = userData;\n wikibarColorTool.moveColorPicker(theTarget);\n};\nwikibarColorTool.convert3to6HexColor = function(c){\n c=c.trim();\n var rx=/^\s#(\sd|[a-f])(\sd|[a-f])(\sd|[a-f])$/gi;\n return (rx.test(c)? c.replace(rx, '#$1$1$2$2$3$3') : c);\n};\nwikibarColorTool.numToHexColor = function (n){\n if(typeof(n)=='number' && (n>=0 && n<=255)) {\n s = n.toString(16).toLowerCase();\n return ((s.length==1)? '0'+s : s);\n }else{\n return null;\n }\n};\nwikibarColorTool.renderColorPalette = function(){\n if(wikibarColorTool.paletteName==wikibarColorTool.defaultPaletteName){\n wikibarColorTool.palette=wikibarColorTool.defaultPalette;\n wikibarColorTool.columns=wikibarColorTool.defaultColumns;\n return;\n }\n tiddlerText = (store.getTiddlerText(wikibarColorTool.paletteName, '')).trim();\n if(tiddlerText.length<=0) { return; }\n var cpContents = tiddlerText.split('\sn');\n var colors=[];\n columns = wikibarColorTool.defaultColumns;\n var tmpArray=null;\n errCount=0;\n for(var i=0; i<cpContents.length; i++){\n cpLine=cpContents[i].trim();\n if( (!cpLine) || (cpLine.length<=0) || (cpLine.charAt(0) == '#') ){ continue; }\n if(cpLine.substring(0,8).toLowerCase()=='columns:'){\n tmpArray = cpLine.split(':');\n try{\n columns = parseInt(tmpArray[1],10);\n }catch(ex){\n columns = wikibarColorTool.defaultColumns;\n }\n }else{\n tmpArray = cpLine.replace('\st', ' ').split(/[ ]{1,}/);\n try{\n color='';\n for(var j=0; j<3; j++){\n c=parseInt(tmpArray[j].trim(), 10);\n if(isNaN(c)){\n break;\n }else{\n c=wikibarColorTool.numToHexColor(c);\n if(!c) {break;}\n color+=c;\n }\n }\n if(color.length==6){\n colors.push('#'+color);\n } else {\n throw 'error';\n }\n }catch(ex){\n }\n }\n }\n if(colors.length>0){\n wikibarColorTool.palette = colors;\n wikibarColorTool.columns = columns;\n }else{\n throw 'renderColorPalette(): No color defined in the palette.';\n }\n};\nwikibarColorTool.displayColorPicker = function(visible){\n if(wikibarColorTool.colorPicker){\n wikibarColorTool.colorPicker.style.display = (visible? 'block' : 'none');\n }\n};\nwikibarColorTool.moveColorPicker = function(theTarget){\n if(!wikibarColorTool.colorPicker){\n wikibarColorTool.createColorPicker();\n }\n var cp = wikibarColorTool.colorPicker;\n var rootLeft = findPosX(theTarget);\n var rootTop = findPosY(theTarget);\n var popupLeft = rootLeft;\n var popupTop = rootTop;\n var popupWidth = cp.offsetWidth;\n var winWidth = findWindowWidth();\n if(popupLeft + popupWidth > winWidth){\n popupLeft = winWidth - popupWidth;\n }\n cp.style.left = popupLeft + 'px';\n cp.style.top = popupTop + 'px';\n wikibarColorTool.displayColorPicker(true);\n};\nwikibarColorTool.createColorPicker = function(unused, palette){\n if(palette){ wikibarColorTool.paletteName=palette; }\n wikibarColorTool.renderColorPalette();\n wikibarColorTool.colorPicker = document.createElement('div');\n wikibarColorTool.colorPicker.id = 'colorPicker';\n document.body.appendChild(wikibarColorTool.colorPicker);\n var theTable = document.createElement('table');\n wikibarColorTool.colorPicker.appendChild(theTable);\n var theTR = document.createElement('tr');\n theTable.appendChild(theTR);\n var theTD = document.createElement('td');\n theTD.className = 'header';\n theTD.colSpan = wikibarColorTool.columns;\n theTD.innerHTML = wikibarColorTool.paletteName;\n theTR.appendChild(theTD);\n for(var i=0; i<wikibarColorTool.palette.length; i++){\n if((i%wikibarColorTool.columns)===0){\n theTR = document.createElement('tr');\n theTable.appendChild(theTR);\n }\n theTD = document.createElement('td');\n theTD.className = 'cell';\n theTD.bgColor = wikibarColorTool.convert3to6HexColor(wikibarColorTool.palette[i]);\n theTD.onclick = wikibarColorTool.onPickColor;\n theTD.onmouseover = wikibarColorTool.onMouseOver;\n theTR.appendChild(theTD);\n }\n rest = wikibarColorTool.palette.length % wikibarColorTool.columns;\n if(rest>0){\n theTD = document.createElement('td');\n theTD.colSpan = wikibarColorTool.columns-rest;\n theTD.bgColor = '#000000';\n theTR.appendChild(theTD);\n }\n theTR = document.createElement('tr');\n theTable.appendChild(theTR);\n theTD = document.createElement('td');\n theTD.colSpan = wikibarColorTool.columns;\n theTD.id = 'colorPickerInfo';\n theTR.appendChild(theTD);\n};\nwikibarColorTool.onDocumentClick = function(e){\n if (!e){ e = window.event; }\n if(wikibarColorTool.skipClickDocumentEvent) {\n wikibarColorTool.skipClickDocumentEvent = false;\n return true;\n }\n if((!e.eventPhase) || e.eventPhase == Event.BUBBLING_PHASE || e.eventPhase == Event.AT_TARGET){\n wikibarColorTool.displayColorPicker(false);\n }\n return true;\n};\nfunction wikibar_doSelectPalette(param){\n clearMessage();\n var theButton = param.button;\n if(!theButton.toolItem.key) { return; }\n var palette = theButton.toolItem.key;\n var oldPaletteName = wikibarColorTool.paletteName;\n if(oldPaletteName != palette){\n try{\n wikibarColorTool.createColorPicker(theButton, palette);\n displayMessage('Palette \s"'+palette+'\s" ('+ wikibarColorTool.palette.length +' colors) is selected');\n }catch(ex){\n errMsg = ex;\n if(errMsg.substring(0,18)=='renderColorPalette'){\n displayMessage('Invalid palette \s"' + palette + '\s", please check it out!');\n wikibarColorTool.createColorPicker(theButton, oldPaletteName);\n }\n }\n }\n}\nvar wikibarPopup = {\n skipClickDocumentEvent: false,\n stack: []\n};\nwikibarPopup.resolveRootPopup = function(o){\n if(o.isOnMainMenu){ return null; }\n if(o.className.substring(0,12)=='wikibarPopup'){ return o;}\n return wikibarPopup.resolveRootPopup(o.parentNode);\n};\nwikibarPopup.create = function(root){\n for(var i=0; i<wikibarPopup.stack.length; i++){\n var p=wikibarPopup.stack[i];\n if(p.root==root){\n wikibarPopup.removeFrom(i+1);\n return null;\n }\n }\n var rootPopup = wikibarPopup.resolveRootPopup(root);\n if(!rootPopup){\n wikibarPopup.remove();\n }else{\n wikibarPopup.removeFromRootPopup(rootPopup);\n }\n var popup = createTiddlyElement(document.body,'div','wikibarPopup'+root.toolItem.key,'wikibarPopup');\n var pop = createTiddlyElement(popup,'table','','');\n wikibarPopup.stack.push({rootPopup: rootPopup, root: root, popup: popup});\n return pop;\n};\nwikibarPopup.show = function(unused,slowly){\n var curr = wikibarPopup.stack[wikibarPopup.stack.length-1];\n var overlayWidth = 1;\n var rootLeft, rootTop, rootWidth, rootHeight, popupLeft, popupTop, popupWidth;\n if(curr.rootPopup){\n rootLeft = findPosX(curr.rootPopup);\n rootTop = findPosY(curr.root);\n rootWidth = curr.rootPopup.offsetWidth;\n popupLeft = rootLeft + rootWidth - overlayWidth;\n popupTop = rootTop;\n }else{\n rootLeft = findPosX(curr.root);\n rootTop = findPosY(curr.root);\n rootHeight = curr.root.offsetHeight;\n popupLeft = rootLeft;\n popupTop = rootTop + rootHeight;\n }\n var winWidth = findWindowWidth();\n popupWidth = curr.popup.offsetWidth;\n if(popupLeft + popupWidth > winWidth){\n popupLeft = rootLeft - popupWidth + overlayWidth;\n }\n curr.popup.style.left = popupLeft + 'px';\n curr.popup.style.top = popupTop + 'px';\n curr.popup.style.display = 'block';\n addClass(curr.root, 'highlight');\n if(config.options.chkAnimate){\n anim.startAnimating(new Scroller(curr.popup,slowly));\n }else{\n window.scrollTo(0,ensureVisible(curr.popup));\n }\n};\nwikibarPopup.remove = function(){\n if(wikibarPopup.stack.length > 0){\n wikibarPopup.removeFrom(0);\n }\n};\nwikibarPopup.removeFrom = function(from){\n for(var t=wikibarPopup.stack.length-1; t>=from; t--){\n var p = wikibarPopup.stack[t];\n removeClass(p.root,'highlight');\n p.popup.parentNode.removeChild(p.popup);\n }\n wikibarPopup.stack = wikibarPopup.stack.slice(0,from);\n};\nwikibarPopup.removeFromRootPopup = function(from){\n for(var t=0; t<wikibarPopup.stack.length; t++){\n var p = wikibarPopup.stack[t];\n if(p.rootPopup==from){\n wikibarPopup.removeFrom(t);\n break;\n }\n }\n};\nwikibarPopup.onDocumentClick = function(e){\n if (!e){ e = window.event; }\n if(wikibarPopup.skipClickDocumentEvent){\n wikibarPopup.skipClickDocumentEvent=false;\n return true;\n }\n if((!e.eventPhase) || e.eventPhase == Event.BUBBLING_PHASE || e.eventPhase == Event.AT_TARGET){\n wikibarPopup.remove();\n }\n return true;\n};\nvar wikibarStore = {\n TYPE: 'MAIN_MENU',\n help:{\n TYPE:'MENU',\n CAPTION: '<font face=\s"verdana\s">?</font>',\n TOOLTIP: 'about WikiBar',\n options:{\n TYPE:'MENU',\n DYNAITEM: wikibar_genWikibarOptions\n },\n about:{\n TYPE:'MENU',\n DYNAITEM: wikibar_genWikibarAbout\n }\n },\n preview:{\n TOOLTIP: 'preview this tiddler',\n CAPTION: '<font face=\s"verdana\s">&infin;</font>',\n HANDLER: wikibar_doPreview\n },\n line:{\n TOOLTIP: 'horizontal line',\n CAPTION: '<font face=\s"verdana\s">&mdash;</font>',\n syntax: '\sn----\sn',\n HANDLER: wikibar_editFormatByCursor\n },\n crlf:{\n TOOLTIP: 'new line',\n CAPTION: '<font face=\s"verdana\s">&para;</font>',\n syntax: '\sn',\n HANDLER: wikibar_editFormatByCursor\n },\n selectAll:{\n TOOLTIP: 'select all',\n CAPTION: '<font face=\s"verdana\s">&sect;</font>',\n HANDLER: wikibar_editSelectAll\n },\n deleteSelected:{\n TOOLTIP: 'delete selected',\n CAPTION: '<font face=\s"verdana\s">&times;</font>',\n syntax: '',\n HANDLER: wikibar_editFormat\n },\n textFormat:{\n TYPE: 'MENU',\n CAPTION: 'text',\n TOOLTIP: 'text formatters',\n ignore:{\n TOOLTIP: 'ignore wiki word',\n CAPTION: 'ignore wikiWord',\n syntax: '~user_text',\n hint: 'wiki_word',\n HANDLER: wikibar_editFormatByWord\n },\n bolder:{\n TOOLTIP: 'bolder text',\n CAPTION: '<strong>bolder</strong>',\n syntax: "''user_text''",\n hint: 'bold_text',\n HANDLER: wikibar_editFormatByWord\n },\n italic:{\n TOOLTIP: 'italic text',\n CAPTION: '<em>italic</em>',\n syntax: '\s/\s/user_text\s/\s/',\n hint: 'italic_text',\n HANDLER: wikibar_editFormatByWord\n },\n underline:{\n TOOLTIP: 'underline text',\n CAPTION: '<u>underline</u>',\n syntax: '__user_text__',\n hint: 'underline_text',\n HANDLER: wikibar_editFormatByWord\n },\n strikethrough:{\n TOOLTIP: 'strikethrough text',\n CAPTION: '<strike>strikethrough</strike>',\n syntax: '==user_text==',\n hint: 'strikethrough_text',\n HANDLER: wikibar_editFormatByWord\n },\n superscript:{\n TOOLTIP: 'superscript text',\n CAPTION: 'X<sup>superscript</sup>',\n syntax: '^^user_text^^',\n hint: 'superscript_text',\n HANDLER: wikibar_editFormatByWord\n },\n subscript:{\n TOOLTIP: 'subscript text',\n CAPTION: 'X<sub>subscript</sub>',\n syntax: '~~user_text~~',\n hint: 'subscript_text',\n HANDLER: wikibar_editFormatByWord\n },\n comment:{\n TOOLTIP: 'comment text',\n CAPTION: 'comment text',\n syntax: '/%user_text%/',\n hint: 'comment_text',\n HANDLER: wikibar_editFormatByWord\n },\n monospaced:{\n TOOLTIP: 'monospaced text',\n CAPTION: '<code>monospaced</code>',\n syntax: '{{{user_text}}}',\n hint: 'monospaced_text',\n HANDLER: wikibar_editFormatByWord\n }\n },\n paragraph:{\n TYPE: 'MENU',\n TOOLTIP: 'paragarph formatters',\n list:{\n TYPE: 'MENU',\n TOOLTIP: 'list tools',\n bullet:{\n TOOLTIP: 'bullet point',\n syntax: '*user_text',\n hint: 'bullet_text',\n HANDLER: wikibar_editFormatByLine\n },\n numbered:{\n TOOLTIP: 'numbered list',\n syntax: '#user_text',\n hint: 'numbered_text',\n HANDLER: wikibar_editFormatByLine\n }\n },\n heading:{\n TYPE: 'MENU',\n heading1:{\n CAPTION:'<h1>Heading 1</h1>',\n TOOLTIP: 'Heading 1',\n syntax: '!user_text',\n hint: 'heading_1',\n HANDLER: wikibar_editFormatByLine\n },\n heading2:{\n CAPTION:'<h2>Heading 2<h2>',\n TOOLTIP: 'Heading 2',\n syntax: '!!user_text',\n hint: 'heading_2',\n HANDLER: wikibar_editFormatByLine\n },\n heading3:{\n CAPTION:'<h3>Heading 3</h3>',\n TOOLTIP: 'Heading 3',\n syntax: '!!!user_text',\n hint: 'heading_3',\n HANDLER: wikibar_editFormatByLine\n },\n heading4:{\n CAPTION:'<h4>Heading 4</h4>',\n TOOLTIP: 'Heading 4',\n syntax: '!!!!user_text',\n hint: 'heading_4',\n HANDLER: wikibar_editFormatByLine\n },\n heading5:{\n CAPTION:'<h5>Heading 5</h5>',\n TOOLTIP: 'Heading 5',\n syntax: '!!!!!user_text',\n hint: 'heading_5',\n HANDLER: wikibar_editFormatByLine\n }\n },\n comment:{\n TYPE: 'MENU',\n commentByLine:{\n CAPTION:'comment by line',\n TOOLTIP: 'line comment',\n syntax: '/%user_text%/',\n hint: 'comment_text',\n HANDLER: wikibar_editFormatByLine\n },\n commentByBlock:{\n CAPTION:'comment by block',\n TOOLTIP: 'block comment',\n syntax: '/%\snuser_text\sn%/',\n hint: 'comment_text',\n byBlock: true,\n HANDLER: wikibar_editFormatByLine\n }\n },\n monospaced:{\n TYPE: 'MENU',\n monosByLine:{\n CAPTION: 'monospaced by line',\n TOOLTIP: 'line monospaced',\n syntax: '{{{\snuser_text\sn}}}',\n hint: 'monospaced_text',\n HANDLER: wikibar_editFormatByLine\n },\n monosByBlock:{\n CAPTION: 'monospaced by block',\n TOOLTIP: 'block monospaced',\n syntax: '{{{\snuser_text\sn}}}',\n hint: 'monospaced_text',\n byBlock: true,\n HANDLER: wikibar_editFormatByLine\n }\n },\n quote:{\n TYPE: 'MENU',\n quoteByLine:{\n CAPTION: 'quote by line',\n TOOLTIP: 'line quote',\n syntax: '>user_text',\n hint: 'quote_text',\n HANDLER: wikibar_editFormatByLine\n },\n quoteByBlcok:{\n CAPTION: 'quote by block',\n TOOLTIP: 'block quote',\n syntax: '<<<\snuser_text\sn<<<',\n hint: 'quote_text',\n byBlock: true,\n HANDLER: wikibar_editFormatByLine\n }\n },\n plugin:{\n TYPE: 'MENU',\n code:{\n CAPTION: 'code area',\n TOOLTIP: 'block monospaced for plugin',\n syntax: '\sn\s/\s/{{{\snuser_text\sn\s/\s/}}}\sn',\n hint: 'monospaced_plugin_code',\n byBlock: true,\n HANDLER: wikibar_editFormatByLine\n },\n commentByLine:{\n CAPTION: 'comment by line',\n TOOLTIP: 'line comment',\n syntax: '\s/\s/user_text',\n hint: 'plugin_comment',\n HANDLER: wikibar_editFormatByLine\n },\n commentByBlock:{\n CAPTION: 'comment by block',\n TOOLTIP: 'block comment',\n syntax: '\s/\s***\snuser_text\sn***\s/',\n hint: 'plugin_comment',\n byBlock: true,\n HANDLER: wikibar_editFormatByLine\n }\n },\n css:{\n TYPE: 'MENU',\n code:{\n CAPTION: 'code area',\n TOOLTIP: 'block monospaced for css',\n syntax: '\sn\snuser_text\sn\sn',\n hint: 'monospaced_css_code',\n byBlock: true,\n HANDLER: wikibar_editFormatByLine\n },\n commentByLine:{\n CAPTION: 'comment by line',\n TOOLTIP: 'line comment',\n syntax: '',\n hint: 'css_comment',\n HANDLER: wikibar_editFormatByLine\n },\n commentByBlock:{\n CAPTION: 'comment by block',\n TOOLTIP: 'block comment',\n syntax: '',\n hint: 'css_comment',\n byBlock: true,\n HANDLER: wikibar_editFormatByLine\n }\n }\n },\n color:{\n TYPE: 'MENU',\n TOOLTIP: 'color tools',\n highlight:{\n CAPTION:'highlight text',\n TOOLTIP: 'highlight text',\n syntax: '@@user_text@@',\n hint: 'highlight_text',\n HANDLER: wikibar_editFormatByWord\n },\n color:{\n CAPTION:'text color',\n TOOLTIP: 'text color',\n hint: 'your_text',\n syntax: '@@color(%1):user_text@@',\n HANDLER: wikibar_getColorCode,\n doMore: wikibar_editFormatByWord\n },\n bgcolor:{\n CAPTION:'background color',\n TOOLTIP: 'background color',\n hint: 'your_text',\n syntax: '@@bgcolor(%1):user_text@@',\n HANDLER: wikibar_getColorCode,\n doMore: wikibar_editFormatByWord\n },\n colorcode:{\n CAPTION:'color code',\n TOOLTIP: 'insert color code',\n syntax: '%1',\n HANDLER: wikibar_getColorCode,\n doMore: wikibar_editFormatByCursor\n },\n 'color palette':{\n TYPE:'MENU',\n DYNAITEM: wikibar_genPaletteSelector,\n SEPERATOR:{},\n morePalette:{\n CAPTION:'more palettes',\n TOOLTIP:'get more palettes',\n HANDLER: wikibar_getMorePalette\n }\n }\n },\n link:{\n TYPE: 'MENU',\n TOOLTIP: 'insert link',\n wiki:{\n CAPTION:'wiki link',\n TOOLTIP: 'wiki link',\n syntax: '[[user_text]]',\n hint: 'wiki_word',\n HANDLER: wikibar_editFormatByWord\n },\n pretty:{\n CAPTION: 'pretty link',\n TOOLTIP: 'pretty link',\n syntax: '[[user_text|%1]]',\n hint: 'pretty_word',\n param: 'PrettyLink Target',\n HANDLER: wikibar_getLinkUrl,\n doMore: wikibar_editFormatByWord\n },\n url:{\n TOOLTIP: 'url link',\n syntax: '[[user_text|%1]]',\n hint: 'your_text',\n param: 'http:\s/\s/...',\n HANDLER: wikibar_getLinkUrl,\n doMore: wikibar_editFormatByWord\n },\n image:{\n TOOLTIP: 'image link',\n syntax: '[img[user_text|%1]]',\n hint: 'alt_text',\n param: 'image/icon.jpg',\n HANDLER: wikibar_getLinkUrl,\n doMore: wikibar_editFormatByWord\n }\n },\n macro:{},\n more:{\n TYPE: 'MENU',\n TOOLTIP: 'more tools',\n table:{\n TYPE: 'MENU',\n TOOLTIP: 'table',\n table:{\n CAPTION:'create table',\n TOOLTIP: 'create a new table',\n syntax: '\sn%1\sn',\n HANDLER: wikibar_getTableRowCol,\n doMore: wikibar_editFormatByWord\n },\n header:{\n TOOLTIP: 'table header text',\n syntax: '|user_text|c',\n hint: 'table_header',\n HANDLER: wikibar_editFormatByWord\n },\n cell:{\n TOOLTIP: 'create a tabel cell',\n syntax: '|user_text|',\n hint: 'your_text',\n HANDLER: wikibar_editFormatByWord\n },\n columnHeader:{\n CAPTION:'column header',\n TOOLTIP: 'create a column header cell',\n syntax: '|!user_text|',\n hint: 'column_header',\n HANDLER: wikibar_editFormatByWord\n },\n cell:{\n TYPE: 'MENU',\n CAPTION: 'cell options',\n bgcolor:{\n CAPTION: 'background color',\n TOOLTIP: 'cell bgcolor',\n syntax: '|bgcolor(%1):user_text|',\n hint: 'your_text',\n HANDLER: wikibar_getColorCode,\n doMore: wikibar_editFormatByTableCell\n },\n alignLeft:{\n CAPTION: 'align left',\n TOOLTIP: 'left align cell text',\n syntax: '|user_text|',\n hint: 'your_text',\n HANDLER: wikibar_editFormatByTableCell\n },\n alignCenter:{\n CAPTION: 'align center',\n TOOLTIP: 'center align cell text',\n syntax: '| user_text |',\n hint: 'your_text',\n HANDLER: wikibar_editFormatByTableCell\n },\n alignRight:{\n CAPTION: 'align right',\n TOOLTIP: 'right align cell text',\n syntax: '| user_text|',\n hint: 'your_text',\n HANDLER: wikibar_editFormatByTableCell\n }\n }\n },\n html:{\n TYPE: 'MENU',\n html:{\n CAPTION: '&lt;html&gt;',\n TOOLTIP: 'html tag',\n syntax: '<html>\snuser_text\sn</html>',\n hint: 'html_content',\n byBlock: true,\n HANDLER: wikibar_editFormatByLine\n }\n }\n },\n addon:{\n TYPE: 'MENU',\n TOOLTIP:'3rd party tools',\n 'about addons':{\n TOOLTIP: 'list loaded addons',\n HANDLER: wikibar_doListAddons\n },\n SEPERATOR:{}\n }\n};\naddEvent(document, 'click', wikibarColorTool.onDocumentClick);\naddEvent(document, 'click', wikibarPopup.onDocumentClick);\nwikibar_install();\n//}}}
<<gradient vert ##00cc33 #ffffff #ff66cc>>Pases:\n#clica a ''edita''\n#clica al nou botó ''wikibar'' (a la dreta).\n>>