Ignore:
Timestamp:
2008/07/10 18:57:26 (16 years ago)
Author:
pineray
Message:

レイアウト編集のjavascriptをjquery UIを用いて全面的に書き直し

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/data/Smarty/templates/default/admin/design/index.tpl

    r17407 r17417  
    1010} 
    1111 
    12 // 初期処理 
    13 function init () { 
    14     document.body.ondrag = function () { return false; }; 
    15     document.body.onselectstart = function () { return false; }; 
    16  
    17     // ウィンドウサイズを取得 
    18   scrX = GetWindowSize("width"); 
    19   scrY = GetWindowSize("height"); 
    20  
    21   // ウィンドウサイズ変更イベントに関連付け 
    22     window.onresize = fnMoveObject; 
    23  
    24   // divタグを取得 
    25   all_elms = document.getElementsByTagName ( 'div' ); 
    26  
    27   all_dragged = $(".dragged-elm"); 
    28   all_target = $(".drop-target"); 
    29  
    30   // 配列作成 
    31   fnCreateArr(0); 
    32  
    33   // alerttest(0); 
    34  
    35     // 並び替え 
    36   fnMoveObject(); 
    37  
    38   <!--{$complate_msg}--> 
    39 } 
    40  
    4112</script> 
    4213 
     14<script type="text/javascript" src="<!--{$TPL_DIR}-->js/ui.core.js"></script> 
     15<script type="text/javascript" src="<!--{$TPL_DIR}-->js/ui.sortable.js"></script> 
    4316<script type="text/javascript" src="<!--{$TPL_DIR}-->js/layout_design.js"></script> 
    4417 
     
    6841            <!--{* 左ナビテーブルここから *}--> 
    6942            <td rowspan="3" id="layout-left"> 
    70               <div tid="LeftNavi" class="drop-target" id="t1" style="width: 145px; height: 100px;"></div> 
     43              <div id="LeftNavi" class="ui-sortable" style="position: relative; width: 145px; height: 100px;"> 
     44                <!--{assign var="firstflg" value=false}--> 
     45                <!--{foreach key=key item=item from=$tpl_arrBloc name="bloc_loop"}--> 
     46                <!--{if $item.target_id == "LeftNavi"}--> 
     47                <div class="sort<!--{if !$firstflg}--> first<!--{/if}-->"> 
     48                  <!--{$item.name}--> 
     49                  <input type="hidden" class="name" name="name_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.name}-->" /> 
     50                  <input type="hidden" class="id" name="id_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.bloc_id}-->" /> 
     51                  <input type="hidden" class="target-id" name="target_id_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.target_id}-->" /> 
     52                  <input type="hidden" class="top" name="top_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.bloc_row}-->" /> 
     53                </div> 
     54                <!--{assign var="firstflg" value=true}--> 
     55                <!--{/if}--> 
     56                <!--{/foreach}--> 
     57              </div> 
    7158            </td> 
    7259            <!--{* 左ナビテーブルここまで *}--> 
    7360            <!--{* メイン上部テーブルここから *}--> 
    7461            <td id="layout-main-head"> 
    75               <div tid="MainHead" class="drop-target" id="t2" style="width: 145px; height: 100px;"></div> 
     62              <div id="MainHead" class="ui-sortable" style="position: relative; width: 145px; height: 100px;"> 
     63                <!--{assign var="firstflg" value=false}--> 
     64                <!--{foreach key=key item=item from=$tpl_arrBloc name="bloc_loop"}--> 
     65                <!--{if $item.target_id == "MainHead"}--> 
     66                <div class="sort<!--{if !$firstflg}--> first<!--{/if}-->"> 
     67                  <!--{$item.name}--> 
     68                  <input type="hidden" class="name" name="name_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.name}-->" /> 
     69                  <input type="hidden" class="id" name="id_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.bloc_id}-->" /> 
     70                  <input type="hidden" class="target-id" name="target_id_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.target_id}-->" /> 
     71                  <input type="hidden" class="top" name="top_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.bloc_row}-->" /> 
     72                </div> 
     73                <!--{assign var="firstflg" value=true}--> 
     74                <!--{/if}--> 
     75                <!--{/foreach}--> 
     76              </div> 
    7677            </td> 
    7778            <!--{* メイン上部テーブルここまで *}--> 
    7879            <!--{* 右ナビここから *}--> 
    7980            <td rowspan="3" id="layout-right"> 
    80               <div tid="RightNavi" class="drop-target" id="t3" style="width: 145px; height: 100px;"></div> 
     81              <div id="RightNavi" class="ui-sortable" style="position: relative; width: 145px; height: 100px;"> 
     82                <!--{assign var="firstflg" value=false}--> 
     83                <!--{foreach key=key item=item from=$tpl_arrBloc name="bloc_loop"}--> 
     84                <!--{if $item.target_id == "RightNavi"}--> 
     85                <div class="sort<!--{if !$firstflg}--> first<!--{/if}-->"> 
     86                  <!--{$item.name}--> 
     87                  <input type="hidden" class="name" name="name_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.name}-->" /> 
     88                  <input type="hidden" class="id" name="id_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.bloc_id}-->" /> 
     89                  <input type="hidden" class="target-id" name="target_id_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.target_id}-->" /> 
     90                  <input type="hidden" class="top" name="top_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.bloc_row}-->" /> 
     91                </div> 
     92                <!--{assign var="firstflg" value=true}--> 
     93                <!--{/if}--> 
     94                <!--{/foreach}--> 
     95              </div> 
    8196            </td> 
    8297            <!--{* 右ナビここまで *}--> 
     
    90105          <tr> 
    91106            <td id="layout-main-foot"> 
    92               <div tid="MainFoot" class="drop-target" id="t4" style="width: 145px; height: 100px;"></div> 
     107              <div id="MainFoot" class="ui-sortable" style="position: relative; width: 145px; height: 100px;"> 
     108                <!--{assign var="firstflg" value=false}--> 
     109                <!--{foreach key=key item=item from=$tpl_arrBloc name="bloc_loop"}--> 
     110                <!--{if $item.target_id == "MainFoot"}--> 
     111                <div class="sort<!--{if !$firstflg}--> first<!--{/if}-->"> 
     112                  <!--{$item.name}--> 
     113                  <input type="hidden" class="name" name="name_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.name}-->" /> 
     114                  <input type="hidden" class="id" name="id_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.bloc_id}-->" /> 
     115                  <input type="hidden" class="target-id" name="target_id_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.target_id}-->" /> 
     116                  <input type="hidden" class="top" name="top_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.bloc_row}-->" /> 
     117                </div> 
     118                <!--{assign var="firstflg" value=true}--> 
     119                <!--{/if}--> 
     120                <!--{/foreach}--> 
     121              </div> 
    93122            </td> 
    94123          </tr> 
     
    103132      <!--{* ▼未使用ブロックここから *}--> 
    104133      <td> 
    105         <div tid="Unused" class="drop-target" id="t5" style="width: 160px; height: 500px;"></div> 
     134        <div id="Unused" class="ui-sortable" style="position: relative; width: 145px; height: 500px;"> 
     135          <!--{assign var="firstflg" value=false}--> 
     136          <!--{foreach key=key item=item from=$tpl_arrBloc name="bloc_loop"}--> 
     137          <!--{if $item.target_id == "Unused"}--> 
     138          <div class="sort<!--{if !$firstflg}--> first<!--{/if}-->"> 
     139            <!--{$item.name}--> 
     140            <input type="hidden" class="name" name="name_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.name}-->" /> 
     141            <input type="hidden" class="id" name="id_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.bloc_id}-->" /> 
     142            <input type="hidden" class="target-id" name="target_id_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.target_id}-->" /> 
     143            <input type="hidden" class="top" name="top_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.bloc_row}-->" /> 
     144          </div> 
     145          <!--{assign var="firstflg" value=true}--> 
     146          <!--{/if}--> 
     147          <!--{/foreach}--> 
     148        </div> 
    106149        <div class="btn"><button type='button' onclick="fnTargetSelf(); fnFormModeSubmit('form1','new_bloc','','');"><span>新規ブロック作成</span></button></div> 
    107150      </td> 
     
    119162  <!--▼ページ一覧 ここから--> 
    120163  <h2>編集可能ページ</h2> 
    121  
    122164  <table class="list center"> 
    123165  <!--{foreach key=key item=item from=$arrEditPage}--> 
     
    141183  </div> 
    142184  <!--▲ページ一覧 ここまで--> 
    143  
    144  
    145  
    146 <!--{foreach key=key item=item from=$tpl_arrBloc name="bloc_loop"}--> 
    147 <div target_id="<!--{$item.target_id}-->" did="<!--{$smarty.foreach.bloc_loop.iteration}-->" class="dragged-elm" style="left:350px; top:0px; filter: alpha(opacity=100); opacity: 1;width: 120px;"> 
    148    <!--{$item.name}--> 
    149 </div> 
    150 <input type="hidden" name="name_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.name}-->" /> 
    151 <input type="hidden" name="id_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.bloc_id}-->" /> 
    152 <input type="hidden" name="target_id_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.target_id}-->" /> 
    153 <input type="hidden" name="top_<!--{$smarty.foreach.bloc_loop.iteration}-->" value="<!--{$item.bloc_row}-->" /> 
    154 <!--{/foreach}--> 
    155185</div> 
    156186</form> 
Note: See TracChangeset for help on using the changeset viewer.