@oat-sa/tao-core-ui 3.19.2 → 3.20.0
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/dist/datatable.js +5 -4
- package/dist/dialog.js +2 -2
- package/dist/feedback.js +32 -4
- package/dist/login/login.js +2 -2
- package/dist/resource/selector.js +2 -2
- package/dist/resourcemgr.js +2 -2
- package/package.json +2 -2
- package/src/datatable/tpl/layout.tpl +2 -2
- package/src/dialog/tpl/buttons.tpl +1 -1
- package/src/feedback.js +38 -3
- package/src/login/tpl/login.tpl +3 -1
- package/src/resource/tpl/selector.tpl +1 -1
- package/src/resourcemgr/tpl/layout.tpl +1 -1
- package/dist/rubyHtml.js +0 -1633
- package/src/rubyHtml.js +0 -153
package/dist/datatable.js
CHANGED
|
@@ -228,7 +228,7 @@ define(['jquery', 'lodash', 'i18n', 'core/pluginifier', 'handlebars', 'lib/handl
|
|
|
228
228
|
buffer += ">";
|
|
229
229
|
if (helper = helpers.label) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
230
230
|
else { helper = (depth0 && depth0.label); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
231
|
-
buffer +=
|
|
231
|
+
if(stack1 || stack1 === 0) { buffer += stack1; }
|
|
232
232
|
stack1 = helpers['if'].call(depth0, (depth0 && depth0.alias), {hash:{},inverse:self.noop,fn:self.program(51, program51, data),data:data});
|
|
233
233
|
if(stack1 || stack1 === 0) { buffer += stack1; }
|
|
234
234
|
stack1 = helpers['if'].call(depth0, (depth0 && depth0.comment), {hash:{},inverse:self.noop,fn:self.program(53, program53, data),data:data});
|
|
@@ -563,9 +563,10 @@ define(['jquery', 'lodash', 'i18n', 'core/pluginifier', 'handlebars', 'lib/handl
|
|
|
563
563
|
buffer += ">\n ";
|
|
564
564
|
stack1 = helpers['if'].call(depth0, (depth2 && depth2.icon), {hash:{},inverse:self.noop,fn:self.programWithDepth(75, program75, data, depth2),data:data});
|
|
565
565
|
if(stack1 || stack1 === 0) { buffer += stack1; }
|
|
566
|
-
buffer += "\n "
|
|
567
|
-
|
|
568
|
-
|
|
566
|
+
buffer += "\n ";
|
|
567
|
+
stack1 = ((stack1 = (depth2 && depth2.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1);
|
|
568
|
+
if(stack1 || stack1 === 0) { buffer += stack1; }
|
|
569
|
+
buffer += "\n </button>\n ";
|
|
569
570
|
return buffer;
|
|
570
571
|
}
|
|
571
572
|
|
package/dist/dialog.js
CHANGED
|
@@ -118,8 +118,8 @@ define(['jquery', 'lodash', 'i18n', 'handlebars', 'lib/handlebars/helpers', 'ui/
|
|
|
118
118
|
buffer += "\n <span class=\"label\">";
|
|
119
119
|
if (helper = helpers.label) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
120
120
|
else { helper = (depth0 && depth0.label); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
121
|
-
buffer +=
|
|
122
|
-
|
|
121
|
+
if(stack1 || stack1 === 0) { buffer += stack1; }
|
|
122
|
+
buffer += "</span>\n </button>\n";
|
|
123
123
|
return buffer;
|
|
124
124
|
}
|
|
125
125
|
function program2(depth0,data) {
|
package/dist/feedback.js
CHANGED
|
@@ -96,6 +96,32 @@ define(['jquery', 'lodash', 'core/format', 'ui/component', 'util/wrapLongWords',
|
|
|
96
96
|
//change the display (absolute or in the flow)
|
|
97
97
|
popup: true
|
|
98
98
|
};
|
|
99
|
+
var feedbackFactory;
|
|
100
|
+
const RUBY_HTML = /<\s*(?:ruby|rt|rp|rb)\b/i;
|
|
101
|
+
const RUBY_BLOCK = /<ruby\b[^>]*>[\s\S]*?<\/ruby>/gi;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* HTML-encodes a string while preserving ruby annotation blocks.
|
|
105
|
+
*
|
|
106
|
+
* @param {String} str
|
|
107
|
+
* @returns {String}
|
|
108
|
+
*/
|
|
109
|
+
function encodeHtmlPreservingRuby(str) {
|
|
110
|
+
var parts = [];
|
|
111
|
+
var rubies = [];
|
|
112
|
+
var lastIndex = 0;
|
|
113
|
+
var match;
|
|
114
|
+
RUBY_BLOCK.lastIndex = 0;
|
|
115
|
+
while ((match = RUBY_BLOCK.exec(str)) !== null) {
|
|
116
|
+
parts.push(str.slice(lastIndex, match.index));
|
|
117
|
+
rubies.push(match[0]);
|
|
118
|
+
lastIndex = match.index + match[0].length;
|
|
119
|
+
}
|
|
120
|
+
parts.push(str.slice(lastIndex));
|
|
121
|
+
return parts.map(function (part, index) {
|
|
122
|
+
return encode.html(part) + (rubies[index] || '');
|
|
123
|
+
}).join('');
|
|
124
|
+
}
|
|
99
125
|
|
|
100
126
|
/**
|
|
101
127
|
* Creates a feedback object.
|
|
@@ -110,7 +136,7 @@ define(['jquery', 'lodash', 'core/format', 'ui/component', 'util/wrapLongWords',
|
|
|
110
136
|
* @returns {feedback} the feedback object
|
|
111
137
|
* @throws {TypeError} without a container
|
|
112
138
|
*/
|
|
113
|
-
|
|
139
|
+
feedbackFactory = function ($container, config) {
|
|
114
140
|
var feedback;
|
|
115
141
|
const codeEnter = 13;
|
|
116
142
|
const codeSpace = 32;
|
|
@@ -146,14 +172,15 @@ define(['jquery', 'lodash', 'core/format', 'ui/component', 'util/wrapLongWords',
|
|
|
146
172
|
}
|
|
147
173
|
this.config = _.defaults(options || {}, this.config);
|
|
148
174
|
this.config.level = level;
|
|
175
|
+
const hasRubyHtml = typeof displayedMessage === 'string' && RUBY_HTML.test(displayedMessage);
|
|
149
176
|
|
|
150
177
|
// encode plain text string to html
|
|
151
178
|
if (this.config.encodeHtml) {
|
|
152
|
-
displayedMessage = encode.html(displayedMessage);
|
|
179
|
+
displayedMessage = hasRubyHtml ? encodeHtmlPreservingRuby(displayedMessage) : encode.html(displayedMessage);
|
|
153
180
|
}
|
|
154
181
|
|
|
155
182
|
// wrap long words
|
|
156
|
-
if (this.config.wrapLongWordsAfter) {
|
|
183
|
+
if (this.config.wrapLongWordsAfter && !hasRubyHtml) {
|
|
157
184
|
displayedMessage = wrapLongWords(displayedMessage, this.config.wrapLongWordsAfter);
|
|
158
185
|
}
|
|
159
186
|
|
|
@@ -285,7 +312,8 @@ define(['jquery', 'lodash', 'core/format', 'ui/component', 'util/wrapLongWords',
|
|
|
285
312
|
_.pull(currents, this);
|
|
286
313
|
}).init(config);
|
|
287
314
|
};
|
|
315
|
+
var feedbackFactory$1 = feedbackFactory;
|
|
288
316
|
|
|
289
|
-
return feedbackFactory;
|
|
317
|
+
return feedbackFactory$1;
|
|
290
318
|
|
|
291
319
|
});
|
package/dist/login/login.js
CHANGED
|
@@ -86,9 +86,9 @@ define(['jquery', 'lodash', 'i18n', 'ui/component', 'ui/feedback', 'util/url', '
|
|
|
86
86
|
buffer += " aria-required=\"true\">\n ";
|
|
87
87
|
stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.fieldMessages)),stack1 == null || stack1 === false ? stack1 : stack1.password), {hash:{},inverse:self.noop,fn:self.program(7, program7, data),data:data});
|
|
88
88
|
if(stack1 || stack1 === 0) { buffer += stack1; }
|
|
89
|
-
buffer += "\n </div>\n <div class=\"form-toolbar\"
|
|
89
|
+
buffer += "\n </div>\n <div class=\"form-toolbar\">\n <button type=\"submit\" id=\"connect\" name=\"connect\" disabled=\"disabled\" class=\"disabled\">"
|
|
90
90
|
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Log in", options) : helperMissing.call(depth0, "__", "Log in", options)))
|
|
91
|
-
+ "
|
|
91
|
+
+ "</button>\n </div>\n </form>\n</div>\n";
|
|
92
92
|
return buffer;
|
|
93
93
|
});
|
|
94
94
|
function loginTpl(data, options, asString) {
|
|
@@ -124,8 +124,8 @@ define(['jquery', 'lodash', 'i18n', 'ui/component', 'ui/hider', 'ui/class/select
|
|
|
124
124
|
+ " ";
|
|
125
125
|
if (helper = helpers.type) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
126
126
|
else { helper = (depth0 && depth0.type); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
127
|
-
buffer +=
|
|
128
|
-
|
|
127
|
+
if(stack1 || stack1 === 0) { buffer += stack1; }
|
|
128
|
+
buffer += " : </span><span class=\"selected-num\">0</span>\n </div>\n </footer>\n ";
|
|
129
129
|
return buffer;
|
|
130
130
|
}
|
|
131
131
|
|
package/dist/resourcemgr.js
CHANGED
|
@@ -32,8 +32,8 @@ define(['jquery', 'lodash', 'core/pluginifier', 'ui/resourcemgr/fileBrowser', 'u
|
|
|
32
32
|
buffer += "\">\n\n <h2>";
|
|
33
33
|
if (helper = helpers.title) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
|
34
34
|
else { helper = (depth0 && depth0.title); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
|
35
|
-
buffer +=
|
|
36
|
-
|
|
35
|
+
if(stack1 || stack1 === 0) { buffer += stack1; }
|
|
36
|
+
buffer += "</h2>\n\n <div class=\"file-wrapper\">\n\n <!-- left section: items selection -->\n <section class=\"file-browser\">\n <h1>"
|
|
37
37
|
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Browse resources", options) : helperMissing.call(depth0, "__", "Browse resources", options)))
|
|
38
38
|
+ "</h1>\n <div class=\"file-browser-wrapper\"></div>\n </section>\n\n <!-- test editor -->\n <section class=\"file-selector\">\n\n <h1>\n <div class=\"title lft\"></div>\n <div class=\"upload-switcher rgt\">\n <a href=\"#\" class=\"btn-info small upload hidden\"><span class=\"icon-add\"></span>"
|
|
39
39
|
+ escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Add file(s)", options) : helperMissing.call(depth0, "__", "Add file(s)", options)))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oat-sa/tao-core-ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.20.0",
|
|
4
4
|
"displayName": "TAO Core UI",
|
|
5
5
|
"description": "UI libraries of TAO",
|
|
6
6
|
"scripts": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@oat-sa/prettier-config": "^0.1.1",
|
|
53
53
|
"@oat-sa/rollup-plugin-wildcard-external": "^1.0.0",
|
|
54
54
|
"@oat-sa/tao-calculator": "^0.6.2",
|
|
55
|
-
"@oat-sa/tao-core-libs": "^1.
|
|
55
|
+
"@oat-sa/tao-core-libs": "^1.2.1",
|
|
56
56
|
"@oat-sa/tao-core-sdk": "^3.0.0",
|
|
57
57
|
"@oat-sa/tao-core-shared-libs": "^1.6.1",
|
|
58
58
|
"@oat-sa/tao-qunit-testrunner": "^2.0.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
data-sort-by="{{#if sortId}}{{sortId}}{{else}}{{id}}{{/if}}"
|
|
65
65
|
{{#if sorttype}}data-sort-type="{{sorttype}}"{{/if}}
|
|
66
66
|
tabindex="0"
|
|
67
|
-
{{/if}}>{{label}}{{#if alias}} <span class="alias">({{alias}})</span>{{/if}}{{#if comment}} <span class="comment">/ {{comment}}</span>{{/if}}</div>
|
|
67
|
+
{{/if}}>{{{label}}}{{#if alias}} <span class="alias">({{alias}})</span>{{/if}}{{#if comment}} <span class="comment">/ {{comment}}</span>{{/if}}</div>
|
|
68
68
|
{{#if filterable}}
|
|
69
69
|
<aside data-column="{{id}}" class="filter column
|
|
70
70
|
{{#if customFilter}} customInput" >
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
{{#if ../../title}} title="{{../../../title}}"{{/if}}
|
|
133
133
|
{{#if ../../disabled}} disabled="disabled"{{/if}}>
|
|
134
134
|
{{#if ../../icon}}<span class="icon-{{../../../icon}}"></span>{{/if}}
|
|
135
|
-
{{../../label}}
|
|
135
|
+
{{{../../label}}}
|
|
136
136
|
</button>
|
|
137
137
|
{{/unless}}
|
|
138
138
|
{{/with}}
|
package/src/feedback.js
CHANGED
|
@@ -70,6 +70,36 @@ var defaultOptions = {
|
|
|
70
70
|
popup: true
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
+
var feedbackFactory;
|
|
74
|
+
|
|
75
|
+
const RUBY_HTML = /<\s*(?:ruby|rt|rp|rb)\b/i;
|
|
76
|
+
const RUBY_BLOCK = /<ruby\b[^>]*>[\s\S]*?<\/ruby>/gi;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* HTML-encodes a string while preserving ruby annotation blocks.
|
|
80
|
+
*
|
|
81
|
+
* @param {String} str
|
|
82
|
+
* @returns {String}
|
|
83
|
+
*/
|
|
84
|
+
function encodeHtmlPreservingRuby(str) {
|
|
85
|
+
var parts = [];
|
|
86
|
+
var rubies = [];
|
|
87
|
+
var lastIndex = 0;
|
|
88
|
+
var match;
|
|
89
|
+
|
|
90
|
+
RUBY_BLOCK.lastIndex = 0;
|
|
91
|
+
while ((match = RUBY_BLOCK.exec(str)) !== null) {
|
|
92
|
+
parts.push(str.slice(lastIndex, match.index));
|
|
93
|
+
rubies.push(match[0]);
|
|
94
|
+
lastIndex = match.index + match[0].length;
|
|
95
|
+
}
|
|
96
|
+
parts.push(str.slice(lastIndex));
|
|
97
|
+
|
|
98
|
+
return parts.map(function(part, index) {
|
|
99
|
+
return encode.html(part) + (rubies[index] || '');
|
|
100
|
+
}).join('');
|
|
101
|
+
}
|
|
102
|
+
|
|
73
103
|
/**
|
|
74
104
|
* Creates a feedback object.
|
|
75
105
|
*
|
|
@@ -83,7 +113,7 @@ var defaultOptions = {
|
|
|
83
113
|
* @returns {feedback} the feedback object
|
|
84
114
|
* @throws {TypeError} without a container
|
|
85
115
|
*/
|
|
86
|
-
|
|
116
|
+
feedbackFactory = function ($container, config) {
|
|
87
117
|
var feedback;
|
|
88
118
|
const codeEnter = 13;
|
|
89
119
|
const codeSpace = 32;
|
|
@@ -124,13 +154,18 @@ var feedbackFactory = function feedbackFactory($container, config) {
|
|
|
124
154
|
this.config = _.defaults(options || {}, this.config);
|
|
125
155
|
this.config.level = level;
|
|
126
156
|
|
|
157
|
+
const hasRubyHtml =
|
|
158
|
+
typeof displayedMessage === 'string' && RUBY_HTML.test(displayedMessage);
|
|
159
|
+
|
|
127
160
|
// encode plain text string to html
|
|
128
161
|
if (this.config.encodeHtml) {
|
|
129
|
-
displayedMessage =
|
|
162
|
+
displayedMessage = hasRubyHtml
|
|
163
|
+
? encodeHtmlPreservingRuby(displayedMessage)
|
|
164
|
+
: encode.html(displayedMessage);
|
|
130
165
|
}
|
|
131
166
|
|
|
132
167
|
// wrap long words
|
|
133
|
-
if (this.config.wrapLongWordsAfter) {
|
|
168
|
+
if (this.config.wrapLongWordsAfter && !hasRubyHtml) {
|
|
134
169
|
displayedMessage = wrapLongWords(displayedMessage, this.config.wrapLongWordsAfter);
|
|
135
170
|
}
|
|
136
171
|
|
package/src/login/tpl/login.tpl
CHANGED
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
</div>
|
|
25
25
|
{{/if}}
|
|
26
26
|
</div>
|
|
27
|
-
<div class="form-toolbar"
|
|
27
|
+
<div class="form-toolbar">
|
|
28
|
+
<button type="submit" id="connect" name="connect" disabled="disabled" class="disabled">{{__ "Log in"}}</button>
|
|
29
|
+
</div>
|
|
28
30
|
</form>
|
|
29
31
|
</div>
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
{{#if multiple}}
|
|
40
40
|
<footer>
|
|
41
41
|
<div class="get-selection">
|
|
42
|
-
<span>{{__ 'Selected'}} {{type}} : </span><span class="selected-num">0</span>
|
|
42
|
+
<span>{{__ 'Selected'}} {{{ type }}} : </span><span class="selected-num">0</span>
|
|
43
43
|
</div>
|
|
44
44
|
</footer>
|
|
45
45
|
{{/if}}
|