-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8092867
commit 5704e83
Showing
4 changed files
with
108 additions
and
1 deletion.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
app/views/components/editor/example-with-gen-ai-button.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
|
||
<div class="row"> | ||
<div class="twelve columns"> | ||
<div class="field"> | ||
<label class="label" for="title">Title</label> | ||
<input type="text" id="title" placeholder="Example"/> | ||
</div> | ||
|
||
<div class="field"> | ||
<span id="comments-label" class="label">Comments</span> | ||
<div class="editor" id="editor1" aria-label="Comments" data-options="{attributes: [{name: 'id', value: 'example1'}, {name: 'data-automation-id', value: 'automation-id-example1'}]}"> | ||
<p>Embrace <a href="http://en.wikipedia.org/wiki/e-commerce" class="hyperlink">e-commerce action-items</a>, reintermediate, ecologies paradigms wireless share life-hacks create innovative harness. Evolve solutions rich-clientAPIs synergies harness relationships virtual vertical facilitate end-to-end, wireless, evolve synergistic synergies.</p> | ||
<p>Cross-platform, evolve, ROI scale cultivate eyeballs addelivery, e-services content cross-platform leverage extensible viral incentivize integrateAJAX-enabled sticky evolve magnetic cultivate leverage; cutting-edge. Innovate, end-to-end podcasting, whiteboard streamline e-business social; compelling, "cross-media exploit infomediaries innovative integrate integrateAJAX-enabled." Killer interactive reinvent, cultivate widgets leverage morph.</p> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
|
||
<script> | ||
$('body').on('initialized', function () { | ||
var editorElement = $('#editor1'); | ||
var loadingIndicator = $('<div class="ai-loading-indicator"><div class="bar"></div><div class="bar"></div><div class="bar"></div></div>'); | ||
|
||
editorElement.on('AIButtonClicked', function (e, elements) { | ||
e.preventDefault(); | ||
|
||
// Cache the jQuery objects | ||
var editor = $(elements.editor[0]); | ||
var toolbar = $(elements.toolbar); | ||
|
||
// Add the loading indicator to the editor element | ||
loadingIndicator.appendTo(editor); | ||
|
||
// Disable button interactions during processing | ||
toolbar.find('.btn-gen-ai').css('pointer-events', 'none'); | ||
|
||
setTimeout(function () { | ||
// Remove the loading indicator after a delay | ||
editor.find('.ai-loading-indicator').remove(); | ||
toolbar.find('.btn-gen-ai').css('pointer-events', ''); | ||
}, 4000); | ||
}); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters