diff options
Diffstat (limited to 'ishtar_common/static')
| -rw-r--r-- | ishtar_common/static/js/ishtar.js | 91 | ||||
| -rw-r--r-- | ishtar_common/static/media/style.css | 44 |
2 files changed, 130 insertions, 5 deletions
diff --git a/ishtar_common/static/js/ishtar.js b/ishtar_common/static/js/ishtar.js index fecefe0a9..6017aed64 100644 --- a/ishtar_common/static/js/ishtar.js +++ b/ishtar_common/static/js/ishtar.js @@ -23,8 +23,6 @@ beforeSend: function(xhr, settings) { } }}); -var shortcut_url = ''; - function manage_async_link(event){ event.preventDefault(); var url = $(this).attr('href'); @@ -38,10 +36,36 @@ function manage_async_link(event){ function get_next_table_id(){} function get_previous_table_id(){} +var shortcut_url = ''; +var advanced_menu = false; +var activate_all_search_url = '/activate-all-search/'; +var activate_own_search_url = '/activate-own-search/'; +var activate_advanced_url = '/activate-advanced-menu/'; +var activate_simple_url = '/activate-simple-menu/'; + + function init_shortcut_menu(html){ $("#progress").hide(); $("#context_menu").html(html); $(".chosen-select").chosen(); + if (advanced_menu) { + init_advanced_shortcut_fields(); + } else { + init_shortcut_fields(); + } + $("#short-menu-advanced").click(function(){ + $.get(url_path + activate_advanced_url, + load_shortcut_menu + ); + }); + $("#short-menu-simple").click(function(){ + $.get(url_path + activate_simple_url, + load_shortcut_menu + ); + }); +} + +function init_shortcut_fields(){ $("#current_file").change(function(){ $.post('/' + url_path + 'update-current-item/', {item:'file', value:$("#current_file").val()}, @@ -68,6 +92,41 @@ function init_shortcut_menu(html){ }); } +function init_advanced_shortcut_fields(){ + $('#id_file-shortcut').change(function(){ + $("#id_select_file-shortcut").attr( + 'title', $('#id_select_file-shortcut').val()); + $.post('/' + url_path + 'update-current-item/', + {item: "file", value:$("#id_file-shortcut").val()}, + load_shortcut_menu + ); + }); + $('#id_operation-shortcut').change(function(){ + $("#id_select_operation-shortcut").attr( + 'title', $('#id_select_operation-shortcut').val()); + $.post('/' + url_path + 'update-current-item/', + {item: "operation", value:$("#id_operation-shortcut").val()}, + load_shortcut_menu + ); + }); + $('#id_contextrecord-shortcut').change(function(){ + $("#id_select_contextrecord-shortcut").attr( + 'title', $('#id_select_contextrecord-shortcut').val()); + $.post('/' + url_path + 'update-current-item/', + {item: "contextrecord", value:$("#id_contextrecord-shortcut").val()}, + load_shortcut_menu + ); + }); + $('#id_find-shortcut').change(function(){ + $("#id_select_find-shortcut").attr( + 'title', $('#id_select_find-shortcut').val()); + $.post('/' + url_path + 'update-current-item/', + {item: "find", value:$("#id_find-shortcut").val()}, + load_shortcut_menu + ); + }); +} + function display_info(msg){ $('#message .information .content').html(msg); $('#message').fadeIn('slow'); @@ -191,7 +250,12 @@ function load_window(url, speed, on_success){ } function load_current_window(url, model_name){ - var id = $("#current_" + model_name).val(); + var id; + if (advanced_menu){ + id = $("#id_" + model_name + "-shortcut").val(); + } else { + id = $("#current_" + model_name).val(); + } if (!id) return; url = url.split('/'); url[url.length - 1] = id; @@ -267,3 +331,24 @@ function show_hide_flex(id){ $(id).hide(); } } + +var activate_all_search_msg = "Searches in the shortcut menu deals with all items."; +var activate_own_search_msg = "Searches in the shortcut menu deals with only your items."; + +function activate_all_search(){ + $('.activate_all_search').removeClass('disabled'); + $('.activate_own_search').addClass('disabled'); + $.get(activate_all_search_url, function(data) { + display_info(activate_all_search_msg); + }); + return false; +} + +function activate_own_search(){ + $('.activate_own_search').removeClass('disabled'); + $('.activate_all_search').addClass('disabled'); + $.get(activate_own_search_url, function(data) { + display_info(activate_own_search_msg); + }); + return false; +} diff --git a/ishtar_common/static/media/style.css b/ishtar_common/static/media/style.css index aab5063e4..8aac9e2a2 100644 --- a/ishtar_common/static/media/style.css +++ b/ishtar_common/static/media/style.css @@ -29,6 +29,16 @@ a, a.remove { color:#D14; } +span.disabled, +a.disabled { + color:#ccc; +} + +span.disabled:hover, +a.disabled:hover { + color:#DB5C7C; +} + .badge, a.add-button, #reset_wizards, @@ -56,6 +66,10 @@ a.add-button, font-family: 'FontAwesome', Arial, Helvetica, sans-serif; } +#context_menu .chosen-select{ + width: 400px; +} + #context_menu option.basket{ color:#000; } @@ -229,6 +243,7 @@ button, input[type=submit], button.submit{ -webkit-border-radius:4px; } +button.btn-selected, button:hover, input[type=submit]:hover{ cursor:pointer; color:#922; @@ -409,6 +424,16 @@ div#language_form_div label{ display:inline; }*/ +.btn-group .btn{ + padding: 0; + margin: 0; +} + +.short-menu-buttons{ + position: absolute; + margin-top: -20px; +} + div#context_menu{ height:110px; margin-right:10px; @@ -418,6 +443,7 @@ div#context_menu{ } div#context_menu fieldset{ + margin-top: 8px; background-color:#f1f2f6; border:0 solid #CCC; -moz-border-radius: 0; @@ -425,13 +451,25 @@ div#context_menu fieldset{ border-radius: 0; } +div#action_current_items{ + display: inline-block; + vertical-align: top; + width: 70px; +} + +div#action_current_items p{ + padding: 0; + margin: 0; + text-align: center; +} + div#context_menu table{ display: inline; vertical-align: top; } div#context_menu .icon{ - padding: 0.6em 0.5em; + padding: 0.2em 0.3em; } div#context_menu ul{ @@ -792,7 +830,9 @@ table.confirm tr.spacer td:last-child{ /* jquery widget customizations */ .ui-autocomplete{ - font-size:0.7em + font-size:0.7em; + z-index:10000 !important; + width:350px; } .ui-autocomplete-loading { |
