+++ /dev/null
-/* CSS StyleSheet for EditSectionHiliteLink extensions */
-
-div.edit_section_hilite {
- background-color:Lavender;
-}
\ No newline at end of file
+++ /dev/null
-<?php
-/**
- * Hooks for EditSectionHiliteLink extension
- *
- * @file
- * @ingroup Extensions
- */
-
-class EditSectionHiliteLinkHooks {
-
- /* Static Functions */
-
- /**
- * interceptLink hook
- */
- public static function interceptLink($this, $nt, $section, $tooltip, &$result) {
- global $wgSectionContainers;
-
- if ( $wgSectionContainers ) {
- $section = $section -1;
- $section_name = 'section_' . $section . '_container';
- $result = preg_replace('/(\D+)( title=)(\D+)/', '${1} onmouseover="editSectionHiliteOn(\'' . $section_name . '\')" onmouseout="editSectionHiliteOff(\'' . $section_name . '\')" title=$3', $result);
- }
- return true;
- }
-
- /**
- * AjaxAddScript hook
- * Add ajax support script
- */
- public static function addJS(
- $out
- ) {
- global $wgScriptPath, $wgJsMimeType, $wgEditSectionHiliteLinkStyleVersion;
- // FIXME: assumes standard dir structure
- // Add javascript to support section edit link highlighting saving
- $out->addScript(
- Xml::element(
- 'script',
- array(
- 'type' => $wgJsMimeType,
- 'src' => $wgScriptPath . '/extensions/EditSectionHiliteLink/EditSectionHiliteLink.js?' .
- $wgEditSectionHiliteLinkStyleVersion
- ),
- '',
- false
- )
- );
- // Continue
- return true;
- }
-
- /**
- * BeforePageDisplay hook
- * Add css style sheet
- */
- public static function addCSS(
- $out
- ) {
- global $wgScriptPath, $wgEditSectionHiliteLinkStyleVersion;
- // FIXME: assumes standard dir structure
- // Add css for various styles
- $out->addLink(
- array(
- 'rel' => 'stylesheet',
- 'type' => 'text/css',
- 'href' => $wgScriptPath . '/extensions/EditSectionHiliteLink/EditSectionHiliteLink.css?' .
- $wgEditSectionHiliteLinkStyleVersion,
- )
- );
- // Continue
- return true;
- }
-}
+++ /dev/null
-/* JavaScript for Drafts extension */
-
-function editSectionHiliteOn (sectionID) {
- document.getElementById(sectionID).className = 'edit_section_hilite';
-}
-
-function editSectionHiliteOff (sectionID) {
- document.getElementById(sectionID).className = '';
-}
\ No newline at end of file
+++ /dev/null
-<?php
-/**
- * EditSectionHiliteLink extension
- *
- * @file
- * @ingroup Extensions
- *
- * This file contains the main include file for the EditSectionHiliteLink extension of
- * MediaWiki.
- *
- * Usage: Add the following line in LocalSettings.php:
- * require_once( "$IP/extensions/EditSectionHiliteLink/EditSectionHiliteLink.php" );
- *
- * @author Arash Boostani <aboostani@wikimedia.org>
- * @license GPL v2
- * @version 0.1.0
- */
-
-// Check environment
-if ( !defined( 'MEDIAWIKI' ) ) {
- echo( "This is an extension to MediaWiki and cannot be run standalone.\n" );
- die( - 1 );
-}
-
-/* Configuration */
-
-// Credits
-$wgExtensionCredits['other'][] = array(
- 'path' => __FILE__,
- 'name' => 'EditSectionHiliteLink',
- 'author' => 'Arash Boostani',
- 'url' => 'http://www.mediawiki.org/wiki/Extension:EditSectionHiliteLink',
- 'description' => 'Hilight the appropriate section of an article when you mouse over the edit link',
- 'description-msg' => 'EditSectionHiliteLink-desc',
-);
-
-// Turn on the section container divs in the Parser
-$wgSectionContainers = true;
-
-// Shortcut to this extension directory
-$dir = dirname( __FILE__ ) . '/';
-
-# Bump the version number every time you change any of the .css/.js files
-$wgEditSectionHiliteLinkStyleVersion = 2;
-
-$wgAutoloadClasses['EditSectionHiliteLinkHooks'] = $dir . 'EditSectionHiliteLink.hooks.php';
-
-// Register edit link interception
-$wgHooks['DoEditSectionLink'][] = 'EditSectionHiliteLinkHooks::interceptLink';
-
-// Register ajax add script hook
-$wgHooks['AjaxAddScript'][] = 'EditSectionHiliteLinkHooks::addJS';
-
-// Register css add script hook
-$wgHooks['BeforePageDisplay'][] = 'EditSectionHiliteLinkHooks::addCSS';
-
-?>
\ No newline at end of file