evolutility
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "evolutility", | ||
"version": "1.0.1", | ||
"homepage": "https://github.com/evoluteur/evolutility", | ||
"version": "1.0.2", | ||
"description": "UI which changes form, volume and structure to adapt to your data.", | ||
"main": [ | ||
"dist/evolutility.min.js", | ||
"dist/css/evolutility.min.css" | ||
], | ||
"homepage": "http://evoluteur.github.io/evolutility/", | ||
"dependencies": { | ||
@@ -13,4 +18,9 @@ "jquery": "2.1.4", | ||
"bootstrap-datepicker": "1.4.0", | ||
"select2": "3.5.2" | ||
"select2": "3.5.2", | ||
"toastr": "2.1.1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/evoluteur/evolutility.git" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
/* evolutility v1.0.1 sample UI-models and data: todo, addressbook, wine cellar. */ | ||
var uiModels=uiModels||{};uiModels.todo_data=[{id:"1",title:"Release Evolutility v1",priority:"3",category:"others",complete:!1,description:"10 generic views + a ui-modeling language.",notes:""},{id:"2",title:"Fix open bugs",duedate:"2014-07-25",priority:"3",category:"work",complete:!1,description:"bla bla"},{id:"3",title:"Testing App",duedate:"2014-06-11",priority:"3",category:"work",complete:!1,description:"test"},{id:"4",title:"Prepare demo",duedate:"2014-05-12",priority:"1",category:"work",complete:!1,description:"Check this out"},{id:"5",title:"Test latest code",priority:"5",category:"misc",complete:!0,description:"notes for my test todo task."},{id:"6",title:"Car wash",priority:"4",category:"work",complete:!1},{id:"7",title:"Watch Inception",duedate:"2014-01-10",priority:"5",category:"fun",complete:!0},{id:"8",title:"Test TODO",duedate:"2015-01-01",priority:"1",category:"work",complete:!0,description:"Test TODO "},{id:"9",title:"Car wash",priority:"4",category:"work",complete:!1},{id:"10",title:"French translation",priority:"4",category:"work"},{id:"11",title:"Italian translation",priority:"4",category:"work"},{id:"12",title:"Chinese translation",priority:"4",category:"work"},{id:"13",title:"Japanese translation",priority:"4",category:"work"},{id:"14",title:"German translation",priority:"4",category:"work"},{id:"15",title:"Russian translation",priority:"4",category:"work"},{id:"16",title:"Polish translation",priority:"4",category:"work"},{id:"17",title:"Klingon translation",priority:"4",category:"work"},{id:"18",title:"Code optimization",duedate:"2015-01-01",priority:"4",category:"work",complete:!1},{id:"19",title:"Setup demo server",priority:"2",category:"work",complete:!1},{id:"20",title:"Add sample data",duedate:"2014-04-23",priority:"3",category:"work",complete:!0},{id:"21",title:"Make proposal",priority:"2",category:"misc",complete:!1},{id:"22",title:"Checkout cool restaurant",priority:"3",category:"home",complete:!1},{id:"23",title:"Kill the vampires",priority:"3",category:"others"}];var uiModels=uiModels||{};uiModels.contact_data=[{id:"1",lastname:"Smallwood",firstname:"Diane",jobtitle:"Director",company:"EasyDoesIt",email:"vsw@EasyDoesIt.com",phone:"415 234 4323",phonehome:"415 378 3577",phonecell:"415 135 3454",web:"http://EasyDoesIt.com",address1:"12, Liverpool Street",city:"San Francisco",state:"CA",zip:"94123",country:"US",category:"4"},{id:"2",lastname:"Shackleford ",firstname:"Rusty ",email:"rustyshackleford@gmail.com",address1:"123 Main Street",city:"Dallas",state:"TX",country:"US",category:"3"},{id:"3",lastname:"Inoue",firstname:"Akemi",jobtitle:"QA Engineer",company:"Testing evol-utility",email:"test@test.com",phone:"423 233 3523",phonehome:"423 523 4523",address1:"5665 Poplar Street",city:"San Jose",state:"CA",zip:"93112",country:"US",category:"3"},{id:"4",lastname:"Reina Moyano",firstname:"Sergio",jobtitle:"Mr",company:"Innova Creaciones",email:"sreina@innovacreaciones.es",phone:"411 444 2222",phonehome:"411 576 4566",phonecell:"411 579 4566",fax:"411 444 2224",address1:"654 Union Street",address2:"#203",city:"San Francisco",state:"CA",zip:"94567",country:"US",category:"3"},{id:"5",lastname:"Paulus",firstname:"Henry",company:"TEST the TEST",phone:"652 491 2345",address1:"1234 That Street",city:"San Mateo",state:"CA",zip:"94401",country:"US",category:"2"},{id:"6",lastname:"Dupond",firstname:"Patrick",jobtitle:"Sales Manager",company:"Au Bon Pain",email:"pdupond@aubonpain.fr",phone:"45 456 414 45",url:"http://aubonpain.fr",city:"Paris",state:"",country:"FR",category:"1"},{id:"7",lastname:"Giulieri",firstname:"Olivier",company:"Evolutility",city:"San Mateo",state:"",email:"olivier@evolutility.org",url:"http://www.evol-utility.org"},{id:"8",lastname:"Martin",firstname:"Mary",jobtitle:"President",company:"Acme Corp",email:"pm@acme.com",phone:"444 580 7007",phonehome:"449 512 0230",phonecell:"589 499 2065",address1:"123 Redville Lane",city:"Musnonville",state:"NH",zip:"03434",category:"1"},{id:"9",lastname:"Munar",firstname:"Roman",jobtitle:"Mr",company:"Informatics",email:"romano@informatics.com",phone:"322 234 5143",phonehome:"322 784 3453",phonecell:"322 538 2568",fax:"322 234 5345",url:"http://roman.munar.com",address1:"Washington",address2:"Buendia",city:"Makati",state:"",zip:"1300",country:"PH",category:"3"},{id:"10",lastname:"Smith",firstname:"George",company:"Blabla",email:"george@blabla.com",web:"http://www.blabla.com",phone:"415 123 1234",phonecell:"415 789 4556",address1:"768 5th Ave",city:"San Francisco",state:"CA",zip:"93123",country:"US",category:"1"},{id:"11",lastname:"Kumar",firstname:"Madhukar",jobtitle:"CEO",company:"CoolWeb",email:"mkumar@coolweb.com",web:"http://www.coolweb.com",phone:"7225 8252",phonecell:"7325 8245",address1:"434 Cool Place",city:"Bengaluru",state:"",country:"IN",category:"4"},{id:"12",lastname:"Cheng",firstname:"Chris",jobtitle:"CTO",company:"MyGreatCorporation",email:"ccheng@MyGreatCorporation.com",phonecell:"650 234 8245",city:"Sunnyvalle",state:"CA",country:"US",category:"4"}];var uiModels=uiModels||{};uiModels.winecellar_data=[{name:"Macrostie",label_img:"wine/macrostie.gif",vintage:2008,winery:"Mc Williams",bsize:"750",type:"red",price:20,grape:"chard",country:"US",region:"Sonoma",buying_date:"2008-05-12",value:24,purchased:24,remaining:16,drink_from:2009,drink_to:2020,peak_from:2014,peak_to:2017,degustations:[{ddate:"2008-05-08",robe:"light",nose:"fruity",taste:"fruity",notes:"too young"},{ddate:"2011-03-10",robe:"light",nose:"light fruit",taste:"",notes:""},{ddate:"2012-12-12",robe:"light",nose:"light fruit",taste:"",notes:"Great"}]},{name:"Château d'Yquem",label_img:"wine/yquem.gif",vintage:2012,winery:"Lur Saluces",bsize:"750",type:"white",grape:"sem",buying_date:"2012-12-12",price:399,value:460,drink_from:2012,drink_to:2017,purchased:3,remaining:1,country:"FR",region:"Bordeaux",area:"Sauternes and Barsac",score_parker:92,score_winespectator:94,degustations:[{ddate:"2013-04-23",robe:"golden",nose:"fruity",taste:"incredible"},{ddate:"2013-05-12",robe:"clear",nose:"strong and sweet",taste:"outstanding"}]},{name:"Château St Jean",label_img:"wine/stjean.gif",vintage:2008,winery:"Ch St Jean",bsize:"750",type:"red",price:34,value:32,purchased:12,remaining:5,drink_from:2009,grape:"shiraz",country:"FR",score_parker:68,score_winespectator:72,degustations:[{ddate:"2013-24-12",robe:"thick",nose:"strong",taste:"good",notes:"Great w/ beef."}]},{name:"Vine Cliff",label_img:"wine/vinecliff.gif",vintage:2013,winery:"Vine Cliff",bsize:"750",type:"red",buying_date:"2013-05-05",price:28,drink_from:2014,grape:"merlo",country:"US",score_parker:67,score_winespectator:62,degustations:[{ddate:"2013-05-05",robe:"light",nose:"strong",taste:"good"},{ddate:"2013-08-05",robe:"light",nose:"strong",taste:"good"},{ddate:"2013-08-18",robe:"light",nose:"strong",taste:"ok"}]},{name:"Château Montelena",label_img:"wine/montelena.gif",vintage:2005,winery:"Château Montelena",bsize:"1500",grape:"merlo",type:"red",drink_from:2005,region:"California",price:62,value:32,purchased:12,remaining:8,country:"US",score_parker:64,score_winespectator:64,degustations:[{ddate:"2012-05-05",nose:"strong+",taste:"excellent"},{ddate:"2013-10-22",robe:"rich",nose:"strong",taste:"very good"}]}];var uiModels=uiModels||{};uiModels.comics_data=[{title:"Do Androids Dream Of Electric Sheep?",genre:"sf",authors:"Philip K Dick, Tony Parker",complete:!0,finished:!0,have:"1-6",haveNb:6,serieNb:6,language:"EN",notes:"",pix:"comics/androitsheep1.jpeg"},{title:"Saga",genre:"sf",authors:"Brian K. Vaughan and Fiona Staples",complete:!1,finished:!1,have:"1-3",haveNb:3,serieNb:4,language:"EN",notes:"",pix:"comics/saga1.jpeg"},{title:"Alim le Tanneur",genre:"hf",authors:"Wilfrid Lupano, Virginie Augustin",complete:!0,finished:!0,have:"1-4",haveNb:4,serieNb:4,language:"FR",notes:"",pix:"comics/alim1.jpg"},{title:"La Caste des Meta-Barons",genre:"sf",authors:"Alexandro Jodorowsky et Juan Gimenez",complete:!1,finished:!0,have:"1-5",haveNb:5,serieNb:8,language:"FR",notes:"",pix:"comics/metabaron1.jpeg"},{title:"Garulfo",genre:"humor",have:"1-6",haveNb:6,serieNb:6,lang:"FR",authors:"Alain Ayroles et Bruno Maïorana",complete:!0,finished:!0,notes:"",pix:"comics/garulfo1.jpeg"},{title:"Lanfeust de Troy",genre:"hf",authors:"Didier Tarquin, Christophe Arleston",complete:!0,finished:!0,have:"1-8",haveNb:8,serieNb:8,language:"FR",notes:"",pix:"comics/lanfeust1.jpeg"},{title:"Salammbo",genre:"fantasy",authors:"Philippe Druillet et Gustave Flaubert",complete:!0,finished:!0,have:"1-3",haveNb:3,serieNb:3,language:"FR",notes:"",pix:"comics/salammbo1.jpeg"},{title:"Blacksad",genre:"pol",authors:"Juan Díaz Canales et Juanjo Guarnido",complete:!0,finished:!1,have:"1-4",haveNb:4,serieNb:4,language:"FR",notes:"",pix:"comics/blacksad1.jpeg"},{title:"Carmen McCallum",genre:"sf",authors:"Fred Duval et Gess",complete:!1,finished:!1,have:"1-5",haveNb:5,serieNb:12,language:"FR",notes:"",pix:"comics/carmenmc1.jpeg"},{title:"Code McCallum",genre:"sf",authors:"Fred Duval et Didier Cassegrain",complete:!0,finished:!0,have:"5",haveNb:5,serieNb:5,language:"FR",notes:"",pix:"comics/codemc1.jpeg"},{title:"La Nef des Fous",genre:"nocat",authors:"Turf",complete:!0,finished:!0,have:"1-7",haveNb:7,serieNb:7,language:"FR",notes:"",pix:"comics/neffous1.jpeg"},{title:"La Quete de l'Oiseau du Temps",genre:"hf",authors:"Serge Le Tendre et Régis Loisel",complete:!0,finished:!0,have:"1-4",haveNb:4,serieNb:4,language:"FR",notes:"",pix:"comics/quete1.jpeg"},{title:"Le Lama Blanc",genre:"adv",authors:"Alejandro Jodorowsky et Georges Bess",complete:!0,finished:!0,have:"1-6",haveNb:6,serieNb:6,language:"FR",notes:"",pix:"comics/lama1.jpeg"},{title:"Le Surfer d'Argent",genre:"sh",authors:"Moebius, Stan Lee",complete:!0,finished:!0,have:"1",haveNb:1,serieNb:1,language:"FR",notes:"",pix:"comics/surfer.jpeg"},{title:"L'Incal",genre:"sf",authors:"Moebius et Alexandro Jodorowsky",complete:!0,finished:!0,have:"1-6",haveNb:6,serieNb:6,language:"FR",notes:"",pix:"comics/incal1.jpeg"},{title:"Ou le regard ne porte pas",genre:"",authors:"Pont et Abolin",complete:!0,finished:!0,have:"1,2",haveNb:2,serieNb:2,language:"FR",notes:"",pix:"comics/regard1.jpeg"},{title:"Péma Ling",genre:"hist",authors:"Georges Bess",complete:!0,finished:!0,have:"1-5",haveNb:5,serieNb:5,language:"FR",notes:"",pix:"comics/pemaling1.jpeg"},{title:"Sky Doll",genre:"fantasy",authors:"Alessandro Barbucci et Barbara Canepa",complete:!0,finished:!0,have:"1-3",haveNb:3,serieNb:3,language:"FR",notes:"",pix:"comics/skydoll1.jpeg"},{title:"Ronin",genre:"sf",authors:"Franck Miller",complete:!0,finished:!0,have:"1",haveNb:1,serieNb:1,language:"EN",notes:"",pix:"comics/ronin.jpeg"},{title:"Rising Stars",genre:"sh",authors:"Joe Michael Straczynski, Christian Zanier, Keu Cha et Ken Lashley",complete:!0,finished:!0,have:"1",haveNb:1,serieNb:1,language:"EN",notes:"",pix:"comics/risingstars.jpeg"},{title:"Le Fleau des Dieux",genre:"sf",authors:"Valérie Mangin et Aleksa Gajic",complete:!0,finished:!0,have:"1-6",haveNb:6,serieNb:6,language:"FR",notes:"",pix:"comics/fleaudieux1.jpeg"},{title:"The Shaolin Cowboy",genre:"fantasy",authors:"Geof Darrow and Lana and Andy Wachowski",complete:!0,finished:!0,have:"1",haveNb:1,serieNb:1,language:"EN",notes:"",pix:"comics/shaolin-cowboy.jpeg"},{title:"Tales of an Imperfect Future",genre:"sf",authors:"Alfonso Font",complete:!0,finished:!0,have:"1",haveNb:1,serieNb:1,language:"EN",notes:"",pix:"comics/imperfect-future.jpeg"},{title:"Ghost in the Shell",genre:"sf",authors:"Masamune Shirow",complete:!1,finished:!0,have:"1",haveNb:1,serieNb:2,language:"EN",notes:"",pix:"comics/ghost-in-the-shell.jpeg"}]; | ||
/* evolutility v1.0.2 sample UI-models and data: todo, addressbook, wine cellar. */ | ||
var uiModels=uiModels||{};uiModels.todo_data=[{id:"1",title:"Release Evolutility v1",priority:"3",category:"others",complete:!1,description:"10 generic views + a ui-modeling language.",notes:""},{id:"2",title:"Fix open bugs",duedate:"2014-07-25",priority:"3",category:"work",complete:!1,description:"bla bla"},{id:"3",title:"Testing App",duedate:"2014-06-11",priority:"3",category:"work",complete:!1,description:"test"},{id:"4",title:"Prepare demo",duedate:"2014-05-12",priority:"1",category:"work",complete:!1,description:"Check this out"},{id:"5",title:"Test latest code",priority:"5",category:"misc",complete:!0,description:"notes for my test todo task."},{id:"6",title:"Car wash",priority:"4",category:"work",complete:!1},{id:"7",title:"Watch Inception",duedate:"2014-01-10",priority:"5",category:"fun",complete:!0},{id:"8",title:"Test TODO",duedate:"2015-01-01",priority:"1",category:"work",complete:!0,description:"Test TODO "},{id:"9",title:"Car wash",priority:"4",category:"work",complete:!1},{id:"10",title:"French translation",priority:"4",category:"work"},{id:"11",title:"Italian translation",priority:"4",category:"work"},{id:"12",title:"Chinese translation",priority:"4",category:"work"},{id:"13",title:"Japanese translation",priority:"4",category:"work"},{id:"14",title:"German translation",priority:"4",category:"work"},{id:"15",title:"Russian translation",priority:"4",category:"work"},{id:"16",title:"Polish translation",priority:"4",category:"work"},{id:"17",title:"Klingon translation",priority:"4",category:"work"},{id:"18",title:"Code optimization",duedate:"2015-01-01",priority:"4",category:"work",complete:!1},{id:"19",title:"Setup demo server",priority:"2",category:"work",complete:!1},{id:"20",title:"Add sample data",duedate:"2014-04-23",priority:"3",category:"work",complete:!0},{id:"21",title:"Make proposal",priority:"2",category:"misc",complete:!1},{id:"22",title:"Checkout cool restaurant",priority:"3",category:"home",complete:!1},{id:"23",title:"Kill the vampires",priority:"3",category:"others"}],"object"==typeof module&&"object"==typeof module.exports&&(module.exports=uiModels.todo_data);var uiModels=uiModels||{};uiModels.contact_data=[{id:"1",lastname:"Smallwood",firstname:"Diane",jobtitle:"Director",company:"EasyDoesIt",email:"vsw@EasyDoesIt.com",phone:"415 234 4323",phonehome:"415 378 3577",phonecell:"415 135 3454",web:"http://EasyDoesIt.com",address1:"12, Liverpool Street",city:"San Francisco",state:"CA",zip:"94123",country:"US",category:"4"},{id:"2",lastname:"Shackleford ",firstname:"Rusty ",email:"rustyshackleford@gmail.com",address1:"123 Main Street",city:"Dallas",state:"TX",country:"US",category:"3"},{id:"3",lastname:"Inoue",firstname:"Akemi",jobtitle:"QA Engineer",company:"Testing evol-utility",email:"test@test.com",phone:"423 233 3523",phonehome:"423 523 4523",address1:"5665 Poplar Street",city:"San Jose",state:"CA",zip:"93112",country:"US",category:"3"},{id:"4",lastname:"Reina Moyano",firstname:"Sergio",jobtitle:"Mr",company:"Innova Creaciones",email:"sreina@innovacreaciones.es",phone:"411 444 2222",phonehome:"411 576 4566",phonecell:"411 579 4566",fax:"411 444 2224",address1:"654 Union Street",address2:"#203",city:"San Francisco",state:"CA",zip:"94567",country:"US",category:"3"},{id:"5",lastname:"Paulus",firstname:"Henry",company:"TEST the TEST",phone:"652 491 2345",address1:"1234 That Street",city:"San Mateo",state:"CA",zip:"94401",country:"US",category:"2"},{id:"6",lastname:"Dupond",firstname:"Patrick",jobtitle:"Sales Manager",company:"Au Bon Pain",email:"pdupond@aubonpain.fr",phone:"45 456 414 45",url:"http://aubonpain.fr",city:"Paris",state:"",country:"FR",category:"1"},{id:"7",lastname:"Giulieri",firstname:"Olivier",company:"Evolutility",city:"San Mateo",state:"",email:"olivier@evolutility.org",url:"http://www.evol-utility.org"},{id:"8",lastname:"Martin",firstname:"Mary",jobtitle:"President",company:"Acme Corp",email:"pm@acme.com",phone:"444 580 7007",phonehome:"449 512 0230",phonecell:"589 499 2065",address1:"123 Redville Lane",city:"Musnonville",state:"NH",zip:"03434",category:"1"},{id:"9",lastname:"Munar",firstname:"Roman",jobtitle:"Mr",company:"Informatics",email:"romano@informatics.com",phone:"322 234 5143",phonehome:"322 784 3453",phonecell:"322 538 2568",fax:"322 234 5345",url:"http://roman.munar.com",address1:"Washington",address2:"Buendia",city:"Makati",state:"",zip:"1300",country:"PH",category:"3"},{id:"10",lastname:"Smith",firstname:"George",company:"Blabla",email:"george@blabla.com",web:"http://www.blabla.com",phone:"415 123 1234",phonecell:"415 789 4556",address1:"768 5th Ave",city:"San Francisco",state:"CA",zip:"93123",country:"US",category:"1"},{id:"11",lastname:"Kumar",firstname:"Madhukar",jobtitle:"CEO",company:"CoolWeb",email:"mkumar@coolweb.com",web:"http://www.coolweb.com",phone:"7225 8252",phonecell:"7325 8245",address1:"434 Cool Place",city:"Bengaluru",state:"",country:"IN",category:"4"},{id:"12",lastname:"Cheng",firstname:"Chris",jobtitle:"CTO",company:"MyGreatCorporation",email:"ccheng@MyGreatCorporation.com",phonecell:"650 234 8245",city:"Sunnyvalle",state:"CA",country:"US",category:"4"}],"object"==typeof module&&"object"==typeof module.exports&&(module.exports=uiModels.contact_data);var uiModels=uiModels||{};uiModels.winecellar_data=[{name:"Macrostie",label_img:"wine/macrostie.gif",vintage:2008,winery:"Mc Williams",bsize:"750",type:"red",price:20,grape:"chard",country:"US",region:"Sonoma",buying_date:"2008-05-12",value:24,purchased:24,remaining:16,drink_from:2009,drink_to:2020,peak_from:2014,peak_to:2017,degustations:[{ddate:"2008-05-08",robe:"light",nose:"fruity",taste:"fruity",notes:"too young"},{ddate:"2011-03-10",robe:"light",nose:"light fruit",taste:"",notes:""},{ddate:"2012-12-12",robe:"light",nose:"light fruit",taste:"",notes:"Great"}]},{name:"Château d'Yquem",label_img:"wine/yquem.gif",vintage:2012,winery:"Lur Saluces",bsize:"750",type:"white",grape:"sem",buying_date:"2012-12-12",price:399,value:460,drink_from:2012,drink_to:2017,purchased:3,remaining:1,country:"FR",region:"Bordeaux",area:"Sauternes and Barsac",score_parker:92,score_winespectator:94,degustations:[{ddate:"2013-04-23",robe:"golden",nose:"fruity",taste:"incredible"},{ddate:"2013-05-12",robe:"clear",nose:"strong and sweet",taste:"outstanding"}]},{name:"Château St Jean",label_img:"wine/stjean.gif",vintage:2008,winery:"Ch St Jean",bsize:"750",type:"red",price:34,value:32,purchased:12,remaining:5,drink_from:2009,grape:"shiraz",country:"FR",score_parker:68,score_winespectator:72,degustations:[{ddate:"2013-24-12",robe:"thick",nose:"strong",taste:"good",notes:"Great w/ beef."}]},{name:"Vine Cliff",label_img:"wine/vinecliff.gif",vintage:2013,winery:"Vine Cliff",bsize:"750",type:"red",buying_date:"2013-05-05",price:28,drink_from:2014,grape:"merlo",country:"US",score_parker:67,score_winespectator:62,degustations:[{ddate:"2013-05-05",robe:"light",nose:"strong",taste:"good"},{ddate:"2013-08-05",robe:"light",nose:"strong",taste:"good"},{ddate:"2013-08-18",robe:"light",nose:"strong",taste:"ok"}]},{name:"Château Montelena",label_img:"wine/montelena.gif",vintage:2005,winery:"Château Montelena",bsize:"1500",grape:"merlo",type:"red",drink_from:2005,region:"California",price:62,value:32,purchased:12,remaining:8,country:"US",score_parker:64,score_winespectator:64,degustations:[{ddate:"2012-05-05",nose:"strong+",taste:"excellent"},{ddate:"2013-10-22",robe:"rich",nose:"strong",taste:"very good"}]}],"object"==typeof module&&"object"==typeof module.exports&&(module.exports=uiModels.winecellar_data);var uiModels=uiModels||{};uiModels.comics_data=[{title:"Do Androids Dream Of Electric Sheep?",genre:"sf",authors:"Philip K Dick, Tony Parker",complete:!0,finished:!0,have:"1-6",haveNb:6,serieNb:6,language:"EN",notes:"",pix:"comics/androitsheep1.jpeg"},{title:"Saga",genre:"sf",authors:"Brian K. Vaughan and Fiona Staples",complete:!1,finished:!1,have:"1-3",haveNb:3,serieNb:4,language:"EN",notes:"",pix:"comics/saga1.jpeg"},{title:"Alim le Tanneur",genre:"hf",authors:"Wilfrid Lupano, Virginie Augustin",complete:!0,finished:!0,have:"1-4",haveNb:4,serieNb:4,language:"FR",notes:"",pix:"comics/alim1.jpg"},{title:"La Caste des Meta-Barons",genre:"sf",authors:"Alexandro Jodorowsky et Juan Gimenez",complete:!1,finished:!0,have:"1-5",haveNb:5,serieNb:8,language:"FR",notes:"",pix:"comics/metabaron1.jpeg"},{title:"Garulfo",genre:"humor",have:"1-6",haveNb:6,serieNb:6,lang:"FR",authors:"Alain Ayroles et Bruno Maïorana",complete:!0,finished:!0,notes:"",pix:"comics/garulfo1.jpeg"},{title:"Lanfeust de Troy",genre:"hf",authors:"Didier Tarquin, Christophe Arleston",complete:!0,finished:!0,have:"1-8",haveNb:8,serieNb:8,language:"FR",notes:"",pix:"comics/lanfeust1.jpeg"},{title:"Salammbo",genre:"fantasy",authors:"Philippe Druillet et Gustave Flaubert",complete:!0,finished:!0,have:"1-3",haveNb:3,serieNb:3,language:"FR",notes:"",pix:"comics/salammbo1.jpeg"},{title:"Blacksad",genre:"pol",authors:"Juan Díaz Canales et Juanjo Guarnido",complete:!0,finished:!1,have:"1-4",haveNb:4,serieNb:4,language:"FR",notes:"",pix:"comics/blacksad1.jpeg"},{title:"Carmen McCallum",genre:"sf",authors:"Fred Duval et Gess",complete:!1,finished:!1,have:"1-5",haveNb:5,serieNb:12,language:"FR",notes:"",pix:"comics/carmenmc1.jpeg"},{title:"Code McCallum",genre:"sf",authors:"Fred Duval et Didier Cassegrain",complete:!0,finished:!0,have:"5",haveNb:5,serieNb:5,language:"FR",notes:"",pix:"comics/codemc1.jpeg"},{title:"La Nef des Fous",genre:"nocat",authors:"Turf",complete:!0,finished:!0,have:"1-7",haveNb:7,serieNb:7,language:"FR",notes:"",pix:"comics/neffous1.jpeg"},{title:"La Quete de l'Oiseau du Temps",genre:"hf",authors:"Serge Le Tendre et Régis Loisel",complete:!0,finished:!0,have:"1-4",haveNb:4,serieNb:4,language:"FR",notes:"",pix:"comics/quete1.jpeg"},{title:"Le Lama Blanc",genre:"adv",authors:"Alejandro Jodorowsky et Georges Bess",complete:!0,finished:!0,have:"1-6",haveNb:6,serieNb:6,language:"FR",notes:"",pix:"comics/lama1.jpeg"},{title:"Le Surfer d'Argent",genre:"sh",authors:"Moebius, Stan Lee",complete:!0,finished:!0,have:"1",haveNb:1,serieNb:1,language:"FR",notes:"",pix:"comics/surfer.jpeg"},{title:"L'Incal",genre:"sf",authors:"Moebius et Alexandro Jodorowsky",complete:!0,finished:!0,have:"1-6",haveNb:6,serieNb:6,language:"FR",notes:"",pix:"comics/incal1.jpeg"},{title:"Ou le regard ne porte pas",genre:"",authors:"Pont et Abolin",complete:!0,finished:!0,have:"1,2",haveNb:2,serieNb:2,language:"FR",notes:"",pix:"comics/regard1.jpeg"},{title:"Péma Ling",genre:"hist",authors:"Georges Bess",complete:!0,finished:!0,have:"1-5",haveNb:5,serieNb:5,language:"FR",notes:"",pix:"comics/pemaling1.jpeg"},{title:"Sky Doll",genre:"fantasy",authors:"Alessandro Barbucci et Barbara Canepa",complete:!0,finished:!0,have:"1-3",haveNb:3,serieNb:3,language:"FR",notes:"",pix:"comics/skydoll1.jpeg"},{title:"Ronin",genre:"sf",authors:"Franck Miller",complete:!0,finished:!0,have:"1",haveNb:1,serieNb:1,language:"EN",notes:"",pix:"comics/ronin.jpeg"},{title:"Rising Stars",genre:"sh",authors:"Joe Michael Straczynski, Christian Zanier, Keu Cha et Ken Lashley",complete:!0,finished:!0,have:"1",haveNb:1,serieNb:1,language:"EN",notes:"",pix:"comics/risingstars.jpeg"},{title:"Le Fleau des Dieux",genre:"sf",authors:"Valérie Mangin et Aleksa Gajic",complete:!0,finished:!0,have:"1-6",haveNb:6,serieNb:6,language:"FR",notes:"",pix:"comics/fleaudieux1.jpeg"},{title:"The Shaolin Cowboy",genre:"fantasy",authors:"Geof Darrow and Lana and Andy Wachowski",complete:!0,finished:!0,have:"1",haveNb:1,serieNb:1,language:"EN",notes:"",pix:"comics/shaolin-cowboy.jpeg"},{title:"Tales of an Imperfect Future",genre:"sf",authors:"Alfonso Font",complete:!0,finished:!0,have:"1",haveNb:1,serieNb:1,language:"EN",notes:"",pix:"comics/imperfect-future.jpeg"},{title:"Ghost in the Shell",genre:"sf",authors:"Masamune Shirow",complete:!1,finished:!0,have:"1",haveNb:1,serieNb:2,language:"EN",notes:"",pix:"comics/ghost-in-the-shell.jpeg"}],"object"==typeof module&&"object"==typeof module.exports&&(module.exports=uiModels.comics_data); |
@@ -28,11 +28,27 @@ /*! *************************************************************************** | ||
function createSampleDataIfEmpty(entityName){ | ||
var lc = new Backbone.LocalStorage('evol-'+entityName), | ||
var M, MS; | ||
if(Evol.Config.localStorage){ | ||
var lc = new Backbone.LocalStorage('evol-'+entityName); | ||
M = Backbone.Model.extend({ | ||
localStorage: lc | ||
}), | ||
}); | ||
Ms = Backbone.Collection.extend({ | ||
model: M, | ||
localStorage: lc | ||
}), | ||
ms = new Ms(); | ||
}); | ||
}else{ | ||
M = new Backbone.Model({ | ||
urlRoot: Evol.Config.url+entityName | ||
}); | ||
Ms = Backbone.Collection.extend({ | ||
model: M, | ||
url: Evol.Config.url+entityName/*, | ||
sync : function(method, collection, options) { | ||
//options.dataType = "jsonp"; | ||
return Backbone.sync(method, collection, options); | ||
}*/ | ||
}); | ||
} | ||
var ms = new Ms(); | ||
ms.fetch({ | ||
@@ -42,3 +58,5 @@ success: function(collection){ | ||
if(collection.length===0){ | ||
Evol.UI.insertCollection(collection, uiModels[entityName+'_data']); | ||
_.each(uiModels[entityName+'_data'], function(d){ | ||
collection.create(d); | ||
}); | ||
} | ||
@@ -57,2 +75,3 @@ } | ||
} | ||
function hideUIModel(){ | ||
@@ -59,0 +78,0 @@ $('#uimodel').slideUp(); |
@@ -11,8 +11,8 @@ module.exports = function (grunt) { | ||
banner : '/* <%= pkg.name %> v<%= pkg.version %> */\n' + | ||
'/* <%= pkg.copyright %> */\n' + | ||
'/* https://github.com/evoluteur/evolutility */\n', | ||
banner : '/*!\n <%= pkg.name %> <%= pkg.version %> \n' + | ||
' <%= pkg.copyright %> \n' + | ||
' <%= pkg.homepage %> \n*/\n', | ||
bannerDependencies: '/*\n <%= pkg.name %> v<%= pkg.version %> dependencies: \n' + | ||
' bootstrap 3.3.4, jquery 2.1.4, backbone 1.1.2, backbone.localStorage v1.1.7, underscore 1.8.3, d3 3.5.5, bootstrap-datepicker" 1.4.0, select2 3.5.2. \n*/\n', | ||
bannerDependencies: '/*!\n <%= pkg.name %> <%= pkg.version %> dependencies: \n' + | ||
' bootstrap 3.3.4, jquery 2.1.4, backbone 1.1.2, backbone.localStorage v1.1.7, underscore 1.8.3, d3 3.5.5, bootstrap-datepicker" 1.4.0, select2 3.5.2, toastr 2.1.1. \n*/\n', | ||
@@ -53,3 +53,4 @@ // ************************************************************************************* | ||
'bower_components/bootstrap-datepicker/js/bootstrap-datepicker.js', | ||
'bower_components/select2/select2.js' | ||
'bower_components/select2/select2.js', | ||
'bower_components/toastr/toastr.js' | ||
], | ||
@@ -64,2 +65,6 @@ dest: '<%= pkg.target %>/dependencies.js' | ||
src: [ | ||
'js/dico/config.js', | ||
'js/dico/def.js', | ||
'js/dico/format.js', | ||
'js/dico/ui.js', | ||
@@ -76,3 +81,2 @@ 'js/dico/ui-*.js', | ||
'!js/view-one/one-wizard.js', // NOT ! here | ||
//'js/view-action/action.js', | ||
@@ -116,3 +120,20 @@ 'js/view-action/action-*.js', | ||
files: [ | ||
{expand: true, flatten: true, src: ['bower_components/bootstrap/dist/fonts/*'], dest: '<%= pkg.target %>/fonts/'} | ||
{ | ||
expand: true, | ||
flatten: true, | ||
src: [ | ||
'bower_components/bootstrap/dist/fonts/*' | ||
], | ||
dest: '<%= pkg.target %>/fonts/' | ||
}, | ||
{ | ||
expand: true, | ||
flatten: true, | ||
src: [ | ||
'bower_components/select2/select2-spinner.gif', | ||
'bower_components/select2/select2.png', | ||
'bower_components/select2/select2x2.png' | ||
], | ||
dest: '<%= pkg.target %>/css' | ||
} | ||
] | ||
@@ -202,4 +223,7 @@ } | ||
dev: { | ||
options: { | ||
banner: '<%= banner %>' | ||
}, | ||
files: { | ||
"dist/css/evolutility.css": "less/evol.less" | ||
"dist/css/evolutility.css": "less/evolutility.less" | ||
} | ||
@@ -212,3 +236,3 @@ }, | ||
}, | ||
prod: { | ||
dependencies: { | ||
options: { | ||
@@ -219,5 +243,13 @@ banner: '<%= bannerDependencies %>', | ||
files: { | ||
"dist/css/dependencies.min.css": "less/dependencies.less", | ||
"dist/css/evolutility.min.css": "less/evol.less" | ||
"dist/css/dependencies.min.css": "less/dependencies.less" | ||
} | ||
}, | ||
prod: { | ||
options: { | ||
banner: '<%= banner %>', | ||
//compress: true | ||
}, | ||
files: { | ||
"dist/css/evolutility.min.css": "less/evolutility.less" | ||
} | ||
} | ||
@@ -240,14 +272,34 @@ } | ||
// ************************************************************************************* | ||
// BUILD TASKS : dev prod | ||
// BUILD TASKS : dev prod demo dep | ||
// ************************************************************************************* | ||
// Default task(s). | ||
grunt.registerTask('default', ['dev']); | ||
grunt.registerTask('default', ['prod', 'dep']); | ||
// Dev task(s). | ||
grunt.registerTask('dev', ['concat:js', 'less:dev', 'less:demo']); | ||
grunt.registerTask('dev', [ | ||
'concat:js', | ||
'demo', | ||
'less:dev' | ||
]); | ||
grunt.registerTask('demo', [ | ||
'concat:demo', | ||
'less:demo', | ||
'uglify:demo' | ||
]); | ||
grunt.registerTask('prod', [ | ||
'jshint', | ||
'dev', | ||
'demo', | ||
'less:prod', | ||
'uglify:prod' | ||
]); | ||
grunt.registerTask('prod2', [ | ||
'dev', | ||
'uglify:prod' | ||
]); | ||
grunt.registerTask('dep', [ | ||
'less:dependencies', | ||
'concat:dependencies', | ||
'copy', | ||
'uglify:dependencies' | ||
]); | ||
// Prod task(s). | ||
grunt.registerTask('prod', ['jshint', 'copy', 'dev', 'concat:demo', 'concat:dependencies', 'less:prod', 'uglify']); | ||
}; | ||
@@ -27,3 +27,3 @@ /*! *************************************************************************** | ||
useRouter: true, | ||
pageSize:20, | ||
pageSize: 20, | ||
prefix: 'evol-' | ||
@@ -83,3 +83,4 @@ }, | ||
if(cView){ | ||
Evol.Dico.setRoute(this.router, cView.getTitle(), cView.uiModel.id, cView.viewName, id, triggerRoute); | ||
Evol.Dico.setRoute(this.router, cView.uiModel.id, cView.viewName, id, triggerRoute); | ||
Evol.Dico.setPageTitle(cView.getTitle()); | ||
}else{ | ||
@@ -163,12 +164,28 @@ alert('Error: Invalid route.'); | ||
createEntity: function($v, uiModel, data, defaultView, options, cb){ | ||
var that=this, | ||
lc = new Backbone.LocalStorage(this.prefix+uiModel.id), | ||
M = Backbone.Model.extend({ | ||
localStorage: lc | ||
}), | ||
Ms = Backbone.Collection.extend({ | ||
model: M, | ||
localStorage: lc | ||
}); | ||
var that=this, url, M, Ms; | ||
if(Evol.Config){ | ||
if(Evol.Config.localStorage){ | ||
var lc = new Backbone.LocalStorage(this.prefix+uiModel.id); | ||
M = Backbone.Model.extend({ | ||
localStorage: lc | ||
}); | ||
Ms = Backbone.Collection.extend({ | ||
model: M, | ||
localStorage: lc | ||
}); | ||
}else{ | ||
url = Evol.Config.url+uiModel.id; | ||
M = Backbone.Model.extend({ | ||
urlRoot: url | ||
}); | ||
Ms = Backbone.Collection.extend({ | ||
model: M, | ||
url: url | ||
}); | ||
} | ||
}else{ | ||
alert('Error: missing config file.'); | ||
} | ||
var ms = new Ms(); | ||
@@ -175,0 +192,0 @@ ms.fetch({ |
@@ -147,3 +147,3 @@ // Original code and blog post by Steve Hall http://www.delimited.io/blog/2013/12/19/force-bubble-charts-in-d3 | ||
}); | ||
}else if(Evol.Dico.isNumberType(f.type)){ | ||
}else if(Evol.Def.fieldIsNumber(f)){ | ||
centers = centers.sort(Evol.Dico.sortingNumber('name')); | ||
@@ -150,0 +150,0 @@ var c=_.findWhere(centers, {'name': null}); |
@@ -20,33 +20,7 @@ /*! *************************************************************************** | ||
i18n = Evol.i18n, | ||
fts={ | ||
text: 'text', | ||
textml: 'textmultiline', | ||
bool: 'boolean', | ||
int: 'integer', | ||
dec: 'decimal', | ||
money: 'money', | ||
date: 'date', | ||
datetime: 'datetime', | ||
time: 'time', | ||
lov: 'lov', | ||
list: 'list', // many values for one field (behave like tags - return an array of strings) | ||
html: 'html', | ||
formula:'formula', // soon to be a field attribute rather than a field type | ||
email: 'email', | ||
pix: 'image', | ||
//geoloc: 'geolocation', | ||
//doc:'document', | ||
url: 'url', | ||
color: 'color', | ||
hidden: 'hidden' | ||
//json: 'json', | ||
//rating: 'rating', | ||
//widget: 'widget' | ||
}; | ||
fts = Evol.Def.fieldTypes; | ||
return { | ||
fieldTypes: fts, | ||
fieldOneEdit: {// f, fid, fv, iconsPath | ||
fieldEdit: { | ||
field: function (f, fType, fid, fv) { | ||
@@ -104,3 +78,3 @@ return uiInput[fType](fid, fv, f, null); | ||
email: function (f, fid, fv) { | ||
return '<div class="input-group">'+uiInput.typeFlag(i18n.sgn_email)+ | ||
return '<div class="input-group">'+uiInput.typeFlag(i18n.msg.sgn_email)+ | ||
uiInput.text(fid, fv, f)+ | ||
@@ -126,3 +100,2 @@ '</div>'; | ||
color: function(f, fid, fv){ | ||
//return '<div id="',fid, '" class="form-control">',fv,'</div>'); | ||
return uiInput.color(fid, fv); | ||
@@ -160,7 +133,7 @@ }, | ||
default: | ||
h+=this.fieldHTML_ReadOny(fld, fv, {}, iconsPath); | ||
h+=this.fieldHTML_RO(fld, fv, {}, iconsPath); | ||
} | ||
h+=' </div>'; | ||
}else{ | ||
h+=Evol.Dico.fieldOneEdit[fld.type](fld, fid, fv, iconsPath); | ||
h+=Evol.Dico.fieldEdit[fld.type](fld, fid, fv, iconsPath); | ||
} | ||
@@ -170,3 +143,3 @@ return h; | ||
fieldHTML_ReadOny: function(f, v, hashLov, iconsPath, wId){ | ||
fieldHTML_RO: function(f, v, hashLov, iconsPath, wId){ | ||
switch(f.type){ | ||
@@ -201,7 +174,5 @@ case fts.bool: | ||
case fts.date: | ||
return eUI.formatDate(v); | ||
case fts.time: | ||
return eUI.formatTime(v); | ||
case fts.datetime: | ||
return eUI.formatDateTime(v); | ||
return Evol.Format[f.type+'String'](v); | ||
case fts.pix: | ||
@@ -243,3 +214,3 @@ if (v && v.length) { | ||
HTMLFieldLink: function (id, fld, value, icon, noLink, route) { | ||
fieldLink: function (id, fld, value, icon, noLink, route) { | ||
var h=''; | ||
@@ -266,68 +237,2 @@ if(!noLink){ | ||
// -- list of operator and function for filters | ||
fieldConditions: { | ||
// filter functions take parameters fv=fieldValue, cv=condition value, cv2 | ||
// -- equals | ||
'eq': function(fv, cv){ | ||
return cv==fv; | ||
}, | ||
// -- not equal | ||
'ne': function(fv, cv){ | ||
return cv!=fv; | ||
}, | ||
// -- > or after | ||
'gt': function(fv, cv){ | ||
return fv>cv; | ||
}, | ||
// -- < or before | ||
'lt': function(fv, cv){ | ||
return fv<cv; | ||
}, | ||
// -- between | ||
'bw': function(fv, cv, cv2){ | ||
return !(cv>fv || fv>cv2); | ||
}, | ||
// -- start w/ | ||
'sw': function(fv, cv){ | ||
return fv.toLocaleLowerCase().indexOf(cv)===0; | ||
}, | ||
// -- contains | ||
'ct': function(fv, cv){ | ||
if(fv){ | ||
return fv.toLocaleLowerCase().indexOf(cv)>-1; | ||
} | ||
return false; | ||
}, | ||
// -- finish w/ | ||
'fw': function(fv, cv){ | ||
var l1=fv.length, | ||
l2=cv.length; | ||
if (l1<l2){ | ||
return false; | ||
}else{ | ||
return fv.toLocaleLowerCase().substring(l1-l2)===cv; | ||
} | ||
}, | ||
// -- empty | ||
'null': function(fv, cv){ | ||
return fv=='' || _.isUndefined(fv); | ||
}, | ||
// -- not null | ||
'nn': function(fv, cv){ | ||
return !(_.isUndefined(fv) || fv==''); | ||
}, | ||
// -- in [] | ||
'in': function(fv, cv){ | ||
return _.contains(cv.split(','),fv); | ||
}, | ||
// -- true | ||
'1': function(fv, cv){ | ||
return fv; | ||
}, | ||
// -- false | ||
'0': function(fv, cv){ | ||
return !fv; | ||
} | ||
}, | ||
clearCacheLOV: function(){ | ||
@@ -344,47 +249,3 @@ Evol.hashLov={}; | ||
viewIsOne: function(viewName){ | ||
return viewName==='new' || viewName==='edit' || viewName==='browse' || viewName==='json'; | ||
}, | ||
viewIsMany: function(viewName){ | ||
return viewName==='list' || viewName==='cards' || viewName==='charts' || viewName==='bubbles'; | ||
}, | ||
fieldInCharts: function (f) { | ||
return (_.isUndefined(f.inCharts) || f.inCharts) && Evol.Dico.fieldChartable(f); | ||
}, | ||
fieldChartable: function (f) { | ||
return f.type===fts.lov || f.type===fts.bool || f.type===fts.int || f.type===fts.money; | ||
}, | ||
isNumberType: function(fType){ | ||
return fType===fts.int || fType===fts.dec || fType===fts.money; | ||
}, | ||
isDateOrTimeType: function(fType){ | ||
return fType === fts.date || fType === fts.datetime || fType === fts.time; | ||
}, | ||
// get all "shallow" fields (no sub collections) from a UI model | ||
getFields: function (uiModel, fnFilter) { | ||
var fs = []; | ||
function collectFields(te) { | ||
if (te && te.elements && te.elements.length > 0) { | ||
_.each(te.elements, function (te) { | ||
if(te.type!='panel-list'){ | ||
collectFields(te); | ||
} | ||
}); | ||
} else { | ||
fs.push(te); | ||
} | ||
} | ||
collectFields(uiModel); | ||
if (_.isFunction(fnFilter)) { | ||
fs= _.filter(fs, fnFilter); | ||
} | ||
return fs; | ||
}, | ||
getFieldTypedValue:function(f, $f){ | ||
getFieldVal:function(f, $f){ | ||
switch(f.type) { | ||
@@ -404,26 +265,2 @@ case fts.bool: | ||
}, | ||
// get sub collections | ||
getSubCollecs: function(uiModel){ | ||
var ls = {}; | ||
function collectCollecs(te) { | ||
if(te.type==='panel-list'){ | ||
ls[te.attribute]=te; | ||
}else if (te.type!=='panel' && te.elements && te.elements.length > 0) { | ||
_.each(te.elements, function (te) { | ||
if(te.type==='panel-list'){ | ||
ls[te.attribute]=te; | ||
}else if(te.type!=='panel'){ | ||
collectCollecs(te); | ||
} | ||
}); | ||
} else { | ||
ls[te.attribute]=te; | ||
} | ||
} | ||
collectCollecs(uiModel); | ||
return ls; | ||
}, | ||
/* | ||
@@ -524,4 +361,4 @@ compactUI: function(uiModel){ | ||
var t=uiModel.id || uiModel.name; | ||
var fields=this.getFields(uiModel); | ||
var sql='CREATE TABLE "Evolutility".'+t; | ||
var fields=Evol.Def.getFields(uiModel); | ||
var sql='CREATE TABLE '+t; | ||
sql+='\n(\n'; | ||
@@ -544,2 +381,5 @@ sql+=[' id serial NOT NULL,\n']; | ||
} | ||
if(f.required){ | ||
sql+=' not null'; | ||
} | ||
sql+=',\n'; | ||
@@ -553,3 +393,2 @@ }); | ||
*/ | ||
filterModels: function(models, filters){ | ||
@@ -602,17 +441,14 @@ if(filters.length){ | ||
}, | ||
sortingNumberDesc: function(fid){ | ||
sortingText: function(fid){ | ||
return function(modelA, modelB) { | ||
if(modelA[fid]>modelB[fid]){ | ||
return 1; | ||
} | ||
if(modelB[fid]>modelA[fid]){ | ||
return -1; | ||
} | ||
return 0; | ||
return (modelA[fid]||'').localeCompare(modelB[fid]||''); | ||
}; | ||
}, | ||
sortingText: function(fid){ | ||
//return (modelA.get(fid)||'').localeCompare(modelB.get(fid)||''); | ||
return this.sortingNumber(fid); | ||
setPageTitle: function(title){ | ||
if(_.isUndefined(this._$headTitle)){ | ||
this._$headTitle = $('#headTitle'); | ||
} | ||
this._$headTitle.html(title); | ||
}, | ||
@@ -626,4 +462,3 @@ | ||
setRoute: function(router, title, entity, view, opts, trigger){ | ||
// set route | ||
setRoute: function(router, entity, view, opts, trigger){ | ||
if(!_.isUndefined(router)){ | ||
@@ -638,7 +473,68 @@ var route = entity + '/' + view; | ||
} | ||
// set page title in head | ||
if(_.isUndefined(this._$headTitle)){ | ||
this._$headTitle = $('#headTitle'); | ||
}, | ||
// -- list of operator and function for filters | ||
fieldConditions: { | ||
// filter functions take parameters fv=fieldValue, cv=condition value, cv2 | ||
// -- equals | ||
'eq': function(fv, cv){ | ||
return cv==fv; | ||
}, | ||
// -- not equal | ||
'ne': function(fv, cv){ | ||
return cv!=fv; | ||
}, | ||
// -- > or after | ||
'gt': function(fv, cv){ | ||
return fv>cv; | ||
}, | ||
// -- < or before | ||
'lt': function(fv, cv){ | ||
return fv<cv; | ||
}, | ||
// -- between | ||
'bw': function(fv, cv, cv2){ | ||
return !(cv>fv || fv>cv2); | ||
}, | ||
// -- start w/ | ||
'sw': function(fv, cv){ | ||
return fv.toLocaleLowerCase().indexOf(cv)===0; | ||
}, | ||
// -- contains | ||
'ct': function(fv, cv){ | ||
if(fv){ | ||
return fv.toLocaleLowerCase().indexOf(cv)>-1; | ||
} | ||
return false; | ||
}, | ||
// -- finish w/ | ||
'fw': function(fv, cv){ | ||
var l1=fv.length, | ||
l2=cv.length; | ||
if (l1<l2){ | ||
return false; | ||
}else{ | ||
return fv.toLocaleLowerCase().substring(l1-l2)===cv; | ||
} | ||
}, | ||
// -- empty | ||
'null': function(fv, cv){ | ||
return fv=='' || _.isUndefined(fv); | ||
}, | ||
// -- not null | ||
'nn': function(fv, cv){ | ||
return !(_.isUndefined(fv) || fv==''); | ||
}, | ||
// -- in [] | ||
'in': function(fv, cv){ | ||
return _.contains(cv.split(','),fv); | ||
}, | ||
// -- true | ||
'1': function(fv, cv){ | ||
return fv; | ||
}, | ||
// -- false | ||
'0': function(fv, cv){ | ||
return !fv; | ||
} | ||
this._$headTitle.html(title); | ||
} | ||
@@ -645,0 +541,0 @@ |
@@ -52,4 +52,4 @@ /*! *************************************************************************** | ||
//'selection.many >div': 'click_select', | ||
'click .evo-search>.btn': 'click_search', | ||
'keyup .evo-search>input': 'key_search', | ||
//'click .evo-search>.btn': 'click_search', | ||
//'keyup .evo-search>input': 'key_search', | ||
'change.tab >div': 'change_tab', | ||
@@ -72,3 +72,3 @@ 'action >div': 'click_action', | ||
style: 'panel-info', | ||
display: 'label', // tooltip, text, icon, none | ||
display: 'label', // other possible values: tooltip, text, icon, none | ||
titleSelector: '#title', | ||
@@ -79,5 +79,5 @@ pageSize:20, | ||
{id: 'list', label: i18nTool.bList, icon:'th-list', n:'x'}, | ||
//{id: 'selections', label: i18nTool.Selections, icon:'star', n:'x'}, | ||
{id: 'new', label: i18nTool.bNew, icon:'plus', n:'x', readonly:false} | ||
], | ||
//linkOpt2h('selections','','star'); | ||
actions:[ | ||
@@ -135,3 +135,2 @@ //{id:'browse', label: i18nTool.bBrowse, icon:'eye', n:'1', readonly:false}, | ||
tb=this.buttons, | ||
endMenu='</ul></li>', | ||
menuDevider='<li class="divider" data-cardi="1"></li>', | ||
@@ -159,12 +158,12 @@ menuDeviderH='<li class="divider-h"></li>'; | ||
'<li class="evo-tb-status" data-cardi="n"></li>'; | ||
if(tb.search){ | ||
h+='<li><div class="input-group evo-search">'+ | ||
'<input class="evo-field form-control" type="text" maxlength="100">'+ | ||
'<span class="btn input-group-addon glyphicon glyphicon-search"></span>'+ | ||
if(tb.search){ | ||
h+='<li><div class="input-group evo-search">'+ | ||
'<input class="evo-field form-control" type="text" maxlength="100">'+ | ||
'<span class="btn input-group-addon glyphicon glyphicon-search"></span>'+ | ||
'</div></li>'; | ||
} | ||
} | ||
//h+=eUIm.hBegin('views','li','eye-open'); | ||
h+=menuItems(tb.prevNext); | ||
h+=menuDeviderH; | ||
h+=menuItems(tb.views, true); | ||
h+=menuItems(tb.prevNext)+ | ||
menuDeviderH+ | ||
menuItems(tb.views, true); | ||
//h+=menuDeviderH; | ||
@@ -179,3 +178,3 @@ //h+=eUIm.hItem('customize','','wrench', 'x', 'Customize'); | ||
link2h('new-panel','New Panel','plus'); | ||
h+=endMenu; | ||
h+='</ul></li>'; | ||
} */ | ||
@@ -283,3 +282,3 @@ | ||
.filter('[data-id="'+viewName+'"]').addClass('evo-sel'); | ||
if(Evol.Dico.viewIsMany(viewName)){ | ||
if(Evol.Def.isViewMany(viewName)){ | ||
//fieldsetFilter | ||
@@ -291,3 +290,2 @@ vw = new ViewClass(config) | ||
if(viewName!='charts' && viewName!='bubbles' && this.pageIndex > 0){ | ||
//var pIdx=this.curView.getPage(); | ||
vw.setPage(this.pageIndex || 0); | ||
@@ -451,3 +449,3 @@ } | ||
tbBs.del.hide(); | ||
if(Evol.Dico.viewIsMany(mode)){ | ||
if(Evol.Def.isViewMany(mode)){ | ||
this._prevViewMany=mode; | ||
@@ -463,11 +461,12 @@ oneMany(mode, false, true); | ||
// TODO finish disabling of paging buttons | ||
// use ui.addRemClass | ||
if(this.curView.pageIndex===0){ | ||
tbBs.prevNext.eq(0).addClass('disabled'); | ||
tbBs.prevNext.eq(0).addClass('disabled'); | ||
}else{ | ||
tbBs.prevNext.eq(0).removeClass('disabled'); | ||
tbBs.prevNext.eq(0).removeClass('disabled'); | ||
} | ||
if(this.collection.length/this.pageSize){ | ||
tbBs.prevNext.eq(1).addClass('disabled'); | ||
tbBs.prevNext.eq(1).addClass('disabled'); | ||
}else{ | ||
tbBs.prevNext.eq(1).removeClass('disabled'); | ||
tbBs.prevNext.eq(1).removeClass('disabled'); | ||
}*/ | ||
@@ -496,3 +495,3 @@ } | ||
var that=this, | ||
$ff=$(eUI.HTMLEmptyPanel('filters', 'evo-filters', 'info')); | ||
$ff=$(eUI.panelEmpty('filters', 'evo-filters', 'info')); | ||
this.$('.evo-toolbar').after($ff); | ||
@@ -542,4 +541,4 @@ this._filters = new Evol.ViewAction.Filter({ | ||
setStatus: function(msg){ | ||
var $e=this.$('.evo-toolbar .evo-tb-status'); | ||
$e.html(msg); | ||
this.$('.evo-toolbar .evo-tb-status') | ||
.html(msg); | ||
}, | ||
@@ -566,18 +565,38 @@ | ||
setModelById: function(id){ | ||
var m=this.collection.get(id); | ||
if(_.isUndefined(m)){ | ||
alert('Error: Invalid model ID.'); | ||
//TODO: do something | ||
var that = this, | ||
m, | ||
fnSuccess = function(){ | ||
// TODO set collection ?? | ||
that.model = m; | ||
if(that.curView.cardinality!='1'){ | ||
that.setView(that.defaultViewOne); | ||
} | ||
that.curView.setModel(m); | ||
eUI.scroll2Top(); | ||
}, | ||
fnError = function(){ | ||
alert('Error: Invalid model ID.'); | ||
}; | ||
if(Evol.Config.localStorage){ | ||
m = this.collection.get(id); | ||
if(_.isUndefined(m)){ | ||
fnError(); | ||
}else{ | ||
fnSuccess(); | ||
} | ||
}else{ | ||
this.model=m; | ||
if(this.curView.cardinality!='1'){ | ||
this.setView('browse');//(this._prevViewOne || 'edit'); | ||
} | ||
this.curView.setModel(m); | ||
// todo: decide change model for all views or model event | ||
var M = Backbone.Model.extend({ | ||
urlRoot: Evol.Config.url+that.uiModel.id | ||
}); | ||
m = new M({id:id}); | ||
m.fetch({ | ||
success: fnSuccess, | ||
error: fnError | ||
}); | ||
} | ||
return m; // TODO: return "this" ??? | ||
return this; | ||
}, | ||
browse: function(direction){ // direction = "prev" or "next" | ||
navPrevNext: function(direction){ // direction = "prev" or "next" | ||
var collec=this._curCollec(), | ||
@@ -603,3 +622,2 @@ cModel=this.curView.model; | ||
}else{ | ||
//eUI.modal.alert(i18n.notFound, i18n.getLabel('notFoundMsg', this.uiModel.name)); | ||
this.setMessage(i18n.notFound, i18n.getLabel('notFoundMsg', this.uiModel.name)); | ||
@@ -612,3 +630,4 @@ } | ||
setRoute: function(id, triggerRoute){ | ||
Evol.Dico.setRoute(this.router, this.curView.getTitle(), this.uiModel.id, this.curView.viewName, id, triggerRoute); | ||
Evol.Dico.setRoute(this.router, this.uiModel.id, this.curView.viewName, id, triggerRoute); | ||
Evol.Dico.setPageTitle(this.curView.getTitle()); | ||
return this; | ||
@@ -650,3 +669,4 @@ }, | ||
fnSuccess(m); | ||
that.setMessage(i18n.getLabel('saved', eUI.capitalize(entityName)), i18n.getLabel('status.added', entityName, _.escape(vw.getTitle())), 'success'); | ||
//that.collection.set(m, {remove:false}); | ||
that.setMessage(i18n.getLabel('saved', Evol.Format.capitalize(entityName)), i18n.getLabel('msg.added', entityName, _.escape(vw.getTitle())), 'success'); | ||
}, | ||
@@ -663,10 +683,13 @@ error:function(m, err){ | ||
// TODO fix bug w/ insert when filter applied => dup record | ||
this.model.set(this.getData(true)); | ||
this.model.save('','',{ | ||
var updateModel = this.getData(true); | ||
this.model.set(updateModel); | ||
this.model.save({}, { | ||
//patch: true, | ||
success: function(m){ | ||
fnSuccess(m); | ||
that.setMessage(i18n.getLabel('saved', eUI.capitalize(entityName)), i18n.getLabel('status.updated', eUI.capitalize(entityName), _.escape(vw.getTitle())), 'success'); | ||
that.collection.set(m, {remove:false}); | ||
that.setMessage(i18n.getLabel('saved', Evol.Format.capitalize(entityName)), i18n.getLabel('msg.updated', Evol.Format.capitalize(entityName), _.escape(vw.getTitle())), 'success'); | ||
}, | ||
error:function(m, err){ | ||
alert('error in "saveItem"'); | ||
error: function(m, err){ | ||
alert('Error '+err.status+' - '+err.statusText); | ||
} | ||
@@ -676,6 +699,4 @@ }); | ||
}else{ | ||
if (msgs.length > 0) { | ||
var msg = '<ul><li>'+msgs.join('</li><li>')+'</li></ul>'; // i18nVal.intro, | ||
this.setMessage(i18n.validation.incomplete, msg, 'warning'); | ||
} | ||
var msg = '<ul><li>'+msgs.join('</li><li>')+'</li></ul>'; | ||
this.setMessage(i18n.validation.incomplete, msg, 'warning'); | ||
} | ||
@@ -687,3 +708,3 @@ return this; | ||
var vw=this.curView; | ||
if(vw.viewName=='browse'){ | ||
if(vw.viewName==='browse'){ | ||
if(this._prevViewOne!=='browse' && this._prevViewOne!=='json'){ | ||
@@ -701,2 +722,3 @@ this.setView(this._prevViewOne); | ||
var that=this, | ||
uimId=this.uiModel.id, | ||
entityName=this.uiModel.name, | ||
@@ -706,3 +728,3 @@ entityValue=this.curView.getTitle(); | ||
if(this.curView.cardinality==='1'){ | ||
var delModel=this.curView.model; | ||
var delModel=this.model; | ||
if(delModel){ | ||
@@ -733,4 +755,4 @@ eUI.modal.confirm( | ||
} | ||
delModel.destroy({ | ||
success:function(){ | ||
var opts = { | ||
success: function(){ | ||
if(newModel===null || collec.length===0){ | ||
@@ -742,10 +764,15 @@ that.curView.clear(); | ||
} | ||
var eName=eUI.capitalize(entityName); | ||
that.setMessage(i18n.getLabel('deleted1', eName), i18n.getLabel('status.deleted', eName, entityValue), 'success'); | ||
var eName=Evol.Format.capitalize(entityName); | ||
that.setMessage(i18n.getLabel('deleted1', eName), i18n.getLabel('msg.deleted', eName, entityValue), 'success'); | ||
that._trigger('item.deleted'); | ||
}, | ||
error:function(m, err){ | ||
error: function(m, err){ | ||
alert('error in "deleteItem"'); | ||
} | ||
}); | ||
}; | ||
if(!Evol.Config.localStorage){ | ||
opts.url=that.model.url(); | ||
} | ||
collec.remove(delModel); | ||
delModel.destroy(opts); | ||
} | ||
@@ -769,11 +796,4 @@ } | ||
setMessage: function(title, content, style){ | ||
var $msg=this.$('[data-id="msg"]'); | ||
if($msg.length){ | ||
$msg.attr('class', 'evo-msg alert alert-'+style+' alert-dismissable'); | ||
$msg.find('>strong').text(title); | ||
$msg.find('>span').eq(0).html(content); //TODO text ? | ||
$msg.show(); | ||
}else{ | ||
$(eUI.HTMLMsg(title, ' '+content, style)).insertAfter(this.$el.children()[0]); | ||
} | ||
toastr.options.closeButton = true; | ||
toastr[style || 'info'](content, title); | ||
return this; | ||
@@ -874,9 +894,9 @@ }, | ||
_ok2go: function(){ | ||
if(this.curView && this.curView.editable && this.curView.isDirty && this.curView.isDirty()){ | ||
if(confirm(i18n.unSavedChanges)){ | ||
return true; | ||
} | ||
return false; | ||
} | ||
return true; | ||
if(this.curView && this.curView.editable && this.curView.isDirty && this.curView.isDirty()){ | ||
if(confirm(i18n.unSavedChanges)){ | ||
return true; | ||
} | ||
return false; | ||
} | ||
return true; | ||
},*/ | ||
@@ -907,3 +927,3 @@ | ||
this.proceedIfReady(function(){ | ||
that.browse(toolId); | ||
that.navPrevNext(toolId); | ||
}); | ||
@@ -910,0 +930,0 @@ }else if(this.curView.cardinality==='n'){ |
@@ -231,7 +231,3 @@ /*! *************************************************************************** | ||
linkEmail: function (id, email) { | ||
if(email){ | ||
return this.link(id, email, 'mailto:'+email); | ||
}else{ | ||
return ''; | ||
} | ||
return email ? this.link(id, email, 'mailto:'+email) : ''; | ||
}, | ||
@@ -246,6 +242,6 @@ //html_more: function (label) { | ||
}, | ||
/* | ||
iconCustomize: function (id, type) { | ||
return Evol.UI.iconId(id, type, 'wrench'); | ||
}, | ||
},*/ | ||
@@ -338,3 +334,3 @@ iconId: function (id, type, icon) { | ||
// --- panels --- | ||
HTMLPanelBegin: function (p, css, noToggle) { | ||
panelBegin: function (p, css, noToggle) { | ||
return '<div data-pid="'+p.id+'" class="panel '+(p.css?p.css:css)+'">'+ | ||
@@ -349,7 +345,7 @@ '<div class="panel-heading '+(p.cssLabel? p.cssLabel:'')+'">'+ | ||
HTMLPanelEnd: function () { | ||
panelEnd: function () { | ||
return '</div>'; | ||
}, | ||
HTMLEmptyPanel: function(id, css, style){ | ||
panelEmpty: function(id, css, style){ | ||
return '<div class="'+css+' panel panel-'+style+'" data-id="'+id+'"></div>'; | ||
@@ -365,36 +361,2 @@ }, | ||
// --- date formats --- | ||
formatDate: function(d){ | ||
if(!_.isUndefined(d) && d!==null){ | ||
var dateParts=d.split('-'); | ||
if(dateParts.length>1){ | ||
return dateParts[1]+'/'+dateParts[2]+'/'+dateParts[0]; | ||
} | ||
} | ||
return ''; | ||
}, | ||
formatTime: function(d){ | ||
if(!_.isUndefined(d) && d!==null && d!==''){ | ||
var timeParts=d.split(':'), | ||
hour=parseInt(timeParts[0],10); | ||
if(hour>12){ | ||
return (hour-12)+':'+timeParts[1]+' PM'; | ||
}else{ | ||
return hour+':'+timeParts[1]+' AM'; | ||
} | ||
} | ||
return ''; | ||
}, | ||
formatDateTime: function(d){ | ||
if(!_.isUndefined(d) && d!==null && d!==''){ | ||
var dateParts=d.split('T'); | ||
if(dateParts.length>1){ | ||
return this.formatDate(dateParts[0])+', '+this.formatTime(dateParts[1]); | ||
}else{ | ||
return this.formatDate(dateParts[0]); | ||
} | ||
} | ||
return ''; | ||
}, | ||
// --- Misc. --- | ||
@@ -413,26 +375,2 @@ /* | ||
// insert a dataSet into a Backbone collection | ||
insertCollection: function (collection, dataSet){ | ||
//if(collection.length===0){ | ||
_.each(dataSet,function(d){ | ||
collection.create(d); | ||
}); | ||
//} | ||
}, | ||
capitalize: function(word){ // TODO use _.str.capitalize(word); | ||
if(word && word.length>0){ | ||
//return _.capitalize(word); | ||
return word.substring(0,1).toUpperCase() + word.substring(1);//.toLowerCase(); | ||
} | ||
return ''; | ||
}, | ||
trim: function(stringValue){ // TODO use _.trim(word); | ||
if(_.isString(stringValue) && stringValue!==''){ | ||
return stringValue.replace(/^\s+|\s+$/g, ''); | ||
} | ||
return ''; | ||
}, | ||
setVisible: function($e, visible){ | ||
@@ -457,3 +395,8 @@ if(visible){ | ||
return doAdd; | ||
}, | ||
scroll2Top: function(){ | ||
window.scrollTo(0, 0); | ||
} | ||
}; |
@@ -20,5 +20,7 @@ // Evolutility Localization Library ENGLISH | ||
if(string1 && l){ | ||
l= l.replace('{0}',string1); | ||
l = l.replace('{0}', string1); | ||
//l = l.replace(/\{0\}/g, string1); | ||
if(string2){ | ||
l= l.replace('{1}',string2); | ||
l = l.replace('{1}', string2); | ||
//l = l.replace(/\{1\}/g, string2); | ||
} | ||
@@ -65,6 +67,12 @@ } | ||
vizColorBy: 'Color by', | ||
vizSizeBy: 'Size by' | ||
vizSizeBy: 'Size by', | ||
// --- wizard --- | ||
prev: 'Previous', | ||
next: 'Next', | ||
finish: 'Finish !' | ||
}, | ||
// --- msg & status --- | ||
//msg: { | ||
saved: '{0} saved.', | ||
@@ -93,2 +101,3 @@ unSavedTitle: 'Changes pending', | ||
nodata: 'No data available.', | ||
notEnoughdata: 'Not enough data available.', | ||
nopix: 'No picture.', | ||
@@ -99,10 +108,12 @@ nochart: 'No charts available.', | ||
selected: '{0} selected', | ||
'sgn_money': '$', // indicator for money | ||
'sgn_email': '@', // indicator for email | ||
//}, | ||
// --- status --- | ||
status:{ | ||
msg:{ | ||
sgn_money: '$', // indicator for money | ||
sgn_email: '@', // indicator for email | ||
added: 'New {0} "{1}" added.', | ||
updated: '{0} "{1}" updated.', | ||
deleted: '{0} "{1}" deleted.' | ||
//error: 'Error', | ||
}, | ||
@@ -134,5 +145,2 @@ | ||
// --- errors --- | ||
error: 'Error', | ||
// --- charts --- | ||
@@ -205,9 +213,4 @@ charts:{ | ||
bCancel: 'Cancel' | ||
}, | ||
}/*, | ||
// --- wizard --- | ||
prev: 'Previous', | ||
next: 'Next', | ||
finish: 'Finish !'/*, | ||
// --- documentation --- | ||
@@ -214,0 +217,0 @@ doc:{ |
@@ -315,1 +315,4 @@ var uiModels = uiModels || {}; | ||
if(typeof module === "object" && typeof module.exports === "object"){ | ||
module.exports = uiModels.comics_data; | ||
} |
@@ -76,7 +76,10 @@ var uiModels = uiModels || {}; | ||
formula:function(m){ | ||
var link=m.get('language')=='FR' ? | ||
'http://www.amazon.fr/s/ref=sr_nr_n_1?keywords=' | ||
:'http://www.amazon.com/s/ref=nb_sb_noss?field-keywords='; | ||
link+=encodeURI(m.get('title')+' '+m.get('authors')); | ||
return '<a target="a" href="'+link+'">'+link+'</a>'; | ||
if(m){ | ||
var urlData=m.get('title')+' '+(m.get('authors')||''), | ||
link=m.get('language')=='FR' ? | ||
'http://www.amazon.fr/s/ref=sr_nr_n_1?keywords=' | ||
:'http://www.amazon.com/s/ref=nb_sb_noss?field-keywords='; | ||
return '<a target="a" href="'+link+encodeURI(urlData)+'">'+_.escape(urlData)+'</a>'; | ||
} | ||
return 'N/A'; | ||
} | ||
@@ -101,1 +104,5 @@ }, | ||
}; | ||
if(typeof module === "object" && typeof module.exports === "object"){ | ||
module.exports = uiModels.comics; | ||
} |
@@ -173,1 +173,5 @@ var uiModels = uiModels || {}; | ||
}]; | ||
if(typeof module === "object" && typeof module.exports === "object"){ | ||
module.exports = uiModels.contact_data; | ||
} |
@@ -329,23 +329,29 @@ var contact_LOVs = { | ||
{ | ||
type: 'text', id: 'lastname', label: 'Lastname', maxLength: 50, | ||
type: 'text', id: 'lastname', attribute: 'lastname', | ||
label: 'Lastname', maxLength: 50, | ||
required: true, width: 62, inMany: true | ||
}, | ||
{ | ||
type: 'text', id: 'firstname', label: 'Firstname', maxLength: 50, | ||
type: 'text', id: 'firstname', attribute: 'firstname', | ||
label: 'Firstname', maxLength: 50, | ||
required: true, width: 38, inMany: true | ||
}, | ||
{ | ||
type: 'text', id: 'jobtitle', label: 'Title', maxLength: 50, | ||
type: 'text', id: 'jobtitle', attribute: 'jobtitle', | ||
label: 'Title', maxLength: 50, | ||
width: 62 | ||
}, | ||
{ | ||
type: 'text', id: 'company', label: 'Company', maxLength: 50, | ||
type: 'text', id: 'company', attribute: 'company', | ||
label: 'Company', maxLength: 50, | ||
width: 38, inMany: true | ||
}, | ||
{ | ||
type: 'email', id: 'email', label: 'email', maxLength: 255, | ||
type: 'email', id: 'email', attribute: 'email', | ||
label: 'email', maxLength: 255, | ||
width: 100, inMany: true | ||
}, | ||
{ | ||
type: 'url', id: 'web', label: 'web', maxLength: 255, width: 100 | ||
type: 'url', id: 'web', attribute: 'web', | ||
label: 'web', maxLength: 255, width: 100 | ||
} | ||
@@ -358,12 +364,16 @@ ] | ||
{ | ||
type: 'text', id: 'phone', label: 'Work Phone', maxLength: 20, width: 100, mini:'1' | ||
type: 'text', id: 'phone', attribute: 'phone', | ||
label: 'Work Phone', maxLength: 20, width: 100, mini:'1' | ||
}, | ||
{ | ||
type: 'text', id: 'phonehome', label: 'Home Phone', maxLength: 20, width: 100 | ||
type: 'text', id: 'phonehome', attribute: 'phonehome', | ||
label: 'Home Phone', maxLength: 20, width: 100 | ||
}, | ||
{ | ||
type: 'text', id: 'phonecell', label: 'Cell.', maxLength: 20, width: 100, mini:'1' | ||
type: 'text', id: 'phonecell', attribute: 'phonecell', | ||
label: 'Cell.', maxLength: 20, width: 100, mini:'1' | ||
}, | ||
{ | ||
type: 'text', id: 'fax', label: 'Fax', maxLength: 20, width: 100 | ||
type: 'text', id: 'fax', attribute: 'fax', | ||
label: 'Fax', maxLength: 20, width: 100 | ||
} | ||
@@ -376,19 +386,25 @@ ] | ||
{ | ||
type: 'text', id: 'address1', label: 'Address', maxLength: 150, width: 100 | ||
type: 'text', id: 'address1', attribute: 'address1', | ||
label: 'Address', maxLength: 150, width: 100 | ||
}, | ||
{ | ||
type: 'text', id: 'address2', label: '', labellist: 'Address 2', maxLength: 150, width: 100 | ||
type: 'text', id: 'address2', attribute: 'address2', | ||
label: '', labellist: 'Address 2', maxLength: 150, width: 100 | ||
}, | ||
{ | ||
type: 'text', id: 'city', label: 'City', maxLength: 100, width: 62 | ||
type: 'text', id: 'city', attribute: 'city', | ||
label: 'City', maxLength: 100, width: 62 | ||
}, | ||
{ | ||
type: 'lov', id: 'state', label: 'State', width: 23, | ||
type: 'lov', id: 'state', attribute: 'state', | ||
label: 'State', width: 23, | ||
list: contact_LOVs.states | ||
}, | ||
{ | ||
type: 'text', id: 'zip', label: 'Zip', maxLength: 12, width: 15 | ||
type: 'text', id: 'zip', attribute: 'zip', | ||
label: 'Zip', maxLength: 12, width: 15 | ||
}, | ||
{ | ||
type: 'lov', id: 'country', label: 'Country', maxLength: 60, width: 100, | ||
type: 'lov', id: 'country', attribute: 'country', | ||
label: 'Country', maxLength: 60, width: 100, | ||
list: contact_LOVs.countries | ||
@@ -402,3 +418,4 @@ } | ||
{ | ||
type: 'lov', id: 'category', label: 'Category', width: 100, | ||
type: 'lov', id: 'category', attribute: 'category', | ||
label: 'Category', width: 100, | ||
inMany: true, | ||
@@ -408,11 +425,14 @@ list: contact_LOVs.categories | ||
{ | ||
type: 'text', id: 'custom1', label: 'Custom 1', maxLength: 250, | ||
type: 'text', id: 'custom1', attribute: 'custom1', | ||
label: 'Custom 1', maxLength: 250, | ||
width: 100 | ||
}, | ||
{ | ||
type: 'text', id: 'custom2', label: 'Custom 2', maxLength: 250, | ||
type: 'text', id: 'custom2', attribute: 'custom2', | ||
label: 'Custom 2', maxLength: 250, | ||
width: 100 | ||
}, | ||
{ | ||
type: 'text', id: 'custom3', label: 'Custom 3', maxLength: 250, | ||
type: 'text', id: 'custom3', attribute: 'custom3', | ||
label: 'Custom 3', maxLength: 250, | ||
width: 100 | ||
@@ -424,1 +444,5 @@ } | ||
}; | ||
if(typeof module === "object" && typeof module.exports === "object"){ | ||
module.exports = uiModels.contact; | ||
} |
@@ -25,20 +25,2 @@ // Evolutility ui-model for a test object | ||
var fieldsPanelList = [ | ||
{id: 'pl1f1', type: 'text', label: 'Name', required:true, maxLength: 50}, | ||
{id: 'pl1f2', type: 'text', label: 'Text', required:true, maxLength: 100}, | ||
{id: 'pl1f3', type: 'lov', label: 'Sizes', required:true, list: testLOV} | ||
], | ||
fieldsPanelList2 = [ | ||
{id: 'pl2f1', type: 'text', label: 'Name', maxLength: 50}, | ||
{id: 'pl2f3', type: 'date', label: 'Date', inMany: true}, | ||
{id: 'pl2f4', type: 'boolean', label: 'Bool'}, | ||
{id: 'pl2f2', type: 'text', label: 'Text', maxLength: 100} | ||
], | ||
fieldsPanelList3 = [ | ||
{id: 'pl3f1', type: 'text', label: 'Name', maxLength: 50}, | ||
{id: 'pl3f2', type: 'integer', label: 'Integer'}, | ||
{id: 'pl3f3', type: 'money', label: 'Money'}, | ||
{id: 'pl3f4', type: 'lov', label: 'Sizes', list: testLOV} | ||
]; | ||
function fieldTypePanel(id, label, labelPanel, label2Panel, css){ | ||
@@ -50,2 +32,3 @@ var labelP = labelPanel || label || id, | ||
id: id+'1', | ||
attribute: id+'1', | ||
type: id, | ||
@@ -71,2 +54,3 @@ label: label+' 1', | ||
id: id+'3', | ||
attribute: id, | ||
type: id, | ||
@@ -79,3 +63,3 @@ label: label+' 3', | ||
if(id==='list' || id==='lov'){ | ||
fields= _.each(fields, function(f){ | ||
fields = _.each(fields, function(f){ | ||
f.list=testLOV; | ||
@@ -212,3 +196,3 @@ }); | ||
type: 'tab', | ||
label: 'Formula', | ||
label: 'Formulas', | ||
elements: [ | ||
@@ -310,3 +294,7 @@ { | ||
width: 100, | ||
elements: fieldsPanelList | ||
elements: [ | ||
{id: 'pl1f1', type: 'text', label: 'Name', required:true, maxLength: 50}, | ||
{id: 'pl1f2', type: 'text', label: 'Text', required:true, maxLength: 100}, | ||
{id: 'pl1f3', type: 'lov', label: 'Sizes', required:true, list: testLOV} | ||
] | ||
}, | ||
@@ -320,3 +308,8 @@ { | ||
width: 100, | ||
elements: fieldsPanelList2 | ||
elements: [ | ||
{id: 'pl2f1', type: 'text', label: 'Name', maxLength: 50}, | ||
{id: 'pl2f3', type: 'date', label: 'Date', inMany: true}, | ||
{id: 'pl2f4', type: 'boolean', label: 'Bool'}, | ||
{id: 'pl2f2', type: 'text', label: 'Text', maxLength: 100} | ||
] | ||
}, | ||
@@ -330,3 +323,8 @@ { | ||
width: 100, | ||
elements: fieldsPanelList3 | ||
elements: [ | ||
{id: 'pl3f1', type: 'text', label: 'Name', maxLength: 50}, | ||
{id: 'pl3f2', type: 'integer', label: 'Integer'}, | ||
{id: 'pl3f3', type: 'money', label: 'Money'}, | ||
{id: 'pl3f4', type: 'lov', label: 'Sizes', list: testLOV} | ||
] | ||
} | ||
@@ -338,1 +336,4 @@ ] | ||
if(typeof module === "object" && typeof module.exports === "object"){ | ||
module.exports = uiModels.test; | ||
} |
@@ -27,1 +27,5 @@ var uiModels = uiModels || {}; | ||
]; | ||
if(typeof module === "object" && typeof module.exports === "object"){ | ||
module.exports = uiModels.todo_data; | ||
} |
@@ -75,1 +75,5 @@ var uiModels = uiModels || {}; | ||
}; | ||
if(typeof module === "object" && typeof module.exports === "object"){ | ||
module.exports = uiModels.todo; | ||
} |
@@ -174,1 +174,6 @@ var uiModels = uiModels || {}; | ||
]; | ||
if(typeof module === "object" && typeof module.exports === "object"){ | ||
module.exports = uiModels.winecellar_data; | ||
} | ||
@@ -157,2 +157,3 @@ var winecellar_lovs = { | ||
id:'name', | ||
attribute:'name', | ||
type: 'text', | ||
@@ -168,2 +169,3 @@ label: 'Name', | ||
id:'vintage', | ||
attribute:'vintage', | ||
type: 'integer', | ||
@@ -192,2 +194,3 @@ label: 'Vintage', | ||
id:'winery', | ||
attribute:'winery', | ||
type: 'text', | ||
@@ -203,2 +206,3 @@ label: 'Winery', | ||
id:'bsize', | ||
attribute:'bsize', | ||
type: 'lov', | ||
@@ -212,2 +216,3 @@ label: 'Bottle Size', | ||
id:'grape', | ||
attribute:'grape', | ||
type: 'lov', | ||
@@ -221,2 +226,3 @@ label: 'Grape', | ||
id:'type', | ||
attribute:'type', | ||
type: 'lov', | ||
@@ -230,2 +236,3 @@ label: 'Type', | ||
id:'appellation', | ||
attribute:'appellation', | ||
type: 'text', | ||
@@ -238,2 +245,3 @@ label: 'Appellation', | ||
id:'country', | ||
attribute:'country', | ||
type: 'lov', | ||
@@ -246,2 +254,3 @@ label: 'Country', | ||
id:'region', | ||
attribute:'region', | ||
type: 'text', | ||
@@ -254,2 +263,3 @@ label: 'Region', | ||
id:'area', | ||
attribute:'area', | ||
type: 'text', | ||
@@ -270,2 +280,3 @@ label: 'Area', | ||
id:'label_img', | ||
attribute:'label_img', | ||
type: 'image', | ||
@@ -292,2 +303,3 @@ label: 'Label', | ||
id:'buying_date', | ||
attribute: 'buying_date', | ||
type: 'date', | ||
@@ -299,2 +311,3 @@ label: 'Buying Date', | ||
id:'price', | ||
attribute: 'price', | ||
type: 'money', | ||
@@ -307,2 +320,3 @@ label: 'Price', | ||
id:'value', | ||
attribute: 'value', | ||
type: 'money', | ||
@@ -314,2 +328,3 @@ label: 'Value', | ||
id:'purchased', | ||
attribute: 'purchased', | ||
type: 'integer', | ||
@@ -323,2 +338,3 @@ label: 'Bottles Purchased', | ||
id:'remaining', | ||
attribute: 'remaining', | ||
type: 'integer', | ||
@@ -333,2 +349,3 @@ label: 'Remaining', | ||
id:'notes', | ||
attribute: 'notes', | ||
type: 'textmultiline', | ||
@@ -357,2 +374,3 @@ label: 'Notes', | ||
id:'drink_from', | ||
attribute: 'drink_from', | ||
type: 'integer', | ||
@@ -370,2 +388,3 @@ label: 'Drink from (year)', | ||
id:'drink_to', | ||
attribute: 'drink_to', | ||
type: 'integer', | ||
@@ -381,2 +400,3 @@ label: 'to', | ||
id:'peak_from', | ||
attribute: 'peak_from', | ||
type: 'integer', | ||
@@ -392,2 +412,3 @@ label: 'Peak from', | ||
id:'peak_to', | ||
attribute: 'peak_to', | ||
type: 'integer', | ||
@@ -403,2 +424,3 @@ label: 'to', | ||
id:'meal', | ||
attribute: 'meal', | ||
type: 'textmultiline', | ||
@@ -420,2 +442,3 @@ label: 'Meal', | ||
id:'score', | ||
attribute: 'score', | ||
type: 'lov', | ||
@@ -430,2 +453,3 @@ label: 'My Score', | ||
id:'score_parker', | ||
attribute: 'score_parker', | ||
type: 'integer', | ||
@@ -441,2 +465,3 @@ label: 'Parker', | ||
id:'score_winespectator', | ||
attribute: 'score_winespectator', | ||
type: 'integer', | ||
@@ -487,2 +512,3 @@ label: 'Wine Spectator', | ||
id: 'comments', | ||
attribute: 'comments', | ||
type: 'textmultiline', | ||
@@ -500,1 +526,5 @@ label: 'Comments', | ||
}; | ||
if(typeof module === "object" && typeof module.exports === "object"){ | ||
module.exports = uiModels.winecellar; | ||
} |
@@ -222,1 +222,6 @@ // TODO cleanup | ||
}; | ||
if(typeof module === "object" && typeof module.exports === "object"){ | ||
module.exports = uiModels.entity; | ||
} | ||
@@ -20,3 +20,3 @@ function showIfNumber(m, uim){ | ||
{id:'list',text:"List (multi-select)", icon:'ft-list.gif'}, | ||
//{id:'html',text:"HTML", icon:'ft-htm.gif'}, | ||
{id:'html',text:"HTML", icon:'ft-htm.gif'}, | ||
{id:'email',text:"email", icon:'ft-email.gif'}, | ||
@@ -30,2 +30,3 @@ {id:'url',text:"Link", icon:'ft-url.gif'}, | ||
id:'field', | ||
table:'field', | ||
icon: "edi_fld.png", | ||
@@ -43,2 +44,3 @@ name: "field", | ||
id:'label', | ||
attribute:'label', | ||
label: "Label", | ||
@@ -54,2 +56,3 @@ type: "text", | ||
id: 'type', | ||
attribute: 'type', | ||
label: "Type", | ||
@@ -66,2 +69,3 @@ help: "Type of field: UI type rather than data type.", | ||
id: "attribute", | ||
attribute: 'attribute', | ||
label: "Attribute", | ||
@@ -76,2 +80,3 @@ help: "Attribute name in the Backbone model", | ||
id: 'eid', | ||
attribute: 'eid', | ||
label: "ID", | ||
@@ -86,2 +91,3 @@ labellist: "ID", | ||
id:'format', | ||
attribute:'attribute', | ||
label: "Format", | ||
@@ -102,2 +108,3 @@ type: "text", | ||
id:'position', | ||
attribute:'position', | ||
label: "Position", | ||
@@ -111,2 +118,3 @@ help: "Integer (do not have to be consecutive)", | ||
id:'inMany', | ||
attribute:'inMany', | ||
label: "List", | ||
@@ -121,2 +129,3 @@ help: "Field shows in lists", | ||
id:'width', | ||
attribute:'width', | ||
label: "Width", | ||
@@ -134,3 +143,3 @@ defaultValue: 100, | ||
label: "Height", | ||
help: "Height in number of lines (for ''Textmultiline'' fields)", | ||
help: 'Height in number of lines (for "Textmultiline" fields)', | ||
type: "integer", | ||
@@ -144,2 +153,3 @@ maxLength: 3, | ||
id: 'css', | ||
attribute: 'css', | ||
label: "CSS", | ||
@@ -161,2 +171,3 @@ labellist: "CSS Edit", | ||
id:'required', | ||
attribute:'required', | ||
label: "Required", | ||
@@ -172,2 +183,3 @@ //defaultValue: false, | ||
id:'readonly', | ||
attribute:'readonly', | ||
label: "Read only", | ||
@@ -182,2 +194,3 @@ defaultValue:false, | ||
id:'minLength', | ||
attribute:'minLength', | ||
label: "Min. length", | ||
@@ -190,2 +203,3 @@ help: "Minimum number of characters required", | ||
id:'maxLength', | ||
attribute:'maxLength', | ||
label: "Max. length", | ||
@@ -199,2 +213,3 @@ help: "Maximum number of characters allowed", | ||
id:'minvalue', | ||
attribute:'minvalue', | ||
label: "Min. value", | ||
@@ -212,2 +227,3 @@ help: "Minimum value allowed for the field", | ||
id:'maxvalue', | ||
attribute:'maxvalue', | ||
label: "Max. value", | ||
@@ -225,2 +241,3 @@ help: "Maximum value allowed for the field", | ||
id:'regExp', | ||
attribute:'regExp', | ||
label: "Regular Expression", | ||
@@ -235,2 +252,3 @@ labellist: "RegExp", | ||
id:'fnValidate', | ||
attribute:'fnValidate', | ||
label: "Custom Validation Method", | ||
@@ -252,2 +270,3 @@ type: "text", | ||
id: 'help', | ||
attribute: 'help', | ||
label: "Help", | ||
@@ -264,1 +283,5 @@ help: "Help on the field for edition", | ||
}; | ||
if(typeof module === "object" && typeof module.exports === "object"){ | ||
module.exports = uiModels.field; | ||
} |
// TODO cleanup | ||
// this is a port of XML from the ASP.net version | ||
var uiFieldTypes=[ // TODO ../dico/pix/ | ||
{id:'text',text:"Text", icon:'ft-txt.gif'}, | ||
{id:'textmultiline',text:"Text multiline", icon:'ft-txtml.gif'}, | ||
{id:'boolean',text:"Boolean", icon:'ft-bool.gif'}, | ||
{id:'decimal',text:"Decimal", icon:'ft-dec.gif'}, | ||
{id:'money',text:"Money", icon:'ft-money.gif'}, | ||
{id:'integer',text:"Integer", icon:'ft-int.gif'}, | ||
{id:'date',text:"Date", icon:'ft-date.gif'}, | ||
{id:'time',text:"Time", icon:'ft-time.gif'}, | ||
{id:'datetime',text:"Date-time", icon:'ft-datehm.gif'}, | ||
{id:'image',text:"Image", icon:'ft-img.gif'}, | ||
{id:'document',text:"Document", icon:'ft-doc.gif'}, | ||
{id:'color',text:"Color", icon:'ft-color.gif'}, | ||
{id:'lov',text:"List (dropdown)", icon:'ft-lov.gif'}, | ||
{id:'list',text:"List (multi-select)", icon:'ft-list.gif'}, | ||
//{id:'html',text:"HTML", icon:'ft-htm.gif'}, | ||
{id:'email',text:"email", icon:'ft-email.gif'}, | ||
{id:'url',text:"Link", icon:'ft-url.gif'}, | ||
{id:'hidden',text:"Hidden", icon:'ft-hidden.gif'} | ||
]; | ||
var uiModels=uiModels||{}; | ||
uiModels.object = { | ||
id: 'object', | ||
icon: "edi_frm.png", | ||
uiModels.entity = { | ||
id: 'entity', | ||
label: 'Object', | ||
icon: "cube.gif", | ||
name: "object", | ||
namePlural: "objects", | ||
fnTitle: "Title", | ||
fnTitle: "title", | ||
table: 'entity', | ||
elements: [ | ||
@@ -22,10 +46,19 @@ { | ||
type: "text", | ||
id: "Title", | ||
attribute: "Title", | ||
id: "title", | ||
attribute: "title", | ||
maxLength: 100, | ||
inMany: true, | ||
width: 80, | ||
width: 52, | ||
required: true | ||
}, | ||
{ | ||
label: "Id", | ||
type: "text", | ||
id: "id", | ||
attribute: "id", | ||
maxLength: 20, | ||
inMany: true, | ||
width: 18 | ||
}, | ||
{ | ||
label: "Active", | ||
@@ -37,13 +70,2 @@ type: "boolean", | ||
width: 20 | ||
}, | ||
{ | ||
label: "ID", | ||
help: "Primary Key in table 'EvoDico_Form'.", | ||
type: "text", | ||
id: "id", | ||
attribute: "id", | ||
maxLength: 100, | ||
inMany: true, | ||
width: 100, | ||
readonly: true | ||
} | ||
@@ -58,4 +80,4 @@ ] | ||
type: "panel", | ||
id: 'p-obj', | ||
label: "Object", | ||
id: 'p-def', | ||
label: "Definition", | ||
width: 100, | ||
@@ -104,7 +126,7 @@ elements: [ | ||
type: "textmultiline", | ||
id: "Description", | ||
attribute: "Description", | ||
id: "description", | ||
attribute: "description", | ||
maxLength: 250, | ||
width: 100, | ||
height: 7 | ||
height: 4 | ||
} | ||
@@ -118,2 +140,3 @@ ] | ||
label:'Fields', | ||
id:'tab-fields', | ||
elements: [ | ||
@@ -123,57 +146,41 @@ { | ||
type: "panel-list", | ||
id: "pl-fields", | ||
attribute: "obj-fields", | ||
id: "fields", | ||
attribute: "fields", | ||
width: 100, | ||
elements: [ | ||
{ | ||
"panelid": "14", | ||
label: "Label", | ||
label: "Attribute", | ||
type: "text", | ||
id: "Label", | ||
attribute: "Label", | ||
id: "attribute", | ||
attribute: "attribute", | ||
maxLength: 100, | ||
listmany:true | ||
//"link": "EvoDicoField.aspx?ID=@itemid" | ||
inMany:true, | ||
//"link": "EvoDicoField.aspx?ID=@itemid", | ||
required: true | ||
}, | ||
{ | ||
"panelid": "15", | ||
"dbwherelov": "EvoDico_vpanel.formID=@itemid", | ||
label: "Panel", | ||
type: "lov", | ||
id: "panelid", | ||
attribute: "panel", | ||
"dbtablelov": "EvoDico_vpanel", | ||
"dbcolumnreadlov": "label", | ||
maxLength: "50", | ||
"search": "1", | ||
"searchlist": "1", | ||
width: "50" | ||
label: "Label", | ||
type: "text", | ||
id: "label", | ||
attribute: "label", | ||
maxLength: 100, | ||
inMany:true, | ||
required: true | ||
}, | ||
{ | ||
"panelid": "16", | ||
label: "Type", | ||
type: "lov", | ||
"dbcolumnicon": "Typepix", | ||
id: "TypeID", | ||
attribute: "Type", | ||
"dbtablelov": "EvoDico_vFieldType", | ||
maxLength: "100", | ||
"search": "1", | ||
"searchlist": "1", | ||
"searchadv": "1", | ||
width: "60", | ||
id: "type", | ||
attribute: "type", | ||
width: 60, | ||
list:uiFieldTypes | ||
}, | ||
{ | ||
"panelid": "14", | ||
label: "Result List", | ||
label: "In List", | ||
help: "Field shows as header field for lists", | ||
"labellist": "List", | ||
type: "boolean", | ||
id: "searchlist", | ||
attribute: "searchlist", | ||
"search": "1", | ||
"searchlist": "1", | ||
"searchadv": "1", | ||
width: "50", | ||
id: "inMany", | ||
attribute: "inMany", | ||
width: 50, | ||
"img": "checkg.gif" | ||
@@ -183,25 +190,17 @@ }, | ||
"panelid": "14", | ||
label: "Search", | ||
label: "Required", | ||
type: "boolean", | ||
id: "search", | ||
attribute: "search", | ||
"search": "1", | ||
"searchlist": "1", | ||
"searchadv": "1", | ||
width: 100 | ||
id: "required", | ||
attribute: "required" | ||
}, | ||
{ | ||
"panelid": "14", | ||
label: "Position", | ||
label: "Max length", | ||
help: "Integer (gaps OK)", | ||
type: "integer", | ||
id: "fpos", | ||
attribute: "fpos", | ||
maxLength: "3", | ||
"search": "0", | ||
"searchlist": "1", | ||
id: "maxLength", | ||
attribute: "maxLength", | ||
maxLength: 3, | ||
width: 38 | ||
}, | ||
{ | ||
"panelid": "14", | ||
label: "Width", | ||
@@ -211,21 +210,14 @@ help: "Relative width in percentage", | ||
"format": "0 '%'", | ||
id: "Width", | ||
attribute: "Width", | ||
maxLength: "3", | ||
"search": "0", | ||
"searchlist": "1", | ||
"searchadv": "1", | ||
id: "width", | ||
attribute: "width", | ||
maxLength: 3, | ||
width: 62 | ||
}, | ||
{ | ||
"panelid": "14", | ||
label: "Height", | ||
help: "Height in number of lines (for ''Textmultiline'' fields)", | ||
type: "integer", | ||
id: "Height", | ||
attribute: "Height", | ||
id: "height", | ||
attribute: "height", | ||
maxLength: "3", | ||
"search": "0", | ||
"searchlist": "1", | ||
"searchadv": "1", | ||
width: 38 | ||
@@ -236,304 +228,10 @@ } | ||
] | ||
}, | ||
{ | ||
type: 'tab', | ||
id: 'tpanels', | ||
label: "Panels", | ||
elements: [ | ||
{ | ||
type: 'panel-list', | ||
"id": "p5", | ||
attribute: 'obj-panels', | ||
label: "Panels", | ||
width: 100, | ||
"dbtabledetails": "EvoDico_Panel", | ||
"dbcolumndetails": "FormID", | ||
"dborder": "t.ppos,t.id", | ||
elements: [ | ||
{ | ||
"panelid": "5", | ||
label: "Panel label", | ||
type: "text", | ||
id: "Label", | ||
attribute: "Label", | ||
maxLength: "100", | ||
"link": "EvoDicoPanel.aspx?ID=@itemid", | ||
"search": "1", | ||
"searchlist": "1", | ||
"searchadv": "1", | ||
width: 62 | ||
}, | ||
{ | ||
"panelid": "5", | ||
label: "Position", | ||
help: "Integer (gaps OK)", | ||
type: "integer", | ||
id: "ppos", | ||
attribute: "ppos", | ||
maxLength: "3", | ||
"search": "0", | ||
"searchlist": "1", | ||
"searchadv": "1", | ||
width: 38 | ||
}, | ||
{ | ||
"panelid": "5", | ||
label: "Width", | ||
type: "integer", | ||
id: "Width", | ||
attribute: "Width", | ||
maxLength: "3", | ||
"search": "0", | ||
"searchlist": "1", | ||
"searchadv": "1", | ||
width: "31" | ||
}, | ||
{ | ||
"panelid": "5", | ||
label: "CSS Class", | ||
"labellist": "CSS", | ||
type: "text", | ||
id: "cssclass", | ||
attribute: "cssclass", | ||
maxLength: "100", | ||
"searchadv": "1", | ||
width: 38 | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
type:'tab', | ||
label: "Database", | ||
elements:[ | ||
{ | ||
type:'panel', | ||
label: "Database", | ||
width: 38, | ||
elements: [ | ||
{ | ||
label: "DB Table", | ||
help: "Driving table", | ||
type: "text", | ||
id: "dbtable", | ||
attribute: "dbtable", | ||
maxLength: "100", | ||
"search": "1", | ||
"searchlist": "0", | ||
"searchadv": "1", | ||
width: 100, | ||
"height": "1", | ||
required: true | ||
}, | ||
{ | ||
label: "WHERE clause", | ||
help: "Example 'CategoryID=3'", | ||
"labellist": "Where", | ||
type: "text", | ||
id: "dbwhere", | ||
attribute: "dbwhere", | ||
maxLength: "50", | ||
"search": "0", | ||
"searchlist": "0", | ||
"searchadv": "1", | ||
width: 100, | ||
"height": "1" | ||
}, | ||
{ | ||
label: "ORDER BY clause", | ||
help: "Use 'T' for driving table alias. Example 'T.lastname,T.firstname'", | ||
"labellist": "Order", | ||
type: "text", | ||
id: "dborder", | ||
attribute: "dborder", | ||
maxLength: "50", | ||
"search": "0", | ||
"searchlist": "0", | ||
"searchadv": "1", | ||
width: 100, | ||
"height": "1" | ||
}, | ||
{ | ||
label: "Column used as title", | ||
help: "Title column", | ||
type: "text", | ||
id: "dbcolumnlead", | ||
attribute: "dbcolumnlead", | ||
maxLength: "100", | ||
"searchlist": "0", | ||
"searchadv": "1", | ||
width: 100, | ||
"height": "1" | ||
}, | ||
{ | ||
label: "Primary key name", | ||
help: "Usually ID", | ||
"labellist": "P.Key", | ||
type: "text", | ||
id: "dbcolumnpk", | ||
attribute: "dbcolumnpk", | ||
maxLength: "50", | ||
"search": "0", | ||
"searchlist": "0", | ||
"searchadv": "1", | ||
width: "50", | ||
"height": "1" | ||
}, | ||
{ | ||
label: "Icon Column", | ||
help: "Column used to store the name of a thumnail or icon specific to each record", | ||
type: "text", | ||
id: "dbColumnicon", | ||
attribute: "dbColumnicon", | ||
maxLength: "50", | ||
"search": "1", | ||
"searchlist": "0", | ||
"searchadv": "1", | ||
width: "50", | ||
"height": "1" | ||
}, | ||
{ | ||
label: "Users table", | ||
help: "Table storing users", | ||
type: "text", | ||
id: "dbtableusers", | ||
attribute: "dbtableusers", | ||
maxLength: "100", | ||
"searchlist": "0", | ||
"searchadv": "0", | ||
width: "50", | ||
"height": "1" | ||
}, | ||
{ | ||
label: "Comments table", | ||
help: "Table storing user comments", | ||
type: "text", | ||
id: "dbtablecomments", | ||
attribute: "dbtablecomments", | ||
maxLength: "100", | ||
"searchlist": "0", | ||
"searchadv": "0", | ||
width: "50", | ||
"height": "1" | ||
} | ||
] | ||
}, | ||
{ | ||
type:'panel', | ||
label: "Stored Procedures", | ||
width: 62, | ||
elements: [ | ||
{ | ||
label: "Paging", | ||
help: "Stored Procedure used for displaying selection lists", | ||
"labeledit": "Paging SP", | ||
type: "textmultiline", | ||
id: "spPaging", | ||
attribute: "spPaging", | ||
maxLength: "200", | ||
"search": "1", | ||
"searchlist": "0", | ||
"searchadv": "1", | ||
width: 100, | ||
"height": "4" | ||
}, | ||
{ | ||
label: "Login", | ||
help: "Stored Procedure used for user login", | ||
type: "textmultiline", | ||
"optional": "1", | ||
id: "spLogin", | ||
attribute: "spLogin", | ||
maxLength: "200", | ||
"search": "0", | ||
"searchlist": "0", | ||
"searchadv": "1", | ||
width: 100, | ||
"height": "2" | ||
}, | ||
{ | ||
label: "Get", | ||
help: "Stored Procedure used to get a single record", | ||
type: "textmultiline", | ||
id: "spGet", | ||
attribute: "spGet", | ||
maxLength: 200, | ||
"search": "0", | ||
"searchlist": "0", | ||
"searchadv": "1", | ||
width: 100, | ||
height: 2 | ||
}, | ||
{ | ||
label: "Delete", | ||
help: "Stored Procedure used to delete or disable a record", | ||
type: "textmultiline", | ||
"optional": "1", | ||
id: "spDelete", | ||
attribute: "spDelete", | ||
maxLength: "200", | ||
width: 100, | ||
height: 2 | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
type: 'tab', | ||
label: "User Help", | ||
elements: [ | ||
{ | ||
type: 'panel', | ||
label: "Help", | ||
width: 100, | ||
elements: [ | ||
{ | ||
label: "Help", | ||
help: "Help on the field (for edition)", | ||
"labeledit": "Help", | ||
type: "textmultiline", | ||
id: "Help", | ||
attribute: "Help", | ||
maxLength: "500", | ||
width: 100, | ||
height: 4 | ||
} | ||
] | ||
}, | ||
{ | ||
type: 'panel-list', | ||
width: 100, | ||
elements: { | ||
id: "fieldsHelp", | ||
label: "Fields help", | ||
width: 100, | ||
elements: [ | ||
{ | ||
label: "Label", | ||
type: "text", | ||
id: "Label", | ||
attribute: "Label", | ||
"readonly": "2", | ||
maxLength: 100, | ||
"searchlist": "1", | ||
"searchadv": "1", | ||
"link": "EvoDicoField.aspx?ID=@itemid" | ||
}, | ||
{ | ||
label: "Field Help", | ||
type: "textmultiline", | ||
maxLength: "500", | ||
id: "Help", | ||
attribute: "Help", | ||
"searchlist": "1" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}; | ||
if(typeof module === "object" && typeof module.exports === "object"){ | ||
module.exports = uiModels.entity; | ||
} | ||
@@ -14,3 +14,3 @@ /*! *************************************************************************** | ||
eDico = Evol.Dico, | ||
fts = eDico.fieldTypes, | ||
fts = Evol.Def.fieldTypes, | ||
uiInput = eUI.input, | ||
@@ -24,8 +24,7 @@ i18n = Evol.i18n, | ||
return eUI.fieldLabel(id, label) + | ||
uiInput.text(id, entity.replace(/ /g, '_'), 30) + | ||
'<br>'; | ||
uiInput.text(id, entity.replace(/ /g, '_'), 30); | ||
}, | ||
optsXML: function(entity){ | ||
return this.html_more2(i18nXpt.options)+ | ||
return '<div>'+//this.html_more2(i18nXpt.options)+ | ||
this.optEntityName('elementName', i18nXpt.XMLroot, entity)+ | ||
@@ -36,6 +35,7 @@ '</div>'; | ||
optsSQL: function(entity){ | ||
return this.html_more2(i18nXpt.options)+ | ||
return '<div>'+//this.html_more2(i18nXpt.options)+ | ||
this.optEntityName('table', i18nXpt.SQLTable, entity)+ | ||
'<div>'+uiInput.checkbox('insertId', '0')+eUI.fieldLabelSpan('insertId', i18nXpt.SQLIdInsert)+'</div>'+ | ||
'<div>'+uiInput.checkbox('transaction', '0')+eUI.fieldLabelSpan('transaction', i18nXpt.SQLTrans)+'</div>'+ | ||
'<div class="evo-inline-holder">'+ | ||
//'<div>'+uiInput.checkbox('insertId', '0')+eUI.fieldLabelSpan('insertId', i18nXpt.SQLIdInsert)+'</div>'+ | ||
'<div>'+uiInput.checkbox('transaction', '0')+eUI.fieldLabelSpan('transaction', i18nXpt.SQLTrans)+'</div>'+ | ||
'</div>'; | ||
@@ -64,3 +64,3 @@ }, | ||
events: { | ||
"change .evol-xpt-format": "click_format", | ||
'change .evol-xpt-format': 'click_format', | ||
'change input': 'click_preview', | ||
@@ -91,3 +91,3 @@ 'click .evol-xpt-more': 'click_toggle_sel', | ||
_renderHTML: function () { | ||
var h = [], | ||
var h = '', | ||
formats = this.formats, | ||
@@ -98,8 +98,8 @@ fields = this.getFields(), | ||
h.push('<div class="evol-xpt panel '+this.style+'"><div class="evol-xpt-form clearfix"><div class="evol-xpt-flds">'+ | ||
h+='<div class="evol-xpt panel '+this.style+'"><div class="evol-xpt-form clearfix"><div class="evol-xpt-flds">'+ | ||
'<div><label>'+i18nXpt.xpFields+'</label></div>'+ | ||
'<fieldset class="checkbox">'); | ||
'<fieldset class="checkbox">'; | ||
//### list of columns to export ######################################### | ||
h.push('<div><label><input type="checkbox" value="1" id="showID">'+i18nXpt.IDkey+'</label></div>'); | ||
h+='<div><label><input type="checkbox" value="1" id="showID">'+i18nXpt.IDkey+'</label></div>'; | ||
_.each(fields, function(f, idx){ | ||
@@ -111,11 +111,11 @@ var fLabel = f.labelexport || f.label || f.labellist, | ||
} | ||
h.push('<div><label><input type="checkbox" value="1" id="'+fID+'" checked="checked">'+fLabel+'</label></div>'); | ||
h+='<div><label><input type="checkbox" value="1" id="'+fID+'" checked="checked">'+fLabel+'</label></div>'; | ||
if (idx === 10 && useMore){ | ||
h.push(EvoExport.html_more2(i18nXpt.allFields)); | ||
h+=EvoExport.html_more2(i18nXpt.allFields); | ||
} | ||
}); | ||
if (useMore){ | ||
h.push('</div>'); | ||
h+='</div>'; | ||
} | ||
h.push('</fieldset></div><div class="evol-xpt-para">'); | ||
h+='</fieldset></div><div class="evol-xpt-para">'; | ||
//##### export formats ######################################## | ||
@@ -129,22 +129,22 @@ var fId = 'evol-xpt-format', | ||
}); | ||
h.push('<label for="'+fId+'">'+i18nXpt.format+'</label>'+ | ||
uiInput.select(fId, '', 'evol-xpt-format', false, formatsList)); | ||
h+='<label for="'+fId+'">'+i18nXpt.format+'</label>'+ | ||
uiInput.select(fId, '', 'evol-xpt-format', false, formatsList); | ||
fId = 'xptFLH'; | ||
h.push('<div class="evol-xpt-opts">'+ | ||
h+='<div class="evol-xpt-opts">'+ | ||
//# field (shared b/w formats - header ####### | ||
'<div class="evol-FLH clearfix">'+ | ||
'<label>'+uiInput.checkbox(fId, true)+i18nXpt.firstLine+'</label>'+ | ||
'<label>'+uiInput.checkbox(fId, true)+i18nXpt.firstLine+'</label>'+ | ||
//##### CSV, TAB - First line for field names ####### | ||
'</div><div id="xptCSV">'+ | ||
//# field - separator | ||
//# - csv - any separator ####### | ||
'<div data-id="csv2" class="evol-w120">'+ | ||
eUI.fieldLabel('separator', i18nXpt.separator)+ | ||
uiInput.text('separator', ',', '0')+ | ||
'</div>'+ // </div> | ||
'</div>'); | ||
'</div><div id="xptCSV" class="evol-xpt-opt">'+ | ||
//# field - separator | ||
//# - csv - any separator ####### | ||
'<div data-id="csv2" class="evol-w120">'+ | ||
eUI.fieldLabel('separator', i18nXpt.separator)+ | ||
uiInput.text('separator', ',', '0')+ | ||
'</div>'+ // </div> | ||
'</div>'; | ||
_.each(formats, function(f){ | ||
h.push('<div id="xpt'+f+'" style="display:none;"></div>'); | ||
h+='<div id="xpt'+f+'" style="display:none;"></div>'; | ||
}); | ||
h.push('</div>'+ | ||
h+='</div>'+ | ||
//# Preview ####### | ||
@@ -160,5 +160,4 @@ '<label>'+i18nXpt.preview+'</label><div class="evol-xpt-preview">'+ | ||
'</div>'+ | ||
'</div>' | ||
); | ||
return h.join(''); | ||
'</div>'; | ||
return h; | ||
}, | ||
@@ -197,3 +196,3 @@ | ||
if(!this.fields){ | ||
this.fields=eDico.getFields(this.uiModel, function(f){ | ||
this.fields=Evol.Def.getFields(this.uiModel, function(f){ | ||
return _.isUndefined(f.inExport) || f.inExport; | ||
@@ -246,3 +245,3 @@ }); | ||
case 'TXT': | ||
var sep = eUI.trim(this.$('#separator').val()); | ||
var sep = Evol.Format.trim(this.$('#separator').val()); | ||
if(format=='TAB'){ | ||
@@ -343,25 +342,51 @@ sep='	'; | ||
optIdInsert = this.$('#insertId').prop('checked'), | ||
crlf = '\n', | ||
sqlTable = this.$('#table').val().replace(/ /g,'_'), | ||
sql = ['INSERT INTO '+sqlTable+' (']; | ||
sql = 'INSERT INTO '+sqlTable+' (', | ||
//db = 'postgres',//'sqlserver' | ||
formatString, emptyString, sNull, beginTrans, commitTrans; | ||
/* | ||
switch(db){ | ||
case 'postgres':*/ | ||
formatString = function(v){ | ||
if(_.isUndefined(v) || v===null){ | ||
return "''"; | ||
}else{ | ||
return "'"+v.replace(/'/g, "''")+"'"; | ||
} | ||
}; | ||
sNull='null'; | ||
emptyString="''"; | ||
beginTrans='BEGIN;'; | ||
commitTrans='COMMIT;';/* | ||
break; | ||
case 'sqlserver': | ||
formatString = function(v){ | ||
return '"'+v.replace(/"/g, '""')+'"'; | ||
}; | ||
sNull='NULL'; | ||
emptyString='""'; | ||
beginTrans='BEGIN TRANSACTION'; | ||
commitTrans='COMMIT TRANSACTION'; | ||
break; | ||
}*/ | ||
if(sqlTable===''){ | ||
sqlTable = this.uiModel.name.replace(/ /g,'_'); | ||
sqlTable = this.uiModel.table || this.uiModel.id;//this.uiModel.name.replace(/ /g,'_'); | ||
} | ||
if(showID){ | ||
sql.push('ID, '); | ||
sql+='ID, '; | ||
} | ||
_.each(flds, function(f,idx){ | ||
sql.push(f.id); | ||
sql+=f.id; | ||
if(idx<fMax){ | ||
sql.push(', '); | ||
sql+=', '; | ||
} | ||
}); | ||
sql.push(')\n VALUES ('); | ||
sql = sql.join(''); | ||
sql+=')\n VALUES ('; | ||
// -- options | ||
if(optTransaction){ | ||
h+='BEGIN TRANSACTION\n'; | ||
h+=beginTrans+crlf; | ||
} | ||
if(optIdInsert){ | ||
h+='SET IDENTITY_INSERT '+sqlTable+' ON;\n'; | ||
h+='SET IDENTITY_INSERT '+sqlTable+' ON;'+crlf; | ||
} | ||
@@ -373,3 +398,3 @@ // -- data | ||
if(showID){ | ||
h+='"'+m.id+'", '; | ||
h+=formatString(fValue)+', '; | ||
} | ||
@@ -382,6 +407,6 @@ _.each(flds, function(f, idx){ | ||
case fts.money: | ||
h+=fValue?fValue:'NULL'; | ||
h+=fValue?fValue:sNull; | ||
break; | ||
case fts.bool: | ||
h+=(typeof fValue === 'boolean')?fValue:'NULL'; | ||
h+=(typeof fValue === 'boolean')?fValue:sNull; | ||
break; | ||
@@ -392,5 +417,5 @@ case fts.date: | ||
if(_.isUndefined(fValue)||fValue===''){ | ||
h+='NULL'; | ||
h+=sNull; | ||
}else{ | ||
h+='"'+fValue.replace(/"/g, '""')+'"'; | ||
h+=formatString(fValue); | ||
} | ||
@@ -400,12 +425,16 @@ break; | ||
if(_.isUndefined(fValue) || fValue===''|| (_.isArray(fValue) && fValue.length===0)){ | ||
h+='NULL'; | ||
h+=sNull; | ||
}else if(_.isNumber(fValue)){ | ||
h+=fValue; | ||
}else{ | ||
h+='"'+eDico.fieldHTML_ReadOny(f, fValue, Evol.hashLov, '').replace(/"/g, '""')+'"'; | ||
h+=formatString(eDico.fieldHTML_RO(f, fValue, Evol.hashLov, '')); | ||
} | ||
break; | ||
default: | ||
if(_.isUndefined(fValue)){ | ||
h+='""'; | ||
if(_.isUndefined(fValue)||fValue===''){ | ||
h+=emptyString; | ||
}else if(_.isNumber(fValue)){ | ||
h+=fValue; | ||
}else{ | ||
h+='"'+fValue.replace(/"/g, '""')+'"'; | ||
h+=formatString(fValue); | ||
} | ||
@@ -422,6 +451,6 @@ } | ||
if(optIdInsert){ | ||
h+='SET IDENTITY_INSERT '+sqlTable+' OFF;\n'; | ||
h+='SET IDENTITY_INSERT '+sqlTable+' OFF;'+crlf; | ||
} | ||
if(optTransaction){ | ||
h+='COMMIT TRANSACTION\n'; | ||
h+=commitTrans+crlf; | ||
} | ||
@@ -534,4 +563,5 @@ break; | ||
} | ||
}); | ||
}(); |
@@ -15,3 +15,3 @@ /*! *************************************************************************** | ||
uiInput = eUI.input, | ||
fts = Evol.Dico.fieldTypes, | ||
fts = Evol.Def.fieldTypes, | ||
evoLang = Evol.i18n.filters, | ||
@@ -57,3 +57,3 @@ fOps = { | ||
if(this.fields.length<1 && this.uiModel){ | ||
this.fields = _.map(Evol.Dico.getFields(this.uiModel, function(f){ | ||
this.fields = _.map(Evol.Def.getFields(this.uiModel, function(f){ | ||
return f.type!==fts.hidden; | ||
@@ -224,3 +224,3 @@ }), | ||
.button({ | ||
icons: {secondary:'ui-icon-close'} | ||
icons: {secondary:'ui-icon-close'} | ||
})*/ | ||
@@ -595,24 +595,2 @@ .data('filter', filter) | ||
}, | ||
/* | ||
valUrl: function(){ | ||
var vs=this.val(), | ||
iMax=vs.length, | ||
url=['filters=',iMax]; | ||
if(iMax<1){ | ||
return ''; | ||
} | ||
for(var i=0;i<iMax;i++){ | ||
var v=vs[i]; | ||
url.push( | ||
'&field-',i,'=',v.field.value, | ||
'&operator-',i,'=',v.operator.value, | ||
'&value-',i,'=',encodeURIComponent(v.value.value) | ||
); | ||
if(v.operator==fOps.sBetween){ | ||
url.push('&value2-',i,'=',encodeURIComponent(v.value.value2)); | ||
} | ||
} | ||
url.push('&label=',encodeURIComponent(this.valText())); | ||
return url.join(''); | ||
},*/ | ||
@@ -619,0 +597,0 @@ clear: function(){ |
@@ -12,3 +12,3 @@ /*! *************************************************************************** | ||
Evol.ViewMany.Bubbles = Evol.ViewMany.extend({ | ||
Evol.ViewMany.Bubbles = Evol.View_Many.extend({ | ||
@@ -28,3 +28,3 @@ viewName: 'bubbles', | ||
fieldsetFilter: Evol.Dico.fieldChartable, | ||
fieldsetFilter: Evol.Def.fieldChartable, | ||
@@ -34,7 +34,6 @@ setupBubbles: function() { | ||
ui=this.uiModel, | ||
eDico=Evol.Dico, | ||
models = this.collection.models; | ||
if(!this._bubblesInitialized){ | ||
var flds = eDico.getFields(this.uiModel, eDico.fieldChartable); | ||
var flds = Evol.Def.getFields(this.uiModel, Evol.Def.fieldChartable); | ||
this.bubbles = new Evol.Bubbles({ | ||
@@ -46,4 +45,4 @@ //selector:'.evol-bubbles-body', | ||
fields: flds, | ||
colorFieldId: flds[0].id, | ||
groupFieldId: flds[0].id, | ||
colorFieldId: flds.length?flds[0].id:null, | ||
groupFieldId: flds.length?flds[0].id:null, | ||
sizeFieldId: null, | ||
@@ -77,3 +76,3 @@ uiModel: this.uiModel, | ||
fo, | ||
fs2 = Evol.Dico.getFields(this.uiModel, Evol.Dico.fieldChartable), | ||
fs2 = Evol.Def.getFields(this.uiModel, Evol.Def.fieldChartable), | ||
h = '<div class="evol-many-bubbles panel '+this.style+'"><div class="evol-bubbles-body">'+ | ||
@@ -84,37 +83,39 @@ '<div class="d3-tooltip" style="opacity:0;"></div>'; | ||
h+='<div class="bubbles-opts '+this.style+'">'; | ||
// --- Group --- | ||
h+='<label>'+i18nTools.vizGroupBy+': </label>'; | ||
if(fs2.length>5){ | ||
if(fs2.length){ | ||
// --- Group --- | ||
h+='<label>'+i18nTools.vizGroupBy+': </label>'; | ||
if(fs2.length>5){ | ||
fo=_.map(fs2, function(f, idx){ | ||
return hOpt(f.id, f.label, idx===0); | ||
}); | ||
h+='<select class="form-control bubble-group">'+hOptNull + fo.join('')+'</select>'; | ||
}else{ | ||
h+='<div class="btn-group" data-toggle="buttons">'+ | ||
_.map(fs2, function(f, idx){ | ||
if(_.isUndefined(f.groupable) || f.groupable){ | ||
return '<label class="btn btn-default'+(idx===0?' active':'')+'" id="'+f.id+'">'+ | ||
'<input type="radio" name="options"'+(idx===0?' checked':'')+'>'+f.label+'</label>'; | ||
} | ||
}).join('')+ | ||
'</div>'; | ||
} | ||
// --- Color --- | ||
fo=_.map(fs2, function(f, idx){ | ||
return hOpt(f.id, f.label, idx===0); | ||
return (_.isUndefined(f.colorable) || f.colorable) ? hOpt(f.id, f.label, idx===0) : ''; | ||
}); | ||
h+='<select class="form-control bubble-group">'+hOptNull + fo.join('')+'</select>'; | ||
h+='<label>'+i18nTools.vizColorBy+': </label><select class="form-control bubble-color">'+hOptNull + fo.join('')+'</select>'; | ||
// --- Size --- | ||
fs2=_.filter(fs2, function(f){ | ||
return (_.isUndefined(f.sizable) || f.sizable) ? Evol.Def.fieldIsNumber(f) : ''; | ||
}); | ||
fo=_.map(fs2, function(f, idx){ | ||
return hOpt(f.id, f.label); | ||
}); | ||
if(fo.length){ | ||
h+='<label>'+i18nTools.vizSizeBy+': </label><select class="form-control bubble-size">'+hOptNull+fo.join('')+'</select>'; | ||
} | ||
//h+=Evol.UI.html.clearer; | ||
}else{ | ||
h+='<div class="btn-group" data-toggle="buttons">'+ | ||
_.map(fs2, function(f, idx){ | ||
if(_.isUndefined(f.groupable) || f.groupable){ | ||
return '<label class="btn btn-default'+(idx===0?' active':'')+'" id="'+f.id+'">'+ | ||
'<input type="radio" name="options"'+(idx===0?' checked':'')+'>'+f.label+'</label>'; | ||
} | ||
}).join('')+'</div>'; | ||
h+=Evol.i18n.notEnoughdata; | ||
} | ||
// --- Color --- | ||
fo=_.map(fs2, function(f, idx){ | ||
return (_.isUndefined(f.colorable) || f.colorable) ? hOpt(f.id, f.label, idx===0) : ''; | ||
}); | ||
h+='<label>'+i18nTools.vizColorBy+': </label><select class="form-control bubble-color">'+hOptNull + fo.join('')+'</select>'; | ||
// --- Size --- | ||
fs2=_.filter(fs2, function(f){ | ||
return (_.isUndefined(f.sizable) || f.sizable) ? Evol.Dico.isNumberType(f.type) : ''; | ||
}); | ||
fo=_.map(fs2, function(f, idx){ | ||
return hOpt(f.id, f.label); | ||
}); | ||
if(fo.length){ | ||
h+='<label>'+i18nTools.vizSizeBy+': </label><select class="form-control bubble-size">'+hOptNull+fo.join('')+'</select>'; | ||
} | ||
//h+=Evol.UI.html.clearer; | ||
h+='</div></div></div>'; | ||
@@ -121,0 +122,0 @@ this.$el.html(h); |
@@ -12,3 +12,3 @@ /*! *************************************************************************** | ||
Evol.ViewMany.Cards = Evol.ViewMany.extend({ | ||
Evol.ViewMany.Cards = Evol.View_Many.extend({ | ||
@@ -41,3 +41,3 @@ viewName: 'cards', | ||
v, | ||
fts = Evol.Dico.fieldTypes, | ||
fts = Evol.Def.fieldTypes, | ||
link = (this.links!==false); | ||
@@ -77,3 +77,3 @@ | ||
(selectable?that._HTMLCheckbox(model.id):'')+ | ||
Evol.Dico.HTMLFieldLink(null, f, v, icon, !link, route?route+model.id:null)+ | ||
Evol.Dico.fieldLink(null, f, v, icon, !link, route?route+model.id:null)+ | ||
'</h4></div>'); | ||
@@ -80,0 +80,0 @@ }else{ |
@@ -21,3 +21,3 @@ /*! *************************************************************************** | ||
return Evol.ViewMany.extend({ | ||
return Evol.View_Many.extend({ | ||
@@ -29,3 +29,3 @@ viewName: 'charts', | ||
style: 'panel-info', | ||
fieldsetFilter: EvoDico.fieldInCharts, | ||
fieldsetFilter: Evol.Def.fieldInCharts, | ||
autoUpdate: false | ||
@@ -40,3 +40,3 @@ }, | ||
render: function () { | ||
this.entityName=EvoUI.capitalize(this.uiModel.namePlural); | ||
this.entityName=Evol.Format.capitalize(this.uiModel.namePlural); | ||
if(this.collection && this.collection.length>0){ | ||
@@ -54,3 +54,3 @@ this.$el.html('<div class="evol-many-'+this.viewName+'">'+ | ||
var h='', | ||
fTypes = EvoDico.fieldTypes, | ||
fTypes = Evol.Def.fieldTypes, | ||
uiModel = this.uiModel, | ||
@@ -57,0 +57,0 @@ models = this.collection.models, |
@@ -12,3 +12,3 @@ /*! *************************************************************************** | ||
Evol.ViewMany.List = Evol.ViewMany.extend({ | ||
Evol.ViewMany.List = Evol.View_Many.extend({ | ||
@@ -54,3 +54,4 @@ viewName: 'list', | ||
link = (this.links!==false), | ||
ft = Evol.Dico.fieldTypes; | ||
ft = Evol.Def.fieldTypes, | ||
input = Evol.UI.input; | ||
@@ -63,5 +64,5 @@ h.push('<tr data-mid="'+model.id+'">'); | ||
if(f.type===ft.color){ | ||
v = Evol.UI.input.colorBox(f.id, model.escape(f.attribute || f.id)); | ||
v = input.colorBox(f.id, model.escape(f.attribute || f.id)); | ||
}else if(f.type===ft.formula){ | ||
v = Evol.UI.input.formula(null, f, model); | ||
v = input.formula(null, f, model); | ||
}else if(f.value){ | ||
@@ -73,3 +74,3 @@ v = f.value(model); | ||
if(idx===0){ | ||
v = Evol.Dico.HTMLFieldLink(null, f, v, icon, !link, route?route+model.id:null); | ||
v = Evol.Dico.fieldLink(null, f, v, icon, !link, route?route+model.id:null); | ||
// Item badge | ||
@@ -89,3 +90,3 @@ if(bf){ | ||
css+=' evol-ellipsis'; | ||
}else if(Evol.Dico.isNumberType(f.type)){ | ||
}else if(Evol.Def.fieldIsNumber(f)){ | ||
css+=' evol-r-align'; | ||
@@ -92,0 +93,0 @@ } |
@@ -14,4 +14,6 @@ /*! *************************************************************************** | ||
Evol.ViewMany = function() { | ||
Evol.ViewMany = {}; | ||
Evol.View_Many = function() { | ||
var eUI = Evol.UI, | ||
@@ -25,3 +27,3 @@ eDico = Evol.Dico, | ||
viewType: 'many', | ||
editable: false, | ||
//editable: false, | ||
cardinality: 'n', | ||
@@ -95,4 +97,2 @@ | ||
models = this.collection.models, | ||
model, | ||
r, | ||
rMin = (pageIdx > 0) ? pageIdx * pSize : 0, | ||
@@ -104,5 +104,4 @@ rMax = _.min([models.length, rMin + pSize]), | ||
var route = this.getItemRoute(); | ||
for (r = rMin; r < rMax; r++) { | ||
model = models[r]; | ||
this.HTMLItem(h, fields, model, ico, selectable, route); | ||
for (var r = rMin; r < rMax; r++) { | ||
this.HTMLItem(h, fields, models[r], ico, selectable, route); | ||
} | ||
@@ -127,3 +126,3 @@ } | ||
}else{ | ||
fv = eDico.fieldHTML_ReadOny(f, v, Evol.hashLov, this.iconsPath || ''); | ||
fv = eDico.fieldHTML_RO(f, v, Evol.hashLov, this.iconsPath || ''); | ||
if (f.type === 'list') { | ||
@@ -175,3 +174,3 @@ return _.escape(fv); | ||
// -- returns a string like "Contacts list" | ||
return eUI.capitalize(this.uiModel.namePlural) + ' ' + this.viewName; | ||
return Evol.Format.capitalize(this.uiModel.namePlural) + ' ' + this.viewName; | ||
}, | ||
@@ -181,3 +180,3 @@ | ||
if (!this._fields) { | ||
this._fields = eDico.getFields(this.uiModel, this.fieldsetFilter); | ||
this._fields = Evol.Def.getFields(this.uiModel, this.fieldsetFilter); | ||
this._fieldHash = {}; | ||
@@ -233,11 +232,9 @@ var fh = this._fieldHash; | ||
// - param: sel = array of ids like ['1','2'] | ||
if (this.selectable) { | ||
if (sel.length > 0) { | ||
// TODO optimize and uncheck prev checked | ||
var selector = []; | ||
_.each(sel, function (id) { | ||
selector.push('[data-mid=' + id + '] .list-sel'); | ||
}); | ||
this.$(selector.join(',')).prop('checked', true); | ||
} | ||
if (this.selectable && sel.length > 0) { | ||
// TODO optimize and uncheck prev checked | ||
var selector = []; | ||
_.each(sel, function (id) { | ||
selector.push('[data-mid=' + id + '] .list-sel'); | ||
}); | ||
this.$(selector.join(',')).prop('checked', true); | ||
} | ||
@@ -325,6 +322,6 @@ return this; | ||
var collec = this.collection, | ||
ft = eDico.fieldTypes; | ||
fts = Evol.Def.fieldTypes; | ||
if (!_.isUndefined(collec)) { | ||
var sel = this.getSelection(); | ||
if (f.type == ft.text || f.type == ft.textml || f.type == ft.email) { | ||
if (f.type == fts.text || f.type == fts.textml || f.type == fts.email) { | ||
collec.comparator = eDico.bbComparatorText(f.id); | ||
@@ -354,9 +351,6 @@ } else if (f.value) { | ||
getItemRoute: function () { | ||
var router = this.router, | ||
route = null; | ||
if (router) { | ||
route = '#' + this.uiModel.id + '/browse/'; | ||
if (this.router) { | ||
return '#' + this.uiModel.id + '/browse/'; | ||
} | ||
return route; | ||
return null; | ||
}, | ||
@@ -363,0 +357,0 @@ |
@@ -12,3 +12,3 @@ /*! *************************************************************************** | ||
Evol.ViewOne.Browse = Evol.ViewOne.extend({ | ||
Evol.ViewOne.Browse = Evol.View_One.extend({ | ||
@@ -28,4 +28,4 @@ viewName: 'browse', | ||
uii=Evol.UI.input, | ||
fts = Evol.Dico.fieldTypes, | ||
fieldHTML_ReadOny = Evol.Dico.fieldHTML_ReadOny, | ||
fts = Evol.Def.fieldTypes, | ||
fieldHTML_ReadOnly = Evol.Dico.fieldHTML_RO, | ||
$f, fv, | ||
@@ -49,3 +49,3 @@ prefix='#'+ that.prefix + '-', | ||
case fts.html: | ||
$f.html(fieldHTML_ReadOny(f, fv, Evol.hashLov, iconsPath)); | ||
$f.html(fieldHTML_ReadOnly(f, fv, Evol.hashLov, iconsPath)); | ||
break; | ||
@@ -69,3 +69,3 @@ case fts.formula: | ||
default: | ||
$f.text(fieldHTML_ReadOny(f, fv, Evol.hashLov, iconsPath) || ' '); | ||
$f.text(fieldHTML_ReadOnly(f, fv, Evol.hashLov, iconsPath) || ' '); | ||
} | ||
@@ -89,3 +89,3 @@ } | ||
$f, | ||
fts = Evol.Dico.fieldTypes, | ||
fts = Evol.Def.fieldTypes, | ||
prefix='#'+ that.prefix + '-', | ||
@@ -92,0 +92,0 @@ subCollecs=this.getSubCollecs(); |
@@ -12,3 +12,3 @@ /*! *************************************************************************** | ||
Evol.ViewOne.Edit = Evol.ViewOne.extend({ | ||
Evol.ViewOne.Edit = Evol.View_One.extend({ | ||
@@ -15,0 +15,0 @@ viewName: 'edit', |
@@ -12,3 +12,3 @@ /*! *************************************************************************** | ||
Evol.ViewOne.JSON = Evol.ViewOne.extend({ | ||
Evol.ViewOne.JSON = Evol.View_One.extend({ | ||
@@ -28,5 +28,5 @@ events: { | ||
h.push( | ||
eUI.HTMLPanelBegin({ | ||
eUI.panelBegin({ | ||
id: 'p-json', | ||
label:Evol.UI.capitalize(this.uiModel.name), | ||
label:Evol.Format.capitalize(this.uiModel.name), | ||
label2: 'JSON' | ||
@@ -38,3 +38,3 @@ }, this.style+' evo-p-json', true)+ | ||
'</fieldset>'+ | ||
eUI.HTMLPanelEnd()); | ||
eUI.panelEnd()); | ||
this._renderButtons(h, 'json'); | ||
@@ -41,0 +41,0 @@ this.$el.html(h.join('')); |
@@ -15,3 +15,3 @@ /*! *************************************************************************** | ||
var eUI = Evol.UI, | ||
fts = Evol.Dico.fieldTypes; | ||
fts = Evol.Def.fieldTypes; | ||
@@ -42,3 +42,3 @@ return Evol.ViewOne.Edit.extend({ | ||
class: 'evol-mini-holder', | ||
label: Evol.UI.capitalize(this.uiModel.name), | ||
label: Evol.Format.capitalize(this.uiModel.name), | ||
width: 100, | ||
@@ -57,3 +57,3 @@ elements: this.getFields() | ||
h.push('<div data-p-width="100%" class="evol-pnl evol-p-mini">'+ | ||
eUI.HTMLPanelBegin(p, this.style)+ | ||
eUI.panelBegin(p, this.style)+ | ||
'<fieldset data-pid="'+p.id+(p.readonly?'" disabled>':'">')); | ||
@@ -72,3 +72,3 @@ _.each(p.elements, function (elem) { | ||
h.push('</fieldset>'+ | ||
eUI.HTMLPanelEnd()+ | ||
eUI.panelEnd()+ | ||
'</div>'); | ||
@@ -75,0 +75,0 @@ return this; |
@@ -14,6 +14,5 @@ /*! *************************************************************************** | ||
var eUI = Evol.UI, | ||
i18n = Evol.i18n; | ||
var eUI = Evol.UI; | ||
return Evol.ViewOne.extend({ | ||
return Evol.View_One.extend({ | ||
@@ -114,8 +113,9 @@ viewName: 'wizard', | ||
_renderButtons: function (h) { | ||
var b=eUI.button; | ||
var bLabel=Evol.i18n.tools, | ||
b=eUI.button; | ||
h.push(eUI.html.clearer, | ||
'<div class="evo-wiz-buttons">', | ||
b('prev', i18n.prev, 'btn-default disabled'), | ||
b('next', i18n.next, 'btn-primary'), | ||
b('finish', i18n.finish, 'btn-default'), | ||
b('prev', bLabel.prev, 'btn-default disabled'), | ||
b('next', bLabel.next, 'btn-primary'), | ||
b('finish', bLabel.finish, 'btn-default'), | ||
'</div>'); | ||
@@ -134,3 +134,3 @@ return this; | ||
}else{ | ||
this.sendMessage(i18n.validation.incomplete, v, 'warning'); | ||
this.sendMessage(Evol.i18n.validation.incomplete, v, 'warning'); | ||
} | ||
@@ -137,0 +137,0 @@ }else{ |
@@ -14,4 +14,6 @@ /*! *************************************************************************** | ||
Evol.ViewOne = function(){ | ||
Evol.ViewOne = {}; | ||
Evol.View_One = function(){ | ||
var eUI = Evol.UI, | ||
@@ -21,4 +23,5 @@ uiInput = eUI.input, | ||
i18nTools = i18n.tools, | ||
eDef=Evol.Def, | ||
eDico = Evol.Dico, | ||
fts = eDico.fieldTypes; | ||
fts = eDef.fieldTypes; | ||
@@ -38,4 +41,4 @@ return Backbone.View.extend({ | ||
//'click .glyphicon-wrench': 'click_customize', | ||
'click [data-id="bPlus"],[data-id="bMinus"]':'click_detailsAddDel', | ||
'keyup [data-id="bPlus"],[data-id="bMinus"]':'click_detailsAddDel' | ||
'click [data-id="bPlus"],[data-id="bMinus"]': 'click_detailsAddDel', | ||
'keyup [data-id="bPlus"],[data-id="bMinus"]': 'click_detailsAddDel' | ||
}, | ||
@@ -79,7 +82,7 @@ | ||
if(!this._fields){ | ||
this._fields=eDico.getFields(this.uiModel, this.fieldsetFilter); | ||
this._fieldHash={}; | ||
var that=this; | ||
var that = this; | ||
this._fields = eDef.getFields(this.uiModel, this.fieldsetFilter); | ||
this._fieldHash = {}; | ||
_.each(this._fields, function(f){ | ||
that._fieldHash[f.id]=f; | ||
that._fieldHash[f.id] = f; | ||
}); | ||
@@ -99,4 +102,4 @@ } | ||
if(!this._subCollecsOK){ | ||
this._subCollecs=eDico.getSubCollecs(this.uiModel); | ||
this._subCollecsOK=true; | ||
this._subCollecs = eDef.getSubCollecs(this.uiModel); | ||
this._subCollecsOK = true; | ||
} | ||
@@ -159,6 +162,6 @@ return this._subCollecs; | ||
} | ||
_.each(fs, function(f){ | ||
_.forEach(fs, function(f){ | ||
vs[f.id]=that.getFieldValue(f); | ||
}); | ||
if(subCollecs){ | ||
if(subCollecs && subCollecs.length){ | ||
// -- for each sub collection (panel-list) | ||
@@ -176,3 +179,3 @@ _.each(subCollecs, function (sc) { | ||
_.each(sc.elements,function(f, idx){ | ||
v[f.id]=eDico.getFieldTypedValue(f, cells.eq(idx).find('input,select,textarea').eq(0)); | ||
v[f.id]=eDico.getFieldVal(f, cells.eq(idx).find('input,select,textarea').eq(0)); | ||
}); | ||
@@ -221,3 +224,3 @@ vs2.push(v); | ||
case fts.email: | ||
$f.html(eDico.fieldHTML_ReadOny(f, _.isUndefined(fv)?'':fv, Evol.hashLov, iconsPath) + ' '); | ||
$f.html(eDico.fieldHTML_RO(f, _.isUndefined(fv)?'':fv, Evol.hashLov, iconsPath) + ' '); | ||
break; | ||
@@ -231,3 +234,3 @@ case fts.formula: | ||
default: | ||
$f.text(eDico.fieldHTML_ReadOny(f, _.isUndefined(fv)?'':fv, Evol.hashLov, iconsPath) + ' '); | ||
$f.text(eDico.fieldHTML_RO(f, _.isUndefined(fv)?'':fv, Evol.hashLov, iconsPath) + ' '); | ||
} | ||
@@ -246,2 +249,8 @@ }else{ | ||
break; | ||
case fts.date: | ||
if(fv){ | ||
fv=fv.substring(0, 10); | ||
} | ||
$f.val(fv); | ||
break; | ||
case fts.pix: | ||
@@ -264,3 +273,3 @@ newPix=(fv)?('<img src="'+iconsPath+fv+'" class="img-thumbnail">'):('<p class="">'+i18n.nopix+'</p>'); | ||
}); | ||
if(subCollecs){ | ||
if(subCollecs && subCollecs.length){ | ||
_.each(subCollecs, function (sc) { | ||
@@ -301,5 +310,5 @@ var h=[]; | ||
if(_.isString(f)){ | ||
return eDico.getFieldTypedValue(this._fieldHash[f], this.$field(f)); | ||
return eDico.getFieldVal(this._fieldHash[f], this.$field(f)); | ||
}else{ | ||
return eDico.getFieldTypedValue(f, this.$field(f.id)); | ||
return eDico.getFieldVal(f, this.$field(f.id)); | ||
} | ||
@@ -423,3 +432,3 @@ }, | ||
var fs= this.getFields(), | ||
isNumType=eDico.isNumberType, | ||
isNumType=eDef.fieldIsNumber, | ||
data=this.getData(), | ||
@@ -437,3 +446,3 @@ model=this.model, | ||
if(isNumType(f.type)){ | ||
if(isNumType(f)){ | ||
if(isNaN(dataVal)){ | ||
@@ -616,6 +625,6 @@ if(!isNaN(modelVal)){ | ||
}else{ | ||
h.push('<div data-p-width="'+p.width+'" class="evol-pnl pull-left" style="width:'+p.width+'%">'); | ||
h.push('<div data-p-width="'+p.width+'" class="evol-pnl" style="width:'+p.width+'%">'); | ||
} | ||
h.push(eUI.HTMLPanelBegin(p, this.style||'panel-default'), | ||
'<fieldset data-pid="'+p.id+(p.readonly?'" disabled>':'">')); | ||
h.push(eUI.panelBegin(p, this.style||'panel-default'), | ||
'<fieldset data-pid="'+p.id+(p.readonly?'" disabled>':'"><div class="evol-fset">')); | ||
_.each(p.elements, function (elem) { | ||
@@ -628,3 +637,3 @@ if(elem.type=='panel-list'){ | ||
}else{ | ||
h.push('<div style="width:'+parseInt(elem.width||100, 10)+'%" class="pull-left evol-fld">'); | ||
h.push('<div style="width:'+parseInt(elem.width||100, 10)+'%" class="evol-fld">'); | ||
that.renderField(h, elem, mode, iconsPath); | ||
@@ -635,4 +644,4 @@ h.push("</div>"); | ||
}); | ||
h.push('</fieldset>'+ | ||
eUI.HTMLPanelEnd()+ | ||
h.push('</div></fieldset>'+ | ||
eUI.panelEnd()+ | ||
'</div>'); | ||
@@ -646,4 +655,4 @@ return this; | ||
h.push('<div style="width:'+p.width+'%" class="evol-pnl pull-left" data-pid="'+p.id+'">', | ||
eUI.HTMLPanelBegin(p, this.style), | ||
h.push('<div style="width:'+p.width+'%" class="evol-pnl" data-pid="'+p.id+'">', | ||
eUI.panelBegin(p, this.style), | ||
'<table class="table" data-mid="'+(p.attribute || p.id)+'"><thead><tr>'); | ||
@@ -659,3 +668,3 @@ _.each(p.elements, function (elem) { | ||
h.push('</tbody></table>', | ||
eUI.HTMLPanelEnd(), | ||
eUI.panelEnd(), | ||
'</div>'); | ||
@@ -685,8 +694,8 @@ return this; | ||
if(f.type===fts.bool || f.type===fts.lov){ | ||
h.push(eDico.fieldHTML_ReadOny(f, row[f.id], Evol.hashLov, iconsPath)); | ||
h.push(eDico.fieldHTML_RO(f, row[f.id], Evol.hashLov, iconsPath)); | ||
}else{ | ||
h.push(_.escape(eDico.fieldHTML_ReadOny(f, row[f.id], Evol.hashLov, iconsPath))); | ||
h.push(_.escape(eDico.fieldHTML_RO(f, row[f.id], Evol.hashLov, iconsPath))); | ||
} | ||
}else{ | ||
h.push(_.escape(eDico.fieldHTML_ReadOny(f, '', Evol.hashLov, iconsPath))); | ||
h.push(_.escape(eDico.fieldHTML_RO(f, '', Evol.hashLov, iconsPath))); | ||
} | ||
@@ -732,3 +741,3 @@ h.push('</td>'); | ||
h.push(Evol.Dico.HTMLFieldLabel(f, mode || 'edit')+ | ||
Evol.UI.input.formula(this.fieldViewId(f.id), this.model)); | ||
Evol.UI.input.formula(this.fieldViewId(f.id), f, this.model)); | ||
}else{ | ||
@@ -748,3 +757,3 @@ h.push(eDico.fieldHTML(f, this.fieldViewId(f.id), fv, mode, iconsPath, skipLabel)); | ||
}else{ | ||
return eUI.capitalize(this.uiModel.name); | ||
return Evol.Format.capitalize(this.uiModel.name); | ||
} | ||
@@ -836,3 +845,3 @@ }, | ||
var i18nVal = i18n.validation, | ||
numberField = eDico.isNumberType(f.type); | ||
numberField = eDef.fieldIsNumber(f); | ||
@@ -839,0 +848,0 @@ function formatMsg(fLabel, msg, r2, r3){ |
{ | ||
"name": "evolutility", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"copyright": "(c) 2015 Olivier Giulieri", | ||
"license": "AGPL-3.0", | ||
"target": "dist", | ||
"homepage": "https://github.com/evoluteur/evolutility", | ||
"author": { | ||
"name": "Olivier Giulieri", | ||
"url": "https://github.com/evoluteur" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/evoluteur/evolutility.git" | ||
}, | ||
"bugs": "https://github.com/evoluteur/evolutility/issues", | ||
"homepage": "http://evoluteur.github.io/evolutility/", | ||
"author": { | ||
"name": "Olivier Giulieri", | ||
"url": "https://github.com/evoluteur" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/evoluteur/evolutility.git" | ||
}, | ||
"bugs": "https://github.com/evoluteur/evolutility/issues", | ||
"devDependencies": { | ||
@@ -25,12 +25,14 @@ "grunt": "~0.4.5", | ||
}, | ||
"keywords": [ | ||
"MDA", | ||
"MDDA", | ||
"metadata", | ||
"form", | ||
"CRUD", | ||
"UI", | ||
"D3", | ||
"Backbone" | ||
] | ||
"keywords": [ | ||
"metadata", | ||
"UI", | ||
"forms", | ||
"CRUD", | ||
"framework", | ||
"D3", | ||
"Backbone", | ||
"web", | ||
"MDA", | ||
"MDDA" | ||
] | ||
} |
@@ -25,2 +25,4 @@ # Evolutility.js | ||
By default, Evolutility uses LocalStorage but it can be configured for REST (using [Evolutility-server](https://github.com/evoluteur/evolutility-server) or your own REST API). | ||
## Views | ||
@@ -165,3 +167,3 @@ | ||
Views are not defined in templates but configured with a UI-model using [vocabulary](http://evoluteur.github.io/evolutility/doc/ui-model.html) with words like "field", "panel" and "tab" rather than "INPUT" and "DIV" to describe UI elements. | ||
Views are not defined in templates but configured with a UI-model using a [vocabulary](http://evoluteur.github.io/evolutility/doc/ui-model.html) with words like "field", "panel" and "tab" rather than "INPUT" and "DIV" to describe UI elements. | ||
@@ -188,3 +190,4 @@ Here is the UI-model used to configure all views for the ["Graphic Novels" app demo](http://evoluteur.github.io/evolutility/demo/index.html#comics/cards): | ||
{ | ||
id: 'title', attribute: 'title', type: 'text', label: 'Title', required: true, | ||
id: 'title', attribute: 'title', type: 'text', | ||
label: 'Title', required: true, | ||
maxLength: 255, | ||
@@ -194,3 +197,4 @@ width: 62, inMany: true | ||
{ | ||
id: 'genre', attribute: 'genre', type: 'lov', label: 'Genre', width: 38, inMany: true, | ||
id: 'genre', attribute: 'genre', type: 'lov', | ||
label: 'Genre', width: 38, inMany: true, | ||
list: [ | ||
@@ -213,7 +217,8 @@ {id: 'adv', text: 'Adventure'}, | ||
{ | ||
id: 'authors', attribute: 'authors', type: 'text', width: 62, inMany: true, | ||
label: 'Authors' | ||
id: 'authors', attribute: 'authors', type: 'text', | ||
label: 'Authors', width: 62, inMany: true | ||
}, | ||
{ | ||
id: 'language', attribute: 'language', type: 'lov', label: 'Language', width: 38, inMany: false, | ||
id: 'language', attribute: 'language', type: 'lov', | ||
label: 'Language', width: 38, inMany: false, | ||
list: [ | ||
@@ -225,33 +230,40 @@ {id: 'FR', text: 'French'}, | ||
{ | ||
id: 'serieNb', attribute: 'serieNb', type: 'integer', width: 15, inMany: false, | ||
label: 'Albums', inCharts:false | ||
id: 'serieNb', attribute: 'serieNb', type: 'integer', | ||
label: 'Albums', width: 15, inMany: false, | ||
inCharts: false | ||
}, | ||
{ | ||
id: 'haveNb', attribute: 'haveNb', type: 'integer', width: 15, inMany: false, | ||
label: 'Owned', inCharts:false | ||
id: 'haveNb', attribute: 'haveNb', type: 'integer', | ||
label: 'Owned', width: 15, inMany: false, | ||
inCharts:false | ||
}, | ||
{ | ||
id: 'have', attribute: 'have', type: 'text', width: 32, inMany: false, | ||
label: 'have' | ||
id: 'have', attribute: 'have', type: 'text', | ||
label: 'have', width: 32, inMany: false | ||
}, | ||
{ | ||
id: 'complete', attribute: 'complete', type: 'boolean', width: 19, inMany: true, | ||
label: 'Complete', labelFalse:'Incomplete', labelTrue:'Complete' | ||
id: 'complete', attribute: 'complete', type: 'boolean', | ||
label: 'Complete', width: 19, inMany: true, | ||
labelFalse:'Incomplete', labelTrue:'Complete' | ||
}, | ||
{ | ||
id: 'finished', attribute: 'finished', type: 'boolean', width: 19, inMany: true, | ||
label: 'Finished', labelTrue:'Finished', labelFalse:'Unfinished', css:'cBlue' | ||
id: 'finished', attribute: 'finished', type: 'boolean', | ||
label: 'Finished', width: 19, inMany: true, | ||
labelTrue:'Finished', labelFalse:'Unfinished', css:'cBlue' | ||
}, | ||
{ | ||
id:'amazon', label:'Amazon', type:'formula', width:100, css:'evol-ellipsis', | ||
id:'amazon', type:'formula', | ||
label:'Amazon', width:100, css:'evol-ellipsis', | ||
formula:function(m){ | ||
var link=m.get('language')=='FR' ? | ||
var urlData=m.get('title')+' '+m.get('authors'), | ||
link=m.get('language')=='FR' ? | ||
'http://www.amazon.fr/s/ref=sr_nr_n_1?keywords=' | ||
:'http://www.amazon.com/s/ref=nb_sb_noss?field-keywords='; | ||
link+=encodeURI(m.get('title')+' '+m.get('authors')); | ||
return '<a target="a" href="'+link+'">'+link+'</a>'; | ||
return '<a target="a" href="'+link+encodeURI(urlData)+'">'+ | ||
_.escape(urlData)+'</a>'; | ||
} | ||
}, | ||
{ | ||
id: 'notes', attribute: 'notes', type: 'textmultiline', label: 'Notes', maxLength: 1000, | ||
id: 'notes', attribute: 'notes', type: 'textmultiline', | ||
label: 'Notes', maxLength: 1000, | ||
width: 100, height: 6, inMany: false | ||
@@ -265,4 +277,4 @@ } | ||
{ | ||
id: 'pix', attribute: 'pix', type: 'image', width: 100, inMany: true, | ||
label: 'Cover' | ||
id: 'pix', attribute: 'pix', type: 'image', | ||
label: 'Cover', width: 100, inMany: true | ||
} | ||
@@ -284,3 +296,3 @@ ] | ||
With Evolutility, a single UI-model defines a full single page applications (SPA) to view, edit, filter and export a Backbone model or collection. | ||
With Evolutility, a single UI-model defines a full single page applications (SPA) to view, edit, filter and export a Backbone.js model or collection. | ||
@@ -292,4 +304,4 @@ Try it now: Download Evolutility.JS, make modification to the demo UI-models by adding and modifying fields and panels and see the demo apps become your apps. | ||
Javascript, HTML5, CSS3, | ||
[Backbone] (http://backbonejs.org), | ||
[Underscore] (http://underscorejs.org/), | ||
[Backbone.js] (http://backbonejs.org), | ||
[Underscore.js] (http://underscorejs.org/), | ||
[jQuery] (http://jquery.com), | ||
@@ -299,3 +311,4 @@ [D3.js] (http://d3js.org), | ||
[Bootstrap-datepicker] (http://eternicode.github.io/bootstrap-datepicker/), | ||
[Select2] (http://ivaynberg.github.io/select2/). | ||
[Select2] (http://ivaynberg.github.io/select2/), | ||
[Toastr] (https://github.com/CodeSeven/toastr). | ||
@@ -302,0 +315,0 @@ Note: For convenience, all dependencies are minified together in a single file "dependencies.min.js". The dependencies list is specified in "Gruntfile.js". |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2385004
145
19558
322
2