| 3 | | <div id="flash-graph" style="visiblity:;"> |
| | 3 | .widget-container {border:1px solid #cccccc; width:100%;} |
| | 4 | .widget-header {color: white;background-color:orange; padding:10px;text-align:left; font-weight:bold; font-size:18px;} |
| | 5 | .widget-title {font-size:20px;text-align:right;} |
| | 6 | .widget-title a {color: white;} |
| | 7 | .widget-title-controls {font-size:14px;text-align:right;} |
| | 8 | .widget-controls {text-align:right;padding:10px} |
| | 9 | .widget-content {padding:10px;} |
| | 20 | |
| | 21 | <script> |
| | 22 | //var widgeturl = "http://wp25-php5-test.openwebanalytics.com/index.php?owa_specialAction&owa_do=base.dashboardTrendWidget&owa_period=last_thirty_days&owa_format="; |
| | 23 | var widgeturl = state['<?=$widget;?>'].url; |
| | 24 | |
| | 25 | // When the document loads do everything inside here ... |
| | 26 | jQuery(document).ready(function(){ |
| | 27 | //$('#content').load('boo.php'); //by default initally load text from boo.php |
| | 28 | jQuery('.widget-control').click(function() { //start function when any link is clicked |
| | 29 | var parentname = jQuery("div").parent(".widget-container").attr("id"); |
| | 30 | var widgetname2 = parentname.split("_"); |
| | 31 | var widgetname = widgetname2[0]; |
| | 32 | var widgetcontentid = "#"+widgetname+"_widget-content"; |
| | 33 | var format = jQuery(this).attr("name"); |
| | 34 | //alert(widgetcontentid); |
| | 35 | jQuery(widgetcontentid).slideUp("slow"); |
| | 36 | //var content_show = $(this).attr("title"); //retrieve title of link so we can compare with php file |
| | 37 | jQuery.ajax({ |
| | 38 | method: "get",url: widgeturl+format, |
| | 39 | beforeSend: function(){ jQuery(".widget-status").show("fast");}, //show loading just when link is clicked |
| | 40 | complete: function(){ jQuery(".widget-status").hide("fast");}, //stop showing loading when the process is complete |
| | 41 | success: function(html){ //so, if data is retrieved, store it in html |
| | 42 | jQuery(widgetcontentid).show("slow"); //animation |
| | 43 | jQuery(widgetcontentid).html(html); //show the html inside .content div |
| | 44 | } |
| | 45 | }); //close $.ajax( |
| | 46 | }); //close click( |
| | 47 | }); //close $( |
| | 48 | </script> |
| | 49 | |
| | 50 | |
| | 51 | <div id="<?=$widget;?>_widget-container" class="widget-container"> |
| | 52 | |
| | 53 | <div id="<?=$widget;?>_widget-header"class="widget-header"> |
| | 54 | <span class="widget-title"><?=$title;?></span> |
| | 55 | |
| | 56 | <div id="<?=$widget;?>_widget-title-controls" style="float:right;"> |
| | 57 | <span class="widget-title-controls"><a href="">Close</a></span> |
| | 58 | </div> |
| | 59 | |
| | 60 | </div> |
| | 61 | |
| | 62 | <div id="<?=$widget;?>_widget-status" class="widget-status">LOADING</div> |
| | 63 | |
| | 64 | <div id="<?=$widget;?>_widget-content" class="widget-content"><?=$subview;?></div> |
| | 65 | |
| | 66 | <div id="<?=$widget;?>_widget-controls" class="widget-controls"> |
| | 67 | <a class="widget-control" href="#base-dashboardTrendWidget_widget-header" name="graph">Graph</a> | |
| | 68 | <a class="widget-control" href="#base-dashboardTrendWidget_widget-header" name="table">Table</a> | |
| | 69 | <a class="widget-control" href="#base-dashboardTrendWidget_widget-header" name="sparkline">Sparkline</a> |
| | 70 | </div> |
| | 71 | |
| | 72 | |
| | 73 | </div> |