From b66660ac1d990dac827e59e163d1a657d6b62875 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Sun, 25 May 2014 21:40:14 -0300 Subject: [PATCH] Improve demo with two-way binding example. --- app/index.html | 2 + app/styles/style.scss | 9 +--- app/templates/index.hbs | 47 ++++++++++++++----- bower.json | 3 +- dist/index.html | 8 ++-- dist/scripts/7acabe46.templates.js | 1 - ...3.components.js => 8578e3f0.components.js} | 11 +++-- dist/scripts/eba4f04f.templates.js | 1 + dist/styles/2097fa0f.main.css | 1 + dist/styles/2eff5d3b.main.css | 1 - dist/styles/5b494039.components.css | 5 ++ dist/styles/f6c048b9.components.css | 1 - 12 files changed, 59 insertions(+), 31 deletions(-) delete mode 100644 dist/scripts/7acabe46.templates.js rename dist/scripts/{839dfd23.components.js => 8578e3f0.components.js} (75%) create mode 100644 dist/scripts/eba4f04f.templates.js create mode 100644 dist/styles/2097fa0f.main.css delete mode 100644 dist/styles/2eff5d3b.main.css create mode 100644 dist/styles/5b494039.components.css delete mode 100644 dist/styles/f6c048b9.components.css diff --git a/app/index.html b/app/index.html index c51d37b..32d4189 100644 --- a/app/index.html +++ b/app/index.html @@ -11,6 +11,7 @@ + @@ -26,6 +27,7 @@ + diff --git a/app/styles/style.scss b/app/styles/style.scss index c2a5fb6..14d7f7d 100644 --- a/app/styles/style.scss +++ b/app/styles/style.scss @@ -1,10 +1,5 @@ // SASS! -.well { - background-color: gray; - border-radius: 5px; - - li { - padding: 5px; - } +.jsoneditor-component { + height: 300px; } diff --git a/app/templates/index.hbs b/app/templates/index.hbs index f95b618..171a213 100644 --- a/app/templates/index.hbs +++ b/app/templates/index.hbs @@ -1,22 +1,47 @@ -
-

Welcome to Ember-JSONEditor

+
-

Editor

+
+

Welcome to Ember-JSONEditor

+

Ember component to view, edit and format JSON.

+

Learn more

+
- {{json-editor json=model mode=controller.mode name=controller.name}} +
+

Features

+
    +
  • Two-Way Bindings
  • +
  • Set name and mode with component
  • +
+
+

Try it out for yourself!

+
-
+
+
-

Options

+

Editor 1

- Name: {{input value=controller.name}} + {{json-editor json=model mode=controller.mode name=controller.name}} -
+

Options

- Mode: {{view Ember.Select content=controller.modes value=controller.mode}} + Name: {{input value=controller.name}} -

Raw JSON

+
-
{{pretty-print model undefined 4}}
+ Mode: {{view Ember.Select content=controller.modes value=controller.mode}} +
+
+ +

Editor 2

+ + {{json-editor json=model mode="code" name="Two-Way Bindings"}} + +

Raw JSON

+ +
{{pretty-print model undefined 4}}
+ +
+
diff --git a/bower.json b/bower.json index a5ae800..fc0f1c4 100644 --- a/bower.json +++ b/bower.json @@ -8,7 +8,8 @@ "jsoneditor": "~2.3.6" }, "devDependencies": { - "ember-mocha-adapter": "0.1.2" + "ember-mocha-adapter": "0.1.2", + "bootstrap": "~3.1.1" }, "main": "build/ember-plugin.js" } diff --git a/dist/index.html b/dist/index.html index 0ebcb87..b40c668 100644 --- a/dist/index.html +++ b/dist/index.html @@ -5,20 +5,20 @@ Ember-JSONEditor - + - + - + - + diff --git a/dist/scripts/7acabe46.templates.js b/dist/scripts/7acabe46.templates.js deleted file mode 100644 index e404b53..0000000 --- a/dist/scripts/7acabe46.templates.js +++ /dev/null @@ -1 +0,0 @@ -Ember.TEMPLATES.index=Ember.Handlebars.template(function(a,b,c,d,e){this.compilerInfo=[4,">= 1.0.0"],c=this.merge(c,Ember.Handlebars.helpers),e=e||{};var f,g,h,i,j="",k=c.helperMissing,l=this.escapeExpression;return e.buffer.push('
\n

Welcome to Ember-JSONEditor

\n\n

Editor

\n\n '),g={json:b,mode:b,name:b},h={json:"ID",mode:"ID",name:"ID"},i={hash:{json:"model",mode:"controller.mode",name:"controller.name"},contexts:[],types:[],hashContexts:g,hashTypes:h,data:e},e.buffer.push(l((f=c["json-editor"]||b["json-editor"],f?f.call(b,i):k.call(b,"json-editor",i)))),e.buffer.push("\n\n
\n\n

Options

\n\n Name: "),g={value:b},h={value:"ID"},i={hash:{value:"controller.name"},contexts:[],types:[],hashContexts:g,hashTypes:h,data:e},e.buffer.push(l((f=c.input||b.input,f?f.call(b,i):k.call(b,"input",i)))),e.buffer.push("\n\n
\n\n Mode: "),g={content:b,value:b},h={content:"ID",value:"ID"},e.buffer.push(l(c.view.call(b,"Ember.Select",{hash:{content:"controller.modes",value:"controller.mode"},contexts:[b],types:["ID"],hashContexts:g,hashTypes:h,data:e}))),e.buffer.push("\n\n

Raw JSON

\n\n
"),h={},g={},i={hash:{},contexts:[b,b,b],types:["ID","ID","INTEGER"],hashContexts:g,hashTypes:h,data:e},e.buffer.push(l((f=c["pretty-print"]||b["pretty-print"],f?f.call(b,"model","undefined",4,i):k.call(b,"pretty-print","model","undefined",4,i)))),e.buffer.push("
\n\n
\n"),j}); \ No newline at end of file diff --git a/dist/scripts/839dfd23.components.js b/dist/scripts/8578e3f0.components.js similarity index 75% rename from dist/scripts/839dfd23.components.js rename to dist/scripts/8578e3f0.components.js index c063f2a..d461f7f 100644 --- a/dist/scripts/839dfd23.components.js +++ b/dist/scripts/8578e3f0.components.js @@ -1,9 +1,9 @@ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){function c(a){var b=a.length,c=ab.type(a);return"function"===c||ab.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}function d(a,b,c){if(ab.isFunction(b))return ab.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return ab.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(hb.test(b))return ab.filter(b,a,c);b=ab.filter(b,a)}return ab.grep(a,function(a){return U.call(b,a)>=0!==c})}function e(a,b){for(;(a=a[b])&&1!==a.nodeType;);return a}function f(a){var b=ob[a]={};return ab.each(a.match(nb)||[],function(a,c){b[c]=!0}),b}function g(){$.removeEventListener("DOMContentLoaded",g,!1),a.removeEventListener("load",g,!1),ab.ready()}function h(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=ab.expando+Math.random()}function i(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(ub,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:tb.test(c)?ab.parseJSON(c):c}catch(e){}sb.set(a,b,c)}else c=void 0;return c}function j(){return!0}function k(){return!1}function l(){try{return $.activeElement}catch(a){}}function m(a,b){return ab.nodeName(a,"table")&&ab.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function n(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function o(a){var b=Kb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function p(a,b){for(var c=0,d=a.length;d>c;c++)rb.set(a[c],"globalEval",!b||rb.get(b[c],"globalEval"))}function q(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(rb.hasData(a)&&(f=rb.access(a),g=rb.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)ab.event.add(b,e,j[e][c])}sb.hasData(a)&&(h=sb.access(a),i=ab.extend({},h),sb.set(b,i))}}function r(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&ab.nodeName(a,b)?ab.merge([a],c):c}function s(a,b){var c=b.nodeName.toLowerCase();"input"===c&&yb.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}function t(b,c){var d=ab(c.createElement(b)).appendTo(c.body),e=a.getDefaultComputedStyle?a.getDefaultComputedStyle(d[0]).display:ab.css(d[0],"display");return d.detach(),e}function u(a){var b=$,c=Ob[a];return c||(c=t(a,b),"none"!==c&&c||(Nb=(Nb||ab("