isite 2022.8.4 → 2022.8.7
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.
- package/README.md +7 -7
- package/apps/client-side/app.js +8 -3
- package/apps/client-side/site_files/css/bootstrap5-addon.css +55 -7
- package/apps/client-side/site_files/css/bootstrap5.css +1 -1
- package/apps/client-side/site_files/css/bootstrap5.css.map +1 -0
- package/apps/client-side/site_files/css/dropdown.css +3 -0
- package/apps/client-side/site_files/css/effect.css +136 -77
- package/apps/client-side/site_files/css/images.css +0 -3
- package/apps/client-side/site_files/css/layout.css +45 -51
- package/apps/client-side/site_files/css/modal.css +5 -6
- package/apps/client-side/site_files/css/normalize.css +146 -0
- package/apps/client-side/site_files/css/scrollbar.css +5 -5
- package/apps/client-side/site_files/css/table.css +3 -3
- package/apps/client-side/site_files/html/directive/i-button.html +5 -0
- package/apps/client-side/site_files/html/directive/i-checkbox.html +4 -0
- package/apps/client-side/site_files/html/directive/i-checklist.html +6 -0
- package/apps/client-side/site_files/html/directive/i-control.html +5 -0
- package/apps/client-side/site_files/html/directive/i-date.html +21 -16
- package/apps/client-side/site_files/html/directive/i-datetime.html +32 -0
- package/apps/client-side/site_files/html/{sub/i-file.content.html → directive/i-file.html} +3 -5
- package/apps/client-side/site_files/html/directive/i-image.html +7 -0
- package/apps/client-side/site_files/html/{sub/i-list2.content.html → directive/i-list.html} +2 -2
- package/apps/client-side/site_files/html/directive/i-radio.html +4 -0
- package/apps/client-side/site_files/html/directive/i-textarea.html +4 -0
- package/apps/client-side/site_files/html/directive/i-treenode.html +20 -0
- package/apps/client-side/site_files/html/directive/i-treeview.html +13 -0
- package/apps/client-side/site_files/html/directive/i-upload.html +5 -0
- package/apps/client-side/site_files/html/directive-core/i-date.html +64 -0
- package/apps/client-side/site_files/html/directive-core/i-list.html +22 -0
- package/apps/client-side/site_files/js/bootstrap-5-addon.js +1 -0
- package/apps/client-side/site_files/js/bootstrap-5-directive.js +171 -862
- package/apps/client-side/site_files/js/bootstrap.js.map +1 -0
- package/apps/client-side/site_files/js/directive.js +1865 -2044
- package/apps/client-side/site_files/js/directive.min.js +2 -2
- package/apps/client-side/site_files/js/site.js +26 -3
- package/apps/client-side/site_files/js/site.min.js +1 -1
- package/apps/security/site_files/html/login_modal.html +18 -26
- package/index.js +277 -278
- package/lib/email.js +108 -0
- package/lib/integrated.js +10 -26
- package/lib/parser.js +538 -514
- package/lib/routing.js +21 -15
- package/lib/security.js +1109 -1081
- package/lib/sessions.js +182 -247
- package/object-options/index.js +24 -4
- package/object-options/lib/fn.js +9 -3
- package/package.json +5 -3
- package/pull.bat +3 -0
- package/push.bat +2 -5
- package/apps/client-side/site_files/html/sub/i-list.content.html +0 -31
|
@@ -29,15 +29,7 @@ app.directive('iControl', function () {
|
|
|
29
29
|
$('.i-list .dropdown-content').css('display', 'none');
|
|
30
30
|
});
|
|
31
31
|
},
|
|
32
|
-
template:
|
|
33
|
-
<div class="mb-3 {{class2}}">
|
|
34
|
-
<label for="{{id2}}" class="form-label">{{label}}</label>
|
|
35
|
-
<input id="{{id2}}" ng-disabled="disabled" autofocus v="{{v}}" type="{{type}}" ng-model="ngModel" ng-change="ngChange()" ngKeydown="ngKeydown()" class="form-control" placeholder="{{placeholder}}" aria-label="{{label}}" />
|
|
36
|
-
<div class="invalid-feedback">
|
|
37
|
-
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
`,
|
|
32
|
+
template: `/*##client-side/directive/i-control.html*/`,
|
|
41
33
|
};
|
|
42
34
|
});
|
|
43
35
|
|
|
@@ -68,12 +60,7 @@ app.directive('iTextarea', function () {
|
|
|
68
60
|
$('.popup').hide();
|
|
69
61
|
});
|
|
70
62
|
},
|
|
71
|
-
template:
|
|
72
|
-
<div class="mb-3">
|
|
73
|
-
<label for="{{id2}}" class="form-label">{{label}}</label>
|
|
74
|
-
<textarea ng-disabled="disabled" class="form-control" id="{{id2}}" ng-model="ngModel" ng-change="ngChange()" v="{{v}}" rows="{{rows}}"></textarea>
|
|
75
|
-
</div>
|
|
76
|
-
`,
|
|
63
|
+
template: `/*##client-side/directive/i-textarea.html*/`,
|
|
77
64
|
};
|
|
78
65
|
});
|
|
79
66
|
|
|
@@ -102,14 +89,7 @@ app.directive('iCheckbox', function ($timeout) {
|
|
|
102
89
|
}, 100);
|
|
103
90
|
};
|
|
104
91
|
},
|
|
105
|
-
template:
|
|
106
|
-
<div class="form-check">
|
|
107
|
-
<input ng-change="changed()" ng-disabled="disabled" class="form-check-input" type="checkbox" ng-model="ngModel" id="{{id2}}">
|
|
108
|
-
<label class="form-check-label" for="{{id2}}">
|
|
109
|
-
{{label}}
|
|
110
|
-
</label>
|
|
111
|
-
</div>
|
|
112
|
-
`,
|
|
92
|
+
template: `/*##client-side/directive/i-checkbox.html*/`,
|
|
113
93
|
};
|
|
114
94
|
});
|
|
115
95
|
|
|
@@ -121,6 +101,7 @@ app.directive('iRadio', function () {
|
|
|
121
101
|
label: '@',
|
|
122
102
|
group: '@',
|
|
123
103
|
id2: '@',
|
|
104
|
+
ngValue: '@',
|
|
124
105
|
ngModel: '=',
|
|
125
106
|
ngChange: '&',
|
|
126
107
|
},
|
|
@@ -131,18 +112,10 @@ app.directive('iRadio', function () {
|
|
|
131
112
|
attrs.disabled = '';
|
|
132
113
|
}
|
|
133
114
|
|
|
134
|
-
$scope.group = $scope.group || attrs.
|
|
115
|
+
$scope.group = $scope.group || attrs.ngModel.replaceAll('.', '_');
|
|
135
116
|
$scope.id2 = $scope.id2 || 'input_' + Math.random().toString().replace('0.', '');
|
|
136
117
|
},
|
|
137
|
-
template:
|
|
138
|
-
<div class="form-check">
|
|
139
|
-
<input class="form-check-input" type="radio" ng-change="ngChange()" ng-disabled="disabled" ng-model="ngModel" id="{{id2}}" name="{{group}}" >
|
|
140
|
-
<label class="form-check-label" for="exampleRadios1">
|
|
141
|
-
{{label}}
|
|
142
|
-
</label>
|
|
143
|
-
</div>
|
|
144
|
-
|
|
145
|
-
`,
|
|
118
|
+
template: `/*##client-side/directive/i-radio.html*/`,
|
|
146
119
|
};
|
|
147
120
|
});
|
|
148
121
|
|
|
@@ -182,11 +155,21 @@ app.directive('iButton', function () {
|
|
|
182
155
|
} else if ($scope.type.like('*print*')) {
|
|
183
156
|
$scope.fa = 'fas fa-print';
|
|
184
157
|
$scope.class = 'btn-secondary';
|
|
185
|
-
} else if ($scope.type.like('*search*')) {
|
|
186
|
-
$scope.fa = 'search';
|
|
187
158
|
} else if ($scope.type.like('*export*') || $scope.type.like('*excel*')) {
|
|
188
159
|
$scope.fa = 'fas fa-file-export';
|
|
189
160
|
$scope.class = 'btn-secondary';
|
|
161
|
+
} else if ($scope.type.like('*search*') || $scope.type.like('*find*')) {
|
|
162
|
+
$scope.fa = 'fas fa-search';
|
|
163
|
+
$scope.class = 'btn-light';
|
|
164
|
+
} else if ($scope.type.like('*login*') || $scope.type.like('*signin*')) {
|
|
165
|
+
$scope.fa = 'fas fa-sign-in-alt';
|
|
166
|
+
$scope.class = 'btn-light';
|
|
167
|
+
} else if ($scope.type.like('*logout*') || $scope.type.like('*signout*')) {
|
|
168
|
+
$scope.fa = 'fas fa-sign-out-alt';
|
|
169
|
+
$scope.class = 'btn-light';
|
|
170
|
+
}
|
|
171
|
+
if ($scope.type.like('*default*')) {
|
|
172
|
+
$scope.class = '';
|
|
190
173
|
}
|
|
191
174
|
$scope.$watch('loading', (loading) => {
|
|
192
175
|
if (loading === 'true') {
|
|
@@ -196,13 +179,7 @@ app.directive('iButton', function () {
|
|
|
196
179
|
}
|
|
197
180
|
});
|
|
198
181
|
},
|
|
199
|
-
template:
|
|
200
|
-
<button class="btn {{class}}" type="button" ng-click="click()" ng-disabled="busy">
|
|
201
|
-
<span ng-show="busy" class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
|
202
|
-
{{label}}
|
|
203
|
-
<i class="{{fa}}"></i>
|
|
204
|
-
</button>
|
|
205
|
-
`,
|
|
182
|
+
template: `/*##client-side/directive/i-button.html*/`,
|
|
206
183
|
};
|
|
207
184
|
});
|
|
208
185
|
app.directive('iList', [
|
|
@@ -370,7 +347,7 @@ app.directive('iList', [
|
|
|
370
347
|
$scope.hide();
|
|
371
348
|
};
|
|
372
349
|
},
|
|
373
|
-
template: `/*##client-side/
|
|
350
|
+
template: `/*##client-side/directive/i-list.html*/`,
|
|
374
351
|
};
|
|
375
352
|
},
|
|
376
353
|
]);
|
|
@@ -400,7 +377,9 @@ app.directive('iChecklist', [
|
|
|
400
377
|
$scope.$watch('ngModel', (ngModel) => {
|
|
401
378
|
$scope.reload();
|
|
402
379
|
});
|
|
403
|
-
|
|
380
|
+
$scope.$watch('items', (ngModel) => {
|
|
381
|
+
$scope.reload();
|
|
382
|
+
});
|
|
404
383
|
$scope.reload = function () {
|
|
405
384
|
$scope.selectedItems = [];
|
|
406
385
|
|
|
@@ -465,14 +444,7 @@ app.directive('iChecklist', [
|
|
|
465
444
|
}, 100);
|
|
466
445
|
};
|
|
467
446
|
},
|
|
468
|
-
template:
|
|
469
|
-
<div class="check-list">
|
|
470
|
-
<label class="title margin"> {{label}} </label>
|
|
471
|
-
<div class="row">
|
|
472
|
-
<i-checkbox class="{{class2}}" label="{{item[display]}}" ng-repeat="item in items" ng-model="item.$selected" ng-change="change(item);"></i-checkbox>
|
|
473
|
-
</div>
|
|
474
|
-
</div>
|
|
475
|
-
`,
|
|
447
|
+
template: `/*##client-side/directive/i-checklist.html*/`,
|
|
476
448
|
};
|
|
477
449
|
},
|
|
478
450
|
]);
|
|
@@ -483,6 +455,7 @@ app.directive('iDate', function () {
|
|
|
483
455
|
required: 'ngModel',
|
|
484
456
|
scope: {
|
|
485
457
|
label: '@',
|
|
458
|
+
V: '@',
|
|
486
459
|
year: '@',
|
|
487
460
|
ngModel: '=',
|
|
488
461
|
ngChange: '&',
|
|
@@ -565,6 +538,7 @@ app.directive('iDate', function () {
|
|
|
565
538
|
$scope.updateDate = function (date) {
|
|
566
539
|
if ($scope.model.selectedDay && $scope.model.selectedMonth && $scope.model.selectedYear) {
|
|
567
540
|
$scope.ngModel = new Date($scope.model.selectedYear.id, $scope.model.selectedMonth.id, $scope.model.selectedDay.id, 0, 0, 0);
|
|
541
|
+
$scope.editOnly = false;
|
|
568
542
|
if ($scope.ngChange) {
|
|
569
543
|
$scope.ngChange();
|
|
570
544
|
}
|
|
@@ -583,262 +557,123 @@ app.directive('iDate', function () {
|
|
|
583
557
|
};
|
|
584
558
|
});
|
|
585
559
|
|
|
586
|
-
app.directive('
|
|
560
|
+
app.directive('iDatetime', function () {
|
|
587
561
|
return {
|
|
562
|
+
restrict: 'E',
|
|
563
|
+
required: 'ngModel',
|
|
564
|
+
scope: {
|
|
565
|
+
label: '@',
|
|
566
|
+
V: '@',
|
|
567
|
+
ngYear: '@',
|
|
568
|
+
ngModel: '=',
|
|
569
|
+
ngChange: '&',
|
|
570
|
+
},
|
|
588
571
|
link: function ($scope, element, attrs) {
|
|
589
572
|
if (typeof attrs.disabled !== 'undefined') {
|
|
590
573
|
attrs.disabled = 'disabled';
|
|
591
574
|
} else {
|
|
592
575
|
attrs.disabled = '';
|
|
593
576
|
}
|
|
577
|
+
$scope.year = $scope.ngYear ? parseInt($scope.ngYear) : 1960;
|
|
594
578
|
|
|
595
579
|
$scope.model = {};
|
|
596
580
|
|
|
597
581
|
$scope.hours = [];
|
|
598
|
-
for (let i =
|
|
599
|
-
$scope.hours.push(
|
|
582
|
+
for (let i = 0; i < 24; i++) {
|
|
583
|
+
$scope.hours.push({
|
|
584
|
+
id: i,
|
|
585
|
+
name: i < 10 ? '0' + i : i,
|
|
586
|
+
});
|
|
600
587
|
}
|
|
601
|
-
|
|
602
588
|
$scope.minutes = [];
|
|
603
589
|
for (let i = 0; i < 60; i++) {
|
|
604
|
-
$scope.minutes.push(
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
$(element)
|
|
608
|
-
.find('select')
|
|
609
|
-
.focus(() => {
|
|
610
|
-
$('.popup').hide();
|
|
590
|
+
$scope.minutes.push({
|
|
591
|
+
id: i,
|
|
592
|
+
name: i < 10 ? '0' + i : i,
|
|
611
593
|
});
|
|
612
|
-
|
|
613
|
-
$scope.$watch('ngModel', function (ngModel) {
|
|
614
|
-
if (ngModel) {
|
|
615
|
-
ngModel.date = new Date(ngModel.date);
|
|
616
|
-
$scope.model = $scope.model || {};
|
|
617
|
-
$scope.model.hour = ngModel.hour;
|
|
618
|
-
$scope.model.minute = ngModel.minute;
|
|
619
|
-
} else {
|
|
620
|
-
$scope.model = $scope.model || {};
|
|
621
|
-
$scope.model.hour = 0;
|
|
622
|
-
$scope.model.minute = 0;
|
|
623
|
-
}
|
|
624
|
-
});
|
|
625
|
-
|
|
626
|
-
$scope.updateTime = function () {
|
|
627
|
-
if ($scope.model) {
|
|
628
|
-
$scope.ngModel = $scope.ngModel || {};
|
|
629
|
-
$scope.ngModel.hour = $scope.model.hour;
|
|
630
|
-
$scope.ngModel.minute = $scope.model.minute;
|
|
631
|
-
$scope.ngModel.date = new Date(null, null, null, $scope.model.hour, $scope.model.minute, null);
|
|
632
|
-
} else {
|
|
633
|
-
delete $scope.ngModel;
|
|
634
|
-
}
|
|
635
|
-
};
|
|
636
|
-
},
|
|
637
|
-
restrict: 'E',
|
|
638
|
-
require: 'ngModel',
|
|
639
|
-
scope: {
|
|
640
|
-
v: '@',
|
|
641
|
-
disabled: '@',
|
|
642
|
-
label: '@',
|
|
643
|
-
ngModel: '=',
|
|
644
|
-
},
|
|
645
|
-
template: `
|
|
646
|
-
<div class="row i-time">
|
|
647
|
-
<div class=" control ">
|
|
648
|
-
<label class="text-center"> {{label}} </label>
|
|
649
|
-
<div class="row">
|
|
650
|
-
<div class="col6 right">
|
|
651
|
-
<div class="row">
|
|
652
|
-
<div class="col2"></div>
|
|
653
|
-
<div class="col8">
|
|
654
|
-
<select ng-disabled="disabled" ng-model="model.minute" ng-change="updateTime()" class="small appearance-none no-border-left no-border-radius" >
|
|
655
|
-
<option ng-repeat="m in minutes" ng-value="m"> {{m}}</option>
|
|
656
|
-
</select>
|
|
657
|
-
</div>
|
|
658
|
-
<div class="col2"></div>
|
|
659
|
-
</div>
|
|
660
|
-
|
|
661
|
-
</div>
|
|
662
|
-
<div class="col6">
|
|
663
|
-
<div class="row">
|
|
664
|
-
<div class="col2 space right">
|
|
665
|
-
<span> : </span>
|
|
666
|
-
</div>
|
|
667
|
-
<div class="col8">
|
|
668
|
-
<select ng-disabled="disabled" ng-model="model.hour" ng-change="updateTime()" class="large blue appearance-none no-border-left no-border-radius" >
|
|
669
|
-
<option ng-repeat="h in hours" ng-value="h"> {{h}} </option>
|
|
670
|
-
</select>
|
|
671
|
-
</div>
|
|
672
|
-
|
|
673
|
-
</div>
|
|
674
|
-
|
|
675
|
-
</div>
|
|
676
|
-
</div>
|
|
677
|
-
</div>
|
|
678
|
-
`,
|
|
679
|
-
};
|
|
680
|
-
});
|
|
681
|
-
|
|
682
|
-
app.directive('iDatetime2', function () {
|
|
683
|
-
return {
|
|
684
|
-
link: function ($scope, element, attrs) {
|
|
685
|
-
if (typeof attrs.disabled !== 'undefined') {
|
|
686
|
-
attrs.disabled = 'disabled';
|
|
687
|
-
} else {
|
|
688
|
-
attrs.disabled = '';
|
|
689
594
|
}
|
|
690
595
|
|
|
691
|
-
$scope.
|
|
692
|
-
for (let i = 1; i <
|
|
693
|
-
$scope.
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
$scope.minute_list = [];
|
|
697
|
-
for (let i = 1; i < 60; i++) {
|
|
698
|
-
$scope.minute_list.push({
|
|
596
|
+
$scope.days = [];
|
|
597
|
+
for (let i = 1; i < 32; i++) {
|
|
598
|
+
$scope.days.push({
|
|
599
|
+
id: i,
|
|
699
600
|
name: i,
|
|
700
601
|
});
|
|
701
602
|
}
|
|
702
603
|
|
|
703
|
-
$scope.
|
|
704
|
-
for (let i =
|
|
705
|
-
$scope.
|
|
604
|
+
$scope.years = [];
|
|
605
|
+
for (let i = $scope.year; i < 2100; i++) {
|
|
606
|
+
$scope.years.push({
|
|
607
|
+
id: i,
|
|
608
|
+
name: i,
|
|
609
|
+
});
|
|
706
610
|
}
|
|
707
|
-
$scope.
|
|
708
|
-
|
|
709
|
-
$scope.
|
|
611
|
+
$scope.lang = site.session ? site.session.lang : 'en';
|
|
612
|
+
if ($scope.lang === 'ar') {
|
|
613
|
+
$scope.monthes = [
|
|
614
|
+
{ id: 0, name: 'يناير' },
|
|
615
|
+
{ id: 1, name: 'فبراير' },
|
|
616
|
+
{ id: 2, name: 'مارس' },
|
|
617
|
+
{ id: 3, name: 'ابريل' },
|
|
618
|
+
{ id: 4, name: 'مايو' },
|
|
619
|
+
{ id: 5, name: 'يونيو' },
|
|
620
|
+
{ id: 6, name: 'يوليو' },
|
|
621
|
+
{ id: 7, name: 'اغسطس' },
|
|
622
|
+
{ id: 8, name: 'سبتمبر' },
|
|
623
|
+
{ id: 9, name: 'اكتوبر' },
|
|
624
|
+
{ id: 10, name: 'نوفمبر' },
|
|
625
|
+
{ id: 11, name: 'ديسمبر' },
|
|
626
|
+
];
|
|
627
|
+
} else {
|
|
628
|
+
$scope.monthes = [
|
|
629
|
+
{ id: 0, name: 'Jan' },
|
|
630
|
+
{ id: 1, name: 'Feb' },
|
|
631
|
+
{ id: 2, name: 'Mar' },
|
|
632
|
+
{ id: 3, name: 'Aper' },
|
|
633
|
+
{ id: 4, name: 'May' },
|
|
634
|
+
{ id: 5, name: 'June' },
|
|
635
|
+
{ id: 6, name: 'Jule' },
|
|
636
|
+
{ id: 7, name: 'Aug' },
|
|
637
|
+
{ id: 8, name: 'Sep' },
|
|
638
|
+
{ id: 9, name: 'Oct' },
|
|
639
|
+
{ id: 10, name: 'Nov' },
|
|
640
|
+
{ id: 11, name: 'Des' },
|
|
641
|
+
];
|
|
710
642
|
}
|
|
711
|
-
$scope.monthes1 = ['يناير', 'فبراير', 'مارس', 'ابريل', 'مايو', 'يونيو', 'يوليو', 'اغسطس', 'سبتمبر', 'اكتوبر', 'نوفمبر', 'ديسمبر'];
|
|
712
|
-
|
|
713
|
-
$scope.model = null;
|
|
714
|
-
|
|
715
|
-
$(element)
|
|
716
|
-
.find('select')
|
|
717
|
-
.focus(() => {
|
|
718
|
-
$('.popup').hide();
|
|
719
|
-
});
|
|
720
643
|
|
|
721
644
|
$scope.$watch('ngModel', function (ngModel) {
|
|
722
645
|
if (ngModel) {
|
|
723
646
|
ngModel = new Date(ngModel);
|
|
724
647
|
$scope.model = $scope.model || {};
|
|
725
|
-
$scope.model.
|
|
726
|
-
$scope.model.
|
|
727
|
-
$scope.model.
|
|
728
|
-
$scope.model.
|
|
729
|
-
$scope.model.
|
|
648
|
+
$scope.model.selectedDay = $scope.days.find((d) => d.id == ngModel.getDate());
|
|
649
|
+
$scope.model.selectedMonth = $scope.monthes.find((m) => m.id == ngModel.getMonth());
|
|
650
|
+
$scope.model.selectedYear = $scope.years.find((y) => y.id == ngModel.getFullYear());
|
|
651
|
+
$scope.model.selectedHour = $scope.hours.find((y) => y.id == ngModel.getHours());
|
|
652
|
+
$scope.model.selectedMinute = $scope.minutes.find((y) => y.id == ngModel.getMinutes());
|
|
653
|
+
$(element).attr('value', ngModel.getTime());
|
|
730
654
|
} else {
|
|
731
655
|
$scope.model = $scope.model || {};
|
|
732
|
-
$scope.model.
|
|
733
|
-
$scope.model.
|
|
734
|
-
$scope.model.
|
|
735
|
-
$scope.model.
|
|
736
|
-
$scope.model.
|
|
656
|
+
$scope.model.selectedDay = null;
|
|
657
|
+
$scope.model.selectedMonth = null;
|
|
658
|
+
$scope.model.selectedYear = null;
|
|
659
|
+
$scope.model.selectedHour = null;
|
|
660
|
+
$scope.model.selectedMinute = null;
|
|
661
|
+
$(element).attr('value', '');
|
|
737
662
|
}
|
|
738
663
|
});
|
|
739
664
|
|
|
740
|
-
$scope.
|
|
741
|
-
|
|
742
|
-
$scope.ngModel = new Date($scope.model.year, $scope.model.month, $scope.model.day, $scope.model.hour, $scope.model.minute);
|
|
743
|
-
} else {
|
|
744
|
-
delete $scope.ngModel;
|
|
745
|
-
}
|
|
665
|
+
$scope.setDay = function () {
|
|
666
|
+
$scope.ngModel = new Date();
|
|
746
667
|
};
|
|
747
|
-
},
|
|
748
|
-
restrict: 'E',
|
|
749
|
-
require: 'ngModel',
|
|
750
|
-
scope: {
|
|
751
|
-
v: '@',
|
|
752
|
-
disabled: '@',
|
|
753
|
-
label: '@',
|
|
754
|
-
ngModel: '=',
|
|
755
|
-
},
|
|
756
|
-
template: `
|
|
757
|
-
<div class="row i-datetime2">
|
|
758
|
-
|
|
759
|
-
<div class=" control">
|
|
760
|
-
<label> {{label}} </label>
|
|
761
|
-
<div class="row">
|
|
762
|
-
|
|
763
|
-
<div class="col2 day">
|
|
764
|
-
<select v="{{v}}" ng-disabled="disabled" ng-model="model.day" ng-change="updateDate()" class="appearance-none no-border-left no-border-radius" >
|
|
765
|
-
<option ng-repeat="d1 in days1" ng-value="d1"> {{d1}} </option>
|
|
766
|
-
</select>
|
|
767
|
-
</div>
|
|
768
|
-
<div class="col5 month">
|
|
769
|
-
<select v="{{v}}" ng-disabled="disabled" ng-model="model.month" ng-change="updateDate()" class="appearance-none no-border-left no-border-right no-border-radius" >
|
|
770
|
-
<option ng-repeat="m1 in monthes1" ng-value="$index"> {{m1}} </option>
|
|
771
|
-
</select>
|
|
772
|
-
</div>
|
|
773
|
-
<div class="col3 year">
|
|
774
|
-
<select v="{{v}}" ng-disabled="disabled" ng-model="model.year" ng-change="updateDate()" class="appearance-none no-border-right no-border-radius" >
|
|
775
|
-
<option ng-repeat="y1 in years1" ng-value="y1"> {{y1}} </option>
|
|
776
|
-
</select>
|
|
777
|
-
</div>
|
|
778
|
-
|
|
779
|
-
<div class="col1 hour">
|
|
780
|
-
<select v="{{v}}" ng-disabled="disabled" ng-model="model.hour" ng-change="updateDate()" class="appearance-none no-border-radius" >
|
|
781
|
-
<option ng-repeat="h1 in hour1" ng-value="h1"> {{h1}} </option>
|
|
782
|
-
</select>
|
|
783
|
-
</div>
|
|
784
|
-
<div class="col1 minute">
|
|
785
|
-
<select v="{{v}}" ng-disabled="disabled" ng-model="model.minute" ng-change="updateDate()" class="green appearance-none no-border-right no-border-radius" >
|
|
786
|
-
<option ng-repeat="m1 in minute_list" ng-value="m1.name" class="green"> {{m1.name}} </option>
|
|
787
|
-
</select>
|
|
788
|
-
</div>
|
|
789
|
-
|
|
790
|
-
</div>
|
|
791
|
-
</div>
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
</div>
|
|
795
|
-
`,
|
|
796
|
-
};
|
|
797
|
-
});
|
|
798
|
-
|
|
799
|
-
app.directive('iMonth2', function () {
|
|
800
|
-
return {
|
|
801
|
-
link: function ($scope, element, attrs) {
|
|
802
|
-
if (typeof attrs.disabled !== 'undefined') {
|
|
803
|
-
attrs.disabled = 'disabled';
|
|
804
|
-
} else {
|
|
805
|
-
attrs.disabled = '';
|
|
806
|
-
}
|
|
807
|
-
|
|
808
|
-
$scope.years = [];
|
|
809
|
-
for (let i = 1900; i < 2100; i++) {
|
|
810
|
-
$scope.years.push(i);
|
|
811
|
-
}
|
|
812
|
-
$scope.monthes = ['يناير', 'فبراير', 'مارس', 'ابريل', 'مايو', 'يونيو', 'يوليو', 'اغسطس', 'سبتمبر', 'اكتوبر', 'نوفمبر', 'ديسمبر'];
|
|
813
|
-
|
|
814
|
-
$scope.model = null;
|
|
815
|
-
|
|
816
|
-
$(element)
|
|
817
|
-
.find('select')
|
|
818
|
-
.focus(() => {
|
|
819
|
-
$('.popup').hide();
|
|
820
|
-
});
|
|
821
668
|
|
|
822
|
-
$scope
|
|
823
|
-
if (
|
|
824
|
-
ngModel = new Date(
|
|
825
|
-
$scope.
|
|
826
|
-
$scope.
|
|
827
|
-
$scope.
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
$scope.model = $scope.model || {};
|
|
831
|
-
$scope.model.day = 0;
|
|
832
|
-
$scope.model.month = -1;
|
|
833
|
-
$scope.model.year = 0;
|
|
834
|
-
}
|
|
835
|
-
});
|
|
836
|
-
|
|
837
|
-
$scope.updateDate = function () {
|
|
838
|
-
if ($scope.model && $scope.model.year) {
|
|
839
|
-
$scope.ngModel = new Date($scope.model.year, $scope.model.month, 1);
|
|
840
|
-
} else {
|
|
841
|
-
delete $scope.ngModel;
|
|
669
|
+
$scope.updateDate = function (date) {
|
|
670
|
+
if ($scope.model.selectedDay && $scope.model.selectedMonth && $scope.model.selectedYear && $scope.model.selectedHour && $scope.model.selectedMinute) {
|
|
671
|
+
$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);
|
|
672
|
+
$scope.editOnly = false;
|
|
673
|
+
$(element).attr('value', $scope.ngModel.getTime());
|
|
674
|
+
if ($scope.ngChange) {
|
|
675
|
+
$scope.ngChange();
|
|
676
|
+
}
|
|
842
677
|
}
|
|
843
678
|
};
|
|
844
679
|
},
|
|
@@ -846,389 +681,47 @@ app.directive('iMonth2', function () {
|
|
|
846
681
|
require: 'ngModel',
|
|
847
682
|
scope: {
|
|
848
683
|
v: '@',
|
|
849
|
-
label: '@',
|
|
850
684
|
disabled: '@',
|
|
685
|
+
label: '@',
|
|
851
686
|
ngModel: '=',
|
|
852
687
|
},
|
|
853
|
-
template:
|
|
854
|
-
<div class="row i-date2">
|
|
855
|
-
|
|
856
|
-
<div class=" control">
|
|
857
|
-
<label> {{label}} </label>
|
|
858
|
-
<div class="row">
|
|
859
|
-
|
|
860
|
-
<div class="col7 month">
|
|
861
|
-
<select ng-disabled="disabled" v="{{v}}" ng-model="model.month" ng-change="updateDate()" class="appearance-none no-border-left no-border-radius" >
|
|
862
|
-
<option ng-repeat="m1 in monthes" ng-value="$index"> {{m1}} </option>
|
|
863
|
-
</select>
|
|
864
|
-
</div>
|
|
865
|
-
|
|
866
|
-
<div class="col5 year">
|
|
867
|
-
<select ng-disabled="disabled" v="{{v}}" ng-model="model.year" ng-change="updateDate()" class="appearance-none no-border-right no-border-radius" >
|
|
868
|
-
<option ng-repeat="y1 in years" ng-value="y1"> {{y1}} </option>
|
|
869
|
-
</select>
|
|
870
|
-
</div>
|
|
871
|
-
|
|
872
|
-
</div>
|
|
873
|
-
</div>
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
</div>
|
|
877
|
-
`,
|
|
688
|
+
template: `/*##client-side/directive/i-datetime.html*/`,
|
|
878
689
|
};
|
|
879
690
|
});
|
|
880
691
|
|
|
881
|
-
app.directive('iFulldate', [
|
|
882
|
-
'$http',
|
|
883
|
-
function ($http) {
|
|
884
|
-
return {
|
|
885
|
-
link: function ($scope, element, attrs, ngModel) {
|
|
886
|
-
let _busy = !1;
|
|
887
|
-
|
|
888
|
-
if (typeof attrs.disabled !== 'undefined') {
|
|
889
|
-
attrs.disabled = 'disabled';
|
|
890
|
-
} else {
|
|
891
|
-
attrs.disabled = '';
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
$(element)
|
|
895
|
-
.find('select')
|
|
896
|
-
.focus(() => {
|
|
897
|
-
$('.popup').hide();
|
|
898
|
-
});
|
|
899
|
-
|
|
900
|
-
$scope.days1 = [];
|
|
901
|
-
for (let i = 1; i < 32; i++) {
|
|
902
|
-
$scope.days1.push(i);
|
|
903
|
-
}
|
|
904
|
-
$scope.years1 = [];
|
|
905
|
-
for (let i = 1950; i < 2030; i++) {
|
|
906
|
-
$scope.years1.push(i);
|
|
907
|
-
}
|
|
908
|
-
|
|
909
|
-
$scope.monthes1 = ['يناير', 'فبراير', 'مارس', 'ابريل', 'مايو', 'يونيو', 'يوليو', 'اغسطس', 'سبتمبر', 'اكتوبر', 'نوفمبر', 'ديسمبر'];
|
|
910
|
-
|
|
911
|
-
$scope.days2 = [];
|
|
912
|
-
for (let i = 1; i < 31; i++) {
|
|
913
|
-
$scope.days2.push(i);
|
|
914
|
-
}
|
|
915
|
-
$scope.years2 = [];
|
|
916
|
-
for (let i = 1370; i < 1450; i++) {
|
|
917
|
-
$scope.years2.push(i);
|
|
918
|
-
}
|
|
919
|
-
$scope.monthes2 = ['محرم', 'صفر', 'ربيع اول', 'ربيع ثان', 'جمادى اول', 'جمادى ثان', 'رجب', 'شعبان', 'رمضان', 'شوال', 'ذى القعدة', 'ذى الحجة'];
|
|
920
|
-
|
|
921
|
-
$scope.model = {};
|
|
922
|
-
|
|
923
|
-
$scope.$watch('ngModel', function (ngModel) {
|
|
924
|
-
if (ngModel) {
|
|
925
|
-
$scope.model = ngModel;
|
|
926
|
-
} else {
|
|
927
|
-
$scope.model = {};
|
|
928
|
-
}
|
|
929
|
-
});
|
|
930
|
-
|
|
931
|
-
$scope.$watch('ngModel.date', function (date) {
|
|
932
|
-
if (date) {
|
|
933
|
-
if (typeof date == 'string') {
|
|
934
|
-
date = new Date(date);
|
|
935
|
-
}
|
|
936
|
-
$scope.model = $scope.model || {};
|
|
937
|
-
$scope.model.date = date;
|
|
938
|
-
$scope.model.day = date.getDate();
|
|
939
|
-
$scope.model.month = date.getMonth();
|
|
940
|
-
$scope.model.year = date.getFullYear();
|
|
941
|
-
$scope.get_hijri_date();
|
|
942
|
-
}
|
|
943
|
-
});
|
|
944
|
-
|
|
945
|
-
$scope.get_hijri_date = function () {
|
|
946
|
-
if ($scope.model && $scope.model.year && $scope.model.day) {
|
|
947
|
-
ngModel.$setViewValue($scope.model);
|
|
948
|
-
if (_busy) {
|
|
949
|
-
return;
|
|
950
|
-
}
|
|
951
|
-
_busy = !0;
|
|
952
|
-
$scope.model.date = new Date($scope.model.year, $scope.model.month, $scope.model.day);
|
|
953
|
-
$http({
|
|
954
|
-
method: 'POST',
|
|
955
|
-
url: '/api/get_hijri_date',
|
|
956
|
-
data: {
|
|
957
|
-
date: $scope.model.year + '/' + ($scope.model.month + 1) + '/' + $scope.model.day,
|
|
958
|
-
},
|
|
959
|
-
})
|
|
960
|
-
.then((response) => {
|
|
961
|
-
if (response.data.done) {
|
|
962
|
-
$scope.model.hijri = response.data.hijri;
|
|
963
|
-
$scope.model.day2 = parseInt($scope.model.hijri.split('/')[2]);
|
|
964
|
-
$scope.model.month2 = parseInt($scope.model.hijri.split('/')[1]) - 1;
|
|
965
|
-
$scope.model.year2 = parseInt($scope.model.hijri.split('/')[0]);
|
|
966
|
-
ngModel.$setViewValue($scope.model);
|
|
967
|
-
_busy = !1;
|
|
968
|
-
}
|
|
969
|
-
})
|
|
970
|
-
.catch(() => {
|
|
971
|
-
_busy = !1;
|
|
972
|
-
});
|
|
973
|
-
}
|
|
974
|
-
};
|
|
975
|
-
|
|
976
|
-
$scope.get_normal_date = function () {
|
|
977
|
-
if ($scope.model && $scope.model.year2 && $scope.model.day2) {
|
|
978
|
-
ngModel.$setViewValue($scope.model);
|
|
979
|
-
if (_busy) {
|
|
980
|
-
return;
|
|
981
|
-
}
|
|
982
|
-
_busy = !0;
|
|
983
|
-
$http({
|
|
984
|
-
method: 'POST',
|
|
985
|
-
url: '/api/get_normal_date',
|
|
986
|
-
data: {
|
|
987
|
-
hijri: $scope.model.year2 + '/' + ($scope.model.month2 + 1) + '/' + $scope.model.day2,
|
|
988
|
-
},
|
|
989
|
-
})
|
|
990
|
-
.then((response) => {
|
|
991
|
-
if (response.data.done) {
|
|
992
|
-
$scope.model.date = new Date(response.data.date);
|
|
993
|
-
$scope.model.day = parseInt(response.data.date.split('/')[2]);
|
|
994
|
-
$scope.model.month = parseInt(response.data.date.split('/')[1]) - 1;
|
|
995
|
-
$scope.model.year = parseInt(response.data.date.split('/')[0]);
|
|
996
|
-
ngModel.$setViewValue($scope.model);
|
|
997
|
-
_busy = !1;
|
|
998
|
-
}
|
|
999
|
-
})
|
|
1000
|
-
.catch(() => {
|
|
1001
|
-
_busy = !1;
|
|
1002
|
-
});
|
|
1003
|
-
}
|
|
1004
|
-
};
|
|
1005
|
-
},
|
|
1006
|
-
restrict: 'E',
|
|
1007
|
-
require: 'ngModel',
|
|
1008
|
-
scope: {
|
|
1009
|
-
v: '@',
|
|
1010
|
-
label1: '@',
|
|
1011
|
-
label2: '@',
|
|
1012
|
-
disabled: '@',
|
|
1013
|
-
ngModel: '=',
|
|
1014
|
-
ngChange: '&',
|
|
1015
|
-
},
|
|
1016
|
-
template: `
|
|
1017
|
-
<div class="row i-date">
|
|
1018
|
-
|
|
1019
|
-
<div class="col6 control">
|
|
1020
|
-
<label> {{label1}} </label>
|
|
1021
|
-
<div class="row">
|
|
1022
|
-
<div class="col3 day">
|
|
1023
|
-
<select ng-change="get_hijri_date()" ng-disabled="disabled" v="{{v}}" ng-model="model.day" class="appearance-none no-border-left no-border-radius">
|
|
1024
|
-
<option ng-repeat="d1 in days1" ng-value="d1"> {{d1}} </option>
|
|
1025
|
-
</select>
|
|
1026
|
-
</div>
|
|
1027
|
-
<div class="col5 month">
|
|
1028
|
-
<select ng-change="get_hijri_date()" ng-disabled="disabled" v="{{v}}" ng-model="model.month" class="appearance-none no-border-left no-border-right no-border-radius">
|
|
1029
|
-
<option ng-repeat="m1 in monthes1" ng-value="$index"> {{m1}} </option>
|
|
1030
|
-
</select>
|
|
1031
|
-
</div>
|
|
1032
|
-
<div class="col4 year">
|
|
1033
|
-
<select ng-change="get_hijri_date()" ng-disabled="disabled" v="{{v}}" ng-model="model.year" class="appearance-none no-border-right no-border-radius">
|
|
1034
|
-
<option ng-repeat="y1 in years1" ng-value="y1"> {{y1}} </option>
|
|
1035
|
-
</select>
|
|
1036
|
-
</div>
|
|
1037
|
-
</div>
|
|
1038
|
-
</div>
|
|
1039
|
-
|
|
1040
|
-
<div class="col6 control">
|
|
1041
|
-
<label> {{label2}} </label>
|
|
1042
|
-
<div class="row">
|
|
1043
|
-
<div class="col3 day">
|
|
1044
|
-
<select ng-change="get_normal_date()" ng-disabled="disabled" v="{{v}}" ng-model="model.day2" class="appearance-none no-border-left no-border-radius">
|
|
1045
|
-
<option ng-repeat="d2 in days2" ng-value="d2"> {{d2}} </option>
|
|
1046
|
-
</select>
|
|
1047
|
-
</div>
|
|
1048
|
-
<div class="col5 month">
|
|
1049
|
-
<select ng-change="get_normal_date()" ng-disabled="disabled" v="{{v}}" ng-model="model.month2" class="appearance-none no-border-left no-border-right no-border-radius">
|
|
1050
|
-
<option ng-repeat="m2 in monthes2" ng-value="$index"> {{m2}} </option>
|
|
1051
|
-
</select>
|
|
1052
|
-
</div>
|
|
1053
|
-
<div class="col4 year">
|
|
1054
|
-
<select ng-change="get_normal_date()" ng-disabled="disabled" v="{{v}}" ng-model="model.year2" class="appearance-none no-border-right no-border-radius">
|
|
1055
|
-
<option ng-repeat="y2 in years2" ng-value="y2"> {{y2}} </option>
|
|
1056
|
-
</select>
|
|
1057
|
-
</div>
|
|
1058
|
-
</div>
|
|
1059
|
-
</div>
|
|
1060
|
-
|
|
1061
|
-
</div>
|
|
1062
|
-
`,
|
|
1063
|
-
};
|
|
1064
|
-
},
|
|
1065
|
-
]);
|
|
1066
|
-
|
|
1067
|
-
app.directive('iChecklist2', [
|
|
1068
|
-
'$interval',
|
|
1069
|
-
function ($interval) {
|
|
1070
|
-
return {
|
|
1071
|
-
restrict: 'E',
|
|
1072
|
-
required: 'ngModel',
|
|
1073
|
-
scope: {
|
|
1074
|
-
label: '@',
|
|
1075
|
-
primary: '@',
|
|
1076
|
-
display: '@',
|
|
1077
|
-
ngModel: '=',
|
|
1078
|
-
items: '=',
|
|
1079
|
-
like: '&',
|
|
1080
|
-
},
|
|
1081
|
-
link: function ($scope, element, attrs, ctrl) {
|
|
1082
|
-
attrs.primary = attrs.primary || 'id';
|
|
1083
|
-
|
|
1084
|
-
$scope.selectedItems = [];
|
|
1085
|
-
|
|
1086
|
-
$scope.$watch('ngModel', (ngModel) => {
|
|
1087
|
-
$scope.reload();
|
|
1088
|
-
});
|
|
1089
|
-
|
|
1090
|
-
$scope.reload = function () {
|
|
1091
|
-
$scope.selectedItems = [];
|
|
1092
|
-
|
|
1093
|
-
if ($scope.ngModel) {
|
|
1094
|
-
$scope.ngModel.forEach((mitem) => {
|
|
1095
|
-
$scope.selectedItems.push(mitem);
|
|
1096
|
-
});
|
|
1097
|
-
|
|
1098
|
-
if ($scope.items) {
|
|
1099
|
-
$scope.items.forEach((mitem) => {
|
|
1100
|
-
let exist = !1;
|
|
1101
|
-
$scope.selectedItems.forEach((sitem) => {
|
|
1102
|
-
if (mitem[$scope.primary] === sitem[$scope.primary]) {
|
|
1103
|
-
exist = !0;
|
|
1104
|
-
}
|
|
1105
|
-
});
|
|
1106
|
-
if (exist) {
|
|
1107
|
-
mitem.$selected = !0;
|
|
1108
|
-
} else {
|
|
1109
|
-
mitem.$selected = !1;
|
|
1110
|
-
}
|
|
1111
|
-
});
|
|
1112
|
-
}
|
|
1113
|
-
}
|
|
1114
|
-
if (!$scope.ngModel) {
|
|
1115
|
-
$scope.selectedItems = [];
|
|
1116
|
-
if ($scope.items) {
|
|
1117
|
-
$scope.items.forEach((mitem) => {
|
|
1118
|
-
mitem.$selected = !1;
|
|
1119
|
-
});
|
|
1120
|
-
}
|
|
1121
|
-
}
|
|
1122
|
-
};
|
|
1123
|
-
|
|
1124
|
-
$scope.change = function (item) {
|
|
1125
|
-
if (item.$selected) {
|
|
1126
|
-
let exsits = !1;
|
|
1127
|
-
$scope.selectedItems.forEach((sitem) => {
|
|
1128
|
-
if (sitem[$scope.primary] === item[$scope.primary]) {
|
|
1129
|
-
exsits = !0;
|
|
1130
|
-
}
|
|
1131
|
-
});
|
|
1132
|
-
if (!exsits) {
|
|
1133
|
-
$scope.selectedItems.push(item);
|
|
1134
|
-
}
|
|
1135
|
-
} else {
|
|
1136
|
-
$scope.selectedItems.forEach((sitem, index) => {
|
|
1137
|
-
if (sitem[$scope.primary] === item[$scope.primary]) {
|
|
1138
|
-
$scope.selectedItems.splice(index, 1);
|
|
1139
|
-
}
|
|
1140
|
-
});
|
|
1141
|
-
}
|
|
1142
|
-
|
|
1143
|
-
$scope.ngModel = $scope.selectedItems;
|
|
1144
|
-
};
|
|
1145
|
-
},
|
|
1146
|
-
template: `
|
|
1147
|
-
<div class="row padding check-list">
|
|
1148
|
-
<label class="title"> {{label}} </label>
|
|
1149
|
-
<div class="control" ng-repeat="item in items">
|
|
1150
|
-
<label class="checkbox" >
|
|
1151
|
-
<span > {{item[display]}} </span>
|
|
1152
|
-
<input type="checkbox" ng-model="item.$selected" ng-change="change(item)" >
|
|
1153
|
-
<span class="checkmark"></span>
|
|
1154
|
-
</label>
|
|
1155
|
-
</div>
|
|
1156
|
-
</div>
|
|
1157
|
-
`,
|
|
1158
|
-
};
|
|
1159
|
-
},
|
|
1160
|
-
]);
|
|
1161
|
-
|
|
1162
|
-
app.directive('iRadiolist', [
|
|
1163
|
-
'$interval',
|
|
1164
|
-
function ($interval) {
|
|
1165
|
-
return {
|
|
1166
|
-
restrict: 'E',
|
|
1167
|
-
required: 'ngModel',
|
|
1168
|
-
scope: {
|
|
1169
|
-
label: '@',
|
|
1170
|
-
display: '@',
|
|
1171
|
-
ngModel: '=',
|
|
1172
|
-
items: '=',
|
|
1173
|
-
},
|
|
1174
|
-
link: function (scope, element, attrs) {
|
|
1175
|
-
scope.model = scope.ngModel;
|
|
1176
|
-
|
|
1177
|
-
scope.code = 'radio_' + Math.random();
|
|
1178
|
-
|
|
1179
|
-
scope.change = function (item) {
|
|
1180
|
-
scope.ngModel = item;
|
|
1181
|
-
};
|
|
1182
|
-
|
|
1183
|
-
scope.isChecked = function (item) {
|
|
1184
|
-
if (item && scope.ngModel && scope.ngModel.id === item.id) {
|
|
1185
|
-
return !0;
|
|
1186
|
-
}
|
|
1187
|
-
return !1;
|
|
1188
|
-
};
|
|
1189
|
-
},
|
|
1190
|
-
template: `
|
|
1191
|
-
<div class="row padding radio-list">
|
|
1192
|
-
<label class="title"> {{label}} </label>
|
|
1193
|
-
<div class="control" ng-repeat="item in items">
|
|
1194
|
-
<label class="radio" >
|
|
1195
|
-
<span > {{item[display]}} </span>
|
|
1196
|
-
<input name="{{code}}" type="radio" ng-model="model" ng-checked="isChecked(item)" ng-click="change(item)" ng-change="change(item)" >
|
|
1197
|
-
<span class="checkmark"></span>
|
|
1198
|
-
</label>
|
|
1199
|
-
</div>
|
|
1200
|
-
</div>
|
|
1201
|
-
`,
|
|
1202
|
-
};
|
|
1203
|
-
},
|
|
1204
|
-
]);
|
|
1205
|
-
|
|
1206
692
|
app.directive('iFile', [
|
|
1207
693
|
'$interval',
|
|
1208
694
|
'isite',
|
|
1209
|
-
|
|
695
|
+
'$timeout',
|
|
696
|
+
function ($interval, isite, $timeout) {
|
|
1210
697
|
return {
|
|
1211
698
|
restrict: 'E',
|
|
1212
699
|
required: 'ngModel',
|
|
1213
700
|
scope: {
|
|
1214
701
|
label: '@',
|
|
702
|
+
view: '@',
|
|
703
|
+
accept: '@',
|
|
1215
704
|
folder: '@',
|
|
1216
705
|
ngModel: '=',
|
|
1217
706
|
ngClick: '&',
|
|
1218
707
|
onSelected: '&',
|
|
708
|
+
ngChange: '&',
|
|
1219
709
|
},
|
|
1220
710
|
link: function ($scope, element, attrs, ctrl) {
|
|
1221
|
-
$scope.label = $scope.label || '
|
|
711
|
+
$scope.label = $scope.label || '';
|
|
712
|
+
$scope.folder = $scope.folder || 'default';
|
|
713
|
+
$scope.accept = $scope.accept ? $scope.accept : '';
|
|
714
|
+
$scope.viewOnly = $scope.view === undefined ? false : true;
|
|
715
|
+
|
|
1222
716
|
let input = $(element).find('input')[0];
|
|
1223
717
|
let button = $(element).find('button')[0];
|
|
1224
|
-
|
|
1225
|
-
$scope.viewOnly = !0;
|
|
1226
|
-
}
|
|
718
|
+
|
|
1227
719
|
let progress = $(element).find('.progress')[0];
|
|
1228
720
|
$(progress).hide();
|
|
1229
|
-
|
|
721
|
+
|
|
1230
722
|
$scope.id = Math.random().toString().replace('.', '_');
|
|
1231
|
-
|
|
723
|
+
|
|
724
|
+
if (!$scope.viewOnly) {
|
|
1232
725
|
button.addEventListener('click', function () {
|
|
1233
726
|
input.click();
|
|
1234
727
|
});
|
|
@@ -1252,7 +745,7 @@ app.directive('iFile', [
|
|
|
1252
745
|
|
|
1253
746
|
if (file) {
|
|
1254
747
|
$scope.ngModel = file;
|
|
1255
|
-
|
|
748
|
+
$scope.changed();
|
|
1256
749
|
}
|
|
1257
750
|
}
|
|
1258
751
|
);
|
|
@@ -1263,11 +756,19 @@ app.directive('iFile', [
|
|
|
1263
756
|
|
|
1264
757
|
$scope.$watch('ngModel', (ngModel) => {
|
|
1265
758
|
if (ngModel) {
|
|
1266
|
-
|
|
759
|
+
button.setAttribute('url', ngModel);
|
|
1267
760
|
}
|
|
1268
761
|
});
|
|
762
|
+
|
|
763
|
+
$scope.changed = function () {
|
|
764
|
+
$timeout(() => {
|
|
765
|
+
if ($scope.ngChange) {
|
|
766
|
+
$scope.ngChange();
|
|
767
|
+
}
|
|
768
|
+
}, 200);
|
|
769
|
+
};
|
|
1269
770
|
},
|
|
1270
|
-
template: `/*##client-side/
|
|
771
|
+
template: `/*##client-side/directive/i-file.html*/`,
|
|
1271
772
|
};
|
|
1272
773
|
},
|
|
1273
774
|
]);
|
|
@@ -1275,24 +776,30 @@ app.directive('iFile', [
|
|
|
1275
776
|
app.directive('iImage', [
|
|
1276
777
|
'$interval',
|
|
1277
778
|
'isite',
|
|
1278
|
-
|
|
779
|
+
'$timeout',
|
|
780
|
+
function ($interval, isite, $timeout) {
|
|
1279
781
|
return {
|
|
1280
782
|
restrict: 'E',
|
|
1281
783
|
required: 'ngModel',
|
|
1282
784
|
scope: {
|
|
1283
785
|
folder: '@',
|
|
786
|
+
view: '@',
|
|
787
|
+
accept: '@',
|
|
1284
788
|
ngModel: '=',
|
|
1285
789
|
ngClick: '&',
|
|
790
|
+
ngChange: '&',
|
|
1286
791
|
},
|
|
1287
792
|
link: function ($scope, element, attrs, ctrl) {
|
|
1288
793
|
$scope.folder = $scope.folder || 'default';
|
|
794
|
+
$scope.accept = $scope.accept ? $scope.accept : 'image/*';
|
|
795
|
+
$scope.viewOnly = $scope.view === undefined ? false : true;
|
|
1289
796
|
|
|
1290
797
|
let input = $(element).find('input')[0];
|
|
1291
798
|
let img = $(element).find('img')[0];
|
|
1292
799
|
let progress = $(element).find('.progress')[0];
|
|
1293
800
|
$(progress).hide();
|
|
1294
801
|
|
|
1295
|
-
if (
|
|
802
|
+
if (!$scope.viewOnly) {
|
|
1296
803
|
img.addEventListener('click', function () {
|
|
1297
804
|
input.click();
|
|
1298
805
|
});
|
|
@@ -1316,6 +823,11 @@ app.directive('iImage', [
|
|
|
1316
823
|
|
|
1317
824
|
if (image) {
|
|
1318
825
|
$scope.ngModel = image;
|
|
826
|
+
if ($scope.ngChange) {
|
|
827
|
+
$timeout(() => {
|
|
828
|
+
$scope.ngChange();
|
|
829
|
+
}, 200);
|
|
830
|
+
}
|
|
1319
831
|
}
|
|
1320
832
|
}
|
|
1321
833
|
);
|
|
@@ -1327,39 +839,27 @@ app.directive('iImage', [
|
|
|
1327
839
|
}
|
|
1328
840
|
});
|
|
1329
841
|
},
|
|
1330
|
-
template:
|
|
1331
|
-
<div class=" text-center pointer">
|
|
1332
|
-
<input class="hidden" type="file" name="fileToUpload" accept="image/*"/>
|
|
1333
|
-
<img class="rounded" ng-src="{{ngModel.url}}" ngClick="ngClick()" onerror="this.src='/images/no.jpg'" />
|
|
1334
|
-
<div class="progress row">
|
|
1335
|
-
<div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="100" style="width: {{value}}%"></div>
|
|
1336
|
-
</div>
|
|
1337
|
-
</div>
|
|
1338
|
-
`,
|
|
842
|
+
template: `/*##client-side/directive/i-image.html*/`,
|
|
1339
843
|
};
|
|
1340
844
|
},
|
|
1341
845
|
]);
|
|
1342
|
-
|
|
1343
846
|
app.directive('iUpload', [
|
|
1344
847
|
'$interval',
|
|
1345
848
|
'isite',
|
|
1346
849
|
function ($interval, isite) {
|
|
1347
850
|
return {
|
|
1348
851
|
restrict: 'E',
|
|
1349
|
-
required: 'ngModel',
|
|
1350
852
|
scope: {
|
|
1351
853
|
label: '@',
|
|
1352
854
|
api: '@',
|
|
1353
855
|
type: '@',
|
|
1354
|
-
|
|
856
|
+
view: '@',
|
|
1355
857
|
ngClick: '&',
|
|
1356
858
|
onUploaded: '&',
|
|
1357
859
|
},
|
|
1358
|
-
link: function (scope, element, attrs, ctrl) {
|
|
1359
|
-
scope.type = scope.type || 'bg-green';
|
|
1360
|
-
|
|
860
|
+
link: function ($scope, element, attrs, ctrl) {
|
|
1361
861
|
let input = $(element).find('input')[0];
|
|
1362
|
-
let a = $(element).find('
|
|
862
|
+
let a = $(element).find('button')[0];
|
|
1363
863
|
let progress = $(element).find('progress')[0];
|
|
1364
864
|
$(progress).hide();
|
|
1365
865
|
|
|
@@ -1370,180 +870,28 @@ app.directive('iUpload', [
|
|
|
1370
870
|
}
|
|
1371
871
|
|
|
1372
872
|
input.addEventListener('change', function () {
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
873
|
+
if ($scope.api) {
|
|
874
|
+
isite.upload(
|
|
875
|
+
this.files,
|
|
876
|
+
{
|
|
877
|
+
api: $scope.api,
|
|
878
|
+
},
|
|
879
|
+
(err, file, e) => {
|
|
880
|
+
if (e) {
|
|
881
|
+
$(progress).show();
|
|
882
|
+
progress.value = e.loaded;
|
|
883
|
+
progress.max = e.total;
|
|
884
|
+
}
|
|
1384
885
|
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
886
|
+
if (file) {
|
|
887
|
+
$scope.onUploaded(file);
|
|
888
|
+
}
|
|
1388
889
|
}
|
|
1389
|
-
|
|
1390
|
-
);
|
|
1391
|
-
});
|
|
1392
|
-
|
|
1393
|
-
scope.$watch('ngModel', (ngModel) => {
|
|
1394
|
-
if (ngModel) {
|
|
1395
|
-
a.setAttribute('url', ngModel);
|
|
890
|
+
);
|
|
1396
891
|
}
|
|
1397
892
|
});
|
|
1398
893
|
},
|
|
1399
|
-
template:
|
|
1400
|
-
<form class="form text-center pointer">
|
|
1401
|
-
<input class="hidden" type="file" name="file" />
|
|
1402
|
-
<a class="btn {{type}}" ngClick="ngClick()" url="{{ngModel}}"> {{label}} </a>
|
|
1403
|
-
<progress class="row"></progress>
|
|
1404
|
-
</form>
|
|
1405
|
-
`,
|
|
1406
|
-
};
|
|
1407
|
-
},
|
|
1408
|
-
]);
|
|
1409
|
-
|
|
1410
|
-
app.directive('iFiles', [
|
|
1411
|
-
'$interval',
|
|
1412
|
-
'isite',
|
|
1413
|
-
function ($interval, isite) {
|
|
1414
|
-
return {
|
|
1415
|
-
restrict: 'E',
|
|
1416
|
-
required: 'ngModel',
|
|
1417
|
-
scope: {
|
|
1418
|
-
category: '@',
|
|
1419
|
-
label: '@',
|
|
1420
|
-
ngModel: '=',
|
|
1421
|
-
},
|
|
1422
|
-
link: function (scope, element, attrs, ctrl) {
|
|
1423
|
-
if (attrs.view === '') {
|
|
1424
|
-
scope.viewOnly = !0;
|
|
1425
|
-
}
|
|
1426
|
-
|
|
1427
|
-
let progress = $(element).find('progress')[0];
|
|
1428
|
-
|
|
1429
|
-
scope.category = scope.category || 'default';
|
|
1430
|
-
scope.id = Math.random().toString().replace('.', '_');
|
|
1431
|
-
scope.deleteFile = function (file) {
|
|
1432
|
-
isite.deleteFile(file, () => {
|
|
1433
|
-
for (let i = 0; i < scope.ngModel.length; i++) {
|
|
1434
|
-
let f = scope.ngModel[i];
|
|
1435
|
-
if (f.url === file.url) {
|
|
1436
|
-
scope.ngModel.splice(i, 1);
|
|
1437
|
-
return;
|
|
1438
|
-
}
|
|
1439
|
-
}
|
|
1440
|
-
});
|
|
1441
|
-
};
|
|
1442
|
-
|
|
1443
|
-
let setEvent = !1;
|
|
1444
|
-
$interval(() => {
|
|
1445
|
-
if (setEvent) {
|
|
1446
|
-
return;
|
|
1447
|
-
}
|
|
1448
|
-
|
|
1449
|
-
if (attrs.view !== '') {
|
|
1450
|
-
let btn = document.querySelector('#btn_' + scope.id);
|
|
1451
|
-
if (btn) {
|
|
1452
|
-
setEvent = !0;
|
|
1453
|
-
btn.addEventListener('click', function () {
|
|
1454
|
-
document.querySelector('#input_' + scope.id).click();
|
|
1455
|
-
});
|
|
1456
|
-
}
|
|
1457
|
-
|
|
1458
|
-
let input = document.querySelector('#input_' + scope.id);
|
|
1459
|
-
if (input) {
|
|
1460
|
-
input.addEventListener('change', function () {
|
|
1461
|
-
isite.uploadFile(
|
|
1462
|
-
this.files,
|
|
1463
|
-
{
|
|
1464
|
-
category: scope.category,
|
|
1465
|
-
},
|
|
1466
|
-
(err, file, e) => {
|
|
1467
|
-
if (e) {
|
|
1468
|
-
$(progress).show();
|
|
1469
|
-
progress.value = e.loaded;
|
|
1470
|
-
progress.max = e.total;
|
|
1471
|
-
}
|
|
1472
|
-
|
|
1473
|
-
if (file) {
|
|
1474
|
-
if (typeof scope.ngModel === 'undefined') {
|
|
1475
|
-
scope.ngModel = [];
|
|
1476
|
-
}
|
|
1477
|
-
scope.ngModel.push(file);
|
|
1478
|
-
}
|
|
1479
|
-
}
|
|
1480
|
-
);
|
|
1481
|
-
});
|
|
1482
|
-
}
|
|
1483
|
-
} else {
|
|
1484
|
-
setEvent = !0;
|
|
1485
|
-
}
|
|
1486
|
-
}, 500);
|
|
1487
|
-
},
|
|
1488
|
-
template: `
|
|
1489
|
-
<div class="files">
|
|
1490
|
-
<label> {{label}} </label>
|
|
1491
|
-
<form ng-if="viewOnly !== !0" id="img_{{id}}" class="form text-center pointer">
|
|
1492
|
-
<input id="input_{{id}}" class="hidden" type="file" name="file" />
|
|
1493
|
-
<a id="btn_{{id}}" class="btn bg-green"> <i class="fa fa-upload white"></i> </a>
|
|
1494
|
-
</form>
|
|
1495
|
-
<progress class="row"></progress>
|
|
1496
|
-
<div class="padding">
|
|
1497
|
-
|
|
1498
|
-
<div class="row padding" ng-repeat="f in ngModel">
|
|
1499
|
-
<h2>
|
|
1500
|
-
<a class="btn default bg-blue" href="{{f.url}}"> <i class="fa fa-2x fa-download white"></i> </a>
|
|
1501
|
-
<a ng-if="viewOnly !== !0" class="btn default bg-red" ng-click="deleteFile(f)"> <i class="fa fa-trash white"></i> </a>
|
|
1502
|
-
<span> {{f.name}} </span>
|
|
1503
|
-
</h2>
|
|
1504
|
-
</div>
|
|
1505
|
-
</div>
|
|
1506
|
-
</div>
|
|
1507
|
-
|
|
1508
|
-
`,
|
|
1509
|
-
};
|
|
1510
|
-
},
|
|
1511
|
-
]);
|
|
1512
|
-
|
|
1513
|
-
app.directive('iDrag', [
|
|
1514
|
-
'$document',
|
|
1515
|
-
function ($document) {
|
|
1516
|
-
return function (scope, element, attr) {
|
|
1517
|
-
var startX = 0,
|
|
1518
|
-
startY = 0,
|
|
1519
|
-
x = 0,
|
|
1520
|
-
y = 0;
|
|
1521
|
-
|
|
1522
|
-
element.css({
|
|
1523
|
-
position: 'relative',
|
|
1524
|
-
});
|
|
1525
|
-
|
|
1526
|
-
element.on('mousedown', function (event) {
|
|
1527
|
-
event.preventDefault();
|
|
1528
|
-
startX = event.screenX - x;
|
|
1529
|
-
startY = event.screenY - y;
|
|
1530
|
-
$document.on('mousemove', mousemove);
|
|
1531
|
-
$document.on('mouseup', mouseup);
|
|
1532
|
-
});
|
|
1533
|
-
|
|
1534
|
-
function mousemove(event) {
|
|
1535
|
-
y = event.screenY - startY;
|
|
1536
|
-
x = event.screenX - startX;
|
|
1537
|
-
element.css({
|
|
1538
|
-
top: y + 'px',
|
|
1539
|
-
left: x + 'px',
|
|
1540
|
-
});
|
|
1541
|
-
}
|
|
1542
|
-
|
|
1543
|
-
function mouseup() {
|
|
1544
|
-
$document.off('mousemove', mousemove);
|
|
1545
|
-
$document.off('mouseup', mouseup);
|
|
1546
|
-
}
|
|
894
|
+
template: `/*##client-side/directive/i-upload.html*/`,
|
|
1547
895
|
};
|
|
1548
896
|
},
|
|
1549
897
|
]);
|
|
@@ -1661,23 +1009,7 @@ app.directive('iTreeview', [
|
|
|
1661
1009
|
}
|
|
1662
1010
|
});
|
|
1663
1011
|
},
|
|
1664
|
-
template:
|
|
1665
|
-
<div class="treeview">
|
|
1666
|
-
<ul >
|
|
1667
|
-
<li ng-dblclick="$event.preventDefault();$event.stopPropagation();source.$actions = !0" ng-mouseleave="source.$actions = !1">
|
|
1668
|
-
|
|
1669
|
-
<i ng-hide="openTree" class="fa fa-folder"></i> <i ng-show="openTree" class="fa fa-folder"></i>
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
<span ng-click="openTree = !openTree" class="title"> {{label}} <small class="display"> [ {{ngModel.v_display}} ] </small> </span>
|
|
1673
|
-
<div class="actions" ng-show="source.$actions === !0">
|
|
1674
|
-
<i-button type="add default" ng-click="ngClick($event , ngModel);ngNode($event , ngModel)"></i-button>
|
|
1675
|
-
</div>
|
|
1676
|
-
<i-treenode display="{{display}}" ng-click="ngClick($event)" ng-add="ngAdd()" ng-edit="ngEdit()" ng-delete="ngDelete()" ng-show="openTree" ng-model="ngModel" nodes="v_nodes" ></i-treenode>
|
|
1677
|
-
</li>
|
|
1678
|
-
</ul>
|
|
1679
|
-
</div>
|
|
1680
|
-
`,
|
|
1012
|
+
template: `/*##client-side/directive/i-treeview.html*/`,
|
|
1681
1013
|
};
|
|
1682
1014
|
},
|
|
1683
1015
|
]);
|
|
@@ -1782,30 +1114,7 @@ app.directive('iTreenode', [
|
|
|
1782
1114
|
node.$selected = !0;
|
|
1783
1115
|
};
|
|
1784
1116
|
},
|
|
1785
|
-
template:
|
|
1786
|
-
<div class="treenode">
|
|
1787
|
-
<ul >
|
|
1788
|
-
<li ng-repeat="node in nodes" >
|
|
1789
|
-
<div class="row" ng-dblclick="$event.preventDefault();$event.stopPropagation();node.$actions = !0;source.$actions = !1" ng-mouseleave="node.$actions = !1">
|
|
1790
|
-
<span ng-show="node.nodes.length > 0" ng-click="node.$expand = !node.$expand;">
|
|
1791
|
-
<i ng-hide="node.$expand" class="fa fa-caret-left"></i> <i ng-show="node.$expand" class="fa fa-caret-down"></i>
|
|
1792
|
-
</span>
|
|
1793
|
-
<span ng-hide="node.nodes.length > 0" >
|
|
1794
|
-
<i class="fa fa-file"></i>
|
|
1795
|
-
</span>
|
|
1796
|
-
|
|
1797
|
-
<span class="text" ng-class="{'selected' : node.$selected == !0}" ng-click="ngClick($event , node);node.$expand = !node.$expand;selected(node);updateModal(node)" > {{node[display]}} </span>
|
|
1798
|
-
<div class="actions" ng-show="node.$actions === !0">
|
|
1799
|
-
<i-button type="add default" ng-click="ngAdd(node)"></i-button>
|
|
1800
|
-
<i-button type="edit default" ng-click="ngEdit(node)"></i-button>
|
|
1801
|
-
<i-button type="delete default" ng-click="ngDelete(node)"></i-button>
|
|
1802
|
-
</div>
|
|
1803
|
-
</div>
|
|
1804
|
-
<i-treenode display="{{display}}" ng-click="ngClick($event)" ng-add="ngAdd()" ng-edit="ngEdit()" ng-delete="ngDelete()" ng-show="node.$expand" ng-model="ngModel" nodes="node.nodes" nodes="node.nodes"></i-treenode>
|
|
1805
|
-
</li>
|
|
1806
|
-
</ul>
|
|
1807
|
-
</div>
|
|
1808
|
-
`,
|
|
1117
|
+
template: `/*##client-side/directive/i-treenode.html*/`,
|
|
1809
1118
|
};
|
|
1810
1119
|
},
|
|
1811
1120
|
]);
|