| 1 | <mt:unless name="direct_asset_insert"><mt:setvarblock name="screen_type">dialog-screen new-asset</mt:setvarblock></mt:unless> |
|---|
| 2 | <mt:setvarblock name="page_title"><__trans phrase="File Options"></mt:setvarblock> |
|---|
| 3 | <mt:setvarblock name="html_head" append="1"> |
|---|
| 4 | <script type="text/javascript" src="<mt:var name="static_uri">js/tc/focus.js"></script> |
|---|
| 5 | <script type="text/javascript" src="<mt:var name="static_uri">js/tc/tagcomplete.js"></script> |
|---|
| 6 | <script type="text/javascript" src="<mt:var name="static_uri">js/tc/client.js"></script> |
|---|
| 7 | <script type="text/javascript"> |
|---|
| 8 | /* <![CDATA[ */ |
|---|
| 9 | var tag_delim = '<mt:var name="auth_pref_tag_delim">'; |
|---|
| 10 | |
|---|
| 11 | // array of tag names |
|---|
| 12 | var tagList; |
|---|
| 13 | |
|---|
| 14 | function tagSplit(str) { |
|---|
| 15 | var delim = RegExp.escape(tag_delim); |
|---|
| 16 | var delim_scan = new RegExp('^((([\'"])(.*?)\\3[^' + delim + ']*?|.*?)(' + delim + '\\s*|$))', ''); |
|---|
| 17 | str = str.replace(/(^\s+|\s+$)/g, ''); |
|---|
| 18 | var tags = []; |
|---|
| 19 | while (str.length && str.match(delim_scan)) { |
|---|
| 20 | str = str.substr(RegExp.$1.length); |
|---|
| 21 | var tag = RegExp.$4 ? RegExp.$4 : RegExp.$2; |
|---|
| 22 | tag = tag.replace(/(^\s+|\s+$)/g, ''); |
|---|
| 23 | tag = tag.replace(/\s+/g, ' '); |
|---|
| 24 | if (tag != '') tags.push(tag); |
|---|
| 25 | } |
|---|
| 26 | return tags; |
|---|
| 27 | } |
|---|
| 28 | |
|---|
| 29 | var autoTag; |
|---|
| 30 | <mt:if name="tags_js"> |
|---|
| 31 | tagList = <mt:var name="tags_js">; |
|---|
| 32 | </mt:if> |
|---|
| 33 | |
|---|
| 34 | function init() |
|---|
| 35 | { |
|---|
| 36 | <mt:if name="tags_js">initTags();</mt:if> |
|---|
| 37 | } |
|---|
| 38 | |
|---|
| 39 | var tagPos = 0; |
|---|
| 40 | function initTags() { |
|---|
| 41 | if (!tagList || tagList.length == 0) return; |
|---|
| 42 | autoTag = new TC.TagComplete("tags", tagList); |
|---|
| 43 | autoTag.delimiter = tag_delim; |
|---|
| 44 | } |
|---|
| 45 | |
|---|
| 46 | TC.attachLoadEvent( init ); |
|---|
| 47 | |
|---|
| 48 | function presubmit(f) { |
|---|
| 49 | var mode = 'complete_upload'; |
|---|
| 50 | <mt:if name="entry_insert"> |
|---|
| 51 | mode = 'asset_insert'; |
|---|
| 52 | <mt:else name="asset_select"> |
|---|
| 53 | mode = 'asset_insert'; |
|---|
| 54 | <mt:else name="can_create_post"> |
|---|
| 55 | if (f.new_entry && f.new_entry.checked) mode = 'start_upload_entry'; |
|---|
| 56 | </mt:if> |
|---|
| 57 | if (mode != 'asset_insert') { |
|---|
| 58 | f.target = "_top"; |
|---|
| 59 | } |
|---|
| 60 | f['__mode'].value = mode; |
|---|
| 61 | return true; |
|---|
| 62 | } |
|---|
| 63 | |
|---|
| 64 | /* ]]> */ |
|---|
| 65 | </script> |
|---|
| 66 | </mt:setvarblock> |
|---|
| 67 | <mt:include name="dialog/header.tmpl"> |
|---|
| 68 | <form action="<mt:var name="script_url">" method="post" onsubmit="return presubmit(this)"> |
|---|
| 69 | <input type="hidden" name="__mode" value="" /> |
|---|
| 70 | <input type="hidden" name="id" value="<mt:var name="asset_id">" /> |
|---|
| 71 | <input type="hidden" name="blog_id" value="<mt:var name="blog_id">" /> |
|---|
| 72 | <input type="hidden" name="site_path" value="<mt:var name="site_path" escape="html">" /> |
|---|
| 73 | <input type="hidden" name="edit_field" value="<mt:var name="edit_field">" /> |
|---|
| 74 | <input type="hidden" name="fname" value="<mt:var name="fname" escape="html">" /> |
|---|
| 75 | <input type="hidden" name="url" value="<mt:var name="url" escape="html">" /> |
|---|
| 76 | <input type="hidden" name="magic_token" value="<mt:var name="magic_token">" /> |
|---|
| 77 | <mt:unless name="direct_asset_insert"> |
|---|
| 78 | <input type="hidden" name="middle_path" value="<mt:var name="middle_path">" /> |
|---|
| 79 | <input type="hidden" name="extra_path" value="<mt:var name="extra_path">" /> |
|---|
| 80 | </mt:unless> |
|---|
| 81 | <mt:if name="entry_insert"> |
|---|
| 82 | <input type="hidden" name="new_entry" value="1" /> |
|---|
| 83 | </mt:if> |
|---|
| 84 | <mt:unless name="is_image"> |
|---|
| 85 | <input type="hidden" name="link" value="1" /> |
|---|
| 86 | </mt:unless> |
|---|
| 87 | |
|---|
| 88 | <mt:unless name="direct_asset_insert"> |
|---|
| 89 | <!-- <__trans phrase="The file named '[_1]' has been uploaded. Size: [quant,_2,byte,bytes]." params="<mt:var name="fname" escape="html">%%<mt:var name="bytes">"> --> |
|---|
| 90 | </mt:unless> |
|---|
| 91 | |
|---|
| 92 | <mt:unless name="direct_asset_insert"> |
|---|
| 93 | <div> |
|---|
| 94 | <div id="asset_details"> |
|---|
| 95 | <mtapp:setting |
|---|
| 96 | id="file_name" |
|---|
| 97 | label_class="top-label" |
|---|
| 98 | label="<__trans phrase="Name">"> |
|---|
| 99 | <div class="textarea-wrapper"> |
|---|
| 100 | <input type="text" name="label" id="file_name" value="<mt:var name="fname" escape="html">" class="full-width"> |
|---|
| 101 | </div> |
|---|
| 102 | </mtapp:setting> |
|---|
| 103 | <mtapp:setting |
|---|
| 104 | id="file_desc" |
|---|
| 105 | label_class="top-label" |
|---|
| 106 | label="<__trans phrase="Description">"> |
|---|
| 107 | <textarea name="description" id="file_desc" cols="" rows="" class="full-width short"></textarea> |
|---|
| 108 | </mtapp:setting> |
|---|
| 109 | <mtapp:setting |
|---|
| 110 | id="file_tags" |
|---|
| 111 | label_class="top-label" |
|---|
| 112 | label="<__trans phrase="Tags">"> |
|---|
| 113 | <div class="textarea-wrapper"> |
|---|
| 114 | <input type="text" name="tags" id="file_tags" class="full-width" value="" mt:watch-change="1" autocomplete="0" /> |
|---|
| 115 | </div> |
|---|
| 116 | </mtapp:setting> |
|---|
| 117 | </div> |
|---|
| 118 | <mt:unless name="asset_select"> |
|---|
| 119 | <mt:unless name="entry_insert"> |
|---|
| 120 | <mt:if name="can_create_post"> |
|---|
| 121 | <mtapp:setting |
|---|
| 122 | id="new_entry" |
|---|
| 123 | label="<__trans phrase="Create entry using this uploaded file">" |
|---|
| 124 | label_class="no-header" |
|---|
| 125 | hint="" |
|---|
| 126 | show_hint="0" |
|---|
| 127 | help_page="file_upload" |
|---|
| 128 | help_section="creating_a_new_entry"> |
|---|
| 129 | <input type="checkbox" name="new_entry" id="new_entry" value="1" checked="checked" onclick="toggleSubPrefs(this); return true;" /> |
|---|
| 130 | <label for="new_entry"><__trans phrase="Create a new entry using this uploaded file."></label> |
|---|
| 131 | </mtapp:setting> |
|---|
| 132 | </mt:if> |
|---|
| 133 | </mt:unless> |
|---|
| 134 | </mt:unless> |
|---|
| 135 | </mt:unless> |
|---|
| 136 | |
|---|
| 137 | <mt:var name="options_snippet"> |
|---|
| 138 | </div> |
|---|
| 139 | <div class="actions-bar"> |
|---|
| 140 | <div class="actions-bar-inner actions"> |
|---|
| 141 | <button |
|---|
| 142 | type="submit" |
|---|
| 143 | accesskey="s" |
|---|
| 144 | title="<__trans phrase="Finish (s)">" |
|---|
| 145 | class="primary-button" |
|---|
| 146 | ><__trans phrase="Finish"></button> |
|---|
| 147 | <button |
|---|
| 148 | onclick="closeDialog(); return false" |
|---|
| 149 | type="submit" |
|---|
| 150 | accesskey="x" |
|---|
| 151 | title="<__trans phrase="Cancel (x)">" |
|---|
| 152 | ><__trans phrase="Cancel"></button> |
|---|
| 153 | </div> |
|---|
| 154 | </div> |
|---|
| 155 | </form> |
|---|
| 156 | |
|---|
| 157 | <mt:include name="dialog/footer.tmpl"> |
|---|