TWiki
>
PROGESP Web
>
XinhaTemplate
(04 Jun 2007,
MoisesMachado
?
)
(raw view)
E
dit
A
ttach
<!DOCTYPE BHTML PUBLIC "-//BC//DTD BHTML 3.2 Final//EN"> <html> <head> %TMPL:P{"windowtitle"}% <meta http-equiv="Content-Type" content="text/html; charset=%CHARSET%" /> <link rel="icon" href="%FAVICON%" type="image/x-icon" /> <link rel="shortcut icon" href="%FAVICON%" type="image/x-icon" /> <meta name="robots" content="noindex" />%HTTP_EQUIV_ON_VIEW% <base href="%SCRIPTURL{"view"}%/%WEB%/%TOPIC%"></base><!--/closing tag 'solves' IE selection bug--> <script type="text/javascript"> //<![CDATA[ // You must set _editor_url to the URL (including trailing slash) where // where xinha is installed, it's highly recommended to use an absolute URL // eg: _editor_url = "/path/to/xinha/"; // You may try a relative URL if you wish] // eg: _editor_url = "../"; // in this example we do a little regular expression to find the absolute path. _editor_url = "%PUBURLPATH%/%TWIKIWEB%/XinhaEditorPlugin/xinha/"; _editor_lang = "en"; // And the language we need to use in the editor. //]]> </script> <!-- Load up the actual editor core --> <script type="text/javascript" src="%PUBURLPATH%/%TWIKIWEB%/XinhaEditorPlugin/xinha/htmlarea.js"></script> <script type="text/javascript"> //<![CDATA[ xinha_editors = null; xinha_init = null; xinha_config = null; xinha_plugins = null; function showError( sMsg, sUrl, sLine){ document.getElementById('errors').style.display = 'inline'; document.getElementById('errors').value += 'Error: ' + sMsg + '\n' + 'Source File: ' + sUrl + '\n' + 'Line: ' + sLine + '\n'; return false; } // This contains the names of textareas we will make into Xinha editors xinha_init = xinha_init ? xinha_init : function() { window.onerror = showError; document.onerror = showError; /** 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 : [ 'BeeReport', 'FullScreen', 'CharacterMap', 'ContextMenu', 'ListType', 'Stylist', 'SuperClean', 'TableOperations', //This causes fault on IE (please test it before turn it on) // 'FindReplace', //Enable this if PHP is turn on // 'SpellChecker', // 'ImageManager', 'HorizontalRule', // It has fault menu image position // 'InsertPagebreak', // 'PasteText', 'QuickTag', 'InsertAnchor', 'EditTag' ]; // 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 : ['topic']; /** 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 5. * * If you want to modify the default config you might do something like this. * * xinha_config = new HTMLArea.Config(); * xinha_config.width = '640px'; * xinha_config.height = '420px'; * *************************************************************************/ xinha_config = xinha_config ? xinha_config() : new HTMLArea.Config(); xinha_config.pageStyleSheets = [ %IF{ "$ TWIKISTYLEURL" then="'%TWIKISTYLEURL%',"}% %IF{ "$ TWIKICOLORSURL" then="'%TWIKICOLORSURL%',"}% %IF{ "$ USERLAYOUTURL" then="'%USERLAYOUTURL%',"}% %IF{ "$ USERCOLORSURL" then="'%USERCOLORSURL%',"}% ]; //xinha_config.only7BitPrintablesInURLs = false; //xinha_config.sevenBitClean = false; // if true then HTMLArea will retrieve the full HTML, starting with the // <HTML> tag. //xinha_config.fullPage = true; xinha_config.userName = "%USERNAME%"; // sometimes we want to be able to replace some string in the html comng in and going out // so that in the editor we use the "internal" string, and outside and in the source view // we use the "external" string this is useful for say making special codes for // your absolute links, your external string might be some special code, say "{server_url}" // an you say that the internal represenattion of that should be http://your.server/ //xinha_config.specialReplacements = {'%<nop>WIKIHOMEURL%':'%WIKIHOMEURL%'}; // { 'external_string' : 'internal_string' } xinha_config.registerButton("save", "Save topic", _editor_url + xinha_config.imgURL+"ed_save.gif", false, function(editor) {document.getElementById('save').click();}); xinha_config.registerButton("qsave", "Quiet save", _editor_url + xinha_config.imgURL+"ed_qsave.gif", false, function(editor) {document.getElementById('quietsave').click();}); xinha_config.registerButton("chckpoint", "Checkpoint", _editor_url + xinha_config.imgURL+"ed_checkpoint.gif", false, function(editor) {document.getElementById('checkpoint').click();}); xinha_config.registerButton("cancel", "Cancel", _editor_url + xinha_config.imgURL+"ed_cancel.gif", false, function(editor) {document.getElementById('cancel').click();}); xinha_config.addToolbarElement('save', 'popupeditor', 1); xinha_config.addToolbarElement('qsave', 'popupeditor', 2); xinha_config.addToolbarElement('chckpoint', 'popupeditor', 3); xinha_config.addToolbarElement('cancel', 'popupeditor', 4); /** STEP 4 *************************************************************** * 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 5 *************************************************************** * 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 = '640px'; xinha_editors.myTextArea.config.height = '480px'; * ************************************************************************/ /** STEP 6 *************************************************************** * Finally we "start" the editors, this turns the textareas into * Xinha editors. ************************************************************************/ HTMLArea.startEditors(xinha_editors); //FullScreen when start // Width & Height of window var x,y; if (window.innerHeight) // all except Explorer { x = window.innerWidth; y = window.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) // Explorer 6 Strict Mode { x = document.documentElement.clientWidth; y = document.documentElement.clientHeight; } else if (document.body) // other Explorers { x = document.body.clientWidth; y = document.body.clientHeight; } window.scroll(0,0); } window.onload = xinha_init; //]]> </script> %TMPL:P{"styles"}% </head> <body class="patternNoViewPage patternEditPage" style="overflow: hidden;" > <form name="main" id="main" action="%SCRIPTURLPATH{"save"}%/%WEB%/%TOPIC%" method="post"> <textarea id="topic" name="text" rows="40" style="width:100%;">%TEXT%</textarea> <div style="display: none"> <input type="submit" class="twikiSubmit" name="action_save" id="save" %MAKETEXT{"value='Save' accesskey='s'"}% /> <input type="submit" class="twikiButton" name="action_quietsave" id="quietsave" %MAKETEXT{"value='Quiet save' accesskey='q'"}% /> <input type="submit" class="twikiButton" name="action_checkpoint" id="checkpoint" %MAKETEXT{"value='Checkpoint' accesskey='k'"}% /> <input type="submit" class="twikiButton" name="action_cancel" id="cancel" title='%MAKETEXT{"Cancel editing and discard changes"}%' %MAKETEXT{"value='Cancel' accesskey='c'"}% /> </div> <input type="hidden" name="originalrev" value="%ORIGINALREV%" /> <input type="hidden" name="skin" value="%URLPARAM{"skin"}%" /> <input type="hidden" name="cover" value="%URLPARAM{"cover"}%" /> <input type="hidden" name="formtemplate" value="%FORMTEMPLATE%" /> <input type="hidden" name="templatetopic" value="%TEMPLATETOPIC%" /> <input type="hidden" name="topicparent" value="%TOPICPARENT%" /> <input type="hidden" name="newtopic" value="%NEWTOPIC%" /> <input type="hidden" name="cmd" value="%CMD%" /> <textarea id="errors" name="errors" style="width:100%; height:100px; background:silver; display:none;"></textarea><!-- style="display:none;" --> </form> </body></html> %TMPL:INCLUDE{"constants"}% %TMPL:INCLUDE{"styles"}%
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r1 - 04 Jun 2007 - 12:19:15 -
MoisesMachado
?
PROGESP
Log In
or
Register
PROGESP Web
Create New Topic
Index
Search
Changes
Notifications
Statistics
Preferences
Webs
Abacos
Acbahia
AnpedGT16
ArcoDigital
Argumento
Avsan
CalculoB
Ceb
Cetad
CetadObserva
Cibercultura
Ciberfem
CiberParque
ColoquioCiags
Coloquiofasa
ConexoesSaberes
Cpdteste
Cppd
Creche
Cridi
Da
DACN
DCE
DelzaTeste
DeniseCarla
DepHistoria
DicionarioBelasartes
Ecologia
EDC
Educandow
EduMus
EleicoesReitor2010
Encima
Enearte
Estruturas
EstruturasEng
FACED
FAT
FepFaced
GEC
GeneticaBiodiversidade
GeneticaBiodiversidade3
GeneticaBiodiversidade
Gepindi
GetecEng
Godofredofilho
GrupoAlgebra
ICI010
Informev
Ites
LabioComp
LEG
Lepeja
Letras
LivroLivreSalvador
Main
MaisUm
Mata07
Mefes
MefesCpd
MetaReciclagem
Neclif
NelsonPretto
Nuclear
Numcad
Nutricao
Observa
OrfaosdeRua
PauloCostaLima
PdI
PescandoLetras
PETFilosofia
Pgif
PGNUT
PortalPpga
PosCultura
Pospetroigeo
PPGAC
PPGE
PpggBio
Ppggenbio
Pretto
Proad
PROGESP
ProjetoLencois
Quimica
RadioFACED
RadioTeatro
RadioWeb
Riosymposium10
Ripe
Salasdoctai
Sat
Sedu
SemBio
SeminarioPibid
SimoneLucena
Sociologia
SSL
Tabuleiro
TabuleirosUfba
TCinema
TerritoriosDigitais
TWiki
Twikidea
UFBAIrece
UniversidadeNova
VizinhoEstrangeiro
XIISNHCT
Български
English
Español
日本語
Português
Copyright &© by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback