summaryrefslogtreecommitdiff
path: root/ishtar_common/static
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/static')
-rw-r--r--ishtar_common/static/js/ishtar.js65
-rw-r--r--ishtar_common/static/media/style.css12
2 files changed, 69 insertions, 8 deletions
diff --git a/ishtar_common/static/js/ishtar.js b/ishtar_common/static/js/ishtar.js
index 9021dc4f5..6017aed64 100644
--- a/ishtar_common/static/js/ishtar.js
+++ b/ishtar_common/static/js/ishtar.js
@@ -37,11 +37,62 @@ 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()},
+ load_shortcut_menu
+ );
+ });
+ $("#current_operation").change(function(){
+ $.post('/' + url_path + 'update-current-item/',
+ {item:'operation', value:$("#current_operation").val()},
+ load_shortcut_menu
+ );
+ });
+ $("#current_contextrecord").change(function(){
+ $.post('/' + url_path + 'update-current-item/',
+ {item:'contextrecord', value:$("#current_contextrecord").val()},
+ load_shortcut_menu
+ );
+ });
+ $("#current_find").change(function(){
+ $.post('/' + url_path + 'update-current-item/',
+ {item:'find', value:$("#current_find").val()},
+ load_shortcut_menu
+ );
+ });
+}
+
+function init_advanced_shortcut_fields(){
$('#id_file-shortcut').change(function(){
$("#id_select_file-shortcut").attr(
'title', $('#id_select_file-shortcut').val());
@@ -76,13 +127,6 @@ function init_shortcut_fields(){
});
}
-function init_shortcut_menu(html){
- $("#progress").hide();
- $("#context_menu").html(html);
- $(".chosen-select").chosen();
- init_shortcut_fields();
-}
-
function display_info(msg){
$('#message .information .content').html(msg);
$('#message').fadeIn('slow');
@@ -206,7 +250,12 @@ function load_window(url, speed, on_success){
}
function load_current_window(url, model_name){
- var id = $("#id_" + model_name + "-shortcut").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;
diff --git a/ishtar_common/static/media/style.css b/ishtar_common/static/media/style.css
index fff2fad78..8aac9e2a2 100644
--- a/ishtar_common/static/media/style.css
+++ b/ishtar_common/static/media/style.css
@@ -243,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;
@@ -423,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;
@@ -432,6 +443,7 @@ div#context_menu{
}
div#context_menu fieldset{
+ margin-top: 8px;
background-color:#f1f2f6;
border:0 solid #CCC;
-moz-border-radius: 0;