Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function addButton()
{
$("#trackChangesShareButton").remove();
// Update button in track changes
var $trackchanges = $("#changeTracker_hbox");
// Create the button if it doens't exist
var shareButton = require("ko/ui/button").create('Share',
{
attributes:
{
type: "menu",
id: "trackChangesShareButton",
tooltiptext:"Share Changeset .."
}
});
//Create the new modules menuitem for this menu
for (let id in koShare.modules)
{
let module = koShare.modules[id];
let menuitem = require("ko/ui/menuitem").create({
attributes: {
label: module.label
function createPostAndOpenBtn()
{
return require("ko/ui/button").create({attributes:{label:"Share & Open Browser",disabled:true}});
}
wrapper.addRow(
errorLabel,
{ attributes: { align: "center", pack: "center", class: "ui-error" } }
);
var buttonRow = wrapper.addRow({ attributes: { align: "center", pack: "center" } });
buttonRow.addClass("buttons-ui");
if (opts.onComplete)
{
var okButton = require("ko/ui/button").create(opts.okLabel);
okButton.onCommand(onFormComplete.bind(this, opts));
buttonRow.add(okButton);
}
var cancelButton = require("ko/ui/button").create(opts.cancelLabel);
cancelButton.onCommand(function()
{
parent.close();
if (opts.onComplete)
opts.onComplete();
});
buttonRow.add(cancelButton);
if (opts.onReady)
opts.onReady(parent, mapping);
parent.sizeToContent();
};
function createPostBtn()
{
return require("ko/ui/button").create({attributes:{label:"Share on Slack",disabled:true}});
}
this.init = function()
{
this.defaultInit.apply(this, arguments);
this.textbox = require("ko/ui/textbox").create({ attributes: this.attributes });
var button = require("ko/ui/button").create("...");
button.onCommand(() =>
{
var ko = require("ko/windows").getMain().ko;
var type = this.attributes.filetype || this.options.filetype || "file";
var value = this.textbox.value();
var filter = this.attributes.filter || null;
var filters = this.attributes.filters || null;
switch (type)
{
default:
case "file":
this.textbox.value(ko.filepicker.browseForFile(value, null, null, filter, filters));
break;
elem.value(field.value);
}
var errorLabel = require("ko/ui/label").create({ attributes: { class: "fullwidth state-error" } });
errorLabel.hide();
wrapper.addRow(
errorLabel,
{ attributes: { align: "center", pack: "center", class: "ui-error" } }
);
var buttonRow = wrapper.addRow({ attributes: { align: "center", pack: "center" } });
buttonRow.addClass("buttons-ui");
if (opts.onComplete)
{
var okButton = require("ko/ui/button").create(opts.okLabel);
okButton.onCommand(onFormComplete.bind(this, opts));
buttonRow.add(okButton);
}
var cancelButton = require("ko/ui/button").create(opts.cancelLabel);
cancelButton.onCommand(function()
{
parent.close();
if (opts.onComplete)
opts.onComplete();
});
buttonRow.add(cancelButton);
if (opts.onReady)
opts.onReady(parent, mapping);
function createCloseBtn()
{
return require("ko/ui/button").create({attributes:{label:"Cancel"}});
}