', {
262 | class: 'sidebar-brand'
263 | }).append(
264 | $('
', {
265 | href: $('.navbar-brand').attr('href'),
266 | }).html($('.navbar-brand').html())
267 | ));
268 | setTimeout(function() {
269 | sidebar_nicescroll = main_sidebar.niceScroll(sidebar_nicescroll_opts);
270 | sidebar_nicescroll = main_sidebar.getNiceScroll();
271 | }, 700);
272 |
273 | sidebar_dropdown();
274 | $(".main-wrapper").removeClass("container");
275 | }
276 | }else{
277 | $("body").removeClass("sidebar-gone sidebar-show");
278 | if(now_layout_class)
279 | $("body").addClass(now_layout_class);
280 |
281 | let nav_second_classes = $(".main-sidebar").attr('data-nav-classes'),
282 | nav_second = $(".main-sidebar");
283 |
284 | if(now_layout_class == 'layout-3' && nav_second.hasClass('main-sidebar')) {
285 | nav_second.find(".sidebar-menu li a.has-dropdown").off('click');
286 | nav_second.find('.sidebar-brand').remove();
287 | nav_second.removeAttr('class');
288 | nav_second.addClass(nav_second_classes);
289 |
290 | let main_sidebar = $(".navbar-secondary");
291 | main_sidebar.find('.sidebar-wrapper').addClass('container').removeClass('sidebar-wrapper');
292 | main_sidebar.find('.sidebar-menu').addClass('navbar-nav').removeClass('sidebar-menu');
293 | main_sidebar.find('.dropdown-menu').hide();
294 | main_sidebar.removeAttr('style');
295 | main_sidebar.removeAttr('tabindex');
296 | main_sidebar.removeAttr('data-nav-classes');
297 | $(".main-wrapper").addClass("container");
298 | // if(sidebar_nicescroll != null)
299 | // sidebar_nicescroll.remove();
300 | }else if(now_layout_class == 'layout-2') {
301 | $("body").addClass("layout-2");
302 | }else{
303 | update_sidebar_nicescroll();
304 | }
305 | }
306 | }
307 | toggleLayout();
308 | $(window).resize(toggleLayout);
309 |
310 | $('[data-toggle=\'search\']').on('click', function () {
311 | var body = $('body');
312 |
313 | if (body.hasClass('search-gone')) {
314 | body.addClass('search-gone');
315 | body.removeClass('search-show');
316 | } else {
317 | body.removeClass('search-gone');
318 | body.addClass('search-show');
319 | }
320 | });
321 |
322 | // tooltip
323 | $("[data-toggle='tooltip']").tooltip();
324 |
325 | // popover
326 | $('[data-toggle="popover"]').popover({
327 | container: 'body'
328 | });
329 |
330 | // Select2
331 | if(jQuery().select2) {
332 | $(".select2").select2();
333 | }
334 |
335 | // Selectric
336 | if(jQuery().selectric) {
337 | $(".selectric").selectric({
338 | disableOnMobile: false,
339 | nativeOnMobile: false
340 | });
341 | }
342 |
343 | $(".notification-toggle").dropdown();
344 | $(".notification-toggle").parent().on('shown.bs.dropdown', function() {
345 | $(".dropdown-list-icons").niceScroll({
346 | cursoropacitymin: .3,
347 | cursoropacitymax: .8,
348 | cursorwidth: 7
349 | });
350 | });
351 |
352 | $(".message-toggle").dropdown();
353 | $(".message-toggle").parent().on('shown.bs.dropdown', function() {
354 | $(".dropdown-list-message").niceScroll({
355 | cursoropacitymin: .3,
356 | cursoropacitymax: .8,
357 | cursorwidth: 7
358 | });
359 | });
360 |
361 | if($(".chat-content").length) {
362 | $(".chat-content").niceScroll({
363 | cursoropacitymin: .3,
364 | cursoropacitymax: .8,
365 | });
366 | $('.chat-content').getNiceScroll(0).doScrollTop($('.chat-content').height());
367 | }
368 |
369 | if(jQuery().summernote) {
370 | $(".summernote").summernote({
371 | dialogsInBody: true,
372 | minHeight: 250,
373 | });
374 | $(".summernote-simple").summernote({
375 | dialogsInBody: true,
376 | minHeight: 150,
377 | toolbar: [
378 | ['style', ['bold', 'italic', 'underline', 'clear']],
379 | ['font', ['strikethrough']],
380 | ['para', ['paragraph']]
381 | ]
382 | });
383 | }
384 |
385 | if(window.CodeMirror) {
386 | $(".codeeditor").each(function() {
387 | let editor = CodeMirror.fromTextArea(this, {
388 | lineNumbers: true,
389 | theme: "duotone-dark",
390 | mode: 'javascript',
391 | height: 200
392 | });
393 | editor.setSize("100%", 200);
394 | });
395 | }
396 |
397 | // Follow function
398 | $('.follow-btn, .following-btn').each(function() {
399 | var me = $(this),
400 | follow_text = 'Follow',
401 | unfollow_text = 'Following';
402 |
403 | me.on('click', function () {
404 | if (me.hasClass('following-btn')) {
405 | me.removeClass('btn-danger');
406 | me.removeClass('following-btn');
407 | me.addClass('btn-primary');
408 | me.html(follow_text);
409 |
410 | eval(me.data('unfollow-action'));
411 | } else {
412 | me.removeClass('btn-primary');
413 | me.addClass('btn-danger');
414 | me.addClass('following-btn');
415 | me.html(unfollow_text);
416 |
417 | eval(me.data('follow-action'));
418 | }
419 | return false;
420 | });
421 | });
422 |
423 | // Dismiss function
424 | $("[data-dismiss]").each(function() {
425 | var me = $(this),
426 | target = me.data('dismiss');
427 |
428 | me.on('click', function () {
429 | $(target).fadeOut(function () {
430 | $(target).remove();
431 | });
432 | return false;
433 | });
434 | });
435 |
436 | // Collapsable
437 | $("[data-collapse]").each(function() {
438 | var me = $(this),
439 | target = me.data('collapse');
440 |
441 | me.on('click', function () {
442 | $(target).collapse('toggle');
443 | $(target).on('shown.bs.collapse', function (e) {
444 | e.stopPropagation();
445 | me.html('');
446 | });
447 | $(target).on('hidden.bs.collapse', function (e) {
448 | e.stopPropagation();
449 | me.html('');
450 | });
451 | return false;
452 | });
453 | });
454 |
455 | // Gallery
456 | $(".gallery .gallery-item").each(function() {
457 | var me = $(this);
458 |
459 | me.attr('href', me.data('image'));
460 | me.attr('title', me.data('title'));
461 | if(me.parent().hasClass('gallery-fw')) {
462 | me.css({
463 | height: me.parent().data('item-height'),
464 | });
465 | me.find('div').css({
466 | lineHeight: me.parent().data('item-height') + 'px'
467 | });
468 | }
469 | me.css({
470 | backgroundImage: 'url("'+ me.data('image') +'")'
471 | });
472 | });
473 | if(jQuery().Chocolat) {
474 | $(".gallery").Chocolat({
475 | className: 'gallery',
476 | imageSelector: '.gallery-item',
477 | });
478 | }
479 |
480 | // Background
481 | $("[data-background]").each(function() {
482 | var me = $(this);
483 | me.css({
484 | backgroundImage: 'url(' + me.data('background') + ')'
485 | });
486 | });
487 |
488 | // Custom Tab
489 | $("[data-tab]").each(function() {
490 | var me = $(this);
491 |
492 | me.on('click', function () {
493 | if (!me.hasClass('active')) {
494 | var tab_group = $('[data-tab-group="' + me.data('tab') + '"]'),
495 | tab_group_active = $(
496 | '[data-tab-group="' + me.data('tab') + '"].active'),
497 | target = $(me.attr('href')),
498 | links = $('[data-tab="' + me.data('tab') + '"]');
499 |
500 | links.removeClass('active');
501 | me.addClass('active');
502 | target.addClass('active');
503 | tab_group_active.removeClass('active');
504 | }
505 | return false;
506 | });
507 | });
508 |
509 | // Bootstrap 4 Validation
510 | $(document).on('submit', ".needs-validation", function (event) {
511 | var form = $(this);
512 | if (form[0].checkValidity() === false) {
513 | event.preventDefault();
514 | event.stopPropagation();
515 | }
516 | form.addClass('was-validated');
517 | });
518 |
519 | // alert dismissible
520 | $(".alert-dismissible").each(function() {
521 | var me = $(this);
522 |
523 | me.find('.close').on('click', function () {
524 | me.alert('close');
525 | });
526 | });
527 |
528 | if($('.main-navbar').length) {
529 | }
530 |
531 | // Image cropper
532 | $('[data-crop-image]').each(function(e) {
533 | $(this).css({
534 | overflow: 'hidden',
535 | position: 'relative',
536 | height: $(this).data('crop-image')
537 | });
538 | });
539 |
540 | // Slide Toggle
541 | $('[data-toggle-slide]').on('click', function () {
542 | let target = $(this).data('toggle-slide');
543 |
544 | $(target).slideToggle();
545 | return false;
546 | });
547 |
548 | // Dismiss modal
549 | $('[data-dismiss=modal]').on('click', function () {
550 | $(this).closest('.modal').modal('hide');
551 |
552 | return false;
553 | });
554 |
555 | // Width attribute
556 | $('[data-width]').each(function() {
557 | $(this).css({
558 | width: $(this).data('width')
559 | });
560 | });
561 |
562 | // Height attribute
563 | $('[data-height]').each(function() {
564 | $(this).css({
565 | height: $(this).data('height')
566 | });
567 | });
568 |
569 | // Chocolat
570 | if($('.chocolat-parent').length && jQuery().Chocolat) {
571 | $('.chocolat-parent').Chocolat();
572 | }
573 |
574 | // Sortable card
575 | if($('.sortable-card').length && jQuery().sortable) {
576 | $('.sortable-card').sortable({
577 | handle: '.card-header',
578 | opacity: .8,
579 | tolerance: 'pointer'
580 | });
581 | }
582 |
583 | // Daterangepicker
584 | if(jQuery().daterangepicker) {
585 | if($(".datepicker").length) {
586 | $('.datepicker').daterangepicker({
587 | locale: {format: 'YYYY-MM-DD'},
588 | singleDatePicker: true,
589 | });
590 | }
591 | if($(".datetimepicker").length) {
592 | $('.datetimepicker').daterangepicker({
593 | locale: {format: 'YYYY-MM-DD hh:mm'},
594 | singleDatePicker: true,
595 | timePicker: true,
596 | timePicker24Hour: true,
597 | });
598 | }
599 | if($(".daterange").length) {
600 | $('.daterange').daterangepicker({
601 | locale: {format: 'YYYY-MM-DD'},
602 | drops: 'down',
603 | opens: 'right'
604 | });
605 | }
606 | }
607 |
608 | // Timepicker
609 | if(jQuery().timepicker && $(".timepicker").length) {
610 | $(".timepicker").timepicker({
611 | icons: {
612 | up: 'fas fa-chevron-up',
613 | down: 'fas fa-chevron-down'
614 | }
615 | });
616 | }
617 | });
618 |
--------------------------------------------------------------------------------
/stisla-stubs/vendors/public/web/js/stisla.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | (function($, window, i) {
4 | // Bootstrap 4 Modal
5 | $.fn.fireModal = function(options) {
6 | var options = $.extend({
7 | size: 'modal-md',
8 | center: false,
9 | animation: true,
10 | title: 'Modal Title',
11 | closeButton: true,
12 | header: true,
13 | bodyClass: '',
14 | footerClass: '',
15 | body: '',
16 | buttons: [],
17 | autoFocus: true,
18 | removeOnDismiss: false,
19 | created: function() {},
20 | appended: function() {},
21 | onFormSubmit: function() {},
22 | modal: {}
23 | }, options);
24 |
25 | this.each(function() {
26 | i++;
27 | var id = 'fire-modal-' + i,
28 | trigger_class = 'trigger--' + id,
29 | trigger_button = $('.' + trigger_class);
30 |
31 | $(this).addClass(trigger_class);
32 |
33 | // Get modal body
34 | let body = options.body;
35 |
36 | if(typeof body == 'object') {
37 | if(body.length) {
38 | let part = body;
39 | body = body.removeAttr('id').clone().removeClass('modal-part');
40 | part.remove();
41 | }else{
42 | body = 'Modal part element not found!
';
43 | }
44 | }
45 |
46 | // Modal base template
47 | var modal_template = ' ' +
48 | '
' +
49 | '
' +
50 | ((options.header == true) ?
51 | ' '
59 | : '') +
60 | '
' +
61 | '
' +
62 | (options.buttons.length > 0 ?
63 | ' '
65 | : '')+
66 | '
' +
67 | '
' +
68 | '
' ;
69 |
70 | // Convert modal to object
71 | var modal_template = $(modal_template);
72 |
73 | // Start creating buttons from 'buttons' option
74 | var this_button;
75 | options.buttons.forEach(function(item) {
76 | // get option 'id'
77 | let id = "id" in item ? item.id : '';
78 |
79 | // Button template
80 | this_button = '';
81 |
82 | // add click event to the button
83 | this_button = $(this_button).off('click').on("click", function() {
84 | // execute function from 'handler' option
85 | item.handler.call(this, modal_template);
86 | });
87 | // append generated buttons to the modal footer
88 | $(modal_template).find('.modal-footer').append(this_button);
89 | });
90 |
91 | // append a given body to the modal
92 | $(modal_template).find('.modal-body').append(body);
93 |
94 | // add additional body class
95 | if(options.bodyClass) $(modal_template).find('.modal-body').addClass(options.bodyClass);
96 |
97 | // add footer body class
98 | if(options.footerClass) $(modal_template).find('.modal-footer').addClass(options.footerClass);
99 |
100 | // execute 'created' callback
101 | options.created.call(this, modal_template, options);
102 |
103 | // modal form and submit form button
104 | let modal_form = $(modal_template).find('.modal-body form'),
105 | form_submit_btn = modal_template.find('button[type=submit]');
106 |
107 | // append generated modal to the body
108 | $("body").append(modal_template);
109 |
110 | // execute 'appended' callback
111 | options.appended.call(this, $('#' + id), modal_form, options);
112 |
113 | // if modal contains form elements
114 | if(modal_form.length) {
115 | // if `autoFocus` option is true
116 | if(options.autoFocus) {
117 | // when modal is shown
118 | $(modal_template).on('shown.bs.modal', function() {
119 | // if type of `autoFocus` option is `boolean`
120 | if(typeof options.autoFocus == 'boolean')
121 | modal_form.find('input:eq(0)').focus(); // the first input element will be focused
122 | // if type of `autoFocus` option is `string` and `autoFocus` option is an HTML element
123 | else if(typeof options.autoFocus == 'string' && modal_form.find(options.autoFocus).length)
124 | modal_form.find(options.autoFocus).focus(); // find elements and focus on that
125 | });
126 | }
127 |
128 | // form object
129 | let form_object = {
130 | startProgress: function() {
131 | modal_template.addClass('modal-progress');
132 | },
133 | stopProgress: function() {
134 | modal_template.removeClass('modal-progress');
135 | }
136 | };
137 |
138 | // if form is not contains button element
139 | if(!modal_form.find('button').length) $(modal_form).append('');
140 |
141 | // add click event
142 | form_submit_btn.on('click', function () {
143 | modal_form.submit();
144 | });
145 |
146 | // add submit event
147 | modal_form.on('submit', function (e) {
148 | // start form progress
149 | form_object.startProgress();
150 |
151 | // execute `onFormSubmit` callback
152 | options.onFormSubmit.call(this, modal_template, e, form_object);
153 | });
154 | }
155 |
156 | $(document).on("click", '.' + trigger_class, function() {
157 | let modal = $('#' + id).modal(options.modal);
158 |
159 | if(options.removeOnDismiss) {
160 | modal.on('hidden.bs.modal', function() {
161 | modal.remove();
162 | });
163 | }
164 |
165 | return false;
166 | });
167 | });
168 | }
169 |
170 | // Bootstrap Modal Destroyer
171 | $.destroyModal = function(modal) {
172 | modal.modal('hide');
173 | modal.on('hidden.bs.modal', function() {
174 | });
175 | }
176 |
177 | // Card Progress Controller
178 | $.cardProgress = function(card, options) {
179 | var options = $.extend({
180 | dismiss: false,
181 | dismissText: 'Cancel',
182 | spinner: true,
183 | onDismiss: function() {}
184 | }, options);
185 |
186 | var me = $(card);
187 |
188 | me.addClass('card-progress');
189 | if(options.spinner == false) {
190 | me.addClass('remove-spinner');
191 | }
192 |
193 | if(options.dismiss == true) {
194 | var btn_dismiss = ''+options.dismissText+'';
195 | btn_dismiss = $(btn_dismiss).off('click').on('click', function() {
196 | me.removeClass('card-progress');
197 | me.find('.card-progress-dismiss').remove();
198 | options.onDismiss.call(this, me);
199 | });
200 | me.append(btn_dismiss);
201 | }
202 |
203 | return {
204 | dismiss: function(dismissed) {
205 | $.cardProgressDismiss(me, dismissed);
206 | }
207 | };
208 | }
209 |
210 | $.cardProgressDismiss = function(card, dismissed) {
211 | var me = $(card);
212 | me.removeClass('card-progress');
213 | me.find('.card-progress-dismiss').remove();
214 | if(dismissed)
215 | dismissed.call(this, me);
216 | }
217 |
218 | $.chatCtrl = function(element, chat) {
219 | var chat = $.extend({
220 | position: 'chat-right',
221 | text: '',
222 | time: moment(new Date().toISOString()).format('hh:mm'),
223 | picture: '',
224 | type: 'text', // or typing
225 | timeout: 0,
226 | onShow: function() {}
227 | }, chat);
228 |
229 | var target = $(element),
230 | element = '
' +
231 | '

' +
232 | '
' +
233 | '
'+chat.text+'
' +
234 | '
'+chat.time+'
' +
235 | '
' +
236 | '
',
237 | typing_element = '
' +
238 | '

' +
239 | '
' +
242 | '
';
243 |
244 | var append_element = element;
245 | if(chat.type == 'typing') {
246 | append_element = typing_element;
247 | }
248 |
249 | if(chat.timeout > 0) {
250 | setTimeout(function() {
251 | target.find('.chat-content').append($(append_element).fadeIn());
252 | }, chat.timeout);
253 | }else{
254 | target.find('.chat-content').append($(append_element).fadeIn());
255 | }
256 |
257 | var target_height = 0;
258 | target.find('.chat-content .chat-item').each(function() {
259 | target_height += $(this).outerHeight();
260 | });
261 | setTimeout(function() {
262 | target.find('.chat-content').scrollTop(target_height, -1);
263 | }, 100);
264 | chat.onShow.call(this, append_element);
265 | }
266 | })(jQuery, this, 0);
267 |
268 |
--------------------------------------------------------------------------------
/stisla-stubs/vendors/resources/assets/js/custom/custom-datatable.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | $.extend($.fn.dataTable.defaults, {
4 | 'paging': true,
5 | 'info': true,
6 | 'ordering': true,
7 | 'autoWidth': false,
8 | 'pageLength': 10,
9 | 'language': {
10 | 'search': '',
11 | 'sSearch': 'Search',
12 | },
13 | "preDrawCallback": function () {
14 | customSearch()
15 | }
16 | });
17 |
18 | function customSearch() {
19 | $('.dataTables_filter input').addClass("form-control");
20 | $('.dataTables_filter input').attr("placeholder", "Search");
21 | }
22 |
--------------------------------------------------------------------------------
/stisla-stubs/vendors/resources/assets/js/custom/custom.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | let jsrender = require('jsrender');
3 | $.ajaxSetup({
4 | headers: {
5 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content'),
6 | },
7 | });
8 | $(document).ajaxComplete(function () {
9 | // Required for Bootstrap tooltips in DataTables
10 | $('[data-toggle="tooltip"]').tooltip({
11 | 'html': true,
12 | 'offset': 10,
13 | });
14 | });
15 | $('input:text:not([readonly="readonly"])').first().focus();
16 |
17 | $(function () {
18 | $('.modal').on('shown.bs.modal', function () {
19 | $(this).find('input:text').first().focus();
20 | });
21 | });
22 |
23 | window.resetModalForm = function (formId, validationBox) {
24 | $(formId)[0].reset();
25 | $('select.select2Selector').each(function (index, element) {
26 | let drpSelector = '#' + $(this).attr('id');
27 | $(drpSelector).val('');
28 | $(drpSelector).trigger('change');
29 | });
30 | $(validationBox).hide();
31 | };
32 |
33 | window.printErrorMessage = function (selector, errorResult) {
34 | $(selector).show().html('');
35 | $(selector).text(errorResult.responseJSON.message);
36 | };
37 |
38 | window.manageAjaxErrors = function (data) {
39 | var errorDivId = arguments.length > 1 && arguments[1] !== undefined
40 | ? arguments[1]
41 | : 'editValidationErrorsBox';
42 | if (data.status == 404) {
43 | iziToast.error({
44 | title: 'Error!',
45 | message: data.responseJSON.message,
46 | position: 'topRight',
47 | });
48 | } else {
49 | printErrorMessage('#' + errorDivId, data);
50 | }
51 | };
52 |
53 | window.displaySuccessMessage = function (message) {
54 | iziToast.success({
55 | title: 'Success',
56 | message: message,
57 | position: 'topRight',
58 | });
59 | };
60 |
61 | window.displayErrorMessage = function (message) {
62 | iziToast.error({
63 | title: 'Error',
64 | message: message,
65 | position: 'topRight',
66 | });
67 | };
68 |
69 | window.deleteItem = function (url, tableId, header, callFunction = null) {
70 | swal({
71 | title: 'Delete !',
72 | text: 'Are you sure want to delete this "' + header + '" ?',
73 | type: 'warning',
74 | showCancelButton: true,
75 | closeOnConfirm: false,
76 | showLoaderOnConfirm: true,
77 | confirmButtonColor: '#6777ef',
78 | cancelButtonColor: '#d33',
79 | cancelButtonText: 'No',
80 | confirmButtonText: 'Yes',
81 | },
82 | function () {
83 | deleteItemAjax(url, tableId, header, callFunction = null);
84 | });
85 | };
86 |
87 | function deleteItemAjax (url, tableId, header, callFunction = null) {
88 | $.ajax({
89 | url: url,
90 | type: 'DELETE',
91 | dataType: 'json',
92 | success: function (obj) {
93 | if (obj.success) {
94 | if ($(tableId).DataTable().data().count() == 1) {
95 | $(tableId).DataTable().page('previous').draw('page');
96 | } else {
97 | $(tableId).DataTable().ajax.reload(null, false);
98 | }
99 | }
100 | swal({
101 | title: 'Deleted!',
102 | text: header + ' has been deleted.',
103 | type: 'success',
104 | confirmButtonColor: '#6777ef',
105 | timer: 2000,
106 | });
107 | if (callFunction) {
108 | eval(callFunction);
109 | }
110 | },
111 | error: function (data) {
112 | swal({
113 | title: '',
114 | text: data.responseJSON.message,
115 | type: 'error',
116 | confirmButtonColor: '#6777ef',
117 | timer: 5000,
118 | });
119 | },
120 | });
121 | }
122 |
123 | window.format = function (dateTime) {
124 | var format = arguments.length > 1 && arguments[1] !== undefined
125 | ? arguments[1]
126 | : 'DD-MMM-YYYY';
127 | return moment(dateTime).format(format);
128 | };
129 |
130 | window.processingBtn = function (selecter, btnId, state = null) {
131 | var loadingButton = $(selecter).find(btnId);
132 | if (state === 'loading') {
133 | loadingButton.button('loading');
134 | } else {
135 | loadingButton.button('reset');
136 | }
137 | };
138 |
139 | window.prepareTemplateRender = function (templateSelector, data) {
140 | let template = jsrender.templates(templateSelector);
141 | return template.render(data);
142 | };
143 |
144 | window.isValidFile = function (inputSelector, validationMessageSelector) {
145 | let ext = $(inputSelector).val().split('.').pop().toLowerCase();
146 | if ($.inArray(ext, ['gif', 'png', 'jpg', 'jpeg']) == -1) {
147 | $(inputSelector).val('');
148 | $(validationMessageSelector).removeClass('d-none');
149 | $(validationMessageSelector).
150 | html('The image must be a file of type: jpeg, jpg, png.').
151 | show();
152 | return false;
153 | }
154 | $(validationMessageSelector).hide();
155 | return true;
156 | };
157 |
158 | window.displayPhoto = function (input, selector) {
159 | let displayPreview = true;
160 | if (input.files && input.files[0]) {
161 | let reader = new FileReader();
162 | reader.onload = function (e) {
163 | let image = new Image();
164 | image.src = e.target.result;
165 | image.onload = function () {
166 | $(selector).attr('src', e.target.result);
167 | displayPreview = true;
168 | };
169 | };
170 | if (displayPreview) {
171 | reader.readAsDataURL(input.files[0]);
172 | $(selector).show();
173 | }
174 | }
175 | };
176 | window.removeCommas = function (str) {
177 | return str.replace(/,/g, '');
178 | };
179 |
180 | window.DatetimepickerDefaults = function (opts) {
181 | return $.extend({}, {
182 | sideBySide: true,
183 | ignoreReadonly: true,
184 | icons: {
185 | close: 'fa fa-times',
186 | time: 'fa fa-clock-o',
187 | date: 'fa fa-calendar',
188 | up: 'fa fa-arrow-up',
189 | down: 'fa fa-arrow-down',
190 | previous: 'fa fa-chevron-left',
191 | next: 'fa fa-chevron-right',
192 | today: 'fa fa-clock-o',
193 | clear: 'fa fa-trash-o',
194 | },
195 | }, opts);
196 | };
197 |
198 | window.isEmpty = (value) => {
199 | return value === undefined || value === null || value === '';
200 | };
201 |
202 | window.screenLock = function () {
203 | $('#overlay-screen-lock').show();
204 | $('body').css({ 'pointer-events': 'none', 'opacity': '0.6' });
205 | };
206 |
207 | window.screenUnLock = function () {
208 | $('body').css({ 'pointer-events': 'auto', 'opacity': '1' });
209 | $('#overlay-screen-lock').hide();
210 | };
211 |
212 | window.onload = function () {
213 | window.startLoader = function () {
214 | $('.infy-loader').show();
215 | };
216 |
217 | window.stopLoader = function () {
218 | $('.infy-loader').hide();
219 | };
220 |
221 | // infy loader js
222 | stopLoader();
223 | };
224 |
225 | $(document).ready(function () {
226 | // script to active parent menu if sub menu has currently active
227 | let hasActiveMenu = $(document).
228 | find('.nav-item.dropdown ul li').
229 | hasClass('active');
230 | if (hasActiveMenu) {
231 | $(document).
232 | find('.nav-item.dropdown ul li.active').
233 | parent('ul').
234 | css('display', 'block');
235 | $(document).
236 | find('.nav-item.dropdown ul li.active').
237 | parent('ul').
238 | parent('li').
239 | addClass('active');
240 | }
241 | });
242 |
243 | window.urlValidation = function (value, regex) {
244 | let urlCheck = (value == '' ? true : (value.match(regex)
245 | ? true
246 | : false));
247 | if (!urlCheck) {
248 | return false;
249 | }
250 |
251 | return true;
252 | };
253 |
254 | $('.languageSelection').on('click', function () {
255 | let languageName = $(this).data('prefix-value');
256 |
257 | $.ajax({
258 | type: 'POST',
259 | url: '/change-language',
260 | data: { languageName: languageName },
261 | success: function () {
262 | location.reload();
263 | },
264 | });
265 | });
266 |
--------------------------------------------------------------------------------
/stisla-stubs/vendors/resources/assets/js/profile.js:
--------------------------------------------------------------------------------
1 | $(document).on('click', '.edit-profile', function (event) {
2 | $('#editProfileUserId').val(loggedInUser.id);
3 | $('#pfName').val(loggedInUser.name);
4 | $('#pfEmail').val(loggedInUser.email);
5 | $('#EditProfileModal').appendTo('body').modal('show');
6 | });
7 |
8 | $(document).on('change', '#pfImage', function () {
9 | let ext = $(this).val().split('.').pop().toLowerCase();
10 | if ($.inArray(ext, ['gif', 'png', 'jpg', 'jpeg']) == -1) {
11 | $(this).val('');
12 | $('#editProfileValidationErrorsBox').
13 | html(
14 | 'The profile image must be a file of type: jpeg, jpg, png.').
15 | show();
16 | } else {
17 | displayPhoto(this, '#edit_preview_photo');
18 | }
19 | });
20 |
21 | window.displayPhoto = function (input, selector) {
22 | let displayPreview = true
23 | if (input.files && input.files[0]) {
24 | let reader = new FileReader()
25 | reader.onload = function (e) {
26 | let image = new Image()
27 | image.src = e.target.result
28 | image.onload = function () {
29 | $(selector).attr('src', e.target.result)
30 | displayPreview = true
31 | }
32 | }
33 | if (displayPreview) {
34 | reader.readAsDataURL(input.files[0])
35 | $(selector).show()
36 | }
37 | }
38 | }
39 |
40 | $(document).on('submit', '#editProfileForm', function (event) {
41 | event.preventDefault();
42 | let userId = $('#editProfileUserId').val();
43 | var loadingButton = jQuery(this).find('#btnPrEditSave');
44 | loadingButton.button('loading');
45 | $.ajax({
46 | url: usersUrl + '/' + userId,
47 | type: 'post',
48 | data: new FormData($(this)[0]),
49 | processData: false,
50 | contentType: false,
51 | success: function success(result) {
52 | if (result.success) {
53 | $('#EditProfileModal').modal('hide');
54 | setTimeout(function () {
55 | location.reload();
56 | }, 1500);
57 | }
58 | },
59 | error: function error(result) {
60 | console.log(result);
61 | },
62 | complete: function complete() {
63 | loadingButton.button('reset');
64 | }
65 | });
66 | });
67 |
--------------------------------------------------------------------------------
/stisla-stubs/vendors/resources/js/app.js:
--------------------------------------------------------------------------------
1 | require('./bootstrap');
2 |
--------------------------------------------------------------------------------
/stisla-stubs/vendors/resources/js/bootstrap.js:
--------------------------------------------------------------------------------
1 | window._ = require('lodash');
2 |
3 | /**
4 | * We'll load the axios HTTP library which allows us to easily issue requests
5 | * to our Laravel back-end. This library automatically handles sending the
6 | * CSRF token as a header based on the value of the "XSRF" token cookie.
7 | */
8 |
9 | window.axios = require('axios');
10 |
11 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
12 |
13 | /**
14 | * Echo exposes an expressive API for subscribing to channels and listening
15 | * for events that are broadcast by Laravel. Echo and event broadcasting
16 | * allows your team to easily build robust real-time web applications.
17 | */
18 |
19 | // import Echo from 'laravel-echo';
20 |
21 | // window.Pusher = require('pusher-js');
22 |
23 | // window.Echo = new Echo({
24 | // broadcaster: 'pusher',
25 | // key: process.env.MIX_PUSHER_APP_KEY,
26 | // cluster: process.env.MIX_PUSHER_APP_CLUSTER,
27 | // forceTLS: true
28 | // });
29 |
--------------------------------------------------------------------------------
/stisla-stubs/views/auth/forgot-password.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.auth_app')
2 | @section('title')
3 | Forgot Password
4 | @endsection
5 | @section('content')
6 |
7 |
8 |
9 |
10 | @if (session('status'))
11 |
12 | {{ session('status') }}
13 |
14 | @endif
15 |
31 |
32 |
33 |
34 | Recalled your login info?
Sign In
35 |
36 | @endsection
37 |
--------------------------------------------------------------------------------
/stisla-stubs/views/auth/login.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.auth_app')
2 | @section('title')
3 | Admin Login
4 | @endsection
5 | @section('content')
6 |
68 | @endsection
69 |
--------------------------------------------------------------------------------
/stisla-stubs/views/auth/passwords/confirm.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
{{ config('app.name') }}
7 |
8 |
9 |
10 |
11 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
23 |
24 |
25 |
26 |
Please confirm your password before continuing.
27 |
28 |
53 |
54 |
55 | Forgot Your Password?
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/stisla-stubs/views/auth/passwords/email.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.auth_app')
2 | @section('title')
3 | Forgot Password
4 | @endsection
5 | @section('content')
6 |
7 |
8 |
9 |
10 | @if (session('status'))
11 |
12 | {{ session('status') }}
13 |
14 | @endif
15 |
31 |
32 |
33 |
34 | Recalled your login info?
Sign In
35 |
36 | @endsection
37 |
--------------------------------------------------------------------------------
/stisla-stubs/views/auth/passwords/reset.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.auth_app')
2 | @section('title')
3 | Reset Password
4 | @endsection
5 | @section('content')
6 |
56 |
57 | Recalled your login info?
Sign In
58 |
59 | @endsection
60 |
--------------------------------------------------------------------------------
/stisla-stubs/views/auth/register.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.auth_app')
2 | @section('title')
3 | Register
4 | @endsection
5 | @section('content')
6 |
78 |
79 | Already have an account ?
SignIn
81 |
82 | @endsection
83 |
--------------------------------------------------------------------------------
/stisla-stubs/views/auth/reset-password.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.auth_app')
2 | @section('title')
3 | Reset Password
4 | @endsection
5 | @section('content')
6 |
56 |
57 | Recalled your login info?
Sign In
58 |
59 | @endsection
60 |
--------------------------------------------------------------------------------
/stisla-stubs/views/auth/verify.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 |
3 | @section('content')
4 |
5 |
6 |
7 |
8 |
Verify Your Email Address
9 |
10 |
11 | @if (session('resent'))
12 |
A fresh verification link has been sent to
13 | your email address
14 |
15 | @endif
16 |
Before proceeding, please check your email for a verification link.If you did not receive
17 | the email,
18 |
click here to request another'.
19 |
20 |
21 |
22 |
23 |
24 | @endsection
--------------------------------------------------------------------------------
/stisla-stubs/views/layouts/app.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
@yield('title') | {{ config('app.name') }}
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | @yield('page_css')
18 |
19 |
20 |
21 | @yield('page_css')
22 |
23 | @yield('css')
24 |
25 |
26 |
27 |
28 |
29 |
30 |
34 |
35 | @include('layouts.sidebar')
36 |
37 |
38 |
39 | @yield('content')
40 |
41 |
44 |
45 |
46 |
47 | @include('profile.change_password')
48 | @include('profile.edit_profile')
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 | @yield('page_js')
65 | @yield('scripts')
66 |
82 |
83 |
--------------------------------------------------------------------------------
/stisla-stubs/views/layouts/auth_app.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
@yield('title') | {{ config('app.name') }}
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
 }})
29 |
30 | @yield('content')
31 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/stisla-stubs/views/layouts/footer.blade.php:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/stisla-stubs/views/layouts/header.blade.php:
--------------------------------------------------------------------------------
1 |
6 |
54 |
--------------------------------------------------------------------------------
/stisla-stubs/views/layouts/menu.blade.php:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/stisla-stubs/views/layouts/sidebar.blade.php:
--------------------------------------------------------------------------------
1 |
16 |
--------------------------------------------------------------------------------
/stisla-stubs/views/profile/change_password.blade.php:
--------------------------------------------------------------------------------
1 |
81 |
2 |
60 |
61 |
62 |
--------------------------------------------------------------------------------