Remove unnecessary _form functions that can be direct calls.
This commit is contained in:
		
							parent
							
								
									139d54f344
								
							
						
					
					
						commit
						36a2ed9f88
					
				
					 2 changed files with 9 additions and 27 deletions
				
			
		|  | @ -142,7 +142,7 @@ | ||||||
|         <ul id="this_tags"> |         <ul id="this_tags"> | ||||||
|             <li> |             <li> | ||||||
|                 <input id="add_tag_textbox" type="text" list="tag_autocomplete_datalist" autofocus> |                 <input id="add_tag_textbox" type="text" list="tag_autocomplete_datalist" autofocus> | ||||||
|                 <button id="add_tag_button" class="green_button" onclick="add_photo_tag_form('{{photo.id}}');">add</button> |                 <button id="add_tag_button" class="green_button" onclick="add_photo_tag_form();">add</button> | ||||||
|             </li> |             </li> | ||||||
|             {% set tags = photo.get_tags()|sort_tags %} |             {% set tags = photo.get_tags()|sort_tags %} | ||||||
|             {% for tag in tags %} |             {% for tag in tags %} | ||||||
|  | @ -159,7 +159,7 @@ | ||||||
|         <!-- METADATA & DOWNLOAD --> |         <!-- METADATA & DOWNLOAD --> | ||||||
|         <h4> |         <h4> | ||||||
|             File info |             File info | ||||||
|             <button id="refresh_metadata_button" class="green_button" onclick="refresh_metadata_form('{{photo.id}}');">refresh</button> |             <button id="refresh_metadata_button" class="green_button" onclick="api.photos.refresh_metadata('{{photo.id}}', common.refresh);">refresh</button> | ||||||
|         </h4> |         </h4> | ||||||
|         <ul id="metadata"> |         <ul id="metadata"> | ||||||
|             <li>Filename: {{photo.basename}}</li> |             <li>Filename: {{photo.basename}}</li> | ||||||
|  | @ -232,6 +232,8 @@ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| <script type="text/javascript"> | <script type="text/javascript"> | ||||||
|  | var PHOTO_ID = "{{photo.id}}"; | ||||||
|  | 
 | ||||||
| var add_tag_box = document.getElementById('add_tag_textbox'); | var add_tag_box = document.getElementById('add_tag_textbox'); | ||||||
| var add_tag_button = document.getElementById('add_tag_button'); | var add_tag_button = document.getElementById('add_tag_button'); | ||||||
| add_tag_box.addEventListener("keyup", common.entry_with_history_hook); | add_tag_box.addEventListener("keyup", common.entry_with_history_hook); | ||||||
|  | @ -239,14 +241,14 @@ common.bind_box_to_button(add_tag_box, add_tag_button, false); | ||||||
| 
 | 
 | ||||||
| var message_area = document.getElementById('message_area'); | var message_area = document.getElementById('message_area'); | ||||||
| 
 | 
 | ||||||
| function add_photo_tag_form(photo_id) | function add_photo_tag_form() | ||||||
| { | { | ||||||
|     var tagname = document.getElementById("add_tag_textbox").value; |     var tagname = document.getElementById("add_tag_textbox").value; | ||||||
|     if (tagname == "") |     if (tagname == "") | ||||||
|     { |     { | ||||||
|         return; |         return; | ||||||
|     } |     } | ||||||
|     api.photos.add_tag('{{photo.id}}', tagname, receive_callback); |     api.photos.add_tag(PHOTO_ID, tagname, receive_callback); | ||||||
|     add_tag_box.value = ""; |     add_tag_box.value = ""; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -285,11 +287,6 @@ function receive_callback(response) | ||||||
|     common.create_message_bubble(message_area, message_positivity, message_text, 8000); |     common.create_message_bubble(message_area, message_positivity, message_text, 8000); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function refresh_metadata_form(photo_id) |  | ||||||
| { |  | ||||||
|     api.photos.refresh_metadata(photo_id, common.refresh); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| var ZOOM_BG_URL = "url('{{photo|file_link}}')"; | var ZOOM_BG_URL = "url('{{photo|file_link}}')"; | ||||||
| function enable_hoverzoom(event) | function enable_hoverzoom(event) | ||||||
| { | { | ||||||
|  |  | ||||||
|  | @ -161,7 +161,7 @@ h2, h3 | ||||||
|                     {{tag_object.tag_object(tag, link='search', innertext=qualified_name, with_alt_description=True)-}} |                     {{tag_object.tag_object(tag, link='search', innertext=qualified_name, with_alt_description=True)-}} | ||||||
|                     <button |                     <button | ||||||
|                     class="remove_tag_button red_button button_with_confirm" |                     class="remove_tag_button red_button button_with_confirm" | ||||||
|                     data-onclick="remove_child_form('{{qualified_name.split('.')[-2]}}', '{{tag.name}}');" |                     data-onclick="api.tags.remove_child('{{qualified_name.split('.')[-2]}}', '{{tag.name}}', receive_callback);" | ||||||
|                     data-prompt="Unlink Tags?" |                     data-prompt="Unlink Tags?" | ||||||
|                     data-confirm="Unlink" |                     data-confirm="Unlink" | ||||||
|                     data-confirm-class="remove_tag_button_perm red_button" |                     data-confirm-class="remove_tag_button_perm red_button" | ||||||
|  | @ -176,7 +176,7 @@ h2, h3 | ||||||
|                     {{tag_object.tag_object(tag, link='search', innertext=qualified_name, with_alt_description=True)-}} |                     {{tag_object.tag_object(tag, link='search', innertext=qualified_name, with_alt_description=True)-}} | ||||||
|                     <button |                     <button | ||||||
|                     class="remove_tag_button red_button button_with_confirm" |                     class="remove_tag_button red_button button_with_confirm" | ||||||
|                     data-onclick="delete_tag_form('{{qualified_name}}');" |                     data-onclick="api.tags.delete('{{qualified_name}}', receive_callback);" | ||||||
|                     data-prompt="Delete Tag?" |                     data-prompt="Delete Tag?" | ||||||
|                     data-confirm="Delete" |                     data-confirm="Delete" | ||||||
|                     data-confirm-class="remove_tag_button_perm red_button" |                     data-confirm-class="remove_tag_button_perm red_button" | ||||||
|  | @ -194,7 +194,7 @@ h2, h3 | ||||||
|                     {{tag_object.tag_object(tag, link='search', innertext=qualified_name + '+' + synonym)-}} |                     {{tag_object.tag_object(tag, link='search', innertext=qualified_name + '+' + synonym)-}} | ||||||
|                     <button |                     <button | ||||||
|                     class="remove_tag_button red_button button_with_confirm" |                     class="remove_tag_button red_button button_with_confirm" | ||||||
|                     data-onclick="remove_synonym_form('{{tag.name}}', '{{synonym}}');" |                     data-onclick="api.tags.remove_synonym('{{tag.name}}', '{{synonym}}', receive_callback);" | ||||||
|                     data-prompt="Remove Synonym?" |                     data-prompt="Remove Synonym?" | ||||||
|                     data-confirm="Remove" |                     data-confirm="Remove" | ||||||
|                     data-confirm-class="remove_tag_button_perm red_button" |                     data-confirm-class="remove_tag_button_perm red_button" | ||||||
|  | @ -221,11 +221,6 @@ var message_area = document.getElementById('message_area'); | ||||||
| box.addEventListener("keyup", common.entry_with_history_hook); | box.addEventListener("keyup", common.entry_with_history_hook); | ||||||
| common.bind_box_to_button(box, button, false); | common.bind_box_to_button(box, button, false); | ||||||
| 
 | 
 | ||||||
| function delete_tag_form(tag_name) |  | ||||||
| { |  | ||||||
|     api.tags.delete(tag_name, receive_callback); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| function easybake_form() | function easybake_form() | ||||||
| { | { | ||||||
|     var box = document.getElementById('add_tag_textbox'); |     var box = document.getElementById('add_tag_textbox'); | ||||||
|  | @ -239,16 +234,6 @@ function easybake_form() | ||||||
|     box.value = ""; |     box.value = ""; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function remove_child_form(tag_name, child_name) |  | ||||||
| { |  | ||||||
|     api.tags.remove_child(tag_name, child_name, receive_callback); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| function remove_synonym_form(tag_name, syn_name) |  | ||||||
| { |  | ||||||
|     api.tags.remove_synonym(tag_name, syn_name, receive_callback); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| function receive_callback(response) | function receive_callback(response) | ||||||
| { | { | ||||||
|     responses = response["data"]; |     responses = response["data"]; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue