From 541a4ccd3c9e86eb9f3db7fff4e259ca83de8154 Mon Sep 17 00:00:00 2001 From: "Michael J. Radwin" Date: Mon, 11 Nov 2024 21:28:04 -0800 Subject: [PATCH] Enable Yizkor as optional checkbox --- package.json | 2 +- src/common.js | 4 ++++ src/deserializeDownload.js | 1 + src/download.proto | 1 + src/download_pb.cjs | 32 +++++++++++++++++++++++++++++++- src/makeDownloadProps.js | 1 + views/partials/hebcal-form.ejs | 5 +++++ 7 files changed, 44 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 83312083..3b440828 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "rollup": "^4.25.0" }, "dependencies": { - "@hebcal/core": "^5.8.0", + "@hebcal/core": "^5.8.2", "@hebcal/geo-sqlite": "^5.0.6", "@hebcal/hdate": "^0.12.0", "@hebcal/icalendar": "^6.0.2", diff --git a/src/common.js b/src/common.js index 4f537fc2..0383c71c 100644 --- a/src/common.js +++ b/src/common.js @@ -110,6 +110,7 @@ const optsToMask = { ykk: flags.YOM_KIPPUR_KATAN, molad: flags.MOLAD, min: flags.MINOR_HOLIDAY, + yzkr: flags.YIZKOR, }; const booleanOpts = { @@ -126,6 +127,7 @@ const booleanOpts = { molad: 'molad', yto: 'yomTovOnly', ue: 'useElevation', + yzkr: 'yizkor', }; export const dailyLearningOpts = { @@ -1328,6 +1330,7 @@ export const queryToName = { yyomi: 'Yerushalmi Yomi', dw: 'Daf-a-Week', dpa: 'Pirkei Avot', + yzkr: 'Yizkor', }; export const queryLongDescr = { @@ -1347,6 +1350,7 @@ export const queryLongDescr = { yyomi: 'Jerusalem Talmud (Vilna Edition)', dw: 'One page of Babylonian Talmud per week', dpa: 'Ethics of our Fathers, studied on Shabbat between Pesach and Rosh Hashana', + yzkr: 'Ashkenazi Jewish memorial prayer service for the dead recited in synagogue during four holidays yearly', }; /** diff --git a/src/deserializeDownload.js b/src/deserializeDownload.js index 2b734115..0bee6066 100644 --- a/src/deserializeDownload.js +++ b/src/deserializeDownload.js @@ -63,6 +63,7 @@ export function deserializeDownload(data) { if (msg.getTanakhyomi()) q.dty = 'on'; if (msg.getPirkeiavotsummer()) q.dpa = 'on'; if (msg.getUseelevation()) q.ue = 'on'; + if (msg.getYizkor()) q.yzkr = 'on'; q.month = msg.getMonth() || undefined; if (msg.getGeopos()) { q.latitude = msg.hasOldLatitude() ? msg.getOldLatitude() : msg.getLatitude(); diff --git a/src/download.proto b/src/download.proto index 1bcfdfc9..f85e6006 100644 --- a/src/download.proto +++ b/src/download.proto @@ -71,4 +71,5 @@ message Download { bool useElevation = 53; bool tanakhYomi = 54; bool pirkeiAvotSummer = 55; + bool yizkor = 56; } diff --git a/src/download_pb.cjs b/src/download_pb.cjs index 635b2d52..b1831790 100644 --- a/src/download_pb.cjs +++ b/src/download_pb.cjs @@ -205,7 +205,8 @@ proto.Download.toObject = function(includeInstance, msg) { elev: jspb.Message.getFieldWithDefault(msg, 52, 0), useelevation: jspb.Message.getBooleanFieldWithDefault(msg, 53, false), tanakhyomi: jspb.Message.getBooleanFieldWithDefault(msg, 54, false), - pirkeiavotsummer: jspb.Message.getBooleanFieldWithDefault(msg, 55, false) + pirkeiavotsummer: jspb.Message.getBooleanFieldWithDefault(msg, 55, false), + yizkor: jspb.Message.getBooleanFieldWithDefault(msg, 56, false) }; if (includeInstance) { @@ -450,6 +451,10 @@ proto.Download.deserializeBinaryFromReader = function(msg, reader) { var value = /** @type {boolean} */ (reader.readBool()); msg.setPirkeiavotsummer(value); break; + case 56: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setYizkor(value); + break; default: reader.skipField(); break; @@ -843,6 +848,13 @@ proto.Download.serializeBinaryToWriter = function(message, writer) { f ); } + f = message.getYizkor(); + if (f) { + writer.writeBool( + 56, + f + ); + } }; @@ -1935,4 +1947,22 @@ proto.Download.prototype.setPirkeiavotsummer = function(value) { }; +/** + * optional bool yizkor = 56; + * @return {boolean} + */ +proto.Download.prototype.getYizkor = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 56, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.Download} returns this + */ +proto.Download.prototype.setYizkor = function(value) { + return jspb.Message.setProto3BooleanField(this, 56, value); +}; + + goog.object.extend(exports, proto); diff --git a/src/makeDownloadProps.js b/src/makeDownloadProps.js index dcd59958..9eefbdaa 100644 --- a/src/makeDownloadProps.js +++ b/src/makeDownloadProps.js @@ -91,6 +91,7 @@ export function downloadHref2(query, filename, override={}) { if (on(q.dw)) msg.setDafweekly(true); if (on(q.dty)) msg.setTanakhyomi(true); if (on(q.dpa)) msg.setPirkeiavotsummer(true); + if (on(q.yzkr)) msg.setYizkor(true); if (on(q.ue)) msg.setUseelevation(true); diff --git a/views/partials/hebcal-form.ejs b/views/partials/hebcal-form.ejs index 5c1af744..1d677331 100644 --- a/views/partials/hebcal-form.ejs +++ b/views/partials/hebcal-form.ejs @@ -65,6 +65,11 @@ if (typeof year !== 'string' || year.length === 0) {  
+ id="yzkr"> + +   +
id="s">