From d67032c3e44e7abf7e8fa5c9a4625e1814c0fa48 Mon Sep 17 00:00:00 2001 From: Aricura Date: Fri, 27 Jun 2014 10:40:26 +0000 Subject: [PATCH] - Bugfix: New styling of the mouse-over box to stay in screen (thanks to Jori, France and Manuel345, undisclosed location) git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@939570 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- classes/footnotes_settings.php | 2 ++ css/footnote.css | 63 ++++++---------------------------- includes/scripts.php | 4 +++ index.php | 2 +- js/jquery.tools.min.js | 31 +++++++++++++++++ readme.txt | 3 ++ templates/footnote.html | 28 +++++++++++---- 7 files changed, 74 insertions(+), 59 deletions(-) create mode 100644 js/jquery.tools.min.js diff --git a/classes/footnotes_settings.php b/classes/footnotes_settings.php index a156dde..b1bd59c 100644 --- a/classes/footnotes_settings.php +++ b/classes/footnotes_settings.php @@ -126,6 +126,8 @@ class Class_FootnotesSettings wp_enqueue_style('footnote_settings_style'); /* Needed to allow metabox layout and close functionality */ wp_enqueue_script('postbox'); + /* add jquery tools to public page */ + wp_enqueue_script('footnotes_public_script', plugins_url('../js/jquery.tools.min.js', __FILE__), array()); /* gets active tag, or if nothing set the "general" tab will be set to active */ $l_str_tab = isset($_GET['tab']) ? $_GET['tab'] : FOOTNOTE_SETTINGS_LABEL_GENERAL; /* outputs all tabs */ diff --git a/css/footnote.css b/css/footnote.css index d92030b..45a956c 100755 --- a/css/footnote.css +++ b/css/footnote.css @@ -102,59 +102,18 @@ } /* tooltip */ -.footnote_plugin_tooltip, .footnote_plugin_tooltip a { - /*outline: none !important;*/ - /*color: #4777ff !important;*/ - text-decoration: none !important; - cursor: pointer !important; -} - -.footnote_plugin_tooltip strong { - line-height: 30px !important; -} - -.footnote_plugin_tooltip:hover { +.footnote_plugin_tooltip_text { text-decoration: none !important; } -.footnote_plugin_tooltip span { - z-index: 10 !important; - display: none !important; - padding: 14px 20px !important; - margin-top: -30px !important; - /*margin-left: 28px !important;*/ - /*width: 240px;*/ - line-height: 16px !important; - cursor: default; -} - -/* - * added width and white-space styling in version 1.0.6 - */ -.footnote_plugin_tooltip:hover span, .footnote_plugin_tooltip span:hover { - display: inline !important; - position: absolute !important; - color: #474747 !important; - border: 1px solid #ddccaa !important; - background: #fffaf0 !important; - width: auto; - white-space: nowrap; -} - -.callout { - z-index: 20 !important; - position: absolute !important; - top: 30px !important; - border: 0 !important; - left: -12px !important; -} - -/*CSS3 extras*/ -.footnote_plugin_tooltip span { - border-radius: 4px !important; - -moz-border-radius: 4px !important; - -webkit-border-radius: 4px !important; - -moz-box-shadow: 5px 5px 8px #cccccc !important; - -webkit-box-shadow: 5px 5px 8px #cccccc !important; - box-shadow: 5px 5px 8px #cccccc !important; +/* tooltip styling */ +.tooltip { + display: none; + background-color: #fff7a7; + border: 1px solid #cccc99; + border-radius: 3px; + padding: 12px; + font-size: 13px; + -moz-box-shadow: 2px 2px 11px #666; + -webkit-box-shadow: 2px 2px 11px #666; } \ No newline at end of file diff --git a/includes/scripts.php b/includes/scripts.php index c2fabca..55d846e 100644 --- a/includes/scripts.php +++ b/includes/scripts.php @@ -19,6 +19,10 @@ function footnotes_add_public_stylesheet() wp_register_style('footnotes_public_style', plugins_url('../css/footnote.css', __FILE__)); /* add public stylesheet */ wp_enqueue_style('footnotes_public_style'); + /* add the jQuery plugin (already registered by WP) */ + wp_enqueue_script('jquery'); + /* add jquery tools to public page */ + wp_enqueue_script('footnotes_public_script', plugins_url('../js/jquery.tools.min.js', __FILE__), array()); } /** diff --git a/index.php b/index.php index a067c82..b89a197 100755 --- a/index.php +++ b/index.php @@ -4,7 +4,7 @@ Plugin URI: http://wordpress.org/plugins/footnotes/ Description: time to bring footnotes to your website! footnotes are known from offline publishing and everybody takes them for granted when reading a magazine. Author: media competence institute - Version: 1.2.4 + Version: 1.2.5 Author URI: http://cheret.co.uk/mci Text Domain: footnotes Domain Path: /languages diff --git a/js/jquery.tools.min.js b/js/jquery.tools.min.js new file mode 100644 index 0000000..e8413d9 --- /dev/null +++ b/js/jquery.tools.min.js @@ -0,0 +1,31 @@ +/*! + * jQuery Tools v1.2.7 - The missing UI library for the Web + * + * toolbox/toolbox.expose.js + * toolbox/toolbox.flashembed.js + * toolbox/toolbox.history.js + * toolbox/toolbox.mousewheel.js + * tooltip/tooltip.js + * tooltip/tooltip.dynamic.js + * tooltip/tooltip.slide.js + * + * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE. + * + * http://flowplayer.org/tools/ + * + * jquery.event.wheel.js - rev 1 + * Copyright (c) 2008, Three Dub Media (http://threedubmedia.com) + * Liscensed under the MIT License (MIT-LICENSE.txt) + * http://www.opensource.org/licenses/mit-license.php + * Created: 2008-07-01 | Updated: 2008-07-14 + * + * ----- + * + */ +(function(a){a.tools=a.tools||{version:"v1.2.7"};var b;b=a.tools.expose={conf:{maskId:"exposeMask",loadSpeed:"slow",closeSpeed:"fast",closeOnClick:!0,closeOnEsc:!0,zIndex:9998,opacity:.8,startOpacity:0,color:"#fff",onLoad:null,onClose:null}};function c(){if(a.browser.msie){var b=a(document).height(),c=a(window).height();return[window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,b-c<20?c:b]}return[a(document).width(),a(document).height()]}function d(b){if(b)return b.call(a.mask)}var e,f,g,h,i;a.mask={load:function(j,k){if(g)return this;typeof j=="string"&&(j={color:j}),j=j||h,h=j=a.extend(a.extend({},b.conf),j),e=a("#"+j.maskId),e.length||(e=a("
").attr("id",j.maskId),a("body").append(e));var l=c();e.css({position:"absolute",top:0,left:0,width:l[0],height:l[1],display:"none",opacity:j.startOpacity,zIndex:j.zIndex}),j.color&&e.css("backgroundColor",j.color);if(d(j.onBeforeLoad)===!1)return this;j.closeOnEsc&&a(document).on("keydown.mask",function(b){b.keyCode==27&&a.mask.close(b)}),j.closeOnClick&&e.on("click.mask",function(b){a.mask.close(b)}),a(window).on("resize.mask",function(){a.mask.fit()}),k&&k.length&&(i=k.eq(0).css("zIndex"),a.each(k,function(){var b=a(this);/relative|absolute|fixed/i.test(b.css("position"))||b.css("position","relative")}),f=k.css({zIndex:Math.max(j.zIndex+1,i=="auto"?0:i)})),e.css({display:"block"}).fadeTo(j.loadSpeed,j.opacity,function(){a.mask.fit(),d(j.onLoad),g="full"}),g=!0;return this},close:function(){if(g){if(d(h.onBeforeClose)===!1)return this;e.fadeOut(h.closeSpeed,function(){d(h.onClose),f&&f.css({zIndex:i}),g=!1}),a(document).off("keydown.mask"),e.off("click.mask"),a(window).off("resize.mask")}return this},fit:function(){if(g){var a=c();e.css({width:a[0],height:a[1]})}},getMask:function(){return e},isLoaded:function(a){return a?g=="full":g},getConf:function(){return h},getExposed:function(){return f}},a.fn.mask=function(b){a.mask.load(b);return this},a.fn.expose=function(b){a.mask.load(b,this);return this}})(jQuery); +(function(){var a=document.all,b="http://www.adobe.com/go/getflashplayer",c=typeof jQuery=="function",d=/(\d+)[^\d]+(\d+)[^\d]*(\d*)/,e={width:"100%",height:"100%",id:"_"+(""+Math.random()).slice(9),allowfullscreen:!0,allowscriptaccess:"always",quality:"high",version:[3,0],onFail:null,expressInstall:null,w3c:!1,cachebusting:!1};window.attachEvent&&window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){},__flash_savedUnloadHandler=function(){}});function f(a,b){if(b)for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}function g(a,b){var c=[];for(var d in a)a.hasOwnProperty(d)&&(c[d]=b(a[d]));return c}window.flashembed=function(a,b,c){typeof a=="string"&&(a=document.getElementById(a.replace("#","")));if(a){typeof b=="string"&&(b={src:b});return new j(a,f(f({},e),b),c)}};var h=f(window.flashembed,{conf:e,getVersion:function(){var a,b;try{b=navigator.plugins["Shockwave Flash"].description.slice(16)}catch(c){try{a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"),b=a&&a.GetVariable("$version")}catch(e){try{a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"),b=a&&a.GetVariable("$version")}catch(f){}}}b=d.exec(b);return b?[b[1],b[3]]:[0,0]},asString:function(a){if(a===null||a===undefined)return null;var b=typeof a;b=="object"&&a.push&&(b="array");switch(b){case"string":a=a.replace(new RegExp("([\"\\\\])","g"),"\\$1"),a=a.replace(/^\s?(\d+\.?\d*)%/,"$1pct");return"\""+a+"\"";case"array":return"["+g(a,function(a){return h.asString(a)}).join(",")+"]";case"function":return"\"function()\"";case"object":var c=[];for(var d in a)a.hasOwnProperty(d)&&c.push("\""+d+"\":"+h.asString(a[d]));return"{"+c.join(",")+"}"}return String(a).replace(/\s/g," ").replace(/\'/g,"\"")},getHTML:function(b,c){b=f({},b);var d="";if(b.w3c||a)d+="";b.width=b.height=b.id=b.w3c=b.src=null,b.onFail=b.version=b.expressInstall=null;for(var e in b)b[e]&&(d+="");var g="";if(c){for(var i in c)if(c[i]){var j=c[i];g+=i+"="+encodeURIComponent(/function|object/.test(typeof j)?h.asString(j):j)+"&"}g=g.slice(0,-1),d+=""}d+="";return d},isSupported:function(a){return i[0]>a[0]||i[0]==a[0]&&i[1]>=a[1]}}),i=h.getVersion();function j(c,d,e){if(h.isSupported(d.version))c.innerHTML=h.getHTML(d,e);else if(d.expressInstall&&h.isSupported([6,65]))c.innerHTML=h.getHTML(f(d,{src:d.expressInstall}),{MMredirectURL:location.href,MMplayerType:"PlugIn",MMdoctitle:document.title});else{c.innerHTML.replace(/\s/g,"")||(c.innerHTML="

Flash version "+d.version+" or greater is required

"+(i[0]>0?"Your version is "+i:"You have no flash plugin installed")+"

"+(c.tagName=="A"?"

Click here to download latest version

":"

Download latest version from here

"),c.tagName=="A"&&(c.onclick=function(){location.href=b}));if(d.onFail){var g=d.onFail.call(this);typeof g=="string"&&(c.innerHTML=g)}}a&&(window[d.id]=document.getElementById(d.id)),f(this,{getRoot:function(){return c},getOptions:function(){return d},getConf:function(){return e},getApi:function(){return c.firstChild}})}c&&(jQuery.tools=jQuery.tools||{version:"v1.2.7"},jQuery.tools.flashembed={conf:e},jQuery.fn.flashembed=function(a,b){return this.each(function(){jQuery(this).data("flashembed",flashembed(this,a,b))})})})(); +(function(a){var b,c,d,e;a.tools=a.tools||{version:"v1.2.7"},a.tools.history={init:function(g){e||(a.browser.msie&&a.browser.version<"8"?c||(c=a("