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!).

Comments (0)

Files changed (6)

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",
Add a comment to this file

images/projectavatar.png

Removed
Old image
Add a comment to this file

images/projector-mode.gif

Removed
Old image
Add a comment to this file

images/projector-mode.png

Removed
Old image

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(); });
 });

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}
 ]
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.