Ero sivun ”Widget:XJwCharts” versioiden välillä
Järvi-meriwikistä
Rivi 30: | Rivi 30: | ||
memo.lang = memo.widgetEl.attr( 'data-lang' ); if (typeof memo.lang == 'undefined') { memo.lang = 'fi'; } | memo.lang = memo.widgetEl.attr( 'data-lang' ); if (typeof memo.lang == 'undefined') { memo.lang = 'fi'; } | ||
− | + | memo.obscode = memo.widgetEl.attr( 'data-obscode' ); if (typeof memo.obscode == 'undefined') { memo.lang = 'ice'; }; | |
− | + | memo.siteid = memo.widgetEl.attr( 'data-siteid' ); //'284245'; //'240829'; //'284245'; | |
− | memo.siteid = memo.widgetEl.attr( 'data | ||
// add chart container | // add chart container | ||
memo.widgetEl.append( '<div class="jwChartContainer" style="position: absolute; z-index: 110; width: 100%; height: 100%;"></div>' ); | memo.widgetEl.append( '<div class="jwChartContainer" style="position: absolute; z-index: 110; width: 100%; height: 100%;"></div>' ); | ||
− | memo.chartEl = | + | memo.chartEl = memo.widgetEl.find( '.jwChartContainer' ); |
− | memo.widgetEl.append( '<div class="jwloading"></div>' ); | + | memo.widgetEl.append( '<div style="display: none;" class="jwloading"></div>' ); |
− | + | memo.loadingEl = memo.widgetEl.find( '.jwloading' ); | |
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
// add fullscreen button | // add fullscreen button | ||
//memo.widgetEl.append( '<div class="obschartbutton fullscreen-button" style="Xdisplay: none; position: absolute; z-index: 120; float: right; top: 40px; right: 1.5px; background-color: rgba( 255, 255, 255, .9 ); border-radius: 50%; border: 1px solid rgba( 230, 230, 230, 0.75 ); width: 24px; height: 24px; padding: 0;"><button title="fullscreen" style="width: 24px; height: 24px; padding: 0; margin: 0; background: none; border: none; background-image: url( //www.jarviwiki.fi/widgets/img/fullscreen_16px.png ); background-size: 50%; background-position: center; background-repeat: no-repeat; "></button></div>' ); | //memo.widgetEl.append( '<div class="obschartbutton fullscreen-button" style="Xdisplay: none; position: absolute; z-index: 120; float: right; top: 40px; right: 1.5px; background-color: rgba( 255, 255, 255, .9 ); border-radius: 50%; border: 1px solid rgba( 230, 230, 230, 0.75 ); width: 24px; height: 24px; padding: 0;"><button title="fullscreen" style="width: 24px; height: 24px; padding: 0; margin: 0; background: none; border: none; background-image: url( //www.jarviwiki.fi/widgets/img/fullscreen_16px.png ); background-size: 50%; background-position: center; background-repeat: no-repeat; "></button></div>' ); | ||
Rivi 59: | Rivi 51: | ||
memo.jw = new jwApi(); | memo.jw = new jwApi(); | ||
+ | memo.loadingEl.show( slow ); | ||
memo.jw.loadObses( { 'obscode': memo.obscode, 'siteid': memo.siteid, 'custom': '[[Jäätilanne::2||5]]' }, function( o ) { | memo.jw.loadObses( { 'obscode': memo.obscode, 'siteid': memo.siteid, 'custom': '[[Jäätilanne::2||5]]' }, function( o ) { | ||
obsesReady( memo ); | obsesReady( memo ); |