Commit 9a787362 authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

Merge branch 'normalisation_plugin' into 'master'

ajout du plugin normalisation

See merge request pdn-certic/MaX!1
parents 9b686460 fe866605
Loading
Loading
Loading
Loading
+0 −0

Empty file added.

+9 −0
Original line number Diff line number Diff line
.orig{
  color:black;
  display:none;
}

.reg{
  color:black;
  font-weight:bold;
}
 No newline at end of file
+50 −0
Original line number Diff line number Diff line
const REG_CLASS = "reg";
const ORIG_CLASS = "orig";

var normalisationOptions = new Object();
  
  
normalisationOptions['onTextChange'] = function() { 
  
  var checkAttr = "";
  if(localStorage.
         getItem(MAX_LOCAL_STORAGE_PREFIX + REG_CLASS) === MAX_VISIBLE_PROPERTY_STRING) 
  {    
    checkAttr = "checked='checked' ";
    //updates visibility
    onNorm();
  }
  else{  
    //updates visibility 
    offNorm();
   }

 $("#options-list").append("<li><a><input id='toggle_reg' type='checkbox' onchange='setRegVisible()' "+checkAttr+" name='toggle_reg'>Normalisation de l'éditeur</a></li>");
}


function setRegVisible(){

  if($('#toggle_reg').is(":checked"))
  {
    onNorm();
    localStorage.setItem(MAX_LOCAL_STORAGE_PREFIX + REG_CLASS, MAX_VISIBLE_PROPERTY_STRING);
  }
  else{ 
    offNorm(); 
    localStorage.removeItem(MAX_LOCAL_STORAGE_PREFIX + REG_CLASS);
  }  
}

/*corr visibles*/
function onNorm(){
  $("." + ORIG_CLASS).hide(); 
  $("." + REG_CLASS).show(); 
}
/*corr hidden (sic visibles)*/
function offNorm(){
  $("." + ORIG_CLASS).show(); 
  $("." + REG_CLASS).hide();
}

MAX.addModule(normalisationOptions);
 No newline at end of file
+16 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>


<xsl:stylesheet	version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:tei="http://www.tei-c.org/ns/1.0"
                exclude-result-prefixes="tei xsl">


  <xsl:template match="//tei:choice">
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="//tei:orig | //tei:reg"><span><xsl:attribute name="class"><xsl:value-of select="local-name(.)"/></xsl:attribute><xsl:apply-templates/></span></xsl:template>

</xsl:stylesheet>