isite 2023.8.10 → 2023.8.11

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.
@@ -108,6 +108,14 @@ module.exports = function (site) {
108
108
  res.render('client-side/words.html', {}, { parser: 'html css js', public: true });
109
109
  }
110
110
  );
111
+ site.get(
112
+ {
113
+ name: '/x-words-old',
114
+ },
115
+ (req, res) => {
116
+ res.render('client-side/words-old.html', {}, { parser: 'html css js', public: true });
117
+ }
118
+ );
111
119
 
112
120
  site.get({
113
121
  name: '/x-css',
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en" ng-app="myApp">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Document</title>
7
+ <link rel="stylesheet" href="/x-css/bootstrap-5-support.css" />
8
+ </head>
9
+ <body ng-controller="mainController" class="container loaded">
10
+ <h1 class="center">##word.counts## : {{words.length}}</h1>
11
+ <div class="row padding margin border">
12
+ <div class="col9">
13
+ <i-control ng-model="nameSearch" label="Search Words"></i-control>
14
+ </div>
15
+ <div class="col3">
16
+ <i-button type="save" ng-click="saveWords()" label="Save All Words"></i-button>
17
+ </div>
18
+ </div>
19
+
20
+ <table class="table">
21
+ <tr>
22
+ <th>ID</th>
23
+ <th>Name</th>
24
+ <th>En</th>
25
+ <th>Ar</th>
26
+ </tr>
27
+ <tr ng-repeat="word in words | filter:nameSearch">
28
+ <td>{{$index+1}}</td>
29
+ <td>{{word.name}}</td>
30
+ <td>
31
+ <i-control ng-model="word.en"></i-control>
32
+ </td>
33
+ <td><i-control ng-model="word.ar"></i-control></td>
34
+ </tr>
35
+ </table>
36
+
37
+ <script src="/x-js/bootstrap-5-support.js"></script>
38
+ <script>
39
+ site.connectScope({}, ($scope, $http) => {
40
+ $scope.name = 'Amr Barakat';
41
+ $scope.loadWords = function () {
42
+ $http({
43
+ method: 'get',
44
+ url: '/x-api/words',
45
+ }).then(function (response) {
46
+ if (response.data.done) {
47
+ $scope.words = response.data.words;
48
+ }
49
+ });
50
+ };
51
+ $scope.saveWords = function () {
52
+ $http({
53
+ method: 'POST',
54
+ url: '/x-api/words/save',
55
+ data: $scope.words,
56
+ }).then(function (response) {
57
+ if (response.data.done) {
58
+ console.log(response.data);
59
+ }
60
+ });
61
+ };
62
+ $scope.loadWords();
63
+ });
64
+ </script>
65
+ </body>
66
+ </html>
@@ -25,7 +25,5 @@
25
25
  {"name" : "file_name" , "en" : "File Name" , "ar":"أسم الملف"},
26
26
  {"name" : "ar_lang" , "en" : "اللغة العربية" , "ar":"اللغة العربية"},
27
27
  {"name" : "en_lang" , "en" : "English" , "ar":"English"},
28
- {"name" : "brand_title" , "en" : "Private Site" , "ar":"موقع شخصى"},
29
- {"name" : "brand_tag" , "en" : "Just Template" , "ar":"تصميم مؤقت"},
30
28
  {"name" : "close" , "en" : "Close" , "ar":"أغلاق"}
31
29
  ]
package/lib/words.js CHANGED
@@ -27,7 +27,14 @@ module.exports = function init(____0) {
27
27
  }
28
28
  };
29
29
 
30
- app.add = app.set = function (word) {
30
+ app.add = function (word) {
31
+ let index = app.list.findIndex((w) => w.name === word.name);
32
+ if (index === -1) {
33
+ app.list.push(word);
34
+ }
35
+ return word;
36
+ };
37
+ app.set = function (word) {
31
38
  let index = app.list.findIndex((w) => w.name === word.name);
32
39
  if (index === -1) {
33
40
  app.list.push(word);
@@ -36,7 +43,6 @@ module.exports = function init(____0) {
36
43
  }
37
44
  return word;
38
45
  };
39
-
40
46
  app.addList = function (list) {
41
47
  if (Array.isArray(list)) {
42
48
  list.forEach((doc) => {
@@ -134,7 +134,6 @@ function setOptions(_options, ____0) {
134
134
  } else {
135
135
  userOptions = {};
136
136
  }
137
- console.log('User Template From .options.json', userOptions);
138
137
  }
139
138
  } catch (error) {
140
139
  console.error(error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isite",
3
- "version": "2023.08.10",
3
+ "version": "2023.08.11",
4
4
  "description": "Create Secure Multi-Language Web Site [Fast and Easy] ",
5
5
  "main": "index.js",
6
6
  "repository": {