Skip to content

Commit

Permalink
Add templates stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
travstone committed Jun 24, 2016
1 parent ffa1a3e commit 8dfed46
Showing 1 changed file with 84 additions and 2 deletions.
86 changes: 84 additions & 2 deletions src/js/hopscotch.js
Original file line number Diff line number Diff line change
Expand Up @@ -2431,8 +2431,90 @@
// Template includes, placed inside a closure to ensure we don't
// end up declaring our shim globally.
(function(){
// @@include('../../src/tl/_template_headers.js') //
// @@include('../../tmp/js/hopscotch_templates.js') //
var _ = {};
/*
* Adapted from the Underscore.js framework. Check it out at
* https://github.com/jashkenas/underscore
*/
_.escape = function(str){
if(customEscape){ return customEscape(str); }

if(str == null) return '';
return ('' + str).replace(new RegExp('[&<>"\']', 'g'), function(match){
if(match == '&'){ return '&amp;' }
if(match == '<'){ return '&lt;' }
if(match == '>'){ return '&gt;' }
if(match == '"'){ return '&quot;' }
if(match == "'"){ return '&#x27;' }
});
}
this["templates"] = this["templates"] || {};

this["templates"]["bubble_default"] = function(obj) {
obj || (obj = {});
var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
with (obj) {


function optEscape(str, unsafe){
if(unsafe){
return _.escape(str);
}
return str;
}
;
__p += '\n<div class="hopscotch-bubble-container" style="width: ' +
((__t = ( step.width )) == null ? '' : __t) +
'px; padding: ' +
((__t = ( step.padding )) == null ? '' : __t) +
'px;">\n ';
if(tour.isTour){ ;
__p += '<span class="hopscotch-bubble-number">' +
((__t = ( i18n.stepNum )) == null ? '' : __t) +
'</span>';
} ;
__p += '\n <div class="hopscotch-bubble-content">\n ';
if(step.title !== ''){ ;
__p += '<h3 class="hopscotch-title">' +
((__t = ( optEscape(step.title, tour.unsafe) )) == null ? '' : __t) +
'</h3>';
} ;
__p += '\n ';
if(step.content !== ''){ ;
__p += '<div class="hopscotch-content">' +
((__t = ( optEscape(step.content, tour.unsafe) )) == null ? '' : __t) +
'</div>';
} ;
__p += '\n </div>\n <div class="hopscotch-actions">\n ';
if(buttons.showPrev){ ;
__p += '<button class="hopscotch-nav-button prev hopscotch-prev">' +
((__t = ( i18n.prevBtn )) == null ? '' : __t) +
'</button>';
} ;
__p += '\n ';
if(buttons.showCTA){ ;
__p += '<button class="hopscotch-nav-button next hopscotch-cta">' +
((__t = ( buttons.ctaLabel )) == null ? '' : __t) +
'</button>';
} ;
__p += '\n ';
if(buttons.showNext){ ;
__p += '<button class="hopscotch-nav-button next hopscotch-next">' +
((__t = ( i18n.nextBtn )) == null ? '' : __t) +
'</button>';
} ;
__p += '\n </div>\n ';
if(buttons.showClose){ ;
__p += '<button class="hopscotch-bubble-close hopscotch-close">' +
((__t = ( i18n.closeTooltip )) == null ? '' : __t) +
'</button>';
} ;
__p += '\n</div>\n<div class="hopscotch-bubble-arrow-container hopscotch-arrow">\n <div class="hopscotch-bubble-arrow-border"></div>\n <div class="hopscotch-bubble-arrow"></div>\n</div>';

}
return __p
};
}.call(winHopscotch));

return winHopscotch;
Expand Down

0 comments on commit 8dfed46

Please sign in to comment.