Skip to content

Commit

Permalink
Fixed some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
gubi committed Aug 4, 2014
1 parent 8ae75e4 commit d6915ab
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion common/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ section #se_p form .input-group, section #se_p #statistics {
width: 100%;
}
}
section #se_p #summary {
section #se_p #summary, section #se_p #results {
margin-top: 5em;
}
section #se_p .panel_content-head, section #se_p .panel_content-body, section #se_p .panel_content-footer {
Expand Down
3 changes: 2 additions & 1 deletion common/include/conf/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@
"class" => "btn btn-link"
),
"divider" => "vertical-divider"
),
)
//),
/*
"Map" => array(
"content" => array(
Expand Down
21 changes: 15 additions & 6 deletions common/js/_main/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,6 @@
case kAPI_PARAM_INPUT_ENUM:
rt[kAPI_PARAM_INPUT_TYPE] = af_obj[kAPI_PARAM_INPUT_TYPE];
rt[kAPI_RESULT_ENUM_TERM] = af_obj.term.split(",");
rt[kAPI_PARAM_GROUP] = [kTAG_DOMAIN];
active_forms[af_obj.tags] = rt;
break;
case kAPI_PARAM_INPUT_RANGE:
Expand Down Expand Up @@ -890,6 +889,7 @@
});
if(storage_also) {
$.remove_storage("pgrdg_cache." + content);
$.remove_storage("pgrdg_cache.selected_forms");
}
};

Expand Down Expand Up @@ -1129,7 +1129,7 @@
if(content[kAPI_PARAM_RESPONSE_FRMT_DOCU] === undefined) {
switch($.type(content[kAPI_PARAM_RESPONSE_FRMT_DISP])) {
case "object":
r += '<li><b>' + $.cycle_disp(content, kAPI_PARAM_RESPONSE_FRMT_NAME, "label") + '</b>: ' + content[kAPI_PARAM_RESPONSE_FRMT_DISP][kAPI_PARAM_RESPONSE_FRMT_DISP];
r += '<li><b>' + $.cycle_disp(content, kAPI_PARAM_RESPONSE_FRMT_NAME, "label") + '</b>: ' + $.highlight(content[kAPI_PARAM_RESPONSE_FRMT_DISP][kAPI_PARAM_RESPONSE_FRMT_DISP]);
break;
case "array":
$.each(content[kAPI_PARAM_RESPONSE_FRMT_DISP], function(k, v) {
Expand All @@ -1144,7 +1144,7 @@
if(v_type == "string") {
r += '<li><b>' + content[kAPI_PARAM_RESPONSE_FRMT_NAME] + '</b>: <ul>';
$.each(content[kAPI_PARAM_RESPONSE_FRMT_DISP], function(k, v) {
r += '<li>' + $.cycle_disp(v, kAPI_PARAM_RESPONSE_FRMT_DISP) + '</li>';
r += '<li>' + $.highlight($.cycle_disp(v, kAPI_PARAM_RESPONSE_FRMT_DISP)) + '</li>';
});
r += '</ul></li>';
} else {
Expand All @@ -1153,14 +1153,14 @@
break;
case "string":
if(content[kAPI_PARAM_RESPONSE_FRMT_LINK] !== undefined) {
r += '<li><b>' + $.cycle_disp(content, kAPI_PARAM_RESPONSE_FRMT_NAME, "label") + '</b>: <a target="_blank" href="' + content[kAPI_PARAM_RESPONSE_FRMT_LINK] + '">' + content[kAPI_PARAM_RESPONSE_FRMT_DISP] + '</a></li>';
r += '<li><b>' + $.cycle_disp(content, kAPI_PARAM_RESPONSE_FRMT_NAME, "label") + '</b>: <a target="_blank" href="' + content[kAPI_PARAM_RESPONSE_FRMT_LINK] + '">' + $.highlight(content[kAPI_PARAM_RESPONSE_FRMT_DISP]) + '</a></li>';
} else {
if(content[kAPI_PARAM_RESPONSE_FRMT_DISP] !== undefined) {
if(content.serv !== undefined) {
var a_id = $.uuid();
r += '<li><b>'+ $.cycle_disp(content, kAPI_PARAM_RESPONSE_FRMT_NAME, "label") + '</b>: &nbsp;<a id="' + a_id + '" onclick="$.call_service(\'' + $.utf8_to_b64(JSON.stringify(content.serv)) + '\', \'' + a_id + '\')" href="javascript:void(0);"><span class="fa fa-caret-right">&nbsp;' + content[kAPI_PARAM_RESPONSE_FRMT_DISP] + '</a></li>';
r += '<li><b>'+ $.cycle_disp(content, kAPI_PARAM_RESPONSE_FRMT_NAME, "label") + '</b>: &nbsp;<a id="' + a_id + '" onclick="$.call_service(\'' + $.utf8_to_b64(JSON.stringify(content.serv)) + '\', \'' + a_id + '\')" href="javascript:void(0);"><span class="fa fa-caret-right">&nbsp;' + $.highlight(content[kAPI_PARAM_RESPONSE_FRMT_DISP]) + '</a></li>';
} else {
r += '<li><b>'+ $.cycle_disp(content, kAPI_PARAM_RESPONSE_FRMT_NAME, "label") + '</b>: ' + content[kAPI_PARAM_RESPONSE_FRMT_DISP] + '</li>';
r += '<li><b>'+ $.cycle_disp(content, kAPI_PARAM_RESPONSE_FRMT_NAME, "label") + '</b>: ' + $.highlight(content[kAPI_PARAM_RESPONSE_FRMT_DISP]) + '</li>';
}
}
}
Expand Down Expand Up @@ -1188,6 +1188,15 @@

return '<div><ul class="list-unstyled fa-ul">' + r + '</ul></div>';
};
$.highlight = function(string) {
if($.isNumeric(string)) {
return '<span style="color: #099;">' + string + '</span>';
} else if (Date.parse("some string")) {
return '<span style="color: #800000;">' + string + '</span>';
} else {
return string;
}
};

/**
* Show row data contents
Expand Down
6 changes: 6 additions & 0 deletions common/js/_main/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,12 @@
$("#contents #" + hash.toLowerCase()).fadeIn(300);
}
}
} else if(current_path == "Search"){
if(hash.length > 0) {
if($("#contents #" + hash.toLowerCase() + " h1").html().length > 0) {
$("#contents #" + hash.toLowerCase()).fadeIn(300);
}
}
}
}
}
Expand Down

0 comments on commit d6915ab

Please sign in to comment.