Difference between revisions of "MediaWiki:Common.js"

From Openresearch
Jump to: navigation, search
Line 23: Line 23:
 
<noscript><p><img src="//openresearch.org/analysis/piwik.php?idsite=1" style="border:0;" alt="" /></p></noscript>
 
<noscript><p><img src="//openresearch.org/analysis/piwik.php?idsite=1" style="border:0;" alt="" /></p></noscript>
 
<!-- End Piwik Code -->
 
<!-- End Piwik Code -->
 +
 +
<!-- calendar -->
 +
$(document).ready(function () {
 +
 +
    $('#calendar').fullCalendar({
 +
        header: {
 +
            left: 'prev,next today',
 +
            center: 'title',
 +
            right: 'month,agendaWeek,agendaDay'
 +
        },
 +
 +
        eventAfterRender: function () {
 +
            // add titles to "+# more links"
 +
            $('.fc-more-cell a').each(function () {
 +
                this.title = this.textContent;
 +
            });
 +
        },
 +
 +
        // add event name to title attribute on mouseover
 +
        eventMouseover: function (event, jsEvent, view) {
 +
            if (view.name !== 'agendaDay') {
 +
                $(jsEvent.target).attr('title', event.title);
 +
            }
 +
        },
 +
 +
        editable: true,
 +
        eventLimit: true // allow "more" link when too many events
 +
 +
    });
 +
 +
});

Revision as of 16:06, 17 September 2016

/* Any JavaScript here will be loaded for all users on every page load. */

/**
 * Additional linked icon for the searchlabel of result format "feed"
 * @author mwjames
 */
 
$( '.smw-feed-furtherresults > a' ).addClass( 'feedlink' );

<!-- Piwik -->
<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  (function() {
    var u="//openresearch.org/analysis/";
    _paq.push(['setTrackerUrl', u+'piwik.php']);
    _paq.push(['setSiteId', 1]);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
    g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
  })();
</script>
<noscript><p><img src="//openresearch.org/analysis/piwik.php?idsite=1" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->

<!-- calendar -->
$(document).ready(function () {

    $('#calendar').fullCalendar({
        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,agendaWeek,agendaDay'
        },

        eventAfterRender: function () {
            // add titles to "+# more links"
            $('.fc-more-cell a').each(function () {
                this.title = this.textContent;
            });
        },

        // add event name to title attribute on mouseover
        eventMouseover: function (event, jsEvent, view) {
            if (view.name !== 'agendaDay') {
                $(jsEvent.target).attr('title', event.title);
            }
        },

        editable: true,
        eventLimit: true // allow "more" link when too many events

    });

});