CallBackery

 view release on metacpan or  search on metacpan

lib/CallBackery/qooxdoo/callbackery/source/class/callbackery/ui/form/renderer/NoteForm.js  view on Meta::CPAN

                            }
                            else {
                                label.set({
                                    value: newLabel + ':',
                                    marginTop: 2,
                                    marginBottom: 2,
                                    font: 'default',
                                });
                                that._add(label, {
                                    row: row + 1,
                                    column: 0,
                                });
                            }
                        });
                    }
                    that._add(item, { row: that._row + 1, column: 1 });

                    if (itemOptions != null && itemOptions[i] != null) {
                        if (itemOptions[i].note) {
                            that._gotNote = true;
                            var note = new qx.ui.basic.Label(
                                itemOptions[i].note).set({
                                    rich: true,
                                    paddingLeft: 20,
                                    paddingRight: 20
                                });
                            that._add(note, {
                                row: that._row + 1,
                                column: 2
                            });
                            that._connectVisibility(item, note);
                        }
                    }
                    if (itemOptions[i].copyOnTap
                        && item.getReadOnly()) {
                        var copyFailMsg = itemOptions[i].copyFailMsg
                            ? that.xtr(itemOptions[i].copyFailMsg)
                            : that.tr("Select %1 and press [ctrl]+[c]", labelName);
                        var copySuccessMsg = itemOptions[i].copySuccessMsg
                            ? that.xtr(itemOptions[i].copySuccessMsg)
                            : that.tr("%1 copied", labelName);

                        item.addListener('tap', function (e) {
                            try {
                                navigator.clipboard.writeText(item.getValue())
                                    .then(function (ret) {
                                        msg.info(that.tr("Success"), copySuccessMsg);
                                    })
                                    .catch(function (err) {
                                        msg.info(that.tr("Copy failed"), copyFailMsg);
                                    })
                            } catch (err) {
                                msg.info(that.tr("Copy failed"), copyFailMsg);
                            }
                        });
                    }
                    that._row += 2;
                    that._connectVisibility(item, label);

                    // store the names for translation
                    if (qx.core.Environment.get("qx.dynlocale")) {
                        that._names.push({
                            name: names[i], label: label, item: items[i]
                        });
                    }
                })();
            } // end context
            let bounds = this.getBounds();
            if (bounds) {
                this._updateForm(bounds.width);
            }
        }
    }
});



( run in 0.861 second using v1.01-cache-2.11-cpan-ceb78f64989 )