Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ngOnInit() {
SurveyKo.JsonObject.metaData.addProperty(
"questionbase",
"popupdescription:text"
);
SurveyKo.JsonObject.metaData.addProperty("page", "popupdescription:text");
let options = { showEmbededSurveyTab: true, generateValidJSON: true };
this.surveyCreator = new SurveyCreator.SurveyCreator(
"surveyCreatorContainer",
options
);
this.surveyCreator.text = JSON.stringify(this.json);
this.surveyCreator.saveSurveyFunc = this.saveMySurvey;
}
mounted() {
let options = { showEmbededSurveyTab: true };
this.surveyCreator = new SurveyCreator.SurveyCreator(
"surveyCreatorContainer",
options
);
this.surveyCreator.saveSurveyFunc = function() {
console.log(JSON.stringify(this.text));
};
}
};
afterRender: function(modalEditor, htmlElement) {
var editor = window["CKEDITOR"].replace(htmlElement);
editor.on("change", function() {
modalEditor.editingValue = editor.getData();
});
editor.setData(modalEditor.editingValue);
},
destroy: function(modalEditor, htmlElement) {
var instance = window["CKEDITOR"].instances[htmlElement.id];
if (instance) {
instance.removeAllListeners();
window["CKEDITOR"].remove(instance);
}
}
};
SurveyCreator.SurveyPropertyModalEditor.registerCustomWidget(
"html",
CkEditor_ModalEditor
);
@Component({
selector: "survey-creator",
template: `
<div id="surveyCreatorContainer"></div>
`
})
export class SurveyCreatorComponent {
surveyCreator: SurveyCreator.SurveyCreator;
@Input() json: any;
@Output() surveySaved: EventEmitter = new EventEmitter();
ngOnInit() {
SurveyKo.JsonObject.metaData.addProperty(
componentDidMount() {
this.surveyCreator = new SurveyJSCreator.SurveyCreator("surveyCreatorContainer")
this.surveyCreator.saveSurveyFunc = this.saveSurvey;
this.props.getEmployees();
}
componentDidMount() {
let options = { showEmbededSurveyTab: true };
this.surveyCreator = new SurveyJSCreator.SurveyCreator(
"surveyCreatorContainer",
options
);
this.surveyCreator.saveSurveyFunc = this.saveMySurvey;
}
render() {
widgets.icheck(SurveyKo);
widgets.select2(SurveyKo);
widgets.inputmask(SurveyKo);
widgets.jquerybarrating(SurveyKo);
widgets.jqueryuidatepicker(SurveyKo);
widgets.nouislider(SurveyKo);
widgets.select2tagbox(SurveyKo);
widgets.signaturepad(SurveyKo);
widgets.sortablejs(SurveyKo);
widgets.ckeditor(SurveyKo);
widgets.autocomplete(SurveyKo);
widgets.bootstrapslider(SurveyKo);
//widgets.emotionsratings(SurveyKo);
SurveyCreator.StylesManager.applyTheme("default");
var CkEditor_ModalEditor = {
afterRender: function(modalEditor, htmlElement) {
var editor = window["CKEDITOR"].replace(htmlElement);
editor.on("change", function() {
modalEditor.editingValue = editor.getData();
});
editor.setData(modalEditor.editingValue);
},
destroy: function(modalEditor, htmlElement) {
var instance = window["CKEDITOR"].instances[htmlElement.id];
if (instance) {
instance.removeAllListeners();
window["CKEDITOR"].remove(instance);
}
}
import "bootstrap-slider/dist/css/bootstrap-slider.css";
import "jquery-bar-rating/dist/themes/css-stars.css";
import "jquery-bar-rating/dist/themes/fontawesome-stars.css";
import $ from "jquery";
import "jquery-ui/ui/widgets/datepicker.js";
import "select2/dist/js/select2.js";
import "jquery-bar-rating";
//import "icheck/skins/square/blue.css";
import "pretty-checkbox/dist/pretty-checkbox.css";
import * as widgets from "surveyjs-widgets";
SurveyJSCreator.StylesManager.applyTheme("default");
//widgets.icheck(SurveyKo, $);
widgets.prettycheckbox(SurveyKo);
//widgets.select2(SurveyKo, $);
widgets.inputmask(SurveyKo);
widgets.jquerybarrating(SurveyKo, $);
widgets.jqueryuidatepicker(SurveyKo, $);
widgets.nouislider(SurveyKo);
widgets.select2tagbox(SurveyKo, $);
widgets.signaturepad(SurveyKo);
widgets.sortablejs(SurveyKo);
widgets.ckeditor(SurveyKo);
widgets.autocomplete(SurveyKo, $);
widgets.bootstrapslider(SurveyKo);
class SurveyCreator extends Component {
import "survey-creator/survey-creator.css";
import {connect} from 'react-redux';
import $ from "jquery";
import {FormControl, Select, MenuItem} from "@material-ui/core";
import {getEmployees} from "../../actions/employee";
const mapStateToProps = ({employees}) => ({
employees
})
const mapDispatchToProps = dispatch => ({
getEmployees: (component) => dispatch(getEmployees(component))
})
SurveyJSCreator.StylesManager.applyTheme("default");
class SurveyBuilder extends Component {
saveSurvey = () => {
$.ajax('/api/survey', {
method: 'POST',
data: JSON.stringify(this.surveyCreator.JSON),
contentType: 'application/json'
})
}
componentDidMount() {
this.surveyCreator = new SurveyJSCreator.SurveyCreator("surveyCreatorContainer")
this.surveyCreator.saveSurveyFunc = this.saveSurvey;
this.props.getEmployees();
}