Usuario:Edmenb/vector.js

De Wikilibros, la colección de libros de texto de contenido libre.

Nota: Después de publicar, quizás necesite actualizar la caché de su navegador para ver los cambios.

  • Firefox/Safari: Mantenga presionada la tecla Shift mientras pulsa el botón Actualizar, o presiona Ctrl+F5 o Ctrl+R (⌘+R en Mac)
  • Google Chrome: presione Ctrl+Shift+R (⌘+Shift+R en Mac)
  • Internet Explorer/Edge: mantenga presionada Ctrl mientras pulsa Actualizar, o presione Ctrl+F5
  • Opera: Presiona Ctrl+F5.
/* Adición de botones dentro de la barra de botones «avanzada» del nuevo editor */
/* Label = etiquetita cuando le pasas el ratón */
/* icon = la imagen del botón */
/* type = desconozco que otros hay además de ''encapsulate''. */
/* pre = lo que va antes del texto seleccionado (puedes poner "") */
/* post = lo que cierra, aquí puedes poner la plantilla. Explicacion gracias a Magister Mathematicae */

 
if ( typeof $j != 'undefined' && typeof $.fn.wikiEditor != 'undefined' ) {
        $( function() {
                $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
                        'section': 'main',
                        'group': 'insert',
                        'tools': {
                                'Hecho': {
                                        label: 'Plantilla Hecho (chek)',
                                        type: 'button',
                                        icon: 'http://upload.wikimedia.org/wikipedia/commons/b/b6/Button_article_de_qualite.png',
                                        action: {
                                                type: 'encapsulate',
                                                options: {
                                                   pre : "",    
                                                   post: "{{hecho}}"
                                                }
                                        }
                                }
                        }
                } );
        } );
}
if ( typeof $j != 'undefined' && typeof $.fn.wikiEditor != 'undefined' ) {
        $( function() {
                $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
                        'section': 'main',
                        'group': 'insert',
                        'tools': {
                                'No Firmado': {
                                        label: 'Plantilla No firmado',
                                        type: 'button',
                                        icon: 'http://upload.wikimedia.org/wikipedia/commons/1/12/Button_breve.png',
                                        action: {
                                                type: 'encapsulate',
                                                options: {
                                                   pre : "{{no firmado|}}",    
                                                   post: ""
                                                }
                                        }
                                }
                        }
                } );
        } );
}
if ( typeof $j != 'undefined' && typeof $.fn.wikiEditor != 'undefined' ) {
        $( function() {
                $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
                        'section': 'main',
                        'group': 'insert',
                        'tools': {
                                'Proteger': {
                                        label: 'Plantilla Semi-protegido',
                                        type: 'button',
                                        icon: 'http://upload.wikimedia.org/wikipedia/commons/8/83/Button_encrypted.png',
                                        action: {
                                                type: 'encapsulate',
                                                options: {
                                                   pre : "",    
                                                   post: "{{prot|}}"
                                                }
                                        }
                                }
                        }
                } );
        } );
}
if ( typeof $j != 'undefined' && typeof $.fn.wikiEditor != 'undefined' ) {
        $( function() {
                $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
                        'section': 'advanced',
                        'group': 'format',
                        'tools': {
                                'comment': {
                                        label: 'Comment',
                                        type: 'button',
                                        icon: 'http://upload.wikimedia.org/wikipedia/commons/1/1b/Button_hide_wiki_tag.png',
                                        action: {
                                                type: 'encapsulate',
                                                options: {
                                                        pre: "<!-- ",
                                                        post: " -->"
                                                }
                                        }
                                }
                        }
                } );
        } );
}            
if ( typeof $j != 'undefined' && typeof $.fn.wikiEditor != 'undefined' ) {
        $( function() {
                $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
                        'section': 'advanced',
                        'group': 'format',
                        'tools': {
                                'strikethrough': {
                                        label: 'Strike',
                                        type: 'button',
                                        icon: 'http://upload.wikimedia.org/wikipedia/commons/3/30/Btn_toolbar_rayer.png',
                                        action: {
                                                type: 'encapsulate',
                                                options: {
                                                        pre: "<s>",
                                                        post: "</s>"
                                                }
                                        }
                                }
                        }
                } );
        } );
}
if ( typeof $j != 'undefined' && typeof $.fn.wikiEditor != 'undefined' ) {
        $( function() {
                $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
                        'section': 'main',
                        'group': 'insert',
                        'tools': {
                                'Llaves': {
                                        label: 'Llaves para plantillas',
                                        type: 'button',
                                        icon: 'http://upload.wikimedia.org/wikipedia/commons/e/eb/Button_plantilla.png',
                                        action: {
                                                type: 'encapsulate',
                                                options: {
                                                   pre : "{{",    
                                                   post: "}}"
                                                }
                                        }
                                }
                        }
                } );
        } );
}
if ( typeof $j != 'undefined' && typeof $.fn.wikiEditor != 'undefined' ) {
        $( function() {
                $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
                        'section': 'advanced',
                        'group': 'format',
                        'tools': {
                                'Underline': {
                                        label: 'Underline',
                                        type: 'button',
                                        icon: 'http://upload.wikimedia.org/wikipedia/commons/f/fd/Button_underline.png',
                                        action: {
                                                type: 'encapsulate',
                                                options: {
                                                        pre: "<u>",
                                                        post: "</u>"
                                                }
                                        }
                                }
                        }
                } );
        } );
}

if ( typeof $j != 'undefined' && typeof $.fn.wikiEditor != 'undefined' ) {
        $( function() {
                $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
                        'section': 'main',
                        'group': 'insert',
                        'tools': {
                                'Proteger': {
                                        label: 'Plantilla Semi-protegido',
                                        type: 'button',
                                        icon: 'http://upload.wikimedia.org/wikipedia/commons/7/72/Button_copy_vio_plagio.png',
                                        action: {
                                                type: 'encapsulate',
                                                options: {
                                                   pre : "subst:Aviso copyvio|",    
                                                   post: "|plagio"
                                                }
                                        }
                                }
                        }
                } );
        } );
}