Skip to content

Commit

Permalink
Elementor compatibility Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bi1101 committed Jul 22, 2024
1 parent a2aa0b9 commit f7e23ff
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 84 deletions.
4 changes: 2 additions & 2 deletions Assets/js/docx_export.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Script Name: Docx Export
* Version: 1.0.8
* Version: 1.0.9
* Last Updated: 16-5-2024
* Author: bi1101
* Description: Export the result page as docx files with comments.
Expand Down Expand Up @@ -143,7 +143,7 @@ function createSectionsWithComments(rawComments) {

function createNormalSections(className) {
const element = document.querySelector(
`.${className} .elementor-widget-container .elementor-shortcode`
`.${className}`
);
if (!element) {
console.warn(`No element found with class name: ${className}`);
Expand Down
4 changes: 2 additions & 2 deletions Assets/js/docx_export_speaking.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Script Name: Docx Export for Speaking
* Version: 1.0.1
* Version: 1.0.2
* Last Updated: 16-05-2024
* Author: bi1101
* Description: Export the result page as docx files with comments.
Expand Down Expand Up @@ -114,7 +114,7 @@ function createSectionsWithComments(rawComments) {

function createNormalSections(className) {
const element = document.querySelector(
`.${className} .elementor-widget-container .elementor-shortcode`
`.${className}`
);
if (!element) {
console.warn(`No element found with class name: ${className}`);
Expand Down
76 changes: 0 additions & 76 deletions Assets/js/writify_event_stream.js

This file was deleted.

8 changes: 4 additions & 4 deletions writify-gform-openai.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: Writify
* Description: Score IELTS Essays x GPT
* Version: 1.2.6
* Version: 1.2.7
* Author: IELTS Science
* Copyright: © 2023-2026 RLT
*/
Expand Down Expand Up @@ -147,7 +147,7 @@ function writify_enqueue_scripts_footer()
// When a message is done, convert the buffer to HTML and display it
var html = md.render(buffer);
jQuery('.response-div-' + div_index).find('.preloader-icon').hide();
var current_div = jQuery('.response-div-' + div_index).find('.elementor-shortcode');
var current_div = jQuery('.response-div-' + div_index).find('.e-con-full');
current_div.html(html); // Replace the current HTML content with the processed markdown

jQuery.when(current_div.html(html)).then(function () {
Expand Down Expand Up @@ -223,7 +223,7 @@ function writify_enqueue_scripts()

// Enqueue the script only if the slug starts with 'result'
if (substr($slug, 0, 6) === 'result') {
wp_enqueue_script('writify-docx-export', plugin_dir_url(__FILE__) . 'Assets/js/docx_export.js', array('jquery'), '1.0.8', true);
wp_enqueue_script('writify-docx-export', plugin_dir_url(__FILE__) . 'Assets/js/docx_export.js', array('jquery'), '1.0.9', true);
// Enqueue Docx script
wp_enqueue_script('docx', 'https://unpkg.com/[email protected]/build/index.js', array(), null, true);
// Enqueue FileSaver script
Expand Down Expand Up @@ -262,7 +262,7 @@ function writify_enqueue_scripts()
// Enqueue the script only if the slug starts with 'speaking-result'
if (substr($slug, 0, 15) === 'speaking-result') {
// Enqueue necessary scripts
wp_enqueue_script('writify-docx-export', plugin_dir_url(__FILE__) . 'Assets/js/docx_export_speaking.js', array('jquery'), '1.0.1', true);
wp_enqueue_script('writify-docx-export', plugin_dir_url(__FILE__) . 'Assets/js/docx_export_speaking.js', array('jquery'), '1.0.2', true);
// Enqueue Docx script
wp_enqueue_script('docx', 'https://unpkg.com/[email protected]/build/index.js', array(), null, true);
// Enqueue FileSaver script
Expand Down

0 comments on commit f7e23ff

Please sign in to comment.