From b924b266e2466d437d406dc1fc430ad96eb9c634 Mon Sep 17 00:00:00 2001 From: Alex Corvi Date: Mon, 28 Nov 2016 01:38:22 +0300 Subject: [PATCH 01/15] added node_modules --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 496ee2c..7c91ab4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.DS_Store \ No newline at end of file +.DS_Store +/node_modules/ \ No newline at end of file From 632e8a0d4e1f0e87d451999555e40fcda2cecae6 Mon Sep 17 00:00:00 2001 From: Alex Corvi Date: Mon, 28 Nov 2016 01:38:55 +0300 Subject: [PATCH 02/15] build: automate minifying and writing dist file (minified and original) --- build.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 build.js diff --git a/build.js b/build.js new file mode 100644 index 0000000..407a201 --- /dev/null +++ b/build.js @@ -0,0 +1,18 @@ +const fs = require('fs'); +const uglifyjs = require('uglifyjs'); +const cleanCss = require('clean-css'); + +const jsSource = fs.readFileSync("./src/jquery.miniTip.js","utf8"); +const cssSource = fs.readFileSync("./src/miniTip.css","utf8"); + +// JavaScript +// original +fs.writeFileSync("./dist/jquery.minitip.js",jsSource); +// minified +fs.writeFileSync("./dist/jquery.minitip.min.js",uglifyjs.minify(jsSource,{fromString:true}).code); + +// CSS +// original +fs.writeFileSync("./dist/minitip.css",cssSource); +// minified +fs.writeFileSync("./dist/minitip.min.css",new cleanCss().minify(cssSource).styles); \ No newline at end of file From e73bebee2a139fe2cfa973fb7571385c2f0aa91b Mon Sep 17 00:00:00 2001 From: Alex Corvi Date: Mon, 28 Nov 2016 01:39:03 +0300 Subject: [PATCH 03/15] dist files --- dist/jquery.minitip.js | 325 +++++++++++++++++++++++++++++++++++++ dist/jquery.minitip.min.js | 1 + dist/minitip.css | 70 ++++++++ dist/minitip.min.css | 1 + 4 files changed, 397 insertions(+) create mode 100644 dist/jquery.minitip.js create mode 100644 dist/jquery.minitip.min.js create mode 100644 dist/minitip.css create mode 100644 dist/minitip.min.css diff --git a/dist/jquery.minitip.js b/dist/jquery.minitip.js new file mode 100644 index 0000000..c9dadd4 --- /dev/null +++ b/dist/jquery.minitip.js @@ -0,0 +1,325 @@ +/*! + * MiniTip + * Requires: jQuery v1.3+ + * + * (c) 2016, James Simpson + * http://goldfirestudios.com + * + * Dual licensed under the MIT and GPL + * + * Documentation found at: + * http://goldfirestudios.com/blog/81/miniTip-jQuery-Plugin +*/ + +(function($){ + $.fn.miniTip = function(opts) { + // declare the default option values + var d = { + title: '', // if left blank, no title bar will show + content: false, // the content of the tooltip + delay: 300, // how long to wait before showing and hiding the tooltip (ms) + anchor: 'n', // n (top), s (bottom), e (right), w (left) + event: 'hover', // can be 'hover' or 'click' + fadeIn: 200, // speed of fade in animation (ms) + fadeOut: 200, // speed of fade out animation (ms) + aHide: true, // set to false to only hide when the mouse moves away from the anchor and tooltip + maxW: '250px', // max width of tooltip + offset: 5, // offset in pixels of stem from anchor + stemOff: 0, // x-axis offset of stem, set to value of border-radius to adjust for viewport correction + doHide: false, // call $('#id').miniTip({hide: true}); to manually hide the tooltip + class: false, + }, + + // merge the defaults with the user declared options + o = $.extend(d, opts); + + // add the tip elements to the DOM + if (!$('#miniTip')[0]) + $('body').append('
'); + + // declare the containers + var tt_w = $('#miniTip'), + tt_t = $('#miniTip_t'), + tt_c = $('#miniTip_c'), + tt_a = $('#miniTip_a'); + + // manually hide the tooltip if $('#id').miniTip({hide: true}); is called + if (o.doHide) { + tt_w.stop(true,true).fadeOut(o.fadeOut); + return false; + } + + // initialize the tooltip + return this.each(function(){ + // make sure the anchor element can be referred to below + var el = $(this); + + // get options per element by "data-minitip" attributes + o.title = el.attr("data-minitip-title") || o.title; + o.content = el.attr("data-minitip-content") || o.content; + o.delay = el.attr("data-minitip-delay")*1 || o.delay; + o.anchor = el.attr("data-minitip-anchor") || o.anchor; + o.event = el.attr("data-minitip-event") || o.event; + o.fadeIn = el.attr("data-minitip-fadeIn")*1 || o.fadeIn; + o.fadeOut = el.attr("data-minitip-fadeOut")*1 || o.fadeOut; + o.aHide = el.attr("data-minitip-aHide") || o.aHide; + o.maxW = el.attr("data-minitip-maxW") || o.maxW; + o.offset = el.attr("data-minitip-offset")*1 || o.offset; + o.stemOff = el.attr("data-minitip-stemOff")*1 || o.stemOff; + o.doHide = el.attr("data-minitip-doHide") || o.doHide; + o.class = el.attr("data-minitip-class") || o.class; + + // if content is set to false, use the title attribute + var cont = o.content ? o.content : el.attr('title'); + + // if the tooltip isn't empty + if (cont != '' && typeof cont != 'undefined') { + // declare the delay variable and make sure it is global + window.delay = false; + + // declare the variables that check if the mouse is still on the tooltip + var tHov = false, + aHov = true; + + // if you are using the title attribute, remove it from the anchor + if (!o.content) + el.removeAttr('title'); + + if (o.event == 'hover') { + // add the hover event + el.hover( + function(){ + // make sure we know this wasn't activated by click + tt_w.removeAttr('click'); + + // show the tooltip + aHov = true; + show.call(this); + }, + function(){ + aHov = false; + hide(); + } + ); + + // add a hover event for the tooltip if aHide is false + if (!o.aHide) { + tt_w.hover( + function() { + tHov = true; + }, + function() { + tHov = false; + setTimeout(function(){if (!aHov && !tt_w.attr('click')) hide()}, 20); + } + ); + } + } else if (o.event == 'click') { + // make sure auto hide is set to false automatically + o.aHide = true; + + // add the click event to the anchor + el.click(function(){ + // make sure we know this was activated by click + tt_w.attr('click', 't'); + + if (tt_w.data('last_target') !== el) { + // rerender the tooltip if the target changed + show.call(this); + } else { + // show the tooltip, unless it is already showing, then close it + if (tt_w.css('display') == 'none') show.call(this); else hide(); + } + + tt_w.data('last_target', el); + + // clear the tooltip if anywhere but the tooltip itself is clicked + $('html').unbind('click').click(function(e){ + if (tt_w.css('display') == 'block' && !$(e.target).closest('#miniTip').length) { + $('html').unbind('click'); + hide(); + } + }); + + return false; + }); + } + + // show the tooltip + var show = function() { + // call the show callback function + if (o.show) o.show.call(this, o); + + // use content set by callback, if any + if (o.content && o.content != '') { + cont = o.content; + } + + // add in the content + tt_c.html(cont); + + // insert the title (or hide if none is set) + if (o.title != '') + tt_t.html(o.title).show(); + else + tt_t.hide(); + + // call the render callback function + if (o.render) o.render(tt_w); + + // reset arrow position + tt_a.removeAttr('class'); + + // make sure the tooltip is the right width even if the anchor is flush to the right of the screen + // set the max width + tt_w.hide().width('').width(tt_w.width()).css('max-width', o.maxW); + + // add support for image maps + var isArea = el.is('area'); + if (isArea) { + // declare variables to determine coordinates + var i, + x = [], + y = [], + c = el.attr('coords').split(','); + + // sortin funciton for coordinates + function num (a, b) { + return a - b; + } + + // loop through the coordinates and populate x & y arrays + for (i=0; i < c.length; i++){ + x.push(c[i++]); + y.push(c[i]); + } + + // get the center coordinates of the area + var mapImg = el.parent().attr('name'), + mapOff = $('img[usemap=\\#' + mapImg + ']').offset(), + left = parseInt(mapOff.left, 10) + parseInt((parseInt(x.sort(num)[0], 10) + parseInt(x.sort(num)[x.length-1], 10)) / 2, 10), + top = parseInt(mapOff.top, 10) + parseInt((parseInt(y.sort(num)[0], 10) + parseInt(y.sort(num)[y.length-1], 10)) / 2, 10); + } else { + // get the coordinates of the element + var top = parseInt(el.offset().top, 10), + left = parseInt(el.offset().left, 10); + } + + // get width and height of the anchor element + var elW = isArea ? 0 : parseInt(el.outerWidth(), 10), + elH = isArea ? 0 : parseInt(el.outerHeight(), 10), + + // get width and height of the tooltip + tipW = tt_w.outerWidth(), + tipH = tt_w.outerHeight(), + + // calculate position for tooltip + mLeft = Math.round(left + Math.round((elW - tipW) / 2)), + mTop = Math.round(top + elH + o.offset + 8), + + // position of the arrow + aLeft = (Math.round(tipW - 16) / 2) - parseInt(tt_w.css('borderLeftWidth'), 10), + aTop = 0, + + // figure out if the tooltip will go off of the screen + eOut = (left + elW + tipW + o.offset + 8) > parseInt($(window).width(), 10), + wOut = (tipW + o.offset + 8) > left, + nOut = (tipH + o.offset + 8) > top - $(window).scrollTop(), + sOut = (top + elH + tipH + o.offset + 8) > parseInt($(window).height() + $(window).scrollTop(), 10), + + // default anchor position + elPos = o.anchor; + + // calculate where the anchor should be (east & west) + if (wOut || o.anchor == 'e' && !eOut) { + if (o.anchor == 'w' || o.anchor == 'e') { + elPos = 'e'; + aTop = Math.round((tipH / 2) - 8 - parseInt(tt_w.css('borderRightWidth'), 10)); + aLeft = -8 - parseInt(tt_w.css('borderRightWidth'), 10); + mLeft = left + elW + o.offset + 8; + mTop = Math.round((top + elH / 2) - (tipH / 2)); + } + } else if (eOut || o.anchor == 'w' && !wOut) { + if (o.anchor == 'w' || o.anchor == 'e') { + elPos = 'w'; + aTop = Math.round((tipH / 2) - 8 - parseInt(tt_w.css('borderLeftWidth'), 10)); + aLeft = tipW - parseInt(tt_w.css('borderLeftWidth'), 10); + mLeft = left - tipW - o.offset - 8; + mTop = Math.round((top + elH / 2) - (tipH / 2)); + } + } + + // calculate where the anchor should be (north & south) + if (sOut || o.anchor == 'n' && !nOut) { + if (o.anchor == 'n' || o.anchor == 's') { + elPos = 'n'; + aTop = tipH - parseInt(tt_w.css('borderTopWidth'), 10); + mTop = top - (tipH + o.offset + 8); + } + } else if (nOut || o.anchor == 's' && !sOut) { + if (o.anchor == 'n' || o.anchor == 's') { + elPos = 's'; + aTop = -8 - parseInt(tt_w.css('borderBottomWidth'), 10); + mTop = top + elH + o.offset + 8; + } + } + + // if it is going to go off on the sides, use corner + if (o.anchor == 'n' || o.anchor == 's') { + if ((tipW / 2) > left) { + mLeft = mLeft < 0 ? aLeft + mLeft : aLeft; + aLeft = 0; + } else if ((left + tipW / 2) > parseInt($(window).width(), 10)) { + mLeft -= aLeft; + aLeft *= 2; + } + } else { + if (nOut) { + mTop = mTop + aTop + aTop = 0; + } else if (sOut) { + mTop -= aTop; + aTop *= 2; + } + } + + // position the arrow + tt_a.css({'margin-left': (aLeft > 0 ? aLeft : aLeft + parseInt(o.stemOff, 10) / 2) + 'px', 'margin-top': aTop + 'px'}).attr('class', elPos); + + // clear delay timer if exists + if (delay) clearTimeout(delay); + + // position the tooltip and show it + delay = setTimeout(function(){ tt_w.css({"margin-left": mLeft+"px", "margin-top": mTop + 'px'}).stop(true,true).fadeIn(o.fadeIn); }, o.delay); + + // add custom class + $("#miniTip").attr("class",o.class||""); + }; + + // hide the tooltip + var hide = function() { + if (!o.aHide && !tHov || o.aHide) { + // clear delay timer if exists + if (delay) clearTimeout(delay); + + // fade out the tooltip + delay = setTimeout(function(){hide2()}, o.delay); + } + } + + // make a second hide function if the tooltip is set to not auto hide + var hide2 = function() { + // if the mouse isn't on the tooltip or the anchor, hide it, otherwise loop back through + if (!o.aHide && !tHov || o.aHide) { + // fade out the tooltip + tt_w.stop(true,true).fadeOut(o.fadeOut); + + // call the show callback function + if (o.hide) o.hide.call(this); + } else + setTimeout(function(){hide()}, 200); + } + } + }); + } +})(jQuery); \ No newline at end of file diff --git a/dist/jquery.minitip.min.js b/dist/jquery.minitip.min.js new file mode 100644 index 0000000..7e71186 --- /dev/null +++ b/dist/jquery.minitip.min.js @@ -0,0 +1 @@ +!function(t){t.fn.miniTip=function(e){var i={title:"",content:!1,delay:300,anchor:"n",event:"hover",fadeIn:200,fadeOut:200,aHide:!0,maxW:"250px",offset:5,stemOff:0,doHide:!1,"class":!1},a=t.extend(i,e);t("#miniTip")[0]||t("body").append('
');var n=t("#miniTip"),r=t("#miniTip_t"),o=t("#miniTip_c"),d=t("#miniTip_a");return a.doHide?(n.stop(!0,!0).fadeOut(a.fadeOut),!1):this.each(function(){var e=t(this);a.title=e.attr("data-minitip-title")||a.title,a.content=e.attr("data-minitip-content")||a.content,a.delay=1*e.attr("data-minitip-delay")||a.delay,a.anchor=e.attr("data-minitip-anchor")||a.anchor,a.event=e.attr("data-minitip-event")||a.event,a.fadeIn=1*e.attr("data-minitip-fadeIn")||a.fadeIn,a.fadeOut=1*e.attr("data-minitip-fadeOut")||a.fadeOut,a.aHide=e.attr("data-minitip-aHide")||a.aHide,a.maxW=e.attr("data-minitip-maxW")||a.maxW,a.offset=1*e.attr("data-minitip-offset")||a.offset,a.stemOff=1*e.attr("data-minitip-stemOff")||a.stemOff,a.doHide=e.attr("data-minitip-doHide")||a.doHide,a["class"]=e.attr("data-minitip-class")||a["class"];var i=a.content?a.content:e.attr("title");if(""!=i&&"undefined"!=typeof i){window.delay=!1;var s=!1,c=!0;a.content||e.removeAttr("title"),"hover"==a.event?(e.hover(function(){n.removeAttr("click"),c=!0,f.call(this)},function(){c=!1,h()}),a.aHide||n.hover(function(){s=!0},function(){s=!1,setTimeout(function(){c||n.attr("click")||h()},20)})):"click"==a.event&&(a.aHide=!0,e.click(function(){return n.attr("click","t"),n.data("last_target")!==e?f.call(this):"none"==n.css("display")?f.call(this):h(),n.data("last_target",e),t("html").unbind("click").click(function(e){"block"!=n.css("display")||t(e.target).closest("#miniTip").length||(t("html").unbind("click"),h())}),!1}));var f=function(){function s(t,e){return t-e}a.show&&a.show.call(this,a),a.content&&""!=a.content&&(i=a.content),o.html(i),""!=a.title?r.html(a.title).show():r.hide(),a.render&&a.render(n),d.removeAttr("class"),n.hide().width("").width(n.width()).css("max-width",a.maxW);var c=e.is("area");if(c){var f,h=[],l=[],p=e.attr("coords").split(",");for(f=0;fparseInt(t(window).width(),10),k=y+a.offset+8>v,M=g+a.offset+8>I-t(window).scrollTop(),_=I+T+g+a.offset+8>parseInt(t(window).height()+t(window).scrollTop(),10),A=a.anchor;k||"e"==a.anchor&&!b?("w"==a.anchor||"e"==a.anchor)&&(A="e",x=Math.round(g/2-8-parseInt(n.css("borderRightWidth"),10)),O=-8-parseInt(n.css("borderRightWidth"),10),H=v+w+a.offset+8,W=Math.round(I+T/2-g/2)):(b||"w"==a.anchor&&!k)&&("w"==a.anchor||"e"==a.anchor)&&(A="w",x=Math.round(g/2-8-parseInt(n.css("borderLeftWidth"),10)),O=y-parseInt(n.css("borderLeftWidth"),10),H=v-y-a.offset-8,W=Math.round(I+T/2-g/2)),_||"n"==a.anchor&&!M?("n"==a.anchor||"s"==a.anchor)&&(A="n",x=g-parseInt(n.css("borderTopWidth"),10),W=I-(g+a.offset+8)):(M||"s"==a.anchor&&!_)&&("n"==a.anchor||"s"==a.anchor)&&(A="s",x=-8-parseInt(n.css("borderBottomWidth"),10),W=I+T+a.offset+8),"n"==a.anchor||"s"==a.anchor?y/2>v?(H=0>H?O+H:O,O=0):v+y/2>parseInt(t(window).width(),10)&&(H-=O,O*=2):M?(W+=x,x=0):_&&(W-=x,x*=2),d.css({"margin-left":(O>0?O:O+parseInt(a.stemOff,10)/2)+"px","margin-top":x+"px"}).attr("class",A),delay&&clearTimeout(delay),delay=setTimeout(function(){n.css({"margin-left":H+"px","margin-top":W+"px"}).stop(!0,!0).fadeIn(a.fadeIn)},a.delay),t("#miniTip").attr("class",a["class"]||"")},h=function(){(!a.aHide&&!s||a.aHide)&&(delay&&clearTimeout(delay),delay=setTimeout(function(){l()},a.delay))},l=function(){!a.aHide&&!s||a.aHide?(n.stop(!0,!0).fadeOut(a.fadeOut),a.hide&&a.hide.call(this)):setTimeout(function(){h()},200)}}})}}(jQuery); \ No newline at end of file diff --git a/dist/minitip.css b/dist/minitip.css new file mode 100644 index 0000000..0fe3eda --- /dev/null +++ b/dist/minitip.css @@ -0,0 +1,70 @@ +/*! miniTip CSS */ + +#miniTip { + /* main styles for tooltip */ + background-color: #f8f5ca; + border: 4px solid #eae4b4; + color: #927847; + font-size: .9em; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + /* end editing style */ + display: none; + position: absolute; + top: 0; + left: 0; + z-index: 99999; +} + +/* title bar style */ +#miniTip_t { + background-color: #f5edc2; + font-weight: 700; + padding: 4px 6px; +} + +/* main content style */ +#miniTip_c { padding: 4px 8px } + + +/* arrow holder, no need to edit */ +#miniTip_a { + width: 0; + height: 0; + position: absolute; + top: 0; + left: 0; +} + +/* arrow pointing down, change border-top color to change color of the arrow */ +#miniTip .n { + border-left: 8px solid transparent; + border-right: 8px solid transparent; + border-top: 8px solid #eae4b4; + border-bottom: 0; +} + +/* arrow pointing up, change border-bottom color to change color of the arrow */ +#miniTip .s { + border-left: 8px solid transparent; + border-right: 8px solid transparent; + border-bottom: 8px solid #eae4b4; + border-top: 0; +} + +/* arrow pointing left, change border-right color to change color of the arrow */ +#miniTip .e { + border-bottom: 8px solid transparent; + border-top: 8px solid transparent; + border-right: 8px solid #eae4b4; + border-left: 0; +} + +/* arrow pointing right, change border-left color to change color of the arrow */ +#miniTip .w { + border-bottom: 8px solid transparent; + border-top: 8px solid transparent; + border-left: 8px solid #eae4b4; + border-right: 0; +} \ No newline at end of file diff --git a/dist/minitip.min.css b/dist/minitip.min.css new file mode 100644 index 0000000..c6c26c2 --- /dev/null +++ b/dist/minitip.min.css @@ -0,0 +1 @@ +/*! miniTip CSS */#miniTip,#miniTip_a{position:absolute;top:0;left:0}#miniTip{background-color:#f8f5ca;border:4px solid #eae4b4;color:#927847;font-size:.9em;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;display:none;z-index:99999}#miniTip .n,#miniTip .s{border-left:8px solid transparent;border-right:8px solid transparent}#miniTip_t{background-color:#f5edc2;font-weight:700;padding:4px 6px}#miniTip_c{padding:4px 8px}#miniTip_a{width:0;height:0}#miniTip .n{border-top:8px solid #eae4b4;border-bottom:0}#miniTip .s{border-bottom:8px solid #eae4b4;border-top:0}#miniTip .e,#miniTip .w{border-bottom:8px solid transparent;border-top:8px solid transparent}#miniTip .e{border-right:8px solid #eae4b4;border-left:0}#miniTip .w{border-left:8px solid #eae4b4;border-right:0} \ No newline at end of file From ef837f3e508edef9ef40933edd12d137763c6fbe Mon Sep 17 00:00:00 2001 From: Alex Corvi Date: Mon, 28 Nov 2016 01:39:25 +0300 Subject: [PATCH 04/15] unecessary --- jquery.miniTip.min.js | 15 --------------- miniTip.jquery.json | 39 --------------------------------------- miniTip.min.css | 2 -- 3 files changed, 56 deletions(-) delete mode 100644 jquery.miniTip.min.js delete mode 100644 miniTip.jquery.json delete mode 100644 miniTip.min.css diff --git a/jquery.miniTip.min.js b/jquery.miniTip.min.js deleted file mode 100644 index c8ba007..0000000 --- a/jquery.miniTip.min.js +++ /dev/null @@ -1,15 +0,0 @@ -/*! - * miniTip v1.5.3 - * - * Updated: July 15, 2012 - * Requires: jQuery v1.3+ - * - * (c) 2011, James Simpson - * http://goldfirestudios.com - * - * Dual licensed under the MIT and GPL - * - * Documentation found at: - * http://goldfirestudios.com/blog/81/miniTip-jQuery-Plugin -*/ -(function(e){e.fn.miniTip=function(t){var n={title:"",content:!1,delay:300,anchor:"n",event:"hover",fadeIn:200,fadeOut:200,aHide:!0,maxW:"250px",offset:5,stemOff:0,doHide:!1},r=e.extend(n,t);e("#miniTip")[0]||e("body").append('
');var i=e("#miniTip"),s=e("#miniTip_t"),o=e("#miniTip_c"),u=e("#miniTip_a");return r.doHide?(i.stop(!0,!0).fadeOut(r.fadeOut),!1):this.each(function(){var t=e(this),n=r.content?r.content:t.attr("title");if(n!=""&&typeof n!="undefined"){window.delay=!1;var a=!1,f=!0;r.content||t.removeAttr("title"),r.event=="hover"?(t.hover(function(){i.removeAttr("click"),f=!0,l.call(this)},function(){f=!1,c()}),r.aHide||i.hover(function(){a=!0},function(){a=!1,setTimeout(function(){!f&&!i.attr("click")&&c()},20)})):r.event=="click"&&(r.aHide=!0,t.click(function(){return i.attr("click","t"),i.data("last_target")!==t?l.call(this):i.css("display")=="none"?l.call(this):c(),i.data("last_target",t),e("html").unbind("click").click(function(t){i.css("display")=="block"&&!e(t.target).closest("#miniTip").length&&(e("html").unbind("click"),c())}),!1}));var l=function(){r.show&&r.show.call(this,r),r.content&&r.content!=""&&(n=r.content),o.html(n),r.title!=""?s.html(r.title).show():s.hide(),r.render&&r.render(i),u.removeAttr("class"),i.hide().width("").width(i.width()).css("max-width",r.maxW);var a=t.is("area");if(a){var f,l=[],c=[],h=t.attr("coords").split(",");function p(e,t){return e-t}for(f=0;fparseInt(e(window).width(),10),k=w+r.offset+8>m,L=E+r.offset+8>g-e(window).scrollTop(),A=g+b+E+r.offset+8>parseInt(e(window).height()+e(window).scrollTop(),10),O=r.anchor;if(k||r.anchor=="e"&&!C){if(r.anchor=="w"||r.anchor=="e")O="e",N=Math.round(E/2-8-parseInt(i.css("borderRightWidth"),10)),T=-8-parseInt(i.css("borderRightWidth"),10),S=m+y+r.offset+8,x=Math.round(g+b/2-E/2)}else if(C||r.anchor=="w"&&!k)if(r.anchor=="w"||r.anchor=="e")O="w",N=Math.round(E/2-8-parseInt(i.css("borderLeftWidth"),10)),T=w-parseInt(i.css("borderLeftWidth"),10),S=m-w-r.offset-8,x=Math.round(g+b/2-E/2);if(A||r.anchor=="n"&&!L){if(r.anchor=="n"||r.anchor=="s")O="n",N=E-parseInt(i.css("borderTopWidth"),10),x=g-(E+r.offset+8)}else if(L||r.anchor=="s"&&!A)if(r.anchor=="n"||r.anchor=="s")O="s",N=-8-parseInt(i.css("borderBottomWidth"),10),x=g+b+r.offset+8;r.anchor=="n"||r.anchor=="s"?w/2>m?(S=S<0?T+S:T,T=0):m+w/2>parseInt(e(window).width(),10)&&(S-=T,T*=2):L?(x+=N,N=0):A&&(x-=N,N*=2),u.css({"margin-left":(T>0?T:T+parseInt(r.stemOff,10)/2)+"px","margin-top":N+"px"}).attr("class",O),delay&&clearTimeout(delay),delay=setTimeout(function(){i.css({"margin-left":S+"px","margin-top":x+"px"}).stop(!0,!0).fadeIn(r.fadeIn)},r.delay)},c=function(){if(!r.aHide&&!a||r.aHide)delay&&clearTimeout(delay),delay=setTimeout(function(){h()},r.delay)},h=function(){!r.aHide&&!a||r.aHide?(i.stop(!0,!0).fadeOut(r.fadeOut),r.hide&&r.hide.call(this)):setTimeout(function(){c()},200)}}})}})(jQuery) \ No newline at end of file diff --git a/miniTip.jquery.json b/miniTip.jquery.json deleted file mode 100644 index e3a7220..0000000 --- a/miniTip.jquery.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "miniTip", - "title": "miniTip", - "description": "Ultra lightweight jQuery tooltip plugin.", - "keywords": [ - "tooltip", - "tip", - "ui" - ], - "version": "1.5.3", - "author": { - "name": "James Simpson", - "url": "http://goldfirestudios.com" - }, - "maintainers": [ - { - "name": "James Simpson", - "url": "http://goldfirestudios.com" - } - ], - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/goldfire/miniTip" - }, - { - "type": "GPL", - "url": "https://github.com/goldfire/miniTip" - } - ], - "bugs": "https://github.com/goldfire/miniTip/issues", - "homepage": "http://goldfirestudios.com/blog/81/miniTip-jQuery-Plugin", - "demo": "http://goldfirestudios.com/blog/81/miniTip-jQuery-Plugin", - "docs": "http://goldfirestudios.com/blog/81/miniTip-jQuery-Plugin", - "download": "http://goldfirestudios.com/blog/81/miniTip-jQuery-Plugin", - "dependencies": { - "jquery": ">=1.3" - } -} \ No newline at end of file diff --git a/miniTip.min.css b/miniTip.min.css deleted file mode 100644 index c2eaa0e..0000000 --- a/miniTip.min.css +++ /dev/null @@ -1,2 +0,0 @@ -/*! miniTip CSS - v1.5.3 */ -#miniTip{background-color:#f8f5ca;border:4px solid #eae4b4;color:#927847;font-size:.9em;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;display:none;position:absolute;top:0;left:0;z-index:99999}#miniTip_t{background-color:#f5edc2;font-weight:700;padding:4px 6px}#miniTip_c{padding:4px 8px}#miniTip_a{width:0;height:0;position:absolute;top:0;left:0}#miniTip .n{border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #eae4b4;border-bottom:0}#miniTip .s{border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid #eae4b4;border-top:0}#miniTip .e{border-bottom:8px solid transparent;border-top:8px solid transparent;border-right:8px solid #eae4b4;border-left:0}#miniTip .w{border-bottom:8px solid transparent;border-top:8px solid transparent;border-left:8px solid #eae4b4;border-right:0} \ No newline at end of file From 9ed253a8ab079acd0b0826cbde46f3d2bd9ba4e8 Mon Sep 17 00:00:00 2001 From: Alex Corvi Date: Mon, 28 Nov 2016 01:39:37 +0300 Subject: [PATCH 05/15] node package.json --- package.json | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 package.json diff --git a/package.json b/package.json new file mode 100644 index 0000000..8cc837c --- /dev/null +++ b/package.json @@ -0,0 +1,32 @@ +{ + "name": "minitip", + "version": "1.6.0", + "description": "Ultra lightweight jQuery tooltip plugin", + "main": "jquery.miniTip.min.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/alexcorvi/miniTip.git" + }, + "author": { + "name": "James Simpson", + "url": "http://goldfirestudios.com" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/alexcorvi/miniTip/issues" + }, + "homepage": "http://goldfirestudios.com/blog/81/miniTip-jQuery-Plugin", + "devDependencies": { + "clean-css": "^3.4.21", + "uglifyjs": "^2.4.10" + }, + "keywords": [ + "tooltip", + "jquery", + "plugin", + "light" + ] +} From fd818f4e84147303f86df9a5cbf723e716d930e3 Mon Sep 17 00:00:00 2001 From: Alex Corvi Date: Mon, 28 Nov 2016 01:39:49 +0300 Subject: [PATCH 06/15] option class --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6ff4214..14b9c52 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,8 @@ This is a more advanced example utilizing all available options (as of v1.0). Th offset: 15, stemOff: 0, show: function(){ alert('Hello,'); }, - hide: funciton(){ alert('World!'); } + hide: funciton(){ alert('World!'); }, + class: "custom-class" }); More examples and live demos can be found at [http://goldfirestudios.com/blog/81/miniTip-jQuery-Plugin](http://goldfirestudios.com/blog/81/miniTip-jQuery-Plugin) From 58ec4f98caea73d1045f87772b10f8f849d42335 Mon Sep 17 00:00:00 2001 From: Alex Corvi Date: Mon, 28 Nov 2016 01:40:04 +0300 Subject: [PATCH 07/15] added changes to history --- HISTORY.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/HISTORY.md b/HISTORY.md index d57fc38..4844e60 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,7 @@ +### Version 1.6.0 (November 28, 2016) ### +* Added ability to add custom classes +* Ability to set options per element via "data-minitip-