| 
									
										
										
										
											2013-11-28 09:41:53 +04:00
										 |  |  | <html> | 
					
						
							| 
									
										
										
										
											2013-11-30 05:10:01 +04:00
										 |  |  | <link rel="stylesheet" type="text/css" href="editor.css"> | 
					
						
							| 
									
										
										
										
											2013-11-28 09:41:53 +04:00
										 |  |  | <style> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-30 04:18:50 +04:00
										 |  |  | body.dark { | 
					
						
							| 
									
										
										
										
											2013-11-30 04:41:05 +04:00
										 |  |  | 	background: #0a0a0a; | 
					
						
							| 
									
										
										
										
											2013-11-30 04:18:50 +04:00
										 |  |  | 	color: silver; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2013-11-30 03:41:54 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-30 04:18:50 +04:00
										 |  |  | body.gray { | 
					
						
							|  |  |  | 	background: #333; | 
					
						
							|  |  |  | 	color: silver; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-30 03:41:54 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-30 05:10:01 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-28 09:41:53 +04:00
										 |  |  | </style> | 
					
						
							|  |  |  | <script src="jquery.js"></script> | 
					
						
							| 
									
										
										
										
											2013-11-29 17:27:59 +04:00
										 |  |  | <script src="jquery-ui.js"></script> | 
					
						
							| 
									
										
										
										
											2013-11-30 05:10:01 +04:00
										 |  |  | <script src="editor.js"></script> | 
					
						
							| 
									
										
										
										
											2013-11-28 09:41:53 +04:00
										 |  |  | <script> | 
					
						
							| 
									
										
										
										
											2013-11-30 04:41:05 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-30 05:43:08 +04:00
										 |  |  | // XXX this exists in jli, remove when not needed... | 
					
						
							|  |  |  | jQuery.fn.sortChildren = function(func){ | 
					
						
							|  |  |  | 	return $(this).each(function(_, e){ | 
					
						
							|  |  |  | 		return $(e).append($(e).children().detach().get().sort(func)) | 
					
						
							|  |  |  | 	}) | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*********************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-30 04:41:05 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | function toggleThemes(){ | 
					
						
							|  |  |  | 	var b = $('body') | 
					
						
							|  |  |  | 	if(b.hasClass('gray')){ | 
					
						
							|  |  |  | 		b.removeClass('gray') | 
					
						
							|  |  |  | 		b.addClass('dark') | 
					
						
							|  |  |  | 	} else if(b.hasClass('dark')){ | 
					
						
							|  |  |  | 		b.removeClass('dark') | 
					
						
							|  |  |  | 	} else { | 
					
						
							|  |  |  | 		b.addClass('gray') | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-30 01:00:43 +04:00
										 |  |  | // setup... | 
					
						
							| 
									
										
										
										
											2013-11-29 03:33:09 +04:00
										 |  |  | $(function(){ | 
					
						
							| 
									
										
										
										
											2013-11-29 17:27:59 +04:00
										 |  |  | 	var target = '#image' | 
					
						
							| 
									
										
										
										
											2013-11-29 03:33:09 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-29 21:52:22 +04:00
										 |  |  | 	var panel = makeControls(target).hide() | 
					
						
							| 
									
										
										
										
											2013-11-29 03:33:09 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-29 21:52:22 +04:00
										 |  |  | 	$('body').append(panel) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-30 01:00:43 +04:00
										 |  |  | 	reloadControls(target) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-29 21:52:22 +04:00
										 |  |  | 	$(target) | 
					
						
							|  |  |  | 		.click(function(){ | 
					
						
							|  |  |  | 			panel.show() | 
					
						
							|  |  |  | 		}) | 
					
						
							| 
									
										
										
										
											2013-11-30 04:18:50 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-29 03:33:09 +04:00
										 |  |  | }) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-30 01:00:43 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*********************************************************************/ | 
					
						
							| 
									
										
										
										
											2013-11-28 09:41:53 +04:00
										 |  |  | </script> | 
					
						
							|  |  |  | <body> | 
					
						
							| 
									
										
										
										
											2013-11-29 21:52:22 +04:00
										 |  |  | 	<img id="image" src="image.jpg" > | 
					
						
							| 
									
										
										
										
											2013-11-30 04:41:05 +04:00
										 |  |  | 	<p>click image to show editor panel and <a href="javascript:toggleThemes()">here</a> to toggle theme...</p> | 
					
						
							| 
									
										
										
										
											2013-12-17 07:13:13 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	<!--br>
 | 
					
						
							|  |  |  | 	<hr> | 
					
						
							|  |  |  | 	<br> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	<p> | 
					
						
							|  |  |  | 		Same image, first scaled (transform: scale(2)) then resized  | 
					
						
							|  |  |  | 		(height=600) and invert filter applied.<br> | 
					
						
							|  |  |  | 		The result shows that resizing does not degrade the quality  | 
					
						
							|  |  |  | 		as much.<br><br> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		#3 the effect is exagurated by first resizing by 2 and then | 
					
						
							|  |  |  | 		scaling by 4... | 
					
						
							|  |  |  | 	</p> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	<img src="image.jpg" style="-webkit-transform: scale(2); -webkit-filter: invert(1)"> | 
					
						
							|  |  |  | 	<img src="image.jpg" height="600" style="-webkit-filter: invert(1)"> | 
					
						
							|  |  |  | 	<img src="image.jpg" height="150" style="-webkit-transform: scale(4); -webkit-filter: invert(1)"> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	<hr> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	<img src="image.jpg" style="-webkit-transform: scale(2)"> | 
					
						
							|  |  |  | 	<img src="image.jpg" height="600"> | 
					
						
							|  |  |  | 	<img src="image.jpg" height="150" style="-webkit-transform: scale(4)"--> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-28 09:41:53 +04:00
										 |  |  | </body> | 
					
						
							|  |  |  | </html> |