Skip to content

Commit

Permalink
Merge pull request #11 from mapbender/fix/enableWhenSecondDialogIsInDOM
Browse files Browse the repository at this point in the history
Fix/enable when second dialog is in dom
  • Loading branch information
eSlider authored Feb 24, 2021
2 parents acc8359 + 1ba0611 commit 6d2fff3
Show file tree
Hide file tree
Showing 17 changed files with 923 additions and 1,415 deletions.
109 changes: 109 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# 0.2.84
* Fix infotext and clipboard event handlers running multiple times in nested generateElements DOM
* Fix validation marking hidden (file input integration) inputs as invalid
* Fix checkboxes and radio buttons ignoring "disabled" setting
* Fix invalid "rows" attribute on non-textarea inputs
* Fix extracted value for (invalid) radio group with no checked radio from false => null
* Emit form validation messages inline instead of using notifyjs
* Disable invalid validation requirements for individual radio buttons
* Prevent initializing required dropdown inputs to empty value
* Add "required" attribute to basic text / textarea inputs with validation constraints
* Support leaving custom validation error message empty

# 0.2.83
* When validating a form with tabs, activate the tab containing the first invalid input
* Fix tabNavigator tab title encoding
* Fix tabNavigator incompatibility with base widget
* Fix tabNavigator incompatibility with Bootstrap script

# 0.2.82
* Monkey-patch $.fn.dialog only once
* Leave proper Bootstrap buttons in dialog button sets unchanged
* Fix "null" fallback text on resultTable buttons
* Fix initialization integration issues with jqueryui dialog
* Respect `dblclick` jquerydialogextendjs option if passed in; only default to maximize if option omitted

# 0.2.81
* Fix copyToClipboard regression
* Fix checkbox validation state visualization
* Fix inconsistent scalar value handling in multi-select initialization
* Throw an error for missing required property `.text` on `type: "text"` item
* Fix cross-origin violations and misc internal deprecations on demo page

# 0.2.0
* Drop requirements for assorted IE <= 9 shim scripts only included on demo page
* Remove digitizing toolset code, this is now moved to the Mapbender Digitizer repository

# 0.1.84
* Fix infotext and clipboard event handlers running multiple times in nested generateElements DOM
* Fix validation marking hidden (file input integration) inputs as invalid
* Fix checkboxes and radio buttons ignoring "disabled" setting
* Fix invalid "rows" attribute on non-textarea inputs
* Fix extracted value for (invalid) radio group with no checked radio from false => null
* Emit form validation messages inline instead of using notifyjs
* Disable invalid validation requirements for individual radio buttons
* Prevent initializing required dropdown inputs to empty value
* Add "required" attribute to basic text / textarea inputs with validation constraints
* Support leaving custom validation error message empty

# 0.1.83
* When validating a form with tabs, activate the tab containing the first invalid input
* Fix tabNavigator tab title encoding
* Fix tabNavigator incompatibility with base widget
* Fix tabNavigator incompatibility with Bootstrap script

# 0.1.82
* Monkey-patch $.fn.dialog only once
* Leave proper Bootstrap buttons in dialog button sets unchanged
* Fix "null" fallback text on resultTable buttons
* Fix initialization integration issues with jqueryui dialog
* Respect `dblclick` jquerydialogextendjs option if passed in; only default to maximize if option omitted

# 0.1.81
* Fix copyToClipboard regression
* Fix checkbox validation state visualization
* Fix inconsistent scalar value handling in multi-select initialization
* Throw an error for missing required property `.text` on `type: "text"` item
* Fix cross-origin violations and misc internal deprecations on demo page

# 0.1.80
* Error for unsupported values for `.mandatory` is now thrown immediately on rendering, instead of later during form data extraction
* No longer generate invalid `<input type="input" ...`, use proper type `"text"` instead
* Suppress resultTable column button text unless explicitly passed in `.text` property (obviates the need for CSS hacks)
* Respect `maximizable` option also for double-click handling on popup title
* Support `.hover` value on `button`-type item for a custom tooltip text, also supoort `attr.title`
* Fix inconsistent `.infoText` on checkboxes
* Fix Fontawesome 5 conflicts in `.infoText` markup

# 0.1.79
* Fix date type input cross-browser behaviour
* Preinitialize required (`mandatory`) date inputs to current date

# 0.1.78
* Add `vis-ui` CSS class to all top-level generated items to allow more specifically guided CSS rules
* Support passing 'declarations' object to override generateElements individual tag-generating functions
* Support passing already constructed dom nodes as child elements, these will be appended without modification
* Support adding free-form HTML attributes to select options; pass options as an object list, and add an `attr` sub-object
* Support adding free-form HTML attributes (via `attr` sub-object on passed item) on:
* `html`
* `form`
* `container`
* `fluidContainer`
* Also support extra `rowAttr` sub-object; `attr` goes on the outer container, `rowAttr` on the embedded `div.row`
* `inline`
* `button`
* `submit`
* `breakLine`
* `text`
* `resultTable`
* `digitizingToolSet` (already deprecated, removed in 0.2.0)
* Despecify select2 css rules in modal.scss (please do not use modal.scss, it's only for the demo page!)
* Restore, but deprecate custom `filled` event
* Deprecate single-item-object invocation of generateElements (note the plural)
* [fringe Break] remove demo-only Leaflet map. This is incoherent with our desired use cases.
Putting a Leaflet map on top of an OpenLayers-based Mapbender Application is asking for trouble. If you want a
Leaflet map, follow [the tutorial](https://leafletjs.com/examples/quick-start/).

# 0.1.77
* Support initializing select2 on simple selects
* Make jquerydialogextendjs functionally optional (popup still opens, without maximize / collapse interactions)
37 changes: 7 additions & 30 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "viscreation/vis-ui.js",
"name": "mapbender/vis-ui.js",
"type": "component",
"description": "JavaScript UI generator framework based on jQuery UI and some other elements",
"keywords": [ "assets", "jquery", "vis-ui"],
Expand All @@ -11,26 +11,22 @@
"email": "[email protected]"
}
],
"require-dev": {
"components/normalize.css": "3.0.*",
"drmonty/leaflet": "1.0.*",
"components/placeholdersjs": "*"
},
"require": {
"robloach/component-installer": "0.2.*",
"components/font-awesome": "4.x",
"components/font-awesome": "^3.0 || ^4.0 || ^5.0",
"components/bootstrap": "3.*",
"components/jquery": "1.* || 2.*",
"components/jqueryui": "1.*",
"afarkas/html5shiv": "3.*",
"components/underscore": "1.8.*",
"rogeriopradoj/respond": "1.4.*",
"wheregroup/jquerydialogextendjs": "2.x",
"components/datatables": "1.10.*",
"datatables/datatables": "^1.10.16",
"medialize/jquery-context-menu": "1.*",
"debugteam/bootstrap-colorpicker": "1.*",
"select2/select2": "^4.0"
},
"conflict": {
"mapbender/digitizer": "<1.1.67"
},
"config": {
"bin-dir": "bin",
"component-dir": "web/assets"
Expand All @@ -49,24 +45,5 @@
"branch-alias": {
"dev-master": "0.0.x-dev"
}
},
"repositories": [
{
"type": "package",
"package": {
"name": "components/placeholdersjs",
"type": "component",
"version": "4.0.1",
"dist": {
"url": "https://github.com/jamesallardice/Placeholders.js/archive/v4.0.1.zip",
"type": "zip"
},
"extra": {
"component": {
"scripts": ["dist/placeholders.min.js","dist/placeholders.jquery.min.js"]
}
}
}
}
]
}
}
109 changes: 31 additions & 78 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html class="no-js" lang="en">
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
Expand All @@ -12,44 +12,45 @@
<link media="all" type="text/css" rel="stylesheet" href="src/styles/base.css">

<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js" type="text/javascript"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js" type="text/javascript"></script>
<script
src="https://code.jquery.com/jquery-1.12.4.min.js"
integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ="
crossorigin="anonymous"></script>
<script
src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"
integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU="
crossorigin="anonymous"></script>
<script src="https://cdn.datatables.net/r/dt/dt-1.10.8/datatables.min.js" type="text/javascript"></script>
<script src="https://cdn.rawgit.com/ROMB/jquery-dialogextend/master/build/jquery.dialogextend.min.js" type="text/javascript"></script>
<link media="all" type="text/css" rel="stylesheet" href="https://raw.githubusercontent.com/jquery/jquery-ui/master/themes/base/resizable.css">

<!-- Underscore -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js" type="text/javascript"></script>

<!-- Leaflat -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></script>
<link rel="stylesheet" href="https://cdn.rawgit.com/Leaflet/Leaflet/master/dist/leaflet.css" />

<!--[if lt IE 9]>
<script src="web/assets/html5shiv/dist/html5shiv.js" type="text/javascript"></script>
<script src="web/assets/respondjs/respondjs-built.js" type="text/javascript"></script>
<![endif]-->

<!--[if lt IE 10]>
<script src="web/assets/placeholdersjs/placeholdersjs-built.js" type="text/javascript"></script>
<![endif]-->

<script src="src/js/utils/fn.formData.js" type="text/javascript"></script>
<script src="src/js/elements/date.selector.js" type="text/javascript"></script>
<script src="src/js/elements/popup.dialog.js" type="text/javascript"></script>
<script src="src/js/jquery.form.generator.js" type="text/javascript"></script>

<script type="application/javascript">
$(function() {
jQuery.getScript("src/js/loader.js?ver=" + Math.random(), function() {
loadElements(function() {

var nameFields = [{
type: "select",
name: 'title',
title: "Title",
options: {
mr: "Mr.",
ms: "Ms."
},
options: [
{
label: "Mr.",
value: "mr"
},
{
label: "Ms.",
value: "ms"
}
],
css: {width: "20%"}
}, {
type: "input",
name: 'firstname',
title: "Name",
placeholder: "Please enter name",
mandatory: true,
Expand All @@ -62,51 +63,12 @@
css: {width: "40%"}
}, {
type: "date",
title: "Birthday",
value: "2015",
format: "YY",
css: {width: "20%"}
name: 'birthday',
title: "Birthday"
}];

$("body").generateElements({
type: "form",
children: [{
type: "select",
title: "Examples",
options: {popup: "popup demo #1"}
}, {type: "fieldSet",
children: nameFields
}]
});

// Map test
(function() {
var leafLatPopup = $("<div><div class='leaflat-map'/></div>");
var isCreated = false;
leafLatPopup.popupDialog({
title: 'Leaflat demo',
height: "500",
width: "500px",
open: function() {
var map = L.map(leafLatPopup.find('.leaflat-map')[0]).setView([51.505, -0.09], 13);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
maxZoom: 18,
attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' + 'Imagery © <a href="http://mapbox.com">Mapbox</a>',
id: 'examples.map-i875mjb7'
}).addTo(map);

L.marker([51.5, -0.09]).addTo(map).bindPopup("<b>Hello world!</b><br />I am a popup.").openPopup();

var popup = L.popup();
map.on('click', function(e) {
popup.setLatLng(e.latlng).setContent("You clicked the map at " + e.latlng.toString()).openOn(map);
});
}
});
})();

// Form test
(function() {

var $div = $("<div/>");
var agreementElements = [{
type: "checkbox",
Expand All @@ -130,6 +92,7 @@
children: nameFields
}, {type: "breakLine"}, {
type: "textArea",
name: 'description',
title: "Description",
placeholder: "Something..."
}, {
Expand All @@ -145,31 +108,21 @@
buttons: [{
text: "OK",
click: function(e) {
var popup = $(e.currentTarget).closest(".ui-").find(".popup-");
console.log(popup.formData());
return;
popup.popup('close');
console.log($div.formData());
}
}]
});
})()

});
})
});
</script>

<style type="text/css" media="all">
html, body {
height: 100%;
overflow: hidden;
}

.leaflat-map {
height: 100%;
}
</style>
</head>
<body>
</body>
</html>
</html>
21 changes: 0 additions & 21 deletions packages.json

This file was deleted.

Loading

0 comments on commit 6d2fff3

Please sign in to comment.