Skip to content

Commit

Permalink
Move old packages
Browse files Browse the repository at this point in the history
  • Loading branch information
tmetzl committed Oct 23, 2024
1 parent 6cdcb7a commit 7feaadb
Show file tree
Hide file tree
Showing 85 changed files with 73 additions and 71 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class AssignmentViewToolbar {
}
CellToolbar.register_callback(
"assignment_view.create_header",
_.bind(this.create_header, this)
_.bind(this.create_header, this),
);
let preset = ["assignment_view.create_header"];
CellToolbar.register_preset(this.preset_name, preset, Jupyter.notebook);
Expand Down Expand Up @@ -159,7 +159,7 @@ export class AssignmentViewToolbar {
celltoolbar.rebuild();
});
$(div).append(
$("<span/>").append(edit_btn).append(btn).addClass("cell_control")
$("<span/>").append(edit_btn).append(btn).addClass("cell_control"),
);
}
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const PRESET_API_ROOT = urlJoin(
"e2x",
"authoring",
"api",
"presets"
"presets",
);

const API = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function manage_tags() {

let name = $("<tr/>");
name.append(
$("<td/>").append($("<span/>").text("Tags: (separate by comma)"))
$("<td/>").append($("<span/>").text("Tags: (separate by comma)")),
);

table.append(name);
Expand Down Expand Up @@ -76,8 +76,8 @@ export function insert_question_preset_dialog(preset_name, callback) {
$("<input/>")
.attr("type", "text")
.attr("id", "taskname")
.val(get_valid_task_name())
)
.val(get_valid_task_name()),
),
);

let pointRow = $("<tr/>")
Expand All @@ -90,8 +90,8 @@ export function insert_question_preset_dialog(preset_name, callback) {
.attr("type", "number")
.attr("id", "points")
.attr("min", "0")
.val(0)
)
.val(0),
),
);

let body = $("<div/>").append(table.append(nameRow).append(pointRow));
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export function get_file_options() {
let path = Jupyter.utils.url_path_join(
Jupyter.notebook.base_url,
"tree",
Jupyter.notebook.notebook_path.replace(Jupyter.notebook.notebook_name, "")
Jupyter.notebook.notebook_path.replace(Jupyter.notebook.notebook_name, ""),
);
return [
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function add_unsafe_renderer() {
that.unrender();
that.render();
}, 100);
})
}),
);
});
// links in markdown cells should open in new tabs
Expand All @@ -72,7 +72,7 @@ export function add_unsafe_renderer() {
that.events.trigger("rendered.MarkdownCell", {
cell: that,
});
}
},
);
}
return cont;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class E2xCell {
that.cell.unrender_force();
that.cell.keyboard_manager.enable();
})
.append("Edit cell")
.append("Edit cell"),
);
html.append(container);
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ export class SinglechoiceCell extends ChoiceCell {
choices.indexOf(i.toString()) >= 0,
function () {
that.set_choice(this.value);
}
},
);
Jupyter.keyboard_manager.register_events(input);
form.append(
$("<div>")
.append(input)
.append("&nbsp;&nbsp;")
.append(items[i].childNodes)
.append(items[i].childNodes),
);
}
$(list).replaceWith(form);
Expand Down Expand Up @@ -144,7 +144,7 @@ export class MultiplechoiceCell extends ChoiceCell {
let input = this.create_checkbox(
"my_checkbox",
i,
choices.indexOf(i.toString()) >= 0
choices.indexOf(i.toString()) >= 0,
);
Jupyter.keyboard_manager.register_events(input);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class DiagramCell extends E2xCell {
if (!this.model.hasAttachment("diagram.png")) {
this.model.setAttachment(
"diagram.png",
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAAAADwCAYAAABxLb1rAAAABHNCSVQICAgIfAhkiAAAAylJREFUeJzt1DEBACAMwDDAv+chY0cTB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lgECWAQJZBghkGSCQZYBAlgECWQYIZBkgkGWAQJYBAlkGCGQZIJBlgECWAQJZH97eBdx+cY1yAAAAAElFTkSuQmCC",
);
}
}
Expand All @@ -40,7 +40,9 @@ export class DiagramCell extends E2xCell {
let attachment_comment = "<!-- Display the diagram attachment -->";
if (this.cell.get_text().indexOf(attachment_string) == -1) {
this.cell.set_text(
[this.cell.get_text(), attachment_comment, attachment_string].join("\n")
[this.cell.get_text(), attachment_comment, attachment_string].join(
"\n",
),
);
}

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Webcam {
$("#takePhoto span").text("Retry");
}
})
.append($("<span/>").text("Take Photo"))
.append($("<span/>").text("Take Photo")),
);
body.append(controls);

Expand All @@ -73,7 +73,7 @@ class Webcam {
0,
0,
video[0].videoWidth,
video[0].videoHeight
video[0].videoHeight,
);
let dataUrl = tmpCanvas[0].toDataURL("image/png");
let key = that.model.getName("webcam", "png");
Expand Down Expand Up @@ -126,8 +126,8 @@ export class AttachmentGallery extends Observer {
.addClass("remove-file-modal")
.append(
$("<p/>").append(
"Are you sure you want to delete the file " + attachment.name + " ?"
)
"Are you sure you want to delete the file " + attachment.name + " ?",
),
);
let removeItem = $("<i/>").addClass("fa fa-trash");
removeItem.on("click", function () {
Expand Down Expand Up @@ -178,7 +178,7 @@ export class AttachmentGallery extends Observer {
.addClass("btn-e2x")
.append($("<i/>").addClass("fa fa-camera"))
.append("Webcam")
.on("click", () => new Webcam(this.model).open())
.on("click", () => new Webcam(this.model).open()),
);
let input_button = $("<button/>")
.addClass("btn-e2x")
Expand All @@ -193,7 +193,7 @@ export class AttachmentGallery extends Observer {
.attr("type", "file")
.attr("accept", "application/pdf,image/*")
.attr("multiple", "multiple")
.on("change", () => this.uploadFiles())
.on("change", () => this.uploadFiles()),
);

controls.append(input_button);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ async function fetchBaseOptions() {
if (!baseOptionsLoaded) {
try {
baseOptions = await requests.get(
urlJoin(Jupyter.notebook.base_url, "e2x", "diagrams", "api")
urlJoin(Jupyter.notebook.base_url, "e2x", "diagrams", "api"),
);
baseOptionsLoaded = true;
} catch (error) {
Expand Down Expand Up @@ -44,7 +44,7 @@ class DiagramEditor {
const actualOrigin = new URL(evt.origin);
if (actualOrigin.href !== expectedOrigin.href) {
console.log(
`Message should come from ${expectedOrigin.href} but came from ${actualOrigin.href}`
`Message should come from ${expectedOrigin.href} but came from ${actualOrigin.href}`,
);
}
if (
Expand Down Expand Up @@ -77,7 +77,7 @@ class DiagramEditor {
},
urlParams,
cell,
options
options,
).editElement(elt);
}
}
Expand All @@ -89,7 +89,7 @@ class DiagramEditor {
ui,
done,
urlParams,
options = {}
options = {},
) {
fetchBaseOptions().then(() => {
return this.editElement(cell, elt, config, ui, done, urlParams, options);
Expand Down Expand Up @@ -204,10 +204,7 @@ class DiagramEditor {

postMessage(msg) {
if (this.frame != null) {
this.frame.contentWindow.postMessage(
JSON.stringify(msg),
this.origin
);
this.frame.contentWindow.postMessage(JSON.stringify(msg), this.origin);
}
}

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class OptionDict {
let container = $("<div/>").addClass("e2x_options");

for (const [key, value] of Object.entries(
get_e2x_field(this.cell, "options")
get_e2x_field(this.cell, "options"),
)) {
if (value["type"] == "checkbox") {
let node = $("<div/>");
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class CreateAssignmentToolbar {
$("<input />")
.attr("disabled", "disabled")
.attr("type", "number")
.attr("id", "nbgrader-total-points")
.attr("id", "nbgrader-total-points"),
);
$("#maintoolbar-container").append(elem);
}
Expand All @@ -92,7 +92,7 @@ export class CreateAssignmentToolbar {
if (cell.element?.hasClass(that.highlight)) {
cell.element.removeClass(that.highlight);
}
}
},
);

// update total points when a cell is deleted
Expand All @@ -112,19 +112,19 @@ export class CreateAssignmentToolbar {
}
CellToolbar.register_callback(
"create_assignment.grading_options",
_.bind(this.create_celltype_select, this)
_.bind(this.create_celltype_select, this),
);
CellToolbar.register_callback(
"create_assignment.id_input",
_.bind(this.create_id_input, this)
_.bind(this.create_id_input, this),
);
CellToolbar.register_callback(
"create_assignment.points_input",
_.bind(this.create_points_input, this)
_.bind(this.create_points_input, this),
);
CellToolbar.register_callback(
"create_assignment.lock_cell",
_.bind(this.create_lock_cell_button, this)
_.bind(this.create_lock_cell_button, this),
);

let preset = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class NbgraderValidator {
"update the metadata on the command " +
"line using the following command: <code>nbgrader update " +
Jupyter.notebook.notebook_path +
"</code>"
"</code>",
);
this.warning = dialog.modal(modal_opts);
break;
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class ExamMenubar extends Menubar {
$("<span/>")
.css("padding", "0 1em 0 1em")
.append($(".kernel_indicator_name").css("padding-left", ".5em"))
.append($("#kernel_indicator_icon").css("padding-left", ".5em"))
.append($("#kernel_indicator_icon").css("padding-left", ".5em")),
);
}

Expand All @@ -34,9 +34,9 @@ export class ExamMenubar extends Menubar {
urlJoin(
Jupyter.notebook.base_url,
"e2x/help/static/",
entry[1]
entry[1],
),
"_blank"
"_blank",
);
},
});
Expand All @@ -53,7 +53,7 @@ export class ExamMenubar extends Menubar {
that.submit.prepare_submit();
})
.append("Submit")
.append($("<i/>").addClass("fa fa-paper-plane"))
.append($("<i/>").addClass("fa fa-paper-plane")),
);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ export class Submit {
.append(
$("<i/>")
.addClass("fa fa-spinner fa-spin")
.attr("id", "submit_spinner")
.attr("id", "submit_spinner"),
)
.append(
$("<p/>").text("Submitting exam. This may take a few seconds...")
)
)
$("<p/>").text("Submitting exam. This may take a few seconds..."),
),
),
);
}

Expand Down Expand Up @@ -145,12 +145,12 @@ export class Submit {

let body = $("<div/>");
body.append(
$("<h4/>").text("Something went wrong while submitting the assignment")
$("<h4/>").text("Something went wrong while submitting the assignment"),
);
body.append(
$("<p/>").append(
"Please try to submit via the assignments tab or contact a supervisor."
)
"Please try to submit via the assignments tab or contact a supervisor.",
),
);

dialog.modal({
Expand Down Expand Up @@ -178,7 +178,7 @@ export class Submit {
$("<p/>")
.append("You will receive your ")
.append($("<span/>").append("hashcode").attr("id", "hashcode_label"))
.append(" when you end the exam.")
.append(" when you end the exam."),
);

dialog.modal({
Expand All @@ -194,7 +194,10 @@ export class Submit {
window.location.href = utils.url_path_join(
Jupyter.notebook.base_url,
"view",
Jupyter.notebook.notebook_path.replace(".ipynb", "_hashcode.html")
Jupyter.notebook.notebook_path.replace(
".ipynb",
"_hashcode.html",
),
);
},
class: "btn-success",
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 7feaadb

Please sign in to comment.