added: a new winix function: imgcrop
for cropping images (and thumbnails) www.domain.com/dir/file.jpg/imgcrop -- crop an image www.domain.com/dir/file.jpg/imgcrop/thumb -- crop an image's thumbnail www.domain.com/dir/file.jpg/imgcrop/newthumb -- crop and create a new thumbnail (from an original image) www.domain.com/dir/imgcrop -- show images' list with above options added: to Image class: some methods for cropping git-svn-id: svn://ttmath.org/publicrep/winix/trunk@919 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
109
html/fun_imgcrop.html
Normal file
109
html/fun_imgcrop.html
Normal file
@@ -0,0 +1,109 @@
|
||||
<div class="winix">
|
||||
|
||||
|
||||
<h1>Kadrowanie obrazów</h1>
|
||||
|
||||
[if item_is]
|
||||
|
||||
[if winix_function_param_is "thumb"]
|
||||
<p>Kadruj miniaturę zdjęcia, obraz oryginalny (duży) nie zostanie zmodyfikowany.</p>.
|
||||
[else]
|
||||
[if winix_function_param_is "newthumb"]
|
||||
<p>Zaznacz myszką kadr na zdjęciu, z tej części zostanie stworzona nowa miniatura, obraz oryginalny (duży) nie zostanie zmodyfikowany.</p>.
|
||||
[else]
|
||||
<p>Kadruj oryginalny obraz (miniatura nie zostanie zmodyfikowana).</p>.
|
||||
[end]
|
||||
[end]
|
||||
|
||||
[if-any item_is item_filetype_is_image]
|
||||
|
||||
<script type="text/javascript">
|
||||
var winix_jcrop;
|
||||
</script>
|
||||
|
||||
<img src="[item_link][if winix_function_param_is "thumb"]/-/thumb[end]" alt="" id="winix_imgcropper">
|
||||
|
||||
<form id="winix_cropform" action="[item_link]/imgcrop[if winix_function_param_is "thumb"]/thumb[end][if winix_function_param_is "newthumb"]/newthumb[end]" method="post">
|
||||
<input type="hidden" name="cropxtop" value="" id="winix_idcropxtop">
|
||||
<input type="hidden" name="cropytop" value="" id="winix_idcropytop">
|
||||
<input type="hidden" name="cropwidth" value="" id="winix_idcropwidth">
|
||||
<input type="hidden" name="cropheight" value="" id="winix_idcropheight">
|
||||
|
||||
[if-any-no winix_function_param_is "thumb" winix_function_param_is "newthumb"]
|
||||
|
||||
[if false]
|
||||
<div class="winix_input_b">
|
||||
<input type="checkbox" name="createthumbtoo" id="winix_createthumbtooid">
|
||||
<label for="winix_createthumbtooid">Stwórz także nową miniaturę</label>
|
||||
</div>
|
||||
[end]
|
||||
|
||||
[end]
|
||||
|
||||
[if winix_function_param_is "postredirect"]
|
||||
<input type="hidden" name="postredirect" value="[winix_function_param_value "postredirect"]">
|
||||
[end]
|
||||
|
||||
<input type="submit" value="Kadruj">
|
||||
</form>
|
||||
|
||||
|
||||
[else]
|
||||
<p>To nie jest obrazek.</p>
|
||||
[end]
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$('#winix_imgcropper').Jcrop(\{boxWidth: 700, boxHeight: 450\}, function()\{winix_jcrop = this;\});
|
||||
|
||||
$('form#winix_cropform').submit(function()\{
|
||||
var c = winix_jcrop.tellSelect();
|
||||
$('form#winix_cropform input#winix_idcropxtop').val(c.x);
|
||||
$('form#winix_cropform input#winix_idcropytop').val(c.y);
|
||||
$('form#winix_cropform input#winix_idcropwidth').val(c.w);
|
||||
$('form#winix_cropform input#winix_idcropheight').val(c.h);
|
||||
|
||||
return c.w != 0 && c.h != 0;
|
||||
\});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
[else]
|
||||
|
||||
[if item_tab]
|
||||
<ul class="winix_imgcrop_list">
|
||||
[for item_tab]
|
||||
|
||||
<li>
|
||||
|
||||
<div class="winix_imgcrop_list_image">
|
||||
<img src="[item_tab_link][if item_tab_has_thumb]/-/thumb[end]" alt="[item_tab_subject]">
|
||||
</div>
|
||||
|
||||
<div class="winix_imgcrop_list_imageurl">
|
||||
[item_tab_url]
|
||||
</div>
|
||||
|
||||
<div class="winix_imgcrop_list_options">
|
||||
|
||||
<ul>
|
||||
<li><a href="[item_tab_link]/imgcrop/postredirect:[filter fil_urlencode][doc_base_url][dir]imgcrop[end]">Kadruj zdjęcie</a></li>
|
||||
<li><a href="[item_tab_link]/imgcrop/thumb/postredirect:[filter fil_urlencode][doc_base_url][dir]imgcrop[end]">Kadruj miniature</a></li>
|
||||
<li><a href="[item_tab_link]/imgcrop/newthumb/postredirect:[filter fil_urlencode][doc_base_url][dir]imgcrop[end]">Kadruj i stwórz nową miniature</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
[end]
|
||||
</ul>
|
||||
[end]
|
||||
|
||||
|
||||
[end]
|
||||
|
||||
|
||||
</div>
|
||||
|
@@ -32,7 +32,10 @@
|
||||
[for item_tab]
|
||||
<li id="winix_sort_item_[item_tab_index]">
|
||||
<input type="text" name="sort[item_tab_id]" value="[item_tab_sort]">
|
||||
|
||||
[# is it correct? may give this 'if' only to /-/thumb param? ]
|
||||
[if item_tab_has_thumb]<img src="[item_tab_link]/-/thumb" alt="[item_tab_subject]">[end]
|
||||
|
||||
[item_tab_url]
|
||||
</li>
|
||||
[end]
|
||||
|
@@ -162,8 +162,6 @@
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('#fileupload button.start').css('display', 'none');
|
||||
|
||||
|
@@ -9,6 +9,7 @@
|
||||
winix_function_is "download"
|
||||
winix_function_is "emacs"
|
||||
winix_function_is "env"
|
||||
winix_function_is "imgcrop"
|
||||
winix_function_is "last"
|
||||
winix_function_is "ln"
|
||||
winix_function_is "locale"
|
||||
@@ -190,6 +191,13 @@
|
||||
[end]
|
||||
|
||||
|
||||
[if winix_function_is "imgcrop"]
|
||||
<script type="text/javascript" src="[doc_base_url_common]/jquery-1.9.1.min.js"></script>
|
||||
<script type="text/javascript" src="[doc_base_url_common]/jcrop-0.9.12/js/jquery.Jcrop.js"></script>
|
||||
<link type="text/css" rel="stylesheet" href="[doc_base_url_common]/jcrop-0.9.12/css/jquery.Jcrop.css">
|
||||
[end]
|
||||
|
||||
|
||||
|
||||
[if winix_has_plugin "stats"]
|
||||
[include "stats_info.html"]
|
||||
|
Reference in New Issue
Block a user