root/branches/wheeljack/tmpl/cms/asset_image_options.tmpl @ 987

Revision 987, 4.5 kB (checked in by fumiakiy, 3 years ago)

Japanese L10N of Wheeljack; Minor fixes to make some phrases L10N-able.

  • Property svn:keywords set to Id Revision
Line 
1<script type="text/javascript">
2<!--
3function calcDim (val, type, full) {
4    return val.value;
5}
6
7function adjustPixelsPct (f, width) {
8//    if (!f.constrain.checked) return;
9    var e, s, full;
10    if (width) {
11        e = f.thumb_width;
12        s = f.thumb_width_type;
13        full = f.full_width.value;
14    } else {
15        e = f.thumb_height;
16        s = f.thumb_height_type;
17        full = f.full_height.value;
18    }
19    e.value = Math.floor(full * e.value / 100);
20    return true;
21}
22
23function checkThumbs(f) {
24    f = document.forms[0];
25    adjustWidthHeight(f,1);
26}
27
28function adjustWidthHeight (f, width) {
29//    if (!f.constrain.checked) return;
30    var w = f.thumb_width;
31    var wt = f.thumb_width_type;
32    var wf = f.full_width.value;
33    var h = f.thumb_height;
34    var ht = f.thumb_height_type;
35    var hf = f.full_height.value;
36    var pct;
37    var s = width ? wt : ht;
38    pct = width ? (w.value / wf) : (h.value / hf);
39    var e = width ? h : w;
40    var s = width ? ht : wt;
41    var full = width ? hf : wf;
42    e.value = Math.floor(pct * full);
43    return true;
44}
45
46function widthKeyPress(e) {
47    var key;
48    if (window.event) {
49        key = window.event.keyCode;
50        e = window.event;
51    } else if (e)
52        key = e.which;
53    else
54        return true;
55    if (( key == null) || ( key == 0 ) || ( key == 8 ) ||
56        ( key == 9 ) || ( key == 13 ) || ( key == 27 ))
57        return true;
58    if (key > 60000) // handles range of special keys such as arrow keys
59        return true;
60    if (e.ctrlKey || e.altKey)
61        return true;
62    if ((e.charCode < 48) || (e.charCode > 57))
63        return TC.stopEvent(e);
64    return true;
65}
66
67//-->
68</script>
69<TMPL_IF NAME=DO_THUMB>
70<input type="hidden" name="full_width" value="<TMPL_VAR NAME=WIDTH>" />
71<input type="hidden" name="full_height" value="<TMPL_VAR NAME=HEIGHT>" />
72</TMPL_IF>
73
74    <div id="new_entry_prefs" style="display:block;">
75    <strong><MT_TRANS phrase="Display Options"></strong>
76
77        <div class="upload_indent_choices">
78        <p><label><input type="checkbox" name="include" value="1" checked="checked" onclick="toggleSubPrefs(this); return true;" /> <MT_TRANS phrase="Display Image in Entry"></label></p>
79
80            <div id="include_prefs" style="display:block;">
81
82            <input type="hidden" name="wrap_text" value="1" />
83            <p><MT_TRANS phrase="Alignment">: <span class="align_left_icon"><img align="absbottom" src="<TMPL_VAR NAME=STATIC_URI>images/spacer.gif" alt="<MT_TRANS phrase="Align Image Left">" width="16" height="17" /></span> <input type="radio" name="align" value="left" <TMPL_IF NAME=ALIGN_LEFT>checked="checked" </TMPL_IF>/> <MT_TRANS phrase="Left"> <span class="align_center_icon"><img align="absbottom" src="<TMPL_VAR NAME=STATIC_URI>images/spacer.gif" alt="<MT_TRANS phrase="Align Image Center">" width="16" height="17" /></span> <input type="radio" name="align" value="center" <TMPL_IF NAME=ALIGN_CENTER>checked="checked" </TMPL_IF>/> <MT_TRANS phrase="Center"> <span class="align_right_icon"><img align="absbottom" src="<TMPL_VAR NAME=STATIC_URI>images/spacer.gif" alt="<MT_TRANS phrase="Align Image Right">" width="16" height="17" /></span> <input type="radio" name="align" value="right" <TMPL_IF NAME=ALIGN_RIGHT>checked="checked" </TMPL_IF>/> <MT_TRANS phrase="Right"></p>
84
85            <TMPL_IF NAME=DO_THUMB>
86            <p><input type="checkbox" name="thumb" value="1" <TMPL_IF NAME=MAKE_THUMB>checked="checked" </TMPL_IF>/> <MT_TRANS phrase="Create Thumbnail"> <a href="#" onclick="return openManual('file_upload', 'creating_thumbnails')" class="help">?</a>
87            <label for="thumb_width"><MT_TRANS phrase="Width">:</label>
88            <input name="thumb_width" id="thumb_width" value="<TMPL_VAR NAME=THUMB_WIDTH>" onkeypress="widthKeyPress(event)" onchange="adjustWidthHeight(this.form, 1)" size="4" />
89            <input type="hidden" name="thumb_height" value="<TMPL_VAR NAME=THUMB_HEIGHT>" onchange="adjustWidthHeight(this.form, 0)" size="4" />
90            <MT_TRANS phrase="Pixels">
91<img onload="checkThumbs('now');" src="<TMPL_VAR NAME=STATIC_URI>images/spacer.gif" alt="" width="1" height="1" />
92            </p>
93            </TMPL_IF>
94
95            <p><input type="checkbox" name="popup" value="1" <TMPL_IF NAME=POPUP>checked="checked" </TMPL_IF>/> <MT_TRANS phrase="Link image to full-size version in a popup window."></p>
96            <TMPL_IF NAME=CAN_SAVE_IMAGE_DEFAULTS>
97            <p><input type="checkbox" name="image_defaults" value="1" /> <MT_TRANS phrase="Remember these settings"></p>
98            </TMPL_IF>
99
100            </div>
101
102        </div>
103    </div>
Note: See TracBrowser for help on using the browser.