Changeset 3006114
- Timestamp:
- 12/06/2023 10:11:09 AM (2 years ago)
- Location:
- surveyjs
- Files:
-
- 15 added
- 7 deleted
- 19 edited
-
assets/banner-1544x500.png (modified) (previous)
-
assets/banner-772x250.png (modified) (previous)
-
assets/icon-128x128.png (modified) (previous)
-
assets/icon-256x256.png (modified) (previous)
-
assets/screenshot-1.png (modified) (previous)
-
assets/screenshot-2.png (modified) (previous)
-
assets/screenshot-3.png (modified) (previous)
-
assets/screenshot-4.png (modified) (previous)
-
assets/screenshot-5.png (modified) (previous)
-
assets/screenshot-6.png (modified) (previous)
-
assets/screenshot-7.png (modified) (previous)
-
trunk/ajax_handlers/get_survey_json.php (modified) (1 diff)
-
trunk/ajax_handlers/save_survey.php (modified) (2 diffs)
-
trunk/initializer.php (modified) (5 diffs)
-
trunk/libs/babel.min.js (added)
-
trunk/libs/creator (added)
-
trunk/libs/creator/survey-creator-core.i18n.min.js (added)
-
trunk/libs/creator/survey-creator-core.min.css (added)
-
trunk/libs/creator/survey-creator-core.min.js (added)
-
trunk/libs/creator/survey-creator-react.min.js (added)
-
trunk/libs/library (added)
-
trunk/libs/library/defaultV2.min.css (added)
-
trunk/libs/library/survey-react-ui.min.js (added)
-
trunk/libs/library/survey.core.min.js (added)
-
trunk/libs/library/survey.i18n.min.js (added)
-
trunk/libs/library/survey.jquery.min.js (added)
-
trunk/libs/library/themes (added)
-
trunk/libs/library/themes/index.min.js (added)
-
trunk/libs/modern.css (deleted)
-
trunk/libs/survey-creator.css (deleted)
-
trunk/libs/survey-creator.min.js (deleted)
-
trunk/libs/survey.css (deleted)
-
trunk/libs/survey.jquery.min.js (deleted)
-
trunk/libs/survey.ko.min.js (deleted)
-
trunk/libs/survey.pdf.min.js (deleted)
-
trunk/normalize.css (added)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/surveyjs.php (modified) (1 diff)
-
trunk/views/editor.php (modified) (3 diffs)
-
trunk/views/results.php (modified) (1 diff)
-
trunk/views/settings.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
surveyjs/trunk/ajax_handlers/get_survey_json.php
r2097896 r3006114 16 16 $query = "SELECT * FROM " . $table_name . " WHERE id=" . $surveyId; 17 17 $json = $wpdb->get_row($query)->json; 18 $theme = $wpdb->get_row($query)->theme; 18 19 19 wp_send_json( array('json' => $json ) );20 wp_send_json( array('json' => $json, 'theme' => $theme) ); 20 21 } 21 22 } -
surveyjs/trunk/ajax_handlers/save_survey.php
r2454557 r3006114 13 13 $id = sanitize_key($_POST['Id']); 14 14 $json = current_user_can( 'unfiltered_html' ) ? $_POST['Json'] : wp_kses_post( $_POST['Json'] ); 15 $theme = current_user_can( 'unfiltered_html' ) ? $_POST['Theme'] : wp_kses_post( $_POST['Theme'] ); 15 16 16 17 if(!!$json) { … … 21 22 $table_name, 22 23 array( 23 'json' => $json 24 'json' => $json, 25 'theme' => $theme 24 26 ), 25 27 array( -
surveyjs/trunk/initializer.php
r2506505 r3006114 81 81 $_GET['page'] == "surveyjs_results") 82 82 ) { 83 wp_enqueue_style('wps-adm-bootstrap-css', plugins_url('libs/bootstrap.min.css', __FILE__) ); 84 85 wp_enqueue_style('wps-adm-normalize-css', plugins_url('/normalize.css', __FILE__) ); 83 86 wp_enqueue_style('wps-adm-index-css', plugins_url('/index.css', __FILE__) ); 84 87 85 wp_enqueue_script('wps-adm-knockout-js', plugins_url('libs/knockout.min.js', __FILE__)); 86 wp_enqueue_style('wps-adm-bootstrap-css', plugins_url('libs/bootstrap.min.css', __FILE__) ); 87 88 wp_enqueue_style('wps-adm-survey-css', plugins_url('libs/modern.css', __FILE__) ); 89 wp_enqueue_script('wps-adm-survey-ko-js', plugins_url('libs/survey.ko.min.js', __FILE__), array('wps-adm-knockout-js')); 90 wp_enqueue_style('wps-adm-surveyjseditor-css', plugins_url('libs/survey-creator.css', __FILE__) ); 91 wp_enqueue_script('wps-adm-surveyjseditor-js', plugins_url('libs/survey-creator.min.js', __FILE__), array('wps-adm-survey-ko-js')); 88 wp_enqueue_script('wps-adm--babel.min.js', plugins_url('libs/babel.min.js', __FILE__)); 89 90 wp_enqueue_script('wps-adm--survey.core.min.js', plugins_url('libs/library/survey.core.min.js', __FILE__)); 91 wp_enqueue_script('wps-adm--survey.i18n.min.js', plugins_url('libs/library/survey.i18n.min.js', __FILE__)); 92 wp_enqueue_script('wps-adm--themes-index.min.js', plugins_url('libs/library/themes/index.min.js', __FILE__)); 93 wp_enqueue_script('wps-adm--survey-react-ui.min.js', plugins_url('libs/library/survey-react-ui.min.js', __FILE__)); 94 95 wp_enqueue_script('wps-adm--survey-creator-core.min.js', plugins_url('libs/creator/survey-creator-core.min.js', __FILE__)); 96 wp_enqueue_script('wps-adm--survey-creator-core.i18n.min.js', plugins_url('libs/creator/survey-creator-core.i18n.min.js', __FILE__)); 97 wp_enqueue_script('wps-adm--survey-creator-react.min.js', plugins_url('libs/creator/survey-creator-react.min.js', __FILE__)); 98 99 wp_enqueue_style('wps-adm--defaultV2.min.css', plugins_url('libs/library/defaultV2.min.css', __FILE__)); 100 101 wp_enqueue_style('wps-adm--survey-creator-core.min.css', plugins_url('libs/creator/survey-creator-core.min.css', __FILE__)); 102 103 104 // wp_enqueue_script('wps-adm-knockout-js', plugins_url('libs/knockout.min.js', __FILE__)); 105 106 // wp_enqueue_style('wps-adm-survey-css', plugins_url('libs/modern.css', __FILE__) ); 107 // wp_enqueue_script('wps-adm-survey-ko-js', plugins_url('libs/survey.ko.min.js', __FILE__), array('wps-adm-knockout-js')); 108 // wp_enqueue_style('wps-adm-surveyjseditor-css', plugins_url('libs/survey-creator.css', __FILE__) ); 109 // wp_enqueue_script('wps-adm-surveyjseditor-js', plugins_url('libs/survey-creator.min.js', __FILE__), array('wps-adm-survey-ko-js')); 92 110 93 111 wp_enqueue_style('wps-adm-datatables-css', plugins_url('libs/datatables/dataTables.min.css', __FILE__) ); … … 108 126 109 127 public function enqueue_frontend_scripts() { 110 $theme = sanitize_text_field(SurveyJS_SettingsPage::get_theme());111 if ($theme == "modern") {112 wp_enqueue_style('wps-survey-modern-css', plugins_url('libs/modern.css', __FILE__) );113 } else {114 wp_enqueue_style('wps-survey-css', plugins_url('libs/survey.css', __FILE__) );115 }128 // $theme = sanitize_text_field(SurveyJS_SettingsPage::get_theme()); 129 // if ($theme == "modern") { 130 // wp_enqueue_style('wps-survey-modern-css', plugins_url('libs/modern.css', __FILE__) ); 131 // } else { 132 // wp_enqueue_style('wps-survey-css', plugins_url('libs/survey.css', __FILE__) ); 133 // } 116 134 wp_enqueue_style('wps-survey-override-css', plugins_url('/survey.css', __FILE__) ); 117 wp_enqueue_script('wps-survey-jquery-js', plugins_url('libs/survey.jquery.min.js', __FILE__), array('jquery')); 135 wp_enqueue_script('wps-front-jquery-js', plugins_url('libs/library/survey.jquery.min.js', __FILE__), array('jquery')); 136 wp_enqueue_script('wps-front--themes-index.min.js', plugins_url('libs/library/themes/index.min.js', __FILE__)); 137 wp_enqueue_style('wps-front--defaultV2.min.css', plugins_url('libs/library/defaultV2.min.css', __FILE__)); 118 138 } 119 139 … … 125 145 // __CLASS__, 'wps_mysurveys_page' 126 146 // )); 127 add_submenu_page( 'sjs-main-menu', __( 'Settings', 'sjs-main-menu' ), __( 'Settings', 'sjs-main-menu' ), 'manage_options', 'sjs-settings', array( 'SurveyJS_SettingsPage', 'sjs_render_settings' ) );147 //add_submenu_page( 'sjs-main-menu', __( 'Settings', 'sjs-main-menu' ), __( 'Settings', 'sjs-main-menu' ), 'manage_options', 'sjs-settings', array( 'SurveyJS_SettingsPage', 'sjs_render_settings' ) ); 128 148 add_submenu_page('', '', '', 'manage_options', 'surveyjs_editor', array('SurveyJS_Editor', 'render')); 129 149 add_submenu_page('', '', '', 'manage_options', 'surveyjs_results', array('SurveyJS_Results', 'render')); … … 163 183 json = JSON.parse(data.json.replace(/\\\"/g, "\"").replace(/\\\\/g, "\\").replace(/\\'/g, "'")); 164 184 } 165 initSurvey<?php echo $id ?>(json); 185 if (data.theme) { 186 theme = JSON.parse(data.theme.replace(/\\\"/g, "\"").replace(/\\\\/g, "\\").replace(/\\'/g, "'")); 187 } 188 initSurvey<?php echo $id ?>(json, theme); 166 189 } 167 190 }); 168 191 169 function initSurvey<?php echo $id ?>(json) { 170 Survey.StylesManager.applyTheme('<?php echo sanitize_text_field(SurveyJS_SettingsPage::get_theme()) ?>'); 171 172 var customCss = { 173 <?php 174 if (SurveyJS_SettingsPage::get_allow_paddings() == 0) { 175 echo '"root": "sv_main sv_default_css"'; 176 } 177 ?> 178 } 179 180 window.survey<?php echo $id ?> = new Survey.Model(json); 181 192 function initSurvey<?php echo $id ?>(json, theme) { 193 // Survey.StylesManager.applyTheme('<?php echo sanitize_text_field(SurveyJS_SettingsPage::get_theme()) ?>'); 194 195 // var customCss = { 196 // <?php 197 // if (SurveyJS_SettingsPage::get_allow_paddings() == 0) { 198 // echo '"root": "sv_main sv_default_css"'; 199 // } 200 // ?> 201 // } 202 203 const survey<?php echo $id ?> = new Survey.Model(json); 204 survey<?php echo $id ?>.applyTheme(theme); 205 window.survey<?php echo $id ?> = survey<?php echo $id ?>; 182 206 survey<?php echo $id ?> 183 207 .onComplete … … 194 218 }); 195 219 196 jQuery("#surveyElement-<?php echo $id ?>").Survey({model: survey<?php echo $id ?> , css: customCss});220 jQuery("#surveyElement-<?php echo $id ?>").Survey({model: survey<?php echo $id ?>/*, css: customCss*/}); 197 221 } 198 222 </script> -
surveyjs/trunk/readme.txt
r2849163 r3006114 1 === SurveyJS ===1 === SurveyJS: Drag & Drop WordPress Form Builder to create, style and embed multiple forms of any complexity. === 2 2 Contributors: devsoftbaltic 3 3 Tags: survey, quiz, form builder, survey creator, survey maker, quiz creator 4 Requires at least: 4.65 Tested up to: 6. 1.14 Requires at least: 6.4.1 5 Tested up to: 6.4.1 6 6 Stable tag: trunk 7 Requires PHP: 5.2.47 Requires PHP: php8.2 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html 10 10 11 SurveyJS for WordPress - Survey, Quiz, Survey Creator and Form Builder plug-in.12 13 11 == Description == 14 12 15 Easy to use, drag & drop Survey Creator with myriad options. It is based on popular in JavaScript developer community [SurveyJS Library](https://surveyjs.io/Overview/Library/) and [Survey Creator](https://surveyjs.io/Survey/Survey-Creator/). 13 =Drag & Drop WordPress Form Builder for your Enterprise= 14 SurveyJS is **the most advanced yet easy-to-use form builder**, perfect for enterprises of any size. You can use it to build something as simple as a Contact or Feedback form, or to handle more complex use cases, such as an Application form with dynamic fields whose values are calculated and set based on the user's input and pre-defined conditions. 16 15 17 *Main features:* 18 * It has 15 elements (questions and panels) from simple inputs like text and dropdown to Panel containers and dynamic matrix (table), that allows to build you complex forms. 19 * Multi pages support 20 * It is localized on many languages and supporting multi language surveys/forms (one survey for several languages). 21 * Control survey flow by setting visibility expression for pages, panels, questions and even individual items in checkboxes, radio groups and dropdowns. 22 * Fill data for checkboxes, radio groups and dropdowns from web services. 23 * Validate user inputs with several built-in validators. 24 * Show results in a read only survey. 25 * Several good-looking themes and much more 16 =Flexible Configuration Options= 17 **Every single element of your form is fully customizable**, starting from titles and helper texts, to placeholder texts and error messages - all to make sure you can provide your respondents with tailored guides and instructions and ensure high-quality user experience. 26 18 27 The plugin supports the Gutenberg editor and old the editor as well. 19 =Diverse Question types= 20 Unlike the vast majority of form builders, SurveyJS goes far beyond common question types such as Single line input (date, email, name, surname etc.), Long text, Rating and Radio button group. Among some more advanced form elements that you can use are: 21 - [**Single-Select Dropdown**](https://surveyjs.io/form-library/examples/create-dropdown-menu-in-javascript/reactjs) 22 - [**Multi-Select Dropdown**](https://surveyjs.io/form-library/examples/how-to-create-multiselect-tag-box/reactjs) **(Tag Box)** 23 - [**Image Picker**](https://surveyjs.io/form-library/examples/image-picker-question/reactjs) 24 - [**Multiple Textboxes**](https://surveyjs.io/form-library/examples/multiple-text-box-question/reactjs) 25 - [**Ranking**](https://surveyjs.io/form-library/examples/add-ranking-question-to-form/reactjs) 26 - [**Select Items to Rank**](https://surveyjs.io/form-library/examples/select-items-to-rank/reactjs) 27 - [**HTML**](https://surveyjs.io/form-library/examples/questiontype-html/reactjs) 28 - [**Image Capture**](https://surveyjs.io/form-library/examples/photo-capture/reactjs) 29 - [**Single-Select Matrix**](https://surveyjs.io/form-library/examples/single-selection-matrix-table-question/reactjs) 30 - [**Multi-Select Matrix**](https://surveyjs.io/form-library/examples/questiontype-matrixdropdown/reactjs) 31 - [**Dynamic Matrix**](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/reactjs) 28 32 29 To find out more and review SurveyJS Examples please go to [https://surveyjs.io/Examples/Library/](https://surveyjs.io/Examples/Library/). 33 =Features= 34 Besides offering a wide variety of question elements, SurveyJS enables you to implement some advanced features, including: 30 35 31 == Installation and usage == 36 - [**Calculations**](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic-totals/reactjs) - to dynamically calculate values based on user input or predefined variables and display the calculated values in your form or survey. 37 - [**Carry Forward Responses**](https://surveyjs.io/form-library/examples/survey-carry-forward/reactjs#content-docs) - to copy choices from one question (the source) to another (the target). 38 - [**Side Navigation**](https://surveyjs.io/form-library/examples/table-of-contents/reactjs) **(Table of Contents)** - to help users to quickly navigate through longer surveys. 39 - [**Progress bar**](https://surveyjs.io/form-library/examples/configure-form-navigation-with-progress-indicators/reactjs) - to show users how many completed pages, answered questions, or valid answers have been given. 40 - [**Input validation**](https://surveyjs.io/form-library/examples/javascript-form-validation/reactjs) - to ensure that respondents fill out all required form fields and the format of values is correct before they are submitted. 41 - [**Panels**](https://surveyjs.io/form-library/examples/set-properties-on-multiple-questions-using-panel/reactjs) - to group questions and configure settings for several questions at once. 42 - [**Duplicate group option**](https://surveyjs.io/form-library/examples/dynamic-matrix-table-question-with-dropdown-cell-type/reactjs) - to save time and effort by allowing users to quickly clone a set of questions or elements without having to recreate them manually. 43 - [**Multi-file upload**](https://surveyjs.io/form-library/examples/file-upload/reactjs) - to enable respondents to upload multiple files of a required format within one file upload field. Once uploaded, files can be managed in the preview mode. 44 - [**Join identifier**](https://surveyjs.io/form-library/examples/merge-question-values/reactjs) - to link several questions within a form together and sync their values. 32 45 33 1. Upload SurveyJS plugin files to the `/wp-content/plugins/surveyjs` directory, or install the plugin through the WordPress plugins screen directly. 34 2. Activate the plugin through the 'Plugins' screen in WordPress 35 3. Navigate to the SurveyJS page of wordpress admin menu and click the “Add Survey”. 36 4. Use the SurveyJS->Setting page to choose a theme. 37 5. Go to the Posts page and click the “Add Survey” button. Then choose a survey and click the “Insert” button to add a SurveyJS shortcut. 38 6. For the Gutenberg Editor, please add "SurveyJS" block in the "Common Blocks" section. Then choose a survey in the block's settings to add a SurveyJS shortcut. 39 7. Go to the preview and check your survey. 40 8. Check your wordpress database for *wp_sjs_my_surveys* and *wp_sjs_results* tables. 46 =Display and Skip Logic= 47 To simplify the process of setting up conditional rules, SurveyJS ships with a **dedicated GUI for conditional rules** that makes the process simple for everyone. For example, you can set a rule that defines the [visibility of the next question](https://surveyjs.io/form-library/examples/conditional-logic-and-branching-in-surveys/reactjs) based on a given answer, or you can [customize the text of the Thank you page](https://surveyjs.io/form-library/examples/nps-question/reactjs#) based on how the respondent answered your questions. 41 48 42 == Hooks == 43 1. surveyjs_save_result : 44 add_action( 'surveyjs_save_result', function ( ) { 45 // do something with $_POST 46 } ); 49 =Styling= 50 But this is not all! **SurveyJS Theme Editor gives you the power to effortlessly customize survey UI themes and create unique survey looks** tailored to your application. And here's the exciting part: we've included a [collection of predefined themes](https://surveyjs.io/form-library/documentation/manage-default-themes-and-styles#add-surveyjs-themes-to-your-application) to help you get started. Just pick a theme as your base, refine it further to align with your brand's aesthetic, and witness real-time changes - from colors to layouts. Notably, our predefined themes prioritize accessibility. Dark mode and a specially designed contrast theme are particularly suited for individuals with visual impairments. 51 52 Please also refer to the collection of demos specially designed for various real-life use cases. 53 [View Featured Demos](https://surveyjs.io/form-library/examples/overview) 54 55 =E-signature capture field= 56 SurveyJS offers a simple way to add digital signatures to your e-forms with a build-it input field. This [signature field](https://surveyjs.io/form-library/examples/signature-pad-widget-javascript/reactjs) enables respondents to sign a form with their mouse pointer or even a finger by simply drawing a signature within the signature pad area. 47 57 48 58 == Screenshots == 49 59 50 1. My surveys page51 2. Survey Creator52 3. Results page53 4. Settings54 5. Choose Gutenberg block55 6. Choose the survey56 7. Gutenberg block with the shortcode60 1. Admin UI wiht your SurveyJS forms 61 2. Form builder UI for drag-and-drop form creation 62 3. GUI for setting up conditional rules 63 4. Theme editor 64 5. Add a block with your SurveyJS form 65 6. Embed and publish your form 66 7. View the result 57 67 58 68 == Changelog == … … 60 70 = 0.5 = 61 71 * first public release 62 = 1.0.26=72 = v1.9.120 = 63 73 * synchronized version with SurveyJS project 64 * fixed the bug https://surveyjs.answerdesk.io/internal/ticket/details/T33274 * added Survey Creator V2 65 75 66 76 == Support == -
surveyjs/trunk/surveyjs.php
r2849163 r3006114 27 27 name text NOT NULL, 28 28 json LONGTEXT, 29 theme LONGTEXT, 29 30 UNIQUE KEY id (id) 30 31 ) $charset_collate;"; -
surveyjs/trunk/views/editor.php
r2506505 r3006114 19 19 ?> 20 20 <style> 21 #sjs-editor-container .svd_container .card {21 /* #sjs-editor-container .svd_container .card { 22 22 max-width: none; 23 23 } … … 26 26 line-height: 20px; 27 27 padding: 6px 12px; 28 } 28 } */ 29 29 </style> 30 30 <script> … … 87 87 </span> 88 88 </h3> 89 <div id="sjs-editor-container"></div> 90 <script> 91 var CommercialLicense = <?php echo json_encode(file_exists(plugin_dir_path(__FILE__) . 'CommercialLicense.txt')) ?>; 92 var editorOptions = { showEmbededSurveyTab: false, showOptions: true, generateValidJSON : false, haveCommercialLicense: CommercialLicense }; 93 var editor = new SurveyCreator.SurveyCreator("sjs-editor-container", editorOptions); 94 editor.showState = true; 95 editor.isAutoSave = true; 96 editor.saveSurveyFunc = function(saveNo, callback) { 97 var json = JSON.stringify(editor.getSurveyJSON()); 98 jQuery.ajax({ 99 url: "<?php echo esc_url($saveSurveyUri) ?>", 100 type: "POST", 101 data: { Id: '<?php echo $surveyId ?>', Json: json }, 102 success: function (data) { 103 // if(data.isSuccess) { 104 // } 105 callback(saveNo, data.IsSuccess === 1); 106 } 89 <div id="sjs-editor-container" style="height: 77vh;"></div> 90 <script type="text/babel"> 91 function SurveyCreatorRenderComponent() { 92 var CommercialLicense = <?php echo json_encode(file_exists(plugin_dir_path(__FILE__) . 'CommercialLicense.txt')) ?>; 93 var editorOptions = { showThemeTab: true, showLogicTab: true, showEmbededSurveyTab: false, showOptions: true, generateValidJSON : false, haveCommercialLicense: CommercialLicense }; 94 const editor = new SurveyCreator.SurveyCreator(editorOptions); 95 editor.showState = true; 96 editor.isAutoSave = true; 97 editor.saveSurveyFunc = function(saveNo, callback) { 98 var json = JSON.stringify(editor.getSurveyJSON()); 99 var theme = JSON.stringify(editor.theme); 100 jQuery.ajax({ 101 url: "<?php echo esc_url($saveSurveyUri) ?>", 102 type: "POST", 103 data: { Id: '<?php echo $surveyId ?>', Json: json, Theme: theme }, 104 success: function (data) { 105 // if(data.isSuccess) { 106 // } 107 callback(saveNo, data.IsSuccess === 1); 108 } 109 }); 110 }; 111 editor.saveThemeFunc = function(saveNo, callback) { 112 var json = JSON.stringify(editor.getSurveyJSON()); 113 var theme = JSON.stringify(editor.theme); 114 jQuery.ajax({ 115 url: "<?php echo esc_url($saveSurveyUri) ?>", 116 type: "POST", 117 data: { Id: '<?php echo $surveyId ?>', Json: json, Theme: theme }, 118 success: function (data) { 119 // if(data.isSuccess) { 120 // } 121 callback(saveNo, data.IsSuccess === 1); 122 } 123 }); 124 }; 125 editor.onUploadFile.add(function(editor, options) { 126 var formData = new FormData(); 127 options.files.forEach(function(file) { 128 formData.append("file", file); 129 }); 130 jQuery.ajax({ 131 url: "<?php echo esc_url($uploadFileUri) ?>", 132 type: "POST", 133 xhr: function () { 134 var myXhr = jQuery.ajaxSettings.xhr(); 135 if (myXhr.upload) { 136 myXhr.upload.addEventListener('progress', function (event) { 137 var percent = 0; 138 var position = event.loaded || event.position; 139 var total = event.total; 140 }, false); 141 } 142 return myXhr; 143 }, 144 success: function (data) { 145 options.callback("success", data["url"]); 146 }, 147 error: function (error) { 148 }, 149 async: true, 150 data: formData, 151 cache: false, 152 contentType: false, 153 processData: false, 154 timeout: 60000 155 }); 107 156 }); 157 const creator = editor; 158 var json = '<?php echo htmlspecialchars_decode($json); ?>'; 159 creator.text = json; 160 //creator.JSON = surveyJSON; 161 return (<SurveyCreator.SurveyCreatorComponent creator={creator} />); 108 162 } 109 editor.onUploadFile.add(function(editor, options) { 110 var formData = new FormData(); 111 options.files.forEach(function(file) { 112 formData.append("file", file); 113 }); 114 jQuery.ajax({ 115 url: "<?php echo esc_url($uploadFileUri) ?>", 116 type: "POST", 117 xhr: function () { 118 var myXhr = jQuery.ajaxSettings.xhr(); 119 if (myXhr.upload) { 120 myXhr.upload.addEventListener('progress', function (event) { 121 var percent = 0; 122 var position = event.loaded || event.position; 123 var total = event.total; 124 }, false); 125 } 126 return myXhr; 127 }, 128 success: function (data) { 129 options.callback("success", data["url"]); 130 }, 131 error: function (error) { 132 }, 133 async: true, 134 data: formData, 135 cache: false, 136 contentType: false, 137 processData: false, 138 timeout: 60000 139 }); 140 }); 141 var json = '<?php echo htmlspecialchars_decode($json); ?>'; 142 editor.text = json; 163 164 const root = ReactDOM.createRoot(document.getElementById("sjs-editor-container")); 165 root.render(<SurveyCreatorRenderComponent />); 143 166 </script> 144 167 </div> -
surveyjs/trunk/views/results.php
r2263985 r3006114 76 76 }); 77 77 78 var windowSurvey = new Survey. SurveyWindow(surveyJson);78 var windowSurvey = new Survey.PopupSurveyModel(surveyJson); 79 79 windowSurvey.survey.mode = "display"; 80 80 windowSurvey.survey.title = "<?php echo $surveyName; ?>"; -
surveyjs/trunk/views/settings.php
r2300379 r3006114 31 31 register_setting( 'sjs-settings-group', 'sjs-settings' ); 32 32 33 add_settings_section( 'sjs-themes-section', __( 'Tnemes', 'sjs' ), array($this, 'sjs_themes_section'), 'sjs-settings-page' );34 add_settings_field( 'theme', __( 'Current Theme', 'sjs' ), array($this, 'theme_render'), 'sjs-settings-page', 'sjs-themes-section' );33 // add_settings_section( 'sjs-themes-section', __( 'Tnemes', 'sjs' ), array($this, 'sjs_themes_section'), 'sjs-settings-page' ); 34 //add_settings_field( 'theme', __( 'Current Theme', 'sjs' ), array($this, 'theme_render'), 'sjs-settings-page', 'sjs-themes-section' ); 35 35 add_settings_field( 'allow-paddings', __( 'Allow Paddings', 'sjs' ), array($this, 'allow_paddings_render'), 'sjs-settings-page', 'sjs-themes-section' ); 36 36 }
Note: See TracChangeset
for help on using the changeset viewer.