jdarwood007

jdarwood007 commited on 2018-08-11 14:55:57
Showing 5 changed files, with 29 additions and 27 deletions.

... ...
@@ -271,9 +271,9 @@ function QuickReply(oOptions)
271 271
 QuickReply.prototype.quote = function (e)
272 272
 {
273 273
 	e.preventDefault();
274
-	iMessageId = e.currentTarget.dataset.id;
274
+	this.iMessageId = e.currentTarget.dataset.id;
275 275
 
276
-	shd_getJSONDocument(smf_prepareScriptUrl(this.opt.sScriptUrl) + 'action=helpdesk;sa=ajax;op=quote;quote=' + iMessageId + ';' + this.opt.sSession + ';json' + ';mode=' + (oEditorHandle_shd_message.bRichTextEnabled ? 1 : 0), this.onQuoteReceived.bind(this));
276
+	shd_getJSONDocument(smf_prepareScriptUrl(this.opt.sScriptUrl) + 'action=helpdesk;sa=ajax;op=quote;quote=' + this.iMessageId + ';' + this.opt.sSession + ';json' + ';mode=' + (oEditorHandle_shd_message.bRichTextEnabled ? 1 : 0), this.onQuoteReceived.bind(this));
277 277
 
278 278
 	// Move the view to the quick reply box.
279 279
 	window.location.hash = navigator.appName == 'Microsoft Internet Explorer' ? this.opt.sJumpAnchor : '#' + this.opt.sJumpAnchor;
... ...
@@ -295,7 +295,7 @@ function CannedReply(oOptions)
295 295
 	$('#' + this.opt.sCannedRepliesContainerId + ' input.button').on('click', this.getReply.bind(this));
296 296
 }
297 297
 
298
-CannedReply.prototype.getReply = function (e)
298
+CannedReply.prototype.getReply = function ()
299 299
 {
300 300
 	var iReplyId = $('#' + this.opt.sSelectContainerId).val();
301 301
 	if (!iReplyId || parseInt(iReplyId, 10) < 1)
... ...
@@ -519,7 +519,7 @@ function goAdvanced(oOptions)
519 519
 	$(document).ready(this.init.bind(this));
520 520
 }
521 521
 
522
-goAdvanced.prototype.init = function(e)
522
+goAdvanced.prototype.init = function()
523 523
 {
524 524
 	$('#' + this.opt.sBbcContainerId +
525 525
 		', .' + this.opt.sBbcContainerEditorClass +
... ...
@@ -554,7 +554,7 @@ shd_dept_filter.prototype.startFilter = function ()
554 554
 	$(this.opt.oFields).each(this.filterDept.bind(this));
555 555
 }
556 556
 
557
-shd_dept_filter.prototype.filterDept = function (index, value)
557
+shd_dept_filter.prototype.filterDept = function (index)
558 558
 {
559 559
 	this.currentDept = $('#' + this.opt.sSelectContainerId).val();
560 560
 
... ...
@@ -9,7 +9,7 @@ $(document).ready(function(){
9 9
 	$('input[type="submit"].save').parent('form').on('submit', function(){
10 10
 		submitonce(this.currentTarget);
11 11
 	});
12
-	$('input[type="submit"].save').on('click', function(e){
12
+	$('input[type="submit"].save').on('click', function(){
13 13
 		submitThisOnce(this.currentTarget);
14 14
 	});
15 15
 });
... ...
@@ -107,7 +107,7 @@ sd_AdminIndex.prototype.checkUpdateAvailable = function ()
107 107
 // Ticket number information...
108 108
 sd_AdminIndex.prototype.TickekTotals = function ()
109 109
 {
110
-	var infocontainer = $('#' + this.opt.sTotalTicketsInfoContainerID).toggle();
110
+	$('#' + this.opt.sTotalTicketsInfoContainerID).toggle();
111 111
 }
112 112
 
113 113
 // Modified, SMF 2.0 ToggleItem
... ...
@@ -129,17 +129,17 @@ shd_plugins.prototype.setupPlugins = function (index, itemID)
129 129
 shd_plugins.prototype.togglePlugin = function (e)
130 130
 {
131 131
 	e.preventDefault();
132
-	itemID = e.currentTarget.dataset.plugin;
132
+	this.itemID = e.currentTarget.dataset.plugin;
133 133
 
134 134
 	// Toggle the hidden item.
135 135
 	this.oItemValueHandle = $('#' + this.opt.sFeatureClass.replace('%itemid%', itemID));
136
-	this.bItemValue = this.oItemValueHandle.val() == 0 ? 1 : 0;
136
+	this.bItemValue = this.oItemValueHandle.val() == '0' ? 1 : 0;
137 137
 
138 138
 	// Change the image, alternative text and the title.
139
-	$('#' + this.opt.sSwitchClass.replace('%itemid%', itemID)).attr('src', this.bItemValue === 1 ? this.opt.sPluginOnImg : this.opt.sPluginOffImg);
140
-	$('#' + this.opt.sSwitchClass.replace('%itemid%', itemID)).attr('alt', this.bItemValue === 1 ? this.opt.sPluginOnText : this.opt.sPluginOffText);
141
-	$('#' + this.opt.sSwitchClass.replace('%itemid%', itemID)).attr('title', this.bItemValue === 1 ? this.opt.sPluginOnText : this.opt.sPluginOffText);
142
-	$('#' + this.opt.sFeatureClass.replace('%itemid%', itemID)).val(this.bItemValue);
139
+	$('#' + this.opt.sSwitchClass.replace('%itemid%', this.itemID)).attr('src', this.bItemValue === 1 ? this.opt.sPluginOnImg : this.opt.sPluginOffImg);
140
+	$('#' + this.opt.sSwitchClass.replace('%itemid%', this.itemID)).attr('alt', this.bItemValue === 1 ? this.opt.sPluginOnText : this.opt.sPluginOffText);
141
+	$('#' + this.opt.sSwitchClass.replace('%itemid%', this.itemID)).attr('title', this.bItemValue === 1 ? this.opt.sPluginOnText : this.opt.sPluginOffText);
142
+	$('#' + this.opt.sFeatureClass.replace('%itemid%', this.itemID)).val(this.bItemValue);
143 143
 
144 144
 	// Don't reload.
145 145
 	return false;
... ...
@@ -309,38 +309,38 @@ shd_AttributeValidate.prototype.focusValidator = function (e)
309 309
 /* Reattribute Posts: Validate if we can start the process to reattribute */
310 310
 shd_AttributeValidate.prototype.validator = function ()
311 311
 {
312
-	origText = this.opt.sOrigText;
313
-	origTextStarter = this.opt.sOrigTextStarter;
314
-	valid = true;
312
+	this.origText = this.opt.sOrigText;
313
+	this.origTextStarter = this.opt.sOrigTextStarter;
314
+	this.valid = true;
315 315
 
316 316
 	// Do all the fields!
317 317
 	if (!$('#' + this.opt.sToContainerId).val())
318
-		valid = false;
318
+		this.valid = false;
319 319
 
320
-	warningMessage = origText.replace(/%member_to%/, $('#' + this.opt.sToContainerId).value);
320
+	warningMessage = this.origText.replace(/%member_to%/, $('#' + this.opt.sToContainerId).value);
321 321
 
322 322
 	if ($('#' + this.opt.sTypeEmailContainerId).is(":checked"))
323 323
 	{
324 324
 		$('#' + this.opt.sStarterContainerId + ', #' + this.opt.sFromContainerId).val("");
325
-			valid = $('#' + this.opt.sEmailContainerId).val() != '';
325
+			this.valid = $('#' + this.opt.sEmailContainerId).val() != '';
326 326
 		warningMessage = warningMessage.replace(/%type%/, this.opt.sEmailConfirmText).replace(/%find%/, $('#' + this.opt.sEmailContainerId).val());
327 327
 	}
328 328
 	else if ($('#' + this.opt.sTypeStarterContainerId).is(":checked"))
329 329
 	{
330 330
 		$('#' + this.opt.sEmailContainerId + ' #' + this.opt.sFromContainerId).val("");
331 331
 
332
-			valid = $('#' + this.opt.sStarterContainerId).val() != '';
333
-		warningMessage = origTextStarter.replace(/%member_to%/, $('#' + this.opt.sToContainerId).val()).replace(/%find%/, $('#' + this.opt.sStarterContainerId).val());			
332
+			this.valid = $('#' + this.opt.sStarterContainerId).val() != '';
333
+		warningMessage = this.origTextStarter.replace(/%member_to%/, $('#' + this.opt.sToContainerId).val()).replace(/%find%/, $('#' + this.opt.sStarterContainerId).val());			
334 334
 	}
335 335
 	else
336 336
 	{
337 337
 		$('#' + this.opt.sEmailContainerId + ' #' + this.opt.sStarterContainerId).val("");
338 338
 
339
-		valid = $('#' + this.opt.sFromContainerId).val() != '';
339
+		this.valid = $('#' + this.opt.sFromContainerId).val() != '';
340 340
 		warningMessage = warningMessage.replace(/%type%/, this.opt.sFromConfirmText).replace(/%find%/, $('#' + this.opt.sFromContainerId).val());
341 341
 	}
342 342
 
343
-	$('#' + this.opt.sDoAttributeContainerId).prop("disabled", valid ? false : true);
343
+	$('#' + this.opt.sDoAttributeContainerId).prop("disabled", this.valid ? false : true);
344 344
 }
345 345
 
346 346
 /* Roles Management */
... ...
@@ -199,10 +199,10 @@ function template_shd_admin_maint_findrepairdone()
199 199
 
200 200
 		// Heh, super squeeky buns time!
201 201
 		// Each test has potentially its own feedback to give. So we'll handle each one separately.
202
-		foreach (array('zero_tickets', 'zero_msgs', 'deleted', 'first_last', 'status', 'starter_updater', 'invalid_dept') as $maintResult)
203
-			if (!empty($context['maintenance_result'][$maintResult]))
202
+		foreach (array('zero_tickets', 'zero_msgs', 'deleted', 'first_last', 'status', 'starter_updater', 'invalid_dept') as $maint)
203
+			if (!empty($context['maintenance_result'][$maint]))
204 204
 				echo '
205
-				<p class="padding">', sprintf($txt['shd_maint_' . $maintTxt], $context['maintenance_result'][$maintResult]), '</p>';
205
+				<p class="padding">', sprintf($txt['shd_maint_' . $maint], $context['maintenance_result'][$maint]), '</p>';
206 206
 
207 207
 		echo '
208 208
 				<p class="padding">
... ...
@@ -46,9 +46,11 @@ function template_viewticket()
46 46
 					<a href="', $button['url'], '"', (!empty($button['is_last']) ? ' id="last"' : ''), '', (!empty($button['onclick']) ? ' onclick="' . $button['onclick'] . '"' : ''), '><img src="', $settings['default_images_url'], '/simpledesk/', $button['icon'], '.png" alt="', $button['alt'], '" title="', $txt[$button['text']], '"> ', $txt[$button['text']], '</a>';
47 47
 	elseif ($modSettings['shd_ticketnav_style'] == 'sdcompact')
48 48
 		foreach ($context['ticket_navigation'] as $button)
49
+		{
49 50
 			if (!empty($button['display']))
50 51
 				echo '
51 52
 					<a href="', $button['url'], '"', (!empty($button['is_last']) ? ' id="last"' : ''), '', (!empty($button['onclick']) ? ' onclick="' . $button['onclick'] . '"' : ''), '><img src="', $settings['default_images_url'], '/simpledesk/', $button['icon'], '.png" alt="', $button['alt'], '" title="', $txt[$button['text']], '"></a>';
53
+		}
52 54
 
53 55
 	echo '
54 56
 				</span>
... ...
@@ -778,7 +778,7 @@ function template_ticket_do_replies()
778 778
 
779 779
 function template_ticket_do_single_reply($reply)
780 780
 {
781
-	global $context, $modSettings, $settings, $txt;
781
+	global $context, $modSettings, $settings, $options, $scripturl, $txt;
782 782
 
783 783
 	echo '
784 784
 					<div class="windowbg" id="reply', $reply['id'], '">
785 785