kopia lustrzana https://github.com/magicbug/Cloudlog
Fixed issue #85 by trimming the locator field
rodzic
87b6a7c086
commit
4c50ae3ea7
|
@ -40,7 +40,7 @@ class Logbook_model extends CI_Model {
|
|||
'COL_COMMENT' => $this->input->post('comment'),
|
||||
'COL_SAT_NAME' => $this->input->post('sat_name'),
|
||||
'COL_SAT_MODE' => $this->input->post('sat_mode'),
|
||||
'COL_GRIDSQUARE' => $this->input->post('locator'),
|
||||
'COL_GRIDSQUARE' => trim($this->input->post('locator')),
|
||||
'COL_COUNTRY' => $this->input->post('country'),
|
||||
'COL_MY_RIG' => $this->input->post('equipment'),
|
||||
'COL_QSLSDATE' => date('Y-m-d'),
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery-1.5.1.min.js"></script>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery-ui-1.8.12.custom.min.js"></script>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery.shortkeys.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>js/bootstrap-dropdown.js"></script>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>js/bootstrap-tabs.js"></script>
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@
|
|||
|
||||
<tr>
|
||||
<td class="title">QTH</td>
|
||||
<td><input id="qth" type"text" name"qth" value"" /></td>
|
||||
<td><input id="qth" type="text" name"qth" value"" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
@ -245,9 +245,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
i=0;
|
||||
$(document).ready(function(){
|
||||
|
|
|
@ -0,0 +1,92 @@
|
|||
jQuery.fn.shortkeys = jQuery.fn.keys = function (obj, settings) {
|
||||
var el = this;
|
||||
this.settings = jQuery.extend({
|
||||
split: "+",
|
||||
moreKeys: {}
|
||||
}, settings || {});
|
||||
this.wackyKeys = { '.': 190, ',': 188, ';': 59, 'Space': 32 };
|
||||
this.formElements = new Array("input", "select", "textarea", "button");
|
||||
this.keys = new Array();
|
||||
this.onFormElement = false;
|
||||
this.keysDown = new Array();
|
||||
this.init = function (obj) {
|
||||
for(x in this.wackyKeys) {
|
||||
this.wackyKeys[x.toUpperCase()] = this.wackyKeys[x];
|
||||
}
|
||||
for(x in obj) {
|
||||
this.keys.push(x.split(this.settings.split));
|
||||
}
|
||||
for(i in this.keys) {
|
||||
var quickArr = new Array();
|
||||
for(j in this.keys[i]) {
|
||||
quickArr.push(this.convertToNumbers(this.keys[i][j].toUpperCase()));
|
||||
}
|
||||
quickArr.sort();
|
||||
this.keys[i] = quickArr;
|
||||
}
|
||||
};
|
||||
this.convertToNumbers = function (inp) {
|
||||
if (this.wackyKeys[inp] != undefined) {
|
||||
return this.wackyKeys[inp];
|
||||
}
|
||||
return inp.toUpperCase().charCodeAt(0);
|
||||
};
|
||||
this.keyAdd = function(keyCode) {
|
||||
this.keysDown.push(keyCode);
|
||||
this.keysDown.sort();
|
||||
};
|
||||
this.keyRemove = function (keyCode) {
|
||||
for(i in this.keysDown) {
|
||||
if(this.keysDown[i] == keyCode) {
|
||||
this.keysDown.splice(i,1);
|
||||
}
|
||||
};
|
||||
this.keysDown.sort();
|
||||
};
|
||||
this.keyTest = function (i) {
|
||||
if (this.keys[i].length != this.keysDown.length) return false;
|
||||
for(j in this.keys[i]) {
|
||||
if(this.keys[i][j] != this.keysDown[j]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
this.keyRemoveAll = function () {
|
||||
this.keysDown = new Array();
|
||||
};
|
||||
this.focused = function (bool) {
|
||||
this.onFormElement = bool;
|
||||
}
|
||||
$(document).keydown(function(e) {
|
||||
el.keyAdd(e.keyCode);
|
||||
var i = 0;
|
||||
for(x in obj) {
|
||||
if(el.keyTest(i) && !el.onFormElement) {
|
||||
obj[x]();
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
};
|
||||
});
|
||||
$(document).keyup(function (e) {
|
||||
el.keyRemove(e.keyCode);
|
||||
});
|
||||
for(x in this.formElements) {
|
||||
$(this.formElements[x]).focus( function () {
|
||||
el.focused(true);
|
||||
});
|
||||
$(this.formElements[x]).blur( function () {
|
||||
el.focused(false);
|
||||
});
|
||||
}
|
||||
$(document).focus( function () {
|
||||
el.keyRemoveAll();
|
||||
});
|
||||
|
||||
this.init(obj);
|
||||
jQuery.extend(this.wackyKeys, this.settings.moreKeys);
|
||||
|
||||
return this;
|
||||
}
|
Ładowanie…
Reference in New Issue