Просмотр исходного кода

Allow local only URL's - will auto hide if not on local network

causefx 7 лет назад
Родитель
Сommit
9b8e095af5
3 измененных файлов с 9 добавлено и 9 удалено
  1. 6 6
      js/custom.js
  2. 0 0
      js/custom.min.js
  3. 3 3
      js/functions.js

+ 6 - 6
js/custom.js

@@ -873,10 +873,10 @@ $(document).on("click", ".editTab", function () {
     if (typeof post.tabImage == 'undefined' || post.tabImage == '') {
         message('Edit Tab Error',' Please set a Tab Image',activeInfo.settings.notifications.position,'#FFF','warning','5000');
     }
-    if (typeof post.tabURL == 'undefined' || post.tabURL == '') {
-        message('Edit Tab Error',' Please set a Tab URL',activeInfo.settings.notifications.position,'#FFF','warning','5000');
+    if ((typeof post.tabURL == 'undefined' || post.tabURL == '') && (typeof post.tabLocalURL == 'undefined' || post.tabLocalURL == '')) {
+        message('Edit Tab Error',' Please set a Tab URL or Local URL',activeInfo.settings.notifications.position,'#FFF','warning','5000');
     }
-    if(post.id !== '' && post.tabName !== '' && post.tabImage !== '' && post.tabURL !== '' ){
+    if(post.id !== '' && post.tabName !== '' && post.tabImage !== ''){
         var callbacks = $.Callbacks();
         callbacks.add( buildTabEditor );
         settingsAPI(post,callbacks);
@@ -910,13 +910,13 @@ $(document).on("click", ".addNewTab", function () {
     if (typeof post.tabName == 'undefined' || post.tabName == '') {
         message('New Tab Error',' Please set a Tab Name',activeInfo.settings.notifications.position,'#FFF','error','5000');
     }
-    if (typeof post.tabURL == 'undefined' || post.tabURL == '') {
-        message('New Tab Error',' Please set a Tab URL',activeInfo.settings.notifications.position,'#FFF','warning','5000');
+    if ((typeof post.tabURL == 'undefined' || post.tabURL == '') && (typeof post.tabLocalURL == 'undefined' || post.tabLocalURL == '')) {
+        message('New Tab Error',' Please set a Tab URL or Local URL',activeInfo.settings.notifications.position,'#FFF','warning','5000');
     }
     if (typeof post.tabImage == 'undefined' || post.tabImage == '') {
         message('New Tab Error',' Please set a Tab Image',activeInfo.settings.notifications.position,'#FFF','warning','5000');
     }
-    if(post.tabOrder !== '' && post.tabName !== '' && post.tabURL !== '' && post.tabImage !== '' ){
+    if(post.tabOrder !== '' && post.tabName !== '' && (post.tabURL !== '' || post.tabLocalURL !== '') && post.tabImage !== '' ){
         var callbacks = $.Callbacks();
         callbacks.add( buildTabEditor );
         settingsAPI(post,callbacks);

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
js/custom.min.js


+ 3 - 3
js/functions.js

@@ -2111,7 +2111,7 @@ function tabProcess(arrayItems) {
 	var defaultTabType = null;
 	if (Array.isArray(arrayItems['data']['tabs']) && arrayItems['data']['tabs'].length > 0) {
 		$.each(arrayItems['data']['tabs'], function(i,v) {
-			if(v.enabled === 1){
+			if(v.enabled === 1 && v.access_url){
                 if(v.default === 1){
                     defaultTabName = cleanClass(v.name);
                     defaultTabType = v.type;
@@ -2204,7 +2204,7 @@ function buildSplashScreenItem(arrayItems){
     if (Array.isArray(arrayItems['data']['tabs']) && arrayItems['data']['tabs'].length > 0) {
         arrayItems['data']['tabs'].sort((a, b) => parseFloat(a.order) - parseFloat(b.order));
         $.each(arrayItems['data']['tabs'], function(i,v) {
-            if(v.enabled === 1 && v.splash === 1){
+            if(v.enabled === 1 && v.splash === 1 && v.access_url){
                 var image = iconPrefixSplash(v.image);
                 if(image.indexOf('.') !== -1){
                     var dataSrc = 'data-src="'+iconPrefixSplash(v.image)+'"';
@@ -2214,7 +2214,7 @@ function buildSplashScreenItem(arrayItems){
                     var nonImage = '<span class="text-uppercase badge bg-org splash-badge">'+image+'</span>';
                 }
                 splashList += `
-                <div class="col-xs-12 col-sm-3 col-md-3 col-lg-3 col-xl-2 mouse hvr-grow m-b-20" id="menu-`+cleanClass(v.name)+`" type="`+v.type+`" data-url="`+v.url+`" onclick="tabActions(event,'`+cleanClass(v.name)+`',`+v.type+`);">
+                <div class="col-xs-12 col-sm-3 col-md-3 col-lg-3 col-xl-2 mouse hvr-grow m-b-20" id="menu-`+cleanClass(v.name)+`" type="`+v.type+`" data-url="`+v.access_url+`" onclick="tabActions(event,'`+cleanClass(v.name)+`',`+v.type+`);">
                     <div class="homepage-drag fc-event bg-org lazyload"  `+ dataSrc +`>
                         `+nonImage+`
                         <span class="homepage-text">&nbsp; `+v.name+`</span>

Некоторые файлы не были показаны из-за большого количества измененных файлов