This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
//source file is https://docs.google.com/spreadsheet/ccc?key=0Ak0qDiMLT3XddHlNempadUs1djdkQ0tFLWF6ci1rUUE | |
$(function listBooks() { | |
$.getJSON( "https://spreadsheets.google.com/feeds/list/0Ak0qDiMLT3XddHlNempadUs1djdkQ0tFLWF6ci1rUUE/od6/public/values?alt=json-in-script&callback=?", | |
function (data) { | |
$('div#book-list').append('<ul class="items"></ul>'); | |
$.each(data.feed.entry, function(i,entry) { | |
var item = '<span style="display:none">' + entry.id.$t + '</span>'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function removeMultipleLineBreaks(element) { | |
if (!element) { | |
element = DocumentApp.getActiveDocument().getBody(); | |
} | |
var parent = element.getParent(); | |
// Remove empty paragraphs | |
if (element.getType() == DocumentApp.ElementType.PARAGRAPH | |
&& element.asParagraph().getText().replace(/\s/g, '') == '') { | |
if (!(parent.getType() == DocumentApp.ElementType.BODY_SECTION | |
&& parent.getChildIndex(element) == parent.getNumChildren() - 1)) { |
NewerOlder