Skip to content
This repository was archived by the owner on May 24, 2022. It is now read-only.

Update header.php #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion themes/default/views/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,33 @@
$(document).click(window.parent.hideMenus);
if ($("textarea").length > 0) {
$("textarea").tabby();


// Search with ID field
var elTextField = $("<input />").attr({type: 'text', size: 30}).keypress(function(e) {
if (e.keyCode == '13') {
e.preventDefault();
$(this).parent().find('input:last').click();
}
});
var elButton = $("<input />").attr({type: 'button', value: 'Select by ID'})
.bind('click', function (e) {
var v = $(this).parent().find('input:first').val();
// заветная строка!
$('#query_form textarea').val('{\n\t\"_id\": ObjectId(\"'+v+'\")\n}');
$('#query_form').submit();
});
$("<div />")
.html('_id: ')
.css({paddingLeft: 5, paddingTop: 4})
.append(elTextField)
.append(' ')
.append(elButton)
.prependTo('#query_form');


}
});
</script>
</head>
<body>
<body>