Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

widget_iframe - new setting value-url to allow getting the url from a… #187

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
8 changes: 7 additions & 1 deletion www/tablet/js/widget_iframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ var Modul_iframe = function () {
elem.initData('color-error', '#505050');
elem.initData('get', 'STATE');
elem.initData('check', true);

// allow readings to contain the url for the iframe
elem.initData('value-url', elem.data('value-url') || false);

me.addReading(elem, 'get');
}

Expand Down Expand Up @@ -92,6 +94,10 @@ var Modul_iframe = function () {
var elem = $(this);
var value = elem.getReading('get').val;
if (value) {
if ( elem.data('value-url') ) {
elem.data('src', value);
// console.log('Got URL on update',value);
}
if (value == elem.data('get-refresh'))
me.init_ui(elem);
else if (value.match(RegExp('^' + elem.data('get-refresh') + '$')))
Expand Down
3 changes: 2 additions & 1 deletion www/tablet/js/widget_select.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ var Modul_select = function () {
items = items.split(':');
elem.data('alias', items);
fillList(elem);
setCurrentItem(elem);
}
});

Expand Down Expand Up @@ -116,4 +117,4 @@ var Modul_select = function () {
});

return me;
};
};