From a7e1e6593f7e3ffb9475d959384ae79c0910abae Mon Sep 17 00:00:00 2001 From: Joseph Schipper Date: Fri, 13 Jul 2018 15:15:06 -0400 Subject: [PATCH 1/3] Update for jquery compatibility --- bootstro.js | 4 ++-- bootstro.min.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bootstro.js b/bootstro.js index 80a995e..cb1b84c 100644 --- a/bootstro.js +++ b/bootstro.js @@ -152,7 +152,7 @@ $(document).ready(function(){ { //get the element with data-bootstro-step=i //or otherwise the the natural order of the set - if ($elements.filter("[data-bootstro-step=" + i +"]").size() > 0) + if ($elements.filter("[data-bootstro-step=" + i +"]").length > 0) return $elements.filter("[data-bootstro-step=" + i +"]"); else { @@ -317,7 +317,7 @@ $(document).ready(function(){ selector = selector || '.bootstro'; $elements = $(selector); - count = $elements.size(); + count = $elements.length; if (count > 0 && $('div.bootstro-backdrop').length === 0) { // Prevents multiple copies diff --git a/bootstro.min.js b/bootstro.min.js index c6861c0..61b28d6 100644 --- a/bootstro.min.js +++ b/bootstro.min.js @@ -1 +1 @@ -$(document).ready(function(){(function(e,t,n){function f(e){var n=t(window).scrollTop();var r=n+t(window).height();var i=e.offset().top;var s=i+e.height();return s>=n&&i<=r&&s<=r&&i>=n}function l(e,t){var n=get_element(t);var r,s,o;e=e+"
";if(n.attr("data-bootstro-nextButton")){r=n.attr("data-bootstro-nextButton")}else if(n.attr("data-bootstro-nextButtonText")){r='"}else{if(typeof a.nextButton!="undefined")r=a.nextButton;else r='"}if(n.attr("data-bootstro-prevButton")){s=n.attr("data-bootstro-prevButton")}else if(n.attr("data-bootstro-prevButtonText")){s='"}else{if(typeof a.prevButton!="undefined")s=a.prevButton;else s='"}if(n.attr("data-bootstro-finishButton")){o=n.attr("data-bootstro-finishButton")}else if(n.attr("data-bootstro-finishButtonText")){o='"}else{if(typeof a.finishButton!="undefined")o=a.finishButton;else o='"}if(i!=1){if(t==0)e=e+r;else if(t==i-1)e=e+s;else e=e+r+s}e=e+"
";e=e+'
'+o+"
";return e}var r;var i;var s=[];var o=null;var u={nextButtonText:"Next »",prevButtonText:"« Prev",finishButtonText:' Ok I got it, get back to the site',stopOnBackdropClick:true,stopOnEsc:true,margin:100};var a;get_element=function(e){if(r.filter("[data-bootstro-step="+e+"]").size()>0)return r.filter("[data-bootstro-step="+e+"]");else{return r.eq(e)}};get_popup=function(e){var t={};var n=get_element(e);var r="";if(i>1){r=""+(e+1)+"/"+i+""}t.title=n.attr("data-bootstro-title")||"";if(t.title!=""&&r!="")t.title=r+" - "+t.title;else if(t.title=="")t.title=r;t.content=n.attr("data-bootstro-content")||"";t.content=l(t.content,e);t.placement=n.attr("data-bootstro-placement")||"top";var s="";if(n.attr("data-bootstro-width")){t.width=n.attr("data-bootstro-width");s=s+"width:"+n.attr("data-bootstro-width")+";"}if(n.attr("data-bootstro-height")){t.height=n.attr("data-bootstro-height");s=s+"height:"+n.attr("data-bootstro-height")+";"}t.trigger="manual";t.html=n.attr("data-bootstro-html")||"top";t.template='

'+"
";return t};e.destroy_popover=function(e){var e=e||0;if(e!="all"){var t=get_element(e);t.popover("destroy").removeClass("bootstro-highlight")}};e.stop=function(){e.destroy_popover(o);e.unbind();t("div.bootstro-backdrop").remove();if(typeof a.onExit=="function")a.onExit.call(this,{idx:o})};e.go_to=function(n){e.destroy_popover(o);if(i!=0){var r=get_popup(n);var s=get_element(n);s.popover(r).popover("show");var u=t(window).scrollTop();var l=Math.min(t(".popover.in").offset().top,s.offset().top);var c=l-u;if(c0&&t("div.bootstro-backdrop").length===0){t('
').appendTo("body");e.bind();e.go_to(0)}};e.start=function(n,r){a=t.extend(true,{},u);t.extend(a,r||{});if(typeof a.url!="undefined"){t.ajax({url:a.url,success:function(r){if(r.success){var i=r.result;var s=[];t.each(i,function(e,n){t.each(n,function(e,r){t(n.selector).attr("data-bootstro-"+e,r)});if(t(n.selector).is(":visible"))s.push(n.selector)});n=s.join(",");e._start(n)}}})}else{e._start(n)}};e.bind=function(){e.unbind();t("html").on("click.bootstro",".bootstro-next-btn",function(t){e.next();t.preventDefault();return false});t("html").on("click.bootstro",".bootstro-prev-btn",function(t){e.prev();t.preventDefault();return false});t("html").on("click.bootstro",".bootstro-finish-btn",function(t){e.stop()});if(a.stopOnBackdropClick){t("html").on("click.bootstro","div.bootstro-backdrop",function(n){if(t(n.target).hasClass("bootstro-backdrop"))e.stop()})}t(document).on("keydown.bootstro",function(t){var n=t.keyCode?t.keyCode:t.which;if(n==39||n==40)e.next();else if(n==37||n==38)e.prev();else if(n==27&&a.stopOnEsc)e.stop()})};e.unbind=function(){t("html").unbind("click.bootstro");t(document).unbind("keydown.bootstro")}})(window.bootstro=window.bootstro||{},jQuery)}) +$(document).ready(function(){(function(e,t,n){function f(e){var n=t(window).scrollTop();var r=n+t(window).height();var i=e.offset().top;var s=i+e.height();return s>=n&&i<=r&&s<=r&&i>=n}function l(e,t){var n=get_element(t);var r,s,o;e=e+"
";if(n.attr("data-bootstro-nextButton")){r=n.attr("data-bootstro-nextButton")}else if(n.attr("data-bootstro-nextButtonText")){r='"}else{if(typeof a.nextButton!="undefined")r=a.nextButton;else r='"}if(n.attr("data-bootstro-prevButton")){s=n.attr("data-bootstro-prevButton")}else if(n.attr("data-bootstro-prevButtonText")){s='"}else{if(typeof a.prevButton!="undefined")s=a.prevButton;else s='"}if(n.attr("data-bootstro-finishButton")){o=n.attr("data-bootstro-finishButton")}else if(n.attr("data-bootstro-finishButtonText")){o='"}else{if(typeof a.finishButton!="undefined")o=a.finishButton;else o='"}if(i!=1){if(t==0)e=e+r;else if(t==i-1)e=e+s;else e=e+r+s}e=e+"
";e=e+'
'+o+"
";return e}var r;var i;var s=[];var o=null;var u={nextButtonText:"Next »",prevButtonText:"« Prev",finishButtonText:' Ok I got it, get back to the site',stopOnBackdropClick:true,stopOnEsc:true,margin:100};var a;get_element=function(e){if(r.filter("[data-bootstro-step="+e+"]").length>0)return r.filter("[data-bootstro-step="+e+"]");else{return r.eq(e)}};get_popup=function(e){var t={};var n=get_element(e);var r="";if(i>1){r=""+(e+1)+"/"+i+""}t.title=n.attr("data-bootstro-title")||"";if(t.title!=""&&r!="")t.title=r+" - "+t.title;else if(t.title=="")t.title=r;t.content=n.attr("data-bootstro-content")||"";t.content=l(t.content,e);t.placement=n.attr("data-bootstro-placement")||"top";var s="";if(n.attr("data-bootstro-width")){t.width=n.attr("data-bootstro-width");s=s+"width:"+n.attr("data-bootstro-width")+";"}if(n.attr("data-bootstro-height")){t.height=n.attr("data-bootstro-height");s=s+"height:"+n.attr("data-bootstro-height")+";"}t.trigger="manual";t.html=n.attr("data-bootstro-html")||"top";t.template='

'+"
";return t};e.destroy_popover=function(e){var e=e||0;if(e!="all"){var t=get_element(e);t.popover("destroy").removeClass("bootstro-highlight")}};e.stop=function(){e.destroy_popover(o);e.unbind();t("div.bootstro-backdrop").remove();if(typeof a.onExit=="function")a.onExit.call(this,{idx:o})};e.go_to=function(n){e.destroy_popover(o);if(i!=0){var r=get_popup(n);var s=get_element(n);s.popover(r).popover("show");var u=t(window).scrollTop();var l=Math.min(t(".popover.in").offset().top,s.offset().top);var c=l-u;if(c0&&t("div.bootstro-backdrop").length===0){t('
').appendTo("body");e.bind();e.go_to(0)}};e.start=function(n,r){a=t.extend(true,{},u);t.extend(a,r||{});if(typeof a.url!="undefined"){t.ajax({url:a.url,success:function(r){if(r.success){var i=r.result;var s=[];t.each(i,function(e,n){t.each(n,function(e,r){t(n.selector).attr("data-bootstro-"+e,r)});if(t(n.selector).is(":visible"))s.push(n.selector)});n=s.join(",");e._start(n)}}})}else{e._start(n)}};e.bind=function(){e.unbind();t("html").on("click.bootstro",".bootstro-next-btn",function(t){e.next();t.preventDefault();return false});t("html").on("click.bootstro",".bootstro-prev-btn",function(t){e.prev();t.preventDefault();return false});t("html").on("click.bootstro",".bootstro-finish-btn",function(t){e.stop()});if(a.stopOnBackdropClick){t("html").on("click.bootstro","div.bootstro-backdrop",function(n){if(t(n.target).hasClass("bootstro-backdrop"))e.stop()})}t(document).on("keydown.bootstro",function(t){var n=t.keyCode?t.keyCode:t.which;if(n==39||n==40)e.next();else if(n==37||n==38)e.prev();else if(n==27&&a.stopOnEsc)e.stop()})};e.unbind=function(){t("html").unbind("click.bootstro");t(document).unbind("keydown.bootstro")}})(window.bootstro=window.bootstro||{},jQuery)}) From 4b2e5488f14f1bcac68f3355d2353377a5a04364 Mon Sep 17 00:00:00 2001 From: Joseph Schipper Date: Mon, 24 Sep 2018 08:20:46 -0400 Subject: [PATCH 2/3] Delete bootstro.min.js --- bootstro.min.js | 1 - 1 file changed, 1 deletion(-) delete mode 100644 bootstro.min.js diff --git a/bootstro.min.js b/bootstro.min.js deleted file mode 100644 index 61b28d6..0000000 --- a/bootstro.min.js +++ /dev/null @@ -1 +0,0 @@ -$(document).ready(function(){(function(e,t,n){function f(e){var n=t(window).scrollTop();var r=n+t(window).height();var i=e.offset().top;var s=i+e.height();return s>=n&&i<=r&&s<=r&&i>=n}function l(e,t){var n=get_element(t);var r,s,o;e=e+"
";if(n.attr("data-bootstro-nextButton")){r=n.attr("data-bootstro-nextButton")}else if(n.attr("data-bootstro-nextButtonText")){r='"}else{if(typeof a.nextButton!="undefined")r=a.nextButton;else r='"}if(n.attr("data-bootstro-prevButton")){s=n.attr("data-bootstro-prevButton")}else if(n.attr("data-bootstro-prevButtonText")){s='"}else{if(typeof a.prevButton!="undefined")s=a.prevButton;else s='"}if(n.attr("data-bootstro-finishButton")){o=n.attr("data-bootstro-finishButton")}else if(n.attr("data-bootstro-finishButtonText")){o='"}else{if(typeof a.finishButton!="undefined")o=a.finishButton;else o='"}if(i!=1){if(t==0)e=e+r;else if(t==i-1)e=e+s;else e=e+r+s}e=e+"
";e=e+'
'+o+"
";return e}var r;var i;var s=[];var o=null;var u={nextButtonText:"Next »",prevButtonText:"« Prev",finishButtonText:' Ok I got it, get back to the site',stopOnBackdropClick:true,stopOnEsc:true,margin:100};var a;get_element=function(e){if(r.filter("[data-bootstro-step="+e+"]").length>0)return r.filter("[data-bootstro-step="+e+"]");else{return r.eq(e)}};get_popup=function(e){var t={};var n=get_element(e);var r="";if(i>1){r=""+(e+1)+"/"+i+""}t.title=n.attr("data-bootstro-title")||"";if(t.title!=""&&r!="")t.title=r+" - "+t.title;else if(t.title=="")t.title=r;t.content=n.attr("data-bootstro-content")||"";t.content=l(t.content,e);t.placement=n.attr("data-bootstro-placement")||"top";var s="";if(n.attr("data-bootstro-width")){t.width=n.attr("data-bootstro-width");s=s+"width:"+n.attr("data-bootstro-width")+";"}if(n.attr("data-bootstro-height")){t.height=n.attr("data-bootstro-height");s=s+"height:"+n.attr("data-bootstro-height")+";"}t.trigger="manual";t.html=n.attr("data-bootstro-html")||"top";t.template='

'+"
";return t};e.destroy_popover=function(e){var e=e||0;if(e!="all"){var t=get_element(e);t.popover("destroy").removeClass("bootstro-highlight")}};e.stop=function(){e.destroy_popover(o);e.unbind();t("div.bootstro-backdrop").remove();if(typeof a.onExit=="function")a.onExit.call(this,{idx:o})};e.go_to=function(n){e.destroy_popover(o);if(i!=0){var r=get_popup(n);var s=get_element(n);s.popover(r).popover("show");var u=t(window).scrollTop();var l=Math.min(t(".popover.in").offset().top,s.offset().top);var c=l-u;if(c0&&t("div.bootstro-backdrop").length===0){t('
').appendTo("body");e.bind();e.go_to(0)}};e.start=function(n,r){a=t.extend(true,{},u);t.extend(a,r||{});if(typeof a.url!="undefined"){t.ajax({url:a.url,success:function(r){if(r.success){var i=r.result;var s=[];t.each(i,function(e,n){t.each(n,function(e,r){t(n.selector).attr("data-bootstro-"+e,r)});if(t(n.selector).is(":visible"))s.push(n.selector)});n=s.join(",");e._start(n)}}})}else{e._start(n)}};e.bind=function(){e.unbind();t("html").on("click.bootstro",".bootstro-next-btn",function(t){e.next();t.preventDefault();return false});t("html").on("click.bootstro",".bootstro-prev-btn",function(t){e.prev();t.preventDefault();return false});t("html").on("click.bootstro",".bootstro-finish-btn",function(t){e.stop()});if(a.stopOnBackdropClick){t("html").on("click.bootstro","div.bootstro-backdrop",function(n){if(t(n.target).hasClass("bootstro-backdrop"))e.stop()})}t(document).on("keydown.bootstro",function(t){var n=t.keyCode?t.keyCode:t.which;if(n==39||n==40)e.next();else if(n==37||n==38)e.prev();else if(n==27&&a.stopOnEsc)e.stop()})};e.unbind=function(){t("html").unbind("click.bootstro");t(document).unbind("keydown.bootstro")}})(window.bootstro=window.bootstro||{},jQuery)}) From a741d6a008c1c36ee7bdba1b2096f32bc8701d3d Mon Sep 17 00:00:00 2001 From: Joseph Schipper Date: Mon, 24 Sep 2018 08:21:18 -0400 Subject: [PATCH 3/3] Delete bootstro.min.css --- bootstro.min.css | 1 - 1 file changed, 1 deletion(-) delete mode 100644 bootstro.min.css diff --git a/bootstro.min.css b/bootstro.min.css deleted file mode 100644 index cd314a5..0000000 --- a/bootstro.min.css +++ /dev/null @@ -1 +0,0 @@ -.bootstro-next-btn{float:right}.bootstro-prev-btn{float:left}.bootstro-backdrop{opacity:.5;background-color:#000;bottom:0;left:0;position:fixed;right:0;top:0;z-index:1;filter:alpha(opacity=50)}.bootstro-highlight{z-index:9999;position:relative;border:1px solid white;background-color:white}.bootstro-finish-btn-wrapper{padding-top:10px;text-align:center;clear:both}.bootstro-nav-wrapper{margin-top:10px}.bootstro-nav-wrapper button,.bootstro-finish-btn-wrapper button{font-size:12px!important;padding:3px 5px 3px 5px!important;font-weight:bold}