json-object-editor 0.10.668 → 0.10.670
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/TESTING_PHASE1_PROGRESS.md +216 -0
- package/_www/ai-jobs.html +218 -0
- package/_www/mcp-nav.js +21 -12
- package/_www/mcp-test.html +287 -287
- package/capp/capp.css +3 -2
- package/css/joe-ai.css +71 -0
- package/css/joe.css +1 -1
- package/docs/protocol_report_template.html +479 -0
- package/docs/protocol_report_template.js +563 -0
- package/js/JsonObjectEditor.jquery.craydent.js +22 -3
- package/js/joe-ai.js +3220 -2301
- package/js/joe.js +23 -4
- package/js/joe.min.js +1 -1
- package/package.json +1 -1
- package/pages/template.html +2 -0
- package/server/fields/core.js +16 -2
- package/server/init.js +9 -1
- package/server/modules/AiJobs.js +412 -0
- package/server/modules/MCP.js +1481 -1368
- package/server/modules/Server.js +3 -0
- package/server/plugins/chatgpt.js +2332 -2113
- package/server/schemas/ai_prompt.js +9 -2
- package/server/schemas/report.js +1 -1
- package/server/schemas/task.js +1 -0
- package/web-components/field-jobs-container.js +224 -0
package/js/joe.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* --------------------------------------------------------
|
|
2
2
|
*
|
|
3
|
-
* json-object-editor - v0.10.
|
|
3
|
+
* json-object-editor - v0.10.670
|
|
4
4
|
* Created by: Corey Hadden
|
|
5
5
|
*
|
|
6
6
|
* -------------------------------------------------------- */
|
|
@@ -3350,6 +3350,10 @@ this.renderHTMLContent = function(specs){
|
|
|
3350
3350
|
|
|
3351
3351
|
//if(prop.width){
|
|
3352
3352
|
//close field container
|
|
3353
|
+
// Add field-jobs-container if queryJobs is true
|
|
3354
|
+
if (prop.queryJobs && self.current && self.current.object && self.current.object._id) {
|
|
3355
|
+
html += '<field-jobs-container data-object-id="' + self.current.object._id + '" data-field-name="' + prop.name + '"></field-jobs-container>';
|
|
3356
|
+
}
|
|
3353
3357
|
html+='</joe-field-container>';
|
|
3354
3358
|
// }
|
|
3355
3359
|
|
|
@@ -3561,13 +3565,28 @@ this.renderHTMLContent = function(specs){
|
|
|
3561
3565
|
try{
|
|
3562
3566
|
var aiLabel = self.propAsFuncOrValue(prop.ai.label) || 'AI';
|
|
3563
3567
|
var fieldName = prop.name || '';
|
|
3568
|
+
var obj = self.current && self.current.object || {};
|
|
3569
|
+
var objectId = obj._id || '';
|
|
3570
|
+
// Generate progress token using centralized function
|
|
3571
|
+
var progressToken = '';
|
|
3572
|
+
if (objectId && fieldName && window._joe && _joe.Ai && _joe.Ai.generateProgressToken) {
|
|
3573
|
+
progressToken = _joe.Ai.generateProgressToken(objectId, fieldName);
|
|
3574
|
+
}
|
|
3564
3575
|
html +=
|
|
3565
|
-
'<button
|
|
3576
|
+
'<joe-button class="joe-button joe-ai-button joe-ai-autofill-button joe-iconed-button" ' +
|
|
3577
|
+
'data-progress-token="' + progressToken + '" ' +
|
|
3578
|
+
'data-original-text="' + aiLabel.replace(/"/g, '"') + '" ' +
|
|
3579
|
+
'data-field-name="' + fieldName + '" ' +
|
|
3580
|
+
'data-object-id="' + objectId + '" ' +
|
|
3566
3581
|
'onclick="if(window._joe && _joe.Ai && _joe.Ai.populateField){_joe.Ai.populateField(\''+fieldName+'\');}" ' +
|
|
3567
3582
|
'title="Let AI suggest a value for this field">'+
|
|
3568
3583
|
aiLabel+
|
|
3569
|
-
'</button>'
|
|
3570
|
-
|
|
3584
|
+
'</joe-button>';
|
|
3585
|
+
if (progressToken) {
|
|
3586
|
+
html += '<div class="joe-ai-progress" data-for-token="' + progressToken + '" style="font-size:12px; color:#666; margin-top:4px; min-height:16px;"></div>';
|
|
3587
|
+
html += '<div class="joe-ai-jobs" data-for-token="' + progressToken + '" style="margin-top:4px;"></div>';
|
|
3588
|
+
}
|
|
3589
|
+
html += '<div class="clear"></div>';
|
|
3571
3590
|
}catch(_e){
|
|
3572
3591
|
// fail silently if something about the ai config is invalid
|
|
3573
3592
|
}
|