Commits

Mike Cannon-Brookes committed 93b5043

Version 2. Fixed ordering of curtains code. Fixed bug in 4.0. Removed web item icons (which suddenly started working!).

  • Participants
  • Parent commits fda8336
  • Tags 2_0

Comments (0)

Files changed (6)

File atlassian-extension.json

 	"key": 			"projector-mode",
 	"name":			"Projector Mode",
 	"description":	"View Confluence pages on a projector!",
-	"version":		"1",
+	"version":		"2",
 	
 	"vendor": {	"name": "Mike Cannon-Brookes",
 			     "url": "http://example.com/extension-homepage.html",

File images/projectavatar.png

Removed
Old image

File images/projector-mode.gif

Removed
Old image

File images/projector-mode.png

Removed
Old image

File js/projector-mode/main.js

  * @context page, blogpost
  */
 var $ = require('speakeasy/jquery').jQuery;
-var curtainImg = require('speakeasy/resources').getImageUrl(module, 'frontcurtain.jpg');
 var projectorMode = false;
 
 function goProjectorMode() {
 
 		increase(jQuery('.wiki-content li, .wiki-content p, .wiki-content td, .wiki-content th, .wiki-content .code'), 1.5, 1.5);
 		
-		console.log('Can\'t find curtains? ' + curtainImg)
-/*		var curtainImg = 'http://dl.dropbox.com/u/48692/frontcurtain.jpg';*/
-		jQuery('.wiki-content').append('<div class="leftcurtain"><img src="' + curtainImg + '"/></div><div class="rightcurtain"><img src="' + curtainImg + '"/></div>');
 	}
 }
 
 function undoProjectorMode() {
 	if (projectorMode)
 	{
+		var curtainImg = require('speakeasy/resources').getImageUrl(module, 'frontcurtain.jpg');
+		console.log('Can\'t find curtains? ' + curtainImg)
+/*		var curtainImg = 'http://dl.dropbox.com/u/48692/frontcurtain.jpg';*/
+		jQuery('.wiki-content').append('<div class="leftcurtain"><img src="' + curtainImg + '"/></div><div class="rightcurtain"><img src="' + curtainImg + '"/></div>');
+
 		jQuery(".leftcurtain").stop().animate({width:'50%'}, 2000 );
 		jQuery(".rightcurtain").stop().animate({width:'51%'}, 2000 );
 		window.setInterval(function () {
 			window.location.reload();
 		}, 5000);
-//		jQuery("#main").fadeOut(1000);
 	}
 }
 
 $(document).ready(function() {
-	$('.projector-mode-web-item').click(function() { goProjectorMode(); });
+	$('.projector-mode-web-item').click(function(e) { e.preventDefault(); goProjectorMode(); });
 	AJS.whenIType("shift+x").execute(function() { goProjectorMode(); });
 	AJS.whenIType("esc").execute(function() { undoProjectorMode(); });
 });

File ui/web-items.json

         "url"     : "javascript: return false;",
         "cssName" : "projector-mode-web-item",
 		"tooltip" : "Enter Projector Mode ( type 'shift+x' )",
-		"icon"	  : { 
-			"height" : 16,
-			"width"  : 16,
-			"link"   : "http://kimkelln.com/SlideProjector.gif"
-		},
         "weight"  : 40}
 ]