pulizia e razionalizzazione jQuery!!!
This commit is contained in:
@@ -35,11 +35,10 @@ textarea {
|
||||
textarea {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
.elTimbSmart{
|
||||
.elTimbSmart {
|
||||
padding: 0.2em;
|
||||
font-size: 1.1em;
|
||||
line-height: 1.3em;
|
||||
@@ -47,4 +46,22 @@ textarea {
|
||||
|
||||
.ui-input-btn input {
|
||||
opacity: .5;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
* {
|
||||
-webkit-box-sizing: content-box;
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
*:before,
|
||||
*:after {
|
||||
-webkit-box-sizing: content-box;
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.ui-panel-inner {
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
@@ -4,17 +4,6 @@
|
||||
@import url('../Content/BtnReport.css');
|
||||
@import url('../Content/JQClock.css');
|
||||
|
||||
* {
|
||||
-webkit-box-sizing: content-box;
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
*:before,
|
||||
*:after {
|
||||
-webkit-box-sizing: content-box;
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.logo
|
||||
{
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
/*@import url("nativedroid2.color.deep-orange.css");*/
|
||||
/*@import url("nativedroid2.color.brown.css");*/
|
||||
/*@import url("nativedroid2.color.grey.css");*/
|
||||
@import url("/Content/nativeDroid/nativedroid2.color.blue-grey.css");
|
||||
@import url("nativedroid2.color.blue-grey.css");
|
||||
|
||||
|
||||
@import url("/Content/nativeDroid/flexboxgrid.min.css");
|
||||
@import url("/Content/nativeDroid/material-design-iconic-font.min.css");
|
||||
@import url("nativeDroid/flexboxgrid.min.css");
|
||||
@import url("nativeDroid/material-design-iconic-font.min.css");
|
||||
@import url(//fonts.googleapis.com/css?family=RobotoDraft:300,400,500,700,400italic);
|
||||
@import url(//fonts.googleapis.com/css?family=Roboto:400,300,500,400italic,700,900);
|
||||
|
||||
@@ -317,7 +317,7 @@ code {
|
||||
}
|
||||
|
||||
.ui-bottom-sheet-list .ui-bottom-sheet-link .zmdi {
|
||||
font-size: 1em;
|
||||
font-size: 0.8em;
|
||||
display: inline-block;
|
||||
margin-right: 7px;
|
||||
min-width: 20px;
|
||||
@@ -559,8 +559,8 @@ code {
|
||||
.ui-header .ui-title, .ui-footer .ui-title {
|
||||
text-align: left;
|
||||
margin: 0px 72px;
|
||||
font-size: 20px;
|
||||
line-height: 1.8em;
|
||||
font-size: 16px;
|
||||
line-height: 1.3em;
|
||||
font-weight: 400;
|
||||
letter-spacing: 0.005em;
|
||||
}
|
||||
@@ -616,8 +616,8 @@ code {
|
||||
color: #ffffff !important;
|
||||
|
||||
font-size: 20px;
|
||||
line-height: 1.8em;
|
||||
padding: 0.5em;
|
||||
line-height: 1.3em;
|
||||
padding: 0.25em;
|
||||
display: inline-block;
|
||||
width: 1.6em;
|
||||
height: 1.6em;
|
||||
|
||||
@@ -51,8 +51,8 @@
|
||||
<HintPath>..\packages\AspNet.ScriptManager.bootstrap.3.3.7\lib\net45\AspNet.ScriptManager.bootstrap.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="AspNet.ScriptManager.jQuery, Version=3.1.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\AspNet.ScriptManager.jQuery.3.1.1\lib\net45\AspNet.ScriptManager.jQuery.dll</HintPath>
|
||||
<Reference Include="AspNet.ScriptManager.jQuery, Version=2.1.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\AspNet.ScriptManager.jQuery.2.1.4\lib\net45\AspNet.ScriptManager.jQuery.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Elmah, Version=1.2.14706.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
@@ -447,13 +447,14 @@
|
||||
<Content Include="fonts\glyphicons-halflings-regular.woff" />
|
||||
<Content Include="fonts\glyphicons-halflings-regular.ttf" />
|
||||
<Content Include="fonts\glyphicons-halflings-regular.eot" />
|
||||
<Content Include="logs\PlaceHolder.file" />
|
||||
<None Include="Properties\PublishProfiles\ETS.pubxml" />
|
||||
<None Include="Properties\PublishProfiles\IIS01.pubxml" />
|
||||
<None Include="Properties\PublishProfiles\IIS02-ETS.pubxml" />
|
||||
<None Include="Properties\PublishProfiles\IIS02.pubxml" />
|
||||
<None Include="Properties\PublishProfiles\SPS.pubxml" />
|
||||
<None Include="Scripts\jquery-3.1.1.intellisense.js" />
|
||||
<Content Include="images\logo_sw.png" />
|
||||
<Content Include="jumper.aspx" />
|
||||
<Content Include="Properties\PublishProfiles\ETS.pubxml.user" />
|
||||
<Content Include="Properties\PublishProfiles\IIS01.pubxml.user" />
|
||||
<Content Include="Properties\PublishProfiles\IIS02-ETS.pubxml.user" />
|
||||
@@ -461,10 +462,13 @@
|
||||
<Content Include="Properties\PublishProfiles\SPS.pubxml.user" />
|
||||
<Content Include="Scripts\bootstrap.js" />
|
||||
<Content Include="Scripts\bootstrap.min.js" />
|
||||
<Content Include="Scripts\jquery-3.1.1.js" />
|
||||
<Content Include="Scripts\jquery-3.1.1.min.js" />
|
||||
<Content Include="Scripts\jquery-3.1.1.slim.js" />
|
||||
<Content Include="Scripts\jquery-3.1.1.slim.min.js" />
|
||||
<None Include="Scripts\jquery-2.1.4.intellisense.js" />
|
||||
<Content Include="Scripts\jquery-2.1.4.js" />
|
||||
<Content Include="Scripts\jquery-2.1.4.min.js" />
|
||||
<Content Include="Scripts\jquery-ui-1.12.1.js" />
|
||||
<Content Include="Scripts\jquery-ui-1.12.1.min.js" />
|
||||
<Content Include="Scripts\jquery.mobile-1.4.5.js" />
|
||||
<Content Include="Scripts\jquery.mobile-1.4.5.min.js" />
|
||||
<Content Include="Scripts\modernizr-2.8.3.js" />
|
||||
<Content Include="Scripts\nativedroid2.js" />
|
||||
<Content Include="Scripts\nd2settings.js" />
|
||||
@@ -529,8 +533,8 @@
|
||||
<Content Include="packages.config" />
|
||||
<None Include="Project_Readme.html" />
|
||||
<Content Include="Site.Mobile.Master" />
|
||||
<Content Include="Scripts\jquery-3.1.1.slim.min.map" />
|
||||
<Content Include="Scripts\jquery-3.1.1.min.map" />
|
||||
<Content Include="Scripts\jquery.mobile-1.4.5.min.map" />
|
||||
<Content Include="Scripts\jquery-2.1.4.min.map" />
|
||||
<None Include="Web.Debug.config">
|
||||
<DependentUpon>Web.config</DependentUpon>
|
||||
</None>
|
||||
@@ -586,6 +590,13 @@
|
||||
<Compile Include="Global.asax.cs">
|
||||
<DependentUpon>Global.asax</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="jumper.aspx.cs">
|
||||
<DependentUpon>jumper.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="jumper.aspx.designer.cs">
|
||||
<DependentUpon>jumper.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="mancataTimbr.aspx.cs">
|
||||
<DependentUpon>mancataTimbr.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
||||
Binary file not shown.
Vendored
+2731
-3741
File diff suppressed because it is too large
Load Diff
+5
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-4
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
-4
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+18706
File diff suppressed because it is too large
Load Diff
+13
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
+10
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -166,11 +166,6 @@
|
||||
</runtime>
|
||||
<system.webServer>
|
||||
<validation validateIntegratedModeConfiguration="false" />
|
||||
<modules>
|
||||
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
|
||||
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
|
||||
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
|
||||
</modules>
|
||||
<staticContent>
|
||||
<remove fileExtension=".woff" />
|
||||
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
<meta name="description" content="GPW site" />
|
||||
<meta name="description" content="GPW SMART site" />
|
||||
<meta name="author" content="Steamware" />
|
||||
<link rel="shortcut icon" href="~/favicon.ico" />
|
||||
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
|
||||
@@ -20,21 +20,22 @@
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||||
|
||||
|
||||
|
||||
<asp:PlaceHolder ID="PlaceHolder1" runat="server">
|
||||
<%: Scripts.Render("~/bundles/jquery") %>
|
||||
<%: Scripts.Render("~/bundles/jSteamware") %>
|
||||
<%: Scripts.Render("~/bundles/jqueryui") %>
|
||||
<%: Scripts.Render("~/bundles/jquerymobile") %>
|
||||
</asp:PlaceHolder>
|
||||
|
||||
|
||||
<webopt:BundleReference ID="BundleReference4" runat="server" Path="~/Content/bootstrap" />
|
||||
<webopt:BundleReference ID="BundleReference1" runat="server" Path="~/Content/css" />
|
||||
<webopt:BundleReference ID="BundleReference2" runat="server" Path="~/Content/jqm" />
|
||||
<webopt:BundleReference ID="BundleReference3" runat="server" Path="~/Content/droid" />
|
||||
|
||||
<link rel="stylesheet" href="~/Content/waves/waves.min.css" />
|
||||
<link rel="stylesheet" href="~/Content/wow/animate.css" />
|
||||
|
||||
<webopt:BundleReference ID="BundleReference2" runat="server" Path="~/Content/jqm" />
|
||||
<webopt:BundleReference ID="BundleReference3" runat="server" Path="~/Content/droid" />
|
||||
<webopt:BundleReference ID="BundleReference4" runat="server" Path="~/Content/bootstrap" />
|
||||
<webopt:BundleReference ID="BundleReference1" runat="server" Path="~/Content/css" />
|
||||
|
||||
<link rel="stylesheet" href="~/Content/nativeDroid/nativedroid2.css" />
|
||||
|
||||
<asp:ContentPlaceHolder ID="head" runat="server">
|
||||
@@ -50,29 +51,28 @@
|
||||
<nd2-include data-src="/fragments/bottom.sheet.html"></nd2-include>
|
||||
</div>--%>
|
||||
|
||||
<div data-role="header" data-position="fixed" class="wow fadeInDown" data-wow-delay="0.1s">
|
||||
<div data-role="header" data-position="fixed" class="wow">
|
||||
<a href="#bottomsheet" class="ui-btn ui-btn-right wow fadeIn" data-wow-delay='0.2s'><i class="zmdi zmdi-more-vert"></i></a>
|
||||
<a href="#leftpanel" class="ui-btn ui-btn-left wow fadeIn" data-wow-delay='0.2s'><i class="zmdi zmdi-menu"></i></a>
|
||||
<h3><uc2:mod_title ID="mod_title1" runat="server" /></h3>
|
||||
<a href="#leftpanel" class="ui-btn ui-btn-left wow fadeIn" data-wow-delay='0.1s'><i class="zmdi zmdi-menu"></i></a>
|
||||
<h3>
|
||||
<uc2:mod_title ID="mod_title1" runat="server" />
|
||||
</div>
|
||||
|
||||
<div role="main" class="ui-content" data-inset="false">
|
||||
<div role="main" class="ui-content" data-inset="false" style="padding: 1em 0;">
|
||||
<asp:ContentPlaceHolder ID="MainContent" runat="server">
|
||||
</asp:ContentPlaceHolder>
|
||||
</div>
|
||||
<%--<div data-role="footer" data-position="fixed" data-theme="a">--%>
|
||||
<div data-role="panel" id="bottomsheet" data-animate="false" data-position='bottom' data-display="overlay">
|
||||
<div data-role="panel" id="bottomsheet" data-animate="false" data-position='bottom' data-display="overlay" style="padding: -1em;">
|
||||
<uc1:mod_footer runat="server" ID="mod_footer" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
|
||||
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.js"></script>
|
||||
|
||||
<script src="../Content/waves/waves.min.js"></script>
|
||||
<script src="../Content/wow/wow.min.js"></script>
|
||||
<script src="../Scripts/nativedroid2.js"></script>
|
||||
<script src="../Scripts/nd2settings.js"></script>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_footer.ascx.cs" Inherits="GPW.WebUserControls.mod_footer" %>
|
||||
<div data-role="navbar" data-iconpos="top" >
|
||||
<div data-role="navbar" data-iconpos="top">
|
||||
<ul>
|
||||
<li>
|
||||
<asp:HyperLink runat="server" ID="btnTimbra" data-role="button" data-icon="home" data-theme="b" NavigateUrl="~/A3/Timbrature.aspx" rel="external">Timbra</asp:HyperLink>
|
||||
<asp:HyperLink runat="server" ID="btnTimbra" data-role="button" data-icon="home" data-theme="b" NavigateUrl="~/Timbrature" rel="external">Timbra</asp:HyperLink>
|
||||
</li>
|
||||
<li>
|
||||
<asp:HyperLink runat="server" ID="btnProgetti" data-role="button" data-icon="grid" data-theme="b" NavigateUrl="~/A3/Progetti.aspx" rel="external">Progetti</asp:HyperLink>
|
||||
<asp:HyperLink runat="server" ID="btnProgetti" data-role="button" data-icon="grid" data-theme="b" NavigateUrl="~/Progetti" rel="external">Progetti</asp:HyperLink>
|
||||
</li>
|
||||
<li>
|
||||
<asp:HyperLink runat="server" ID="btnAdmin" data-role="button" data-icon="gear" data-theme="b" NavigateUrl="~/A3/Admin.aspx" rel="external">Admin</asp:HyperLink>
|
||||
<asp:HyperLink runat="server" ID="btnAdmin" data-role="button" data-icon="gear" data-theme="b" NavigateUrl="~/Admin" rel="external">Admin</asp:HyperLink>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -93,6 +93,6 @@
|
||||
<asp:Button runat="server" ID="btnAbilitaFull" Text="Abilita All" CssClass="ui-btn ui-btn-icon-left ui-shadow ui-corner-all clr-btn-orange" data-icon="alert" OnClick="btnAbilitaFull_Click" />
|
||||
</div>
|
||||
<div class="ui-block-b">
|
||||
<asp:HyperLink runat="server" ID="hlMancateTimbr" NavigateUrl="~/A3/mancataTimbr.aspx" data-role="button" CssClass="ui-btn ui-icon-star ui-btn-icon-left ui-shadow ui-corner-all clr-btn-red" data-transition="slide" Text="Mancata Tim." rel="external" />
|
||||
<asp:HyperLink runat="server" ID="hlMancateTimbr" NavigateUrl="~/mancataTimbr" data-role="button" CssClass="ui-btn ui-icon-star ui-btn-icon-left ui-shadow ui-corner-all clr-btn-red" data-transition="slide" Text="Mancata Tim." rel="external" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/WebMasterPages/jQueryMobileNoCookie.Master" AutoEventWireup="true" CodeBehind="jumper.aspx.cs" Inherits="GPW.jumper" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
|
||||
</asp:Content>
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace GPW
|
||||
{
|
||||
public partial class jumper : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
// cerco un insieme di parametri in URL (get)...
|
||||
string UserAuthkey = "";
|
||||
string idxDipendente = "";
|
||||
try
|
||||
{
|
||||
UserAuthkey = Request["UserAuthkey"];
|
||||
idxDipendente = Request["idxDipendente"];
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// ... li inserisco in sessione ...
|
||||
Session["UserAuthkey"] = UserAuthkey;
|
||||
Session["idxDipendente"] = idxDipendente;
|
||||
// ...infine rimando a pagina di login...
|
||||
Response.Redirect("~/regNewDevice.aspx");
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+17
@@ -0,0 +1,17 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW
|
||||
{
|
||||
|
||||
|
||||
public partial class jumper
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
<packages>
|
||||
<package id="Antlr" version="3.5.0.2" targetFramework="net462" />
|
||||
<package id="AspNet.ScriptManager.bootstrap" version="3.3.7" targetFramework="net462" />
|
||||
<package id="AspNet.ScriptManager.jQuery" version="3.1.1" targetFramework="net462" />
|
||||
<package id="AspNet.ScriptManager.jQuery" version="2.1.4" targetFramework="net462" />
|
||||
<package id="bootstrap" version="3.3.7" targetFramework="net462" />
|
||||
<package id="elmah" version="1.2.2" targetFramework="net462" />
|
||||
<package id="elmah.corelibrary" version="1.2.2" targetFramework="net462" />
|
||||
<package id="jQuery" version="3.1.1" targetFramework="net462" />
|
||||
<package id="jQuery" version="2.1.4" targetFramework="net462" />
|
||||
<package id="jquery.mobile" version="1.4.5" targetFramework="net462" />
|
||||
<package id="jQuery.UI.Combined" version="1.12.1" targetFramework="net462" />
|
||||
<package id="Microsoft.AspNet.FriendlyUrls" version="1.0.2" targetFramework="net462" />
|
||||
<package id="Microsoft.AspNet.FriendlyUrls.Core" version="1.0.2" targetFramework="net462" />
|
||||
<package id="Microsoft.AspNet.ScriptManager.MSAjax" version="5.0.0" targetFramework="net462" />
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
File diff suppressed because it is too large
Load Diff
-10220
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-117
@@ -1,117 +0,0 @@
|
||||
function Get-Checksum($file) {
|
||||
$cryptoProvider = New-Object "System.Security.Cryptography.MD5CryptoServiceProvider"
|
||||
|
||||
$fileInfo = Get-Item $file
|
||||
trap { ;
|
||||
continue } $stream = $fileInfo.OpenRead()
|
||||
if ($? -eq $false) {
|
||||
# Couldn't open file for reading
|
||||
return $null
|
||||
}
|
||||
|
||||
$bytes = $cryptoProvider.ComputeHash($stream)
|
||||
$checksum = ''
|
||||
foreach ($byte in $bytes) {
|
||||
$checksum += $byte.ToString('x2')
|
||||
}
|
||||
|
||||
$stream.Close() | Out-Null
|
||||
|
||||
return $checksum
|
||||
}
|
||||
|
||||
function AddOrUpdate-Reference($scriptsFolderProjectItem, $fileNamePattern, $newFileName) {
|
||||
try {
|
||||
$referencesFileProjectItem = $scriptsFolderProjectItem.ProjectItems.Item("_references.js")
|
||||
}
|
||||
catch {
|
||||
# _references.js file not found
|
||||
return
|
||||
}
|
||||
|
||||
if ($referencesFileProjectItem -eq $null) {
|
||||
# _references.js file not found
|
||||
return
|
||||
}
|
||||
|
||||
$referencesFilePath = $referencesFileProjectItem.FileNames(1)
|
||||
$referencesTempFilePath = Join-Path $env:TEMP "_references.tmp.js"
|
||||
|
||||
if ((Select-String $referencesFilePath -pattern $fileNamePattern).Length -eq 0) {
|
||||
# File has no existing matching reference line
|
||||
# Add the full reference line to the beginning of the file
|
||||
"/// <reference path=""$newFileName"" />" | Add-Content $referencesTempFilePath -Encoding UTF8
|
||||
Get-Content $referencesFilePath | Add-Content $referencesTempFilePath
|
||||
}
|
||||
else {
|
||||
# Loop through file and replace old file name with new file name
|
||||
Get-Content $referencesFilePath | ForEach-Object { $_ -replace $fileNamePattern, $newFileName } > $referencesTempFilePath
|
||||
}
|
||||
|
||||
# Copy over the new _references.js file
|
||||
Copy-Item $referencesTempFilePath $referencesFilePath -Force
|
||||
Remove-Item $referencesTempFilePath -Force
|
||||
}
|
||||
|
||||
function Remove-Reference($scriptsFolderProjectItem, $fileNamePattern) {
|
||||
try {
|
||||
$referencesFileProjectItem = $scriptsFolderProjectItem.ProjectItems.Item("_references.js")
|
||||
}
|
||||
catch {
|
||||
# _references.js file not found
|
||||
return
|
||||
}
|
||||
|
||||
if ($referencesFileProjectItem -eq $null) {
|
||||
return
|
||||
}
|
||||
|
||||
$referencesFilePath = $referencesFileProjectItem.FileNames(1)
|
||||
$referencesTempFilePath = Join-Path $env:TEMP "_references.tmp.js"
|
||||
|
||||
if ((Select-String $referencesFilePath -pattern $fileNamePattern).Length -eq 1) {
|
||||
# Delete the line referencing the file
|
||||
Get-Content $referencesFilePath | ForEach-Object { if (-not ($_ -match $fileNamePattern)) { $_ } } > $referencesTempFilePath
|
||||
|
||||
# Copy over the new _references.js file
|
||||
Copy-Item $referencesTempFilePath $referencesFilePath -Force
|
||||
Remove-Item $referencesTempFilePath -Force
|
||||
}
|
||||
}
|
||||
|
||||
function Delete-ProjectItem($item) {
|
||||
$itemDeleted = $false
|
||||
for ($1=1; $i -le 5; $i++) {
|
||||
try {
|
||||
$item.Delete()
|
||||
$itemDeleted = $true
|
||||
break
|
||||
}
|
||||
catch {
|
||||
# Try again in 200ms
|
||||
[System.Threading.Thread]::Sleep(200)
|
||||
}
|
||||
}
|
||||
if ($itemDeleted -eq $false) {
|
||||
throw "Unable to delete project item after five attempts."
|
||||
}
|
||||
}
|
||||
|
||||
# Extract the version number from the jquery file in the package's content\scripts folder
|
||||
$packageScriptsFolder = Join-Path $installPath Content\Scripts
|
||||
$jqueryFileName = Join-Path $packageScriptsFolder "jquery-*.js" | Get-ChildItem -Exclude "*.min.js","*-vsdoc.js","*.slim.js" | Split-Path -Leaf
|
||||
$jqueryFileNameRegEx = "jquery-((?:\d+\.)?(?:\d+\.)?(?:\d+\.)?(?:\d+)).js"
|
||||
$jqueryFileName -match $jqueryFileNameRegEx
|
||||
$ver = $matches[1]
|
||||
|
||||
$intelliSenseFileName = "jquery-$ver.intellisense.js"
|
||||
|
||||
# Get the project item for the scripts folder
|
||||
try {
|
||||
$scriptsFolderProjectItem = $project.ProjectItems.Item("Scripts")
|
||||
$projectScriptsFolderPath = $scriptsFolderProjectItem.FileNames(1)
|
||||
}
|
||||
catch {
|
||||
# No Scripts folder
|
||||
Write-Host "No scripts folder found"
|
||||
}
|
||||
-41
@@ -1,41 +0,0 @@
|
||||
param($installPath, $toolsPath, $package, $project)
|
||||
|
||||
. (Join-Path $toolsPath common.ps1)
|
||||
|
||||
# VS 11 and above supports the new intellisense JS files
|
||||
$vsVersion = [System.Version]::Parse($dte.Version)
|
||||
$supportsJsIntelliSenseFile = $vsVersion.Major -ge 11
|
||||
|
||||
if (-not $supportsJsIntelliSenseFile) {
|
||||
$displayVersion = $vsVersion.Major
|
||||
Write-Host "IntelliSense JS files are not supported by your version of Visual Studio: $displayVersion"
|
||||
exit
|
||||
}
|
||||
|
||||
if ($scriptsFolderProjectItem -eq $null) {
|
||||
# No Scripts folder
|
||||
Write-Host "No Scripts folder found"
|
||||
exit
|
||||
}
|
||||
|
||||
# Delete the vsdoc file from the project
|
||||
try {
|
||||
$vsDocProjectItem = $scriptsFolderProjectItem.ProjectItems.Item("jquery-$ver-vsdoc.js")
|
||||
Delete-ProjectItem $vsDocProjectItem
|
||||
}
|
||||
catch {
|
||||
Write-Host "Error deleting vsdoc file: " + $_.Exception -ForegroundColor Red
|
||||
exit
|
||||
}
|
||||
|
||||
# Copy the intellisense file to the project from the tools folder
|
||||
$intelliSenseFileSourcePath = Join-Path $toolsPath $intelliSenseFileName
|
||||
try {
|
||||
$scriptsFolderProjectItem.ProjectItems.AddFromFileCopy($intelliSenseFileSourcePath)
|
||||
}
|
||||
catch {
|
||||
# This will throw if the file already exists, so we need to catch here
|
||||
}
|
||||
|
||||
# Update the _references.js file
|
||||
AddOrUpdate-Reference $scriptsFolderProjectItem $jqueryFileNameRegEx $jqueryFileName
|
||||
File diff suppressed because it is too large
Load Diff
-41
@@ -1,41 +0,0 @@
|
||||
param($installPath, $toolsPath, $package, $project)
|
||||
|
||||
. (Join-Path $toolsPath common.ps1)
|
||||
|
||||
# Determine the file paths
|
||||
$projectIntelliSenseFilePath = Join-Path $projectScriptsFolderPath $intelliSenseFileName
|
||||
$origIntelliSenseFilePath = Join-Path $toolsPath $intelliSenseFileName
|
||||
|
||||
if (Test-Path $projectIntelliSenseFilePath) {
|
||||
if ((Get-Checksum $projectIntelliSenseFilePath) -eq (Get-Checksum $origIntelliSenseFilePath)) {
|
||||
# The intellisense file in the project matches the file in the tools folder, delete it
|
||||
|
||||
if ($scriptsFolderProjectItem -eq $null) {
|
||||
# No Scripts folder
|
||||
exit
|
||||
}
|
||||
|
||||
try {
|
||||
# Get the project item for the intellisense file
|
||||
$intelliSenseFileProjectItem = $scriptsFolderProjectItem.ProjectItems.Item($intelliSenseFileName)
|
||||
}
|
||||
catch {
|
||||
# The item wasn't found
|
||||
exit
|
||||
}
|
||||
|
||||
# Delete the project item
|
||||
Delete-ProjectItem $intelliSenseFileProjectItem
|
||||
}
|
||||
else {
|
||||
$projectScriptsFolderLeaf = Split-Path $projectScriptsFolderPath -Leaf
|
||||
Write-Host "Skipping '$projectScriptsFolderLeaf\$intelliSenseFileName' because it was modified." -ForegroundColor Magenta
|
||||
}
|
||||
}
|
||||
else {
|
||||
# The intellisense file was not found in project
|
||||
Write-Host "The intellisense file was not found in project at path $projectIntelliSenseFilePath"
|
||||
}
|
||||
|
||||
# Update the _references.js file
|
||||
Remove-Reference $scriptsFolderProjectItem $jqueryFileNameRegEx
|
||||
BIN
Binary file not shown.
Reference in New Issue
Block a user