This file contains 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 searchBook(isbn) { | |
// fetch the book information using Google API's ISBN search: | |
// https://developers.google.com/books/ | |
return $.get('https://www.googleapis.com/books/v1/volumes?q=isbn:' + isbn); | |
} | |
function initSearch($isbn) { | |
// Focus on the isbn input immediately | |
$isbn.focus(); | |
This file contains 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, code1, hexcode1, code2, hexcode2 | |
"COOL","sendir,1:1,1,38000,1,69,341,171,21,21,21,21,21,21,21,64,21,21,21,21,21,21,21,21,21,64,21,21,21,64,21,21,21,64,21,64,21,64,21,64,21,64,21,21,21,21,21,64,21,21,21,21,21,21,21,21,21,21,21,64,21,64,21,21,21,64,21,64,21,64,21,64,21,1555,341,86,21,3653","0000 006C 0022 0002 0155 00AB 0015 0015 0015 0015 0015 0015 0015 0040 0015 0015 0015 0015 0015 0015 0015 0015 0015 0040 0015 0015 0015 0040 0015 0015 0015 0040 0015 0040 0015 0040 0015 0040 0015 0040 0015 0015 0015 0015 0015 0040 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0040 0015 0040 0015 0015 0015 0040 0015 0040 0015 0040 0015 0040 0015 0613 0155 0056 0015 0E45",, | |
"ENERGY SAVER","sendir,1:1,1,38000,1,69,340,171,21,21,21,21,21,21,21,64,21,21,21,21,21,21,21,21,21,64,21,21,21,64,21,21,21,64,21,64,21,64,21,64,21,21,21,64,21,21,21,21,21,21,21,21,21,21,21,21,21,64,21,21,21,64,21,64,21,64,21,64,21,64,21,64,21,1555,340,86,21,3653","0000 006C 0022 0002 0154 00AB 0015 0015 0015 0015 0015 0015 0015 0040 0015 |
This file contains 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
$(document).ready(function(){ | |
//this assumes you have a file field in your form with id=image | |
//when this field is updated, run the function | |
$('#image').change(function(e){ | |
var file = this.files[0]; | |
var form = new FormData(); | |
form.append('files', file); | |
$.ajax({ | |
url : "https://api.knack.com/v1/applications/[YOUR APP ID]/assets/image/upload", | |
headers: {"x-knack-application-id":"YOUR APP ID", |
This file contains 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
var $headers = $('.article-body h1'); | |
if ($headers.length > 1) { | |
var $toc = $('<div class="toc">'); | |
var $firstUl = $('<ul>'); | |
var $currentUl = $firstUl; | |
var previous_level = 1; | |
$firstUl.appendTo($toc); | |
$toc.prependTo('section.article-info'); |
This file contains 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
// target a specific scene / page | |
$(document).on('knack-scene-render.scene_130', function(event, scene) { | |
scene.views.map(function(view) { // go through each scene view | |
if(Knack.models[view.key].data && Knack.models[view.key].data.length < 1) { // if view has row data AND that data is 0... | |
$('#' + view.key).remove(); // remove this specific view | |
} | |
}); | |
}); |
This file contains 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
$(document).on('knack-view-render.any', function () { | |
// add one of these lines per field you want to disabled | |
$('#field_72').attr("disabled", true) | |
}) |
This file contains 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
$(document).on('knack-view-render.any', function () { | |
$('a.register').attr("href", "https://yourcustomURLhere") | |
}) |
This file contains 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
$(document).on('knack-record-update.view_78', function (event, view, record) { | |
location.reload(); | |
}); |
This file contains 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
$(document).on('knack-view-render.view_194', function (event, view, data) { | |
var err_counter = 0; | |
/* Insert error panel. Hidden by default */ | |
$("<div class='kn-message error' id='app-errors'></div>").insertBefore("#view_194"); | |
$("#app-errors").hide(); | |
/* Conditions to Check */ | |
if (data.field_168 === "Yes") { |
This file contains 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
// If Tentative Field = Yes, Highlight Start / End Dates on Table | |
$(document).on('knack-records-render.view_140', function (event, view, records) { | |
$("table tr").each(function () { | |
var tentative = $(this).children("td:nth-child(14)").text().trim(); | |
var startDate = $(this).children("td:nth-child(5)"); | |
var endDate = $(this).children("td:nth-child(6)"); | |
if (tentative === "Yes") { | |
$(startDate).css('backgroundColor','yellow'); | |
$(endDate).css('backgroundColor','yellow'); |
NewerOlder