Skip to content

Commit

Permalink
Enable Yizkor as optional checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed Nov 12, 2024
1 parent a4f8bb9 commit 541a4cc
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions src/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ const optsToMask = {
ykk: flags.YOM_KIPPUR_KATAN,
molad: flags.MOLAD,
min: flags.MINOR_HOLIDAY,
yzkr: flags.YIZKOR,
};

const booleanOpts = {
Expand All @@ -126,6 +127,7 @@ const booleanOpts = {
molad: 'molad',
yto: 'yomTovOnly',
ue: 'useElevation',
yzkr: 'yizkor',
};

export const dailyLearningOpts = {
Expand Down Expand Up @@ -1328,6 +1330,7 @@ export const queryToName = {
yyomi: 'Yerushalmi Yomi',
dw: 'Daf-a-Week',
dpa: 'Pirkei Avot',
yzkr: 'Yizkor',
};

export const queryLongDescr = {
Expand All @@ -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',
};

/**
Expand Down
1 change: 1 addition & 0 deletions src/deserializeDownload.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions src/download.proto
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,5 @@ message Download {
bool useElevation = 53;
bool tanakhYomi = 54;
bool pirkeiAvotSummer = 55;
bool yizkor = 56;
}
32 changes: 31 additions & 1 deletion src/download_pb.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -843,6 +848,13 @@ proto.Download.serializeBinaryToWriter = function(message, writer) {
f
);
}
f = message.getYizkor();
if (f) {
writer.writeBool(
56,
f
);
}
};


Expand Down Expand Up @@ -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);
1 change: 1 addition & 0 deletions src/makeDownloadProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
5 changes: 5 additions & 0 deletions views/partials/hebcal-form.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ if (typeof year !== 'string' || year.length === 0) {
<label class="form-check-label" for="ykk">Yom Kippur Katan</label>
&nbsp;<span title="Minor day of atonement occurring monthly on the day preceding each Rosh Chodesh" data-bs-toggle="tooltip" data-bs-animation="false" data-bs-placement="top"><svg class="icon icon-sm mt-n1"><use xlink:href="<%=spriteHref%>#bi-info-circle-fill"></use></svg></span>
</div><div class="form-check mb-2">
<input class="form-check-input" type="checkbox" name="yzkr" value="on" <%= q.yzkr === 'on' ? 'checked' : '' %> id="yzkr">
<label class="form-check-label" for="yzkr">Yizkor</label>
&nbsp;<span title="Ashkenazi Jewish memorial prayer service for the dead recited in synagogue during four holidays yearly"
data-bs-toggle="tooltip" data-bs-animation="false" data-bs-placement="top"><svg class="icon icon-sm mt-n1"><use xlink:href="<%=spriteHref%>#bi-info-circle-fill"></use></svg></span>
</div><div class="form-check mb-2">
<input class="form-check-input" type="checkbox" name="s" value="on" <%= q.s === 'on' ? 'checked' : '' %> id="s">
<label class="form-check-label" for="s">Weekly Torah portion on Saturdays</label>
</div></fieldset>
Expand Down

0 comments on commit 541a4cc

Please sign in to comment.