Changeset 4156 for trunk/tmpl

Show
Ignore:
Timestamp:
08/29/09 00:42:22 (3 months ago)
Author:
fumiakiy
Message:

Mereged hanson to trunk. "svn merge -r4124:4151 http://code.sixapart.com/svn/movabletype/branches/hanson ."

Location:
trunk/tmpl/cms
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/tmpl/cms/dialog/asset_insert.tmpl

    r4155 r4156  
    33window.parent.app.insertHTML( '<mt:var name="upload_html" escape="js">', '<mt:var name="edit_field" escape="js">' ); 
    44</mt:setvarblock> 
     5 
     6 
    57<script type="text/javascript"> 
    68/* <![CDATA[ */ 
     9 
     10// do the following first... asset manager stuff is ONLY for edit entry 
     11<mt:if name="upload_html"> 
     12    <mt:var name="insert_script"> 
     13</mt:if> 
     14 
     15<mt:unless name="extension_message"> 
     16    closeDialog(); 
     17</mt:unless> 
    718 
    819// remove the no assets text if it's there 
     
    1223}  
    1324 
    14 // make sure the asset isn't there already 
    15 var Asset = window.parent.document.getElementById("list-asset-<mt:AssetID>"); 
    16 if (Asset) { 
    17     // do nothing 
     25// make sure asset list is present in an entry edit page 
     26var AssetList = window.parent.document.getElementById("asset-list"); 
     27 
     28if (AssetList) { 
     29    // make sure the asset isn't there already and that we're in the edit entry page 
     30    var Asset = window.parent.document.getElementById("list-asset-<mt:AssetID>"); 
     31 
     32    if (Asset) { 
     33        // do nothing 
     34    } 
     35    else { 
     36        // add the asset's id to the include_asset_ids hidden input 
     37        var asset_ids = window.parent.document.getElementById("include_asset_ids").value; 
     38        window.parent.document.getElementById("include_asset_ids").value = asset_ids + ",<mt:AssetID>"; 
     39 
     40        // create the link to the asset page with asset name as label 
     41        var myAssetLink = window.document.createElement('a'); 
     42        myAssetLink.setAttribute('href', '<mt:CGIPath><mt:AdminScript>?__mode=view&_type=asset&blog_id=<mt:var name="blog_id">&id=<mt:AssetID>'); 
     43        myAssetLink.appendChild(document.createTextNode('<mt:AssetFileName encode_js="1">')); 
     44 
     45        // create the remove link icon 
     46        var myRemoveIcon = window.document.createElement('img'); 
     47        myRemoveIcon.setAttribute('src', '<mt:StaticWebPath>images/status_icons/close.gif'); 
     48        myRemoveIcon.setAttribute('alt', 'Remove asset'); 
     49 
     50        // create the remove link for this asset 
     51        var myRemoveLink = window.document.createElement('a'); 
     52        myRemoveLink.setAttribute('href', 'javascript:removeAssetFromList(<mt:AssetID>)'); 
     53        myRemoveLink.setAttribute('class', 'remove-asset'); 
     54        myRemoveLink.appendChild(myRemoveIcon); 
     55 
     56        // create the asset list item 
     57        var myElement = window.document.createElement('li'); 
     58        myElement.setAttribute('id', 'list-asset-<mt:AssetID>'); 
     59        <mt:If tag="AssetType" eq="image"> 
     60            myElement.setAttribute('onmouseover', 'show(\'list-image-<mt:AssetID>\', window.parent.document)'); 
     61            myElement.setAttribute('onmouseout','hide(\'list-image-<mt:AssetID>\', window.parent.document)'); 
     62        </mt:If> 
     63        myElement.appendChild(myAssetLink); 
     64        myElement.appendChild(myRemoveLink); 
     65 
     66        // I HATE IE! 
     67        if (document.attachEvent) { 
     68            var oldLis = window.parent.document.getElementById("asset-list").innerHTML; 
     69            var newLi  = '<li id="list-asset-<mt:AssetID>" onmouseover="show(\'list-image-<mt:AssetID>\', window.parent.document)" onmouseout="hide(\'list-image-<mt:AssetID>\', window.parent.document)">'  
     70                         + myElement.innerHTML + '</li>'; 
     71            window.parent.document.getElementById("asset-list").innerHTML = oldLis + newLi; 
     72        }  
     73        else { 
     74            window.parent.document.getElementById("asset-list").appendChild(myElement); 
     75        } 
     76 
     77        // create the image thumbnail if it exists 
     78        <mt:If tag="AssetType" eq="image"> 
     79            var myImageElement = window.document.createElement('img'); 
     80            myImageElement.setAttribute('id', 'list-image-<mt:AssetID>'); 
     81            myImageElement.setAttribute('src', '<mt:AssetThumbnailURL width="100" encode_js="1">'); 
     82            myImageElement.setAttribute('class', 'list-image hidden'); 
     83            myElement.appendChild(myImageElement); 
     84        </mt:If> 
     85    } 
    1886} 
    19 else { 
    20     // add the asset's id to the include_asset_ids hidden input 
    21     var asset_ids = window.parent.document.getElementById("include_asset_ids").value; 
    22     window.parent.document.getElementById("include_asset_ids").value = asset_ids + ",<mt:AssetID>"; 
    23  
    24     // create the link to the asset page with asset name as label 
    25     var myAssetLink = window.document.createElement('a'); 
    26     myAssetLink.setAttribute('href', '<mt:CGIPath><mt:AdminScript>?__mode=view&_type=asset&blog_id=<mt:var name="blog_id">&id=<mt:AssetID>'); 
    27     myAssetLink.appendChild(document.createTextNode('<mt:AssetFileName encode_js="1">')); 
    28  
    29     // create the remove link icon 
    30     var myRemoveIcon = window.document.createElement('img'); 
    31     myRemoveIcon.setAttribute('src', '<mt:StaticWebPath>images/status_icons/close.gif'); 
    32     myRemoveIcon.setAttribute('alt', 'Remove asset'); 
    33  
    34     // create the remove link for this asset 
    35     var myRemoveLink = window.document.createElement('a'); 
    36     myRemoveLink.setAttribute('href', 'javascript:removeAssetFromList(<mt:AssetID>)'); 
    37         myRemoveLink.setAttribute('class', 'remove-asset'); 
    38     myRemoveLink.appendChild(myRemoveIcon); 
    39  
    40     // create the asset list item 
    41     var myElement = window.document.createElement('li'); 
    42     myElement.setAttribute('id', 'list-asset-<mt:AssetID>'); 
    43     <mt:If tag="AssetType" eq="image"> 
    44         myElement.setAttribute('onmouseover', 'show(\'list-image-<mt:AssetID>\', window.parent.document)'); 
    45         myElement.setAttribute('onmouseout','hide(\'list-image-<mt:AssetID>\', window.parent.document)'); 
    46     </mt:If> 
    47     myElement.appendChild(myAssetLink); 
    48     myElement.appendChild(myRemoveLink); 
    49  
    50     // I HATE IE! 
    51     if (document.attachEvent) { 
    52         var oldLis = window.parent.document.getElementById("asset-list").innerHTML; 
    53         var newLi  = '<li id="list-asset-<mt:AssetID>" onmouseover="show(\'list-image-<mt:AssetID>\', window.parent.document)" onmouseout="hide(\'list-image-<mt:AssetID>\', window.parent.document)">'  
    54                      + myElement.innerHTML + '</li>'; 
    55         window.parent.document.getElementById("asset-list").innerHTML = oldLis + newLi; 
    56     }  
    57     else { 
    58         window.parent.document.getElementById("asset-list").appendChild(myElement); 
    59     } 
    60  
    61     // create the image thumbnail if it exists 
    62     <mt:If tag="AssetType" eq="image"> 
    63         var myImageElement = window.document.createElement('img'); 
    64         myImageElement.setAttribute('id', 'list-image-<mt:AssetID>'); 
    65         myImageElement.setAttribute('src', '<mt:AssetThumbnailURL width="100" encode_js="1">'); 
    66         myImageElement.setAttribute('class', 'list-image hidden'); 
    67         myElement.appendChild(myImageElement); 
    68     </mt:If> 
    69 } 
    70 <mt:if name="upload_html"> 
    71     <mt:var name="insert_script"> 
    72 </mt:if> 
    73  
    74 <mt:unless name="extension_message"> 
    75     closeDialog(); 
    76 </mt:unless> 
    7787 
    7888/* ]]> */ 
     
    8595        <mt:var name="extension_message"> 
    8696    </mtapp:statusmsg> 
    87 </mt:if> 
    8897 
    89 <div class="actions-bar"> 
    9098    <div class="actions-bar-inner pkg actions"> 
    9199        <form action="" method="get" onsubmit="return false"> 
     
    99107        </form> 
    100108    </div> 
    101 </div> 
     109</mt:if> 
     110 
    102111 
    103112<mt:include name="dialog/footer.tmpl"> 
  • trunk/tmpl/cms/edit_entry.tmpl

    r4155 r4156  
    475475    <mtapp:widget 
    476476        id="asset_container" 
    477         label="Assets"> 
     477        label="<__trans phrase="Assets">"> 
    478478                <div class="asset-list-header"> 
    479479                <a href="javascript:void(0)" class="add-new-asset-link"  
    480480           onclick="openDialog(null,'list_assets','_type=asset&edit_field=&blog_id=<mt:var name="blog_id">&dialog_view=1&no_insert=1');return false;"> 
    481                 Add New 
     481                <__trans phrase="Add New"> 
    482482                </a> 
    483483                </div> 
     
    500500                </mt:loop> 
    501501            <mt:else> 
    502                 <li id="empty-asset-list">No asset(s) associated with this <mt:var name="object_type"></li> 
     502                <li id="empty-asset-list"><__trans phrase="No asset(s) associated with this [_1]" params="<mt:var name="object_type">"></li> 
    503503            </mt:if> 
    504504        </ul>