survey.js.editor is the visual editor for surveyjs. It uses JSON to store the survey metadata.
#Download Dowload the latest version as zip file Download
Install the library using npm.
npm install surveyjs-editor
#Example of using
<div id="surveyjseditor"></div>
<script type="text/javascript">
var editor = new SurveyEditor.SurveyEditor("surveyjseditor");
//set the survey json
editor.text = JSON.stringify({pages:[questions:[{ name: "rateme", type: "rating" }]]});
// setting saveSurveyFunc will make visible the save button
// use it to save the survey json as text in your database
editor.saveSurveyFunc = function() { var myJSONText = editor.text; };
</script>
See the visual editor in action.
##Building surveyjs Editor from sources
To build library yourself:
-
Clone the repo from GitHub
git clone https://github.com/andrewtelnov/surveyjs.editor.git cd surveyjs.editor
-
Acquire build dependencies. Make sure you have Node.js installed on your workstation.
npm install -g gulp npm install -g typings npm install
The first
npm
command sets up the popular Gulp build tool. The secondnpm
command sets up the Typescript Definition Manager Typings. -
Create TypeScript definition files
typings install
Typescript definition files should be located at 'typings' directory.
-
Build the library
gulp makedist
After that you should have the library at 'dist' directory.
-
Run unit tests
gulp copyfiles gulp test_ci
The first command will copy all required files to 'wwwroot' directory and the last command will run unit tests usign Karma
##Coming features
Find the features under development and Todo list in the Trello board.
#Dependencies The library depends from: surveyjs, knockoutjs, bootstrap and ace editor.
#License
Non-commercial use | Commercial use |
---|---|
Please contact me: andrew.telnov at gmail.com |