You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by sommeralex <al...@gmail.com> on 2012/06/09 08:18:21 UTC

image cropper

has someone a image cropper plugin which works on all major browsers? / i was
implementing mine with cropper, but it does not work with chrome and i cant
figure out, why..

--
View this message in context: http://tapestry.1045711.n5.nabble.com/image-cropper-tp5713738.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: image cropper

Posted by sommeralex <al...@gmail.com>.
i could solve my issue (cropper with chrome) with the cropper libarary. the
solution:

javaScriptSupport.addScript("Event.observe(window, 'load', function() {"+
cropperScript +"});");

i have to wait until the page loads fully. 

--
View this message in context: http://tapestry.1045711.n5.nabble.com/image-cropper-tp5713738p5713742.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: image cropper

Posted by sommeralex <al...@gmail.com>.
I am trying to implement the http://developer.yahoo.com/yui/imagecropper/ for
tapestry. Maybe someone is willing to help me / at the end, i will post the
full (working code!)

The problem: i am not able to run the example as provided on yahoo with
tapestry.

alerting with alert(imgCrop) in my add Script method shows me that the
variable is loaded, but i dont see a square on my picture for cropping. My
pic is loaded but without the cropping square. 

The yahoo doc says that the two commands should be enough:

yui.jpg 
var imgCrop = new YAHOO.widget.ImageCropper('crop1');
 

JAVA

@Import(
library = {
	"context:plugins/jscropper/yahoo-dom-event.js", 
	"context:plugins/jscropper/dragdrop-min.js", 
	"context:plugins/jscropper/element-min.js",
	"context:plugins/jscropper/resize-min.js",
	"context:plugins/jscropper/imagecropper-min.js"
})
public class JSCropper {

	@Property
	@Persist
	private String tempImageName;

	void afterRender(){
		if(tempImageName != null){
	
			javaScriptSupport.addScript("var imgCrop = new
YAHOO.widget.ImageCropper('cropper_image'); alert(imgCrop);");

		}
		
	}

}

TML


<t:container	xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"
							xmlns:p="tapestry:parameter">
							
													
							
<t:if test="tempImageName">
	
	<t:form t:id="imageEditForm">
		<div style="float:left">
			 /img/temp/${tempImageName} 
		</div>
		
		<div style="clear:left;"></div>		
		
	</t:form>

</t:if>
							
							
</t:container>



TML PAGE WHERE I AM IMPLEMENTING THE PLUGIN

		 <t:plugins.jscropper t:id="jscropper" /> 




--
View this message in context: http://tapestry.1045711.n5.nabble.com/image-cropper-tp5713738p5713740.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org