2 * Description: PresView plugin
3 * Copyright (c) 2012 UPMC Sorbonne Universite
8 * It's a best practice to pass jQuery to an IIFE (Immediately Invoked Function
9 * Expression) that maps it to the dollar sign so it can't be overwritten by
10 * another library in the scope of its execution.
15 var PLUGIN_NAME = 'PresView';
18 jQuery.fn.PresView = function( method ) {
19 if ( methods[method] ) {
20 return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
21 } else if ( typeof method === 'object' || ! method ) {
22 return methods.init.apply( this, arguments );
24 jQuery.error( 'Method ' + method + ' does not exist on jQuery.' + PLUGIN_NAME );
28 /***************************************************************************
30 ***************************************************************************/
35 * @brief Plugin initialization
36 * @param options : an associative array of setting values
37 * @return : a jQuery collection of objects on which the plugin is
38 * applied, which allows to maintain chainability of calls
40 init : function ( options ) {
42 return this.each(function() {
46 /* An object that will hold private variables and methods */
47 var plugin = new PresView(options);
48 $this.data('Manifold', plugin);
51 $this.on('show.' + PLUGIN_NAME, methods.show);
57 * @brief Plugin destruction
58 * @return : a jQuery collection of objects on which the plugin is
59 * applied, which allows to maintain chainability of calls
61 destroy : function( ) {
63 return this.each(function() {
65 var plugin = $this.data('Manifold');
67 // Unbind all events using namespacing
68 $(window).unbind(PLUGIN_NAME);
70 // Remove associated data
72 $this.removeData('Manifold');
77 google.maps.event.trigger(map, 'resize');
82 /***************************************************************************
84 ***************************************************************************/
86 function PresView(options)
89 /* member variables */
90 this.options = options;
97 this.initialize = function() {
99 j = jQuery.noConflict();
101 j.getScript('/all-static/js/config.js');
104 j(".datepicker").datepicker({
105 showOtherMonths: true,
106 selectOtherMonths: true,
107 showAnim: 'slideDown',
109 dateFormat: 'dd/mm/yy',
114 j("#accordion").accordion({
115 animated: 'easeslide',
121 j("#interval_animation").slider({
129 // http://www.alessioatzeni.com/blog/simple-tooltip-with-jquery-only-text/
131 j('.masterTooltip').hover(function(){
133 var title = j('#interval_animation').attr('title');
134 j('#interval_animation').data('tipText', title).removeAttr('title');
135 j('<p class="tooltip"></p>')
141 j('#interval_animation').attr('title', j('#interval_animation').data('tipText'));
142 j('.tooltip').remove();
143 }).mousemove(function(e) {
144 var mousex = e.pageX + 20; //Get X coordinates
145 var mousey = e.pageY + 10; //Get Y coordinates
147 .css({ top: mousey, left: mousex })
156 } // function PresView