Merge branch 'MinifyResources-#65' into Release0.1.5

This commit is contained in:
chris.watts90@outlook.com 2017-03-18 23:08:09 +00:00
commit 0eaecbb3e5
20 changed files with 69 additions and 5 deletions

View File

@ -0,0 +1,14 @@
<root>
<output path="..\www\admin.min.js">
<input path="..\www\admin.js"/>
</output>
<output path="..\www\Helpers.min.js">
<input path="..\www\Helpers.js"/>
</output>
<output path="..\www\spa.min.js">
<input path="..\www\spa.js"/>
</output>
<output path="..\www\spa.min.css">
<input path="..\www\spa.css"/>
</output>
</root>

View File

@ -0,0 +1,18 @@
set "SolutionDir=%~1"
set "Directory=%~1..\..\Tools\Minifier\AjaxMinifier.exe"
echo "normalising.."
echo "1 - %Directory%"
echo "1a - %SolutionDir%"
call :normalise "%Directory%"
start /wait "" "%Directory%" -xml "%SolutionDir%WindowsDataCenter\Minifier\MinifierConfig.xml"
GOTO :EOF
:normalise
SET "Directory=%~f1"
echo "2 - %Directory%"
EXIT /b
:EOF
exit 0

View File

@ -174,6 +174,7 @@
<Compile Include="Controllers\ValuesController.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Minifier\MinifierConfig.xml" />
<Content Include="NinjectConfig.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
@ -183,6 +184,9 @@
<Content Include="www\admin.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\admin.min.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\css\bootstrap-theme.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@ -204,6 +208,9 @@
<Content Include="www\Helpers.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\Helpers.min.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\index.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
@ -219,6 +226,12 @@
<Content Include="www\spa.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\spa.min.css">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\spa.min.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
@ -240,6 +253,7 @@
<Content Include="Help\DalSoft.WebApi.HelpPage.Views\index.cshtml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="Minifier\Minify.bat" />
<None Include="packages.config" />
<None Include="www\css\bootstrap-theme.css.map">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@ -295,6 +309,9 @@
</PropertyGroup>
<Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.104.0\build\net451\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.104.0\build\net451\System.Data.SQLite.Core.targets'))" />
</Target>
<PropertyGroup>
<PreBuildEvent>call "$(ProjectDir)Minifier\Minify.bat" "$(SolutionDir)"</PreBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">

View File

@ -5,7 +5,7 @@
<meta charset="utf-8" />
<title>Flexitime Admin page</title>
<link rel="stylesheet preload" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link href="spa.css" rel="stylesheet" />
<link href="spa.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.0.0/knockout-min.js" type="text/javascript"></script>
@ -77,7 +77,7 @@
</form>
</div>
</div>
<script src="Helpers.js" type="text/javascript"></script>
<script src="admin.js" type="text/javascript"></script>
<script src="Helpers.min.js" type="text/javascript"></script>
<script src="admin.min.js" type="text/javascript"></script>
</body>
</html>

View File

@ -0,0 +1 @@
function Helpers(){var n=this;n.createRequestUrl=function(t,i,r,u){var o="?",f="",e;if(u&&(f=n.apiEndpoints.root),f=f+t,i!==undefined&&i!==null&&i.length>0)for(e=0;e<i.length;e++)f+=o+i[e].key+"="+i[e].value,o="&";return r&&(f+=o+"callback=?"),f};n.goToMenuOption=function(n){location.hash=n;console.log("goToMenuOption: "+n)};n.processRequestFailure=function(n){return n.readyState===4?{errorCode:n.status,errorMessage:n.statusText,errorSource:""}:n.readyState===0?{errorCode:n.status,errorMessage:"Network Error - Is the server available?",errorSource:""}:{errorCode:n.status,errorMessage:"Unknown Error",errorSource:""}};n.getPageDestination=function(n,t){var i=null,u,r;if(t.target?i=t.target:t.srcElement&&(i=t.srcElement),u="",i!=null){for(r=0;r<i.attributes.length;r++)if(i.attributes[r].nodeName==="pagedestination"){u=i.attributes[r].value;break}if(u!=="")return u}else console.log("target is null, going nowhere")}}

View File

@ -0,0 +1 @@
function AdminVM(){var n=this;n.groupsList=ko.observable(null);n.groupEditItem=ko.observable(null);n.helpers=new Helpers;n.uiPages={overview:"overview",group:"groups",home:function(){return this.overview}};n.apiEndpoints={deleteGroups:"/api/groups/delete",getGroups:"/api/groups",editGroup:"/api/groups/edit"};n.clearGroupForm=function(){n.helpers.goToMenuOption(n.uiPages.group);n.groupEditItem(null)};n.hideGroupForm=function(){n.groupEditItem(null)};n.newGroupForm=function(){n.groupEditItem({Id:-1,Name:""});n.helpers.goToMenuOption(n.uiPages.group)};n.groupFormHidden=ko.computed(function(){return n.groupEditItem()==null},n);n.editGroupClick=function(t){n.helpers.goToMenuOption(n.uiPages.group);n.groupEditItem(t)};n.getGroups=function(){var t=n.helpers.createRequestUrl(n.apiEndpoints.getGroups,null,!1);$.getJSON(t,function(t){n.groupsList(t)}).fail(function(t,i,r){console.log("error - getGroups");var u=n.helpers.processRequestFailure(t,i,r)})};n.deleteGroup=function(t){var i=n.helpers.createRequestUrl(n.apiEndpoints.deleteGroups,[{key:"groupId",value:t}],!1,!1);$.ajax({url:i,type:"DELETE",success:function(){console.log("deleted "+t);n.hideGroupForm();n.helpers.goToMenuOption(n.uiPages.home())}});console.log("delete: "+t)};n.submitGroupEdit=function(t){var i=n.helpers.createRequestUrl(n.apiEndpoints.editGroup,null,!1);$.post(i,t,function(){},"json").done(function(){n.groupEditItem(null);n.helpers.goToMenuOption(n.uiPages.home())}).fail(function(t,i,r){n.helpers.goToMenuOption(n.uiPages.home());var u=n.helpers.processRequestFailure(t,i,r)})};Sammy(function(){this.disable_push_state=!0;this.get("#overview",function(){n.getGroups()});this.post("#editgroup",function(){return n.submitGroupEdit(n.groupEditItem()),!1});this.get("",function(){this.app.runRoute("get","#"+n.uiPages.home())})}).run()}ko.applyBindings(new AdminVM)

View File

@ -6,7 +6,7 @@
<link rel="stylesheet preload" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet preload" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.1/css/bootstrap-datepicker3.min.css">
<link href="spa.css" rel="stylesheet" />
<link href="spa.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.0.0/knockout-min.js" type="text/javascript"></script>
@ -333,6 +333,6 @@
</div>
</footer>
<script src="spa.js" type="text/javascript"></script>
<script src="spa.min.js" type="text/javascript"></script>
</body>
</html>

View File

@ -0,0 +1 @@
.table td.fit,.table th.fit{white-space:nowrap;width:1%}.table>tbody>tr>td.valign{vertical-align:middle}@media(max-width:576px){ul>li>a.indent-nav-xs{padding-left:50px}}.bootstrap-datetimepicker-widget tr:hover{background-color:#808080}.datepicker tr.highlight{background:#eee;cursor:pointer}.footer{position:absolute;bottom:0;width:100%;height:132px}.footerBody{margin-bottom:132px}

File diff suppressed because one or more lines are too long

BIN
Tools/Minifier/AjaxMin.dll Normal file

Binary file not shown.

BIN
Tools/Minifier/AjaxMin.exe Normal file

Binary file not shown.

View File

@ -0,0 +1,2 @@
@echo off
%comspec% /k "%~dp0AjaxMinCommandPromptVars.bat"

View File

@ -0,0 +1,8 @@
@echo off
set PATH=%~dp0;%PATH%
echo Minify a JavaScript file by typing:
echo ajaxminifier inputfile.js -o outputfile.js
echo Minify a CSS file by typing:
echo ajaxminifier inputfile.css -o outputfile.css
echo Type ajaxminifier -? to get help.
echo ----------------------------------------------

Binary file not shown.

Binary file not shown.

1
Tools/Minifier/Helpers.min.js vendored Normal file
View File

@ -0,0 +1 @@
function Helpers(){var n=this;n.createRequestUrl=function(t,i,r,u){var o="?",f="",e;if(u&&(f=n.apiEndpoints.root),f=f+t,i!==undefined&&i!==null&&i.length>0)for(e=0;e<i.length;e++)f+=o+i[e].key+"="+i[e].value,o="&";return r&&(f+=o+"callback=?"),f};n.goToMenuOption=function(n){location.hash=n;console.log("goToMenuOption: "+n)};n.processRequestFailure=function(n){return n.readyState===4?{errorCode:n.status,errorMessage:n.statusText,errorSource:""}:n.readyState===0?{errorCode:n.status,errorMessage:"Network Error - Is the server available?",errorSource:""}:{errorCode:n.status,errorMessage:"Unknown Error",errorSource:""}};n.getPageDestination=function(n,t){var i=null,u,r;if(t.target?i=t.target:t.srcElement&&(i=t.srcElement),u="",i!=null){for(r=0;r<i.attributes.length;r++)if(i.attributes[r].nodeName==="pagedestination"){u=i.attributes[r].value;break}if(u!=="")return u}else console.log("target is null, going nowhere")}}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.