Quellcode durchsuchen

changed tabActions to use tab id instead of tab name
renamed tabActions for plugins to switchToPlugin
switched value of name to id for getIframeTabs function

CauseFX vor 4 Jahren
Ursprung
Commit
17146c4c2a
3 geänderte Dateien mit 348 neuen und 226 gelöschten Zeilen
  1. 8 8
      api/functions/option-functions.php
  2. 1 1
      api/plugins/chat/main.js
  3. 339 217
      js/functions.js

+ 8 - 8
api/functions/option-functions.php

@@ -458,7 +458,7 @@ trait OptionsFunction
 					'type' => 'select',
 					'label' => 'Target URL',
 					'help' => 'Set the primary URL used when clicking on calendar icon.',
-					'options' => $this->makeOptionsFromValues($this->config[str_replace('CalendarLink','',$name).'URL'], true, 'Use Default'),
+					'options' => $this->makeOptionsFromValues($this->config[str_replace('CalendarLink', '', $name) . 'URL'], true, 'Use Default'),
 				];
 				break;
 			case 'calendarframetarget':
@@ -466,7 +466,7 @@ trait OptionsFunction
 					'type' => 'select',
 					'label' => 'Target Tab',
 					'help' => 'Set the tab used when clicking on calendar icon. If not set, link will open in new window.',
-					'options' => $this->getIframeTabs($this->config[str_replace('FrameTarget','CalendarLink',$name)])
+					'options' => $this->getIframeTabs($this->config[str_replace('FrameTarget', 'CalendarLink', $name)])
 				];
 				break;
 			default:
@@ -484,10 +484,10 @@ trait OptionsFunction
 		}
 		return $setting;
 	}
-	
+
 	public function getIframeTabs($url = "")
-	{	
-		if (!empty($url)){
+	{
+		if (!empty($url)) {
 			$response = [
 				array(
 					'function' => 'fetchAll',
@@ -512,10 +512,10 @@ trait OptionsFunction
 			'name' => 'Open in New Window',
 			'value' => ''
 		];
-		foreach($this->processQueries($response) as $result) {
+		foreach ($this->processQueries($response) as $result) {
 			$formattedValues[] = [
 				'name' => $result['name'],
-				'value' => $result['name']
+				'value' => $result['id']
 			];
 		}
 		return $formattedValues;
@@ -523,7 +523,7 @@ trait OptionsFunction
 
 	public function makeOptionsFromValues($values = null, $appendBlank = null, $blankLabel = null)
 	{
-		if ($appendBlank === true){
+		if ($appendBlank === true) {
 			$formattedValues[] = [
 				'name' => (!empty($blankLabel)) ? $blankLabel : 'Select option...',
 				'value' => ''

+ 1 - 1
api/plugins/chat/main.js

@@ -5,7 +5,7 @@ $('body').arrive('#activeInfo', {onceOnly: true}, function() {
 function chatLaunch(){
 	if(activeInfo.plugins["CHAT-enabled"] == true && activeInfo.plugins.includes["CHAT-authKey-include"] !== '' && activeInfo.plugins.includes["CHAT-appID-include"] !== '' && activeInfo.plugins.includes["CHAT-cluster-include"] !== ''){
 		if (activeInfo.user.groupID <= activeInfo.plugins.includes["CHAT-Auth-include"]) {
-			var menuList = `<li><a class=""  href="javascript:void(0)" onclick="tabActions(event,'chat','plugin');chatEntry();"><i class="fa fa-comments-o fa-fw"></i> <span lang="en">Chat</span><small class="chat-counter label label-rouded label-info pull-right hidden">0</small></a></li>`;
+			var menuList = `<li><a class=""  href="javascript:void(0)" onclick="switchToPlugin('chat');chatEntry();"><i class="fa fa-comments-o fa-fw"></i> <span lang="en">Chat</span><small class="chat-counter label label-rouded label-info pull-right hidden">0</small></a></li>`;
 			var htmlDOM = `
 			<div id="container-plugin-chat" class="plugin-container hidden">
 				<div class="chat-main-box bg-org">

Datei-Diff unterdrückt, da er zu groß ist
+ 339 - 217
js/functions.js


Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.