Forums | Mahara Community

Developers /
Plugin to share the page on twitter, facebook, evernote


anonymous profile picture
Account deleted
Posts: 808

03 May 2011, 21:34

Hi Marielle,

Part of Evan's gallery plugin is already merged, but only the part that displays images from your files area, not the flickr part.  It *does* use jquery.  You can find it in htdocs/artefact/file/blocktype/gallery.  Gregor has modified it to display flickr & picasa images, and to use a better slideshow viewer.

anonymous profile picture
Account deleted
Posts: 30

04 May 2011, 5:54

Found it, thanks.

These plugins use jQuery but they really are not written as jQuery plugins. I had seen mention of the $j convention in another discussion. But I am not clear about the motivation for adopting yet a a different convention. The recommendation is to use jQuery instead when in noconflict mode. Introducing a Mahara specifc prefix makes it a lot more difficult to reuse plugins already available in the community. 

 If plugins are written using the plugin boilerplate, then you need to use the jQuery reference once only and are free to use whatever you want within the plugin private scope.

This will work perfectly fine in noConflict mode: 

(function($) {  $.fn.pluginName = function(options) {};})(jQuery);

 


 

Concrete example, with a Mahara implementation of an flickr Feed jQuery plugin available under MIT, with source  code. Screenshot:

flickr plugin for Mahara

All I have done is provide write a Mahara plugin for a jQuery plugin written by Joel Sutherland. No change to the jQuery plugin itself was required. 

For demonstration only, at this stage. This is a very simple Mahara plugin, good to learn the plugin basics.  Feel free to adapt. 

 


 

To answer my original question, the function to use, to get the javascript file added to the document header is:

public static function get_instance_javascript(BlockInstance $instance) {
	return array('js/jflickrfeed.min.js');            
}

The version of  jQuery distributed with Mahara 1.4 is jQuery 1.3.2.

Thanks for all the replies and helpful tidbits of information. 

anonymous profile picture
Account deleted
Posts: 131

10 May 2011, 7:18

Thanks for this Marielle.

Can I clarify before I start tweaking this, has Gregor also adapted the Image Gallery plugin to include Flickr streams? It might be nice to do everything in one plugin, though there are arguments for having separate Flickr, Twitter, etc. plugins too. I see mention of a plugin by Gregor but can't find it anywhere.

Mike

Gregor Anželj's profile picture
Posts: 349

10 May 2011, 7:51

You can't find it, because it sin't fully ready.

You can test it at http://mahara.ledina.org/DEV/ with username test, password test140test.

Just login, create new view, and add Gallery blocktype. There select 'External gallery' and pase link to Flickr, Picasa, ... gallery into textarea box.

Regards,
Gregor

anonymous profile picture
Account deleted
Posts: 131
anonymous profile picture
Account deleted
Posts: 30

03 May 2011, 19:06

In these Mahara Meeting notes:

"if you have any other ideas (after this meeting) about how we can remove barriers to contribution and further empower developers"

Yup. That's the sense of my questions. Wink

 

Ruslan Kabalin's profile picture
Posts: 146

03 May 2011, 9:39

There was a discussion about adding header modification methods to Mahara few month ago. I did not have a chance to implement that though. Hopefully soon Mahara will have that functionality Wink

17 results