From 9d09ae3c2d086fdf0d210b132d1cb23a1abea704 Mon Sep 17 00:00:00 2001 From: Igoru Date: Tue, 1 May 2012 04:15:31 -0300 Subject: [PATCH] + adding admin.js + adding jQuery tooltip plugin + using tooltip under everything .tooltip inside admin --- admin/views/layouts/_header_nav.haml | 4 ++-- admin/views/memes/index.haml | 2 +- public/admin/javascripts/admin.js | 8 ++++++++ public/javascripts/jquery.tooltip.js | 15 +++++++++++++++ public/stylesheets/jquery.tooltip.css | 11 +++++++++++ 5 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 public/admin/javascripts/admin.js create mode 100644 public/javascripts/jquery.tooltip.js create mode 100644 public/stylesheets/jquery.tooltip.css diff --git a/admin/views/layouts/_header_nav.haml b/admin/views/layouts/_header_nav.haml index d010e9e..e3215dc 100644 --- a/admin/views/layouts/_header_nav.haml +++ b/admin/views/layouts/_header_nav.haml @@ -4,7 +4,7 @@ %head %meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type"} %title MemeLinks Admin - =stylesheet_link_tag '/stylesheets/admin/base', '/stylesheets/admin/themes/warehouse-bec/style' + =stylesheet_link_tag '/stylesheets/jquery.tooltip', '/stylesheets/admin/base', '/stylesheets/admin/themes/warehouse-bec/style' =yield_content :other_css %body #container @@ -23,5 +23,5 @@ .flash=[:error, :warning, :notice].map { |type| flash_tag(type, :class => "message #{type}") }.join =yield_content :content - =javascript_include_tag '/javascripts/jquery', '/javascripts/jquery-ujs' + =javascript_include_tag '/javascripts/jquery', '/javascripts/jquery-ujs', '/javascripts/jquery.tooltip', '/admin/javascripts/admin' =yield_content :other_js \ No newline at end of file diff --git a/admin/views/memes/index.haml b/admin/views/memes/index.haml index 8e5fc5c..3c37340 100644 --- a/admin/views/memes/index.haml +++ b/admin/views/memes/index.haml @@ -39,7 +39,7 @@ %tr %td -unless meme.ip_user_creator.nil? - =image_tag '/images/icons/light-bulb.png', :title => meme.ip_user_creator + %img.tooltip{:src =>'/images/icons/light-bulb.png', :title => meme.ip_user_creator} %td=link_to meme.name, '/'+meme.filename %td=meme.slug %td=meme.all_views_count.to_s+' / '+meme.external_count.to_s diff --git a/public/admin/javascripts/admin.js b/public/admin/javascripts/admin.js new file mode 100644 index 0000000..2a8dda8 --- /dev/null +++ b/public/admin/javascripts/admin.js @@ -0,0 +1,8 @@ +$(document).ready(function() { + $('.tooltip').tooltip({ + showURL: false, + track: true, + delay: 0, + fade: 100 + }) +}) \ No newline at end of file diff --git a/public/javascripts/jquery.tooltip.js b/public/javascripts/jquery.tooltip.js new file mode 100644 index 0000000..be619ef --- /dev/null +++ b/public/javascripts/jquery.tooltip.js @@ -0,0 +1,15 @@ +/* + * jQuery Tooltip plugin 1.3 + * + * http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/ + * http://docs.jquery.com/Plugins/Tooltip + * + * Copyright (c) 2006 - 2008 Jörn Zaefferer + * + * $Id: jquery.tooltip.js 5741 2008-06-21 15:22:16Z joern.zaefferer $ + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ +eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';(8($){j e={},9,m,B,A=$.2u.2g&&/29\\s(5\\.5|6\\.)/.1M(1H.2t),M=12;$.k={w:12,1h:{Z:25,r:12,1d:19,X:"",G:15,E:15,16:"k"},2s:8(){$.k.w=!$.k.w}};$.N.1v({k:8(a){a=$.1v({},$.k.1h,a);1q(a);g 2.F(8(){$.1j(2,"k",a);2.11=e.3.n("1g");2.13=2.m;$(2).24("m");2.22=""}).21(1e).1U(q).1S(q)},H:A?8(){g 2.F(8(){j b=$(2).n(\'Y\');4(b.1J(/^o\\(["\']?(.*\\.1I)["\']?\\)$/i)){b=1F.$1;$(2).n({\'Y\':\'1D\',\'1B\':"2r:2q.2m.2l(2j=19, 2i=2h, 1p=\'"+b+"\')"}).F(8(){j a=$(2).n(\'1o\');4(a!=\'2f\'&&a!=\'1u\')$(2).n(\'1o\',\'1u\')})}})}:8(){g 2},1l:A?8(){g 2.F(8(){$(2).n({\'1B\':\'\',Y:\'\'})})}:8(){g 2},1x:8(){g 2.F(8(){$(2)[$(2).D()?"l":"q"]()})},o:8(){g 2.1k(\'28\')||2.1k(\'1p\')}});8 1q(a){4(e.3)g;e.3=$(\'<10>\').27(K.f).q();4($.N.L)e.3.L();e.m=$(\'10\',e.3);e.f=$(\'t.f\',e.3);e.o=$(\'t.o\',e.3)}8 7(a){g $.1j(a,"k")}8 1f(a){4(7(2).Z)B=26(l,7(2).Z);p l();M=!!7(2).M;$(K.f).23(\'W\',u);u(a)}8 1e(){4($.k.w||2==9||(!2.13&&!7(2).U))g;9=2;m=2.13;4(7(2).U){e.m.q();j a=7(2).U.1Z(2);4(a.1Y||a.1V){e.f.1c().T(a)}p{e.f.D(a)}e.f.l()}p 4(7(2).18){j b=m.1T(7(2).18);e.m.D(b.1R()).l();e.f.1c();1Q(j i=0,R;(R=b[i]);i++){4(i>0)e.f.T("<1P/>");e.f.T(R)}e.f.1x()}p{e.m.D(m).l();e.f.q()}4(7(2).1d&&$(2).o())e.o.D($(2).o().1O(\'1N://\',\'\')).l();p e.o.q();e.3.P(7(2).X);4(7(2).H)e.3.H();1f.1L(2,1K)}8 l(){B=S;4((!A||!$.N.L)&&7(9).r){4(e.3.I(":17"))e.3.Q().l().O(7(9).r,9.11);p e.3.I(\':1a\')?e.3.O(7(9).r,9.11):e.3.1G(7(9).r)}p{e.3.l()}u()}8 u(c){4($.k.w)g;4(c&&c.1W.1X=="1E"){g}4(!M&&e.3.I(":1a")){$(K.f).1b(\'W\',u)}4(9==S){$(K.f).1b(\'W\',u);g}e.3.V("z-14").V("z-1A");j b=e.3[0].1z;j a=e.3[0].1y;4(c){b=c.2o+7(9).E;a=c.2n+7(9).G;j d=\'1w\';4(7(9).2k){d=$(C).1r()-b;b=\'1w\'}e.3.n({E:b,14:d,G:a})}j v=z(),h=e.3[0];4(v.x+v.1s