Skip to content
This repository was archived by the owner on Mar 14, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/js/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,9 @@ $(function() {
// remove the temp input element
input.remove();
});
input.click();
setTimeout(function() {
input.click();
}, 0);
},

/**
Expand Down
20 changes: 20 additions & 0 deletions src/js/views/property.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,26 @@
value.find("#" + valueId).attr("checked", "checked");
}
break;
case "url-uploadable":
$('<input type ="text" value="">')
.attr('id', valueId)
.addClass('title labelInput')
.appendTo(value);
//set default value
value.find('#' + valueId).val(valueVal);
$('<button> Upload </button>')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to have a small button whose caption is "..." on the right side of the input.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I'll merge this as is, but from a UI and design perspective, it needs to be significantly improved

Also, I found my self wishing I could just pick from files I already uploaded, and not have to upload another. I'd like to see a select menu here as well if there are already files uploaded, making sure only valid IMAGE file types are shown

.addClass('buttonStyle')
.click(function (e) {
var target, saveDir;
target = $(this).prev("input:text");
saveDir = $.rib.pmUtils.ProjectDir + "/" + $.rib.pmUtils.getActive() + "/images/";
$.rib.fsUtils.uploadAndSave("image", saveDir, $(this).parent(), function (file) {
target.val(file.toURL());
target.trigger('change');
});
})
.appendTo(value);
break;
case "record-array":
$('<table/>')
.attr('id', 'selectOption')
Expand Down
4 changes: 2 additions & 2 deletions src/js/widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ var BWidgetRegistry = {
parent: "Base",
properties: {
background: {
type: "string",
type: "url-uploadable",
defaultValue: "",
htmlAttribute: {
name: "style",
Expand Down Expand Up @@ -660,7 +660,7 @@ var BWidgetRegistry = {
template: '<img/>',
properties: {
src: {
type: "string",
type: "url-uploadable",
defaultValue: "src/css/images/widgets/tizen_image.svg",
htmlAttribute: "src",
forceAttribute: true
Expand Down