Show
Ignore:
Timestamp:
08/24/08 02:05:36 (5 months ago)
Author:
padams
Message:

addng open flash cahrt wdget rework

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/modules/base/templates/widget.tpl

    r501 r502  
    1 <div style="border: 2px solid red;"> 
     1<style> 
    22 
    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;} 
    410 
    5 <?=$this->ofc($params['width'], $params['height'], $this->makeAbsoluteLink(array('do' => $widget, 'period' => 'last_thirty_days', 'site_id' => $params['site_id'], 'format' => $format), false , $this->config['action_url'])); ?> 
     11</style> 
    612 
    7 </div> 
    8  
    9 <div id="data-table"></div> 
    10 <div id="data-export"></div> 
    11  
    12 </div> 
    1313 
    1414<script> 
     15var state = new Object; 
     16state['<?=$widget;?>'] = new Object; 
     17state['<?=$widget;?>'].url = "http://wp25-php5-test.openwebanalytics.com/index.php?owa_specialAction&owa_do=base.dashboardTrendWidget&owa_period=last_thirty_days&owa_format="; 
    1518 
    1619</script> 
     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>