Skip to content

Commit a8e2124

Browse files
committed
Version 1.2.3.
1 parent f764523 commit a8e2124

11 files changed

+176
-76
lines changed

bower.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "evolutility-ui-jquery",
3-
"version": "1.2.2",
3+
"version": "1.2.3",
44
"copyright": "(c) 2019 Olivier Giulieri",
55
"description": "Set of model-driven views list, browse, edit, and chart your data (using jQuery, Backbone, and D3.js).",
66
"main": [
@@ -10,7 +10,7 @@
1010
"homepage": "http://evoluteur.github.io/evolutility-ui-jquery/",
1111
"authors": "Olivier Giulieri (https://evoluteur.github.io/)",
1212
"dependencies": {
13-
"jquery": "^3.2.1",
13+
"jquery": "^3.4.1",
1414
"backbone": "^1.3.3",
1515
"backbone.localStorage": "^v1.1.16",
1616
"underscore": "^1.8.3",
@@ -23,7 +23,7 @@
2323
"balloon.css": "^0.4.0"
2424
},
2525
"resolutions": {
26-
"jquery": "3.2.1"
26+
"jquery": "3.4.1"
2727
},
2828
"repository": {
2929
"type": "git",

demo/demo-data.min.js

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/demo.css

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/* --- header, navbar, content and footer --- */
33
.evo-logo {
44
float: left;
5+
line-height: 30px;
56
font-size: 2em;
67
margin: 10px 80px 20px 10px; }
78
.evo-logo > a {
@@ -31,7 +32,7 @@
3132
top: 0;
3233
left: 0;
3334
overflow: none;
34-
background-color: #0099cc;
35+
background-color: #336699;
3536
min-height: 75px;
3637
width: 100%;
3738
min-width: 620px;
@@ -97,7 +98,7 @@
9798
.evo-head-links {
9899
font-size: 1.5em;
99100
margin-top: 5px;
100-
margin-left: -30px; }
101+
margin-left: -40px; }
101102
.evo-head-links > li.spaced {
102103
margin-top: 50px; }
103104
@media only screen and (max-width: 900px) {
@@ -116,7 +117,7 @@
116117
display: block; } }
117118

118119
.evo-title, .evo-title2 {
119-
background-color: #0099cc;
120+
background-color: #336699;
120121
position: absolute;
121122
z-index: 1002;
122123
width: 100%;
@@ -174,6 +175,8 @@
174175
text-align: center;
175176
font-size: smaller;
176177
color: silver; }
178+
.footer a {
179+
color: silver; }
177180

178181
.evol-doc-views > section {
179182
margin: 10px; }
@@ -319,7 +322,8 @@ body {
319322
height: 100%; }
320323

321324
a {
322-
color: #0099cc; }
325+
color: #0099cc;
326+
font-weight: 400; }
323327

324328
h1, h2, h3, h4 {
325329
color: #2072a7; }
@@ -407,7 +411,7 @@ h1, h2, h3, h4 {
407411
.title2 {
408412
font-size: smaller;
409413
font-weight: normal;
410-
color: #b3e5fc; }
414+
color: #336699; }
411415

412416
/* demo card view*/
413417
[data-eid="todo"] .evol-cards-body > .panel,

dist/css/dependencies.min.css

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/evolutility-ui-jquery.css

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
evolutility-ui-jquery 1.2.2
2+
evolutility-ui-jquery 1.2.3
33
44
https://github.com/evoluteur/evolutility-ui-jquery
55
*/
@@ -241,8 +241,11 @@ input.form-control {
241241
min-width: 100px;
242242
}
243243

244-
.evo-plist input[type="text"],
245-
.evo-plist input textarea {
244+
.evo-plist input[type="text"] {
245+
min-width: 120px;
246+
}
247+
248+
.evo-plist textarea {
246249
min-width: 120px;
247250
}
248251

@@ -712,12 +715,6 @@ table {
712715
border-spacing: 0;
713716
}
714717

715-
.evo-pagination li[data-id="prev"] a, .evo-pagination li[data-id="next"] a {
716-
font-size: 24px;
717-
line-height: 23px;
718-
padding: 1px 8px 4px;
719-
}
720-
721718
/* --- cards --- */
722719
.evol-cards-body > .panel {
723720
float: left;

dist/css/evolutility-ui-jquery.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/dependencies.min.js

Lines changed: 3 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/evolutility-ui-jquery.js

Lines changed: 136 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
2-
evolutility-ui-jquery 1.2.2
3-
(c) 2017 Olivier Giulieri
2+
evolutility-ui-jquery 1.2.3
3+
(c) 2019 Olivier Giulieri
44
http://evoluteur.github.io/evolutility-ui-jquery/
55
*/
66
// default config for Evolutility-UI-jQuery
@@ -13,13 +13,13 @@ Evol.Config = {
1313
localStorage: true,
1414

1515
// --- using evolutility-server-node
16-
//url: 'http://localhost:3000/api/v1/evolutility/'
16+
//url: 'http://localhost:2000/api/v1/'
1717

1818
};
1919
;
2020
// Evolutility-UI-jQuery Localization Library ENGLISH
2121
// https://github.com/evoluteur/evolutility-ui-jquery
22-
// (c) 2015 Olivier Giulieri
22+
// (c) 2017 Olivier Giulieri
2323

2424
var Evol = Evol || {};
2525

@@ -598,7 +598,7 @@ Evol.Format = {
598598
dd={"error": "Evol.Format.jsonString"};
599599
}
600600
if(dd===''){
601-
return dd;
601+
return dd;
602602
}else{
603603
//var txt=JSON.stringify(dd, null, '\t');
604604
var txt=JSON.stringify(dd, null, 2);
@@ -788,16 +788,7 @@ Evol.DOM = {
788788
}
789789
});
790790
return opts;
791-
}/*,
792-
793-
toggle: function (items) {
794-
var h=['<div class="btn-group" data-toggle="buttons">'];
795-
_.each(items, function(item){
796-
h.push('<label class="btn btn-info"><input type="radio" name="options" id="',item.id,'">',item.text,'</label>');
797-
});
798-
h.push('</div>');
799-
return h.join('');
800-
},*/
791+
}
801792
},
802793

803794
toggleCheckbox: function($cb, v){
@@ -824,13 +815,7 @@ Evol.DOM = {
824815
},
825816
buttonsPlusMinus: function(){
826817
return this.buttonsPlus()+this.buttonsMinus();
827-
},/*
828-
buttonsPrev: function(){
829-
return this.buttonsIcon('bPrev', 'chevron-left');
830818
},
831-
buttonsNext: function(){
832-
return this.buttonsIcon('bNext', 'chevron-right');
833-
},*/
834819

835820
// --- links ---
836821
link: function (id, label, url, target) {
@@ -2018,7 +2003,7 @@ return Backbone.View.extend({
20182003
};
20192004
h+='<li data-id="prev"'+
20202005
((pId===1)?' class="disabled"':'')+
2021-
'><a href="javascript:void(0)">&laquo;</a></li>';
2006+
'><a href="javascript:void(0)">&lt;</a></li>';
20222007
bPage(1);
20232008
if(pId>4 && nbPages>6){
20242009
if(pId===5){
@@ -2038,7 +2023,7 @@ return Backbone.View.extend({
20382023
}
20392024
h+='<li data-id="next"'+
20402025
((nbPages > pId) ? '' : ' class="disabled"')+
2041-
'><a href="javascript:void(0)">&raquo;</a></li>';
2026+
'><a href="javascript:void(0)">&gt;</a></li>';
20422027
}
20432028
return h;
20442029
},
@@ -4423,6 +4408,125 @@ Evol.ViewOne.Edit = Evol.View_One.extend({
44234408
*
44244409
*************************************************************************** */
44254410

4411+
Evol.ViewOne.JSON = Evol.View_One.extend({
4412+
4413+
events: {
4414+
'click > .evol-buttons > button': 'click_button',
4415+
'click .evol-title-toggle': 'click_toggle',
4416+
},
4417+
4418+
viewName: 'json',
4419+
icon: 'barcode', // glyphicon-barcode
4420+
4421+
render: function () {
4422+
var dom=Evol.DOM;
4423+
if(this.model){
4424+
var h = [],
4425+
jsonStr=JSON.stringify(this.model, null, 2);
4426+
4427+
h.push(dom.panelBegin({
4428+
id: 'p-json',
4429+
label:Evol.Format.capitalize(this.uiModel.name),
4430+
label2: 'JSON'
4431+
}, this.style+' evo-p-json', true)+
4432+
'<fieldset>'+
4433+
dom.label('uimjson', 'JSON')+
4434+
dom.input.textMJSON('uimjson', jsonStr, 16)+
4435+
'</fieldset>'+
4436+
dom.panelEnd());
4437+
4438+
h.push(syntaxHighlight(jsonStr));
4439+
4440+
this._renderButtons(h, 'json');
4441+
this.$el.html(h.join(''));
4442+
}else{
4443+
this.$el.html(dom.HTMLMsg(Evol.i18n.nodata, '', 'info'));
4444+
}
4445+
this.setData(this.model);
4446+
//this.custOn=false;
4447+
return this;
4448+
},
4449+
4450+
validate: function () {
4451+
var isValid=true,
4452+
data=this.getData(),
4453+
$fp=this._getDOMField().parent();
4454+
4455+
//this.clearMessages();
4456+
isValid=!Evol.DOM.addRemClass($fp, data===null, 'has-error');
4457+
this.$el.trigger('action', 'validate', {valid:isValid});
4458+
return isValid?[]:[Evol.i18n.validation.invalid];
4459+
},
4460+
4461+
getData: function () {
4462+
var jsonStr=this._getDOMField().val(),
4463+
obj;
4464+
4465+
if(jsonStr===''){
4466+
return jsonStr;
4467+
}
4468+
try{
4469+
obj=$.parseJSON(jsonStr);
4470+
}catch(err){
4471+
obj=null;
4472+
}
4473+
return obj;
4474+
},
4475+
4476+
setData: function (m) {
4477+
this.clearError()._getDOMField().val(JSON.stringify(m.toJSON(), null, 2));
4478+
return this.setTitle();
4479+
},
4480+
4481+
clear: function () {
4482+
this._getDOMField().val('');
4483+
return this;
4484+
},
4485+
4486+
clearError: function(){
4487+
this._getDOMField().parent().removeClass('has-error');
4488+
return this;
4489+
},
4490+
4491+
_getDOMField: function(){
4492+
return this.$('textarea');
4493+
}
4494+
4495+
});
4496+
4497+
function syntaxHighlight(json) {
4498+
if (typeof json != 'string') {
4499+
json = JSON.stringify(json, undefined, 2);
4500+
}
4501+
json = json.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
4502+
return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) {
4503+
var cls = 'number';
4504+
if (/^"/.test(match)) {
4505+
if (/:$/.test(match)) {
4506+
cls = 'key';
4507+
} else {
4508+
cls = 'string';
4509+
}
4510+
} else if (/true|false/.test(match)) {
4511+
cls = 'boolean';
4512+
} else if (/null/.test(match)) {
4513+
cls = 'null';
4514+
}
4515+
return '<span class="' + cls + '">' + match + '</span>';
4516+
});
4517+
}
4518+
;
4519+
/*! ***************************************************************************
4520+
*
4521+
* evolutility-ui-jquery :: one-json.js
4522+
*
4523+
* View "one json" to edit one backbone model in JSON.
4524+
*
4525+
* https://github.com/evoluteur/evolutility-ui-jquery
4526+
* (c) 2017 Olivier Giulieri
4527+
*
4528+
*************************************************************************** */
4529+
44264530
Evol.ViewOne.JSON = Evol.View_One.extend({
44274531

44284532
events: {
@@ -5692,6 +5796,12 @@ return Backbone.View.extend({
56925796
case fts.datetime:
56935797
fv.value=formattedDate(vval);
56945798
break;
5799+
case fts.int:
5800+
fv.value=vval && typeof(vval)==='string'?parseInt(vval):null;
5801+
break;
5802+
case fts.dec:
5803+
fv.value=vval && typeof(vval)==='string'?parseFloat(vval):null;
5804+
break;
56955805
default:
56965806
fv.value=vval;
56975807
}
@@ -6221,13 +6331,14 @@ return Backbone.View.extend({
62216331
var h,
62226332
isReadOnly=this.readonly!==false,
62236333
that=this,
6334+
itemName=this.uiModel.name||'item',
62246335
domm=dom.menu,
62256336
tb=this.buttons,
62266337
menuDivider='<li class="divider" data-cardi="x"></li>',
62276338
menuDividerH='<li class="divider-h"></li>';
62286339

62296340
function menuItem (m, noLabel){
6230-
return domm.hItem(m.id, noLabel?'':m.label, m.icon, m.n);
6341+
return domm.hItem(m.id, noLabel?'':((m.label=='New'?'New '+itemName:m.label)), m.icon, m.n);
62316342
}
62326343
function menuItems (ms, noLabel){
62336344
return _.map(ms, function(m){
@@ -6403,8 +6514,7 @@ return Backbone.View.extend({
64036514
collection: this.collection,
64046515
style: this.style,
64056516
titleSelector: this.titleSelector,
6406-
router: this.router//,
6407-
//iconsPath: this.iconsPath || ''
6517+
router: this.router
64086518
};
64096519
vw = new ViewClass(config).render();
64106520
break;

dist/evolutility-ui-jquery.min.js

Lines changed: 4 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ <h1 style="color:#BBDEFB;">A set of model-driven views to list, browse, edit, an
5959
</section>
6060

6161
<section id="s-intro">
62-
<p>Evolutility-UI-jQuery (currently v1.2.2) provides a set of generic Views ("V" as in "MVC") to
62+
<p>Evolutility-UI-jQuery (currently v1.2.3) provides a set of generic Views ("V" as in "MVC") to
6363
browse, edit, filter, export and chart
6464
data of different structures and volumes.
6565
</p>

0 commit comments

Comments
 (0)