diff --git a/objects/functions.php b/objects/functions.php
index 03d6b67b2..ff644f75c 100644
--- a/objects/functions.php
+++ b/objects/functions.php
@@ -1208,13 +1208,19 @@ function getCategoriesSelect($id) {
categories, 'hierarchyAndName'), SORT_ASC, $_SESSION['login']->categories);
- foreach ($_SESSION['login']->categories as $key => $value) {
- echo '';
- }
- ?>
-
+ if (Login::canCreateCategory()) {
+ ?>
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/view/js/main.js b/view/js/main.js
index 3d84c2232..474e124e6 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -5,37 +5,75 @@ var modal;
* @param {type} href
* @returns {Element|getLocation.l}
* var l = getLocation("http://example.com/path");
-console.debug(l.hostname)
->> "example.com"
-console.debug(l.pathname)
->> "/path"
+ console.debug(l.hostname)
+ >> "example.com"
+ console.debug(l.pathname)
+ >> "/path"
*/
-var getLocation = function(href) {
+var getLocation = function (href) {
var l = document.createElement("a");
l.href = href;
return l;
};
$(function () {
- modal = modal || (function () {
- var pleaseWaitDiv = $("#pleaseWaitDialog");
- if (pleaseWaitDiv.length === 0) {
- pleaseWaitDiv = $('
').appendTo('body');
+ modal = modal || (function () {
+ var pleaseWaitDiv = $("#pleaseWaitDialog");
+ if (pleaseWaitDiv.length === 0) {
+ pleaseWaitDiv = $('').appendTo('body');
+ }
+
+ return {
+ showPleaseWait: function () {
+ pleaseWaitDiv.modal();
+ },
+ hidePleaseWait: function () {
+ pleaseWaitDiv.modal('hide');
+ },
+ setProgress: function (valeur) {
+ pleaseWaitDiv.find('.progress-bar').css('width', valeur + '%').attr('aria-valuenow', valeur);
+ },
+ setText: function (text) {
+ pleaseWaitDiv.find('h2').html(text);
+ },
+ };
+ })();
+});
+
+var reloadIfIsNotEditingCategoryTimeout;
+function addNewCategory(streamerURL) {
+ clearTimeout(reloadIfIsNotEditingCategoryTimeout);
+ avideoModalIframe(streamerURL + 'categories');
+ reloadIfIsNotEditingCategoryTimeout = setTimeout(function () {
+ reloadIfIsNotEditingCategory();
+ }, 500);
+}
+
+function reloadIfIsNotEditingCategory() {
+ clearTimeout(reloadIfIsNotEditingCategoryTimeout);
+ if (!avideoModalIframeIsVisible()) {
+ loadCategories();
+ } else {
+ reloadIfIsNotEditingCategoryTimeout = setTimeout(function () {
+ reloadIfIsNotEditingCategory();
+ }, 500);
}
+}
- return {
- showPleaseWait: function () {
- pleaseWaitDiv.modal();
- },
- hidePleaseWait: function () {
- pleaseWaitDiv.modal('hide');
- },
- setProgress: function (valeur) {
- pleaseWaitDiv.find('.progress-bar').css('width', valeur + '%').attr('aria-valuenow', valeur);
- },
- setText: function (text) {
- pleaseWaitDiv.find('h2').html(text);
- },
- };
-})();
-});
\ No newline at end of file
+function loadCategories(streamerURL) {
+ console.log('loadCategories');
+ modal.showPleaseWait();
+ $.ajax({
+ url: streamerURL + 'objects/categories.json.php',
+ success: function (response) {
+ $('.categories_id').empty();
+ for (var item in response.rows) {
+ if (typeof response.rows[item] != 'object') {
+ continue;
+ }
+ $('.categories_id').append('');
+ }
+ modal.hidePleaseWait();
+ }
+ });
+}
\ No newline at end of file
diff --git a/view/mini-upload-form/form.php b/view/mini-upload-form/form.php
index 6e3f353c0..a54758552 100644
--- a/view/mini-upload-form/form.php
+++ b/view/mini-upload-form/form.php
@@ -15,34 +15,6 @@
-
-
-
-