Commits

Federico Silva Armas committed 4dc338f

Added build that creates single page to drop in CC.NET.

  • Participants
  • Parent commits 2424484

Comments (0)

Files changed (4)

+
+function replaceScript($html, $scriptId, $scriptPath){
+    $scriptContent = get-content $scriptPath
+    $scriptContent = $scriptContent -replace "$", "`r`n"
+    return $html -replace "<script id=`"$scriptId`".*$", "<script>`r`n$scriptContent`r`n</script>"
+}
+
+function replaceCss($html, $href, $cssPath){
+    $cssContent = get-content $cssPath
+    $cssContent = $cssContent -replace "$", "`r`n"
+    return $html -replace "<link.*href=`"$href`".*$", "<style type=`"text/css`">`r`n$cssContent`r`n</style>"
+}
+
+$html = get-content src\dashboard.html
+
+$html = replaceCss $html dashboard.css src\dashboard.css
+$html = replaceScript $html xml2jsonScript lib\jquery.xml2json.js
+$html = replaceScript $html dashboardScript src\dashboard.js
+
+set-content dashboard.html $html
+
+

File ccnet-dashboard.sln

 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A8230F76-0470-4210-B70B-BB82B5C1F342}"
 	ProjectSection(SolutionItems) = preProject
+		build.ps1 = build.ps1
 		todo.txt = todo.txt
 	EndProjectSection
 EndProject

File src/dashboard.html

         window.ko || document.write('<script src="../lib/knockout-2.2.0.js")><\/script>');
     </script>
 
-    <script type="text/javascript" src="../lib/jquery.xml2json.js"></script>
-    <script type="text/javascript" src="dashboard.js"></script>
+    <script id="xml2jsonScript" type="text/javascript" src="../lib/jquery.xml2json.js"></script>
+    <script id="dashboardScript" type="text/javascript" src="dashboard.js"></script>
     <script>
         var dashboard;
         $(function() {
-- Update html to detect if scripts where loaded from CDN and load from disc if they aren't
-- Move files to src
-- Create msbuild file to generate the dashboard.html
 - Test: Push new project if it did not exist (p2)
 - Test: delete project if it does not exist anymore (p2)