About: AjaxRC/code.js   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

/* * ADVANCED AJAX AUTO-REFRESHING ARTICLES * Code originally by "pcj" of Wowpedia * Maintenance, cleanup, style and bug fixes by Grunny () and Kangaroopower () */ ( function ( $, mw, window ) { 'use strict'; var ajaxIndicator = window.ajaxIndicator || ', ajaxTimer, refreshText = typeof window.AjaxRCRefreshText === 'string' ? window.AjaxRCRefreshText : 'AJAX', refreshHover = typeof window.AjaxRCRefreshHoverText === 'string' ? window.AjaxRCRefreshHoverText : 'Enable auto-refreshing page loads', ajRefresh = window.ajaxRefresh || 60000, ajPages = window.ajaxPages || [ 'Special:RecentChanges' ]; /**

AttributesValues
rdfs:label
  • AjaxRC/code.js
  • AjaxRC/code.js
rdfs:comment
  • /* * ADVANCED AJAX AUTO-REFRESHING ARTICLES * Code originally by "pcj" of Wowpedia * Maintenance, cleanup, style and bug fixes by Grunny () and Kangaroopower () */ ( function ( $, mw, window ) { 'use strict'; var ajaxIndicator = window.ajaxIndicator || ', ajaxTimer, refreshText = typeof window.AjaxRCRefreshText === 'string' ? window.AjaxRCRefreshText : 'AJAX', refreshHover = typeof window.AjaxRCRefreshHoverText === 'string' ? window.AjaxRCRefreshHoverText : 'Enable auto-refreshing page loads', ajRefresh = window.ajaxRefresh || 60000, ajPages = window.ajaxPages || [ 'Spezial:Letzte_Änderungen' ];
  • /* * ADVANCED AJAX AUTO-REFRESHING ARTICLES * Code originally by "pcj" of Wowpedia * Maintenance, cleanup, style and bug fixes by Grunny () and Kangaroopower () */ ( function ( $, mw, window ) { 'use strict'; var ajaxIndicator = window.ajaxIndicator || ', ajaxTimer, refreshText = typeof window.AjaxRCRefreshText === 'string' ? window.AjaxRCRefreshText : 'AJAX', refreshHover = typeof window.AjaxRCRefreshHoverText === 'string' ? window.AjaxRCRefreshHoverText : 'Enable auto-refreshing page loads', ajRefresh = window.ajaxRefresh || 60000, ajPages = window.ajaxPages || [ 'Special:RecentChanges' ]; /**
dcterms:subject
abstract
  • /* * ADVANCED AJAX AUTO-REFRESHING ARTICLES * Code originally by "pcj" of Wowpedia * Maintenance, cleanup, style and bug fixes by Grunny () and Kangaroopower () */ ( function ( $, mw, window ) { 'use strict'; var ajaxIndicator = window.ajaxIndicator || ', ajaxTimer, refreshText = typeof window.AjaxRCRefreshText === 'string' ? window.AjaxRCRefreshText : 'AJAX', refreshHover = typeof window.AjaxRCRefreshHoverText === 'string' ? window.AjaxRCRefreshHoverText : 'Enable auto-refreshing page loads', ajRefresh = window.ajaxRefresh || 60000, ajPages = window.ajaxPages || [ 'Spezial:Letzte_Änderungen' ]; function storage( setTo ) { if ( localStorage.getItem( 'AjaxRC-refresh' ) === null ) { localStorage.setItem( 'AjaxRC-refresh', true ); } if ( setTo === false ) { localStorage.setItem( 'AjaxRC-refresh', false ); } else if ( setTo === true ) { localStorage.setItem( 'AjaxRC-refresh', true ); } return JSON.parse( localStorage.getItem( 'AjaxRC-refresh' ) ); } /** * Main function to start the Auto-refresh process * / function preloadAJAXRL() { var $appTo = ( $( '#WikiaPageHeader' ).length ) ? $( '#WikiaPageHeader' ) : ( $( '#AdminDashboardHeader' ).length ? $( '#AdminDashboardHeader > h1' ) : $( '.firstHeading' ) ); $appTo.append( ' ' + refreshText + ':' ); $( document ).ajaxSend( function ( event, xhr, settings ) { if ( location.href === settings.url ) { $( '#ajaxLoadProgress' ).show(); } } ).ajaxComplete ( function ( event, xhr, settings ) { var $collapsibleElements = $( '#mw-content-text' ).find( '.mw-collapsible' ), ajCallAgain = window.ajaxCallAgain || []; if ( location.href === settings.url ) { $( '#ajaxLoadProgress' ).hide(); for ( var i = 0; i < ajCallAgain.length; i++ ) { ajCallAgain[i](); } if ( $collapsibleElements.length ) { $collapsibleElements.makeCollapsible(); } if ( mw.config.get( 'wgNamespaceNumber' ) === -1 && mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Letzte_Änderungen' ) { mw.special.recentchanges.init(); if ( $( '.mw-recentchanges-table' ).find( '.WikiaDropdown' ).length ) { RecentChangesLocal.init(); } } if ( mw.config.get( 'wgNamespaceNumber' ) === -1 && mw.config.get( 'wgCanonicalSpecialPageName' ) === 'WikiActivity' ) { window.WikiActivity.init(); } } } ); $( '#ajaxToggle' ).click( toggleAjaxReload ); $( '#ajaxToggle' ).attr( 'checked', storage()); if ( storage() ) { loadPageData(); } } /** * Turn refresh on and off by toggling the checkbox * / function toggleAjaxReload() { if ( $( '#ajaxToggle' ).prop( 'checked' ) === true ) { storage( true ); loadPageData(); } else { storage( false ); clearTimeout( ajaxTimer ); } } /** * Does the actual refresh * / function loadPageData() {var $temp = $( ' ' ); $temp.load( location.href + " #mw-content-text", function () { var $newContent = $temp.children( '#mw-content-text' ); if ( $newContent.length ) { $( '#mw-content-text' ).replaceWith( $newContent ); } ajaxTimer = setTimeout( loadPageData, ajRefresh ); } ); } /** * Load the script on specific pages * Should we make it load only on view or just not on edit.... * / $( function () { if ( $.inArray( mw.config.get( 'wgPageName' ), ajPages ) !== -1 && $( '#ajaxToggle' ).length === 0 && mw.config.get( 'wgAction' ) !== 'edit' ) { preloadAJAXRL(); } } ); /** * Temp Hack: copy the RC filter JS since it can't be accessed * / var RecentChangesLocal = { init: function() { this.$table = $('.mw-recentchanges-table'); this.$dropdown = this.$table.find('.WikiaDropdown'); this.$submit = this.$table.find('input[type="submit"]'); this.$submit.on('click.RecentChangesDropdown', $.proxy(this.saveFilters, this)); this.$submit.removeAttr('disabled'); //FF clean this.dropdown = new Wikia.MultiSelectDropdown(this.$dropdown); this.dropdown.on('change', $.proxy(this.onChange, this)); }, saveFilters: function(event) { var self = this; event.preventDefault(); self.dropdown.disable(); self.$submit.attr('disabled', 'disabled'); if(self.dropdown.getSelectedValues().length == 0) { self.dropdown.doSelectAll(true); } $.nirvana.sendRequest({ controller: 'RecentChangesController', method: 'saveFilters', data: { filters: self.dropdown.getSelectedValues() }, type: 'POST', format: 'json', callback: function(data) { window.location.reload(); } }); } }; }( jQuery, mediaWiki, this ) ); en:AjaxRC/code.js Kategorie:Vorlagen
  • /* * ADVANCED AJAX AUTO-REFRESHING ARTICLES * Code originally by "pcj" of Wowpedia * Maintenance, cleanup, style and bug fixes by Grunny () and Kangaroopower () */ ( function ( $, mw, window ) { 'use strict'; var ajaxIndicator = window.ajaxIndicator || ', ajaxTimer, refreshText = typeof window.AjaxRCRefreshText === 'string' ? window.AjaxRCRefreshText : 'AJAX', refreshHover = typeof window.AjaxRCRefreshHoverText === 'string' ? window.AjaxRCRefreshHoverText : 'Enable auto-refreshing page loads', ajRefresh = window.ajaxRefresh || 60000, ajPages = window.ajaxPages || [ 'Special:RecentChanges' ]; function storage( setTo ) { if ( localStorage.getItem( 'AjaxRC-refresh' ) === null ) { localStorage.setItem( 'AjaxRC-refresh', true ); } if ( setTo === false ) { localStorage.setItem( 'AjaxRC-refresh', false ); } else if ( setTo === true ) { localStorage.setItem( 'AjaxRC-refresh', true ); } return JSON.parse( localStorage.getItem( 'AjaxRC-refresh' ) ); } /** * Main function to start the Auto-refresh process * / function preloadAJAXRL() { var $appTo = ( $( '#WikiaPageHeader' ).length ) ? $( '#WikiaPageHeader' ) : ( $( '#AdminDashboardHeader' ).length ? $( '#AdminDashboardHeader > h1' ) : $( '.firstHeading' ) ); $appTo.append( ' ' + refreshText + ':' ); $( document ).ajaxSend( function ( event, xhr, settings ) { if ( location.href === settings.url ) { $( '#ajaxLoadProgress' ).show(); } } ).ajaxComplete ( function ( event, xhr, settings ) { var $collapsibleElements = $( '#mw-content-text' ).find( '.mw-collapsible' ), ajCallAgain = window.ajaxCallAgain || []; if ( location.href === settings.url ) { $( '#ajaxLoadProgress' ).hide(); for ( var i = 0; i < ajCallAgain.length; i++ ) { ajCallAgain[i](); } if ( $collapsibleElements.length ) { $collapsibleElements.makeCollapsible(); } if ( mw.config.get( 'wgNamespaceNumber' ) === -1 && mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Recentchanges' ) { mw.special.recentchanges.init(); if ( $( '.mw-recentchanges-table' ).find( '.WikiaDropdown' ).length ) { RecentChangesLocal.init(); } } if ( mw.config.get( 'wgNamespaceNumber' ) === -1 && mw.config.get( 'wgCanonicalSpecialPageName' ) === 'WikiActivity' ) { window.WikiActivity.init(); } } } ); $( '#ajaxToggle' ).click( toggleAjaxReload ); $( '#ajaxToggle' ).attr( 'checked', storage()); if ( storage() ) { loadPageData(); } } /** * Turn refresh on and off by toggling the checkbox * / function toggleAjaxReload() { if ( $( '#ajaxToggle' ).prop( 'checked' ) === true ) { storage( true ); loadPageData(); } else { storage( false ); clearTimeout( ajaxTimer ); } } /** * Does the actual refresh * / function loadPageData() {var $temp = $( ' ' ); $temp.load( location.href + " #mw-content-text", function () { var $newContent = $temp.children( '#mw-content-text' ); if ( $newContent.length ) { $( '#mw-content-text' ).replaceWith( $newContent ); } ajaxTimer = setTimeout( loadPageData, ajRefresh ); } ); } /** * Load the script on specific pages * Should we make it load only on view or just not on edit.... * / $( function () { if ( $.inArray( mw.config.get( 'wgPageName' ), ajPages ) !== -1 && $( '#ajaxToggle' ).length === 0 && mw.config.get( 'wgAction' ) !== 'edit' ) { preloadAJAXRL(); } } ); /** * Temp Hack: copy the RC filter JS since it can't be accessed * / var RecentChangesLocal = { init: function() { this.$table = $('.mw-recentchanges-table'); this.$dropdown = this.$table.find('.WikiaDropdown'); this.$submit = this.$table.find('input[type="submit"]'); this.$submit.on('click.RecentChangesDropdown', $.proxy(this.saveFilters, this)); this.$submit.removeAttr('disabled'); //FF clean this.dropdown = new Wikia.MultiSelectDropdown(this.$dropdown); this.dropdown.on('change', $.proxy(this.onChange, this)); }, saveFilters: function(event) { var self = this; event.preventDefault(); self.dropdown.disable(); self.$submit.attr('disabled', 'disabled'); if(self.dropdown.getSelectedValues().length == 0) { self.dropdown.doSelectAll(true); } $.nirvana.sendRequest({ controller: 'RecentChangesController', method: 'saveFilters', data: { filters: self.dropdown.getSelectedValues() }, type: 'POST', format: 'json', callback: function(data) { window.location.reload(); } }); } }; }( jQuery, mediaWiki, this ) );
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software