Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function presentWeather(data: WeatherData) {
contentView.find('.weatherInfo').dispose();
createWeatherInformation(data);
applyLayout();
}
function changeGraphFocus(forecastTabView: ForecastTabView, selection: Tab, data: WeatherData) {
let day = forecastTabView.getTabIndex(selection);
let graph = contentView.find(WeatherGraph).first();
if (day === 0) {
animateGraphChange(graph, data.list[0].date.getTime(), data.list[data.list.length - 1].date.getTime());
} else {
let time = data.days[day][0].date.getTime();
let newMin = new Date(time).setHours(0, 0, 0, 0);
let newMax = new Date(time + 24 * 60 * 60 * 1000).setHours(0, 0, 0, 0);
animateGraphChange(graph, newMin, newMax);
}
}
_openPluginInfoPage() {
contentView.find('NavigationView').first().append(
new Page({title: 'Plugin Info'}).append(
new WebView({
left: 0, top: 0, right: 0, bottom: 0,
url: 'https://www.npmjs.com/package/' + this.pluginId
})
)
);
}
import {TextView, contentView} from 'tabris';
['normal', 'interactive', 'prio-high', 'missing', 'prio-high missing'].forEach((style) => {
new TextView({
left: 10, top: 'prev() 10',
class: style,
text: 'class "' + style + '"'
}).appendTo(contentView);
});
contentView.find(TextView).set({font: '24px Arial, sans-serif', textColor: '#333'});
contentView.find(TextView).filter('.interactive').set({textColor: 'blue'});
contentView.find(TextView).filter('.prio-high').set({font: 'bold 24px Arial, Sans-Serif'});
contentView.find(TextView).filter('.missing').set({textColor: '#ccc'});
_showCoversGallery() {
new CoversGalleryPage().appendTo(contentView.find('NavigationView').first());
}
_showBookDetailsPage() {
const BookDetailsPage = require('./BookDetailsPage');
new BookDetailsPage({title: this.book.title, book: this.book}).appendTo(contentView.find('NavigationView').first());
}
this.on('appear', () => contentView.find('#aboutAction').first().visible = false);
}
appear: () => contentView.find('#aboutAction').first().visible = false,
disappear: () => contentView.find('#aboutAction').first().visible = true