CommunityBar

From EducOO.org
Revision as of 17:30, 17 September 2011 by Benbois (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Community Bar


Contents

History

Inspiration

TODO

  • fix incompatibility with WP 3.2.1
  • change mouse comportment on the button (mouse over instead of click on)

Changelog

  • 20110917
- fixed compatibility with jQuery 1.6.x now working with WP v3.2.x
  • 20110730
- fixed community bar width
- modified Campus Libre icon
  • 2011.03.02
- fixed CSS styles incompatibility with WP theme
- removed flicker effect in starting up
  • 2011.01.21
- created the EducOOoCommunityBar extension for easy implementation in Mediawiki
- fixed the Show button position (add 4/5px to the right) due adding a right/left padding on the bar
  • 2011.01.07
- added a check of the edit mode for the wiki systems only. If it's edit mode, do not show the bar
- changed the IE detection to the jQuery way and fixed some bugs with IE6/IE7
/* IE6 + IE7 detection method */
if ( $.browser.msie ) {
	var ie = parseInt(jQuery.browser.version);
}
  • 2010.12.16
- fixed show/hide button position even during resizing window operation
jQuery("#jx-uhid-con-id").css({
	"margin-left": (centerScreen + (jQuery(obj).width()/2) + 6) - jQuery("#jx-uhid-con-id").width()
});
  • 2010.12.11
- switched all $ referencies to JQuery chain to prevent conflict with other framework (jquery.jixedbar.js)
- started to add opacity effect for the bar (to finish)
  • 2010.12.10
- added animation on the "Show" button during lauching (jquery.jixedbar.js):
// check if we need to hide the show/unhide button (based on cookie)
if (!this.hideBar) {
	$("#jx-uhid-con-id").css({
	"display": "none" // do not display the show/unhide button
	});
}
else{
	$("#jx-uhid-con-id").hide();
	$("#jx-uhid-con-id").slideToggle();
}
- fixed cookie bug to save the state of the bar (hide/show) - jquery.jixedbar.js:
replaced all:
if ($(this).checkCookie("JXID")) {
by
if($(this).readCookie("JXID") != "null") {
- added a new link www.educoo.tw in Locales menu
- added a new theme, more stylised
  • 2010.12.07
- added animation during the bar lauching (jquery.jixedbar.js)
  • 2010.12.06
- added extraBarFixFlash() to fix the wmode of Flash animations (ext-bar.js) - source: http://css-tricks.com/snippets/jquery/change-wmode-with-jquery/
- hanged the document size reference to fix initial position of the bar (jquery.jixedbar.js):
var screen=jQuery(window);
instead of
var screen=jQuery(this);
thanks to Marina for the test and bug report
- added icons for web / wiki / blog / XO / about and arrows: up / down / hide / show
- made some style changes
  • 2010.12.05
- added first icons
- added CSS hack to work in few environments like mediawiki, wordpress or drupal
  • 2010.12.04
- initial release
- created ext-bar.js to be the only script to call with the new functions: extraBarGetScript() and extraBarLoad()

Installation

Chamilo 1.8.x

  • open the footer file : main/inc/footer.inc.php
  • go to the end of the file
  • insert before the </body> tag:
<!-- Extra-bar for EducOOo community links -->
<script language="javascript" type="text/javascript" src="http://extbar.educoo.org/ext-bar.js"></script>

Standard website

  • open the home page (ex. index.html)
  • add this lines BEFORE </body>
<!-- Extra-bar for EducOOo community links -->
<script language="javascript" type="text/javascript" src="http://extbar.educoo.org/ext-bar.js"></script>
  • save the file

Drupal

  • open drupal/themse/your-theme/template.php
  • add after line 11 (get_drupal_version() checking):
$external_js = 'http://extbar.educoo.org/ext-bar.js';
drupal_add_js('document.write(unescape("%3Cscript src=\''. $external_js . '\' type=\'text/javascript\'%3E%3C/script%3E"));', 'inline', 'footer', false, false);
  • save the file

Mediawiki

MW extension

require_once("$IP/extensions/EducOOoCommunityBar/EducOOoCommunityBar.php");
  • EducOOoCommunityBar.php source:
<?php
/*
 * EducOOoCommunityBar
 * @authors Benjamin Bois
 * @version 0.1
 * @copyright OSI
 * @license The MIT License - http://www.opensource.org/licenses/mit-license.php 
 * -----------------------------------------------------------------------
 * Description:
 *     Helps administrator to add  the EducOOo Community Bar to a mediawiki.
 * Requirements:
 *     MediaWiki 1.6+
 * Installation:
 *     nothing
 */
 
// Confirm MW environment
if (defined('MEDIAWIKI')) {
 
	// OPTIONS
	$js_url = "http://extbar.educoo.org/ext-bar.js"; // URL of the community bar script
 
	// Version
	define('EDUCOOO_COMMUNITY_BAR_VERSION','0.1');
 
	// Credits
	$wgExtensionCredits['parserhook'][] = array(
		'name'=>'EducOOoCommunityBar',
		'author'=>'Benjamin Bois',
		'url'=>'http://wiki.educoo.org/index.php/CommunityBar#Mediawiki',
		'description'=>'Helps administrator to add  the EducOOo Community Bar to a mediawiki.',
		'version'=>EDUCOOO_COMMUNITY_BAR_VERSION
	);

 	// Check if the page is an action page
 	function is_action(){
		if(isset($_GET[action])){
			return true;
		}
		else{
			return false;
		}
	}
  
	// Load external JavaScript before closing </body> tag
	if(is_action()===false){
		$wgHooks['SkinAfterBottomScripts'][] = 'community_bar_script_call';
	}
 
	function community_bar_script_call($skin, &$text='') {
		global $js_url;
		$text .= '<script type="text/javascript" src="' . $js_url . '"></script>';
		return true;
	}

} // Closing MW Environment wrapper


old insert - not recommended!

  • open wiki/skins/Vector.php (default skin name choosed for the wiki)
  • search for the chain "</body>" (around line 560 for the Vector skin) and add this lines:
		<!-- Extra-bar for EducOOo community links -->
		<?php if($_GET[action]!='edit'): ?>
		<script language="javascript" type="text/javascript" src="http://extbar.educoo.org/ext-bar.js"></script>
		<?php endif; ?>
  • save the file

WordPress

  • go to the admin part
  • Apparence > Editor
  • Select on the right of the window, footer.php and add this lines BEFORE </body>
<!-- Extra-bar for EducOOo community links -->
<script language="javascript" type="text/javascript" src="http://extbar.educoo.org/ext-bar.js"></script>
  • save the changes
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox