diff --git a/airtime_mvc/application/Bootstrap.php b/airtime_mvc/application/Bootstrap.php
index df1ab8475..62679c8b0 100644
--- a/airtime_mvc/application/Bootstrap.php
+++ b/airtime_mvc/application/Bootstrap.php
@@ -117,7 +117,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
$view->headScript()->appendFile($baseUrl.'/js/airtime/dashboard/helperfunctions.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/airtime/dashboard/dashboard.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/airtime/dashboard/versiontooltip.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
- $view->headScript()->appendFile($baseUrl.'/js/tipsy/jquery.tipsy.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
+ $view->headScript()->appendFile($baseUrl.'/js/tipsy/jquery.tipsy.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/airtime/common/common.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/airtime/common/audioplaytest.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
diff --git a/airtime_mvc/public/css/tipsy/jquery.tipsy.css b/airtime_mvc/public/css/tipsy/jquery.tipsy.css
index 836b6e69d..35136464b 100644
--- a/airtime_mvc/public/css/tipsy/jquery.tipsy.css
+++ b/airtime_mvc/public/css/tipsy/jquery.tipsy.css
@@ -1,4 +1,4 @@
-.tipsy { font-size: 10px; position: absolute; padding: 5px; z-index: 100000; width: auto }
+.tipsy { font-size: 11px; position: absolute; padding: 5px; z-index: 100000; width: auto }
.tipsy-inner { background-color: #000; color: #FFF; max-width: 300px; padding: 5px 8px 4px 5px; }
/* Rounded corners */
diff --git a/airtime_mvc/public/js/airtime/user/user.js b/airtime_mvc/public/js/airtime/user/user.js
index 35d4e16dd..3fff79ef6 100644
--- a/airtime_mvc/public/js/airtime/user/user.js
+++ b/airtime_mvc/public/js/airtime/user/user.js
@@ -94,8 +94,82 @@ function populateUserTable() {
$(document).ready(function() {
populateUserTable();
+
+ //assign user-rights and id to each user type option so we can
+ //display user rights for each with tipsy tooltip
+ $.each($('#type').children(), function(i, opt) {
+ switch ($(this).val()) {
+ case 'G':
+ $(this).attr('id', 'user-type-G');
+ $(this).attr('user-rights',
+ $.i18n._('Guests can do the following:')+'
'+
+ $.i18n._('View schedule')+'
'+
+ $.i18n._('View current playing tracks')
+ );
+ break;
+ case 'H':
+ $(this).attr('id', 'user-type-H');
+ $(this).attr('user-rights',
+ $.i18n._('DJs can do the following:')+'
'+
+ $.i18n._('View schedule')+'
'+
+ $.i18n._('View current playing tracks')+'
'+
+ $.i18n._('Manage assigned show content')+'
'+
+ $.i18n._('Import media files')+'
'+
+ $.i18n._('Manage their own library content')+'
'+
+ $.i18n._('Create playlists, smart blocks, and webstreams')
+ );
+ break;
+ case 'P':
+ $(this).attr('id', 'user-type-P');
+ $(this).attr('user-rights',
+ $.i18n._('Progam Managers can do the following:')+'
'+
+ $.i18n._('View schedule')+'
'+
+ $.i18n._('Schedule shows')+'
'+
+ $.i18n._('Import media files')+'
'+
+ $.i18n._('Manage all library content')+'
'+
+ $.i18n._('Create playlists, smart blocks, and webstreams')+'
'+
+ $.i18n._('Manage show content')
+ );
+ break;
+ case 'A':
+ $(this).attr('id', 'user-type-A');
+ $(this).attr('user-rights',
+ $.i18n._('Admins can do the following:')+'
'+
+ $.i18n._('Manage preferences')+'
'+
+ $.i18n._('Manage users')+'
'+
+ $.i18n._('Manage watched folders')+'
'+
+ $.i18n._('Send support feedback')+'
'+
+ $.i18n._('View system status')+'
'+
+ $.i18n._('Access playout history')+'
'+
+ $.i18n._('View listener stats')+'
'+
+ $.i18n._('View schedule')+'
'+
+ $.i18n._('Schedule shows')+'
'+
+ $.i18n._('Import media files')+'
'+
+ $.i18n._('Manage all library content')+'
'+
+ $.i18n._('Create playlists, smart blocks, and webstreams')+'
'+
+ $.i18n._('Manage show content')
+ );
+ break;
+ }
+ });
+
+ $('#type').live("change", function(){
+ //when the title changes on live tipsy tooltips the changes take
+ //affect the next time tipsy is shown so we need to hide and re-show it
+ $(this).tipsy('hide').tipsy('show');
+ });
- //$('#user_details').hide();
+ $('#type').tipsy({
+ gravity: 'w',
+ html: true,
+ trigger: 'manual',
+ live: true,
+ title: function() {
+ return $('#user-type-'+$(this).val()).attr('user-rights');
+ }
+ });
+
+ $('#type').tipsy('show');
var newUser = {login:"", first_name:"", last_name:"", type:"G", id:""};
diff --git a/airtime_mvc/public/js/tipsy/AIRTIME_DEV_README b/airtime_mvc/public/js/tipsy/AIRTIME_DEV_README
new file mode 100644
index 000000000..72ec196c4
--- /dev/null
+++ b/airtime_mvc/public/js/tipsy/AIRTIME_DEV_README
@@ -0,0 +1,23 @@
+Before overwriting jquery.tipsy.js, please note we have changed a few lines to
+support manual triggering with live tipsy tooltips
+
+
+denise@denise-DX4860:~/airtime/airtime_mvc/public/js/tipsy$ diff -u jquery.tipsy_orig.js jquery.tipsy.js
+--- jquery.tipsy_orig.js 2012-12-13 12:03:48.780751104 -0500
++++ jquery.tipsy.js 2012-12-13 12:08:15.564761493 -0500
+@@ -173,12 +173,10 @@
+
+ if (!options.live) this.each(function() { get(this); });
+
+- if (options.trigger != 'manual') {
+- var binder = options.live ? 'live' : 'bind',
+- eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus',
+- eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur';
+- this[binder](eventIn, enter)[binder](eventOut, leave);
+- }
++ var binder = options.live ? 'live' : 'bind',
++ eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus',
++ eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur';
++ this[binder](eventIn, enter)[binder](eventOut, leave);
+
+ return this;
diff --git a/airtime_mvc/public/js/tipsy/jquery.tipsy.js b/airtime_mvc/public/js/tipsy/jquery.tipsy.js
index e0643f82e..0aeadb65f 100644
--- a/airtime_mvc/public/js/tipsy/jquery.tipsy.js
+++ b/airtime_mvc/public/js/tipsy/jquery.tipsy.js
@@ -173,12 +173,10 @@
if (!options.live) this.each(function() { get(this); });
- if (options.trigger != 'manual') {
- var binder = options.live ? 'live' : 'bind',
- eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus',
- eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur';
- this[binder](eventIn, enter)[binder](eventOut, leave);
- }
+ var binder = options.live ? 'live' : 'bind',
+ eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus',
+ eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur';
+ this[binder](eventIn, enter)[binder](eventOut, leave);
return this;
diff --git a/airtime_mvc/public/js/tipsy/jquery.tipsy.min.js b/airtime_mvc/public/js/tipsy/jquery.tipsy.min.js
deleted file mode 100644
index 0cf2b2598..000000000
--- a/airtime_mvc/public/js/tipsy/jquery.tipsy.min.js
+++ /dev/null
@@ -1 +0,0 @@
-(function(e){function t(e,t){return typeof e=="function"?e.call(t):e}function n(e){while(e=e.parentNode){if(e==document)return true}return false}function r(t,n){this.$element=e(t);this.options=n;this.enabled=true;this.fixTitle()}r.prototype={show:function(){var n=this.getTitle();if(n&&this.enabled){var r=this.tip();r.find(".tipsy-inner")[this.options.html?"html":"text"](n);r[0].className="tipsy";r.remove().css({top:0,left:0,visibility:"hidden",display:"block"}).prependTo(document.body);var i=e.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight});var s=r[0].offsetWidth,o=r[0].offsetHeight,u=t(this.options.gravity,this.$element[0]);var a;switch(u.charAt(0)){case"n":a={top:i.top+i.height+this.options.offset,left:i.left+i.width/2-s/2};break;case"s":a={top:i.top-o-this.options.offset,left:i.left+i.width/2-s/2};break;case"e":a={top:i.top+i.height/2-o/2,left:i.left-s-this.options.offset};break;case"w":a={top:i.top+i.height/2-o/2,left:i.left+i.width+this.options.offset};break}if(u.length==2){if(u.charAt(1)=="w"){a.left=i.left+i.width/2-15}else{a.left=i.left+i.width/2-s+15}}r.css(a).addClass("tipsy-"+u);r.find(".tipsy-arrow")[0].className="tipsy-arrow tipsy-arrow-"+u.charAt(0);if(this.options.className){r.addClass(t(this.options.className,this.$element[0]))}if(this.options.fade){r.stop().css({opacity:0,display:"block",visibility:"visible"}).animate({opacity:this.options.opacity})}else{r.css({visibility:"visible",opacity:this.options.opacity})}}},hide:function(){if(this.options.fade){this.tip().stop().fadeOut(function(){e(this).remove()})}else{this.tip().remove()}},fixTitle:function(){var e=this.$element;if(e.attr("title")||typeof e.attr("original-title")!="string"){e.attr("original-title",e.attr("title")||"").removeAttr("title")}},getTitle:function(){var e,t=this.$element,n=this.options;this.fixTitle();var e,n=this.options;if(typeof n.title=="string"){e=t.attr(n.title=="title"?"original-title":n.title)}else if(typeof n.title=="function"){e=n.title.call(t[0])}e=(""+e).replace(/(^\s*|\s*$)/,"");return e||n.fallback},tip:function(){if(!this.$tip){this.$tip=e('