Browse Source

Le champ qui affiche le code source est tout petit. Permettre à ce champ de s'adapter à la longueur du code généré. Meilleure lisibilité à la clef.

svn/root/tags/v1.3.6
xdjuj@apsulis.com 7 years ago
parent
commit
c05b0689c8
  1. 1
      .gitattributes
  2. 1
      formulaires/inserer_modeles.html
  3. 6
      inserer_modeles_pipelines.php
  4. 6
      javascript/autosize.min.js
  5. 3
      paquet.xml

1
.gitattributes vendored

@ -7,6 +7,7 @@ icones_barre/media.png -text
inc/inserer_modeles.php -text
/inserer_modeles.html -text
/inserer_modeles_pipelines.php -text
javascript/autosize.min.js -text
lang/inserer_modeles.xml -text
lang/inserer_modeles_en.php -text
lang/inserer_modeles_fr.php -text

1
formulaires/inserer_modeles.html

@ -12,6 +12,7 @@
#ACTION_FORMULAIRE{#ENV{action}}
<BOUCLE_deja_choisi(CONDITION){si #ENV{formulaire_modele}}>
[<textarea readonly="readonly" class="code_modele" id="code_modele[(#ENV{modalbox}|?{'_modalbox',''})]"[ (#ENV{_code_modele}|et{#ENV{_js_inserer_code}}|oui)ondblclick="#ENV**{_js_inserer_code}"]>(#ENV{_code_modele})</textarea>]
<script>$(document).ready(function(){ autosize($('#code_modele')); });</script>
[(#REM) Insertion du code dans le texte après validation ]
[(#ENV{_code_modele}|et{#ENV{modalbox}|=={oui}}|oui)
<script>$(document).ready(function(){

6
inserer_modeles_pipelines.php

@ -4,6 +4,12 @@ if (!defined('_ECRIRE_INC_VERSION')) {
return;
}
function inserer_modeles_header_prive($flux){
$js = find_in_path('javascript/autosize.min.js');
$flux .= "\n<script type='text/javascript' src='$js'></script>\n";
return $flux;
}
function inserer_modeles_affiche_droite($flux)
{
$config_meta = inserer_modeles_configuration();

6
javascript/autosize.min.js vendored

@ -0,0 +1,6 @@
/*!
Autosize 3.0.17
license: MIT
http://www.jacklmoore.com/autosize
*/
!function(e,t){if("function"==typeof define&&define.amd)define(["exports","module"],t);else if("undefined"!=typeof exports&&"undefined"!=typeof module)t(exports,module);else{var n={exports:{}};t(n.exports,n),e.autosize=n.exports}}(this,function(e,t){"use strict";function n(e){function t(){var t=window.getComputedStyle(e,null);"vertical"===t.resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),l="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(l)&&(l=0),a()}function n(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t,r()}function o(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}function r(){var t=e.style.height,n=o(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="auto";var i=e.scrollHeight+l;return 0===e.scrollHeight?void(e.style.height=t):(e.style.height=i+"px",s=e.clientWidth,n.forEach(function(e){e.node.scrollTop=e.scrollTop}),void(r&&(document.documentElement.scrollTop=r)))}function a(){r();var t=window.getComputedStyle(e,null),o=Math.round(parseFloat(t.height)),i=Math.round(parseFloat(e.style.height));if(o!==i?"visible"!==t.overflowY&&n("visible"):"hidden"!==t.overflowY&&n("hidden"),u!==o){u=o;var a=d("autosize:resized");e.dispatchEvent(a)}}if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!i.has(e)){var l=null,s=e.clientWidth,u=null,c=function(){e.clientWidth!==s&&a()},p=function(t){window.removeEventListener("resize",c,!1),e.removeEventListener("input",a,!1),e.removeEventListener("keyup",a,!1),e.removeEventListener("autosize:destroy",p,!1),e.removeEventListener("autosize:update",a,!1),i["delete"](e),Object.keys(t).forEach(function(n){e.style[n]=t[n]})}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",p,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",a,!1),window.addEventListener("resize",c,!1),e.addEventListener("input",a,!1),e.addEventListener("autosize:update",a,!1),i.add(e),e.style.overflowX="hidden",e.style.wordWrap="break-word",t()}}function o(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName){var t=d("autosize:destroy");e.dispatchEvent(t)}}function r(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName){var t=d("autosize:update");e.dispatchEvent(t)}}var i="function"==typeof Set?new Set:function(){var e=[];return{has:function(t){return Boolean(e.indexOf(t)>-1)},add:function(t){e.push(t)},"delete":function(t){e.splice(e.indexOf(t),1)}}}(),d=function(e){return new Event(e)};try{new Event("test")}catch(a){d=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}var l=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?(l=function(e){return e},l.destroy=function(e){return e},l.update=function(e){return e}):(l=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return n(e,t)}),e},l.destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],o),e},l.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],r),e}),t.exports=l});

3
paquet.xml

@ -1,7 +1,7 @@
<paquet
prefix="inserer_modeles"
categorie="edition"
version="1.2.8"
version="1.2.9"
etat="stable"
compatibilite="[3.0.0;3.1.*]"
logo="prive/themes/spip/images/modele-32.png"
@ -15,6 +15,7 @@
<licence lien="http://www.gnu.org/licenses/gpl-3.0.html">GPL 3</licence>
<pipeline nom="header_prive" inclure="inserer_modeles_pipelines.php" />
<pipeline nom="affiche_droite" inclure="inserer_modeles_pipelines.php" />
<pipeline nom="porte_plume_barre_pre_charger" inclure="inserer_modeles_pipelines.php" />
<pipeline nom="porte_plume_lien_classe_vers_icone" inclure="inserer_modeles_pipelines.php" />

Loading…
Cancel
Save