You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by hu...@apache.org on 2019/08/08 14:36:19 UTC

svn commit: r1864709 - in /comdev/reporter.apache.org/trunk/site/wizard/js: source/drafts.js source/primer.js source/unified.js wizard-beta.js

Author: humbedooh
Date: Thu Aug  8 14:36:19 2019
New Revision: 1864709

URL: http://svn.apache.org/viewvc?rev=1864709&view=rev
Log:
If we have a report in agenda, load that when resetting the editor...it's a nice thing to do :)

Modified:
    comdev/reporter.apache.org/trunk/site/wizard/js/source/drafts.js
    comdev/reporter.apache.org/trunk/site/wizard/js/source/primer.js
    comdev/reporter.apache.org/trunk/site/wizard/js/source/unified.js
    comdev/reporter.apache.org/trunk/site/wizard/js/wizard-beta.js

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/drafts.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/drafts.js?rev=1864709&r1=1864708&r2=1864709&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/drafts.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/drafts.js Thu Aug  8 14:36:19 2019
@@ -186,5 +186,10 @@ function load_from_agenda() {
     window.setTimeout(() => { draft_stepper.editor.highlight() }, 250);
     draft_stepper.build(0, false, false);
     draft_stepper.editor.check_changes(true);
+    let reflower = document.getElementById('unified-reflow');
+    if (reflower) {
+      reflower.innerHTML = "Notice: Loaded most recent version of report from current agenda into editor.";
+      reflower.style.visibility = 'visible';
+    }
   }
 }
\ No newline at end of file

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/primer.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/primer.js?rev=1864709&r1=1864708&r2=1864709&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/primer.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/primer.js Thu Aug  8 14:36:19 2019
@@ -53,6 +53,7 @@ function prime_steps(state, json) {
         let editor = new UnifiedEditor('unified-report', json.steps);
         let stepper = new ReportStepper('unified-steps', editor, json.steps, 'unified-helper');
         editor.stepper = stepper;
+        draft_stepper = stepper;
         stepper.pdata = pdata;
         stepper.build(0, true);
     }

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/unified.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/unified.js?rev=1864709&r1=1864708&r2=1864709&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/unified.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/unified.js Thu Aug  8 14:36:19 2019
@@ -187,6 +187,11 @@ function UnifiedEditor_mark_section(titl
 
 // Function for resetting a report to follow layout
 function UnifiedEditor_reset() {
+    // Check whether we have a report in agenda, if so reset to that.
+    if (meta_data && meta_data.report) {
+        load_from_agenda();
+        return
+    }
     this.report = "";
     this.changed = true;
     for (var i = 0; i < this.layout.length; i++) {

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/wizard-beta.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/wizard-beta.js?rev=1864709&r1=1864708&r2=1864709&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/wizard-beta.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/wizard-beta.js Thu Aug  8 14:36:19 2019
@@ -1201,6 +1201,11 @@ function load_from_agenda() {
     window.setTimeout(() => { draft_stepper.editor.highlight() }, 250);
     draft_stepper.build(0, false, false);
     draft_stepper.editor.check_changes(true);
+    let reflower = document.getElementById('unified-reflow');
+    if (reflower) {
+      reflower.innerHTML = "Notice: Loaded most recent version of report from current agenda into editor.";
+      reflower.style.visibility = 'visible';
+    }
   }
 }
 
@@ -1874,6 +1879,7 @@ function prime_steps(state, json) {
         let editor = new UnifiedEditor('unified-report', json.steps);
         let stepper = new ReportStepper('unified-steps', editor, json.steps, 'unified-helper');
         editor.stepper = stepper;
+        draft_stepper = stepper;
         stepper.pdata = pdata;
         stepper.build(0, true);
     }
@@ -3471,6 +3477,11 @@ function UnifiedEditor_mark_section(titl
 
 // Function for resetting a report to follow layout
 function UnifiedEditor_reset() {
+    // Check whether we have a report in agenda, if so reset to that.
+    if (meta_data && meta_data.report) {
+        load_from_agenda();
+        return
+    }
     this.report = "";
     this.changed = true;
     for (var i = 0; i < this.layout.length; i++) {