diff --git a/InvenTree/InvenTree/static/script/inventree/inventree.js b/InvenTree/InvenTree/static/script/inventree/inventree.js
index df19ca06d2..df49d3d670 100644
--- a/InvenTree/InvenTree/static/script/inventree/inventree.js
+++ b/InvenTree/InvenTree/static/script/inventree/inventree.js
@@ -16,6 +16,7 @@
sanitizeData,
*/
+
function attachClipboard(selector, containerselector, textElement) {
// set container
if (containerselector) {
diff --git a/InvenTree/InvenTree/static/script/inventree/message.js b/InvenTree/InvenTree/static/script/inventree/message.js
new file mode 100644
index 0000000000..24bb8c7700
--- /dev/null
+++ b/InvenTree/InvenTree/static/script/inventree/message.js
@@ -0,0 +1,128 @@
+/* exported
+ showMessage,
+ showAlertOrCache,
+ showCachedAlerts,
+*/
+
+/*
+ * Display an alert message at the top of the screen.
+ * The message will contain a "close" button,
+ * and also dismiss automatically after a certain amount of time.
+ *
+ * arguments:
+ * - message: Text / HTML content to display
+ *
+ * options:
+ * - style: alert style e.g. 'success' / 'warning'
+ * - timeout: Time (in milliseconds) after which the message will be dismissed
+ */
+function showMessage(message, options={}) {
+
+ var style = options.style || 'info';
+
+ var timeout = options.timeout || 5000;
+
+ var target = options.target || $('#alerts');
+
+ var details = '';
+
+ if (options.details) {
+ details = `
${options.details}
`;
+ }
+
+ // Hacky function to get the next available ID
+ var id = 1;
+
+ while ($(`#alert-${id}`).exists()) {
+ id++;
+ }
+
+ var icon = '';
+
+ if (options.icon) {
+ icon = ``;
+ }
+
+ // Construct the alert
+ var html = `
+
+ ${icon}
+ ${message}
+ ${details}
+
+
+ `;
+
+ target.append(html);
+
+ // Remove the alert automatically after a specified period of time
+ $(`#alert-${id}`).delay(timeout).slideUp(200, function() {
+ $(this).alert(close);
+ });
+}
+
+
+/*
+ * Add a cached alert message to sesion storage
+ */
+function addCachedAlert(message, options={}) {
+
+ var alerts = sessionStorage.getItem('inventree-alerts');
+
+ if (alerts) {
+ alerts = JSON.parse(alerts);
+ } else {
+ alerts = [];
+ }
+
+ alerts.push({
+ message: message,
+ style: options.style || 'success',
+ icon: options.icon,
+ });
+
+ sessionStorage.setItem('inventree-alerts', JSON.stringify(alerts));
+}
+
+
+/*
+ * Remove all cached alert messages
+ */
+function clearCachedAlerts() {
+ sessionStorage.removeItem('inventree-alerts');
+}
+
+
+/*
+ * Display an alert, or cache to display on reload
+ */
+function showAlertOrCache(message, cache, options={}) {
+
+ if (cache) {
+ addCachedAlert(message, options);
+ } else {
+ showMessage(message, options);
+ }
+}
+
+
+/*
+ * Display cached alert messages when loading a page
+ */
+function showCachedAlerts() {
+
+ var alerts = JSON.parse(sessionStorage.getItem('inventree-alerts')) || [];
+
+ alerts.forEach(function(alert) {
+
+ showMessage(
+ alert.message,
+ {
+ style: alert.style || 'success',
+ icon: alert.icon,
+ }
+ );
+ });
+
+ clearCachedAlerts();
+}
\ No newline at end of file
diff --git a/InvenTree/templates/account/base.html b/InvenTree/templates/account/base.html
index ef2398f327..4ac646b717 100644
--- a/InvenTree/templates/account/base.html
+++ b/InvenTree/templates/account/base.html
@@ -89,27 +89,20 @@
{% include "third_party_js.html" %}
-
-
-
+
diff --git a/InvenTree/templates/base.html b/InvenTree/templates/base.html
index 851b6ca323..7b6f0fb187 100644
--- a/InvenTree/templates/base.html
+++ b/InvenTree/templates/base.html
@@ -141,6 +141,7 @@
+
diff --git a/InvenTree/templates/js/translated/notification.js b/InvenTree/templates/js/translated/notification.js
index fcd626fbea..c497755f40 100644
--- a/InvenTree/templates/js/translated/notification.js
+++ b/InvenTree/templates/js/translated/notification.js
@@ -2,8 +2,6 @@
/* exported
loadNotificationTable,
- showAlertOrCache,
- showCachedAlerts,
startNotificationWatcher,
stopNotificationWatcher,
openNotificationPanel,
@@ -100,128 +98,6 @@ function loadNotificationTable(table, options={}, enableDelete=false) {
}
-/*
- * Add a cached alert message to sesion storage
- */
-function addCachedAlert(message, options={}) {
-
- var alerts = sessionStorage.getItem('inventree-alerts');
-
- if (alerts) {
- alerts = JSON.parse(alerts);
- } else {
- alerts = [];
- }
-
- alerts.push({
- message: message,
- style: options.style || 'success',
- icon: options.icon,
- });
-
- sessionStorage.setItem('inventree-alerts', JSON.stringify(alerts));
-}
-
-
-/*
- * Remove all cached alert messages
- */
-function clearCachedAlerts() {
- sessionStorage.removeItem('inventree-alerts');
-}
-
-
-/*
- * Display an alert, or cache to display on reload
- */
-function showAlertOrCache(message, cache, options={}) {
-
- if (cache) {
- addCachedAlert(message, options);
- } else {
- showMessage(message, options);
- }
-}
-
-
-/*
- * Display cached alert messages when loading a page
- */
-function showCachedAlerts() {
-
- var alerts = JSON.parse(sessionStorage.getItem('inventree-alerts')) || [];
-
- alerts.forEach(function(alert) {
- showMessage(
- alert.message,
- {
- style: alert.style || 'success',
- icon: alert.icon,
- }
- );
- });
-
- clearCachedAlerts();
-}
-
-
-/*
- * Display an alert message at the top of the screen.
- * The message will contain a "close" button,
- * and also dismiss automatically after a certain amount of time.
- *
- * arguments:
- * - message: Text / HTML content to display
- *
- * options:
- * - style: alert style e.g. 'success' / 'warning'
- * - timeout: Time (in milliseconds) after which the message will be dismissed
- */
-function showMessage(message, options={}) {
-
- var style = options.style || 'info';
-
- var timeout = options.timeout || 5000;
-
- var target = options.target || $('#alerts');
-
- var details = '';
-
- if (options.details) {
- details = `
${options.details}
`;
- }
-
- // Hacky function to get the next available ID
- var id = 1;
-
- while ($(`#alert-${id}`).exists()) {
- id++;
- }
-
- var icon = '';
-
- if (options.icon) {
- icon = ``;
- }
-
- // Construct the alert
- var html = `
-
- ${icon}
- ${message}
- ${details}
-
-
- `;
-
- target.append(html);
-
- // Remove the alert automatically after a specified period of time
- $(`#alert-${id}`).delay(timeout).slideUp(200, function() {
- $(this).alert(close);
- });
-}
-
var notificationWatcher = null; // reference for the notificationWatcher
/**
* start the regular notification checks
diff --git a/InvenTree/templates/skeleton.html b/InvenTree/templates/skeleton.html
index 8d66785b37..3609a44874 100644
--- a/InvenTree/templates/skeleton.html
+++ b/InvenTree/templates/skeleton.html
@@ -70,6 +70,7 @@
+
{% block body_scripts_inventree %}
{% endblock %}