Ei muokkausyhteenvetoa |
Ei muokkausyhteenvetoa |
||
| Rivi 36: | Rivi 36: | ||
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.height = memo.widgetEl.attr( 'data-height' ); if (typeof memo.height == 'undefined') { memo.height = 450; } | memo.height = memo.widgetEl.attr( 'data-height' ); if (typeof memo.height == 'undefined') { memo.height = 450; } | ||
memo.siteid = jQuery( this ).attr( 'data-jw-siteid' ); | |||
memo.obscode = jQuery( this ).attr( 'data-jw-obscode' ); | |||
memo.obscodeParts = memo.obscode.split('_'); | |||
memo.service = jQuery( this ).attr( 'data-coo311-service_code' ); | |||
memo.graphType = jQuery( this ).attr( 'data-graph-type' ); | |||
memo.editUrl = jQuery( this ).attr( 'data-edit-url' ); | |||
memo.id = jQuery( this ).attr( 'id' ); if (typeof memo.id == 'undefined') { memo.id = 'jwsitegraph_' + Math.random() + '_container'; jQuery( this ).attr( 'id', memo.id ); } | |||
memo.widgetEl.css( 'position', 'relative' ); | memo.widgetEl.css( 'position', 'relative' ); | ||
| Rivi 59: | Rivi 67: | ||
memo.fullscreenEl = jQuery( this ).find( '.fullscreen-button' ); | memo.fullscreenEl = jQuery( this ).find( '.fullscreen-button' ); | ||
// add edit button | // add edit button | ||
console.log( memo.editUrl ); | |||
memo.headerEl.append( '<div class="obschartbutton edit-button" style="Xdisplay: none; margin-left: 10px; float: right; Xbackground-color: rgba( 255, 255, 255, 1 ); border-radius: 50%; Xborder: 1px solid rgba( 0, 0, 0, 0.5 ); Xpadding: 1px;"><button title="' + i18n['edit'][memo.lang] + '" style="width: 24px; height: 24px; padding: 0; margin: 0; color: #1B599B; background: none; border: none;"><i class="fas fa-edit"></i></button></div>' ); | memo.headerEl.append( '<div class="obschartbutton edit-button" style="Xdisplay: none; margin-left: 10px; float: right; Xbackground-color: rgba( 255, 255, 255, 1 ); border-radius: 50%; Xborder: 1px solid rgba( 0, 0, 0, 0.5 ); Xpadding: 1px;"><button title="' + i18n['edit'][memo.lang] + '" style="width: 24px; height: 24px; padding: 0; margin: 0; color: #1B599B; background: none; border: none;"><i class="fas fa-edit"></i></button></div>' ); | ||
memo.downloadEl = jQuery( this ).find( '.download-button' ); | memo.downloadEl = jQuery( this ).find( '.download-button' ); | ||
| Rivi 66: | Rivi 75: | ||
memo.headerEl.append( '<div class="obschartbutton download-button" style="display: none; margin-left: 10px; float: right; Xbackground-color: rgba( 255, 255, 255, 1 ); border-radius: 50%; Xborder: 1px solid rgba( 0, 0, 0, 0.5 ); Xpadding: 1px;"><button title="' + i18n['download'][memo.lang] + '" style="width: 24px; height: 24px; padding: 0; margin: 0; color: #1B599B; background: none; border: none;"><i class="fas fa-download"></i></button></div>' ); | memo.headerEl.append( '<div class="obschartbutton download-button" style="display: none; margin-left: 10px; float: right; Xbackground-color: rgba( 255, 255, 255, 1 ); border-radius: 50%; Xborder: 1px solid rgba( 0, 0, 0, 0.5 ); Xpadding: 1px;"><button title="' + i18n['download'][memo.lang] + '" style="width: 24px; height: 24px; padding: 0; margin: 0; color: #1B599B; background: none; border: none;"><i class="fas fa-download"></i></button></div>' ); | ||
memo.downloadEl = jQuery( this ).find( '.download-button' ); | memo.downloadEl = jQuery( this ).find( '.download-button' ); | ||
memo.loadStarts = 0; | memo.loadStarts = 0; | ||
| Rivi 105: | Rivi 107: | ||
memo.jw.loadObses( { 'obscode': memo.obscodeParts[0], 'siteid': memo.siteid, 'custom': custom }, function( o ) { | memo.jw.loadObses( { 'obscode': memo.obscodeParts[0], 'siteid': memo.siteid, 'custom': custom }, function( o ) { | ||
memo.obses = memo.jw.obs; | memo.obses = memo.jw.obs; | ||
drawVisualization(memo); | drawVisualization(memo); | ||
}); | }); | ||
| Rivi 310: | Rivi 311: | ||
memo.options.vAxis.viewWindow = { min: 0 }; | memo.options.vAxis.viewWindow = { min: 0 }; | ||
} | } | ||
//memo.siteName = memo.obsesA[0].printouts.SiteName[0].fulltext; | |||
if (memo.graphType == 'trend') { | if (memo.graphType == 'trend') { | ||


