Coder Social home page Coder Social logo

jsonedit's Introduction

Hi there! ๐Ÿ‘‹ โ€“ some things I made:

Some things I'm interested in:

  • Programming languages: Haskell, Rust, F#, OCaml
  • Crafting code, molding processes and teaching

jsonedit's People

Contributors

cardamon avatar dominicboettger avatar dustinsmith1024 avatar emiljanitzek avatar incontrast avatar matissjanis avatar mb21 avatar solos avatar sparksx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jsonedit's Issues

jQuery dependency

I looked at the JSONedit.js and directives.js files, and I don't see any jquery dependency. Is it really necessary that I add jquery to my page?

Creating a service to track tree

This is a great project. Recursion using Angular directives is very smart.

I've decided to create an Angular service to track where in the tree we are, during the recursions. It will create a breadcrumb trail of the fields (our Json data has a field called "title" which we will use for this).

It will be used in conjunction with a second JSON data source that will, based upon the breadcrumb, will control whether the field is editable and/or visible.

exposed methods:

nextLevel(currentTitle, nextTitle); // builds breadcrumb, tracks position
isEditable(); // true/false based upon json in service
isVisible(); // true/false based upon json in service

License?

This is exactly what I've been looking for. Great work!

I don't see the what license you've chosen. Can I use with my MIT-licensed project?

Add a table type to a JSON editor

I would like to add a Table type along with the existing types (e.g., Text, Boolean), so that users could fill in a table and add it to the JSON object:

screen shot 2017-01-07 at 01 02 22

By adding the following code in addItemTemplate (and some other code) in directives.js, it does show the above table. But I don't know how to do the rest, i.e., adding the instance to the JSON object after pressing the Add button. Note that we could get the data of a handsontable instance from its hot-id like this.

`+ '<span ng-show="$parent.valueType == \'' +tableName+'\'"> : 
 <div ng-controller="MainCtrl as ctrl"><hot-table hot-id="mytable" datarows="ctrl.db.items" height="50" width="100"></hot-table></div>'`

Could anyone give me some hint?

Thanks

Tie

Is it compatible with latest angular version 2+ ?

Is it compatible with latest angular version 2+ ? , if so please share the sample code. how we can customize the edit options in the json viewer . i just want to let the user to view the data only i don't want to give them the options to edit the json data, is that possible to customize the json viewer ?

editing jsonString difficult

Editing the text within the jsonString textarea is difficult - after each character focus jumps to the json directive.

change type of property causes odd behavior

Howdy - great little directive, I am using it for the UI of an API service I am building: https://github.com/southbite/freebase
The UI project is called https://github.com/southbite/freebase-ui

Anyhoo, I found an odd little behaviour that I haven't been able solve, if you change a property type from array to text in scope keeping the property name the same - the old html for the old property is not removed, and is no longer wired to click events

example json:

{
"property": ["some text"]
}

changes to

{
"property": "some text"
}

You can see this in action on your demo page by simply pasting the json in my example in the above order.

long json causes stripes to be out of sync with text

Hi,
If I use a long json, as in the following example, stripes get out of sync with the text. Is there an easy way to solve it? Thanks
{
"Name": "Joe",
"Last Name": "Miller",
"Address": {
"Street": "Neverland 42"
},
"Hobbies": [
"doing stuff",
"dreaming"
],
"Name2": "Joe",
"Last Name2": "Miller",
"Address2": {
"Street": "Neverland 42"
},
"Hobbies2": [
"doing stuff",
"dreaming"
],
"Name3": "Joe",
"Last Name3": "Miller",
"Address3": {
"Street": "Neverland 42"
},
"Hobbies3": [
"doing stuff",
"dreaming"
],
"Name4": "Joe",
"Last Name4": "Miller",
"Address4": {
"Street": "Neverland 42"
},
"Hobbies4": [
"doing stuff",
"dreaming"
]
}

Reordering list elements causes numbers to go out of sync

When reordering list elements, the order numbers to the left go out of sync. It seems this is a pretty common problem with jQuery sortable and one that i've had before. It happens because when dragging, jQuery adds another element to the list which throws everything off. I solved it by doing the following:

  1. Set the newly added elements class to something different then the standard.
$(function() {
       $(el).sortable({
           placeholder: 'sortable-placeholder'
       });
});
  1. Add the following CSS styling to the placeholder
.sortable-placeholder {
       height: 20px;
       display: block;
}

https://gist.github.com/shalotelli/6597324

it cannot set a name for object

So I start with my object as an empty array []. Now when I try to add an object with a nume, JSONedit will incorrectly add it. It doesn't give it a name too.

create master branch

We're using NPM instead of bower (per or Front End engineer's request) and having issues pulling your project due to a missing master branch. Any reason you don't have one? Would you mind making one?

Is it possible to constrain possible edits somehow?

Awesome library. I have a use case in which I need to constrain possible edits to a certain structure. Is it possible to enforce that with JSONedit in some way? For example using a JSON schema and validate against that for each modification?

Back-end Integration

Hi there!

I just forked your project and will try to integrate with a simple Back-End (probably node.js) so that your script save the changes made to a given .json file.

Do you have any interest of a pull request with such changes?

f.sortable not a function errors

I keep getting these f.sortable is not a function errors. We have multiple JSON Editor's on our page and they all seem to throw the error.

Everything works, fine I would just like to clean up the console logs.

Any ideas?

angular.js:14324 TypeError: f.sortable is not a function
    at Object.link (http://localhost:8088/assets/vendor/angular-ui-sortable/sortable.min.js:1:2660)
    at http://localhost:8088/assets/vendor/angular/1.6.0/angular.js:1291:18
    at invokeLinkFn (http://localhost:8088/assets/vendor/angular/1.6.0/angular.js:10249:9)
    at nodeLinkFn (http://localhost:8088/assets/vendor/angular/1.6.0/angular.js:9638:11)
    at compositeLinkFn (http://localhost:8088/assets/vendor/angular/1.6.0/angular.js:8878:13)
    at nodeLinkFn (http://localhost:8088/assets/vendor/angular/1.6.0/angular.js:9632:11)
    at compositeLinkFn (http://localhost:8088/assets/vendor/angular/1.6.0/angular.js:8878:13)
    at publicLinkFn (http://localhost:8088/assets/vendor/angular/1.6.0/angular.js:8743:30)
    at Object.link (http://localhost:8088/assets/vendor/jsonEdit/v0.2.0/js/directives.js:253:29)
    at http://localhost:8088/assets/vendor/angular/1.6.0/angular.js:1291:18 <ol class="arrayOl ng-pristine ng-untouched ng-valid" ui-sortable="sortableOptions" ng-model="child">

Missing Semicolons

Missing semicolons line 35+36 in js/directives.js

var boolName = "Boolean"
var numberName = "Number"

ac0c792

how to show attribute level data which comes with _

Hi,

Please help me to show the attribute level data in this tree having _or @.
I dont want to treat attrbiutes to act as child element which currently happen in this tree.
I want to show the attribute value in one row not as child values.

Few ideas

For simple projects that run from .json files it would be awesome if JSONedit would allow adding whole new objects (not just properties) and also remove whole Objects. Aswell would it be possible to add "Save" button that would save all the changes to json file ?
(I will try to add those features myself, though i'm begginer in the field od AngularJS)
Otherwise, great work on it.

Angular 1.2.16

Shouldn't we replace mutli-sortable by new version ui-sortable ? Did that in my branch, see no issues so far.

Bower component doesn't include Boolean capability

I think there must be some difference between V0.2.0 that you get form bower install --save json-edit and what is in the demo mode because I can see the directives.js doesn't include a Boolean type.

Probably just needs a quick republish. I can see that the .zip folder on github for version 0.2.0 also does not include the Boolean capability.

Cheers

properties with underscores

Hello,

properties with underscores ares not allowed and it's not possible to override this behaviour.

Best regards
Dominic

Large JSON file refresh time on ng-change

Issue with long JSON file (1 mb): the ng-change and ng-model-onblur takes a long time.

<input type="text" ng-model="val" placeholder="Empty" ng-model-onblur ng-change="child[key] = possibleNumber(val)"/>

For some reason the ng-model-onblur isn't waiting for the blur event and is causing a refresh after a single edit.

I would prefer a changeset model and an update button. Unfortunately I think this may mean removing the watch() statements in the controller and the runtime binding, unless we can somehow do it asynchronously.

Additionally, ng-change causes the tree to refresh. On mine I've set the default state to collapsed.

Delete duplicate itens

After I delete a item from a list , when I edit another item in the same list the edited item has his value updated and the next item too.

I am using this list:

{ "import": [
"frontend.components.",
"common.helpers.ciHelpers.
",
"frontend.models.",
"backend.models.
",
"common.modules.configuracao.ConfiguracaoModule",
"backend.components.",
"common.extensions.components.
",
"common.components.",
"common.helpers.
",
"common.models.",
"common.utils.
",
"common.validators.",
"bootstrap.helpers.
",
"application.controllers.",
"application.extensions.
",
"application.helpers.",
"application.models.
",
"common.modules.usuario.models.",
"common.modules.usuario.components.
",
"backend.modules.faq.models.*"
]
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.