Commit cee907437717350797ea4e252a2c3c3e00055f94

Authored by Bartłomiej Nitoń
1 parent ba4f2462

Clearing code from unused functions.

dictionary/ajax_lemma_view.py
... ... @@ -417,16 +417,6 @@ def examples_pinned(frame, schema_examples):
417 417 return True
418 418 return False
419 419  
420   -@ajax(method='get')
421   -def example_got_assigned_semantics(request, lemma_id, example_id):
422   - lemma = Lemma.objects.get(id=lemma_id)
423   - lexical_units = lemma.entry_obj.meanings.all()
424   - for lu in lexical_units:
425   - if LexicalUnitExamples.objects.filter(example__id=example_id,
426   - lexical_unit=lu).exists():
427   - return {'got_assigned_semantics': True}
428   - return {'got_assigned_semantics': False}
429   -
430 420 ############################ lemma notes #################################
431 421  
432 422 @render('lemma_notes.html')
... ...
dictionary/static/js/lemma-view.js
... ... @@ -685,7 +685,7 @@ function needConfirmation(nkjpInstance) {
685 685 function unpin_nkjp_example(example_tabId)
686 686 {
687 687 if(example_tabId != -1 &&
688   - !checkIfSemChangedAndAlert())// && !exampleGotAssignedSemantics(example_tabId))
  688 + !checkIfSemChangedAndAlert())
689 689 {
690 690 example_id = example_tabId.replace('nkjp_', '');
691 691 for(var i=0; i<window.nkjp_examples.length; i++)
... ... @@ -822,7 +822,7 @@ function getNkjpLemmaExampleInstance(nkjp_examples, example_id)
822 822 }
823 823  
824 824 function remove_semantic_example(example_id) {
825   - if(example_id != -1 && !checkIfSemChangedAndAlert())// && !exampleGotAssignedSemantics(example_id))
  825 + if(example_id != -1 && !checkIfSemChangedAndAlert())
826 826 {
827 827 example_id = example_id.replace('nkjp_', '');
828 828 for(var i=0; i<nkjp_examples.length; i++)
... ... @@ -3780,7 +3780,7 @@ function restore_lemma() {
3780 3780  
3781 3781 function delete_nkjp_example(example_id)
3782 3782 {
3783   - if(example_id != -1 && !checkIfSemChangedAndAlert())// && !exampleGotAssignedSemantics(example_id))
  3783 + if(example_id != -1 && !checkIfSemChangedAndAlert())
3784 3784 {
3785 3785 example_id = selected_example_id.replace('nkjp_', '');
3786 3786 for(var i=0; i<nkjp_examples.length; i++)
... ... @@ -3874,7 +3874,7 @@ function restore_lemma() {
3874 3874  
3875 3875 function modify_nkjp_example(example_id)
3876 3876 {
3877   - if(example_id != -1 && !checkIfSemChangedAndAlert())// && !exampleGotAssignedSemantics(example_id))
  3877 + if(example_id != -1 && !checkIfSemChangedAndAlert())
3878 3878 {
3879 3879 var example = '';
3880 3880 for(var i=0; i<window.nkjp_examples.length; i++)
... ...
dictionary/static/js/semantics_coupling.js
... ... @@ -24,28 +24,6 @@ function semanticsAssignedAlert() {
24 24 error_alert('Działaj rozważnie, element jest wykorzystywany w ramach semantycznych.');
25 25 }
26 26  
27   -function exampleGotAssignedSemantics(example_tab_id)
28   -{
29   - var semanticsAssigned = true;
30   - var example_id = example_tab_id.replace('nkjp_', '');
31   - if (example_id < 0) {
32   - semanticsAssigned = false;
33   - }
34   - else {
35   - jQuery.ajax({
36   - type: 'get',
37   - url: ajax_example_got_assigned_semantics,
38   - data: {lemma_id: window.lemma_id,
39   - example_id: example_id},
40   - success: function(result) {
41   - semanticsAssigned = result['got_assigned_semantics'];
42   - },
43   - async: false
44   - });
45   - }
46   - return semanticsAssigned;
47   -}
48   -
49 27 function semanticsAssignedExampleAlert() {
50 28 error_alert('Działaj rozważnie, przykład jest wykorzystywany w ramach semantycznych.');
51 29 }
... ...
dictionary/views.py
... ... @@ -121,7 +121,6 @@ def lemma_view(request):
121 121  
122 122 'ajax_semantics': reverse('semantics.views.ajax_semantics'),
123 123 'ajax_schema_got_assigned_semantics': reverse('schema_got_assigned_semantics'),
124   - 'ajax_example_got_assigned_semantics': reverse('example_got_assigned_semantics'),
125 124  
126 125 'ajax_get_note_text': reverse('get_note_text'),
127 126 'ajax_lemma_notes_form_submit': reverse('lemma_notes_form_submit'),
... ...
... ... @@ -103,7 +103,6 @@ urlpatterns += patterns(&#39;dictionary.ajax_lemma_view&#39;,
103 103 url(r'^ajax/nkjp_example_form_submit/$', 'nkjp_example_form_submit'),
104 104 url(r'^ajax/semantic_example_form_submit/$', 'semantic_example_form_submit'),
105 105 url(r'^ajax/schema_got_assigned_semantics/$', 'schema_got_assigned_semantics'),
106   - url(r'^ajax/example_got_assigned_semantics/$', 'example_got_assigned_semantics'),
107 106 url(r'^ajax/remove_example_from_lemma/$', 'remove_example_from_lemma'),
108 107 url(r'^ajax/can_confirm_example/$', 'can_confirm_example'),
109 108 url(r'^ajax/confirm_nkjp_example/$', 'confirm_nkjp_example'),
... ...