Merge branch 'post-bold2' into avoid-domino
[brisk.git] / web / index.php
index e281aa7..553f10c 100644 (file)
@@ -1231,7 +1231,7 @@ cookie_law(null);
    var $$ = jQuery.noConflict();
 
    var sess = "not_connected";
-   var page_id = "<$ echo $user->page_id; ?>";
+   var page_id = "<? echo $user->page_id; ?>";
    var g_debug = 0;
    var g_lang = "<? echo $G_lang; ?>";
    var g_lng = "<? echo $G_lng; ?>";
@@ -1255,12 +1255,23 @@ cookie_law(null);
    var spo_slide, sup_slide;
 
    window.onload = function() {
-     g_brow = get_browser_agent();
+       if ('localStorage' in window) {
+           var v_name = cookiepath.replace(/\//g, '') + '_index_page_id';
+           var local_page_id = window.localStorage.getItem(v_name);
+           if (local_page_id == page_id) {
+               window.location.reload();
+           }
+           else {
+               window.localStorage.setItem(v_name, page_id);
+           }
+       }
 
-     g_prefs = new client_prefs(null);
+       g_brow = get_browser_agent();
 
-     spo_slide  = new sideslide($('spon_caro'), 80, 20);
-     sup_slide  = new sideslide($('supp_caro'), 80, 20);
+       g_prefs = new client_prefs(null);
+
+       spo_slide  = new sideslide($('spon_caro'), 80, 20);
+       sup_slide  = new sideslide($('supp_caro'), 80, 20);
 
 <?php
         if ($BRISK_SHOWHTML == "debugtable") {
@@ -1279,7 +1290,8 @@ cookie_law(null);
         sidebanners_init($G_sidebanner_idx);
 ?>
      sess = "<?php echo "$sess"; ?>";
-     xstm = new xynt_streaming(window, <?php printf("\"%s\", %d", $transp_type, $transp_port); ?>, 2, null /* console */, gst, 'index_php', 'sess', sess, $('sandbox'), 'index_rd.php', function(com){eval(com);});
+    xstm = new xynt_streaming(window, <?php printf("\"%s\", %d", $transp_type, $transp_port); ?>, 2, null /* console */, gst,
+                              'index_php', 'sess', sess, $('sandbox'), 'index_rd.php', page_id, function(com){eval(com);});
      xstm.hbit_set(heartbit);
      tra = new train($('room_tit'));
      window.onunload = onunload_cb;