Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<style id="jsbin-css">
.page {
display: none;
@bluemango
bluemango / gist:4177246
Last active April 11, 2017 19:15
Zendesk/Desk.com ScreenSteps CSS
/* ScreenSteps Article CSS */
div.screensteps-document h2, div.screensteps-document h3 { margin: .83em 0; }
div.screensteps-document .image img {
padding: 5px 0px;
display: block;
max-width: 100%;
height: auto;
}
@bluemango
bluemango / screensteps-zendesk.js
Last active August 12, 2016 17:01
Zendesk JS for foldable sections
// Begin ScreenSteps
$(document).ready(function() {
$('.screensteps-nested-content').hide();
$('.screensteps-foldable-content-parent').click(function(event) {
event.preventDefault();
var stepId = $(event.target).attr('id').split('screensteps-step-')[1];
if (stepId) {
var contentId = ["nested-step", stepId].join("-");
$(event.target).toggleClass('expanded');
$('.screensteps-active-step').removeClass('screensteps-active-step');
@bluemango
bluemango / expand.js
Created June 9, 2016 01:34
Expand foldable section.js
$(document).ready(function($) {
if (window.location.hash) {
var anchor = window.location.hash;
var el = $(anchor);
var parents = $(el).parents('.nested-article');
$(parents).show();
$(parents).prev().addClass('expanded');
location.hash = null;
location.hash = anchor;
});
Given these values:
first_name: 'bob'
email: 'bob@mail.com'
timestamp: '1461844665'
token: 'abc123'
The canoncial string should equal: 'bobbob@mail.comabc1231461844665'
The hash should equal: '833896248e2e157e7ea3561afaa38164'
@bluemango
bluemango / Our ScreenSteps Overrides.css
Created September 19, 2013 12:02
The overrides we use for CSS on our own ScreenSteps site
#screensteps-content-wrapper { margin-top: 40px; font-size: 14px;}
#screensteps-content-wrapper li ul,
#screensteps-content-wrapper li ol { margin: 0 1.5em; }
#screensteps-content-wrapper ul { list-style: disc; }
#screensteps-content-wrapper ol { list-style: decimal; }
#screensteps-content-wrapper { line-height:normal;}
#screensteps-content-wrapper a { text-decoration:underline;}
#screensteps-content-wrapper ul li,
#screensteps-content-wrapper ol li { margin-bottom: 10px; }
#screensteps-content-wrapper .asset-list li a { line-height: 19px;}
<!DOCTYPE html>
<html>
<head>
<meta content='text/html;charset=UTF-8' http-equiv='Content-Type'>
<title>{{ page_title }}</title>
<meta name='description' content='{{ page_description }}'>
{{ javascripts }}
<!-- This stylesheet includes the full ScreenSteps CSS. It may conflict with your own styles. -->
<link rel="stylesheet" type="text/css" href="/stylesheets/screensteps-site.css">
@bluemango
bluemango / gist:5437086
Last active December 16, 2015 12:49
Hide Next/Previous labels
$(document).ready(function($) {
var prevLi;
var nextLi;
var prevLink;
var nextLink;
prevLi = $('.screensteps-next-prev-navigation li.previous')
nextLi = $('.screensteps-next-prev-navigation li.next')
prevLink = $('.screensteps-next-prev-navigation li.previous a').first()
nextLink = $('.screensteps-next-prev-navigation li.next a').first()
@bluemango
bluemango / gist:4985549
Last active December 13, 2015 22:38
Zendesk Forum/ScreenSteps Live search that defaults to forum search.
var home_search = jQuery("#suggestion_submit");
if (home_search) {
var search_url = "http://help.bluemangolearning.com/searches";
jQuery("#search_box").text("Search");
home_search.val("Search Forums");
var html_string = '<input type="submit" name="commit" value="Search Docs" class="button search" id="screensteps-search-submit"/>';
home_search.after(html_string);
jQuery("#screensteps-search-submit").click(function(e){
var search_string = jQuery("#suggestions_query").val();
var query_string = jQuery("#suggestions_query").val().replace(/\s/g,"+");
@bluemango
bluemango / gist:4589419
Last active December 11, 2015 10:48
ScreenStepsLive Ruby Wrapper example
# this will only give you the id of the space, not its contents
s = ScreenStepsLiveAPI::Space.find(:first)
# now load the contents
s.reload
# load the first manual