Skip to content
This repository was archived by the owner on Jan 4, 2021. It is now read-only.

Commit a6e778f

Browse files
author
Francois-Xavier Gentilhomme
committed
[FIX] normalize lowercase attribute names
1 parent 444eca2 commit a6e778f

File tree

2 files changed

+31
-34
lines changed

2 files changed

+31
-34
lines changed

demo/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
host="[[ host ]]"
6161
applicationkey="[[ applicationKey ]]"
6262
hmackey="[[ hmacKey ]]"
63-
recognition-candidates="3"
64-
available-languages="{{ availableLanguages }}"
63+
recognitioncandidates="3"
64+
availablelanguages="{{ availableLanguages }}"
6565
language="{{ language }}">
6666
</myscript-text-web>
6767
</template>

myscript-text-web.html

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
applicationkey="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
1313
hmackey="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
1414
language="en_US"
15-
recognition-candidates="3">
15+
recognitioncandidates="3">
1616
</myscript-text-web>
1717
1818
@demo
@@ -48,7 +48,7 @@
4848
<template>
4949
<div class="resultField" hidden="[[ hideresult ]]">
5050
<template is="dom-repeat" id="candidateList" items="[[ candidates ]]" as="candidate">
51-
<span selected$="[[ _isSelected(candidate,textDocument) ]]" inner-h-t-m-l="[[ _getLabel(candidate,textDocument) ]]" on-tap="_select"></span>
51+
<span selected$="[[ _isSelected(candidate,textdocument) ]]" inner-h-t-m-l="[[ _getLabel(candidate,textdocument) ]]" on-tap="_select"></span>
5252
</template>
5353
</div>
5454
<myscript-common-element host="[[ host ]]"
@@ -58,10 +58,10 @@
5858
hmackey="[[ hmackey ]]"
5959
timeout="[[ timeout ]]"
6060
hidebuttons="[[ hidebuttons ]]"
61-
text-parameters="[[ _textParameters ]]"
62-
can-undo="{{ canundo }}"
63-
can-redo="{{ canredo }}"
64-
can-clear="{{ canclear }}"
61+
textparameters="[[ _textParameters ]]"
62+
canundo="{{ canundo }}"
63+
canredo="{{ canredo }}"
64+
canclear="{{ canclear }}"
6565
on-changed="_onChanged"
6666
on-success="_onSuccess"
6767
on-error="_onError">
@@ -179,7 +179,7 @@
179179
/**
180180
* The available recognition languages.
181181
*/
182-
availableLanguages: {
182+
availablelanguages: {
183183
type: Array,
184184
notify: true,
185185
readOnly: true,
@@ -188,53 +188,53 @@
188188
/**
189189
* @private
190190
*/
191-
resultDetail: {
191+
resultdetail: {
192192
type: String,
193193
value: MyScript.ResultDetail.TEXT
194194
},
195195
/**
196196
* @private
197197
*/
198-
inputMode: {
198+
inputmode: {
199199
type: String,
200200
value: MyScript.InputMode.CURSIVE,
201201
observer: '_inputModeChanged'
202202
},
203203
/**
204204
* The desired count of recognition candidates
205205
*/
206-
recognitionCandidates: {
206+
recognitioncandidates: {
207207
type: Number,
208208
value: 1
209209
},
210210
/**
211211
* @private
212212
*/
213-
predictionCandidates: {
213+
predictioncandidates: {
214214
type: Number,
215215
value: 0
216216
},
217217
/**
218218
* @private
219219
*/
220-
completionCandidates: {
220+
completioncandidates: {
221221
type: Number,
222222
value: 0
223223
},
224224
_textProperties: {
225225
type: Object,
226-
computed: '_computeTextProperties(resultDetail, recognitionCandidates, predictionCandidates, completionCandidates)'
226+
computed: '_computeTextProperties(resultdetail, recognitioncandidates, predictioncandidates, completioncandidates)'
227227
},
228228
_textParameters: {
229229
type: Object,
230-
computed: '_computeTextParameters(inputMode, language, resultDetail, _textProperties)'
230+
computed: '_computeTextParameters(inputmode, language, resultdetail, _textProperties)'
231231
},
232232
/**
233233
* The text recognition result document.
234234
* @private
235235
* @default {}
236236
*/
237-
textDocument: {
237+
textdocument: {
238238
type: Object,
239239
notify: true,
240240
value: new MyScript.TextDocument()
@@ -246,26 +246,26 @@
246246
type: Array,
247247
notify: true,
248248
readOnly: true,
249-
computed: '_computeCandidates(textDocument)'
249+
computed: '_computeCandidates(textdocument)'
250250
},
251251
/**
252252
* The selected recognition result candidate
253253
*/
254-
selectedCandidate: {
254+
selectedcandidate: {
255255
type: Object,
256256
notify: true,
257257
readOnly: true,
258-
computed: '_computeSelectedCandidate(candidates,textDocument)'
258+
computed: '_computeSelectedCandidate(candidates,textdocument)'
259259
},
260260
/**
261-
* The selected recognition result candidate label (same as selectedCandidate.label)
262-
* @deprecated Use selectedCandidate.label instead of firstcandidate
261+
* The selected recognition result candidate label (same as selectedcandidate.label)
262+
* @deprecated Use selectedcandidate.label instead of firstcandidate
263263
*/
264264
firstcandidate: {
265265
type: String,
266266
notify: true,
267267
readOnly: true,
268-
computed: '_computeFirstCandidate(selectedCandidate)'
268+
computed: '_computeFirstCandidate(selectedcandidate)'
269269
}
270270
},
271271
_clear: function () {
@@ -279,21 +279,18 @@
279279
this._myscriptCommonElement.redo();
280280
},
281281
/**
282-
* <b>Deprecated</b><br />
283282
* Clear the current document.
284283
*/
285284
delete: function () {
286285
this._clear();
287286
},
288287
/**
289-
* <b>Deprecated</b><br />
290288
* Undo the last action.
291289
*/
292290
undo: function () {
293291
this._undo();
294292
},
295293
/**
296-
* <b>Deprecated</b><br />
297294
* Redo the last action.
298295
*/
299296
redo: function () {
@@ -303,18 +300,18 @@
303300
* Get the list of available languages.
304301
*/
305302
getAvailableLanguageList: function () {
306-
this._myscriptCommonElement.getAvailableLanguages(this.inputMode);
303+
this._myscriptCommonElement.getAvailableLanguages(this.inputmode);
307304
},
308305
_onChanged: function (e) {
309306
this.fire(e.type, e.detail);
310307
},
311308
_onSuccess: function (e) {
312309
if (e.detail && e.detail.getTextDocument) {
313-
this.textDocument = e.detail.getTextDocument();
310+
this.textdocument = e.detail.getTextDocument();
314311
} else if (e.detail && (e.detail instanceof Array)) {
315-
this.availableLanguages = e.detail;
312+
this.availablelanguages = e.detail;
316313
} else {
317-
this.textDocument = new MyScript.TextDocument();
314+
this.textdocument = new MyScript.TextDocument();
318315
}
319316
this.fire(e.type, e.detail);
320317
this.fire('myscript-text-web-result', e.detail);
@@ -325,13 +322,13 @@
325322
ready: function () {
326323
this._myscriptCommonElement = this.querySelector('myscript-common-element');
327324
if (this.applicationkey) {
328-
this.getAvailableLanguageList(this.inputMode);
325+
this.getAvailableLanguageList(this.inputmode);
329326
}
330327
this._hideresultChanged(this.hideresult);
331328
},
332329
_select: function (e) {
333-
this.textDocument.getTextSegment().selectedCandidateIdx = e.model.index;
334-
this.textDocument = new MyScript.TextDocument(this.textDocument);
330+
this.textdocument.getTextSegment().selectedCandidateIdx = e.model.index;
331+
this.textdocument = new MyScript.TextDocument(this.textdocument);
335332
},
336333
_isSelected: function (candidate, textDocument) {
337334
if (textDocument.getTextSegment()) {
@@ -438,7 +435,7 @@
438435
},
439436
_applicationKeyChanged: function (applicationKey) {
440437
if (this._myscriptCommonElement && applicationKey) {
441-
this._myscriptCommonElement.getAvailableLanguages(this.inputMode);
438+
this._myscriptCommonElement.getAvailableLanguages(this.inputmode);
442439
}
443440
},
444441
_hideresultChanged: function (hideresult) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy