Benutzer:Loki/vector.js: Unterschied zwischen den Versionen

Aus Shadowhelix
Zur Navigation springen Zur Suche springen
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 77: Zeile 77:
         "speedTip": "adhoc",
         "speedTip": "adhoc",
         "tagOpen": '\| align=\"center\" style=\"height:120px; background-color:white;\" \| \[\[\|80px\]\]',
         "tagOpen": '\| align=\"center\" style=\"height:120px; background-color:white;\" \| \[\[\|80px\]\]',
        "tagClose": "",
        "sampleText": ""};
    mwCustomEditButtons[mwCustomEditButtons.length] = {
        "imageFile": "http://shadowhelix.pegasus.de/images/1/1b/Button_empty.png",
        "speedTip": "a2060 a2070 ad adh adsw ahb aj1 aj2 aj3 aj4 b&s b6w b:adl\nb:m ber berlim bs btech cp! crit ctech c&d d6w db dc dnadoa\ndids dids2 dj eids el eme fd fe fk fk2 fmf fogw fr gidw\ngrim gk gz hbew hbk h hr jdk kd ke ken kf kk kz ldv ls73\nmat merc mg mk mn mshfs mst mst2 mum naqb nl ns otr pb\nped pz rhb r2 r3 ra:s rds rk rl rrmp srz sa sdk sh sk sk2 sl slr\nsls sls2 sls3 sls4 sm sm2 sota63 sota64 sota73 sox sqb sr\nsr2 sr3 sr4 sr4a sr4er srk srk3 ssch ss ss2 ssk ssk2 stech\nsühb sw sz tw ub uqb uw vd vf vn vr2 vt wda wds wpsi ww\n",
        "tagOpen": '',
         "tagClose": "",
         "tagClose": "",
         "sampleText": ""};
         "sampleText": ""};

Version vom 15. April 2013, 22:22 Uhr

/* Skriptimport */

customHighlightFarbe = 'lightgrey';

importScript('Benutzer:Loki/universalimpressumOverviewHighlight.js');
importScript('Benutzer:Loki/shadowtalkDisplay.js');
importScript('Benutzer:Loki/refDisplay.js');
importScript('Benutzer:Loki/vorlageUhr.js');
importScript('Benutzer:Loki/vorlageButton.js');

function testFunktionen () {
    addPortletLink('p-cactions', 'javascript:alert(document.location.href)', 'URL', 'ca-last', 'url');
    addPortletLink('p-cactions', 'javascript:alert(document.location.href.length)', 'URL-Laenge', 'ca-last', 'url laenge');
}

// addOnloadHook( testFunktionen );

// ----------------------------------------------------------

// ----------------------------------------------------------

/* Ergänzung der Editierzeile mit zusätzlichen Buttons */

if (mwCustomEditButtons) {

    mwCustomEditButtons[mwCustomEditButtons.length] = {
        "imageFile": "http://shadowhelix.de/images/b/b9/Button_E.png",
        "speedTip": "Artikelende",
        "tagOpen": "<!-- Ende des Artikelinhalts - Metainformationen -->",
        "tagClose": "",
        "sampleText": ""};

    mwCustomEditButtons[mwCustomEditButtons.length] = {
        "imageFile": "http://shadowhelix.de/images/b/b0/Button_trash.png",
        "speedTip": "Löschantrag",
        "tagOpen": "\{\{Löschantrag||}}",
        "tagClose": "",
        "sampleText": ""};

    mwCustomEditButtons[mwCustomEditButtons.length] = {
        "imageFile": "http://shadowhelix.de/images/3/3e/Button_STD.png",
        "speedTip": "Standardartikel",
        "tagOpen": '\{\{stub}}\n\{\{+quelle}}\n\'\'\'\'\'\'\n<ref></ref>\n<ref group=\"E\"></ref>\n<ref group=\"W\"></ref>\n\n<!-- Ende des Artikelinhalts - Metainformationen -->\n\n==Erläuterungen==\n<references group=\"E\"/>\n\n==Widersprüche==\n<references group=\"W\"/>\n\n==Quellenindex==\n\{\{IdxTab\n|\n*\{\{Qde|}} \{\{+idx}}\n|\n*\{\{Qen|}} \{\{+idx}}\n}}\n*[[Romane#|Roman:]] \{\{+idx}}\n*\{\{Romanquelle||\{\{+idx}}}}\n\n==Quellenangabe==\n<references/>\n\n==Weblinks==\n*[[wp:|Wikipedia: ]]\n\n{{DEFAULTSORT:}}\n\{\{KatSchema|schema=}}\n\{\{KatSort|cat=|}}\n[[Kategorie:]]',
        "tagClose": "",
        "sampleText": ""};

    mwCustomEditButtons[mwCustomEditButtons.length] = {
        "imageFile": "http://shadowhelix.de/images/b/ba/Button_Stub.png",
        "speedTip": "Stubartikel",
        "tagOpen": '\{\{stub}}\n\'\'\'\'\'\'\n\n<!-- Ende des Artikelinhalts - Metainformationen -->\n\n==Quellenindex==\n\{\{IdxTab\n|\n*\{\{Qde|}} \{\{+idx}}\n|\n*\{\{Qen|}} \{\{+idx}}\n}}\n\n==Weblinks==\n*[[wp:|Wikipedia: ]]\n\n\{\{DEFAULTSORT:}}\n\{\{KatSchema|schema=}}\n\{\{KatSort|cat=|}}\n[[Kategorie:]]',
        "tagClose": "",
        "sampleText": ""};

    mwCustomEditButtons[mwCustomEditButtons.length] = {
        "imageFile": "http://shadowhelix.de/images/8/84/Button_Redirect.png",
        "speedTip": "Weiterleitung",
        "tagOpen": '#WEITERLEITUNG [[',
        "tagClose": "]]",
        "sampleText": ""};

    mwCustomEditButtons[mwCustomEditButtons.length] = {
        "imageFile": "http://shadowhelix.de/images/9/9d/Button_Person.png",
        "speedTip": "Vorlage:Person",
        "tagOpen": '\{\{Person\n|GESCHLECHT=\n|METATYP=\n|MAGISCH=\n}}',
        "tagClose": "",
        "sampleText": ""};

    mwCustomEditButtons[mwCustomEditButtons.length] = {
        "imageFile": "http://shadowhelix.de/images/8/8e/Button_Stadt.png",
        "speedTip": "Vorlage:Stadt",
        "tagOpen": '\{\{Stadt\n|STAND=?\n|STATUS=\n|KOORD_DISPLAY=1\n|KOORD_LAENGE=\n|KOORD_BREITE=\n|KOORD_KBS=1\n|KOORD_ZGM=\n|POSITIONSKARTE=\n|POS_LABEL=\n}} \{\{KoordTransform|}}',
        "tagClose": "",
        "sampleText": ""};

    mwCustomEditButtons[mwCustomEditButtons.length] = {
        "imageFile": "http://shadowhelix.de/images/a/a1/Button_adhoc.png",
        "speedTip": "adhoc",
        "tagOpen": '\| align=\"center\" style=\"height:120px; background-color:white;\" \| \[\[\|80px\]\]',
        "tagClose": "",
        "sampleText": ""};

}

/***********************************************************************/

function testButton() {

    var Selection = document.getElementsByClassName( "jsFunctionButton" );

    for ( var i = Selection.length - 1; i >= 0 ; i-- ) {

         var input = Selection[i].id.split("_");
         var jsFunction = input.shift();

         var Button = document.createElement( "a" );

         var inputString = "";
         for ( var j = 0; j < input.length; j++ ) {
              inputString = inputString + "'"+input[j];
              if (j != input.length - 1) {
                   inputString = inputString + "',";
              } else {
                   inputString = inputString + "'";
              }
         }

         Button.setAttribute( "href", "javascript:"+jsFunction+"("+inputString+")" );

//       Button.style.color = Selection[i].style.color;
//       Button.style.fontSize = Selection[i].style.fontSize;

         Button.appendChild( Selection[i].childNodes[0] );

         $(Selection[i]).replaceWith( Button );

    }

}

function toggleVisibility( targetClass, targetID ) {

    var objects = document.getElementsByClassName( targetClass );

    for ( var i = 0; i < objects.length; i++ ) {     

        if (objects[i].id != targetID) {
                objects[i].style.display = 'none';
        } else {
                objects[i].style.display = '';
        }
    }
}

// addOnloadHook( testButton );