make (almost all of) form demo work again

This commit is contained in:
rolux 2011-05-12 06:15:01 +02:00
parent b0e5e906f5
commit c5408a6656
11 changed files with 37 additions and 26 deletions

View file

@ -8,7 +8,7 @@ body {
right: 0;
bottom: 0;
padding: 4px;
background: rgb(240, 240, 240);
//background: rgb(240, 240, 240);
overflow: auto;
}
.margin {

View file

@ -4,10 +4,7 @@
<title>ox.js form demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="css/form.css"/>
<script type="text/javascript" src="../../build/js/jquery-1.4.2.js"></script>
<script type="text/javascript" src="../../source/js/_/ox.data.js"></script>
<script type="text/javascript" src="../../build/js/Ox.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="../../build/Ox.js"></script>
<script type="text/javascript" src="js/form.js"></script>
<!--<script>
$(function() {

View file

@ -1,4 +1,5 @@
Ox.load('UI', function() {
Ox.load('UI', {debug: true}, function() {
Ox.load('Geo', function() {
var $body = $("body"),
$panel = $("<div>")
@ -608,7 +609,7 @@ Ox.load('UI', function() {
},
{
options: {
autocomplete: $.map(Ox.getCountries(), function(v, i) {
autocomplete: $.map(Ox.COUNTRIES, function(v, i) {
return v.name;
}),
autocompleteReplace: true,
@ -618,7 +619,7 @@ Ox.load('UI', function() {
},
{
options: {
autocomplete: $.map(Ox.getCountries(), function(v, i) {
autocomplete: $.map(Ox.COUNTRIES, function(v, i) {
return v.name;
}),
autocompleteReplace: true,
@ -629,7 +630,7 @@ Ox.load('UI', function() {
},
{
options: {
autocomplete: $.map(Ox.getCountries(), function(v, i) {
autocomplete: $.map(Ox.COUNTRIES, function(v, i) {
return v.name;
}),
autocompleteSelect: true,
@ -640,7 +641,7 @@ Ox.load('UI', function() {
},
{
options: {
autocomplete: $.map(Ox.getCountries(), function(v, i) {
autocomplete: $.map(Ox.COUNTRIES, function(v, i) {
return v.name;
}),
autocompleteReplace: true,
@ -652,7 +653,7 @@ Ox.load('UI', function() {
},
{
options: {
autocomplete: $.map(Ox.getCountries(), function(v, i) {
autocomplete: $.map(Ox.COUNTRIES, function(v, i) {
return v.name;
}),
autocompleteReplace: true,
@ -773,7 +774,8 @@ Ox.load('UI', function() {
separators: [
{title: "", width: 0}
]
}
},
title: 'foo'
},
{
options: {
@ -1183,4 +1185,5 @@ Ox.load('UI', function() {
})
.appendTo($panel);
});
});

View file

@ -488,12 +488,12 @@ OxButtonGroup
-webkit-border-bottom-right-radius: 2px;
}
.OxButtonGroup > .OxButton.OxTab {
-moz-border-radius-topleft: 4px;
-moz-border-radius-topright: 4px;
-moz-border-radius-topleft: 8px;
-moz-border-radius-topright: 8px;
-moz-border-radius-bottomleft: 0;
-moz-border-radius-bottomright: 0;
-webkit-border-top-left-radius: 4px;
-webkit-border-top-right-radius: 4px;
-webkit-border-top-left-radius: 8px;
-webkit-border-top-right-radius: 8px;
-webkit-border-bottom-left-radius: 0;
-webkit-border-bottom-right-radius: 0;
}

View file

@ -60,10 +60,12 @@
key = keyNames.join('_');
if (focused !== null) {
Ox.UI.elements[focused].triggerEvent('key_' + key);
// prevent Chrome from going back in history, or scrolling
// prevent Chrome fromor scrolling
// fixme: backspace -> history.back, blocking it doesn't work
// when the autocomplete menu of an input element has focus
if (
[
'backspace', 'down', 'left', 'right', 'space', 'up'
'down', 'left', 'right', 'space', 'up'
].indexOf(keyBasename) > -1 &&
!Ox.UI.elements[focused].hasClass('OxInput')
) {

View file

@ -363,8 +363,8 @@ Ox.Input = function(options, self) {
offset: {
left: 4,
top: 0
},
size: self.options.size
}
//size: self.options.size
})
.bindEvent('click', clickMenu);
if (self.options.autocompleteReplace) {

View file

@ -122,10 +122,12 @@ Ox.PlacePicker = function(options, self) {
function showPicker() {
if (!self.map) {
self.$map = new Ox.Map({
clickable: true,
id: self.options.id + 'Map',
places: [self.options.value]
//places: [self.options.value]
})
.css({
top: '16px',
width: '256px',
height: '160px'
})

View file

@ -944,10 +944,10 @@ Ox.Map = function(options, self) {
function updateFormElements() {
var width = that.width();
self.$zoomInput && constructZoomInput();
self.$placeNameInput.options({
self.$placeNameInput && self.$placeNameInput.options({
width: Math.floor((width - 112) / 2)
});
self.$placeGeonameInput.options({
self.$placeGeonameInput && self.$placeGeonameInput.options({
width: Math.ceil((width - 112) / 2)
});
}

View file

@ -20,7 +20,7 @@
select_menuId {id, value} item was selected
*/
Ox.Menu = function(options, self) {
Ox.print(options)
var self = self || {},
that = new Ox.Element({}, self)
.defaults({
@ -35,7 +35,7 @@ Ox.Menu = function(options, self) {
parent: null,
selected: -1,
side: 'bottom',
size: 'medium',
size: 'medium' // fixme: remove
})
.options(options || {})
.addClass(

View file

@ -133,7 +133,14 @@ Forms
//background: -webkit-gradient(linear, left top, left bottom, from(rgb(128, 128, 128)), color-stop(0.1, rgb(160, 160, 160)), to(rgb(192, 192, 192)));
color: rgb(32, 32, 32);
}
.OxThemeClassic .OxButton.OxTab {
//background: -moz-linear-gradient(top, rgb(160, 160, 160), rgb(192, 192, 192));
//background: -webkit-linear-gradient(top, rgb(160, 160, 160), rgb(192, 192, 192));
}
.OxThemeClassic .OxButton.OxTab.OxSelected {
//background: -moz-linear-gradient(top, rgb(224, 224, 224), rgb(192, 192, 192));
//background: -webkit-linear-gradient(top, rgb(224, 224, 224), rgb(192, 192, 192));
border-bottom: 1px solid rgb(192, 192, 192);
}

View file

@ -4076,7 +4076,7 @@ Ox.toTitleCase = function(str) {
v = v.substr(0, 1).toUpperCase() + low;
}
return v;
}).join(" ");
}).join(' ');
};
/*@