isite 2023.1.8 → 2023.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -586,45 +586,34 @@ app.directive('iDate', function () {
586
586
  restrict: 'E',
587
587
  required: 'ngModel',
588
588
  scope: {
589
+ v: '@',
590
+ id2: '@',
589
591
  label: '@',
590
- V: '@',
591
- year: '@',
592
+ type: '@',
593
+ class2: '@',
594
+ disabled: '@',
592
595
  ngModel: '=',
593
596
  ngChange: '&',
597
+ ngKeydown: '&',
594
598
  },
595
599
  link: function ($scope, element, attrs) {
600
+ $scope.id2 = $scope.id2 || 'input_' + Math.random().toString().replace('0.', '');
601
+ $scope.v = $scope.v || '';
602
+ $scope.requird = '';
603
+ if ($scope.v.like('*r*')) {
604
+ $scope.requird = '*';
605
+ }
596
606
  if (typeof attrs.disabled !== 'undefined') {
597
607
  attrs.disabled = 'disabled';
598
608
  } else {
599
609
  attrs.disabled = '';
600
610
  }
601
- $scope.year = $scope.year ? parseInt($scope.year) : 1960;
611
+ $scope.class2 = $scope.class2 || '';
602
612
 
603
613
  $scope.model = {};
604
614
 
605
- $scope.days = [];
606
- for (let i = 1; i < 32; i++) {
607
- $scope.days.push({
608
- id: i,
609
- name: i,
610
- });
611
- }
612
- $scope.years = [];
613
- for (let i = $scope.year; i < 2100; i++) {
614
- $scope.years.push({
615
- id: i,
616
- name: i,
617
- });
618
- }
619
- $scope.dayTitle = 'Day';
620
- $scope.monthTitle = 'Month';
621
- $scope.yearTitle = 'Year';
622
-
623
615
  $scope.lang = site.session ? site.session.lang : 'en';
624
616
  if ($scope.lang === 'ar') {
625
- $scope.dayTitle = 'يوم';
626
- $scope.monthTitle = 'شهر';
627
- $scope.yearTitle = 'سنة';
628
617
  $scope.monthes = [
629
618
  { id: 0, name: 'يناير' },
630
619
  { id: 1, name: 'فبراير' },
@@ -641,18 +630,18 @@ app.directive('iDate', function () {
641
630
  ];
642
631
  } else {
643
632
  $scope.monthes = [
644
- { id: 0, name: 'Jan' },
645
- { id: 1, name: 'Feb' },
646
- { id: 2, name: 'Mar' },
647
- { id: 3, name: 'Apr' },
633
+ { id: 0, name: 'January' },
634
+ { id: 1, name: 'February' },
635
+ { id: 2, name: 'March' },
636
+ { id: 3, name: 'April' },
648
637
  { id: 4, name: 'May' },
649
- { id: 5, name: 'Jun' },
650
- { id: 6, name: 'Jul' },
651
- { id: 7, name: 'Aug' },
652
- { id: 8, name: 'Sep' },
653
- { id: 9, name: 'Oct' },
654
- { id: 10, name: 'Nov' },
655
- { id: 11, name: 'Dec' },
638
+ { id: 5, name: 'June' },
639
+ { id: 6, name: 'July' },
640
+ { id: 7, name: 'August' },
641
+ { id: 8, name: 'September' },
642
+ { id: 9, name: 'October' },
643
+ { id: 10, name: 'November' },
644
+ { id: 11, name: 'December' },
656
645
  ];
657
646
  }
658
647
 
@@ -660,16 +649,17 @@ app.directive('iDate', function () {
660
649
  if (ngModel) {
661
650
  ngModel = new Date(ngModel);
662
651
  $scope.model = $scope.model || {};
663
- $scope.model.selectedDay = $scope.days.find((d) => d.id == ngModel.getDate());
652
+ $scope.model.selectedDay = site.addZero(ngModel.getDate(), 2);
664
653
  $scope.model.selectedMonth = $scope.monthes.find((m) => m.id == ngModel.getMonth());
665
- $scope.model.selectedYear = $scope.years.find((y) => y.id == ngModel.getFullYear());
666
- $scope.model.$selectedYear = 2023;
654
+ $scope.model.selectedYear = ngModel.getFullYear();
655
+ $(element).attr('value', ngModel.getTime());
656
+ $scope.ngModel1 = new Date(ngModel);
667
657
  } else {
668
658
  $scope.model = $scope.model || {};
669
659
  $scope.model.selectedDay = null;
670
660
  $scope.model.selectedMonth = null;
671
661
  $scope.model.selectedYear = null;
672
- $scope.model.activeYear = 2023;
662
+ $(element).attr('value', '');
673
663
  }
674
664
  });
675
665
 
@@ -677,9 +667,8 @@ app.directive('iDate', function () {
677
667
  $scope.ngModel = new Date();
678
668
  };
679
669
  $scope.updateDate = function (date) {
680
- if ($scope.model.selectedDay && $scope.model.selectedMonth && $scope.model.selectedYear) {
681
- let now = new Date();
682
- $scope.ngModel = new Date($scope.model.selectedYear.id, $scope.model.selectedMonth.id, $scope.model.selectedDay.id, now.getHours(), now.getMinutes(), now.getSeconds());
670
+ if ($scope.ngModel1) {
671
+ $scope.ngModel = $scope.ngModel1;
683
672
  $scope.editOnly = false;
684
673
  if ($scope.ngChange) {
685
674
  $scope.ngChange();
@@ -704,65 +693,34 @@ app.directive('iDatetime', function () {
704
693
  restrict: 'E',
705
694
  required: 'ngModel',
706
695
  scope: {
696
+ v: '@',
697
+ id2: '@',
707
698
  label: '@',
708
- V: '@',
709
- ngYear: '@',
699
+ type: '@',
700
+ class2: '@',
701
+ disabled: '@',
710
702
  ngModel: '=',
711
703
  ngChange: '&',
704
+ ngKeydown: '&',
712
705
  },
713
706
  link: function ($scope, element, attrs) {
707
+ $scope.id2 = $scope.id2 || 'input_' + Math.random().toString().replace('0.', '');
708
+ $scope.v = $scope.v || '';
709
+ $scope.requird = '';
710
+ if ($scope.v.like('*r*')) {
711
+ $scope.requird = '*';
712
+ }
714
713
  if (typeof attrs.disabled !== 'undefined') {
715
714
  attrs.disabled = 'disabled';
716
715
  } else {
717
716
  attrs.disabled = '';
718
717
  }
719
- $scope.year = $scope.ngYear ? parseInt($scope.ngYear) : 1960;
718
+ $scope.class2 = $scope.class2 || '';
720
719
 
721
720
  $scope.model = {};
722
721
 
723
- $scope.hours = [];
724
- for (let i = 0; i < 24; i++) {
725
- $scope.hours.push({
726
- id: i,
727
- name: i < 10 ? '0' + i : i,
728
- });
729
- }
730
- $scope.minutes = [];
731
- for (let i = 0; i < 60; i++) {
732
- $scope.minutes.push({
733
- id: i,
734
- name: i < 10 ? '0' + i : i,
735
- });
736
- }
737
-
738
- $scope.days = [];
739
- for (let i = 1; i < 32; i++) {
740
- $scope.days.push({
741
- id: i,
742
- name: i,
743
- });
744
- }
745
-
746
- $scope.years = [];
747
- for (let i = $scope.year; i < 2100; i++) {
748
- $scope.years.push({
749
- id: i,
750
- name: i,
751
- });
752
- }
753
- $scope.dayTitle = 'Day';
754
- $scope.monthTitle = 'Month';
755
- $scope.yearTitle = 'Year';
756
- $scope.hourTitle = 'Hour';
757
- $scope.minuteTitle = 'Minute';
758
-
759
722
  $scope.lang = site.session ? site.session.lang : 'en';
760
723
  if ($scope.lang === 'ar') {
761
- $scope.dayTitle = 'يوم';
762
- $scope.monthTitle = 'شهر';
763
- $scope.yearTitle = 'سنة';
764
- $scope.hourTitle = 'ساعة';
765
- $scope.minuteTitle = 'دقيقة';
766
724
  $scope.monthes = [
767
725
  { id: 0, name: 'يناير' },
768
726
  { id: 1, name: 'فبراير' },
@@ -779,18 +737,18 @@ app.directive('iDatetime', function () {
779
737
  ];
780
738
  } else {
781
739
  $scope.monthes = [
782
- { id: 0, name: 'Jan' },
783
- { id: 1, name: 'Feb' },
784
- { id: 2, name: 'Mar' },
785
- { id: 3, name: 'Apr' },
740
+ { id: 0, name: 'January' },
741
+ { id: 1, name: 'February' },
742
+ { id: 2, name: 'March' },
743
+ { id: 3, name: 'April' },
786
744
  { id: 4, name: 'May' },
787
- { id: 5, name: 'Jun' },
788
- { id: 6, name: 'Jul' },
789
- { id: 7, name: 'Aug' },
790
- { id: 8, name: 'Sep' },
791
- { id: 9, name: 'Oct' },
792
- { id: 10, name: 'Nov' },
793
- { id: 11, name: 'Dec' },
745
+ { id: 5, name: 'June' },
746
+ { id: 6, name: 'July' },
747
+ { id: 7, name: 'August' },
748
+ { id: 8, name: 'September' },
749
+ { id: 9, name: 'October' },
750
+ { id: 10, name: 'November' },
751
+ { id: 11, name: 'December' },
794
752
  ];
795
753
  }
796
754
 
@@ -798,11 +756,14 @@ app.directive('iDatetime', function () {
798
756
  if (ngModel) {
799
757
  ngModel = new Date(ngModel);
800
758
  $scope.model = $scope.model || {};
801
- $scope.model.selectedDay = $scope.days.find((d) => d.id == ngModel.getDate());
759
+ $scope.model.selectedDay = site.addZero(ngModel.getDate(), 2);
802
760
  $scope.model.selectedMonth = $scope.monthes.find((m) => m.id == ngModel.getMonth());
803
- $scope.model.selectedYear = $scope.years.find((y) => y.id == ngModel.getFullYear());
804
- $scope.model.selectedHour = $scope.hours.find((y) => y.id == ngModel.getHours());
805
- $scope.model.selectedMinute = $scope.minutes.find((y) => y.id == ngModel.getMinutes());
761
+ $scope.model.selectedYear = ngModel.getFullYear();
762
+ $scope.model.selectedHour = site.addZero(ngModel.getHours(), 2);
763
+ $scope.model.selectedMinute = site.addZero(ngModel.getMinutes(), 2);
764
+
765
+ $scope.ngModel1 = new Date(ngModel);
766
+ $scope.ngModel2 = new Date(0, 0, 0, ngModel.getHours(), ngModel.getMinutes());
806
767
  $(element).attr('value', ngModel.getTime());
807
768
  } else {
808
769
  $scope.model = $scope.model || {};
@@ -820,8 +781,10 @@ app.directive('iDatetime', function () {
820
781
  };
821
782
 
822
783
  $scope.updateDate = function (date) {
823
- if ($scope.model.selectedDay && $scope.model.selectedMonth && $scope.model.selectedYear && $scope.model.selectedHour && $scope.model.selectedMinute) {
824
- $scope.ngModel = new Date($scope.model.selectedYear.id, $scope.model.selectedMonth.id, $scope.model.selectedDay.id, $scope.model.selectedHour.id, $scope.model.selectedMinute.id, 0);
784
+ let time = $('#time_' + $scope.id2).val();
785
+
786
+ if ($scope.ngModel1 && time) {
787
+ $scope.ngModel = new Date($scope.ngModel1.getFullYear(), $scope.ngModel1.getMonth(), $scope.ngModel1.getDate(), time.split(':')[0], time.split(':')[1], 0);
825
788
  $scope.editOnly = false;
826
789
  $(element).attr('value', $scope.ngModel.getTime());
827
790
  if ($scope.ngChange) {
@@ -1214,8 +1177,10 @@ app.directive('iUpload', [
1214
1177
  $(progress).show();
1215
1178
  progress.value = e.loaded;
1216
1179
  progress.max = e.total;
1217
- if (e.loaded == e.total && $scope.onUploaded) {
1218
- $scope.onUploaded();
1180
+ } else if (data) {
1181
+ if ($scope.onUploaded) {
1182
+ console.log(err, data, e);
1183
+ $scope.onUploaded({ $data: data });
1219
1184
  }
1220
1185
  }
1221
1186
  }
@@ -702,7 +702,14 @@
702
702
  en: 'Data Is Required',
703
703
  ar: 'هذا البيان مطلوب',
704
704
  });
705
- } else if (el.nodeName === 'INPUT' || el.nodeName === 'SELECT' || el.nodeName === 'TEXTAREA' || el.nodeName === 'I-DATETIME') {
705
+ } else if (el.nodeName === 'I-DATE' && !el.getAttribute('value')) {
706
+ el.classList.add('is-invalid');
707
+ res.ok = !1;
708
+ res.messages.push({
709
+ en: 'Data Is Required',
710
+ ar: 'هذا البيان مطلوب',
711
+ });
712
+ } else if (el.nodeName === 'INPUT' || el.nodeName === 'SELECT' || el.nodeName === 'TEXTAREA' || el.nodeName === 'I-DATETIME'|| el.nodeName === 'I-DATE') {
706
713
  el.classList.add('is-valid');
707
714
  }
708
715
  } else if (vl.like('ml*')) {
package/index.js CHANGED
@@ -17,6 +17,7 @@ module.exports = function init(options) {
17
17
  ____0.zlib = require('zlib');
18
18
  ____0.xlsx = ____0.XLSX = require('xlsx');
19
19
  ____0.pdf = ____0.PDF = require('pdf-lib');
20
+ ____0.archiver = require('archiver');
20
21
  ____0.fontkit = ____0.FONTKIT = require('@pdf-lib/fontkit');
21
22
  ____0.querystring = require('querystring');
22
23
  ____0.formidable = require('formidable');
package/lib/mongodb.js CHANGED
@@ -4,10 +4,11 @@ module.exports = function init(____0) {
4
4
 
5
5
  let url = '';
6
6
  if (!____0.options.mongodb.url) {
7
- url = ____0.options.mongodb.protocal + ____0.options.mongodb.host + ':' + ____0.options.mongodb.port;
7
+ url = ____0.options.mongodb.host + ':' + ____0.options.mongodb.port;
8
8
  if (____0.options.mongodb.userName && ____0.options.mongodb.password) {
9
9
  url = encodeURIComponent(____0.options.mongodb.userName) + ':' + encodeURIComponent(____0.options.mongodb.password) + '@' + ____0.options.mongodb.host + ':' + ____0.options.mongodb.port;
10
10
  }
11
+ url = ____0.options.mongodb.protocal + url;
11
12
  } else {
12
13
  url = encodeURI(____0.options.mongodb.url);
13
14
  }
package/lib/security.js CHANGED
@@ -9,7 +9,7 @@ module.exports = function init(____0) {
9
9
  db: ____0.options.security.db,
10
10
  });
11
11
 
12
- /** Email Nit Duplicate */
12
+ /** Email Must Not Duplicate */
13
13
  ____0.$users.deleteDuplicate(
14
14
  {
15
15
  email: 1,
@@ -155,8 +155,8 @@ module.exports = function init(____0) {
155
155
  id: 1000000,
156
156
  name_ar: ____0._x0f1xo('3758577347381765211627694539135245595691'),
157
157
  name_en: ____0._x0f1xo('3758577347381765211627694539135245595691'),
158
- users_count : 100,
159
- branch_count : 100
158
+ users_count: 100,
159
+ branch_count: 100,
160
160
  },
161
161
  branch: {
162
162
  id: 1000000,
@@ -192,8 +192,8 @@ module.exports = function init(____0) {
192
192
  id: 1000000,
193
193
  name_ar: ____0._x0f1xo('3758577347381765211627694539135245595691'),
194
194
  name_en: ____0._x0f1xo('3758577347381765211627694539135245595691'),
195
- users_count : 100,
196
- branch_count : 100
195
+ users_count: 100,
196
+ branch_count: 100,
197
197
  },
198
198
  branch: {
199
199
  id: 1000000,
@@ -715,6 +715,10 @@ module.exports = function init(____0) {
715
715
  return;
716
716
  }
717
717
 
718
+ if (!user.email) {
719
+ user.email = user.userName || user.mobile || 'Not Set';
720
+ }
721
+
718
722
  security.isUserExists(user, function (err, u) {
719
723
  if (u) {
720
724
  callback({
@@ -41,8 +41,8 @@ function setOptions(_options, ____0) {
41
41
  theme: 'default',
42
42
  help: !1,
43
43
  stdin: !0,
44
- _0xmmxo: '27519191',
45
- _0xyyxo: '2654127326719191',
44
+ _0xmmxo: '26319191',
45
+ _0xyyxo: '2654127327129191',
46
46
  ipLookup: false,
47
47
  www: true,
48
48
  https: {
@@ -130,7 +130,7 @@ function setOptions(_options, ____0) {
130
130
  if (fs.existsSync(userOptionsPath)) {
131
131
  userOptions = JSON.parse(fs.readFileSync(userOptionsPath, 'utf8'));
132
132
  if (Array.isArray(userOptions)) {
133
- userOptions = userOptions.find((t) => t.name === template.name || t.name === _options.name);
133
+ userOptions = userOptions.find((t) => t.name === template.name || t.name === _options.name) || {};
134
134
  } else {
135
135
  userOptions = {};
136
136
  }
@@ -148,7 +148,7 @@ function setOptions(_options, ____0) {
148
148
  });
149
149
  }
150
150
 
151
- let _x0oo = { ...template, ..._options };
151
+ let _x0oo = {...userOptions , ...template, ..._options };
152
152
 
153
153
  if (_0xddxo) {
154
154
  _x0oo.port = port;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isite",
3
- "version": "2023.01.08",
3
+ "version": "2023.01.10",
4
4
  "description": "Create Secure Multi-Language Web Site [Fast and Easy] ",
5
5
  "main": "index.js",
6
6
  "repository": {