• CSS

  • JS

  • CSS

  • General text
  • Card margins
  • Headings
  • Tagline
  • Other elements
  • Public interface
  • HTML export
  • CS + JSS
  • JS

  • gingkoPlusFixViewAsHTMLUrl
  • gingkoPlusGetAllCardLists
  • gingkoPlusGetParentCardElement
  • gingkoPlusGetParentCardElementById
  • gingkoPlusGetParentCardElementsByName
  • gingkoPlusHideEmptyCardLists
  • gingkoPlusHideParentCardsByName
  • EXECUTE

{"cards":[{"_id":"581429c4b110bfba4a019845","treeId":"581429c4b110bfba4a01982f","seq":8774305,"position":9,"parentId":null,"content":"<h3 class=\"hide-card\">CSS</h3>"},{"_id":"581429c4b110bfba4a019846","treeId":"581429c4b110bfba4a01982f","seq":8731091,"position":1,"parentId":"581429c4b110bfba4a019845","content":"<h3 class=\"hide-card\">CSS</h3>"},{"_id":"581429c4b110bfba4a019847","treeId":"581429c4b110bfba4a01982f","seq":8731092,"position":2,"parentId":"581429c4b110bfba4a019845","content":"<style class=\"hide-card\">\n\n.card h2, .card h3, .card h4, .card h5, .card h6 {\n margin-top: 10px; \n margin-bottom: 15px; \n}\n\n.card h2:first-child, .card h3:first-child, \n.card h4:first-child, .card h5:first-child, \n.card h6:first-child { \n margin-top: 0; \n}\n\n#c3 h3:last-child,\n.card h2:last-child, .card h3:last-child, \n.card h4:last-child, .card h5:last-child, \n.card h6:last-child { \n margin-bottom: 0; \n}\n\n</style>\n\n##### General text\n"},{"_id":"581429c4b110bfba4a019848","treeId":"581429c4b110bfba4a01982f","seq":8731093,"position":3,"parentId":"581429c4b110bfba4a019845","content":"<style class=\"hide-card\">\n\n#c2 h2 {\n padding-bottom: 10px;\n border-bottom: 1px dotted #ccc;\n}\n\n#c3 h3 {\n font-size: 14px;\n margin-bottom: 30px;\n}\n\n#c3 h4 {\n padding: 3px 6px;\n font-size: 90%;\n color: #c7254e;\n white-space: nowrap;\n background-color: #f9f2f4;\n}\n\nh1 code, h2 code, h3 code, h4 code, h5 code, h6 code {\n display: block;\n color: inherit;\n font-family: inherit;\n font-size: inherit;\n\n background-color: transparent;\n background-position: center right;\n background-repeat: no-repeat;\n background-size: 12px 10px;\n background-image: url(\"https://upload.wikimedia.org/wikipedia/commons/thumb/3/33/Octicons-arrow-right.svg/75px-Octicons-arrow-right.svg.png\");\n background-opacity: 0.5;\n}\n\n</style>\n\n##### Card margins\n"},{"_id":"581429c4b110bfba4a019849","treeId":"581429c4b110bfba4a01982f","seq":8731094,"position":4,"parentId":"581429c4b110bfba4a019845","content":"<style class=\"hide-card\">\n\n.card ol, .card ul {\n margin-bottom: 0px;\n}\n\n.card p {\n padding-bottom: 10px; \n}\n\n</style>\n\n##### Headings\n"},{"_id":"581429c4b110bfba4a01984a","treeId":"581429c4b110bfba4a01982f","seq":8731095,"position":5,"parentId":"581429c4b110bfba4a019845","content":"<style class=\"hide-card\">\n\n#tagline1, #tagline2 {\n text-align: right;\n}\n\n#tagline1:after {\n content: \" ...\";\n}\n\n#tagline2:before {\n content: \"... \";\n}\n\n#tagline2:first-letter { /*\n /* For Google Translate */\n text-transform: lowercase;\n}\n\n</style>\n\n##### Tagline\n"},{"_id":"581429c4b110bfba4a01984b","treeId":"581429c4b110bfba4a01982f","seq":8731096,"position":6,"parentId":"581429c4b110bfba4a019845","content":"<style class=\"hide-card\">\n\n#tagline1, #tagline2 {\n text-align: right;\n}\n\n#tagline1:after {\n content: \" ...\";\n}\n\n#tagline2:before {\n content: \"... \";\n}\n\n#tagline2:first-letter { /*\n /* For Google Translate */\n text-transform: lowercase;\n}\n\n</style>\n\n##### Other elements\n"},{"_id":"581429c4b110bfba4a01984c","treeId":"581429c4b110bfba4a01982f","seq":8731097,"position":7,"parentId":"581429c4b110bfba4a019845","content":"<style class=\"hide-card\">\n\n.navbar-public {\n padding-bottom: 5px;\n}\n\n.navbar-public h1, /* Logo */ \n.navbar-public .action[href^=\"/clone/\"] { /* Copy */ \n display: none;\n}\n\n.navbar-public .action[href^=\"javascript\"] { /* View As */\n position: absolute;\n top: 0;\n left: 0;\n}\n\n</style>\n\n##### Public interface\n"},{"_id":"581429c4b110bfba4a01984d","treeId":"581429c4b110bfba4a01982f","seq":8731098,"position":8,"parentId":"581429c4b110bfba4a019845","content":"<style class=\"hide-card\">\n\n.html-export p {\n position: relative;\n padding: 0 20px;\n}\n\n.html-export p < h3 {\n padding: 0;\n}\n\n.html-export h1, .html-export h2, .html-export h3 {\n margin: 40px 0;\n}\n\n.html-export h4, .html-export h5, .html-export h6 {\n margin: 30px 0;\n}\n\n.html-export h1 {\n text-align: center;\n}\n\n.html-export h1, .html-export h2, .html-export h3 {\n text-decoration: underline;\n}\n\n.html-export h2, .html-export h3, .html-export h4 {\n position: relative;\n left: -20px;\n}\n\n.html-export h4 {\n font-style: italic;\n}\n\n.html-export .tagline {\n text-decoration: none;\n}\n\n.html-export h1 code, .html-export h2 code,\n.html-export h3 code, .html-export h4 code,\n.html-export h3 code, .html-export h4 code {\n display: none;\n}\n\n.html-export .hide-card, \n.html-export .hide-card + h1,\n.html-export .hide-card + h2,\n.html-export .hide-card + h3,\n.html-export .hide-card + h4,\n.html-export .hide-card + h5, \n.html-export .hide-card + h6 {\n display: none;\n}\n\n</style>\n\n##### HTML export\n"},{"_id":"581429c4b110bfba4a01984e","treeId":"581429c4b110bfba4a01982f","seq":8731099,"position":9,"parentId":"581429c4b110bfba4a019845","content":"<style class=\"hide-card\">\n\n.card style + h1, .card script + h1,\n.card style + h2, .card script + h2,\n.card style + h3, .card script + h3,\n.card style + h4, .card script + h4,\n.card style + h5, .card script + h5,\n.card style + h6, .card script + h6 {\n margin-top: 0;\n}\n\n#c3 h3.hide-card {\n text-align: center;\n padding-bottom: 10px;\n border-bottom: 1px solid #ccc;\n}\n\n</style>\n\n##### CS + JSS\n"},{"_id":"581429c4b110bfba4a01984f","treeId":"581429c4b110bfba4a01982f","seq":8731128,"position":10,"parentId":null,"content":"<h3 class=\"hide-card\">JS</h3>"},{"_id":"581429c4b110bfba4a019850","treeId":"581429c4b110bfba4a01982f","seq":8731101,"position":1,"parentId":"581429c4b110bfba4a01984f","content":"<h3 class=\"hide-card\">JS</h3>"},{"_id":"581429c4b110bfba4a019851","treeId":"581429c4b110bfba4a01982f","seq":8731240,"position":2,"parentId":"581429c4b110bfba4a01984f","content":"<script type=\"text/javascript\" class=\"hide-card\">\n\nfunction gingkoPlusFixViewAsHTMLUrl (){\n\n /* Set the View As > HTML URL */\n\n var loc = window.location.href;\n var prefLen = 22; /* for \"https://gingkoapp.com/ */\n\n var vaUrl = loc.substring (prefLen) + \".html\";\n\n\n /* Set the Export > HTML URL */\n\n var appId, exUrl;\n var links = document.getElementsByTagName (\"a\");\n var found = false;\n\n /* Search for <a href=\"/clone/...\"> */\n\n for (i=0; i<links.length; i++) {\n\n var link = links[i];\n var href = link.getAttribute(\"href\");\n\n if (href == null || href.length < 8) continue;\n\n if (href.substring (0, 7) == \"/clone/\") {\n\n appId = href.substring (7);\n found = true;\n break;\n }\n }\n\n /* Return if /clone/ not found (is not public URL */\n\n if (found != true) return;\n\n exUrl = \"export/\" + appId + \".html\";\n\n\n /* The View As list has class save-as-dropdown */\n\n var sad = document.getElementsByClassName \n (\"save-as-dropdown\");\n\n if (sad.length == 0) return;\n\n /* Get list of View As elements */\n\n list = sad[0].getElementsByTagName (\"li\");\n\n if (list.length == 0) return;\n\n /* Find View As HTML list item */\n\n for (var i=0; i<list.length; i++) {\n\n /* Get the link */\n\n var item = list[i];\n var links = item.getElementsByTagName (\"a\");\n\n if (links.length == 0) return;\n\n var link = links[0];\n\n /* If link is vaUrl, set to exUrl and return */\n\n if (link.getAttribute (\"href\") == vaUrl) {\n\n link.setAttribute (\"href\", exUrl);\n\n return;\n }\n }\n\n}\n\n</script>\n\n##### gingkoPlusFixViewAsHTMLUrl"},{"_id":"581429c4b110bfba4a019852","treeId":"581429c4b110bfba4a01982f","seq":8731103,"position":3,"parentId":"581429c4b110bfba4a01984f","content":"<script class=\"hide-card\">\n\nfunction gingkoPlusGetAllCardLists () {\n\n return document.getElementsByClassName (\"cards\")\n}\n\n</script>\n\n##### gingkoPlusGetAllCardLists\n"},{"_id":"581429c4b110bfba4a019853","treeId":"581429c4b110bfba4a01982f","seq":8731104,"position":4,"parentId":"581429c4b110bfba4a01984f","content":"<script class=\"hide-card\">\n\nfunction gingkoPlusGetParentCardElement (elt) {\n\n if (typeof elt == \"undefined\" || elt == null) return;\n\n /* Check parent elements for card (with limit) */\n\n var found = false\n var limit = 20\n\n for (var j=0; j<20; j++) {\n\n elt = elt.parentElement;\n\n var id = elt.getAttribute (\"id\")\n\n if (id == null || id.length < 5) continue;\n\n if (id.substring(0,4) == \"card\") {\n\n return elt;\n }\n }\n}\n\n</script>\n\n##### gingkoPlusGetParentCardElement"},{"_id":"581429c4b110bfba4a019854","treeId":"581429c4b110bfba4a01982f","seq":8731105,"position":5,"parentId":"581429c4b110bfba4a01984f","content":"<script class=\"hide-card\">\n\nfunction gingkoPlusGetParentCardElementById (id) {\n\n if (typeof id != \"string\") return;\n\n var elt = document.getElementById (id)\n\n if (typeof elt == \"undefined\" || elt == null) return;\n\n return gingkoPlusGetParentCardElement (elt)\n}\n\n</script>\n\n##### gingkoPlusGetParentCardElementById"},{"_id":"581429c4b110bfba4a019855","treeId":"581429c4b110bfba4a01982f","seq":8731106,"position":6,"parentId":"581429c4b110bfba4a01984f","content":"<script class=\"hide-card\">\n\nfunction gingkoPlusGetParentCardElementsByName (name) {\n\n if (typeof name != \"string\") return;\n\n var elts = document.getElementsByClassName (name);\n\n if (elts == null || elts.length == 0) return;\n\n var cards = []\n var idx = 0\n\n for (var i=0; i<elts.length; i++) {\n\n var elt = elts[i];\n var card = gingkoPlusGetParentCardElement (elt)\n\n if (card == null) continue;\n\n cards[idx++] = card\n }\n\n return cards\n}\n\n</script>\n\n##### gingkoPlusGetParentCardElementsByName\n"},{"_id":"581429c4b110bfba4a019856","treeId":"581429c4b110bfba4a01982f","seq":8731107,"position":7,"parentId":"581429c4b110bfba4a01984f","content":"<script class=\"hide-card\">\n\nfunction gingkoPlusHideEmptyCardLists () {\n\n var lists = gingkoPlusGetAllCardLists ()\n\n if (lists == null || lists.length == 0) return;\n\n for (var i=0; i<lists.length; i++) {\n\n var list = lists[i]\n\n var elts = list.getElementsByTagName (\"li\")\n\n if (elts == null || elts.length == 0) {\n\n list.style.display = \"none\"\n continue;\n }\n\n var active = false\n\n for (var j=0; j<elts.length; j++) {\n\n if (elts[j].style.display != \"none\") {\n\n active = true\n break\n }\n }\n\n if (active == false) {\n\n list.style.display = \"none\"\n }\n }\n}\n\n</script>\n\n##### gingkoPlusHideEmptyCardLists\n"},{"_id":"581429c4b110bfba4a019857","treeId":"581429c4b110bfba4a01982f","seq":8731108,"position":8,"parentId":"581429c4b110bfba4a01984f","content":"<script class=\"hide-card\">\n\nfunction gingkoPlusHideParentCardsByName (name) {\n\n /* Check if is in application */\n\n if (window.location.href.substring(22,25) == \"app\") {\n return;\n }\n\n if (typeof name != \"string\") return;\n\n /* Get all card elements */\n\n var cards = gingkoPlusGetParentCardElementsByName \n (name);\n\n if (cards == null) return;\n\n /* Loop through cards except for this one */\n\n for (var i=0; i<cards.length; i++) {\n\n cards[i].style.display = \"none\";\n }\n\n gingkoPlusHideEmptyCardLists ()\n}\n\n</script>\n\n##### gingkoPlusHideParentCardsByName\n"},{"_id":"581429c4b110bfba4a019858","treeId":"581429c4b110bfba4a01982f","seq":8731270,"position":9,"parentId":"581429c4b110bfba4a01984f","content":"<script class=\"hide-card\">\n\nfunction gingkoPlus () {\n\n gingkoPlusFixViewAsHTMLUrl ()\n gingkoPlusHideParentCardsByName (\"hide-card\")\n}\n\ngingkoPlus ()\n\n</script>\n\n<h3 class=\"hide-card\">EXECUTE</h3> \n"}],"tree":{"_id":"581429c4b110bfba4a01982f","name":"gingkoplus.io","publicUrl":"gingko-plus"}}