Craig of the Creek Wiki
mNo edit summary
mNo edit summary
Line 19: Line 19:
 
$('<h2>', {
 
$('<h2>', {
 
'class': 'activity-heading has-icon',
 
'class': 'activity-heading has-icon',
html: '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18"><path d="m 11.3761,0.09175963 c -0.03461,0.0486 -0.0979,0.09305 -0.107937,0.151723 1.335872,0.4284819 2.648233,1.00754387 3.74474,1.89688587 0.104015,0.07693 0.01409,0.05323 -0.04971,0.01473 C 14.117489,1.7238455 13.239722,1.3486066 12.320927,1.1030096 10.812152,0.68275763 9.2257617,0.56403763 7.6690682,0.72492463 6.8677659,0.79806463 6.0667627,0.90879063 5.2938764,1.1394966 4.3930911,1.3917476 3.530967,1.7623115 2.6960266,2.1807065 c -0.1078379,0.06499 -0.052688,-0.007 0.00145,-0.04427 C 3.5610996,1.4249506 4.580377,0.92769263 5.6189131,0.52639263 5.9560176,0.39191553 6.3119763,0.29814463 6.6504097,0.17630453 6.6282317,0.10958463 6.5636097,0.02761063 6.5044191,0.00179253 4.9901383,0.09201253 3.5225254,0.66938863 2.3045549,1.5640906 2.0964472,1.7549985 2.0218827,2.0427115 1.8909807,2.2855045 1.1478929,3.9205315 0.61073819,5.6500596 0.29117599,7.4172116 0.11785409,8.4520902 -0.01224736,9.5003545 9.1720236e-4,10.551172 0.0682928,10.770207 0.25440251,10.93114 0.39772019,11.10446 1.3685635,12.186744 2.7964826,12.775565 4.226482,12.908176 c 0.153807,0.02 0.3088949,0.02406 0.4638097,0.02521 C 5.0256469,12.512842 5.364229,12.094884 5.7013723,11.675774 4.6681809,11.351518 3.6759448,10.776248 3.0337749,9.8858295 c -0.05437,-0.08497 0.072427,0.0033 0.098014,0.0176 0.9217933,0.5973155 1.9561262,1.0027665 3.0117906,1.2938115 0.9406453,0.251479 1.9114064,0.4111 2.8873582,0.396218 0.6117299,0.01426 1.2234533,-0.02847 1.8262173,-0.134781 1.179224,-0.192806 2.318507,-0.598161 3.383552,-1.135018 0.281444,-0.136198 0.540558,-0.319121 0.815609,-0.4623285 -0.247047,0.3998805 -0.615928,0.7155195 -0.992872,0.9919635 -0.515492,0.372988 -1.100499,0.636405 -1.702534,0.835076 -0.110781,0.01514 0.0036,0.10046 0.02662,0.145058 0.290419,0.37718 0.597823,0.740841 0.901192,1.107571 1.409507,-0.05207 2.836773,-0.512219 3.905336,-1.454941 0.292566,-0.268008 0.566228,-0.558694 0.792766,-0.885325 C 17.974124,9.1586895 17.795865,7.7183712 17.462799,6.3152885 17.088144,4.7384875 16.553738,3.1948855 15.826223,1.7454445 15.679262,1.5009175 15.400388,1.3847575 15.176568,1.2234655 14.059766,0.52598953 12.777181,0.07329753 11.457748,-2.1646881e-4 11.430538,0.03044353 11.403318,0.06110353 11.376108,0.09176353 Z m 0.403612,5.65234297 c 0.778923,0.0056 1.432945,0.692541 1.513901,1.446932 0.07181,0.5359536 -0.07066,1.1098646 -0.453033,1.5041536 -0.33422,0.3605673 -0.845148,0.5408913 -1.331343,0.4622713 -0.681961,-0.08975 -1.209717,-0.7050863 -1.327594,-1.3625663 -0.06084,-0.4439616 -0.0094,-0.9163596 0.239373,-1.2991016 0.281675,-0.468746 0.808286,-0.7722 1.358696,-0.751689 z m -5.6392148,4.63e-4 C 6.8533425,5.7451816 7.4865273,6.3111976 7.63547,6.9970716 7.7642945,7.5250726 7.657499,8.1046332 7.3348095,8.5441262 7.0508558,8.9451862 6.5602112,9.2055285 6.0643299,9.1675235 5.4234483,9.1843075 4.8633758,8.6940292 4.6478757,8.1143032 4.5034641,7.7631262 4.5071598,7.3650115 4.5829787,6.9984296 4.7180396,6.4702766 5.0965211,5.9911766 5.6253496,5.8195085 c 0.1645409,-0.0583 0.3414549,-0.07627 0.5151469,-0.07494 z"/></svg> Discord'
+
html: '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18"><path d="m 11.384408,2.621475 c -0.03463,0.0486 -0.09797,0.09305 -0.108016,0.15172 1.336851,0.428475 2.650173,1.007527 3.747483,1.896854 0.104092,0.07693 0.0141,0.05323 -0.04975,0.01473 C 14.127806,4.253533 13.249396,3.8783 12.329928,3.632708 10.820047,3.212463 9.2324947,3.093745 7.6746608,3.254629 c -0.801889,0.07314 -1.603479,0.183863 -2.376932,0.414565 -0.901445,0.252247 -1.7642,0.622804 -2.599752,1.041192 -0.107917,0.06499 -0.05273,-0.007 0.0015,-0.04427 0.864256,-0.711474 1.88428,-1.208723 2.923577,-1.610017 0.337352,-0.134475 0.693571,-0.228244 1.032252,-0.350082 -0.02219,-0.06672 -0.08686,-0.148691 -0.146097,-0.174509 -1.51539,0.09022 -2.984078,0.667585 -4.202941,1.562272 -0.20826,0.190905 -0.282879,0.478613 -0.413877,0.721402 -0.743632,1.634999 -1.28118003,3.364499 -1.60097703,5.131621 -0.173449,1.034861 -0.303645,2.083108 -0.29047099257,3.133908 C 0.06837277,13.299742 0.25461377,13.460673 0.39803677,13.63399 c 0.97155403,1.082266 2.40051903,1.671077 3.83156603,1.803686 0.15392,0.02 0.309121,0.02406 0.46415,0.02521 0.3356,-0.420537 0.674431,-0.838488 1.011821,-1.257591 -1.033948,-0.32425 -2.026911,-0.899511 -2.669552,-1.789914 -0.05441,-0.08497 0.07248,0.0033 0.09809,0.0176 0.922469,0.597305 1.957559,1.002749 3.013997,1.293789 0.941335,0.251475 1.9128069,0.411093 2.8894729,0.396212 0.612178,0.01426 1.2243503,-0.02847 1.8275553,-0.134779 1.180088,-0.192803 2.320206,-0.598151 3.386031,-1.134999 0.28165,-0.136196 0.540954,-0.319116 0.816206,-0.462321 -0.247228,0.399874 -0.616379,0.715508 -0.993599,0.991947 -0.51587,0.372982 -1.101305,0.636394 -1.703781,0.835062 -0.110862,0.01514 0.0036,0.100458 0.02664,0.145056 0.290632,0.377173 0.598261,0.740828 0.901852,1.107552 1.41054,-0.05207 2.838852,-0.51221 3.908197,-1.454917 0.292726,-0.268004 0.566588,-0.558685 0.793292,-0.885311 -0.01271,-1.44202 -0.191099,-2.882314 -0.524409,-4.285374 C 17.100637,7.268125 16.565839,5.724548 15.837791,4.275132 15.690723,4.030609 15.411644,3.914451 15.18766,3.753161 14.07004,3.055697 12.786516,2.603013 11.466116,2.5295 c -0.02723,0.03066 -0.05447,0.06132 -0.0817,0.09198 z m 0.403908,5.652248 c 0.779494,0.0056 1.433995,0.692529 1.51501,1.446908 0.07186,0.535944 -0.07071,1.109846 -0.453365,1.504128 -0.334465,0.360561 -0.845767,0.540883 -1.332318,0.462264 -0.682461,-0.08975 -1.210603,-0.705075 -1.328567,-1.362544 -0.06088,-0.443954 -0.0094,-0.916344 0.239549,-1.29908 0.281881,-0.468738 0.808878,-0.772187 1.359691,-0.751676 z m -5.6433462,4.63e-4 c 0.713368,6.16e-4 1.347017,0.566623 1.496068,1.252485 0.128919,0.527992 0.02204,1.107543 -0.30088,1.547029 -0.284162,0.401053 -0.775166,0.661391 -1.271411,0.623387 -0.641351,0.01678 -1.201834,-0.473487 -1.417492,-1.053203 -0.144517,-0.351171 -0.140818,-0.749279 -0.06494,-1.115855 0.13516,-0.528144 0.513919,-1.007236 1.043135,-1.178901 0.164661,-0.0583 0.341705,-0.07627 0.515524,-0.07494 z"/></svg> Discord'
 
})
 
})
 
)
 
)

Revision as of 21:12, 14 May 2018

/*

    Discord module loader.
    Code taken from http://bokunoheroacademia.wikia.com/wiki/MediaWiki:Wikia.js
    
*/
 
;(function ($, mw) {
    'use strict';
 
    // add module for Craig of the Creek Wiki
    function addModule() {
        $('<section>')
            .attr('id', 'rsw-discord')
            .addClass('rsw-custom-module rail-module')
            .append(
                $('<div>')
                    .append(
                        $('<h2>', {
                        'class': 'activity-heading has-icon',
                        html: '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18"><path d="m 11.384408,2.621475 c -0.03463,0.0486 -0.09797,0.09305 -0.108016,0.15172 1.336851,0.428475 2.650173,1.007527 3.747483,1.896854 0.104092,0.07693 0.0141,0.05323 -0.04975,0.01473 C 14.127806,4.253533 13.249396,3.8783 12.329928,3.632708 10.820047,3.212463 9.2324947,3.093745 7.6746608,3.254629 c -0.801889,0.07314 -1.603479,0.183863 -2.376932,0.414565 -0.901445,0.252247 -1.7642,0.622804 -2.599752,1.041192 -0.107917,0.06499 -0.05273,-0.007 0.0015,-0.04427 0.864256,-0.711474 1.88428,-1.208723 2.923577,-1.610017 0.337352,-0.134475 0.693571,-0.228244 1.032252,-0.350082 -0.02219,-0.06672 -0.08686,-0.148691 -0.146097,-0.174509 -1.51539,0.09022 -2.984078,0.667585 -4.202941,1.562272 -0.20826,0.190905 -0.282879,0.478613 -0.413877,0.721402 -0.743632,1.634999 -1.28118003,3.364499 -1.60097703,5.131621 -0.173449,1.034861 -0.303645,2.083108 -0.29047099257,3.133908 C 0.06837277,13.299742 0.25461377,13.460673 0.39803677,13.63399 c 0.97155403,1.082266 2.40051903,1.671077 3.83156603,1.803686 0.15392,0.02 0.309121,0.02406 0.46415,0.02521 0.3356,-0.420537 0.674431,-0.838488 1.011821,-1.257591 -1.033948,-0.32425 -2.026911,-0.899511 -2.669552,-1.789914 -0.05441,-0.08497 0.07248,0.0033 0.09809,0.0176 0.922469,0.597305 1.957559,1.002749 3.013997,1.293789 0.941335,0.251475 1.9128069,0.411093 2.8894729,0.396212 0.612178,0.01426 1.2243503,-0.02847 1.8275553,-0.134779 1.180088,-0.192803 2.320206,-0.598151 3.386031,-1.134999 0.28165,-0.136196 0.540954,-0.319116 0.816206,-0.462321 -0.247228,0.399874 -0.616379,0.715508 -0.993599,0.991947 -0.51587,0.372982 -1.101305,0.636394 -1.703781,0.835062 -0.110862,0.01514 0.0036,0.100458 0.02664,0.145056 0.290632,0.377173 0.598261,0.740828 0.901852,1.107552 1.41054,-0.05207 2.838852,-0.51221 3.908197,-1.454917 0.292726,-0.268004 0.566588,-0.558685 0.793292,-0.885311 -0.01271,-1.44202 -0.191099,-2.882314 -0.524409,-4.285374 C 17.100637,7.268125 16.565839,5.724548 15.837791,4.275132 15.690723,4.030609 15.411644,3.914451 15.18766,3.753161 14.07004,3.055697 12.786516,2.603013 11.466116,2.5295 c -0.02723,0.03066 -0.05447,0.06132 -0.0817,0.09198 z m 0.403908,5.652248 c 0.779494,0.0056 1.433995,0.692529 1.51501,1.446908 0.07186,0.535944 -0.07071,1.109846 -0.453365,1.504128 -0.334465,0.360561 -0.845767,0.540883 -1.332318,0.462264 -0.682461,-0.08975 -1.210603,-0.705075 -1.328567,-1.362544 -0.06088,-0.443954 -0.0094,-0.916344 0.239549,-1.29908 0.281881,-0.468738 0.808878,-0.772187 1.359691,-0.751676 z m -5.6433462,4.63e-4 c 0.713368,6.16e-4 1.347017,0.566623 1.496068,1.252485 0.128919,0.527992 0.02204,1.107543 -0.30088,1.547029 -0.284162,0.401053 -0.775166,0.661391 -1.271411,0.623387 -0.641351,0.01678 -1.201834,-0.473487 -1.417492,-1.053203 -0.144517,-0.351171 -0.140818,-0.749279 -0.06494,-1.115855 0.13516,-0.528144 0.513919,-1.007236 1.043135,-1.178901 0.164661,-0.0583 0.341705,-0.07627 0.515524,-0.07494 z"/></svg> Discord'
                    })
                    )
                    
                    .append(
                        $('<p>')
                            .append(
                                'The Craig of the Creek Wiki has an official Discord server! Click the button below to join and chat with fellow fans and editors live, or click ',
                                $('<a>')
                                    .attr('href', mw.util.wikiGetlink('Project:Discord'))
                                    .text('here'),
                                ' to read our chat rules.'
                            ),
                        $('<a>')
                            .attr('href', 'https://https://discord.gg/Zx7swKb')
                            .addClass('wds-button')
                            .text('Connect')
                    )
          )
          .insertBefore('#activities');
    }
 
    function init() {
        //load once
        if ($('#rsw-discord').length) {
            mw.log('Discord module already loaded');
            return;
        }
 
        if ($('#WikiaRail').hasClass('loaded')) {
            addModule();
        } else {
            $('#WikiaRail').on('afterLoad.rail', addModule);
        }
    }
 
    mw.log('Loading Discord module');
    mw.loader.using(['mediawiki.util'], function () {
        $(init);
    });
 
}(this.jQuery, this.mediaWiki));