community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1864168 - in /comdev/reporter.apache.org/trunk/site/wizard: css/wizard.css index.html js/source/init.js js/source/primer.js js/source/unified.js js/wizard.js steps.json unified.html
Date Thu, 01 Aug 2019 17:52:02 GMT
Author: humbedooh
Date: Thu Aug  1 17:52:01 2019
New Revision: 1864168

URL: http://svn.apache.org/viewvc?rev=1864168&view=rev
Log:
Start work on unified version of the editor...

Added:
    comdev/reporter.apache.org/trunk/site/wizard/js/source/unified.js
    comdev/reporter.apache.org/trunk/site/wizard/unified.html
Modified:
    comdev/reporter.apache.org/trunk/site/wizard/css/wizard.css
    comdev/reporter.apache.org/trunk/site/wizard/index.html
    comdev/reporter.apache.org/trunk/site/wizard/js/source/init.js
    comdev/reporter.apache.org/trunk/site/wizard/js/source/primer.js
    comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js
    comdev/reporter.apache.org/trunk/site/wizard/steps.json

Modified: comdev/reporter.apache.org/trunk/site/wizard/css/wizard.css
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/css/wizard.css?rev=1864168&r1=1864167&r2=1864168&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/css/wizard.css (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/css/wizard.css Thu Aug  1 17:52:01 2019
@@ -1,3 +1,9 @@
+#wrapper.unified {
+    width: 1200px;
+    min-height: 630px;
+    margin: 0 auto;
+    /*border: 3px solid #333;*/
+}
 .wizard-step {
     width: 64px !important;
     height: 64px;
@@ -16,6 +22,10 @@
 }
 
 
+.unified .wizard-step {
+  margin-left: -10px;
+}
+
 .wizard-step-wrapper {
     display: inline-block;
     color: #333;
@@ -23,6 +33,10 @@
     height: 120px;
 }
 
+.unified .wizard-step-wrapper {
+  height: 96px;
+}
+
 .wizard-step-wrapper:hover > * {
     cursor: pointer;
     color: #090;
@@ -44,6 +58,22 @@
     line-height: 18px;
     margin-left: 9px;
     text-align: center;
+    z-index: 4;
+    position: relative;
+}
+
+.unified .wizard-step-text {
+  margin-left: -10px;
+  margin-top: -3px;
+  height: 16px;
+  border-radius: 5px;
+  border: 2px solid #666;
+  background: #FFF;
+  height: 20px;
+}
+
+.unified .wizard-step-text .done {
+ color: #F00;
 }
 
 .wizard-step.active {
@@ -64,10 +94,22 @@
     position: relative;
 }
 
+.unified .wizard-line {
+    border: none;
+    border-right: 3px solid #666;
+    width: 48px;
+    display: inline-block;
+    margin-top: -24px;
+    margin-left: 4px;
+    height: 48px;
+    z-index: 0;
+    position: absolute;
+}
+
 
 .done {
-    color: #9BE;
-    border-color: #9BE;
+    color: #9BE !important;
+    border-color: #9BE !important;
 }
 
 
@@ -82,6 +124,19 @@
     text-align: center;
 }
 
+.unified #steps {
+    width: 120px;
+    border: 1.5px solid #3339;
+    background: #EEE;
+    border-radius: 10px;
+    margin: 10px auto;
+    padding: 10px;
+    height: 600px;
+    text-align: center;
+    display: inline-block;
+    float: left;
+}
+
 #wizard-content {
     width: 720px;
     border: 1.5px solid #3339;
@@ -180,4 +235,53 @@
        -ms-transition: opacity 0.01s linear !important;
         -o-transition: opacity 0.01s linear !important;
            transition: opacity 0.01s linear !important;
- }
\ No newline at end of file
+ }
+ 
+ 
+.unified textarea {
+ font-family: monospace;
+ font-size: 12px;
+}
+
+#unified-editor {
+ display: none;
+}
+
+.unified #unified-editor {
+  display: inline-block;
+  width: 560px;
+  height: 620px;
+  float: left;
+  margin: 16px;
+  
+}
+
+#unified-helper {
+ display: none;
+}
+
+.unified #unified-helper {
+  display: inline-block;
+  width: 400px;
+  height: 600px;
+  float: left;
+  margin: 10px;
+  border: 2px solid #666;
+  background: #FFE;
+  border-radius: 10px;
+  font-size: 0.8rem;
+}
+
+#unified-report {
+ width: 540px;
+ height: 590px;
+ font-size: 11px;
+}
+
+.unified #tips {
+ display: none !important;
+}
+
+.unified #wizard-content {
+ display: none;
+}
\ No newline at end of file

Modified: comdev/reporter.apache.org/trunk/site/wizard/index.html
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/index.html?rev=1864168&r1=1864167&r2=1864168&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/index.html (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/index.html Thu Aug  1 17:52:01 2019
@@ -11,9 +11,13 @@
 <meta property='og:type' content='website'>
 <meta property='og:image' content='https://reporter.apache.org/guide/logo.png'>
 
+<script type="text/javascript">
+let editor_type = 'default';
+</script>
 
 <title>ASF Board Report Wizard</title>
 <link rel="stylesheet" href="css/wizard.css"/>
+<link rel="stylesheet" href="highlighter/highlighter.css"/>
 <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
 </head>
 <body>
@@ -29,6 +33,11 @@
       
      </div>
     
+    <div id="unified-editor">
+     <textarea id="unified-report" onmouseup="find_section();" onkeyup="find_section();"></textarea>
+    </div>
+    <div id="unified-helper"></div>
+    
     <div id="wizard-content">
      <div id="help_wrapper">
      <h3 id="step_title">Project Activity:</h3>
@@ -69,7 +78,7 @@ placeholder="Example activity:
     </div>
   </div>
    
-   <footer style="text-align: center; font-size: 0.8rem;">
+   <footer style="text-align: center; font-size: 0.8rem; clear: both;">
     Powered by the <a href='./'>ASF Board Report Wizard</a>. Copyright&copy;
2019 <a href='https://community.apache.org'>Apache Community Development</a>.<br/>
     Queries or other feedback should go to our mailing list: dev@community.apache.org
    </footer>
@@ -82,6 +91,7 @@ placeholder="Example activity:
 <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
 <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
crossorigin="anonymous"></script>
 <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js"></script>
+<script src="highlighter/highlighter.js" type="text/javascript"></script>
 <script src="js/wizard.js" type="text/javascript"></script>
 </body>
 </html>

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/init.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/init.js?rev=1864168&r1=1864167&r2=1864168&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/init.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/init.js Thu Aug  1 17:52:01 2019
@@ -29,6 +29,10 @@ if (project.length < 2) {
         titles[i].innerText = document.title;
     }
     
+    if (editor_type == 'unified') {
+        console.log("Using unified editor!");
+        document.getElementById('wrapper').setAttribute('class', 'unified');
+    }
     console.log("Initializing escrow checks");
     window.setInterval(escrow_check, 250);
     

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=1864168&r1=1864167&r2=1864168&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  1 17:52:01 2019
@@ -68,8 +68,14 @@ function build_steps(s, start) {
         stepcircle.inject(stepicon);
         let steptext = new HTML('div', {class: 'wizard-step-text'}, element.description);
         wrapper.inject([stepcircle, steptext]);
-        if (s == i) stepcircle.setAttribute('class', 'wizard-step active');
-        if (i < s) stepcircle.setAttribute('class', 'wizard-step done');
+        if (s == i) {
+            stepcircle.setAttribute('class', 'wizard-step active');
+            steptext.setAttribute('class', 'wizard-step-text active');
+        }
+        if (i < s) {
+            stepcircle.setAttribute('class', 'wizard-step done');
+            steptext.setAttribute('class', 'wizard-step-text done');
+        }
         stepParent.inject(wrapper);
         if (i < step_json.length-1) {
             let line = new HTML('div', {class: 'wizard-line'});
@@ -127,5 +133,46 @@ function build_steps(s, start) {
     let bn = document.getElementById('step_next');
     if (s == step_json.length -1) bn.style.display = 'none';
     else bn.style.display = 'block';
+    
+    if (editor_type == 'unified') {
+        if (start) {
+            let template = "";
+            for (var i = 0; i < step_json.length; i++) {
+                let step = step_json[i];
+                if (!step.noinput) {
+                    template += "## %s:\n".format(step.description);
+                    if (step.generator) {
+                        let data = eval("%s(pdata);".format(step.generator));
+                        if (data && data.length > 0) template += data
+                    } else {
+                        template += "[Insert your own data here]";
+                    }
+                    template += "\n\n";
+                }
+            }
+            document.getElementById('unified-report').value = template;
+        }
+        if (report_changed) hilite_sections();
+        
+        let step = step_json[s];
+        let helper = document.getElementById('unified-helper');
+        
+        helper.innerHTML = "<h5>%s:</h5>".format(step.description);
+        // Add in help
+        if (step.helpgenerator) {
+            let data = eval("%s(pdata);".format(step.helpgenerator));
+            helper.innerHTML += data;
+        } else if (step.help) {
+            helper.innerHTML += step.help;
+        }
+        
+        // Add tips?
+        if (step.tipgenerator) {
+            let data = eval("%s(pdata);".format(step.tipgenerator));
+            helper.innerHTML += data;
+        }
+        
+    }
+    
 }
 

Added: 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=1864168&view=auto
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/unified.js (added)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/unified.js Thu Aug  1 17:52:01
2019
@@ -0,0 +1,52 @@
+
+function hilite_sections() {
+    if (highlighted) return;
+    highlighted = true;
+    let hilites = [
+        {highlight: '[Insert your own data here]', className: 'none' }
+                   ];
+    let hcolors = ['blue', 'green', 'red', 'yellow'];
+    for (var i = 1; i < step_json.length-1; i++) {
+        let step = step_json[i];
+        let tline = "## %s:".format(step.description);
+        console.log(step.description);
+        hilites.push({
+            highlight: tline,
+            className: hcolors[i%hcolors.length]
+            });
+        
+    }
+    $('#unified-report').highlightWithinTextarea({
+        highlight: hilites
+    });
+}
+
+
+let report_unified = "";
+let report_changed = true;
+let highlighted = false;
+
+function find_section() {
+    let tmp = document.getElementById('unified-report').value;
+    report_changed = (report_unified == tmp) ? false : true;
+    report_unified = tmp;
+    let spos = $('#unified-report').prop("selectionStart");
+    let helper = document.getElementById('unified-helper');
+    
+    let tprec = report_unified.substr(0, spos);
+    let at_step = 0;
+    for (var i = 1; i < step_json.length-1; i++) {
+        let step = step_json[i];
+        let tline = "## %s:".format(step.description);
+        if (tprec.search(tline) != -1) {
+            at_step = i;
+        }
+    }
+    
+    if (at_step) {
+        build_steps(at_step);
+        
+    } else {
+        helper.innerText = "";
+    }
+}
\ No newline at end of file

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js?rev=1864168&r1=1864167&r2=1864168&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js Thu Aug  1 17:52:01 2019
@@ -1425,6 +1425,10 @@ if (project.length < 2) {
         titles[i].innerText = document.title;
     }
     
+    if (editor_type == 'unified') {
+        console.log("Using unified editor!");
+        document.getElementById('wrapper').setAttribute('class', 'unified');
+    }
     console.log("Initializing escrow checks");
     window.setInterval(escrow_check, 250);
     
@@ -1505,8 +1509,14 @@ function build_steps(s, start) {
         stepcircle.inject(stepicon);
         let steptext = new HTML('div', {class: 'wizard-step-text'}, element.description);
         wrapper.inject([stepcircle, steptext]);
-        if (s == i) stepcircle.setAttribute('class', 'wizard-step active');
-        if (i < s) stepcircle.setAttribute('class', 'wizard-step done');
+        if (s == i) {
+            stepcircle.setAttribute('class', 'wizard-step active');
+            steptext.setAttribute('class', 'wizard-step-text active');
+        }
+        if (i < s) {
+            stepcircle.setAttribute('class', 'wizard-step done');
+            steptext.setAttribute('class', 'wizard-step-text done');
+        }
         stepParent.inject(wrapper);
         if (i < step_json.length-1) {
             let line = new HTML('div', {class: 'wizard-line'});
@@ -1564,6 +1574,47 @@ function build_steps(s, start) {
     let bn = document.getElementById('step_next');
     if (s == step_json.length -1) bn.style.display = 'none';
     else bn.style.display = 'block';
+    
+    if (editor_type == 'unified') {
+        if (start) {
+            let template = "";
+            for (var i = 0; i < step_json.length; i++) {
+                let step = step_json[i];
+                if (!step.noinput) {
+                    template += "## %s:\n".format(step.description);
+                    if (step.generator) {
+                        let data = eval("%s(pdata);".format(step.generator));
+                        if (data && data.length > 0) template += data
+                    } else {
+                        template += "[Insert your own data here]";
+                    }
+                    template += "\n\n";
+                }
+            }
+            document.getElementById('unified-report').value = template;
+        }
+        if (report_changed) hilite_sections();
+        
+        let step = step_json[s];
+        let helper = document.getElementById('unified-helper');
+        
+        helper.innerHTML = "<h5>%s:</h5>".format(step.description);
+        // Add in help
+        if (step.helpgenerator) {
+            let data = eval("%s(pdata);".format(step.helpgenerator));
+            helper.innerHTML += data;
+        } else if (step.help) {
+            helper.innerHTML += step.help;
+        }
+        
+        // Add tips?
+        if (step.tipgenerator) {
+            let data = eval("%s(pdata);".format(step.tipgenerator));
+            helper.innerHTML += data;
+        }
+        
+    }
+    
 }
 
 
@@ -1810,3 +1861,61 @@ function toggleView(id) {
     obj.style.display = (obj.style.display == 'block') ? 'none' : 'block';
   }
 }
+
+
+/******************************************
+ Fetched from source/unified.js
+******************************************/
+
+
+function hilite_sections() {
+    if (highlighted) return;
+    highlighted = true;
+    let hilites = [
+        {highlight: '[Insert your own data here]', className: 'none' }
+                   ];
+    let hcolors = ['blue', 'green', 'red', 'yellow'];
+    for (var i = 1; i < step_json.length-1; i++) {
+        let step = step_json[i];
+        let tline = "## %s:".format(step.description);
+        console.log(step.description);
+        hilites.push({
+            highlight: tline,
+            className: hcolors[i%hcolors.length]
+            });
+        
+    }
+    $('#unified-report').highlightWithinTextarea({
+        highlight: hilites
+    });
+}
+
+
+let report_unified = "";
+let report_changed = true;
+let highlighted = false;
+
+function find_section() {
+    let tmp = document.getElementById('unified-report').value;
+    report_changed = (report_unified == tmp) ? false : true;
+    report_unified = tmp;
+    let spos = $('#unified-report').prop("selectionStart");
+    let helper = document.getElementById('unified-helper');
+    
+    let tprec = report_unified.substr(0, spos);
+    let at_step = 0;
+    for (var i = 1; i < step_json.length-1; i++) {
+        let step = step_json[i];
+        let tline = "## %s:".format(step.description);
+        if (tprec.search(tline) != -1) {
+            at_step = i;
+        }
+    }
+    
+    if (at_step) {
+        build_steps(at_step);
+        
+    } else {
+        helper.innerText = "";
+    }
+}
\ No newline at end of file

Modified: comdev/reporter.apache.org/trunk/site/wizard/steps.json
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/steps.json?rev=1864168&r1=1864167&r2=1864168&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/steps.json (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/steps.json Thu Aug  1 17:52:01 2019
@@ -19,7 +19,7 @@
     {
         "id": "basic",
         "icon": "chart-bar",
-        "description": "Basic Information",
+        "description": "Membership Data",
         "help": "This is the basic project community data. You can usually leave this part
as is, unless you wish to add additional information.",
         "generator": "generate_pmc_roster"
     },

Added: comdev/reporter.apache.org/trunk/site/wizard/unified.html
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/unified.html?rev=1864168&view=auto
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/unified.html (added)
+++ comdev/reporter.apache.org/trunk/site/wizard/unified.html Thu Aug  1 17:52:01 2019
@@ -0,0 +1,98 @@
+ <!DOCTYPE HTML>
+<html>
+<head>
+<meta charset="utf8">
+<meta property='twitter:title' content='ASF Board Report Wizard'>
+<meta property='twitter:description' content='Guiding tool for creating board reports
for ASF projects'>
+<meta property='twitter:image' content='https://reporter.apache.org/guide/logo.png'>
+
+<meta property='og:site_name' content='ASF Board Report Wizard'>
+<meta property='og:title' content='ASF Board Report Wizard'>
+<meta property='og:type' content='website'>
+<meta property='og:image' content='https://reporter.apache.org/guide/logo.png'>
+
+<script type="text/javascript">
+let editor_type = 'unified';
+</script>
+
+<title>ASF Board Report Wizard</title>
+<link rel="stylesheet" href="css/wizard.css"/>
+<link rel="stylesheet" href="highlighter/highlighter.css"/>
+<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
+</head>
+<body>
+ <div id="wizard_spinner" style="margin-top: 80px; height: 300px !important;">
+  <h4 style="text-align: center;" id="loader_text">Loading base data..</h4>
+  <div class="loader"></div>
+ </div>
+ 
+   <div id="wrapper" style="display: none;">
+    <h2 id="pname" style="text-align: center;">Board Report Wizard</h2>
+    <div id="steps">
+     
+      
+     </div>
+    
+    <div id="unified-editor">
+     <textarea id="unified-report" onmouseup="find_section();" onkeyup="find_section();"></textarea>
+    </div>
+    <div id="unified-helper"></div>
+    
+    <div id="wizard-content">
+     <div id="help_wrapper">
+     <h3 id="step_title">Project Activity:</h3>
+     <p id="step_help">
+      
+     </p>
+     </div>
+     <p style="text-align: center; width: 100%; height: 100%;">
+     <textarea id="step_text" style="width: 90%; height: 60%; margin: 0 auto;"
+placeholder="Example activity:
+- This quarter, we attended FooCon - it was a sounding success!
+- Apache Foo 1.2.3 was released on August 4th, 2019."></textarea><br/>
+<button id="step_prev" onclick="build_steps(current_step-1);" class="btn btn-info" style="float:
left;">&#x2039;&#x2039; Previous step</button>
+<button id="step_next" onclick="build_steps(current_step+1);" class="btn btn-success"
style="float: right;">&#x203A;&#x203A; Next step</button>
+</p>
+    </div>
+    
+    <div id="tips" class="wizard-tip"></div>
+    </div>
+   
+   <!-- Modal for notices -->
+  <div class="modal fade" id="alert" role="dialog">
+    <div class="modal-dialog">
+    
+      <!-- Modal content-->
+      <div class="modal-content">
+        <div class="modal-header">
+          <h4 class="modal-title">Notification</h4>
+        </div>
+        <div class="modal-body">
+          <p id="alert_text" style="font-size: 0.85rem;"></p>
+        </div>
+        <div class="modal-footer">
+          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
+        </div>
+      </div>
+      
+    </div>
+  </div>
+   
+   <footer style="text-align: center; font-size: 0.8rem; clear: both;">
+    Powered by the <a href='./'>ASF Board Report Wizard</a>. Copyright&copy;
2019 <a href='https://community.apache.org'>Apache Community Development</a>.<br/>
+    Queries or other feedback should go to our mailing list: dev@community.apache.org
+   </footer>
+   
+   
+   
+
+<script src="https://kit.fontawesome.com/a250232153.js"></script>
+<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
+<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
crossorigin="anonymous"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js"></script>
+<script src="highlighter/highlighter.js" type="text/javascript"></script>
+<script src="js/wizard.js" type="text/javascript"></script>
+</body>
+</html>
+



Mime
View raw message