");
- this.picker = new Picker({
- parent: picker_wrapper,
- icon: this.get_icon(),
- icons: dv_icons_list,
- });
-
- this.$wrapper
- .popover({
- trigger: "manual",
- offset: `${-this.$wrapper.width() / 4.5}, 5`,
- boundary: "viewport",
- placement: "bottom",
- template: `
-
- `,
- content: () => picker_wrapper,
- html: true,
- })
- .on("show.bs.popover", () => {
- setTimeout(() => {
- this.picker.refresh();
- }, 10);
- })
- .on("hidden.bs.popover", () => {
- $("body").off("click.icon-popover");
- $(window).off("hashchange.icon-popover");
- });
-
- this.picker.on_change = (icon) => {
- this.set_value(icon);
- };
-
- if (!this.selected_icon) {
- this.selected_icon = $(
- `
`
- );
- this.selected_icon.html('
');
- this.selected_icon.insertAfter(this.$input);
- }
-
- this.$wrapper
- .find(".selected-icon")
- .parent()
- .on("click", (e) => {
- this.$wrapper.popover("toggle");
- if (!this.get_icon()) {
- this.$input.val("");
- }
- e.stopPropagation();
- $("body").on("click.icon-popover", (ev) => {
- if (!$(ev.target).parents().is(".popover")) {
- this.$wrapper.popover("hide");
- }
- });
- $(document).on("hashchange.icon-popover", () => {
- this.$wrapper.popover("hide");
- });
- });
- }
-
- refresh() {
- super.refresh();
- let icon = this.get_icon();
- if (this.picker && this.picker.icon !== icon) {
- this.picker.icon = icon;
- this.picker.refresh();
- }
- }
-
- set_formatted_input(value) {
- super.set_formatted_input(value);
- this.$input.val(value);
- this.selected_icon.html(`
`);
- this.selected_icon.toggleClass("no-value", !value);
- }
-
- get_icon() {
- return this.get_value() || 'fal fa-folder';
- }
-};
diff --git a/datavalue_theme_14/public/js/frappe/form/icon_picker/icon_picker.js b/datavalue_theme_14/public/js/frappe/form/icon_picker/icon_picker.js
deleted file mode 100644
index 996631f..0000000
--- a/datavalue_theme_14/public/js/frappe/form/icon_picker/icon_picker.js
+++ /dev/null
@@ -1,89 +0,0 @@
-class Picker {
- constructor(opts) {
- this.parent = opts.parent;
- this.width = opts.width;
- this.height = opts.height;
- this.set_icon(opts.icon);
- this.icons = opts.icons;
- this.setup_picker();
- }
-
- refresh() {
- this.update_icon_selected(true);
- }
-
- setup_picker() {
- this.icon_picker_wrapper = $(`
-
-
-
- ${frappe.utils.icon("search", "sm")}
-
-
-
- `);
- this.parent.append(this.icon_picker_wrapper);
- this.icon_wrapper = this.icon_picker_wrapper.find(".icons");
- this.search_input = this.icon_picker_wrapper.find(".search-icons > input");
- this.refresh();
- this.setup_icons();
- }
-
- setup_icons() {
- this.icons.forEach((icon) => {
- let $icon = $(
- `
`
- );
- this.icon_wrapper.append($icon);
- const set_values = () => {
- this.set_icon(icon);
- this.update_icon_selected();
- };
- $icon.on("click", () => {
- set_values();
- });
- $icon.keydown((e) => {
- const key_code = e.keyCode;
- if ([13, 32].includes(key_code)) {
- e.preventDefault();
- set_values();
- }
- });
- });
- this.search_input.keyup((e) => {
- e.preventDefault();
- this.filter_icons();
- });
-
- this.search_input.on("search", () => {
- this.filter_icons();
- });
- }
-
- filter_icons() {
- let value = this.search_input.val();
- console.log('filter_icons-value', value)
- if (!value) {
- this.icon_wrapper.find(".icon-wrapper").removeClass("hidden");
- } else {
- this.icon_wrapper.find(".icon-wrapper").addClass("hidden");
- this.icon_wrapper.find(`.icon-wrapper[id*='${value}']`).removeClass("hidden");
- }
- }
-
- update_icon_selected(silent) {
- !silent && this.on_change && this.on_change(this.get_icon());
- }
-
- set_icon(icon) {
- this.icon = icon || "";
- }
-
- get_icon() {
- return this.icon || "";
- }
-}
-
-export default Picker;
diff --git a/datavalue_theme_14/public/js/frappe/form/icon_picker/icons_list.js b/datavalue_theme_14/public/js/frappe/form/icon_picker/icons_list.js
deleted file mode 100644
index a0daaf8..0000000
--- a/datavalue_theme_14/public/js/frappe/form/icon_picker/icons_list.js
+++ /dev/null
@@ -1,795 +0,0 @@
-const dv_icons_list = [
- "fal fa-address-book",
- "fal fa-address-card",
- "fal fa-adjust",
- "fal fa-alarm-clock",
- "fal fa-align-center",
- "fal fa-align-justify",
- "fal fa-align-left",
- "fal fa-align-right",
- "fal fa-allergies",
- "fal fa-ambulance",
- "fal fa-american-sign-language-interpreting",
- "fal fa-anchor",
- "fal fa-angle-double-down",
- "fal fa-angle-double-left",
- "fal fa-angle-double-right",
- "fal fa-angle-double-up",
- "fal fa-angle-down",
- "fal fa-angle-left",
- "fal fa-angle-right",
- "fal fa-angle-up",
- "fal fa-archive",
- "fal fa-arrow-alt-circle-down",
- "fal fa-arrow-alt-circle-left",
- "fal fa-arrow-alt-circle-right",
- "fal fa-arrow-alt-circle-up",
- "fal fa-arrow-alt-down",
- "fal fa-arrow-alt-from-bottom",
- "fal fa-arrow-alt-from-left",
- "fal fa-arrow-alt-from-right",
- "fal fa-arrow-alt-from-top",
- "fal fa-arrow-alt-left",
- "fal fa-arrow-alt-right",
- "fal fa-arrow-alt-square-down",
- "fal fa-arrow-alt-square-left",
- "fal fa-arrow-alt-square-right",
- "fal fa-arrow-alt-square-up",
- "fal fa-arrow-alt-to-bottom",
- "fal fa-arrow-alt-to-left",
- "fal fa-arrow-alt-to-right",
- "fal fa-arrow-alt-to-top",
- "fal fa-arrow-alt-up",
- "fal fa-arrow-circle-down",
- "fal fa-arrow-circle-left",
- "fal fa-arrow-circle-right",
- "fal fa-arrow-circle-up",
- "fal fa-arrow-down",
- "fal fa-arrow-from-bottom",
- "fal fa-arrow-from-left",
- "fal fa-arrow-from-right",
- "fal fa-arrow-from-top",
- "fal fa-arrow-left",
- "fal fa-arrow-right",
- "fal fa-arrow-square-down",
- "fal fa-arrow-square-left",
- "fal fa-arrow-square-right",
- "fal fa-arrow-square-up",
- "fal fa-arrow-to-bottom",
- "fal fa-arrow-to-left",
- "fal fa-arrow-to-right",
- "fal fa-arrow-to-top",
- "fal fa-arrow-up",
- "fal fa-arrows",
- "fal fa-arrows-alt",
- "fal fa-arrows-alt-h",
- "fal fa-arrows-alt-v",
- "fal fa-arrows-h",
- "fal fa-arrows-v",
- "fal fa-assistive-listening-systems",
- "fal fa-asterisk",
- "fal fa-at",
- "fal fa-audio-description",
- "fal fa-backward",
- "fal fa-badge",
- "fal fa-badge-check",
- "fal fa-balance-scale",
- "fal fa-ban",
- "fal fa-band-aid",
- "fal fa-barcode",
- "fal fa-barcode-alt",
- "fal fa-barcode-read",
- "fal fa-barcode-scan",
- "fal fa-bars",
- "fal fa-baseball",
- "fal fa-baseball-ball",
- "fal fa-basketball-ball",
- "fal fa-basketball-hoop",
- "fal fa-bath",
- "fal fa-battery-bolt",
- "fal fa-battery-empty",
- "fal fa-battery-full",
- "fal fa-battery-half",
- "fal fa-battery-quarter",
- "fal fa-battery-slash",
- "fal fa-battery-three-quarters",
- "fal fa-bed",
- "fal fa-beer",
- "fal fa-bell",
- "fal fa-bell-slash",
- "fal fa-bicycle",
- "fal fa-binoculars",
- "fal fa-birthday-cake",
- "fal fa-blanket",
- "fal fa-blind",
- "fal fa-bold",
- "fal fa-bolt",
- "fal fa-bomb",
- "fal fa-book",
- "fal fa-book-heart",
- "fal fa-bookmark",
- "fal fa-bowling-ball",
- "fal fa-bowling-pins",
- "fal fa-box",
- "fal fa-box-alt",
- "fal fa-box-check",
- "fal fa-box-fragile",
- "fal fa-box-full",
- "fal fa-box-heart",
- "fal fa-box-open",
- "fal fa-box-up",
- "fal fa-box-usd",
- "fal fa-boxes",
- "fal fa-boxes-alt",
- "fal fa-boxing-glove",
- "fal fa-braille",
- "fal fa-briefcase",
- "fal fa-briefcase-medical",
- "fal fa-browser",
- "fal fa-bug",
- "fal fa-building",
- "fal fa-bullhorn",
- "fal fa-bullseye",
- "fal fa-burn",
- "fal fa-bus",
- "fal fa-calculator",
- "fal fa-calendar",
- "fal fa-calendar-alt",
- "fal fa-calendar-check",
- "fal fa-calendar-edit",
- "fal fa-calendar-exclamation",
- "fal fa-calendar-minus",
- "fal fa-calendar-plus",
- "fal fa-calendar-times",
- "fal fa-camera",
- "fal fa-camera-alt",
- "fal fa-camera-retro",
- "fal fa-capsules",
- "fal fa-car",
- "fal fa-caret-circle-down",
- "fal fa-caret-circle-left",
- "fal fa-caret-circle-right",
- "fal fa-caret-circle-up",
- "fal fa-caret-down",
- "fal fa-caret-left",
- "fal fa-caret-right",
- "fal fa-caret-square-down",
- "fal fa-caret-square-left",
- "fal fa-caret-square-right",
- "fal fa-caret-square-up",
- "fal fa-caret-up",
- "fal fa-cart-arrow-down",
- "fal fa-cart-plus",
- "fal fa-certificate",
- "fal fa-chart-area",
- "fal fa-chart-bar",
- "fal fa-chart-line",
- "fal fa-chart-pie",
- "fal fa-check",
- "fal fa-check-circle",
- "fal fa-check-square",
- "fal fa-chess",
- "fal fa-chess-bishop",
- "fal fa-chess-bishop-alt",
- "fal fa-chess-board",
- "fal fa-chess-clock",
- "fal fa-chess-clock-alt",
- "fal fa-chess-king",
- "fal fa-chess-king-alt",
- "fal fa-chess-knight",
- "fal fa-chess-knight-alt",
- "fal fa-chess-pawn",
- "fal fa-chess-pawn-alt",
- "fal fa-chess-queen",
- "fal fa-chess-queen-alt",
- "fal fa-chess-rook",
- "fal fa-chess-rook-alt",
- "fal fa-chevron-circle-down",
- "fal fa-chevron-circle-left",
- "fal fa-chevron-circle-right",
- "fal fa-chevron-circle-up",
- "fal fa-chevron-double-down",
- "fal fa-chevron-double-left",
- "fal fa-chevron-double-right",
- "fal fa-chevron-double-up",
- "fal fa-chevron-down",
- "fal fa-chevron-left",
- "fal fa-chevron-right",
- "fal fa-chevron-square-down",
- "fal fa-chevron-square-left",
- "fal fa-chevron-square-right",
- "fal fa-chevron-square-up",
- "fal fa-chevron-up",
- "fal fa-child",
- "fal fa-circle",
- "fal fa-circle-notch",
- "fal fa-clipboard",
- "fal fa-clipboard-check",
- "fal fa-clipboard-list",
- "fal fa-clock",
- "fal fa-clone",
- "fal fa-closed-captioning",
- "fal fa-cloud",
- "fal fa-cloud-download",
- "fal fa-cloud-download-alt",
- "fal fa-cloud-upload",
- "fal fa-cloud-upload-alt",
- "fal fa-club",
- "fal fa-code",
- "fal fa-code-branch",
- "fal fa-code-commit",
- "fal fa-code-merge",
- "fal fa-coffee",
- "fal fa-cog",
- "fal fa-cogs",
- "fal fa-columns",
- "fal fa-comment",
- "fal fa-comment-alt",
- "fal fa-comment-alt-check",
- "fal fa-comment-alt-dots",
- "fal fa-comment-alt-edit",
- "fal fa-comment-alt-exclamation",
- "fal fa-comment-alt-lines",
- "fal fa-comment-alt-minus",
- "fal fa-comment-alt-plus",
- "fal fa-comment-alt-slash",
- "fal fa-comment-alt-smile",
- "fal fa-comment-alt-times",
- "fal fa-comment-check",
- "fal fa-comment-dots",
- "fal fa-comment-edit",
- "fal fa-comment-exclamation",
- "fal fa-comment-lines",
- "fal fa-comment-minus",
- "fal fa-comment-plus",
- "fal fa-comment-slash",
- "fal fa-comment-smile",
- "fal fa-comment-times",
- "fal fa-comments",
- "fal fa-comments-alt",
- "fal fa-compass",
- "fal fa-compress",
- "fal fa-compress-alt",
- "fal fa-compress-wide",
- "fal fa-container-storage",
- "fal fa-conveyor-belt",
- "fal fa-conveyor-belt-alt",
- "fal fa-copy",
- "fal fa-copyright",
- "fal fa-couch",
- "fal fa-credit-card",
- "fal fa-credit-card-blank",
- "fal fa-credit-card-front",
- "fal fa-cricket",
- "fal fa-crop",
- "fal fa-crosshairs",
- "fal fa-cube",
- "fal fa-cubes",
- "fal fa-curling",
- "fal fa-cut",
- "fal fa-database",
- "fal fa-deaf",
- "fal fa-desktop",
- "fal fa-desktop-alt",
- "fal fa-diagnoses",
- "fal fa-diamond",
- "fal fa-dna",
- "fal fa-dollar-sign",
- "fal fa-dolly",
- "fal fa-dolly-empty",
- "fal fa-dolly-flatbed",
- "fal fa-dolly-flatbed-alt",
- "fal fa-dolly-flatbed-empty",
- "fal fa-donate",
- "fal fa-dot-circle",
- "fal fa-dove",
- "fal fa-download",
- "fal fa-dumbbell",
- "fal fa-edit",
- "fal fa-eject",
- "fal fa-ellipsis-h",
- "fal fa-ellipsis-h-alt",
- "fal fa-ellipsis-v",
- "fal fa-ellipsis-v-alt",
- "fal fa-envelope",
- "fal fa-envelope-open",
- "fal fa-envelope-square",
- "fal fa-eraser",
- "fal fa-euro-sign",
- "fal fa-exchange",
- "fal fa-exchange-alt",
- "fal fa-exclamation",
- "fal fa-exclamation-circle",
- "fal fa-exclamation-square",
- "fal fa-exclamation-triangle",
- "fal fa-expand",
- "fal fa-expand-alt",
- "fal fa-expand-arrows",
- "fal fa-expand-arrows-alt",
- "fal fa-expand-wide",
- "fal fa-external-link",
- "fal fa-external-link-alt",
- "fal fa-external-link-square",
- "fal fa-external-link-square-alt",
- "fal fa-eye",
- "fal fa-eye-dropper",
- "fal fa-eye-slash",
- "fal fa-fast-backward",
- "fal fa-fast-forward",
- "fal fa-fax",
- "fal fa-female",
- "fal fa-field-hockey",
- "fal fa-fighter-jet",
- "fal fa-file",
- "fal fa-file-alt",
- "fal fa-file-archive",
- "fal fa-file-audio",
- "fal fa-file-check",
- "fal fa-file-code",
- "fal fa-file-edit",
- "fal fa-file-excel",
- "fal fa-file-exclamation",
- "fal fa-file-image",
- "fal fa-file-medical",
- "fal fa-file-medical-alt",
- "fal fa-file-minus",
- "fal fa-file-pdf",
- "fal fa-file-plus",
- "fal fa-file-powerpoint",
- "fal fa-file-times",
- "fal fa-file-video",
- "fal fa-file-word",
- "fal fa-film",
- "fal fa-film-alt",
- "fal fa-filter",
- "fal fa-fire",
- "fal fa-fire-extinguisher",
- "fal fa-first-aid",
- "fal fa-flag",
- "fal fa-flag-checkered",
- "fal fa-flask",
- "fal fa-folder",
- "fal fa-folder-open",
- "fal fa-font",
- "fal fa-football-ball",
- "fal fa-football-helmet",
- "fal fa-forklift",
- "fal fa-forward",
- "fal fa-fragile",
- "fal fa-frown",
- "fal fa-futbol",
- "fal fa-gamepad",
- "fal fa-gavel",
- "fal fa-gem",
- "fal fa-genderless",
- "fal fa-gift",
- "fal fa-glass-martini",
- "fal fa-globe",
- "fal fa-golf-ball",
- "fal fa-golf-club",
- "fal fa-graduation-cap",
- "fal fa-h-square",
- "fal fa-h1",
- "fal fa-h2",
- "fal fa-h3",
- "fal fa-hand-heart",
- "fal fa-hand-holding",
- "fal fa-hand-holding-box",
- "fal fa-hand-holding-heart",
- "fal fa-hand-holding-seedling",
- "fal fa-hand-holding-usd",
- "fal fa-hand-holding-water",
- "fal fa-hand-lizard",
- "fal fa-hand-paper",
- "fal fa-hand-peace",
- "fal fa-hand-point-down",
- "fal fa-hand-point-left",
- "fal fa-hand-point-right",
- "fal fa-hand-point-up",
- "fal fa-hand-pointer",
- "fal fa-hand-receiving",
- "fal fa-hand-rock",
- "fal fa-hand-scissors",
- "fal fa-hand-spock",
- "fal fa-hands",
- "fal fa-hands-heart",
- "fal fa-hands-helping",
- "fal fa-hands-usd",
- "fal fa-handshake",
- "fal fa-handshake-alt",
- "fal fa-hashtag",
- "fal fa-hdd",
- "fal fa-heading",
- "fal fa-headphones",
- "fal fa-heart",
- "fal fa-heart-circle",
- "fal fa-heart-square",
- "fal fa-heartbeat",
- "fal fa-hexagon",
- "fal fa-history",
- "fal fa-hockey-puck",
- "fal fa-hockey-sticks",
- "fal fa-home",
- "fal fa-home-heart",
- "fal fa-hospital",
- "fal fa-hospital-alt",
- "fal fa-hospital-symbol",
- "fal fa-hourglass",
- "fal fa-hourglass-end",
- "fal fa-hourglass-half",
- "fal fa-hourglass-start",
- "fal fa-i-cursor",
- "fal fa-id-badge",
- "fal fa-id-card",
- "fal fa-id-card-alt",
- "fal fa-image",
- "fal fa-images",
- "fal fa-inbox",
- "fal fa-inbox-in",
- "fal fa-inbox-out",
- "fal fa-indent",
- "fal fa-industry",
- "fal fa-industry-alt",
- "fal fa-info",
- "fal fa-info-circle",
- "fal fa-info-square",
- "fal fa-inventory",
- "fal fa-italic",
- "fal fa-jack-o-lantern",
- "fal fa-key",
- "fal fa-keyboard",
- "fal fa-lamp",
- "fal fa-language",
- "fal fa-laptop",
- "fal fa-leaf",
- "fal fa-leaf-heart",
- "fal fa-lemon",
- "fal fa-level-down",
- "fal fa-level-down-alt",
- "fal fa-level-up",
- "fal fa-level-up-alt",
- "fal fa-life-ring",
- "fal fa-lightbulb",
- "fal fa-link",
- "fal fa-lira-sign",
- "fal fa-list",
- "fal fa-list-alt",
- "fal fa-list-ol",
- "fal fa-list-ul",
- "fal fa-location-arrow",
- "fal fa-lock",
- "fal fa-lock-alt",
- "fal fa-lock-open",
- "fal fa-lock-open-alt",
- "fal fa-long-arrow-alt-down",
- "fal fa-long-arrow-alt-left",
- "fal fa-long-arrow-alt-right",
- "fal fa-long-arrow-alt-up",
- "fal fa-long-arrow-down",
- "fal fa-long-arrow-left",
- "fal fa-long-arrow-right",
- "fal fa-long-arrow-up",
- "fal fa-loveseat",
- "fal fa-low-vision",
- "fal fa-luchador",
- "fal fa-magic",
- "fal fa-magnet",
- "fal fa-male",
- "fal fa-map",
- "fal fa-map-marker",
- "fal fa-map-marker-alt",
- "fal fa-map-pin",
- "fal fa-map-signs",
- "fal fa-mars",
- "fal fa-mars-double",
- "fal fa-mars-stroke",
- "fal fa-mars-stroke-h",
- "fal fa-mars-stroke-v",
- "fal fa-medkit",
- "fal fa-meh",
- "fal fa-mercury",
- "fal fa-microchip",
- "fal fa-microphone",
- "fal fa-microphone-alt",
- "fal fa-microphone-slash",
- "fal fa-minus",
- "fal fa-minus-circle",
- "fal fa-minus-hexagon",
- "fal fa-minus-octagon",
- "fal fa-minus-square",
- "fal fa-mobile",
- "fal fa-mobile-alt",
- "fal fa-mobile-android",
- "fal fa-mobile-android-alt",
- "fal fa-money-bill",
- "fal fa-money-bill-alt",
- "fal fa-moon",
- "fal fa-motorcycle",
- "fal fa-mouse-pointer",
- "fal fa-music",
- "fal fa-neuter",
- "fal fa-newspaper",
- "fal fa-notes-medical",
- "fal fa-object-group",
- "fal fa-object-ungroup",
- "fal fa-octagon",
- "fal fa-outdent",
- "fal fa-paint-brush",
- "fal fa-pallet",
- "fal fa-pallet-alt",
- "fal fa-paper-plane",
- "fal fa-paperclip",
- "fal fa-parachute-box",
- "fal fa-paragraph",
- "fal fa-paste",
- "fal fa-pause",
- "fal fa-pause-circle",
- "fal fa-paw",
- "fal fa-pen",
- "fal fa-pen-alt",
- "fal fa-pen-square",
- "fal fa-pencil",
- "fal fa-pencil-alt",
- "fal fa-pennant",
- "fal fa-people-carry",
- "fal fa-percent",
- "fal fa-person-carry",
- "fal fa-person-dolly",
- "fal fa-person-dolly-empty",
- "fal fa-phone",
- "fal fa-phone-plus",
- "fal fa-phone-slash",
- "fal fa-phone-square",
- "fal fa-phone-volume",
- "fal fa-piggy-bank",
- "fal fa-pills",
- "fal fa-plane",
- "fal fa-plane-alt",
- "fal fa-play",
- "fal fa-layer-group",
- "fal fa-play-circle",
- "fal fa-plug",
- "fal fa-plus",
- "fal fa-plus-circle",
- "fal fa-plus-hexagon",
- "fal fa-plus-octagon",
- "fal fa-plus-square",
- "fal fa-podcast",
- "fal fa-poo",
- "fal fa-portrait",
- "fal fa-pound-sign",
- "fal fa-power-off",
- "fal fa-prescription-bottle",
- "fal fa-prescription-bottle-alt",
- "fal fa-print",
- "fal fa-procedures",
- "fal fa-puzzle-piece",
- "fal fa-qrcode",
- "fal fa-question",
- "fal fa-question-circle",
- "fal fa-question-square",
- "fal fa-quidditch",
- "fal fa-quote-left",
- "fal fa-quote-right",
- "fal fa-racquet",
- "fal fa-ramp-loading",
- "fal fa-random",
- "fal fa-rectangle-landscape",
- "fal fa-rectangle-portrait",
- "fal fa-rectangle-wide",
- "fal fa-recycle",
- "fal fa-redo",
- "fal fa-redo-alt",
- "fal fa-registered",
- "fal fa-repeat",
- "fal fa-repeat-1",
- "fal fa-repeat-1-alt",
- "fal fa-repeat-alt",
- "fal fa-reply",
- "fal fa-reply-all",
- "fal fa-retweet",
- "fal fa-retweet-alt",
- "fal fa-ribbon",
- "fal fa-road",
- "fal fa-rocket",
- "fal fa-route",
- "fal fa-rss",
- "fal fa-rss-square",
- "fal fa-ruble-sign",
- "fal fa-rupee-sign",
- "fal fa-save",
- "fal fa-scanner",
- "fal fa-scanner-keyboard",
- "fal fa-scanner-touchscreen",
- "fal fa-scrubber",
- "fal fa-search",
- "fal fa-search-minus",
- "fal fa-search-plus",
- "fal fa-seedling",
- "fal fa-server",
- "fal fa-share",
- "fal fa-share-all",
- "fal fa-share-alt",
- "fal fa-share-alt-square",
- "fal fa-share-square",
- "fal fa-shekel-sign",
- "fal fa-shield",
- "fal fa-shield-alt",
- "fal fa-shield-check",
- "fal fa-ship",
- "fal fa-shipping-fast",
- "fal fa-shipping-timed",
- "fal fa-shopping-bag",
- "fal fa-shopping-basket",
- "fal fa-shopping-cart",
- "fal fa-shower",
- "fal fa-shuttlecock",
- "fal fa-sign",
- "fal fa-sign-in",
- "fal fa-sign-in-alt",
- "fal fa-sign-language",
- "fal fa-sign-out",
- "fal fa-sign-out-alt",
- "fal fa-signal",
- "fal fa-sitemap",
- "fal fa-sliders-h",
- "fal fa-sliders-h-square",
- "fal fa-sliders-v",
- "fal fa-sliders-v-square",
- "fal fa-smile",
- "fal fa-smile-plus",
- "fal fa-smoking",
- "fal fa-snowflake",
- "fal fa-sort",
- "fal fa-sort-alpha-down",
- "fal fa-sort-alpha-up",
- "fal fa-sort-amount-down",
- "fal fa-sort-amount-up",
- "fal fa-sort-down",
- "fal fa-sort-numeric-down",
- "fal fa-sort-numeric-up",
- "fal fa-sort-up",
- "fal fa-space-shuttle",
- "fal fa-spade",
- "fal fa-spinner",
- "fal fa-spinner-third",
- "fal fa-square",
- "fal fa-square-full",
- "fal fa-star",
- "fal fa-star-exclamation",
- "fal fa-star-half",
- "fal fa-step-backward",
- "fal fa-step-forward",
- "fal fa-stethoscope",
- "fal fa-sticky-note",
- "fal fa-stop",
- "fal fa-stop-circle",
- "fal fa-stopwatch",
- "fal fa-street-view",
- "fal fa-strikethrough",
- "fal fa-subscript",
- "fal fa-subway",
- "fal fa-suitcase",
- "fal fa-sun",
- "fal fa-superscript",
- "fal fa-sync",
- "fal fa-sync-alt",
- "fal fa-syringe",
- "fal fa-table",
- "fal fa-table-tennis",
- "fal fa-tablet",
- "fal fa-tablet-alt",
- "fal fa-tablet-android",
- "fal fa-tablet-android-alt",
- "fal fa-tablet-rugged",
- "fal fa-tablets",
- "fal fa-tachometer",
- "fal fa-tachometer-alt",
- "fal fa-tag",
- "fal fa-tags",
- "fal fa-tape",
- "fal fa-tasks",
- "fal fa-taxi",
- "fal fa-tennis-ball",
- "fal fa-terminal",
- "fal fa-text-height",
- "fal fa-text-width",
- "fal fa-th",
- "fal fa-th-large",
- "fal fa-th-list",
- "fal fa-thermometer",
- "fal fa-thermometer-empty",
- "fal fa-thermometer-full",
- "fal fa-thermometer-half",
- "fal fa-thermometer-quarter",
- "fal fa-thermometer-three-quarters",
- "fal fa-thumbs-down",
- "fal fa-thumbs-up",
- "fal fa-thumbtack",
- "fal fa-ticket",
- "fal fa-ticket-alt",
- "fal fa-times",
- "fal fa-times-circle",
- "fal fa-times-hexagon",
- "fal fa-times-octagon",
- "fal fa-times-square",
- "fal fa-tint",
- "fal fa-toggle-off",
- "fal fa-toggle-on",
- "fal fa-trademark",
- "fal fa-train",
- "fal fa-transgender",
- "fal fa-transgender-alt",
- "fal fa-trash",
- "fal fa-trash-alt",
- "fal fa-tree",
- "fal fa-tree-alt",
- "fal fa-triangle",
- "fal fa-trophy",
- "fal fa-trophy-alt",
- "fal fa-truck",
- "fal fa-truck-container",
- "fal fa-truck-couch",
- "fal fa-truck-loading",
- "fal fa-truck-moving",
- "fal fa-truck-ramp",
- "fal fa-tty",
- "fal fa-tv",
- "fal fa-tv-retro",
- "fal fa-umbrella",
- "fal fa-underline",
- "fal fa-undo",
- "fal fa-undo-alt",
- "fal fa-universal-access",
- "fal fa-university",
- "fal fa-unlink",
- "fal fa-unlock",
- "fal fa-unlock-alt",
- "fal fa-upload",
- "fal fa-usd-circle",
- "fal fa-usd-square",
- "fal fa-user",
- "fal fa-user-alt",
- "fal fa-user-circle",
- "fal fa-user-md",
- "fal fa-user-plus",
- "fal fa-user-secret",
- "fal fa-user-times",
- "fal fa-users",
- "fal fa-utensil-fork",
- "fal fa-utensil-knife",
- "fal fa-utensil-spoon",
- "fal fa-utensils",
- "fal fa-utensils-alt",
- "fal fa-venus",
- "fal fa-venus-double",
- "fal fa-venus-mars",
- "fal fa-vial",
- "fal fa-vials",
- "fal fa-video",
- "fal fa-video-plus",
- "fal fa-video-slash",
- "fal fa-volleyball-ball",
- "fal fa-volume-down",
- "fal fa-volume-mute",
- "fal fa-volume-off",
- "fal fa-volume-up",
- "fal fa-warehouse",
- "fal fa-warehouse-alt",
- "fal fa-watch",
- "fal fa-weight",
- "fal fa-wheelchair",
- "fal fa-whistle",
- "fal fa-wifi",
- "fal fa-window",
- "fal fa-window-alt",
- "fal fa-window-close",
- "fal fa-window-maximize",
- "fal fa-window-minimize",
- "fal fa-window-restore",
- "fal fa-wine-glass",
- "fal fa-won-sign",
- "fal fa-wrench",
- "fal fa-x-ray"
-];
-export default dv_icons_list;
diff --git a/datavalue_theme_14/public/js/frappe/ui/notifications/notifications.js b/datavalue_theme_14/public/js/frappe/ui/notifications/notifications.js
deleted file mode 100644
index 4b655b4..0000000
--- a/datavalue_theme_14/public/js/frappe/ui/notifications/notifications.js
+++ /dev/null
@@ -1,443 +0,0 @@
-frappe.provide('frappe.search');
-
-frappe.ui.Notifications = class Notifications {
- constructor() {
- this.tabs = {};
- this.notification_settings = frappe.boot.notification_settings;
- this.make();
- }
-
- make() {
- this.dropdown = $('.dv-navbar.datavalue-nav').find('.dv-dropdown-notifications').removeClass('hidden');
- this.dropdown_list = this.dropdown.find('.notifications-list');
- this.header_items = this.dropdown_list.find('.header-items').html('');
- this.header_actions = this.dropdown_list.find('.header-actions').html('');
- this.body = this.dropdown_list.find('.notification-list-body');
- this.panel_events = this.dropdown_list.find('.panel-events');
- this.panel_notifications = this.dropdown_list.find('.panel-notifications');
-
- this.user = frappe.session.user;
-
- this.setup_headers();
- this.setup_dropdown_events();
- }
-
- setup_headers() {
- // Add header actions
- $(`
- ${frappe.utils.icon('setting-gear')}
- `)
- .on('click', (e) => {
- e.stopImmediatePropagation();
- this.dropdown.dropdown('hide');
- frappe.set_route('Form', 'Notification Settings', frappe.session.user);
- }).appendTo(this.header_actions)
- .attr('title', __("Notification Settings"))
- .tooltip({delay: {"show": 600, "hide": 100}, trigger: "hover"});
-
- $(`
- ${frappe.utils.icon('mark-as-read')}
- `)
- .on('click', (e) => this.mark_all_as_read(e))
- .appendTo(this.header_actions)
- .attr('title', __("Mark all as read"))
- .tooltip({delay: {"show": 600, "hide": 100}, trigger: "hover"});
-
- this.categories = [
- {
- label: __("Notifications"),
- id: "notifications",
- view: NotificationsView,
- el: this.panel_notifications,
- },
- {
- label: __("Today's Events"),
- id: "todays_events",
- view: EventsView,
- el: this.panel_events,
- }
- ];
-
- let get_headers_html = (item) => {
- let active = item.id == "notifications" ? 'active' : '';
-
- let html = `
${item.label}`;
-
- return html;
- };
-
- let navitem = $(`
`);
- this.categories = this.categories.map(item => {
- item.$tab = $(get_headers_html(item));
- item.$tab.on('click', (e) => {
- e.stopImmediatePropagation();
- this.switch_tab(item);
- });
- navitem.append(item.$tab);
-
- return item;
- });
- navitem.appendTo(this.header_items);
- this.categories.forEach(category => {
- this.make_tab_view(category);
- });
- this.switch_tab(this.categories[0]);
- }
-
- switch_tab(item) {
- // Set active tab
- this.categories.forEach((item) => {
- item.$tab.removeClass("active");
- });
-
- item.$tab.addClass("active");
-
- // Hide other tabs
- Object.keys(this.tabs).forEach(tab_name => this.tabs[tab_name].hide());
- this.tabs[item.id].show();
- }
-
- make_tab_view(item) {
- let tabView = new item.view(
- item.el,
- this.dropdown,
- this.notification_settings
- );
- this.tabs[item.id] = tabView;
- }
-
- mark_all_as_read(e) {
- e.stopImmediatePropagation();
- this.dropdown_list.find('.unread').removeClass('unread');
- frappe.call(
- 'frappe.desk.doctype.notification_log.notification_log.mark_all_as_read',
- );
- }
-
- setup_dropdown_events() {
- this.dropdown.on('hide.bs.dropdown', e => {
- let hide = $(e.currentTarget).data('closable');
- $(e.currentTarget).data('closable', true);
- return hide;
- });
-
- this.dropdown.on('click', e => {
- $(e.currentTarget).data('closable', true);
- });
- }
-};
-
-
-frappe.ui.notifications = {
- get_notification_config() {
- return frappe.xcall('frappe.desk.notifications.get_notification_info').then(r => {
- frappe.ui.notifications.config = r;
- return r;
- });
- },
-
- show_open_count_list(doctype) {
- if (!frappe.ui.notifications.config) {
- this.get_notification_config().then(() => {
- this.route_to_list_with_filters(doctype);
- });
- } else {
- this.route_to_list_with_filters(doctype);
- }
- },
-
- route_to_list_with_filters(doctype) {
- let filters = frappe.ui.notifications.config['conditions'][doctype];
- if (filters && $.isPlainObject(filters)) {
- if (!frappe.route_options) {
- frappe.route_options = {};
- }
- $.extend(frappe.route_options, filters);
- }
- frappe.set_route('List', doctype);
- }
-};
-
-class BaseNotificationsView {
- constructor(wrapper, parent, settings) {
- // wrapper, max_length
- this.wrapper = wrapper;
- this.parent = parent;
- this.settings = settings;
- this.max_length = 20;
- this.wrapper.html('');
- this.container = $(`
`).appendTo(this.wrapper);
- this.make();
- }
-
- show() {
- this.container.show();
- }
-
- hide() {
- this.container.hide();
- }
-}
-
-class NotificationsView extends BaseNotificationsView {
- make() {
- this.notifications_icon = this.parent.find('.notifications-icon');
- this.notifications_icon.attr("title", __('Notifications')).tooltip(
- {delay: {"show": 600, "hide": 100}, trigger: "hover"}
- );
-
- this.setup_notification_listeners();
- this.get_notifications_list(this.max_length).then(list => {
- this.dropdown_items = list;
- this.render_notifications_dropdown();
- if (this.settings.seen == 0) {
- this.toggle_notification_icon(false);
- }
- });
-
- }
-
- update_dropdown() {
- this.get_notifications_list(1).then(r => {
- let new_item = r[0];
- this.dropdown_items.unshift(new_item);
- if (this.dropdown_items.length > this.max_length) {
- this.container
- .find('.recent-notification')
- .last()
- .remove();
- this.dropdown_items.pop();
- }
-
- this.insert_into_dropdown();
- });
- }
-
- change_activity_status() {
- if (this.container.find('.activity-status')) {
- this.container.find('.activity-status').replaceWith(
- `
- ${__('View Full Log')}
- `
- );
- }
- }
-
- mark_as_read(docname, $el) {
- frappe.call(
- 'frappe.desk.doctype.notification_log.notification_log.mark_as_read',
- {docname: docname}
- ).then(() => {
- $el.removeClass('unread');
- });
- }
-
- insert_into_dropdown() {
- let new_item = this.dropdown_items[0];
- let new_item_html = this.get_dropdown_item_html(new_item);
- $(new_item_html).prependTo(this.container);
- this.change_activity_status();
- }
-
- get_dropdown_item_html(field) {
- let doc_link = this.get_item_link(field);
-
- let read_class = field.read ? '' : 'unread';
- let message = field.subject;
-
- let title = message.match(/
(.*?)<\/b>/);
- message = title ? message.replace(title[1], frappe.ellipsis(strip_html(title[1]), 100)) : message;
-
- let timestamp = frappe.datetime.comment_when(field.creation);
- let message_html = `
-
${message}
-
- ${timestamp}
-
-
`;
-
- let user = field.from_user;
- let user_avatar = frappe.avatar(user, 'avatar-medium user-avatar');
-
- let item_html =
- $(`
-
- ${user_avatar}
- ${message_html}
-
-
-
- `);
-
- if (!field.read) {
- let mark_btn = item_html.find(".mark-as-read");
- mark_btn.tooltip({delay: {"show": 600, "hide": 100}, trigger: "hover"});
- mark_btn.on('click', (e) => {
- e.preventDefault();
- e.stopImmediatePropagation();
- this.mark_as_read(field.name, item_html);
- });
-
- item_html.on('click', () => {
- this.mark_as_read(field.name, item_html);
- });
- }
-
- return item_html;
- }
-
- render_notifications_dropdown() {
- if (this.settings && !this.settings.enabled) {
- this.container.html(`
-
- ${__('Notifications Disabled')}
- `);
- } else {
- if (this.dropdown_items.length) {
- this.container.empty();
- this.dropdown_items.forEach(field => {
- this.container.append(this.get_dropdown_item_html(field));
- });
- this.container.append(``);
- } else {
- this.container.append($(`
-
-

-
${__('No New notifications')}
-
- ${__('Looks like you haven’t received any notifications.')}
-
`));
- }
- }
- }
-
- get_notifications_list(limit) {
- return frappe.db.get_list('Notification Log', {
- fields: ['*'],
- limit: limit,
- order_by: 'creation desc'
- });
- }
-
- get_item_link(notification_doc) {
- const link_doctype =
- notification_doc.type == 'Alert' ? 'Notification Log' : notification_doc.document_type;
- const link_docname =
- notification_doc.type == 'Alert' ? notification_doc.name : notification_doc.document_name;
- return frappe.utils.get_form_link(
- link_doctype,
- link_docname
- );
- }
-
- toggle_notification_icon(seen) {
- this.notifications_icon.find('.notifications-seen').toggle(seen);
- this.notifications_icon.find('.notifications-unseen').toggle(!seen);
- }
-
- toggle_seen(flag) {
- frappe.call(
- 'frappe.desk.doctype.notification_settings.notification_settings.set_seen_value',
- {
- value: cint(flag),
- user: frappe.session.user
- }
- );
- }
-
- setup_notification_listeners() {
- frappe.realtime.on('notification', () => {
- this.toggle_notification_icon(false);
- this.update_dropdown();
- });
-
- frappe.realtime.on('indicator_hide', () => {
- this.toggle_notification_icon(true);
- });
-
- this.parent.on('show.bs.dropdown', () => {
- this.toggle_seen(true);
- if (this.notifications_icon.find('.notifications-unseen').is(':visible')) {
- this.toggle_notification_icon(true);
- frappe.call(
- 'frappe.desk.doctype.notification_log.notification_log.trigger_indicator_hide'
- );
- }
- });
-
- }
-}
-
-class EventsView extends BaseNotificationsView {
- make() {
- let today = frappe.datetime.get_today();
- frappe.xcall('frappe.desk.doctype.event.event.get_events', {
- start: today,
- end: today
- }).then(event_list => {
- this.render_events_html(event_list);
- });
- }
-
- render_events_html(event_list) {
- let html = '';
- if (event_list.length) {
- let get_event_html = (event) => {
- let time = __("All Day");
- if (!event.all_day) {
- let start_time = frappe.datetime.get_time(event.starts_on);
- let days_diff = frappe.datetime.get_day_diff(event.ends_on, event.starts_on);
- let end_time = frappe.datetime.get_time(event.ends_on);
- if (days_diff > 1) {
- end_time = __("Rest of the day");
- }
- time = `${start_time} - ${end_time}`;
- }
-
- // REDESIGN-TODO: Add Participants to get_events query
- let particpants = '';
- if (event.particpants) {
- particpants = frappe.avatar_group(event.particpants, 3);
- }
-
- // REDESIGN-TODO: Add location to calendar field
- let location = '';
- if (event.location) {
- location = `, ${event.location}`;
- }
-
- return `
-
-
-
${event.subject}
-
${time}${location}
- ${particpants}
-
- `;
- };
- html = event_list.map(get_event_html).join('');
- } else {
- html = `
-
-
-

-
${__('No Upcoming Events')}
-
- ${__('There are no upcoming events for you.')}
-
- `;
- }
-
- this.container.html(html);
- }
-}
diff --git a/datavalue_theme_14/public/js/frappe/ui/page.html b/datavalue_theme_14/public/js/frappe/ui/page.html
deleted file mode 100644
index 5c35bd7..0000000
--- a/datavalue_theme_14/public/js/frappe/ui/page.html
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/datavalue_theme_14/public/js/frappe/ui/page.js b/datavalue_theme_14/public/js/frappe/ui/page.js
deleted file mode 100644
index 8a2bfa4..0000000
--- a/datavalue_theme_14/public/js/frappe/ui/page.js
+++ /dev/null
@@ -1,911 +0,0 @@
-// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
-// MIT License. See license.txt
-
-/**
- * Make a standard page layout with a toolbar and title
- *
- * @param {Object} opts
- *
- * @param {string} opts.parent [HTMLElement] Parent element
- * @param {boolean} opts.single_column Whether to include sidebar
- * @param {string} [opts.title] Page title
- * @param {Object} [opts.make_page]
- *
- * @returns {frappe.ui.Page}
- */
-
-/**
- * @typedef {Object} frappe.ui.Page
- */
-
-
-frappe.ui.make_app_page = function (opts) {
- opts.parent.page = new frappe.ui.Page(opts);
- return opts.parent.page;
-}
-
-frappe.ui.pages = {};
-
-frappe.ui.Page = Class.extend({
- init: function (opts) {
- $.extend(this, opts);
-
- this.set_document_title = true;
- this.buttons = {};
- this.fields_dict = {};
- this.views = {};
-
- this.make();
- frappe.ui.pages[frappe.get_route_str()] = this;
- },
-
- make: function () {
- this.wrapper = $(this.parent);
- this.add_main_section();
- this.setup_scroll_handler();
- this.setup_sidebar_toggle();
- },
-
- setup_scroll_handler() {
- window.addEventListener('scroll', () => {
- if (document.documentElement.scrollTop >= 60) {
- $('.page-head').toggleClass('drop-shadow', true);
- } else {
- $('.page-head').removeClass('drop-shadow');
- }
- });
- },
-
- get_empty_state: function (title, message, primary_action) {
- let $empty_state = $(`
-
-
-
- ${title}
-
-
${message}
-
-
-
-
-
`);
-
- return $empty_state;
- },
-
- load_lib: function (callback) {
- frappe.require(this.required_libs, callback);
- },
-
- add_main_section: function () {
- $(frappe.render_template("page", {})).appendTo(this.wrapper);
- if (this.single_column) {
- // nesting under col-sm-12 for consistency
- this.add_view("main", ``);
- } else {
- this.add_view("main", `
-
- `);
- }
-
- this.setup_page();
- },
-
- setup_page: function () {
- let $this = this;
- this.$title_area = this.wrapper.find(".title-area");
-
- this.$sub_title_area = this.wrapper.find("h6");
-
- if (this.title)
- this.set_title(this.title);
-
- if (this.icon)
- this.get_main_icon(this.icon);
-
- this.body = this.main = this.wrapper.find(".layout-main-section");
- this.container = this.wrapper.find(".page-body");
- this.sidebar = this.wrapper.find(".layout-side-section");
- this.footer = this.wrapper.find(".layout-footer");
- this.indicator = this.wrapper.find(".indicator-pill");
-
- this.page_actions = this.wrapper.find(".page-actions");
-
- this.btn_primary = this.page_actions.find(".primary-action");
- this.btn_secondary = this.page_actions.find(".btn-secondary");
-
- this.menu = this.page_actions.find(".menu-btn-group .dropdown-menu");
- this.menu_btn_group = this.page_actions.find(".menu-btn-group");
-
- this.actions = this.page_actions.find(".actions-btn-group .dropdown-menu");
- this.actions_btn_group = this.page_actions.find(".actions-btn-group");
-
- this.standard_actions = this.page_actions.find(".standard-actions");
- this.custom_actions = this.page_actions.find(".custom-actions");
-
- this.page_form = $('').prependTo(this.main);
- this.inner_toolbar = this.custom_actions;
- this.icon_group = this.page_actions.find(".page-icon-group");
-
- if (this.make_page) {
- this.make_page();
- }
-
- this.card_layout && this.main.addClass('frappe-card');
-
- // keyboard shortcuts
- let menu_btn = this.menu_btn_group.find('button');
- menu_btn.attr("title", __("Menu")).tooltip({delay: {"show": 600, "hide": 100}});
- frappe.ui.keys.get_shortcut_group(this.page_actions[0]).add(menu_btn, menu_btn.find('.menu-btn-group-label'));
-
- let action_btn = this.actions_btn_group.find('button');
- frappe.ui.keys.get_shortcut_group(this.page_actions[0]).add(action_btn, action_btn.find('.actions-btn-group-label'));
-
- let route = frappe.get_route();
- let sidebar_wrapper = this.wrapper.find('.layout-side-section');
- this.body.append('');
- this.page_container = this.body.parents('.page-container');
-
- // if (this.sidebar.length) {
- // console.log('Hide this.sidebar', this.sidebar)
- // this.sidebar.hide();
- // }
-
-
- if (route && route.length && route[0]) {
- if (route[0] != 'Workspaces' && route[0] != 'query-report' && route[0] != 'Tree') {
- if (frappe.utils.is_xs() || frappe.utils.is_sm()) {
-
- } else {
- setTimeout(() => $('.btn-toggle-sidebar', this.page_container).trigger('click'), 250);
- }
- $('.btn-toggle-sidebar', this.page_container).show();
- } else {
- $('.btn-toggle-sidebar', this.page_container).hide();
- }
- } else {
- $('.btn-toggle-sidebar', this.page_container).hide();
- }
-
- $(this.page_container).on('click', '.btn-toggle-sidebar', function () {
- if ($(this).hasClass('sidebar-shown')) {
- $(this).removeClass('sidebar-shown');
- } else {
- $(this).addClass('sidebar-shown');
- }
- if (frappe.utils.is_xs() || frappe.utils.is_sm()) {
- $this.setup_overlay_sidebar();
- } else {
- sidebar_wrapper.toggle();
- }
- $(document.body).trigger('toggleSidebar');
- });
-
- },
-
- setup_sidebar_toggle() {
- let sidebar_toggle = $('.page-head').find('.sidebar-toggle-btn');
- let sidebar_wrapper = this.wrapper.find('.layout-side-section');
- if (this.disable_sidebar_toggle || !sidebar_wrapper.length) {
- sidebar_toggle.remove();
- } else {
- if ($(window).width() > 1024) {
- sidebar_toggle.attr("title", __("Toggle Sidebar")).tooltip({
- delay: {"show": 600, "hide": 100},
- trigger: "hover",
- });
- }
- sidebar_toggle.click(() => {
- if (frappe.utils.is_xs() || frappe.utils.is_sm()) {
- this.setup_overlay_sidebar();
- } else {
- sidebar_wrapper.toggle();
- }
- $(document.body).trigger('toggleSidebar');
- this.update_sidebar_icon();
- });
- }
- },
-
- setup_overlay_sidebar() {
- let overlay_sidebar = this.sidebar.find('.overlay-sidebar').addClass('opened');
- $('`);
- this.inner_toolbar.find('.inner-page-message').remove();
- this.inner_toolbar.removeClass("hide").prepend($message);
-
- return $message;
- },
-
- clear_inner_toolbar: function () {
- this.inner_toolbar.empty().addClass("hide");
- },
-
- //-- Sidebar --//
-
- add_sidebar_item: function (label, action, insert_after, prepend) {
- var parent = this.sidebar.find(".sidebar-menu.standard-actions");
- var li = $('');
- var link = $('').html(label).on("click", action).appendTo(li);
-
- if (insert_after) {
- li.insertAfter(parent.find(insert_after));
- } else {
- if (prepend) {
- li.prependTo(parent);
- } else {
- li.appendTo(parent);
- }
- }
- return link;
- },
-
- //---//
-
- clear_user_actions: function () {
- this.menu.find(".user-action").remove();
- },
-
- // page::title
- get_title_area: function () {
- return this.$title_area;
- },
-
- set_title: function (title, icon = null, strip = true, tab_title = "") {
- if (!title) title = "";
- if (strip) {
- title = strip_html(title);
- }
- this.title = title;
- frappe.utils.set_title(tab_title || title);
- if (icon) {
- title = `${frappe.utils.icon(icon)} ${title}`;
- }
- let title_wrapper = this.$title_area.find(".title-text");
- title_wrapper.html(title);
- title_wrapper.attr('title', this.title);
- },
-
- set_title_sub: function (txt) {
- // strip icon
- this.$sub_title_area.html(txt).toggleClass("hide", !!!txt);
- },
-
- get_main_icon: function (icon) {
- return this.$title_area.find(".title-icon")
- .html(' ')
- .toggle(true);
- },
-
- add_help_button: function (txt) {
- //
- },
-
- add_button: function (label, click, opts) {
- if (!opts) opts = {};
- let button = $(``);
- button.appendTo(this.custom_actions);
- button.on('click', click);
- this.custom_actions.removeClass('hide');
-
- return button;
- },
-
- add_custom_button_group: function (label, icon, parent) {
- let dropdown_label = `
- ${__(label)}
- ${frappe.utils.icon('select', 'xs')}
- `;
-
- if (icon) {
- dropdown_label = `
- ${frappe.utils.icon(icon)}
- ${__(label)}
- ${frappe.utils.icon('select', 'xs')}
-
-
- ${frappe.utils.icon(icon)}
- `;
- }
-
- let custom_btn_group = $(`
-
-
-
-
- `);
-
- if (!parent) parent = this.custom_actions;
- parent.removeClass('hide').append(custom_btn_group);
-
- return custom_btn_group.find('.dropdown-menu');
- },
-
- add_dropdown_button: function (parent, label, click, icon) {
- frappe.ui.toolbar.add_dropdown_button(parent, label, click, icon);
- },
-
- // page::form
- add_label: function (label) {
- this.show_form();
- return $("")
- .appendTo(this.page_form);
- },
- add_select: function (label, options) {
- var field = this.add_field({label: label, fieldtype: "Select"});
- return field.$wrapper.find("select").empty().add_options(options);
- },
- add_data: function (label) {
- var field = this.add_field({label: label, fieldtype: "Data"});
- return field.$wrapper.find("input").attr("placeholder", label);
- },
- add_date: function (label, date) {
- var field = this.add_field({label: label, fieldtype: "Date", "default": date});
- return field.$wrapper.find("input").attr("placeholder", label);
- },
- add_check: function (label) {
- return $("")
- .appendTo(this.page_form)
- .find("input");
- },
- add_break: function () {
- // add further fields in the next line
- this.page_form.append('');
- },
- add_field: function (df, parent) {
- this.show_form();
-
- if (!df.placeholder) {
- df.placeholder = df.label;
- }
-
- df.input_class = 'input-xs';
-
- var f = frappe.ui.form.make_control({
- df: df,
- parent: parent || this.page_form,
- only_input: df.fieldtype == "Check" ? false : true,
- })
- f.refresh();
- $(f.wrapper)
- .addClass('col-md-2')
- .attr("title", __(df.label)).tooltip({
- delay: {"show": 600, "hide": 100},
- trigger: "hover"
- });
-
- // html fields in toolbar are only for display
- if (df.fieldtype == 'HTML') {
- return;
- }
-
- // hidden fields dont have $input
- if (!f.$input) f.make_input();
-
- f.$input.attr("placeholder", __(df.label));
-
- if (df.fieldtype === "Check") {
- $(f.wrapper).find(":first-child")
- .removeClass("col-md-offset-4 col-md-8");
- }
-
- if (df.fieldtype == "Button") {
- $(f.wrapper).find(".page-control-label").html(" ");
- f.$input.addClass("btn-xs").css({"width": "100%", "margin-top": "-1px"});
- }
-
- if (df["default"])
- f.set_input(df["default"])
- this.fields_dict[df.fieldname || df.label] = f;
- return f;
- },
- clear_fields: function () {
- this.page_form.empty();
- },
- show_form: function () {
- this.page_form.removeClass("hide");
- },
- hide_form: function () {
- this.page_form.addClass("hide");
- },
- get_form_values: function () {
- var values = {};
- this.page_form.fields_dict.forEach(function (field, key) {
- values[key] = field.get_value();
- });
- return values;
- },
- add_view: function (name, html) {
- let element = html;
- if (typeof (html) === "string") {
- element = $(html);
- }
- this.views[name] = element.appendTo($(this.wrapper).find(".page-content"));
- if (!this.current_view) {
- this.current_view = this.views[name];
- } else {
- this.views[name].toggle(false);
- }
- return this.views[name];
- },
- set_view: function (name) {
- if (this.current_view_name === name)
- return;
- this.current_view && this.current_view.toggle(false);
- this.current_view = this.views[name];
-
- this.previous_view_name = this.current_view_name;
- this.current_view_name = name;
-
- this.views[name].toggle(true);
-
- this.wrapper.trigger('view-change');
- },
-});
diff --git a/datavalue_theme_14/public/js/frappe/ui/toolbar/navbar.html b/datavalue_theme_14/public/js/frappe/ui/toolbar/navbar.html
deleted file mode 100644
index 88be58f..0000000
--- a/datavalue_theme_14/public/js/frappe/ui/toolbar/navbar.html
+++ /dev/null
@@ -1,145 +0,0 @@
-
-
-
diff --git a/datavalue_theme_14/public/js/frappe/ui/toolbar/theme-setting.js b/datavalue_theme_14/public/js/frappe/ui/toolbar/theme-setting.js
deleted file mode 100644
index 13e73c2..0000000
--- a/datavalue_theme_14/public/js/frappe/ui/toolbar/theme-setting.js
+++ /dev/null
@@ -1,52 +0,0 @@
-// open-theme-setting
-
-$(document).on('click', '.theme-setting-colors-select.theme-setting-modal button', function (event) {
- event.preventDefault();
- $('.theme-setting-colors-select.theme-setting-modal button').removeClass('active');
- $(this).addClass('active');
-});
-$(document).on('click', '.open-theme-setting', function (event) {
- event.preventDefault();
- let colors_list = ['Blue', 'Green', 'Red', 'Orange', 'Yellow', 'Pink', 'Violet']
- let d = new frappe.ui.Dialog({
- title: __('Theme Settings'),
- fields: [
- {
- label: 'Dark Style',
- fieldname: 'dark_style',
- fieldtype: 'Check',
- default: ($('html').attr('data-theme') == 'dark' && $('body').hasClass('dv-dark-style')) ? 1 : 0
- },
- {
- label: 'Colors',
- fieldname: 'colors_icons',
- fieldtype: 'HTML',
- options: `
-
-
${__('Theme Colors')}
-
- ${colors_list.map(color => `
`).join("")}
-
-
- `
- }
- ],
- primary_action_label: __('Save Settings'),
- primary_action(values) {
- let active_btn = $('.theme-setting-colors-select.theme-setting-modal button.active');
- let data = {
- color_name: active_btn.data('color'),
- color_class: active_btn.data('class'),
- dark_style: values.dark_style
- }
- frappe.db.set_value('Theme Settings', 'Theme Settings', {
- 'dark_view': data.dark_style,
- 'theme_color': data.color_name
- }, function () {
- frappe.ui.toolbar.clear_cache();
- setTimeout(() => d.hide(), 1000);
- });
- }
- });
- d.show();
-});
diff --git a/datavalue_theme_14/public/js/frappe/ui/toolbar/toolbar.js b/datavalue_theme_14/public/js/frappe/ui/toolbar/toolbar.js
deleted file mode 100644
index b413c0f..0000000
--- a/datavalue_theme_14/public/js/frappe/ui/toolbar/toolbar.js
+++ /dev/null
@@ -1,293 +0,0 @@
-// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
-// MIT License. See license.txt
-
-frappe.provide("frappe.ui.toolbar");
-frappe.provide("frappe.search");
-
-frappe.ui.toolbar.Toolbar = class {
- constructor() {
- $("header").replaceWith(
- frappe.render_template("navbar", {
- avatar: frappe.avatar(frappe.session.user, "avatar-medium"),
- navbar_settings: frappe.boot.navbar_settings,
- show_help_icon: ($('body').data('show-help-icon') == 1) ? true : false,
- })
- );
- $(".dropdown-toggle").dropdown();
-
- this.setup_awesomebar();
- this.setup_notifications();
- this.setup_help();
- this.make();
- }
-
- make() {
- this.bind_events();
- $(document).trigger("toolbar_setup");
- }
-
- bind_events() {
- // clear all custom menus on page change
- $(document).on("page-change", function () {
- $("header .navbar .custom-menu").remove();
- });
-
- //focus search-modal on show in mobile view
- $("#search-modal").on("shown.bs.modal", function () {
- var search_modal = $(this);
- setTimeout(function () {
- search_modal.find("#modal-search").focus();
- }, 300);
- });
- $(".navbar-toggle-full-width").click(() => {
- frappe.ui.toolbar.toggle_full_width();
- });
- }
-
- setup_help() {
- if (!frappe.boot.desk_settings.notifications) {
- // hide the help section
- $(".navbar .vertical-bar").removeClass("d-sm-block");
- $(".dropdown-help").removeClass("d-lg-block");
- return;
- }
- frappe.provide("frappe.help");
- frappe.help.show_results = show_results;
-
- this.search = new frappe.search.SearchDialog();
- frappe.provide("frappe.searchdialog");
- frappe.searchdialog.search = this.search;
-
- $(".dropdown-help .dropdown-toggle").on("click", function () {
- $(".dropdown-help input").focus();
- });
-
- $(".dropdown-help .dropdown-menu").on("click", "input, button", function (e) {
- e.stopPropagation();
- });
-
- $("#input-help").on("keydown", function (e) {
- if (e.which == 13) {
- $(this).val("");
- }
- });
-
- $(document).on("page-change", function () {
- var $help_links = $(".dropdown-help #help-links");
- $help_links.html("");
-
- var route = frappe.get_route_str();
- var breadcrumbs = route.split("/");
-
- var links = [];
- for (var i = 0; i < breadcrumbs.length; i++) {
- var r = route.split("/", i + 1);
- var key = r.join("/");
- var help_links = frappe.help.help_links[key] || [];
- links = $.merge(links, help_links);
- }
-
- if (links.length === 0) {
- $help_links.next().hide();
- } else {
- $help_links.next().show();
- }
-
- for (var i = 0; i < links.length; i++) {
- var link = links[i];
- var url = link.url;
- $("", {
- href: url,
- class: "dropdown-item",
- text: __(link.label),
- target: "_blank",
- }).appendTo($help_links);
- }
-
- $(".dropdown-help .dropdown-menu").on("click", "a", show_results);
- });
-
- var $result_modal = frappe.get_modal("", "");
- $result_modal.addClass("help-modal");
-
- $(document).on("click", ".help-modal a", show_results);
-
- function show_results(e) {
- //edit links
- var href = e.target.href;
- if (href.indexOf("blob") > 0) {
- window.open(href, "_blank");
- }
- var path = $(e.target).attr("data-path");
- if (path) {
- e.preventDefault();
- }
- }
- }
-
- setup_awesomebar() {
- if (frappe.boot.desk_settings.search_bar) {
- let awesome_bar = new frappe.search.AwesomeBar();
- awesome_bar.setup("#navbar-search");
-
- // TODO: Remove this in v14
- frappe.search.utils.make_function_searchable(function () {
- frappe.set_route("List", "Client Script");
- }, __("Custom Script List"));
- }
- }
-
- setup_notifications() {
- if (frappe.boot.desk_settings.notifications && frappe.session.user !== "Guest") {
- this.notifications = new frappe.ui.Notifications();
- }
- }
-};
-
-$.extend(frappe.ui.toolbar, {
- add_dropdown_button: function (parent, label, click, icon) {
- var menu = frappe.ui.toolbar.get_menu(parent);
- if (menu.find("li:not(.custom-menu)").length && !menu.find(".divider").length) {
- frappe.ui.toolbar.add_menu_divider(menu);
- }
-
- return $(
- '"
- )
- .insertBefore(menu.find(".divider"))
- .find("a")
- .click(function () {
- click.apply(this);
- });
- },
- get_menu: function (label) {
- return $("#navbar-" + label.toLowerCase());
- },
- add_menu_divider: function (menu) {
- menu = typeof menu == "string" ? frappe.ui.toolbar.get_menu(menu) : menu;
-
- $('').prependTo(menu);
- },
- add_icon_link(route, icon, index, class_name) {
- let parent_element = $(".navbar-right").get(0);
- let new_element = $(`
-
-
-
-
-
- `).get(0);
-
- parent_element.insertBefore(new_element, parent_element.children[index]);
- },
- toggle_full_width() {
- let fullwidth = JSON.parse(localStorage.container_fullwidth || "false");
- fullwidth = !fullwidth;
- localStorage.container_fullwidth = fullwidth;
- frappe.ui.toolbar.set_fullwidth_if_enabled();
- $(document.body).trigger("toggleFullWidth");
- },
- set_fullwidth_if_enabled() {
- let fullwidth = JSON.parse(localStorage.container_fullwidth || "false");
- $(document.body).toggleClass("full-width", fullwidth);
- },
- show_shortcuts(e) {
- e.preventDefault();
- frappe.ui.keys.show_keyboard_shortcut_dialog();
- return false;
- },
-});
-
-frappe.ui.toolbar.clear_cache = frappe.utils.throttle(function () {
- frappe.assets.clear_local_storage();
- frappe.xcall("frappe.sessions.clear").then((message) => {
- frappe.show_alert({
- message: message,
- indicator: "info",
- });
- location.reload(true);
- });
-}, 10000);
-
-frappe.ui.toolbar.show_about = function () {
- try {
- frappe.ui.misc.about();
- } catch (e) {
- console.log(e);
- }
- return false;
-};
-
-frappe.ui.toolbar.route_to_user = function () {
- frappe.set_route("Form", "User", frappe.session.user);
-};
-
-frappe.ui.toolbar.view_website = function () {
- let website_tab = window.open();
- website_tab.opener = null;
- website_tab.location = "/index";
-};
-
-frappe.ui.toolbar.setup_session_defaults = function () {
- let fields = [];
- frappe.call({
- method: "frappe.core.doctype.session_default_settings.session_default_settings.get_session_default_values",
- callback: function (data) {
- fields = JSON.parse(data.message);
- let perms = frappe.perm.get_perm("Session Default Settings");
- //add settings button only if user is a System Manager or has permission on 'Session Default Settings'
- if (in_list(frappe.user_roles, "System Manager") || perms[0].read == 1) {
- fields[fields.length] = {
- fieldname: "settings",
- fieldtype: "Button",
- label: __("Settings"),
- click: () => {
- frappe.set_route(
- "Form",
- "Session Default Settings",
- "Session Default Settings"
- );
- },
- };
- }
- frappe.prompt(
- fields,
- function (values) {
- //if default is not set for a particular field in prompt
- fields.forEach(function (d) {
- if (!values[d.fieldname]) {
- values[d.fieldname] = "";
- }
- });
- frappe.call({
- method: "frappe.core.doctype.session_default_settings.session_default_settings.set_session_default_values",
- args: {
- default_values: values,
- },
- callback: function (data) {
- if (data.message == "success") {
- frappe.show_alert({
- message: __("Session Defaults Saved"),
- indicator: "green",
- });
- frappe.ui.toolbar.clear_cache();
- } else {
- frappe.show_alert({
- message: __(
- "An error occurred while setting Session Defaults"
- ),
- indicator: "red",
- });
- }
- },
- });
- },
- __("Session Defaults"),
- __("Save")
- );
- },
- });
-};
diff --git a/datavalue_theme_14/public/js/frappe/views/breadcrumbs.js b/datavalue_theme_14/public/js/frappe/views/breadcrumbs.js
deleted file mode 100644
index cf0d512..0000000
--- a/datavalue_theme_14/public/js/frappe/views/breadcrumbs.js
+++ /dev/null
@@ -1,202 +0,0 @@
-// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
-// MIT License. See license.txt
-
-frappe.breadcrumbs = {
- all: {},
-
- preferred: {
- "File": "",
- "Dashboard": "Customization",
- "Dashboard Chart": "Customization",
- "Dashboard Chart Source": "Customization"
- },
-
- module_map: {
- 'Core': 'Settings',
- 'Email': 'Settings',
- 'Custom': 'Settings',
- 'Workflow': 'Settings',
- 'Printing': 'Settings',
- 'Setup': 'Settings',
- 'Event Streaming': 'Tools',
- 'Automation': 'Tools',
- },
-
- set_doctype_module(doctype, module) {
- localStorage["preferred_breadcrumbs:" + doctype] = module;
- },
-
- get_doctype_module(doctype) {
- return localStorage["preferred_breadcrumbs:" + doctype];
- },
-
- add(module, doctype, type) {
- let obj;
- if (typeof module === 'object') {
- obj = module;
- } else {
- obj = {
- module: module,
- doctype: doctype,
- type: type
- }
- }
-
- let breadcrumb = frappe.breadcrumbs.current_page();
- breadcrumb = breadcrumb.split('/');
- this.all[frappe.breadcrumbs.current_page()] = obj;
-
- this.update();
- },
-
- current_page() {
- return frappe.get_route_str();
- },
-
- update() {
- var breadcrumbs = this.all[frappe.breadcrumbs.current_page()];
-
- this.clear();
- if (!breadcrumbs) return this.toggle(false);
-
- if (breadcrumbs.type === 'Custom') {
- this.set_custom_breadcrumbs(breadcrumbs);
- } else {
- // workspace
- this.set_workspace_breadcrumb(breadcrumbs);
-
- // form / print
- let view = frappe.get_route()[0];
- view = view ? view.toLowerCase() : null;
- if (breadcrumbs.doctype && ["print", "form"].includes(view)) {
- this.set_list_breadcrumb(breadcrumbs);
- this.set_form_breadcrumb(breadcrumbs, view);
- } else if (breadcrumbs.doctype && view === 'list') {
- this.set_list_breadcrumb(breadcrumbs);
- }
- }
-
- this.toggle(true);
- },
-
- set_custom_breadcrumbs(breadcrumbs) {
- const html = `${breadcrumbs.label}`;
- this.$breadcrumbs.append(html);
- },
-
- set_workspace_breadcrumb(breadcrumbs) {
- // get preferred module for breadcrumbs, based on sent via module
-
- if (!breadcrumbs.workspace) {
- this.set_workspace(breadcrumbs);
- }
-
- if (breadcrumbs.workspace) {
- if (!breadcrumbs.module_info.blocked && frappe.visible_modules.includes(breadcrumbs.module_info.module)) {
- $(`${__(breadcrumbs.workspace)}`)
- .appendTo(this.$breadcrumbs);
- }
- }
-
- },
-
- set_workspace(breadcrumbs) {
- // try and get module from doctype or other settings
- // then get the workspace for that module
-
- this.setup_modules();
- var from_module = this.get_doctype_module(breadcrumbs.doctype);
-
- if (from_module) {
- breadcrumbs.module = from_module;
- } else if (this.preferred[breadcrumbs.doctype] !== undefined) {
- // get preferred module for breadcrumbs
- breadcrumbs.module = this.preferred[breadcrumbs.doctype];
- }
-
- if (breadcrumbs.module) {
- if (this.module_map[breadcrumbs.module]) {
- breadcrumbs.module = this.module_map[breadcrumbs.module];
- }
-
- breadcrumbs.module_info = frappe.get_module(breadcrumbs.module);
-
- // set workspace
- if (breadcrumbs.module_info && frappe.boot.module_page_map[breadcrumbs.module]) {
- breadcrumbs.workspace = frappe.boot.module_page_map[breadcrumbs.module];
- }
- }
- },
-
- set_list_breadcrumb(breadcrumbs) {
- const doctype = breadcrumbs.doctype;
- const doctype_meta = frappe.get_doc('DocType', doctype);
- if ((doctype === "User" && !frappe.user.has_role('System Manager'))
- || (doctype_meta && doctype_meta.issingle)) {
- // no user listview for non-system managers and single doctypes
- } else {
- let route;
- const doctype_route = frappe.router.slug(frappe.router.doctype_layout || doctype);
- if (frappe.boot.treeviews.indexOf(doctype) !== -1) {
- let view = frappe.model.user_settings[doctype].last_view || 'Tree';
- route = `${doctype_route}/view/${view}`;
- } else {
- route = doctype_route;
- }
- $(`${__(doctype)}`).appendTo(this.$breadcrumbs);
- }
- },
-
- set_form_breadcrumb(breadcrumbs, view) {
- const doctype = breadcrumbs.doctype;
- const docname = frappe.get_route()[2];
- let form_route = `/app/${frappe.router.slug(doctype)}/${docname}`;
- $(`${this.limit_string(__(docname))}`).appendTo(this.$breadcrumbs);
- if (view === "form") {
- let last_crumb = this.$breadcrumbs.find('li').last();
- last_crumb.addClass('disabled');
- last_crumb.css("cursor", "copy");
- last_crumb.click((event) => {
- event.stopImmediatePropagation();
- frappe.utils.copy_to_clipboard(last_crumb.text());
- });
- }
- },
-
- setup_modules() {
- if (!frappe.visible_modules) {
- frappe.visible_modules = $.map(frappe.boot.allowed_workspaces, (m) => {
- return m.module;
- });
- }
- },
-
- rename(doctype, old_name, new_name) {
- var old_route_str = ["Form", doctype, old_name].join("/");
- var new_route_str = ["Form", doctype, new_name].join("/");
- this.all[new_route_str] = this.all[old_route_str];
- delete frappe.breadcrumbs.all[old_route_str];
- this.update();
- },
-
- clear() {
- this.$breadcrumbs = $("#navbar-breadcrumbs").empty();
- },
-
- toggle(show) {
- if (show) {
- $("body").addClass("no-breadcrumbs");
- } else {
- $("body").removeClass("no-breadcrumbs");
- }
- },
-
- limit_string(string, limit = 25) {
- if (string && string.length >= limit) {
- return string.substring(0, limit) + ' ...';
- } else {
- return string;
- }
- }
-
-}
diff --git a/datavalue_theme_14/public/js/frappe/views/container.js b/datavalue_theme_14/public/js/frappe/views/container.js
deleted file mode 100644
index dc41706..0000000
--- a/datavalue_theme_14/public/js/frappe/views/container.js
+++ /dev/null
@@ -1,129 +0,0 @@
-// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
-// MIT License. See license.txt
-
-// page container
-frappe.provide("frappe.pages");
-frappe.provide("frappe.views");
-
-window.cur_page = null;
-frappe.modules_list = [];
-frappe.module_items_list = [];
-frappe.active_module = {};
-frappe.theme_settings = {};
-frappe.is_app_loaded = false;
-frappe.is_page_changed = false;
-
-frappe.views.Container = class Container {
- // Container contains pages inside `#container` and manages page creation, switching
- constructor() {
- this.container = $("#body").get(0);
- this.page = null; // current page
- this.pagewidth = $(this.container).width();
- this.pagemargin = 50;
- localStorage.container_fullwidth = true;
- $('body').addClass('full-width');
-
- var me = this;
-
- $(document).trigger('app-loaded');
- frappe.is_app_loaded = true;
- document.documentElement.setAttribute("data-theme", document.documentElement.getAttribute('data-dv-theme'));
- if ($('body').data('close-sub-menu') == '1') {
- $('.btn-toggle-main-menu').removeClass('menu-shown');
- $('body').addClass('hide-main-menu');
- }
-
- $(document).on("page-change", function () {
- // set data-route in body
- var route_str = frappe.get_route_str();
- var route_obj = frappe.get_route();
- let current_page = $('.content.page-container:visible', this);
- $("body").attr("data-route", route_str);
- $("body").attr("data-sidebar", me.has_sidebar() ? 1 : 0);
- setTimeout(() => $('input#navbar-search').trigger('blur'), 250);
- $('.dv-nav-search ul[role="listbox"]').prop('hidden', true);
- $(document).trigger('show-side-menu');
- });
-
- $(document).bind("rename", function (event, dt, old_name, new_name) {
- frappe.breadcrumbs.rename(dt, old_name, new_name);
- });
- }
-
- add_page(label) {
- var page = $('')
- .attr("id", "page-" + label)
- .attr("data-page-route", label)
- .hide()
- .appendTo(this.container)
- .get(0);
- page.label = label;
- frappe.pages[label] = page;
-
- return page;
- }
-
- change_to(label) {
- cur_page = this;
- if (label.tagName) {
- // if sent the div, get the table
- var page = label;
- } else {
- var page = frappe.pages[label];
- }
- if (!page) {
- console.log(__("Page not found") + ": " + label);
- return;
- }
-
- // hide dialog
- if (window.cur_dialog && cur_dialog.display && !cur_dialog.keep_open) {
- if (!cur_dialog.minimizable) {
- cur_dialog.hide();
- } else if (!cur_dialog.is_minimized) {
- cur_dialog.toggle_minimize();
- }
- }
-
- // hide current
- if (this.page && this.page != page) {
- $(this.page).hide();
- $(this.page).trigger("hide");
- }
-
- // show new
- if (!this.page || this.page != page) {
- this.page = page;
- // $(this.page).fadeIn(300);
- $(this.page).show();
- }
-
- $(document).trigger("page-change");
-
- this.page._route = frappe.router.get_sub_path();
- $(this.page).trigger("show");
- !this.page.disable_scroll_to_top && frappe.utils.scroll_to(0);
- frappe.breadcrumbs.update();
-
- return this.page;
- }
-
- has_sidebar() {
- var flag = 0;
- var route_str = frappe.get_route_str();
- // check in frappe.ui.pages
- flag = frappe.ui.pages[route_str] && !frappe.ui.pages[route_str].single_column;
-
- // sometimes frappe.ui.pages is updated later,
- // so check the dom directly
- if (!flag) {
- var page_route = route_str.split("/").slice(0, 2).join("/");
- flag = $(`.page-container[data-page-route="${page_route}"] .layout-side-section`)
- .length
- ? 1
- : 0;
- }
-
- return flag;
- }
-};
diff --git a/datavalue_theme_14/public/js/vue/components/Menu.vue b/datavalue_theme_14/public/js/vue/components/Menu.vue
index a4fd31d..6fc0a27 100644
--- a/datavalue_theme_14/public/js/vue/components/Menu.vue
+++ b/datavalue_theme_14/public/js/vue/components/Menu.vue
@@ -22,7 +22,7 @@
@@ -84,8 +84,8 @@ export default {
name: "Menu",
data() {
return {
- route: frappe.get_route(),
- is_rtl: frappe.utils.is_rtl(),
+ route: xhiveframework.get_route(),
+ is_rtl: xhiveframework.utils.is_rtl(),
theme_settings: {},
current_doctype: '',
current_page: '',
@@ -121,8 +121,8 @@ export default {
"Website": "flaticon-browser",
"Settings": "fal fa-cog",
"Utilities": 'flaticon-configuration',
- "ERPNext Settings": 'flaticon-admin',
- "ERPNext Integrations": 'flaticon-configuration',
+ "XhiveERP Settings": 'flaticon-admin',
+ "XhiveERP Integrations": 'flaticon-configuration',
},
modules_list: [],
module_items_list: {},
@@ -132,31 +132,31 @@ export default {
methods: {
get_modules: function (callback) {
const $this = this;
- frappe.call({
+ xhiveframework.call({
type: 'POST',
- method: 'frappe.desk.desktop.get_workspace_sidebar_items',
+ method: 'xhiveframework.desk.desktop.get_workspace_sidebar_items',
args: {},
callback: callback
});
},
get_module_items: function (module = '', callback) {
const $this = this;
- frappe.call({
+ xhiveframework.call({
type: 'POST',
- method: 'frappe.desk.desktop.get_desktop_page',
+ method: 'xhiveframework.desk.desktop.get_desktop_page',
args: {page: '{"name":"' + module + '","title":"' + module + '"}'},
callback: callback
});
},
get_module_name_from_doctype: function () {
const $this = this;
- const route = frappe.get_route();
+ const route = xhiveframework.get_route();
$this.current_doctype = (route && route.length >= 2 && route[1]) ? route[1] : '';
if (route && route[0] && route[0] == 'dashboard-view') {
$this.current_doctype = 'Dashboard';
}
$this.is_dashboard = (route && route.length == 2 && route[1] && route[0] && route[0] == 'dashboard-view') ? true : false;
- frappe.call({
+ xhiveframework.call({
type: 'POST',
method: 'datavalue_theme_14.api.get_module_name_from_doctype',
args: {
@@ -175,7 +175,7 @@ export default {
});
},
module_menu_list: function (current_module) {
- const route = frappe.get_route();
+ const route = xhiveframework.get_route();
let _module = current_module;
if (route && route[0] && route[0] == 'Workspaces') {
_module = route[1];
@@ -248,7 +248,7 @@ export default {
},
after_side_menu_items: function () {
const $this = this;
- const route = frappe.get_route();
+ const route = xhiveframework.get_route();
$this.current_doctype = (route && route.length >= 2 && route[1]) ? route[1] : '';
setTimeout(() => {
$('.side-menu .side-menu-items > ul.dropdown-list').niceScroll({
@@ -303,7 +303,7 @@ export default {
if ($this.theme_settings && Object.keys($this.theme_settings).length) {
callback();
} else {
- frappe.call({
+ xhiveframework.call({
type: 'POST',
method: 'datavalue_theme_14.api.get_theme_settings',
args: {},
@@ -323,7 +323,7 @@ export default {
if (link.link_type == "Report" && !link.is_query_report) {
opts.doctype = link.dependencies;
}
- const route = frappe.utils.generate_route(opts);
+ const route = xhiveframework.utils.generate_route(opts);
return route;
},
open_module: function (module, is_mobile = false) {
@@ -332,9 +332,9 @@ export default {
setTimeout(() => this.module_menu_list(module), 100);
if (is_mobile == false) {
if ($('body').data('menu-opening-type') == 'Dashboard') {
- frappe.set_route('/dashboard-view/' + (module));
+ xhiveframework.set_route('/dashboard-view/' + (module));
} else {
- frappe.set_route('/' + (module.replace(/ /g, "-")).toLowerCase());
+ xhiveframework.set_route('/' + (module.replace(/ /g, "-")).toLowerCase());
}
$('.btn-toggle-main-menu').addClass('menu-shown');
$('body').removeClass('hide-main-menu');
@@ -343,7 +343,7 @@ export default {
}
},
open_dashboard: function (module) {
- frappe.set_route('/dashboard-view/' + (module));
+ xhiveframework.set_route('/dashboard-view/' + (module));
},
mobile_back_modules: function () {
const $this = this;
@@ -366,9 +366,9 @@ export default {
}
},
created() {
- const route = frappe.get_route();
+ const route = xhiveframework.get_route();
this.current_doctype = (route && route.length >= 2 && route[1]) ? route[1] : '';
- if ($('body').hasClass('frappe-rtl')) {
+ if ($('body').hasClass('xhiveframework-rtl')) {
this.menu_items_animate = 'slideInRight';
}
this.get_theme_settings(() => {
diff --git a/datavalue_theme_14/public/js/vue/theme-settings.js b/datavalue_theme_14/public/js/vue/theme-settings.js
index c7c0046..bae5b9e 100644
--- a/datavalue_theme_14/public/js/vue/theme-settings.js
+++ b/datavalue_theme_14/public/js/vue/theme-settings.js
@@ -5,7 +5,7 @@
if ($('#page-login').length) {
$('#page-login').each(function () {
let page = $(this);
- frappe.call({
+ xhiveframework.call({
type: 'POST',
method: 'datavalue_theme_14.api.get_theme_settings',
args: {},
diff --git a/datavalue_theme_14/public/scss/datavalue_theme.bundle.scss b/datavalue_theme_14/public/scss/datavalue_theme.bundle.scss
index 202c618..0c7ea98 100644
--- a/datavalue_theme_14/public/scss/datavalue_theme.bundle.scss
+++ b/datavalue_theme_14/public/scss/datavalue_theme.bundle.scss
@@ -1,6 +1,6 @@
@import 'partials/reset';
@import 'partials/grid';
-@import 'partials/frappe';
+@import 'partials/xhiveframework';
@import 'partials/tooltip';
@import 'partials/chosen';
@import 'partials/forms-ui';
diff --git a/datavalue_theme_14/public/scss/datavalue_theme.scss b/datavalue_theme_14/public/scss/datavalue_theme.scss
index 202c618..0c7ea98 100644
--- a/datavalue_theme_14/public/scss/datavalue_theme.scss
+++ b/datavalue_theme_14/public/scss/datavalue_theme.scss
@@ -1,6 +1,6 @@
@import 'partials/reset';
@import 'partials/grid';
-@import 'partials/frappe';
+@import 'partials/xhiveframework';
@import 'partials/tooltip';
@import 'partials/chosen';
@import 'partials/forms-ui';
diff --git a/datavalue_theme_14/public/scss/partials/_body.scss b/datavalue_theme_14/public/scss/partials/_body.scss
index 3700f1a..1d521f5 100644
--- a/datavalue_theme_14/public/scss/partials/_body.scss
+++ b/datavalue_theme_14/public/scss/partials/_body.scss
@@ -7,7 +7,7 @@ body.hide-main-menu {
margin-left: 80px;
}
- &.frappe-rtl {
+ &.xhiveframework-rtl {
.dv-app-theme .dv-app-content {
margin-left: 0 $imp;
margin-right: 80px $imp;
diff --git a/datavalue_theme_14/public/scss/partials/_frappe.scss b/datavalue_theme_14/public/scss/partials/_frappe.scss
deleted file mode 100644
index f46b3e0..0000000
--- a/datavalue_theme_14/public/scss/partials/_frappe.scss
+++ /dev/null
@@ -1,425 +0,0 @@
-@media (min-width: 768px) {
- body.full-width .container {
- width: 100% $imp;
- max-width: 100% $imp;
- padding: 0px 5px $imp;
- }
-}
-
-.page-container {
- background-color: $body_bg_color;
-}
-
-.page-head {
- border-bottom: 1px solid transparent;
- height: 50px;
- position: relative;
- top: 0px;
-}
-
-.page-head .page-head-content {
- height: auto;
-}
-
-.page-head.drop-shadow {
- box-shadow: none;
- background-color: #fff !important;
- border-bottom: 1px solid #ddd;
- z-index: 150;
- top: 60px;
- position: sticky;
- margin: 0px -20px;
- padding: 10px 20px;
- transition: all 0.2s ease-in-out;
-}
-
-.page-container[data-page-route="Workspaces"] {
- .layout-side-section, .page-title .sidebar-toggle-btn {
- display: none $imp;
- }
-
- .layout-main-section-wrapper {
- width: 100% $imp;
- }
-}
-
-.centered.splash {
- background: #f8fafb;
- position: fixed;
- top: 0;
- left: 0;
- bottom: 0;
- right: 0;
- transform: inherit;
- -webkit-transform: initial;
- text-align: center;
- vertical-align: middle;
- z-index: 9999999999999999;
-
- img {
- position: absolute;
- left: 50%;
- top: 50%;
- margin: -50px 0px 0px -50px;
- }
-}
-
-@media (min-width: 992px) {
- [data-page-route="Workspaces"] .layout-main {
- height: auto;
- }
-}
-
-@media (min-width: 992px) {
- [data-page-route="Workspaces"] .layout-main .layout-side-section, [data-page-route="Workspaces"] .layout-main .layout-main-section-wrapper {
- height: auto;
- padding-right: 20px;
- padding-left: 20px;
- }
-}
-
-.list-sidebar .list-filters input {
- background: #ffffff;
- border: 1px solid #d0d0d0;
-}
-
-.awesomplete .input-with-feedback {
- background-color: #ffffff;
- border: 1px solid #bbb;
-}
-
-.btn {
- box-shadow: none $imp;
- transition: all 0.2s ease-in-out;
- border-radius: 5px;
-}
-
-.form-control {
- background: #ffffff;
- border: 1px solid #bbb;
- transition: all 0.2s ease-in-out;
- box-shadow: inset 1px 1px 7px -4px rgba(0, 0, 0, 0.44) $imp;
- border-radius: 5px;
-
- &:hover {
- border-color: #999999;
- }
-
- &:focus {
- background: #ffffff $imp;
- border-color: var(--primary) $imp;
- box-shadow: inset 1px 1px 7px -4px rgba(0, 0, 0, 0.44), 0 4px 24px 0 rgba(34, 41, 47, 0.10) $imp;
- }
-}
-
-.btn.btn-default {
- border: 1px solid #d1d3d8 $imp;
-
- &:hover {
- background: rgba(235, 239, 243, 0.7) $imp;
- border-color: #a2a8b1 $imp;
- }
-}
-
-.page-head {
- .primary-action {
- .icon {
- display: none $imp;
- }
-
- span.hidden-xs {
- display: inline-block $imp;
- }
- }
-}
-
-.page-form {
- border-bottom: 1px solid #efefef;
-}
-
-select.input-xs {
- line-height: 14px;
- padding: 0 12px;
- cursor: pointer;
-}
-
-input[type="radio"], input[type="checkbox"] {
- cursor: pointer;
-}
-
-button.btn.btn-default.btn-sm.btn-paging.btn-info {
- background: #14a6ef $imp;
- border-color: #14a6ef $imp;
- color: #fff $imp;
-}
-
-.frappe-list {
- padding: 0px $imp;
-}
-
-.list-row-head {
- background: #f3f3f5;
- border-bottom: 1px solid #e8e8e8;
- cursor: default;
- font-size: 16px;
- font-weight: 600;
-}
-
-.report-summary .summary-value {
- height: auto;
- min-height: 30px;
-}
-
-.alert.desk-alert {
-
- .dv-alert-icon {
- margin: 0px;
- }
-
- &.dv-alert-success, &.dv-alert-green {
- border: 1px solid var(--success);
- }
-
- &.dv-alert-info, &.dv-alert-blue {
- border: 1px solid var(--info);
- }
-
- &.dv-alert-error, &.dv-alert-red {
- border: 1px solid var(--danger);
- }
-
- &.dv-alert-warning, &.dv-alert-orange, &.dv-alert-yellow {
- border: 1px solid var(--orange);
- }
-}
-
-.alert-body {
- text-align: left;
- padding: 0px 15px 10px 15px;
-}
-
-.btn svg.icon.icon-sm {
- position: relative;
- top: -1px;
-}
-
-.layout-main {
- position: relative;
-
- .btn-toggle-sidebar {
- background: #fff;
- border: 0;
- box-shadow: -2px 0px 5px -2px #00000030;
- margin: 0px 15px 0px 0px;
- height: 30px;
- width: 20px;
- display: none;
- text-align: center;
- line-height: 29px;
- font-size: 16px;
- padding: 0;
- position: absolute;
- left: 0px;
- top: 0px;
- z-index: 50;
- color: #666666;
- border-radius: 5px 0px 0px 5px;
- transition: all 0.2s ease-in;
-
- &.sidebar-shown {
- > i {
- display: inline-block;
- transform: rotate(180deg);
- }
- }
-
- &:hover {
- color: #434346;
- }
- }
-}
-
-.sidebar-toggle-btn {
- display: none $imp;
-}
-
-.btn-toggle-main-menu {
- background: $my_color;
- border: 0px;
- margin: 0px 15px 0px 0px;
- height: 30px;
- width: 30px;
- min-width: 30px;
- display: inline-block;
- text-align: center;
- line-height: 30px;
- font-size: 16px;
- padding: 0;
- color: #ffffff;
- border-radius: 5px;
- transition: all 0.2s ease-in;
-
- &:hover {
- background: $my_color_hover;
- }
-}
-
-.page-form .filter-button.btn-primary-light {
- color: #000000;
-}
-
-.filter-icon.active use {
- stroke: #000000;
-}
-
-.layout-main-section-wrapper {
- margin-bottom: 0;
-}
-
-.widget .widget-head .widget-label .widget-title {
- font-weight: 600;
-}
-
-.widget.shortcut-widget-box {
- border: 1px solid #ddd;
- box-shadow: 0px 3px 10px -5px rgba(0, 0, 0, .20);
- border-radius: 6px;
- padding: 10px 12px;
- transition: all 0.2s ease-in-out;
-
- .widget-title {
- transition: all 0.2s ease-in-out;
- }
-
- & ~ .divider {
- display: none;
- }
-
- &:hover {
- border-color: var(--blue-500);
-
- .widget-title {
- color: var(--blue-500) !important;
- }
- }
-}
-
-.widget.dashboard-widget-box, .number-widget-box {
- border: 1px solid #ddd;
- box-shadow: 0px 3px 10px -5px rgba(0, 0, 0, .20);
-}
-
-.widget.links-widget-box {
- border: 1px solid #ddd;
- box-shadow: 0px 3px 10px -5px rgba(0, 0, 0, .20);
-
- .widget-head {
- border-bottom: 1px solid #ddd;
- padding: 8px 15px 10px 15px;
- margin: -13px -13px -8px -13px;
- }
-
- .link-item {
- font-weight: 600;
- }
-}
-
-.layout-main-section .frappe-list .result, .layout-main-section .frappe-list .no-result, .layout-main-section .frappe-list .freeze, .layout-main-section .report-wrapper .result, .layout-main-section .report-wrapper .no-result, .layout-main-section .report-wrapper .freeze {
- min-height: calc(100vh - 295px);
-}
-
-.theme-setting-colors-select {
- margin: 0px;
-
- > h4 {
- font-weight: 600;
- margin-bottom: 15px;
- }
-
- button {
- background: #aaaaaa;
- border: 0px;
- outline: none;
- width: 100%;
- height: 65px;
- text-align: center;
- line-height: 65px;
- color: #ffffff;
- border-radius: 5px;
- transition: all 0.2s ease-in-out;
-
- &.active {
- position: relative;
- box-shadow: inset 0px 0px 5px rgba(0, 0, 0, 0.45);
-
- &:after {
- content: "\f058";
- font-family: "Font Awesome 5 Pro";
- font-weight: 700;
- font-size: 18px;
- position: absolute;
- line-height: 26px;
- top: 0px;
- right: 5px;
- }
- }
-
- &[data-color="Blue"] {
- background: $my_color;
- }
-
- &[data-color="Green"] {
- background: $green_color_style;
- }
-
- &[data-color="Red"] {
- background: $red_color_style;
- }
-
- &[data-color="Orange"] {
- background: $orange_color_style;
- }
-
- &[data-color="Yellow"] {
- background: $yellow_color_style;
- }
-
- &[data-color="Pink"] {
- background: $pink_color_style;
- }
-
- &[data-color="Violet"] {
- background: $violet_color_style;
- }
- }
-}
-
-.form-tabs-sticky-down {
- top: calc(var(--navbar-height) + var(--page-head-height) - 25px) $imp;
-}
-
-.frappe-control[data-fieldtype=Icon] .selected-icon {
- top: calc(50% + -1px);
- font-size: 18px;
-}
-
-.icon-picker .icons .icon-wrapper {
- font-size: 20px;
- opacity: .8;
- color: #444;
- border: 1px solid #aaa;
- border-radius: 4px;
- margin: 2.4px 2px;
- transition: all 0.2s ease-in-out;
-
- &:hover {
- border-color: #444444;
- color: #000000;
- opacity: 1;
- }
-
- > i {
- display: block;
- margin: 0px auto;
- }
-}
diff --git a/datavalue_theme_14/public/scss/partials/_rtl.scss b/datavalue_theme_14/public/scss/partials/_rtl.scss
index 274d82d..89c2190 100644
--- a/datavalue_theme_14/public/scss/partials/_rtl.scss
+++ b/datavalue_theme_14/public/scss/partials/_rtl.scss
@@ -1,4 +1,4 @@
-body.frappe-rtl {
+body.xhiveframework-rtl {
direction: rtl;
text-align: right;
overflow-x: hidden $imp;
@@ -180,7 +180,7 @@ body.frappe-rtl {
text-align: right;
}
- .frappe-control[data-fieldtype="Select"] .control-input .select-icon, .frappe-control[data-fieldtype="Select"].form-group .select-icon {
+ .xhiveframework-control[data-fieldtype="Select"] .control-input .select-icon, .xhiveframework-control[data-fieldtype="Select"].form-group .select-icon {
top: 6px;
right: inherit;
left: 12px;
@@ -211,7 +211,7 @@ body.frappe-rtl {
line-height: 21px;
}
- .frappe-control[data-fieldtype="Select"] .control-input .placeholder, .frappe-control[data-fieldtype="Select"].form-group .placeholder {
+ .xhiveframework-control[data-fieldtype="Select"] .control-input .placeholder, .xhiveframework-control[data-fieldtype="Select"].form-group .placeholder {
right: 12px;
left: inherit;
}
@@ -287,7 +287,7 @@ body.frappe-rtl {
text-align: right;
}
- .frappe-control {
+ .xhiveframework-control {
text-align: right;
}
@@ -530,7 +530,7 @@ body.frappe-rtl {
margin-right: 0;
}
- .frappe-control[data-fieldtype="Select"] .control-input select, .frappe-control[data-fieldtype="Select"].form-group select {
+ .xhiveframework-control[data-fieldtype="Select"] .control-input select, .xhiveframework-control[data-fieldtype="Select"].form-group select {
text-align: right $imp;
}
@@ -563,7 +563,7 @@ body.frappe-rtl {
padding-right: 0px;
padding-left: 15px;
}
- .layout-main-section.form-dashboard-section, .layout-main-section.form-section.card-section, .layout-main-section.frappe-card {
+ .layout-main-section.form-dashboard-section, .layout-main-section.form-section.card-section, .layout-main-section.xhiveframework-card {
overflow: visible;
}
}
diff --git a/datavalue_theme_14/templates/includes/login/login.js b/datavalue_theme_14/templates/includes/login/login.js
index 7be1fbd..a3f9fd0 100644
--- a/datavalue_theme_14/templates/includes/login/login.js
+++ b/datavalue_theme_14/templates/includes/login/login.js
@@ -17,11 +17,11 @@ login.bind_events = function () {
event.preventDefault();
var args = {};
args.cmd = "login";
- args.usr = frappe.utils.xss_sanitise(($("#login_email").val() || "").trim());
+ args.usr = xhiveframework.utils.xss_sanitise(($("#login_email").val() || "").trim());
args.pwd = $("#login_password").val();
args.device = "desktop";
if (!args.usr || !args.pwd) {
- frappe.msgprint('{{ _("Both login and password required") }}');
+ xhiveframework.msgprint('{{ _("Both login and password required") }}');
return false;
}
login.call(args);
@@ -31,10 +31,10 @@ login.bind_events = function () {
$(".form-signup").on("submit", function (event) {
event.preventDefault();
var args = {};
- args.cmd = "frappe.core.doctype.user.user.sign_up";
+ args.cmd = "xhiveframework.core.doctype.user.user.sign_up";
args.email = ($("#signup_email").val() || "").trim();
- args.redirect_to = frappe.utils.sanitise_redirect(frappe.utils.get_url_arg("redirect-to"));
- args.full_name = frappe.utils.xss_sanitise(($("#signup_fullname").val() || "").trim());
+ args.redirect_to = xhiveframework.utils.sanitise_redirect(xhiveframework.utils.get_url_arg("redirect-to"));
+ args.full_name = xhiveframework.utils.xss_sanitise(($("#signup_fullname").val() || "").trim());
if (!args.email || !validate_email(args.email) || !args.full_name) {
login.set_status('{{ _("Valid email and name required") }}', 'red');
return false;
@@ -46,7 +46,7 @@ login.bind_events = function () {
$(".form-forgot").on("submit", function (event) {
event.preventDefault();
var args = {};
- args.cmd = "frappe.core.doctype.user.user.reset_password";
+ args.cmd = "xhiveframework.core.doctype.user.user.reset_password";
args.user = ($("#forgot_email").val() || "").trim();
if (!args.user) {
login.set_status('{{ _("Valid Login id required.") }}', 'red');
@@ -138,7 +138,7 @@ login.signup = function () {
login.call = function (args, callback) {
login.set_status('{{ _("Verifying...") }}', 'blue');
- return frappe.call({
+ return xhiveframework.call({
type: "POST",
args: args,
callback: callback,
@@ -196,20 +196,20 @@ login.login_handlers = (function () {
if (data.message == 'Logged In') {
login.set_status('{{ _("Success") }}', 'green');
document.body.innerHTML = `{% include "templates/includes/splash_screen.html" %}`;
- window.location.href = frappe.utils.sanitise_redirect(frappe.utils.get_url_arg("redirect-to")) || data.home_page;
+ window.location.href = xhiveframework.utils.sanitise_redirect(xhiveframework.utils.get_url_arg("redirect-to")) || data.home_page;
} else if (data.message == 'Password Reset') {
- window.location.href = frappe.utils.sanitise_redirect(data.redirect_to);
+ window.location.href = xhiveframework.utils.sanitise_redirect(data.redirect_to);
} else if (data.message == "No App") {
login.set_status("{{ _('Success') }}", 'green');
if (localStorage) {
var last_visited =
localStorage.getItem("last_visited")
- || frappe.utils.sanitise_redirect(frappe.utils.get_url_arg("redirect-to"));
+ || xhiveframework.utils.sanitise_redirect(xhiveframework.utils.get_url_arg("redirect-to"));
localStorage.removeItem("last_visited");
}
if (data.redirect_to) {
- window.location.href = frappe.utils.sanitise_redirect(data.redirect_to);
+ window.location.href = xhiveframework.utils.sanitise_redirect(data.redirect_to);
}
if (last_visited && last_visited != "/login") {
@@ -234,7 +234,7 @@ login.login_handlers = (function () {
login.set_status(data.message[1], 'red');
} else {
login.set_status('{{ _("Success") }}', 'green');
- frappe.msgprint(data.message[1])
+ xhiveframework.msgprint(data.message[1])
}
//login.set_status(__(data.message), 'green');
}
@@ -261,7 +261,7 @@ login.login_handlers = (function () {
return login_handlers;
})();
-frappe.ready(function () {
+xhiveframework.ready(function () {
login.bind_events();
@@ -281,9 +281,9 @@ var verify_token = function (event) {
var args = {};
args.cmd = "login";
args.otp = $("#login_token").val();
- args.tmp_id = frappe.get_cookie('tmp_id');
+ args.tmp_id = xhiveframework.get_cookie('tmp_id');
if (!args.otp) {
- frappe.msgprint('{{ _("Login token required") }}');
+ xhiveframework.msgprint('{{ _("Login token required") }}');
return false;
}
login.call(args);
diff --git a/datavalue_theme_14/www/app.html b/datavalue_theme_14/www/app.html
index 0652525..30dc19a 100644
--- a/datavalue_theme_14/www/app.html
+++ b/datavalue_theme_14/www/app.html
@@ -44,7 +44,7 @@