mirror of
https://github.com/modernw/App-Installer-For-Windows-8.x-Reset.git
synced 2026-04-11 17:57:19 +10:00
Update and fix bugs.
This commit is contained in:
@@ -71,6 +71,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModernNotice", "ModernNotic
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Launch", "Launch\Launch.csproj", "{F0288B24-7B84-42A5-9A92-2E16A012E4DE}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Reader", "Reader\Reader.csproj", "{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -307,6 +309,18 @@ Global
|
||||
{F0288B24-7B84-42A5-9A92-2E16A012E4DE}.Release|x64.Build.0 = Release|Any CPU
|
||||
{F0288B24-7B84-42A5-9A92-2E16A012E4DE}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{F0288B24-7B84-42A5-9A92-2E16A012E4DE}.Release|x86.Build.0 = Release|Any CPU
|
||||
{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}.Release|x64.Build.0 = Release|Any CPU
|
||||
{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -795,7 +795,7 @@ namespace AppxPackage
|
||||
{
|
||||
capabilities_name = Capabilities,
|
||||
device_capabilities = DeviceCapabilities,
|
||||
scales = CapabilityDisplayNames
|
||||
display_capabilities_name = CapabilityDisplayNames
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -917,7 +917,7 @@ namespace AppxPackage
|
||||
{
|
||||
var ret = new List<int> ();
|
||||
if (!IsValid) return ret;
|
||||
IntPtr hList = PackageReadHelper.GetResourcesLanguagesToLcid (m_hReader.Value);
|
||||
IntPtr hList = PackageReadHelper.GetResourcesScales (m_hReader.Value);
|
||||
if (hList == IntPtr.Zero) return ret;
|
||||
try
|
||||
{
|
||||
|
||||
@@ -55,6 +55,9 @@
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>Project1.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject />
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.4\lib\net40\Newtonsoft.Json.dll</HintPath>
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Manager
|
||||
{
|
||||
public partial class ManagerShell: WAShell.WebAppForm
|
||||
@@ -25,6 +27,7 @@ namespace Manager
|
||||
catch { }
|
||||
InitSize ();
|
||||
Text = Bridge.ResXmlStore.StringRes.Get ("MANAGER_APPTITLE");
|
||||
this.Load += Form_Load;
|
||||
}
|
||||
private void InitSize ()
|
||||
{
|
||||
@@ -58,6 +61,17 @@ namespace Manager
|
||||
);
|
||||
WindowState = (FormWindowState)lasts.ReadInt ((int)FormWindowState.Normal);
|
||||
}
|
||||
private void Form_Load (object sender, EventArgs e)
|
||||
{
|
||||
var current = Process.GetCurrentProcess ();
|
||||
var processes = Process.GetProcessesByName (current.ProcessName);
|
||||
int count = processes.Length;
|
||||
int offset = 30; // 每个窗口偏移
|
||||
int x = 20 + (count - 1) * offset;
|
||||
int y = 20 + (count - 1) * offset;
|
||||
this.StartPosition = FormStartPosition.Manual;
|
||||
this.Location = new Point (x, y);
|
||||
}
|
||||
private void ManagerShell_Load (object sender, EventArgs e)
|
||||
{
|
||||
var root = Path.GetDirectoryName (DataUtils.Utilities.GetCurrentProgramPath ());
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Manager
|
||||
@@ -12,7 +14,7 @@ namespace Manager
|
||||
/// 应用程序的主入口点。
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main ()
|
||||
static void Main (string [] args)
|
||||
{
|
||||
Directory.SetCurrentDirectory (AppDomain.CurrentDomain.BaseDirectory);
|
||||
//System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo ("en-US");
|
||||
|
||||
213
PriFileFormat/DataTree.cs
Normal file
213
PriFileFormat/DataTree.cs
Normal file
@@ -0,0 +1,213 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace PriFileFormat
|
||||
{
|
||||
/// <summary>
|
||||
/// 树节点接口
|
||||
/// </summary>
|
||||
public interface ITreeNode: IDisposable, IEnumerable<ITreeNode>
|
||||
{
|
||||
string Name { get; set; }
|
||||
string Value { get; set; }
|
||||
ITreeNode Parent { get; set; }
|
||||
IList<ITreeNode> Children { get; }
|
||||
ITreeNode AddChild (string name, string value);
|
||||
IEnumerable<ITreeNode> DescendantsAndSelf ();
|
||||
ITreeNode Find (string name);
|
||||
IEnumerable<ITreeNode> FindAll (string name);
|
||||
}
|
||||
/// <summary>
|
||||
/// 树节点实现
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class TreeNode: ITreeNode
|
||||
{
|
||||
// 节点基本属性
|
||||
public string Name { get; set; }
|
||||
public string Value { get; set; }
|
||||
// 父节点引用
|
||||
[XmlIgnore]
|
||||
public TreeNode Parent { get; set; }
|
||||
ITreeNode ITreeNode.Parent
|
||||
{
|
||||
get { return Parent; }
|
||||
set { Parent = (TreeNode)value; }
|
||||
}
|
||||
// 子节点列表
|
||||
[XmlArray ("Children")]
|
||||
[XmlArrayItem ("Node")]
|
||||
public IList<TreeNode> Children { get; set; }
|
||||
IList<ITreeNode> ITreeNode.Children
|
||||
{
|
||||
get
|
||||
{
|
||||
List<ITreeNode> list = new List<ITreeNode> ();
|
||||
foreach (TreeNode node in Children)
|
||||
{
|
||||
list.Add (node);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
public TreeNode ()
|
||||
{
|
||||
Name = "";
|
||||
Value = "";
|
||||
Children = new List<TreeNode> ();
|
||||
Parent = null;
|
||||
}
|
||||
public TreeNode (string name, string value)
|
||||
{
|
||||
Name = name;
|
||||
Value = value;
|
||||
Children = new List<TreeNode> ();
|
||||
Parent = null;
|
||||
}
|
||||
/// <summary>
|
||||
/// 添加子节点
|
||||
/// </summary>
|
||||
public TreeNode AddChild (string name, string value)
|
||||
{
|
||||
TreeNode child = new TreeNode (name, value);
|
||||
child.Parent = this;
|
||||
Children.Add (child);
|
||||
return child;
|
||||
}
|
||||
ITreeNode ITreeNode.AddChild (string name, string value)
|
||||
{
|
||||
return AddChild (name, value);
|
||||
}
|
||||
/// <summary>
|
||||
/// 深度优先遍历节点,包括自身
|
||||
/// </summary>
|
||||
public IEnumerable<TreeNode> DescendantsAndSelf ()
|
||||
{
|
||||
yield return this;
|
||||
foreach (TreeNode child in Children)
|
||||
{
|
||||
foreach (TreeNode desc in child.DescendantsAndSelf ())
|
||||
{
|
||||
yield return desc;
|
||||
}
|
||||
}
|
||||
}
|
||||
IEnumerable<ITreeNode> ITreeNode.DescendantsAndSelf ()
|
||||
{
|
||||
foreach (TreeNode n in DescendantsAndSelf ())
|
||||
{
|
||||
yield return n;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 查找第一个匹配节点
|
||||
/// </summary>
|
||||
public TreeNode Find (string name)
|
||||
{
|
||||
foreach (TreeNode n in DescendantsAndSelf ())
|
||||
{
|
||||
if (n.Name == name)
|
||||
return n;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
ITreeNode ITreeNode.Find (string name)
|
||||
{
|
||||
return Find (name);
|
||||
}
|
||||
/// <summary>
|
||||
/// 查找所有匹配节点
|
||||
/// </summary>
|
||||
public IEnumerable<TreeNode> FindAll (string name)
|
||||
{
|
||||
foreach (TreeNode n in DescendantsAndSelf ())
|
||||
{
|
||||
if (n.Name == name)
|
||||
yield return n;
|
||||
}
|
||||
}
|
||||
IEnumerable<ITreeNode> ITreeNode.FindAll (string name)
|
||||
{
|
||||
foreach (TreeNode n in FindAll (name))
|
||||
{
|
||||
yield return n;
|
||||
}
|
||||
}
|
||||
#region IEnumerable<TreeNode>
|
||||
public IEnumerator<TreeNode> GetEnumerator ()
|
||||
{
|
||||
return Children.GetEnumerator ();
|
||||
}
|
||||
IEnumerator IEnumerable.GetEnumerator ()
|
||||
{
|
||||
return GetEnumerator ();
|
||||
}
|
||||
#endregion
|
||||
#region IEnumerable<ITreeNode> 显示实现
|
||||
IEnumerator<ITreeNode> IEnumerable<ITreeNode>.GetEnumerator ()
|
||||
{
|
||||
foreach (TreeNode child in Children)
|
||||
{
|
||||
yield return child;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region XML 序列化
|
||||
public void SaveToXml (string filePath)
|
||||
{
|
||||
XmlSerializer serializer = new XmlSerializer (typeof (TreeNode));
|
||||
using (StreamWriter writer = new StreamWriter (filePath, false, System.Text.Encoding.UTF8))
|
||||
{
|
||||
serializer.Serialize (writer, this);
|
||||
}
|
||||
}
|
||||
|
||||
public static TreeNode LoadFromXml (string filePath)
|
||||
{
|
||||
XmlSerializer serializer = new XmlSerializer (typeof (TreeNode));
|
||||
using (StreamReader reader = new StreamReader (filePath, System.Text.Encoding.UTF8))
|
||||
{
|
||||
TreeNode root = (TreeNode)serializer.Deserialize (reader);
|
||||
SetParentRecursive (root, null);
|
||||
return root;
|
||||
}
|
||||
}
|
||||
|
||||
private static void SetParentRecursive (TreeNode node, TreeNode parent)
|
||||
{
|
||||
node.Parent = parent;
|
||||
foreach (TreeNode child in node.Children)
|
||||
{
|
||||
SetParentRecursive (child, node);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region IDisposable
|
||||
public virtual void Dispose ()
|
||||
{
|
||||
foreach (TreeNode child in Children)
|
||||
{
|
||||
child.Dispose ();
|
||||
}
|
||||
Children.Clear ();
|
||||
Parent = null;
|
||||
Children = null;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
/// <summary>
|
||||
/// 树根节点
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class TreeRoot: TreeNode
|
||||
{
|
||||
public TreeRoot ()
|
||||
: base ("Root", "")
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -48,6 +48,7 @@
|
||||
<Compile Include="ByteSpan.cs" />
|
||||
<Compile Include="ComStreamWrapper.cs" />
|
||||
<Compile Include="DataItemSection.cs" />
|
||||
<Compile Include="DataTree.cs" />
|
||||
<Compile Include="DecisionInfoSection.cs" />
|
||||
<Compile Include="HierarchicalSchemaSection.cs" />
|
||||
<Compile Include="PriDescriptorSection.cs" />
|
||||
|
||||
6
Reader/App.config
Normal file
6
Reader/App.config
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
|
||||
</startup>
|
||||
</configuration>
|
||||
40
Reader/Polyfill.cs
Normal file
40
Reader/Polyfill.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Reader
|
||||
{
|
||||
public static class Polyfill
|
||||
{
|
||||
public static T ParseTo <T> (this string src, T dflt = default (T))
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace (src)) return dflt;
|
||||
try
|
||||
{
|
||||
Type targetType = typeof (T);
|
||||
Type underlying = Nullable.GetUnderlyingType (targetType);
|
||||
if (underlying != null)
|
||||
{
|
||||
object v = Convert.ChangeType (src, underlying, CultureInfo.InvariantCulture);
|
||||
return (T)v;
|
||||
}
|
||||
if (targetType.IsEnum)
|
||||
{
|
||||
object enumValue = Enum.Parse (targetType, src, true);
|
||||
return (T)enumValue;
|
||||
}
|
||||
TypeConverter converter = TypeDescriptor.GetConverter (targetType);
|
||||
if (converter != null && converter.CanConvertFrom (typeof (string)))
|
||||
{
|
||||
object v = converter.ConvertFrom (null, CultureInfo.InvariantCulture, src);
|
||||
return (T)v;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
return dflt;
|
||||
}
|
||||
}
|
||||
}
|
||||
31
Reader/Program.cs
Normal file
31
Reader/Program.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Reader
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
static public readonly string g_appUserId = "WindowsModern.PracticalToolsProject!Reader";
|
||||
static public readonly string g_appId = "Reader";
|
||||
/// <summary>
|
||||
/// 应用程序的主入口点。
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main ()
|
||||
{
|
||||
Directory.SetCurrentDirectory (AppDomain.CurrentDomain.BaseDirectory);
|
||||
AppxPackage.PackageReader.AddApplicationItem ("SmallLogo");
|
||||
AppxPackage.PackageReader.AddApplicationItem ("Square30x30Logo");
|
||||
AppxPackage.PackageReader.AddApplicationItem ("Logo");
|
||||
AppxPackage.PackageReader.AddApplicationItem ("Square44x44Logo");
|
||||
DataUtils.BrowserEmulation.SetWebBrowserEmulation ();
|
||||
Application.EnableVisualStyles ();
|
||||
Application.SetCompatibleTextRenderingDefault (false);
|
||||
Application.Run (new ReaderShell ());
|
||||
}
|
||||
}
|
||||
}
|
||||
36
Reader/Properties/AssemblyInfo.cs
Normal file
36
Reader/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle ("Reader")]
|
||||
[assembly: AssemblyDescription ("")]
|
||||
[assembly: AssemblyConfiguration ("")]
|
||||
[assembly: AssemblyCompany ("")]
|
||||
[assembly: AssemblyProduct ("Reader")]
|
||||
[assembly: AssemblyCopyright ("Copyright © 2026")]
|
||||
[assembly: AssemblyTrademark ("")]
|
||||
[assembly: AssemblyCulture ("")]
|
||||
|
||||
//将 ComVisible 设置为 false 将使此程序集中的类型
|
||||
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible (false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid ("26b3c19d-6182-4db5-8b69-ee098a0fd3bb")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
|
||||
// 方法是按如下所示使用“*”: :
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion ("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion ("1.0.0.0")]
|
||||
99
Reader/Properties/Resources.Designer.cs
generated
Normal file
99
Reader/Properties/Resources.Designer.cs
generated
Normal file
@@ -0,0 +1,99 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本:4.0.30319.42000
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Reader.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 一个强类型的资源类,用于查找本地化的字符串等。
|
||||
/// </summary>
|
||||
// 此类是由 StronglyTypedResourceBuilder
|
||||
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
|
||||
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
|
||||
// (以 /str 作为命令选项),或重新生成 VS 项目。
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返回此类使用的缓存的 ResourceManager 实例。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Reader.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 使用此强类型资源类,为所有资源查找
|
||||
/// 重写当前线程的 CurrentUICulture 属性。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 600 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string IDS_DEFAULTHEIGHT {
|
||||
get {
|
||||
return ResourceManager.GetString("IDS_DEFAULTHEIGHT", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 800 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string IDS_DEFAULTWIDTH {
|
||||
get {
|
||||
return ResourceManager.GetString("IDS_DEFAULTWIDTH", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 412 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string IDS_MINHEIGHT {
|
||||
get {
|
||||
return ResourceManager.GetString("IDS_MINHEIGHT", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 504 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string IDS_MINWIDTH {
|
||||
get {
|
||||
return ResourceManager.GetString("IDS_MINWIDTH", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
136
Reader/Properties/Resources.resx
Normal file
136
Reader/Properties/Resources.resx
Normal file
@@ -0,0 +1,136 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="IDS_DEFAULTHEIGHT" xml:space="preserve">
|
||||
<value>600</value>
|
||||
<comment>默认窗口高度</comment>
|
||||
</data>
|
||||
<data name="IDS_DEFAULTWIDTH" xml:space="preserve">
|
||||
<value>800</value>
|
||||
<comment>默认窗口宽度</comment>
|
||||
</data>
|
||||
<data name="IDS_MINHEIGHT" xml:space="preserve">
|
||||
<value>412</value>
|
||||
<comment>默认最小窗口高度</comment>
|
||||
</data>
|
||||
<data name="IDS_MINWIDTH" xml:space="preserve">
|
||||
<value>504</value>
|
||||
<comment>默认最小窗口宽度</comment>
|
||||
</data>
|
||||
</root>
|
||||
26
Reader/Properties/Settings.Designer.cs
generated
Normal file
26
Reader/Properties/Settings.Designer.cs
generated
Normal file
@@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本:4.0.30319.42000
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Reader.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
7
Reader/Properties/Settings.settings
Normal file
7
Reader/Properties/Settings.settings
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
163
Reader/Reader.csproj
Normal file
163
Reader/Reader.csproj
Normal file
@@ -0,0 +1,163 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Reader</RootNamespace>
|
||||
<AssemblyName>Reader</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<TargetFrameworkProfile />
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup />
|
||||
<PropertyGroup />
|
||||
<PropertyGroup>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Polyfill.cs" />
|
||||
<Compile Include="ReaderShell.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ReaderShell.Designer.cs">
|
||||
<DependentUpon>ReaderShell.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="ReaderShell.resx">
|
||||
<DependentUpon>ReaderShell.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="app.manifest">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AppxPackage\AppxPackage.csproj">
|
||||
<Project>{bd681a4f-eb60-4bb8-90b5-65968fc7da59}</Project>
|
||||
<Name>AppxPackage</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Bridge\Bridge.csproj">
|
||||
<Project>{3c2f5446-33f0-41d5-813a-64a94aa474af}</Project>
|
||||
<Name>Bridge</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\DataUtils\DataUtils.csproj">
|
||||
<Project>{ffd3fd52-37a8-4f43-883c-de8d996cb0e0}</Project>
|
||||
<Name>DataUtils</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\IEHelper\IEHelper.vcxproj">
|
||||
<Project>{e4ca78a9-9408-4f5f-add6-730fd501ff8e}</Project>
|
||||
<Name>IEHelper</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\ModernNotice\ModernNotice.csproj">
|
||||
<Project>{c5587b6e-19c4-4484-aa97-5c20fbb07e43}</Project>
|
||||
<Name>ModernNotice</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\PrivateInit\PrivateInit.csproj">
|
||||
<Project>{8e708d9a-6325-4aa9-b5a5-d1b5eca8eef7}</Project>
|
||||
<Name>PrivateInit</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\WAShell\WAShell.csproj">
|
||||
<Project>{4ec16578-efbf-41e6-8d7f-976e3646dd1d}</Project>
|
||||
<Name>WAShell</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.5.2">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft .NET Framework 4.5.2 %28x86 和 x64%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- 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">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
54
Reader/ReaderShell.Designer.cs
generated
Normal file
54
Reader/ReaderShell.Designer.cs
generated
Normal file
@@ -0,0 +1,54 @@
|
||||
namespace Reader
|
||||
{
|
||||
partial class ReaderShell
|
||||
{
|
||||
/// <summary>
|
||||
/// 必需的设计器变量。
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// 清理所有正在使用的资源。
|
||||
/// </summary>
|
||||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
||||
protected override void Dispose (bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose ();
|
||||
}
|
||||
base.Dispose (disposing);
|
||||
}
|
||||
|
||||
#region Windows 窗体设计器生成的代码
|
||||
|
||||
/// <summary>
|
||||
/// 设计器支持所需的方法 - 不要修改
|
||||
/// 使用代码编辑器修改此方法的内容。
|
||||
/// </summary>
|
||||
private void InitializeComponent ()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ReaderShell));
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// ManagerShell
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(657, 414);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Location = new System.Drawing.Point(0, 0);
|
||||
this.Name = "ManagerShell";
|
||||
this.PageScale = 125;
|
||||
this.Text = "Form1";
|
||||
this.WindowIcon = ((System.Drawing.Icon)(resources.GetObject("$this.WindowIcon")));
|
||||
this.Load += new System.EventHandler(this.ManagerShell_Load);
|
||||
this.Resize += new System.EventHandler(this.ManagerShell_Resize);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
102
Reader/ReaderShell.cs
Normal file
102
Reader/ReaderShell.cs
Normal file
@@ -0,0 +1,102 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Reader
|
||||
{
|
||||
public partial class ReaderShell: WAShell.WebAppForm
|
||||
{
|
||||
public ReaderShell ()
|
||||
{
|
||||
InitializeComponent ();
|
||||
//this.PublicObjectForScripting = new BridgeExt (this, this, this, this);
|
||||
try
|
||||
{
|
||||
var relativePath = DataUtils.VisualElementsStore.Vemanifest.SplashScreenImage (Program.g_appId);
|
||||
var img = Image.FromFile (relativePath);
|
||||
SplashScreen.SplashImage = img;
|
||||
} catch (Exception e) {
|
||||
var ex = e;
|
||||
}
|
||||
try
|
||||
{
|
||||
SplashScreen.SplashBackgroundColor = DataUtils.UITheme.StringToColor (DataUtils.VisualElementsStore.Vemanifest.SplashScreenBackgroundColor (Program.g_appId));
|
||||
}
|
||||
catch { }
|
||||
InitSize ();
|
||||
Text = Bridge.ResXmlStore.StringRes.Get ("MANAGER_APPTITLE");
|
||||
this.Load += Form_Load;
|
||||
}
|
||||
private void InitSize ()
|
||||
{
|
||||
uint ww = 0, wh = 0;
|
||||
var ini = Bridge.InitFileStore.Config;
|
||||
var setsect = ini ["Settings"];
|
||||
var savepos = setsect.GetKey ("PackageReader:SavePosAndSizeBeforeCancel");
|
||||
var lastw = setsect.GetKey ("PackageReader:LastWidth");
|
||||
var lasth = setsect.GetKey ("PackageReader:LastHeight");
|
||||
var defw = setsect.GetKey ("PackageReader:DefaultWidth");
|
||||
var defh = setsect.GetKey ("PackageReader:DefaultHeight");
|
||||
var minw = setsect.GetKey ("PackageReader:MinimumWidth");
|
||||
var minh = setsect.GetKey ("PackageReader:MinimumHeight");
|
||||
var lasts = setsect.GetKey ("PackageReader:LastWndState");
|
||||
if (savepos.ReadBool ())
|
||||
{
|
||||
ww = lastw.ReadUInt (defw.ReadUInt (Properties.Resources.IDS_DEFAULTWIDTH.ParseTo <uint> ()));
|
||||
wh = lasth.ReadUInt (defh.ReadUInt (Properties.Resources.IDS_DEFAULTHEIGHT.ParseTo <uint> ()));
|
||||
}
|
||||
else
|
||||
{
|
||||
ww = defw.ReadUInt (Properties.Resources.IDS_DEFAULTWIDTH.ParseTo<uint> ());
|
||||
wh = defh.ReadUInt (Properties.Resources.IDS_DEFAULTHEIGHT.ParseTo<uint> ());
|
||||
}
|
||||
ClientSize = new Size ((int)(ww * DataUtils.UITheme.DPIDouble), (int)(wh * DataUtils.UITheme.DPIDouble));
|
||||
int hborder = Size.Width - ClientSize.Width,
|
||||
vborder = Size.Height - ClientSize.Height;
|
||||
MinimumSize = new Size (
|
||||
(int)(minw.ReadUInt (Properties.Resources.IDS_MINWIDTH.ParseTo <uint> ()) * DataUtils.UITheme.DPIDouble) + hborder,
|
||||
(int)(minh.ReadUInt (Properties.Resources.IDS_MINHEIGHT.ParseTo <uint> ()) * DataUtils.UITheme.DPIDouble) + vborder
|
||||
);
|
||||
WindowState = (FormWindowState)lasts.ReadInt ((int)FormWindowState.Normal);
|
||||
}
|
||||
private void Form_Load (object sender, EventArgs e)
|
||||
{
|
||||
var current = Process.GetCurrentProcess ();
|
||||
var processes = Process.GetProcessesByName (current.ProcessName);
|
||||
int count = processes.Length;
|
||||
int offset = 30; // 每个窗口偏移
|
||||
int x = 20 + (count - 1) * offset;
|
||||
int y = 20 + (count - 1) * offset;
|
||||
this.StartPosition = FormStartPosition.Manual;
|
||||
this.Location = new Point (x, y);
|
||||
}
|
||||
private void ManagerShell_Load (object sender, EventArgs e)
|
||||
{
|
||||
var root = Path.GetDirectoryName (DataUtils.Utilities.GetCurrentProgramPath ());
|
||||
WebUI.Navigate (Path.Combine (root, "html\\reader.html"));
|
||||
}
|
||||
private void ManagerShell_Resize (object sender, EventArgs e)
|
||||
{
|
||||
var ini = Bridge.InitFileStore.Config;
|
||||
var setsect = ini ["Settings"];
|
||||
var savepos = setsect.GetKey ("PackageReader:SavePosAndSizeBeforeCancel");
|
||||
var lastw = setsect.GetKey ("PackageReader:LastWidth");
|
||||
var lasth = setsect.GetKey ("PackageReader:LastHeight");
|
||||
var lasts = setsect.GetKey ("PackageReader:LastWndState");
|
||||
switch (WindowState)
|
||||
{
|
||||
case FormWindowState.Normal:
|
||||
case FormWindowState.Maximized:
|
||||
lasts.Write ((int)WindowState);
|
||||
break;
|
||||
}
|
||||
if (WindowState == FormWindowState.Normal && savepos.ReadBool ())
|
||||
{
|
||||
lastw.Write ((int)(ClientSize.Width / DataUtils.UITheme.DPIDouble));
|
||||
lasth.Write ((int)(ClientSize.Height / DataUtils.UITheme.DPIDouble));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
9224
Reader/ReaderShell.resx
Normal file
9224
Reader/ReaderShell.resx
Normal file
File diff suppressed because it is too large
Load Diff
75
Reader/app.manifest
Normal file
75
Reader/app.manifest
Normal file
@@ -0,0 +1,75 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||
<security>
|
||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<!-- UAC 清单选项
|
||||
如果想要更改 Windows 用户帐户控制级别,请使用
|
||||
以下节点之一替换 requestedExecutionLevel 节点。n
|
||||
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" /> -->
|
||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||
<!-- <requestedExecutionLevel level="highestAvailable" uiAccess="false" />
|
||||
|
||||
指定 requestedExecutionLevel 元素将禁用文件和注册表虚拟化。
|
||||
如果你的应用程序需要此虚拟化来实现向后兼容性,则删除此
|
||||
元素。
|
||||
|
||||
-->
|
||||
<!-- <requestedExecutionLevel level="asInvoker" uiAccess="false" /> -->
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<!-- 设计此应用程序与其一起工作且已针对此应用程序进行测试的
|
||||
Windows 版本的列表。取消评论适当的元素,Windows 将
|
||||
自动选择最兼容的环境。 -->
|
||||
|
||||
<!-- Windows Vista -->
|
||||
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />
|
||||
|
||||
<!-- Windows 7 -->
|
||||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
|
||||
|
||||
<!-- Windows 8 -->
|
||||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
|
||||
|
||||
<!-- Windows 8.1 -->
|
||||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
|
||||
|
||||
<!-- Windows 10 -->
|
||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
|
||||
|
||||
</application>
|
||||
</compatibility>
|
||||
|
||||
<!-- 指示该应用程序可以感知 DPI 且 Windows 在 DPI 较高时将不会对其进行
|
||||
自动缩放。Windows Presentation Foundation (WPF)应用程序自动感知 DPI,无需
|
||||
选择加入。选择加入此设置的 Windows 窗体应用程序(目标设定为 .NET Framework 4.6 )还应
|
||||
在其 app.config 中将 "EnableWindowsFormsHighDpiAutoResizing" 设置设置为 "true"。-->
|
||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<windowsSettings>
|
||||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
|
||||
<!-- 启用 Windows 公共控件和对话框的主题(Windows XP 和更高版本) -->
|
||||
<!--
|
||||
<dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity
|
||||
type="win32"
|
||||
name="Microsoft.Windows.Common-Controls"
|
||||
version="6.0.0.0"
|
||||
processorArchitecture="*"
|
||||
publicKeyToken="6595b64144ccf1df"
|
||||
language="*"
|
||||
/>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
-->
|
||||
|
||||
</assembly>
|
||||
4
Reader/packages.config
Normal file
4
Reader/packages.config
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net40" />
|
||||
</packages>
|
||||
@@ -12,26 +12,57 @@ static std::wstring StringToWString (const std::string &str, UINT codePage = CP_
|
||||
}
|
||||
|
||||
#undef GetLocaleInfo
|
||||
/// <summary>
|
||||
/// 获取指定 LCID 的区域设置信息(ANSI 版本)。
|
||||
/// </summary>
|
||||
/// <param name="code">区域标识符(LCID)。</param>
|
||||
/// <param name="type">要获取的信息类型(LCTYPE)。</param>
|
||||
/// <returns>以 ANSI 字符串形式返回的区域设置信息。</returns>
|
||||
std::string GetLocaleInfoA (LCID code, LCTYPE type)
|
||||
{
|
||||
char buf [LOCALE_NAME_MAX_LENGTH] = {0};
|
||||
GetLocaleInfoA (code, type, buf, LOCALE_NAME_MAX_LENGTH);
|
||||
return buf;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取指定 LCID 的区域设置信息(Unicode 版本)。
|
||||
/// </summary>
|
||||
/// <param name="code">区域标识符(LCID)。</param>
|
||||
/// <param name="type">要获取的信息类型(LCTYPE)。</param>
|
||||
/// <returns>以宽字符串形式返回的区域设置信息。</returns>
|
||||
std::wstring GetLocaleInfoW (LCID code, LCTYPE type)
|
||||
{
|
||||
WCHAR buf [LOCALE_NAME_MAX_LENGTH] = {0};
|
||||
GetLocaleInfoW (code, type, buf, LOCALE_NAME_MAX_LENGTH);
|
||||
return buf;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取指定 LCID 的区域设置信息(宽字符串输出)。
|
||||
/// </summary>
|
||||
/// <param name="code">区域标识符(LCID)。</param>
|
||||
/// <param name="type">要获取的信息类型(LCTYPE)。</param>
|
||||
/// <param name="output">接收信息的宽字符串引用。</param>
|
||||
void GetLocaleInfo (LCID code, LCTYPE type, std::wstring &output)
|
||||
{
|
||||
output = GetLocaleInfoW (code, type);
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取指定 LCID 的区域设置信息(ANSI 字符串输出)。
|
||||
/// </summary>
|
||||
/// <param name="code">区域标识符(LCID)。</param>
|
||||
/// <param name="type">要获取的信息类型(LCTYPE)。</param>
|
||||
/// <param name="output">接收信息的 ANSI 字符串引用。</param>
|
||||
void GetLocaleInfo (LCID code, LCTYPE type, std::string &output)
|
||||
{
|
||||
output = GetLocaleInfoA (code, type);
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取指定区域名称的区域设置信息(扩展版本,支持 Windows Vista+)。
|
||||
/// </summary>
|
||||
/// <param name="lpLocaleName">区域名称(如 "en-US")。</param>
|
||||
/// <param name="type">要获取的信息类型(LCTYPE)。</param>
|
||||
/// <param name="output">接收信息的宽字符串引用。</param>
|
||||
/// <returns>成功返回非零值,失败返回 0;如果 lpLocaleName 无效,则函数会返回 0。</returns>
|
||||
int GetLocaleInfoEx (std::wstring lpLocaleName, LCTYPE type, std::wstring &output)
|
||||
{
|
||||
WCHAR buf [LOCALE_NAME_MAX_LENGTH] = {0};
|
||||
@@ -41,57 +72,130 @@ int GetLocaleInfoEx (std::wstring lpLocaleName, LCTYPE type, std::wstring &outpu
|
||||
}
|
||||
|
||||
#undef SetLocaleInfo
|
||||
/// <summary>
|
||||
/// 设置指定 LCID 的区域设置信息(ANSI 版本)。
|
||||
/// </summary>
|
||||
/// <param name="code">区域标识符(LCID)。</param>
|
||||
/// <param name="type">要设置的信息类型(LCTYPE)。</param>
|
||||
/// <param name="lcData">要设置的数据(ANSI 字符串)。</param>
|
||||
/// <returns>成功返回非零值,失败返回 0。</returns>
|
||||
BOOL SetLocaleInfoA (LCID code, LCTYPE type, const std::string &lcData)
|
||||
{
|
||||
return SetLocaleInfoA (code, type, lcData.c_str ());
|
||||
}
|
||||
/// <summary>
|
||||
/// 设置指定 LCID 的区域设置信息(Unicode 版本)。
|
||||
/// </summary>
|
||||
/// <param name="code">区域标识符(LCID)。</param>
|
||||
/// <param name="type">要设置的信息类型(LCTYPE)。</param>
|
||||
/// <param name="lcData">要设置的数据(宽字符串)。</param>
|
||||
/// <returns>成功返回非零值,失败返回 0。</returns>
|
||||
BOOL SetLocaleInfoW (LCID code, LCTYPE type, const std::wstring &lcData)
|
||||
{
|
||||
return SetLocaleInfoW (code, type, lcData.c_str ());
|
||||
}
|
||||
/// <summary>
|
||||
/// 设置指定 LCID 的区域设置信息(宽字符串重载)。
|
||||
/// </summary>
|
||||
/// <param name="code">区域标识符(LCID)。</param>
|
||||
/// <param name="type">要设置的信息类型(LCTYPE)。</param>
|
||||
/// <param name="lcData">要设置的数据(宽字符串)。</param>
|
||||
/// <returns>成功返回非零值,失败返回 0。</returns>
|
||||
BOOL SetLocaleInfo (LCID code, LCTYPE type, const std::wstring &lcData)
|
||||
{
|
||||
return SetLocaleInfoW (code, type, lcData);
|
||||
}
|
||||
/// <summary>
|
||||
/// 设置指定 LCID 的区域设置信息(ANSI 字符串重载)。
|
||||
/// </summary>
|
||||
/// <param name="code">区域标识符(LCID)。</param>
|
||||
/// <param name="type">要设置的信息类型(LCTYPE)。</param>
|
||||
/// <param name="lcData">要设置的数据(ANSI 字符串)。</param>
|
||||
/// <returns>成功返回非零值,失败返回 0。</returns>
|
||||
BOOL SetLocaleInfo (LCID code, LCTYPE type, const std::string &lcData)
|
||||
{
|
||||
return SetLocaleInfoA (code, type, lcData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从 LCID 获取受限区域代码(如 "en"),ANSI 版本。
|
||||
/// </summary>
|
||||
/// <param name="lcid">区域标识符。</param>
|
||||
/// <returns>受限区域代码的 ANSI 字符串。</returns>
|
||||
std::string GetLocaleRestrictedCodeFromLcidA (LCID lcid)
|
||||
{
|
||||
return GetLocaleInfoA (lcid, 89);
|
||||
}
|
||||
/// <summary>
|
||||
/// 从 LCID 获取受限区域代码(如 "en"),Unicode 版本。
|
||||
/// </summary>
|
||||
/// <param name="lcid">区域标识符。</param>
|
||||
/// <returns>受限区域代码的宽字符串。</returns>
|
||||
std::wstring GetLocaleRestrictedCodeFromLcidW (LCID lcid)
|
||||
{
|
||||
return GetLocaleInfoW (lcid, 89);
|
||||
}
|
||||
/// <summary>
|
||||
/// 从 LCID 获取受限区域代码(ANSI 输出)。
|
||||
/// </summary>
|
||||
/// <param name="lcid">区域标识符。</param>
|
||||
/// <param name="ret">输出 ANSI 字符串。</param>
|
||||
void GetLocaleRestrictedCodeFromLcid (LCID lcid, std::string &ret)
|
||||
{
|
||||
ret = GetLocaleRestrictedCodeFromLcidA (lcid);
|
||||
}
|
||||
/// <summary>
|
||||
/// 从 LCID 获取受限区域代码(宽字符串输出)。
|
||||
/// </summary>
|
||||
/// <param name="lcid">区域标识符。</param>
|
||||
/// <param name="ret">输出宽字符串。</param>
|
||||
void GetLocaleRestrictedCodeFromLcid (LCID lcid, std::wstring &ret)
|
||||
{
|
||||
ret = GetLocaleRestrictedCodeFromLcidW (lcid);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从 LCID 获取详细区域代码(如 "US"),ANSI 版本。
|
||||
/// </summary>
|
||||
/// <param name="lcid">区域标识符。</param>
|
||||
/// <returns>详细区域代码的 ANSI 字符串。</returns>
|
||||
std::string GetLocaleElaboratedCodeFromLcidA (LCID lcid)
|
||||
{
|
||||
return GetLocaleInfoA (lcid, 90);
|
||||
}
|
||||
/// <summary>
|
||||
/// 从 LCID 获取详细区域代码(如 "US"),Unicode 版本。
|
||||
/// </summary>
|
||||
/// <param name="lcid">区域标识符。</param>
|
||||
/// <returns>详细区域代码的宽字符串。</returns>
|
||||
std::wstring GetLocaleElaboratedCodeFromLcidW (LCID lcid)
|
||||
{
|
||||
return GetLocaleInfoW (lcid, 90);
|
||||
}
|
||||
/// <summary>
|
||||
/// 从 LCID 获取详细区域代码(宽字符串输出)。
|
||||
/// </summary>
|
||||
/// <param name="lcid">区域标识符。</param>
|
||||
/// <param name="ret">输出宽字符串。</param>
|
||||
void GetLocaleElaboratedCodeFromLcid (LCID lcid, std::wstring &ret)
|
||||
{
|
||||
ret = GetLocaleElaboratedCodeFromLcidW (lcid);
|
||||
}
|
||||
/// <summary>
|
||||
/// 从 LCID 获取详细区域代码(ANSI 输出)。
|
||||
/// </summary>
|
||||
/// <param name="lcid">区域标识符。</param>
|
||||
/// <param name="ret">输出 ANSI 字符串。</param>
|
||||
void GetLocaleElaboratedCodeFromLcid (LCID lcid, std::string &ret)
|
||||
{
|
||||
ret = GetLocaleElaboratedCodeFromLcidA (lcid);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将宽字符串形式的区域名称转换为 LCID。
|
||||
/// </summary>
|
||||
/// <param name="localeCode">区域名称(如 L"en-US")。</param>
|
||||
/// <returns>对应的 LCID;若失败返回 0。</returns>
|
||||
LCID LocaleCodeToLcidW (const std::wstring &localeCode)
|
||||
{
|
||||
#if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0600)
|
||||
@@ -108,62 +212,149 @@ LCID LocaleCodeToLcidW (const std::wstring &localeCode)
|
||||
return LocaleNameToLCID (localeCode.c_str (), 0);
|
||||
#endif
|
||||
}
|
||||
/// <summary>
|
||||
/// 将 ANSI 字符串形式的区域名称转换为 LCID。
|
||||
/// </summary>
|
||||
/// <param name="localeCode">区域名称(如 "en-US")。</param>
|
||||
/// <returns>对应的 LCID;若失败返回 0。</returns>
|
||||
LCID LocaleCodeToLcidA (const std::string &localeCode)
|
||||
{
|
||||
std::wstring lcWide = StringToWString (std::string (localeCode));
|
||||
return LocaleCodeToLcidW (lcWide.c_str ());
|
||||
}
|
||||
/// <summary>
|
||||
/// 将宽字符串区域名称转换为 LCID(重载)。
|
||||
/// </summary>
|
||||
/// <param name="loccode">区域名称(宽字符串)。</param>
|
||||
/// <returns>对应的 LCID。</returns>
|
||||
LCID LocaleCodeToLcid (const std::wstring &loccode)
|
||||
{
|
||||
return LocaleCodeToLcidW (loccode.c_str ());
|
||||
}
|
||||
/// <summary>
|
||||
/// 将 ANSI 字符串区域名称转换为 LCID(重载)。
|
||||
/// </summary>
|
||||
/// <param name="loccode">区域名称(ANSI 字符串)。</param>
|
||||
/// <returns>对应的 LCID。</returns>
|
||||
LCID LocaleCodeToLcid (const std::string &loccode)
|
||||
{
|
||||
return LocaleCodeToLcidA (loccode.c_str ());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据区域名称获取受限区域代码(ANSI 版本,接受 C 字符串)。
|
||||
/// </summary>
|
||||
/// <param name="lc">区域名称(如 "en-US")。</param>
|
||||
/// <returns>受限区域代码的 ANSI 字符串。</returns>
|
||||
std::string GetLocaleRestrictedCodeA (LPCSTR lc)
|
||||
{
|
||||
return GetLocaleInfoA (LocaleCodeToLcidA (lc), 89);
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据区域名称获取受限区域代码(ANSI 版本,接受 std::string)。
|
||||
/// </summary>
|
||||
/// <param name="lc">区域名称(std::string)。</param>
|
||||
/// <returns>受限区域代码的 ANSI 字符串。</returns>
|
||||
std::string GetLocaleRestrictedCodeA (const std::string &lc)
|
||||
{
|
||||
return GetLocaleInfoA (LocaleCodeToLcidA (lc.c_str ()), 89);
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据区域名称获取受限区域代码(Unicode 版本,接受 C 宽字符串)。
|
||||
/// </summary>
|
||||
/// <param name="lc">区域名称(如 L"en-US")。</param>
|
||||
/// <returns>受限区域代码的宽字符串。</returns>
|
||||
std::wstring GetLocaleRestrictedCodeW (LPCWSTR lc)
|
||||
{
|
||||
return GetLocaleInfoW (LocaleCodeToLcidW (lc), 89);
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据区域名称获取受限区域代码(Unicode 版本,接受 std::wstring)。
|
||||
/// </summary>
|
||||
/// <param name="lc">区域名称(std::wstring)。</param>
|
||||
/// <returns>受限区域代码的宽字符串。</returns>
|
||||
std::wstring GetLocaleRestrictedCodeW (const std::wstring &lc)
|
||||
{
|
||||
return GetLocaleInfoW (LocaleCodeToLcidW (lc.c_str ()), 89);
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据区域名称获取受限区域代码(宽字符串重载)。
|
||||
/// </summary>
|
||||
/// <param name="lc">区域名称(std::wstring)。</param>
|
||||
/// <returns>受限区域代码的宽字符串。</returns>
|
||||
std::wstring GetLocaleRestrictedCode (const std::wstring &lc) { return GetLocaleRestrictedCodeW (lc); }
|
||||
/// <summary>
|
||||
/// 根据区域名称获取受限区域代码(ANSI 字符串重载)。
|
||||
/// </summary>
|
||||
/// <param name="lc">区域名称(std::string)。</param>
|
||||
/// <returns>受限区域代码的 ANSI 字符串。</returns>
|
||||
std::string GetLocaleRestrictedCode (const std::string &lc) { return GetLocaleRestrictedCodeA (lc); }
|
||||
|
||||
/// <summary>
|
||||
/// 根据区域名称获取详细区域代码(ANSI 版本,接受 C 字符串)。
|
||||
/// </summary>
|
||||
/// <param name="lc">区域名称(如 "en-US")。</param>
|
||||
/// <returns>详细区域代码的 ANSI 字符串。</returns>
|
||||
std::string GetLocaleElaboratedCodeA (LPCSTR lc)
|
||||
{
|
||||
return GetLocaleInfoA (LocaleCodeToLcidA (lc), 90);
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据区域名称获取详细区域代码(ANSI 版本,接受 std::string)。
|
||||
/// </summary>
|
||||
/// <param name="lc">区域名称(std::string)。</param>
|
||||
/// <returns>详细区域代码的 ANSI 字符串。</returns>
|
||||
std::string GetLocaleElaboratedCodeA (const std::string &lc)
|
||||
{
|
||||
return GetLocaleInfoA (LocaleCodeToLcidA (lc.c_str ()), 90);
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据区域名称获取详细区域代码(Unicode 版本,接受 C 宽字符串)。
|
||||
/// </summary>
|
||||
/// <param name="lc">区域名称(如 L"en-US")。</param>
|
||||
/// <returns>详细区域代码的宽字符串。</returns>
|
||||
std::wstring GetLocaleElaboratedCodeW (LPCWSTR lc)
|
||||
{
|
||||
return GetLocaleInfoW (LocaleCodeToLcidW (lc), 90);
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据区域名称获取详细区域代码(Unicode 版本,接受 std::wstring)。
|
||||
/// </summary>
|
||||
/// <param name="lc">区域名称(std::wstring)。</param>
|
||||
/// <returns>详细区域代码的宽字符串。</returns>
|
||||
std::wstring GetLocaleElaboratedCodeW (const std::wstring &lc)
|
||||
{
|
||||
return GetLocaleInfoW (LocaleCodeToLcidW (lc.c_str ()), 90);
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据区域名称获取详细区域代码(宽字符串重载)。
|
||||
/// </summary>
|
||||
/// <param name="lc">区域名称(std::wstring)。</param>
|
||||
/// <returns>详细区域代码的宽字符串。</returns>
|
||||
std::wstring GetLocaleElaboratedCode (const std::wstring &lc) { return GetLocaleElaboratedCodeW (lc); }
|
||||
/// <summary>
|
||||
/// 根据区域名称获取详细区域代码(ANSI 字符串重载)。
|
||||
/// </summary>
|
||||
/// <param name="lc">区域名称(std::string)。</param>
|
||||
/// <returns>详细区域代码的 ANSI 字符串。</returns>
|
||||
std::string GetLocaleElaboratedCode (const std::string &lc) { return GetLocaleElaboratedCodeA (lc); }
|
||||
|
||||
/// <summary>
|
||||
/// 将 LCID 转换为区域名称(ANSI 格式,如 "en-US")。
|
||||
/// </summary>
|
||||
/// <param name="lcid">区域标识符。</param>
|
||||
/// <param name="divide">分隔符,默认为 '-'。</param>
|
||||
/// <returns>区域名称的 ANSI 字符串。</returns>
|
||||
std::string LcidToLocaleCodeA (LCID lcid, char divide = '-')
|
||||
{
|
||||
return GetLocaleRestrictedCodeFromLcidA (lcid) + divide + GetLocaleElaboratedCodeFromLcidA (lcid);
|
||||
}
|
||||
/// <summary>
|
||||
/// 将 LCID 转换为区域名称(Unicode 格式,如 L"en-US")。
|
||||
/// </summary>
|
||||
/// <param name="lcid">区域标识符。</param>
|
||||
/// <param name="divide">分隔符,默认为 L'-'。</param>
|
||||
/// <returns>区域名称的宽字符串。</returns>
|
||||
std::wstring LcidToLocaleCodeW (LCID lcid, WCHAR divide = L'-')
|
||||
{
|
||||
#if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0600)
|
||||
@@ -179,9 +370,25 @@ std::wstring LcidToLocaleCodeW (LCID lcid, WCHAR divide = L'-')
|
||||
return GetLocaleRestrictedCodeFromLcidW (lcid) + divide + GetLocaleElaboratedCodeFromLcidW (lcid);
|
||||
#endif
|
||||
}
|
||||
/// <summary>
|
||||
/// 将 LCID 转换为区域名称(宽字符串重载)。
|
||||
/// </summary>
|
||||
/// <param name="lcid">区域标识符。</param>
|
||||
/// <param name="divide">分隔符,默认为 L'-'。</param>
|
||||
/// <returns>区域名称的宽字符串。</returns>
|
||||
std::wstring LcidToLocaleCode (LCID lcid, WCHAR divide = L'-') { return LcidToLocaleCodeW (lcid, divide); }
|
||||
/// <summary>
|
||||
/// 将 LCID 转换为区域名称(ANSI 字符串重载)。
|
||||
/// </summary>
|
||||
/// <param name="lcid">区域标识符。</param>
|
||||
/// <param name="divide">分隔符,默认为 '-'。</param>
|
||||
/// <returns>区域名称的 ANSI 字符串。</returns>
|
||||
std::string LcidToLocaleCode (LCID lcid, char divide = '-') { return LcidToLocaleCodeA (lcid, divide); }
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前用户的默认区域名称(Unicode)。
|
||||
/// </summary>
|
||||
/// <returns>用户默认区域名称的宽字符串。</returns>
|
||||
std::wstring GetUserDefaultLocaleName ()
|
||||
{
|
||||
#if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0600)
|
||||
@@ -197,6 +404,10 @@ std::wstring GetUserDefaultLocaleName ()
|
||||
return LcidToLocaleCodeW (GetUserDefaultLCID ());
|
||||
#endif
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取系统默认的区域名称(Unicode)。
|
||||
/// </summary>
|
||||
/// <returns>系统默认区域名称的宽字符串。</returns>
|
||||
std::wstring GetSystemDefaultLocaleName ()
|
||||
{
|
||||
#if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0600)
|
||||
@@ -213,6 +424,10 @@ std::wstring GetSystemDefaultLocaleName ()
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前计算机的区域设置名称(优先使用线程区域,然后用户默认,最后系统默认)。
|
||||
/// </summary>
|
||||
/// <returns>计算机区域名称的宽字符串。</returns>
|
||||
std::wstring GetComputerLocaleCodeW ()
|
||||
{
|
||||
#if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0600)
|
||||
@@ -250,6 +465,13 @@ std::wstring GetComputerLocaleCodeW ()
|
||||
}
|
||||
#endif
|
||||
}
|
||||
/// <summary>
|
||||
/// 比较两个区域名称是否相等(支持字符串直接比较或通过 LCID 比较)。
|
||||
/// </summary>
|
||||
/// <param name="left">左区域名称。</param>
|
||||
/// <param name="right">右区域名称。</param>
|
||||
/// <returns>如果区域名称相同(字符串相等或 LCID 相等)则返回 true,否则 false。</returns>
|
||||
/// <remarks>注意:此处使用的 std::wnstring::equals 非标准,可能为自定义函数,实际应替换为 wstring 比较。</remarks>
|
||||
bool LocaleNameCompare (const std::wstring &left, const std::wstring &right)
|
||||
{
|
||||
return std::wnstring::equals (left, right) || LocaleCodeToLcidW (left) == LocaleCodeToLcidW (right);
|
||||
|
||||
@@ -563,6 +563,7 @@ void PriFileIterateTask (PCSPRIFILE pFilePri)
|
||||
System::Runtime::InteropServices::GCHandle handle = System::Runtime::InteropServices::GCHandle::FromIntPtr (handlePtr);
|
||||
auto pri = safe_cast <PriFileInst ^> (handle.Target);
|
||||
auto &priFile = pri;
|
||||
if (!priFile) return;
|
||||
auto resmapsect = pri->inst->PriDescriptorSection->ResourceMapSections;
|
||||
bool isallsearched = true;
|
||||
size_t allitemslen = 0;
|
||||
@@ -788,12 +789,14 @@ void PriFileIterateTaskCli (Object^ pFilePriObj)
|
||||
// t->Start (IntPtr (pFilePri));
|
||||
// }
|
||||
//}
|
||||
#ifdef ELDER_FUNC
|
||||
void AddPriResourceName (PCSPRIFILE pFilePri, const std::vector <std::wnstring> &urilist)
|
||||
{
|
||||
if (!pFilePri) return;
|
||||
if (!urilist.size ()) return;
|
||||
{
|
||||
CreateScopedLock (g_threadlock);
|
||||
CreateScopedLock (g_iterlock);
|
||||
if (g_tasklist.find (pFilePri) == g_tasklist.end ())
|
||||
{
|
||||
g_tasklist [pFilePri] = TASKINFO_SEARCH ();
|
||||
@@ -802,11 +805,13 @@ void AddPriResourceName (PCSPRIFILE pFilePri, const std::vector <std::wnstring>
|
||||
TASKINFO_SEARCH *ptask = nullptr;
|
||||
{
|
||||
CreateScopedLock (g_threadlock);
|
||||
CreateScopedLock (g_iterlock);
|
||||
ptask = &g_tasklist.at (pFilePri);
|
||||
}
|
||||
auto &task = *ptask;
|
||||
bool isallfined = true;
|
||||
{
|
||||
CreateScopedLock (g_threadlock);
|
||||
CreateScopedLock (g_iterlock);
|
||||
for (auto &it : urilist)
|
||||
{
|
||||
@@ -832,6 +837,7 @@ void AddPriResourceName (PCSPRIFILE pFilePri, const std::vector <std::wnstring>
|
||||
if (isallfined) return;
|
||||
{
|
||||
CreateScopedLock (g_threadlock);
|
||||
CreateScopedLock (g_iterlock);
|
||||
if (!task.bIsRunning)
|
||||
{
|
||||
System::Threading::Thread ^t = gcnew System::Threading::Thread (gcnew System::Threading::ParameterizedThreadStart (PriFileIterateTaskCli));
|
||||
@@ -873,7 +879,7 @@ LPWSTR GetPriResource (PCSPRIFILE pFilePri, LPCWSTR lpswResId)
|
||||
auto &result = task.mapTasks [TASKITEM_SEARCH (lpswResId)];
|
||||
if (result.has_search ()) return _wcsdup (result.swValue.c_str ());
|
||||
}
|
||||
BYTE buf [sizeof (LPCWSTRLIST) + sizeof (LPCWSTR)] = {0};
|
||||
BYTE buf [sizeof (LPCWSTRLIST) + sizeof (LPCWSTR)] = { 0 };
|
||||
HLPCWSTRLIST hStrList = (HLPCWSTRLIST)buf;
|
||||
hStrList->dwLength = 1;
|
||||
hStrList->aswArray [0] = lpswResId;
|
||||
@@ -893,6 +899,7 @@ LPWSTR GetPriResource (PCSPRIFILE pFilePri, LPCWSTR lpswResId)
|
||||
}
|
||||
LPWSTR GetPriStringResource (PCSPRIFILE pFilePri, LPCWSTR lpswUri) { return GetPriResource (pFilePri, lpswUri); }
|
||||
LPWSTR GetPriPathResource (PCSPRIFILE pFilePri, LPCWSTR lpswFilePath) { return GetPriResource (pFilePri, lpswFilePath); }
|
||||
#endif
|
||||
void ClearPriCacheData ()
|
||||
{
|
||||
g_tasklist.clear ();
|
||||
@@ -1209,3 +1216,252 @@ HWSDSPAIRLIST GetPriResourcesAllValuesList (PCSPRIFILE pPriFile, const LPCWSTR *
|
||||
if (rnout.empty ()) return nullptr;
|
||||
return CreateWSDSPAIRLISTFromMap (rnout);
|
||||
}
|
||||
|
||||
#ifndef ELDER_FUNC
|
||||
size_t GetPriLocaleStringResources (
|
||||
PCSPRIFILE pPriFile,
|
||||
const std::vector <std::wstring> &resnames,
|
||||
std::map <std::wnstring, std::map <std::wnstring, std::wstring>> &output
|
||||
)
|
||||
{
|
||||
output.clear ();
|
||||
if (!pPriFile) return 0;
|
||||
auto inst = GetPriFileInst (pPriFile);
|
||||
auto pri = inst->inst;
|
||||
auto priFile = inst;
|
||||
auto resmapsect = pri->PriDescriptorSection->ResourceMapSections;
|
||||
std::set <std::wnstring> rnlist;
|
||||
for (auto &it : resnames) rnlist.insert (std::wnstring (it));
|
||||
for (size_t i = 0; i < resmapsect->Count; i ++)
|
||||
{
|
||||
auto resourceMapSectionRef = resmapsect [i];
|
||||
auto resourceMapSection = pri->GetSectionByRef (resourceMapSectionRef);
|
||||
if (resourceMapSection->HierarchicalSchemaReference != nullptr) continue;
|
||||
auto decisionInfoSection = pri->GetSectionByRef (resourceMapSection->DecisionInfoSection);
|
||||
for each (auto candidateSet in resourceMapSection->CandidateSets->Values)
|
||||
{
|
||||
auto item = pri->GetResourceMapItemByRef (candidateSet->ResourceMapItem);
|
||||
std::wstring itemfullname = MPStringToStdW (item->FullName);
|
||||
std::vector <std::wnstring> itempath;
|
||||
{
|
||||
auto ips = split_wcstok (itemfullname, L"\\");
|
||||
for (auto &it : ips)
|
||||
{
|
||||
if (std::wnstring::empty (it)) continue;
|
||||
itempath.push_back (it);
|
||||
}
|
||||
}
|
||||
bool isfind = false;
|
||||
std::wnstring taskkey = L"";
|
||||
int tasktype = 1;
|
||||
for (auto &it : rnlist)
|
||||
{
|
||||
TASKITEM_SEARCH key (it);
|
||||
std::vector <std::wnstring> namepath;
|
||||
key.get_path (namepath);
|
||||
if (PathEquals (itempath, namepath))
|
||||
{
|
||||
taskkey = it;
|
||||
tasktype = key.iTaskType;
|
||||
isfind = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!isfind) continue;
|
||||
std::map <std::wnstring, std::wstring> values;
|
||||
for each (auto candidate in candidateSet->Candidates)
|
||||
{
|
||||
std::wnstring resc = L"";
|
||||
System::String ^value = nullptr;
|
||||
if (candidate->SourceFile.HasValue)
|
||||
{
|
||||
// 内嵌资源,暂无法处理
|
||||
// value = System::String::Format ("<external in {0}>", pri->GetReferencedFileByRef (candidate->SourceFile.Value)->FullName);
|
||||
value = pri->GetReferencedFileByRef (candidate->SourceFile.Value)->FullName;
|
||||
}
|
||||
else
|
||||
{
|
||||
ByteSpan ^byteSpan = nullptr;
|
||||
if (candidate->DataItem.HasValue) byteSpan = priFile->inst->GetDataItemByRef (candidate->DataItem.Value);
|
||||
else byteSpan = candidate->Data.Value;
|
||||
priFile->Seek (byteSpan->Offset, System::IO::SeekOrigin::Begin);
|
||||
auto binaryReader = gcnew System::IO::BinaryReader (priFile, System::Text::Encoding::Default, true);
|
||||
auto data = binaryReader->ReadBytes ((int)byteSpan->Length);
|
||||
switch (candidate->Type)
|
||||
{
|
||||
case ResourceValueType::AsciiPath:
|
||||
case ResourceValueType::AsciiString:
|
||||
value = System::Text::Encoding::ASCII->GetString (data)->TrimEnd ('\0');
|
||||
break;
|
||||
case ResourceValueType::Utf8Path:
|
||||
case ResourceValueType::Utf8String:
|
||||
value = System::Text::Encoding::UTF8->GetString (data)->TrimEnd ('\0');
|
||||
break;
|
||||
case ResourceValueType::Path:
|
||||
case ResourceValueType::String:
|
||||
value = System::Text::Encoding::Unicode->GetString (data)->TrimEnd ('\0');
|
||||
break;
|
||||
case ResourceValueType::EmbeddedData:
|
||||
value = Convert::ToBase64String (data);
|
||||
break;
|
||||
}
|
||||
delete binaryReader;
|
||||
delete data;
|
||||
binaryReader = nullptr;
|
||||
data = nullptr;
|
||||
}
|
||||
auto qualifierSet = decisionInfoSection->QualifierSets [candidate->QualifierSet];
|
||||
auto qualis = gcnew System::Collections::Generic::Dictionary <QualifierType, Object ^> ();
|
||||
for each (auto quali in qualifierSet->Qualifiers)
|
||||
{
|
||||
auto type = quali->Type;
|
||||
auto value = quali->Value;
|
||||
qualis->Add (type, value);
|
||||
}
|
||||
if (qualis->ContainsKey (QualifierType::Language))
|
||||
{
|
||||
resc = MPStringToStdW (qualis [QualifierType::Language]->ToString ());
|
||||
values [resc] = MPStringToStdW (value ? value : System::String::Empty);
|
||||
}
|
||||
delete qualis;
|
||||
qualis = nullptr;
|
||||
}
|
||||
output [taskkey] = values;
|
||||
rnlist.erase (taskkey);
|
||||
}
|
||||
resourceMapSection = nullptr;
|
||||
}
|
||||
}
|
||||
std::wstring GetConfirmLocaleResources (const std::map <std::wnstring, std::wstring> &strvalue, const std::wnstring &lang)
|
||||
{
|
||||
for (auto &it : strvalue)
|
||||
{
|
||||
if (it.first.equals (lang)) return it.second;
|
||||
}
|
||||
for (auto &it : strvalue)
|
||||
{
|
||||
if (LocaleNameCompare (it.first, lang)) return it.second;
|
||||
}
|
||||
auto rest = GetLocaleRestrictedCode (lang);
|
||||
for (auto &it : strvalue)
|
||||
{
|
||||
if (LocaleNameCompare (GetLocaleRestrictedCode (it.first), rest)) return it.second;
|
||||
}
|
||||
return L"";
|
||||
}
|
||||
std::wstring GetSuitableLocaleResources (const std::map <std::wnstring, std::wstring> &strvalue)
|
||||
{
|
||||
auto ret = GetConfirmLocaleResources (strvalue, GetComputerLocaleCodeW ());
|
||||
if (ret.empty ()) ret = GetConfirmLocaleResources (strvalue, L"en-US");
|
||||
if (ret.empty ())
|
||||
{
|
||||
if (strvalue.size () > 0) ret = strvalue.begin ()->second;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
std::wstring GetConfirmFileResources (const std::map <DWORD, std::wnstring> &input, unsigned short dpi, unsigned short contrast)
|
||||
{
|
||||
auto &output = input;
|
||||
auto get_type = [] (DWORD key) -> DWORD {
|
||||
return (key & PRI_TYPE_MASK) >> PRI_TYPE_SHIFT;
|
||||
};
|
||||
auto get_contrast = [] (DWORD key) -> DWORD {
|
||||
return (key & PRI_CONTRAST_MASK) >> PRI_CONTRAST_SHIFT;
|
||||
};
|
||||
auto get_value = [] (DWORD key) -> DWORD {
|
||||
return key & PRI_VALUE_MASK;
|
||||
};
|
||||
struct Candidate
|
||||
{
|
||||
DWORD scale;
|
||||
std::wnstring value;
|
||||
};
|
||||
std::vector <Candidate> exact_contrast;
|
||||
std::vector <Candidate> none_contrast;
|
||||
for (const auto& kv : output) {
|
||||
DWORD key = kv.first;
|
||||
DWORD type = get_type (key);
|
||||
if (type != 0) continue;
|
||||
DWORD cont = get_contrast (key);
|
||||
DWORD scale = get_value (key);
|
||||
if (StrInclude (kv.second, L"layoutdir-RTL", true)) continue;
|
||||
if (cont == contrast) {
|
||||
exact_contrast.push_back ({ scale, kv.second });
|
||||
}
|
||||
else if (cont == 0) {
|
||||
none_contrast.push_back ({ scale, kv.second });
|
||||
}
|
||||
}
|
||||
auto select_best = [dpi] (std::vector<Candidate>& candidates) -> std::wstring {
|
||||
if (candidates.empty ()) return L"";
|
||||
std::sort (candidates.begin (), candidates.end (),
|
||||
[] (const Candidate& a, const Candidate& b) {
|
||||
return a.scale < b.scale;
|
||||
});
|
||||
for (const auto &cand : candidates) {
|
||||
if (cand.scale == dpi) {
|
||||
return cand.value.c_str ();
|
||||
}
|
||||
}
|
||||
for (const auto &cand : candidates) {
|
||||
if (cand.scale > dpi) {
|
||||
return cand.value.c_str ();
|
||||
}
|
||||
}
|
||||
return candidates.back ().value.c_str ();
|
||||
};
|
||||
std::wstring result = select_best (exact_contrast);
|
||||
if (!result.empty ()) return result;
|
||||
return L"";
|
||||
}
|
||||
std::wstring GetSuitableFileResources (const std::map <DWORD, std::wnstring> &input)
|
||||
{
|
||||
std::wstring ret = GetConfirmFileResources (input, GetDPI (), 0);
|
||||
if (ret.empty ()) ret = GetConfirmFileResources (input, GetDPI (), 2);
|
||||
if (ret.empty ()) ret = GetConfirmFileResources (input, GetDPI (), 1);
|
||||
if (ret.empty ())
|
||||
{
|
||||
if (input.size () > 0)
|
||||
{
|
||||
ret = input.begin ()->second;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
void AddPriResourceName (PCSPRIFILE pFilePri, const std::vector <std::wnstring> &urilist) {}
|
||||
void FindPriResource (PCSPRIFILE pFilePri, HLPCWSTRLIST hUriList) {}
|
||||
void FindPriStringResource (PCSPRIFILE pFilePri, HLPCWSTRLIST hUriList) {}
|
||||
void FindPriPathResource (PCSPRIFILE pFilePri, HLPCWSTRLIST hPathList) {}
|
||||
LPWSTR GetPriResource (PCSPRIFILE pFilePri, LPCWSTR lpswResId)
|
||||
{
|
||||
if (strnull (lpswResId)) return NULL;
|
||||
auto resid = lpswResId ? lpswResId : L"";
|
||||
std::vector <std::wstring> ress;
|
||||
ress.push_back (lpswResId ? lpswResId : L"");
|
||||
std::map <std::wnstring, std::map <std::wnstring, std::wstring>> strRes;
|
||||
if (IsMsResourcePrefix (lpswResId))
|
||||
{
|
||||
GetPriLocaleStringResources (pFilePri, ress, strRes);
|
||||
if (strRes.size () > 0)
|
||||
{
|
||||
auto &res = strRes [std::wnstring (resid)];
|
||||
return _wcsdup (GetSuitableLocaleResources (res).c_str ());
|
||||
}
|
||||
}
|
||||
std::map <std::wnstring, std::map <DWORD, std::wnstring>> fileRes;
|
||||
GetPriScaleAndTargetSizeFileList (pFilePri, ress, fileRes);
|
||||
if (fileRes.size () > 0)
|
||||
{
|
||||
auto &fres = fileRes [std::wnstring (resid)];
|
||||
return _wcsdup (GetSuitableFileResources (fres).c_str ());
|
||||
}
|
||||
GetPriLocaleStringResources (pFilePri, ress, strRes);
|
||||
if (strRes.size () > 0)
|
||||
{
|
||||
auto &res = strRes [std::wnstring (resid)];
|
||||
return _wcsdup (GetSuitableLocaleResources (res).c_str ());
|
||||
}
|
||||
}
|
||||
LPWSTR GetPriStringResource (PCSPRIFILE pFilePri, LPCWSTR lpswUri) { return GetPriResource (pFilePri, lpswUri); }
|
||||
LPWSTR GetPriPathResource (PCSPRIFILE pFilePri, LPCWSTR lpswFilePath) { return GetPriResource (pFilePri, lpswFilePath); }
|
||||
#endif
|
||||
Binary file not shown.
326
shared/html/js/handler.js
Normal file
326
shared/html/js/handler.js
Normal file
@@ -0,0 +1,326 @@
|
||||
(function(global) {
|
||||
"use strict";
|
||||
/**
|
||||
* DomEvent 命名空间
|
||||
* @namespace DomEvent
|
||||
*/
|
||||
if (!global.DomEvent) global.DomEvent = {};
|
||||
/**
|
||||
* DOM 事件监控类型常量
|
||||
* @readonly
|
||||
* @enum {string}
|
||||
*/
|
||||
global.DomEvent.Types = Object.freeze({
|
||||
resize: "resize", // 尺寸变化
|
||||
position: "position", // 位置变化
|
||||
attribute: "attribute", // 属性变化
|
||||
child: "child", // 子节点变化
|
||||
text: "text", // 文本内容变化
|
||||
attach: "attach", // 节点附加到 DOM
|
||||
detach: "detach", // 节点从 DOM 移除
|
||||
visible: "visible", // 可见性变化
|
||||
scrollresize: "scrollresize" // 滚动尺寸变化
|
||||
});
|
||||
})(window);
|
||||
|
||||
(function(global) {
|
||||
"use strict";
|
||||
if (!global.DomEvent) global.DomEvent = {};
|
||||
if (!global.DomEvent.Types) throw new Error("DomEvent.Types must be defined first.");
|
||||
var Types = global.DomEvent.Types;
|
||||
/**
|
||||
* DOM 节点监控器
|
||||
* @namespace DomEvent.Monitor
|
||||
*/
|
||||
var Monitor = (function() {
|
||||
var registry = {}; // 存储所有节点及对应事件
|
||||
var polling = false; // 是否正在轮询
|
||||
var loopTimer = null; // 定时器
|
||||
var interval = 120; // 轮询间隔 ms
|
||||
// 初始化 registry,每种事件类型对应 Map
|
||||
Object.keys(Types).forEach(function(key) {
|
||||
registry[Types[key]] = new Map();
|
||||
});
|
||||
/**
|
||||
* 获取元素快照
|
||||
* @param {HTMLElement} el DOM 元素
|
||||
* @returns {Object} 元素快照对象
|
||||
*/
|
||||
function getSnapshot(el) {
|
||||
return {
|
||||
rect: el.getBoundingClientRect(),
|
||||
text: el.textContent,
|
||||
attr: el.attributes.length,
|
||||
child: el.childNodes.length,
|
||||
attached: document.body.contains(el),
|
||||
visible: !!(el.offsetWidth || el.offsetHeight),
|
||||
scrollWidth: el.scrollWidth,
|
||||
scrollHeight: el.scrollHeight
|
||||
};
|
||||
}
|
||||
/**
|
||||
* 判断元素快照是否发生变化
|
||||
* @param {string} type 事件类型
|
||||
* @param {Object} oldSnap 旧快照
|
||||
* @param {Object} newSnap 新快照
|
||||
* @returns {boolean} 是否发生变化
|
||||
*/
|
||||
function hasChanged(type, oldSnap, newSnap) {
|
||||
switch (type) {
|
||||
case Types.resize:
|
||||
return oldSnap.rect.width !== newSnap.rect.width ||
|
||||
oldSnap.rect.height !== newSnap.rect.height;
|
||||
case Types.position:
|
||||
return oldSnap.rect.top !== newSnap.rect.top ||
|
||||
oldSnap.rect.left !== newSnap.rect.left;
|
||||
case Types.attribute:
|
||||
return oldSnap.attr !== newSnap.attr;
|
||||
case Types.child:
|
||||
return oldSnap.child !== newSnap.child;
|
||||
case Types.text:
|
||||
return oldSnap.text !== newSnap.text;
|
||||
case Types.attach:
|
||||
return !oldSnap.attached && newSnap.attached;
|
||||
case Types.detach:
|
||||
return oldSnap.attached && !newSnap.attached;
|
||||
case Types.visible:
|
||||
return oldSnap.visible !== newSnap.visible;
|
||||
case Types.scrollresize:
|
||||
return oldSnap.scrollWidth !== newSnap.scrollWidth ||
|
||||
oldSnap.scrollHeight !== newSnap.scrollHeight;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* 执行轮询检测
|
||||
* @private
|
||||
*/
|
||||
function poll() {
|
||||
Object.keys(registry).forEach(function(type) {
|
||||
registry[type].forEach(function(data, el) {
|
||||
if (!document.body.contains(el)) {
|
||||
registry[type].delete(el);
|
||||
return;
|
||||
}
|
||||
var newSnap = getSnapshot(el);
|
||||
if (hasChanged(type, data.snapshot, newSnap)) {
|
||||
data.snapshot = newSnap;
|
||||
data.handlers.forEach(function(handler) {
|
||||
try {
|
||||
handler.call(el, {
|
||||
type: type,
|
||||
rect: newSnap.rect,
|
||||
text: newSnap.text,
|
||||
visible: newSnap.visible
|
||||
});
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 启动轮询
|
||||
* @private
|
||||
*/
|
||||
function start() {
|
||||
if (polling) return;
|
||||
polling = true;
|
||||
|
||||
function loop() {
|
||||
poll();
|
||||
loopTimer = setTimeout(loop, interval);
|
||||
}
|
||||
loop();
|
||||
}
|
||||
/**
|
||||
* 检查是否有节点存在,空则停止轮询
|
||||
* @private
|
||||
*/
|
||||
function stopIfEmpty() {
|
||||
var hasAny = Object.keys(registry).some(function(type) {
|
||||
return registry[type].size > 0;
|
||||
});
|
||||
if (!hasAny) {
|
||||
clearTimeout(loopTimer);
|
||||
polling = false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 监听指定元素的事件
|
||||
* @param {HTMLElement} el DOM 元素
|
||||
* @param {string} type 事件类型
|
||||
* @param {Function} handler 回调函数
|
||||
*/
|
||||
function observe(el, type, handler) {
|
||||
if (!registry[type])
|
||||
throw new Error("Unsupported type: " + type);
|
||||
|
||||
var map = registry[type];
|
||||
if (!map.has(el)) {
|
||||
map.set(el, {
|
||||
snapshot: getSnapshot(el),
|
||||
handlers: new Set()
|
||||
});
|
||||
}
|
||||
map.get(el).handlers.add(handler);
|
||||
start();
|
||||
}
|
||||
/**
|
||||
* 移除指定元素的事件监听
|
||||
* @param {HTMLElement} el DOM 元素
|
||||
* @param {string} type 事件类型
|
||||
* @param {Function} [handler] 回调函数,可选,未指定则移除所有
|
||||
*/
|
||||
function remove(el, type, handler) {
|
||||
if (!registry[type]) return;
|
||||
var map = registry[type];
|
||||
if (!map.has(el)) return;
|
||||
|
||||
if (handler) {
|
||||
map.get(el).handlers.delete(handler);
|
||||
} else {
|
||||
map.delete(el);
|
||||
}
|
||||
|
||||
if (map.has(el) && map.get(el).handlers.size === 0) {
|
||||
map.delete(el);
|
||||
}
|
||||
stopIfEmpty();
|
||||
}
|
||||
/**
|
||||
* 移除元素的所有事件监听
|
||||
* @param {HTMLElement} el DOM 元素
|
||||
*/
|
||||
function removeAll(el) {
|
||||
Object.keys(registry).forEach(function(type) {
|
||||
registry[type].delete(el);
|
||||
});
|
||||
stopIfEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空所有监听
|
||||
*/
|
||||
function clear() {
|
||||
Object.keys(registry).forEach(function(type) {
|
||||
registry[type].clear();
|
||||
});
|
||||
stopIfEmpty();
|
||||
}
|
||||
return {
|
||||
observe: observe,
|
||||
remove: remove,
|
||||
removeAll: removeAll,
|
||||
clear: clear
|
||||
};
|
||||
})();
|
||||
global.DomEvent.Monitor = Monitor;
|
||||
})(window);
|
||||
(function(global) {
|
||||
"use strict";
|
||||
if (!global.DomEvent) global.DomEvent = {};
|
||||
/**
|
||||
* DOM 事件工具方法
|
||||
* @namespace DomEvent.Utils
|
||||
*/
|
||||
var Utils = {};
|
||||
var eventStore = new WeakMap();
|
||||
/**
|
||||
* 添加原生事件监听
|
||||
* @param {HTMLElement} el DOM 元素
|
||||
* @param {string} type 事件类型
|
||||
* @param {Function} handler 回调函数
|
||||
* @param {boolean} [capture=false] 是否捕获
|
||||
*/
|
||||
Utils.add = function(el, type, handler, capture) {
|
||||
capture = !!capture;
|
||||
el.addEventListener(type, handler, capture);
|
||||
if (!eventStore.has(el)) eventStore.set(el, []);
|
||||
eventStore.get(el).push({
|
||||
type: type,
|
||||
handler: handler,
|
||||
capture: capture
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 移除原生事件监听
|
||||
* @param {HTMLElement} el DOM 元素
|
||||
* @param {string} type 事件类型
|
||||
* @param {Function} handler 回调函数
|
||||
* @param {boolean} [capture=false] 是否捕获
|
||||
*/
|
||||
Utils.remove = function(el, type, handler, capture) {
|
||||
capture = !!capture;
|
||||
el.removeEventListener(type, handler, capture);
|
||||
if (!eventStore.has(el)) return;
|
||||
|
||||
var list = eventStore.get(el);
|
||||
eventStore.set(list.filter(function(item) {
|
||||
return !(item.type === type && item.handler === handler);
|
||||
}));
|
||||
};
|
||||
/**
|
||||
* 移除元素的所有事件监听
|
||||
* @param {HTMLElement} el DOM 元素
|
||||
*/
|
||||
Utils.removeAll = function(el) {
|
||||
if (!eventStore.has(el)) return;
|
||||
var list = eventStore.get(el);
|
||||
list.forEach(function(item) {
|
||||
el.removeEventListener(item.type, item.handler, item.capture);
|
||||
});
|
||||
eventStore.delete(el);
|
||||
};
|
||||
/**
|
||||
* 清空所有事件监听
|
||||
*/
|
||||
Utils.clearAll = function() {
|
||||
eventStore = new WeakMap();
|
||||
};
|
||||
/**
|
||||
* 节流函数
|
||||
* @param {Function} fn 原函数
|
||||
* @param {Number} delay 节流间隔 ms
|
||||
* @returns {Function} 包装后的函数
|
||||
*/
|
||||
Utils.throttle = function(fn, delay) {
|
||||
var last = 0;
|
||||
var timer = null;
|
||||
return function() {
|
||||
var context = this;
|
||||
var args = arguments;
|
||||
var now = Date.now();
|
||||
if (now - last >= delay) {
|
||||
last = now;
|
||||
fn.apply(context, args);
|
||||
} else if (!timer) {
|
||||
timer = setTimeout(function() {
|
||||
last = Date.now();
|
||||
timer = null;
|
||||
fn.apply(context, args);
|
||||
}, delay - (now - last));
|
||||
}
|
||||
};
|
||||
};
|
||||
/**
|
||||
* 防抖函数
|
||||
* @param {Function} fn 原函数
|
||||
* @param {Number} delay 防抖延迟 ms
|
||||
* @returns {Function} 包装后的函数
|
||||
*/
|
||||
Utils.debounce = function(fn, delay) {
|
||||
var timer = null;
|
||||
return function() {
|
||||
var context = this;
|
||||
var args = arguments;
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(function() {
|
||||
fn.apply(context, args);
|
||||
}, delay);
|
||||
};
|
||||
};
|
||||
global.DomEvent.Utils = Utils;
|
||||
})(window);
|
||||
@@ -127,21 +127,24 @@
|
||||
|
||||
function initLoaderPage() {
|
||||
var page = document.getElementById("page-load");
|
||||
var prefixs = ["ins", "reg", "sta"];
|
||||
var prefixs = ["ins", "reg", "sta", "upd"];
|
||||
var opdict = {
|
||||
ins: Package.manager.add,
|
||||
reg: Package.manager.register,
|
||||
sta: Package.manager.stage
|
||||
sta: Package.manager.stage,
|
||||
upd: Package.manager.update
|
||||
};
|
||||
var ingdict = {
|
||||
ins: strres.get("MANAGER_LOAD_INSTALL_ING"),
|
||||
reg: strres.get("MANAGER_LOAD_REGISTER_ING"),
|
||||
sta: strres.get("MANAGER_LOAD_STAGE_ING")
|
||||
sta: strres.get("MANAGER_LOAD_STAGE_ING"),
|
||||
upd: strres.get("MANAGER_LOAD_UPDATE_ING")
|
||||
};
|
||||
var sdict = {
|
||||
ins: strres.get("MANAGER_LOAD_INSTALL_SUCCEED"),
|
||||
reg: strres.get("MANAGER_LOAD_REGISTER_SUCCEED"),
|
||||
sta: strres.get("MANAGER_LOAD_STAGE_SUCCEED")
|
||||
sta: strres.get("MANAGER_LOAD_STAGE_SUCCEED"),
|
||||
upd: strres.get("MANAGER_LOAD_UPDATE_SUCCEED")
|
||||
}
|
||||
var explorer = external.Storage.Explorer;
|
||||
prefixs.forEach(function(prefix) {
|
||||
@@ -195,7 +198,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
if (prefix === "ins" || prefix === "sta") explorer.file(
|
||||
if (prefix === "ins" || prefix === "sta" || prefix === "upd") explorer.file(
|
||||
external.String.format("{0}|{1}|{2}|{3}",
|
||||
strres.get("MANAGER_LOAD_INS_OR_STA_FILTERDISPLAY"),
|
||||
"*.appx;*.appxbundle;*.msix;*.msixbundle",
|
||||
|
||||
@@ -225,39 +225,55 @@
|
||||
data.Properties.LogoBase64 === null || data.Properties.LogoBase64 === "" || data.Properties.LogoBase64 === void 0
|
||||
) {
|
||||
promises.push(function(item, arr) {
|
||||
var ispush = false;
|
||||
return Package.reader.readFromInstallLocation(item.InstallLocation, true).then(function(result) {
|
||||
try {
|
||||
arr.push(processData(result.json, item));
|
||||
ispush = true;
|
||||
} catch (e) {
|
||||
if (ispush) return;
|
||||
item.BackgroundColor = "transparent";
|
||||
arr.push(item);
|
||||
ispush = true;
|
||||
}
|
||||
}, function(result) {
|
||||
try {
|
||||
if (ispush) return;
|
||||
arr.push(processData(result.json, item));
|
||||
ispush = true;
|
||||
} catch (e) {
|
||||
if (ispush) return;
|
||||
item.BackgroundColor = "transparent";
|
||||
arr.push(item);
|
||||
ispush = true;
|
||||
}
|
||||
});
|
||||
}(data, newDatas));
|
||||
} else {
|
||||
promises.push(function(item, arr) {
|
||||
var ispush = false;
|
||||
return Package.reader.readFromInstallLocation(item.InstallLocation, false).then(function(result) {
|
||||
try {
|
||||
item.BackgroundColor = result.json.applications[0].BackgroundColor;
|
||||
arr.push(item);
|
||||
ispush = true;
|
||||
} catch (e) {
|
||||
if (ispush) return;
|
||||
item.BackgroundColor = "transparent";
|
||||
arr.push(item);
|
||||
ispush = true;
|
||||
}
|
||||
}, function(result) {
|
||||
try {
|
||||
if (ispush) return;
|
||||
item.BackgroundColor = result.json.applications[0].BackgroundColor;
|
||||
arr.push(item);
|
||||
ispush = true;
|
||||
} catch (e) {
|
||||
if (ispush) return;
|
||||
item.BackgroundColor = "transparent";
|
||||
arr.push(item);
|
||||
ispush = true;
|
||||
}
|
||||
});
|
||||
}(data, newDatas));
|
||||
@@ -383,6 +399,15 @@
|
||||
set.getKey("PackageManager:ShowFrameworks").set(showFrameworks.checked);
|
||||
});
|
||||
refreshButton.addEventListener("click", refreshAppList2);
|
||||
var appShellButton = new AppBar.Command();
|
||||
appShellButton.icon = "";
|
||||
appShellButton.label = "Applications";
|
||||
appShellButton.element.style.display = "none";
|
||||
appShellButton.addEventListener("click", function() {
|
||||
appbarControl.hide();
|
||||
external.Process.run("shell:::{4234d49b-0245-4df3-b780-3893943456e1}", "", 1, false, "");
|
||||
});
|
||||
appbarControl.add(appShellButton);
|
||||
appbarControl.add(refreshButton);
|
||||
refreshAppList2();
|
||||
var appDetailPage = document.getElementById("page-appinfo");
|
||||
|
||||
@@ -410,6 +410,8 @@
|
||||
if (pkgSupportVer.major == 6 && pkgSupportVer.minor == 3 && pkgSupportVer.build == 1) {
|
||||
if (pkginfo.identity.architecture & (4 | 8)) {
|
||||
ret.osminversionSupport = true;
|
||||
} else if (systemSupportVer.major >= 10) {
|
||||
ret.osminversionSupport = false;
|
||||
}
|
||||
} else {
|
||||
ret.osminversionSupport = true;
|
||||
|
||||
@@ -1,11 +1,51 @@
|
||||
/// <reference path="//Microsoft.WinJS.2.0/js/base.js" />
|
||||
(function(global) {
|
||||
"use strict";
|
||||
|
||||
function PromisePolyfill(pfExecutor) {
|
||||
/**
|
||||
* PromisePolyfill 构造函数。
|
||||
*
|
||||
* 模拟 WinJS.Promise 的构造形式:
|
||||
* new PromisePolyfill(init, oncancel)
|
||||
*
|
||||
* @constructor
|
||||
* @param {function(function(any):void,function(any):void,function(any):void):void} pfInit
|
||||
* Promise 初始化函数。
|
||||
* 该函数在 Promise 创建时立即执行,并接收三个回调:
|
||||
* - complete(value) : 完成 Promise
|
||||
* - error(reason) : 使 Promise 失败
|
||||
* - progress(value) : 发送进度通知(当前实现为占位)
|
||||
*
|
||||
* @param {function():void} [pfOnCancel]
|
||||
* Promise 取消回调。当调用 promise.cancel() 时执行。
|
||||
*
|
||||
* @example
|
||||
* var p = new PromisePolyfill(
|
||||
* function (complete, error, progress) {
|
||||
* setTimeout(function () {
|
||||
* complete("done");
|
||||
* }, 1000);
|
||||
* },
|
||||
* function () {
|
||||
* console.log("Promise canceled");
|
||||
* }
|
||||
* );
|
||||
*/
|
||||
function PromisePolyfill(pfInit, pfOnCancel) {
|
||||
/// <param name="pfInit" type="Function">
|
||||
/// Promise 初始化函数。
|
||||
/// 形参签名:
|
||||
/// function(
|
||||
/// complete : function(any):void,
|
||||
/// error : function(any):void,
|
||||
/// progress : function(any):void
|
||||
/// )
|
||||
/// </param>
|
||||
/// <param name="pfOnCancel" type="Function" optional="true">
|
||||
/// Promise 取消回调函数。当 promise.cancel() 被调用时执行。
|
||||
/// </param>
|
||||
var swState = "pending"; // "fulfilled" | "rejected"
|
||||
var vValue = undefined;
|
||||
var aHandlers = [];
|
||||
var pfOnCancel = null;
|
||||
|
||||
function invokeHandlers() {
|
||||
if (swState === "pending") return;
|
||||
@@ -20,7 +60,11 @@
|
||||
aHandlers.push(hHandler);
|
||||
return;
|
||||
}
|
||||
var pfCallback = swState === "fulfilled" ? hHandler.onFulfilled : hHandler.onRejected;
|
||||
|
||||
var pfCallback = swState === "fulfilled" ?
|
||||
hHandler.onFulfilled :
|
||||
hHandler.onRejected;
|
||||
|
||||
if (!pfCallback) {
|
||||
if (swState === "fulfilled") {
|
||||
hHandler.resolve(vValue);
|
||||
@@ -29,6 +73,7 @@
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
var vResult = pfCallback(vValue);
|
||||
hHandler.resolve(vResult);
|
||||
@@ -39,7 +84,10 @@
|
||||
|
||||
function resolve(vResult) {
|
||||
try {
|
||||
if (vResult === self) throw new TypeError("A promise cannot be resolved with itself.");
|
||||
|
||||
if (vResult === self)
|
||||
throw new TypeError("A promise cannot be resolved with itself.");
|
||||
|
||||
if (vResult && (typeof vResult === "object" || typeof vResult === "function")) {
|
||||
var pfThen = vResult.then;
|
||||
if (typeof pfThen === "function") {
|
||||
@@ -47,9 +95,11 @@
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
swState = "fulfilled";
|
||||
vValue = vResult;
|
||||
invokeHandlers();
|
||||
|
||||
} catch (ex) {
|
||||
reject(ex);
|
||||
}
|
||||
@@ -58,56 +108,105 @@
|
||||
function reject(vReason) {
|
||||
swState = "rejected";
|
||||
vValue = vReason;
|
||||
|
||||
if (typeof PromisePolyfill.onerror === "function") {
|
||||
PromisePolyfill.onerror(vReason);
|
||||
}
|
||||
|
||||
invokeHandlers();
|
||||
}
|
||||
|
||||
// WinJS Promise progress(当前仅占位)
|
||||
function progress(vProgress) {
|
||||
// 当前 polyfill 未实现 progress 传播
|
||||
}
|
||||
|
||||
var self = this;
|
||||
|
||||
try {
|
||||
pfExecutor(resolve, reject, function(pfCancel) {
|
||||
pfOnCancel = pfCancel;
|
||||
});
|
||||
if (typeof pfInit === "function") {
|
||||
pfInit(resolve, reject, progress);
|
||||
}
|
||||
} catch (ex) {
|
||||
reject(ex);
|
||||
}
|
||||
|
||||
this.then = function(pfOnFulfilled, pfOnRejected) {
|
||||
|
||||
return new PromisePolyfill(function(resolve, reject) {
|
||||
|
||||
handle({
|
||||
onFulfilled: pfOnFulfilled,
|
||||
onRejected: pfOnRejected,
|
||||
resolve: resolve,
|
||||
reject: reject
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
this["catch"] = function(pfOnRejected) {
|
||||
return this.then(null, pfOnRejected);
|
||||
};
|
||||
|
||||
this.done = function(pfOnFulfilled, pfOnRejected) {
|
||||
|
||||
this.then(pfOnFulfilled, pfOnRejected)["catch"](function(ex) {
|
||||
setTimeout(function() { throw ex; }, 0);
|
||||
|
||||
setTimeout(function() {
|
||||
throw ex;
|
||||
}, 0);
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
this.cancel = function() {
|
||||
|
||||
if (pfOnCancel) {
|
||||
try { pfOnCancel(); } catch (ex) {}
|
||||
try {
|
||||
pfOnCancel();
|
||||
} catch (ex) {}
|
||||
}
|
||||
|
||||
reject(new Error("Promise was canceled"));
|
||||
|
||||
};
|
||||
|
||||
this._oncancel = pfOnCancel;
|
||||
this._state = swState;
|
||||
this._value = vValue;
|
||||
}
|
||||
/**
|
||||
* 检查对象是否为 PromisePolyfill 实例
|
||||
* @param {any} vObj 待检查对象
|
||||
* @returns {boolean} 是否为 PromisePolyfill 实例
|
||||
*/
|
||||
PromisePolyfill.is = function(vObj) {
|
||||
return vObj instanceof PromisePolyfill;
|
||||
};
|
||||
/**
|
||||
* 创建一个已完成的 PromisePolyfill
|
||||
* @param {any} vValue 要返回的值
|
||||
* @returns {PromisePolyfill} 已完成的 PromisePolyfill
|
||||
*/
|
||||
PromisePolyfill.resolve = function(vValue) {
|
||||
return new PromisePolyfill(function(resolve) { resolve(vValue); });
|
||||
};
|
||||
/**
|
||||
* 创建一个已拒绝的 PromisePolyfill
|
||||
* @param {any} vReason 拒绝原因
|
||||
* @returns {PromisePolyfill} 已拒绝的 PromisePolyfill
|
||||
*/
|
||||
PromisePolyfill.reject = function(vReason) {
|
||||
return new PromisePolyfill(function(resolve, reject) { reject(vReason); });
|
||||
};
|
||||
/**
|
||||
* 等待所有 Promise 完成
|
||||
* @param {Array<PromisePolyfill|any>} aPromises 待处理的 Promise 或普通值数组
|
||||
* @returns {PromisePolyfill<Array<any>>} 返回包含所有结果的 Promise
|
||||
*/
|
||||
PromisePolyfill.all = function(aPromises) {
|
||||
return new PromisePolyfill(function(resolve, reject) {
|
||||
var nRemaining = aPromises.length;
|
||||
@@ -126,6 +225,11 @@
|
||||
}
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 竞速 Promise,谁先完成就返回谁的结果
|
||||
* @param {Array<PromisePolyfill|any>} aPromises 待处理的 Promise 或普通值数组
|
||||
* @returns {PromisePolyfill<any>} 最先完成的 Promise 的值
|
||||
*/
|
||||
PromisePolyfill.race = function(aPromises) {
|
||||
return new PromisePolyfill(function(resolve, reject) {
|
||||
for (var i = 0; i < aPromises.length; i++) {
|
||||
@@ -133,9 +237,19 @@
|
||||
}
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Promise join,同 all
|
||||
* @param {Array<PromisePolyfill|any>} aPromises 待处理的 Promise 或普通值数组
|
||||
* @returns {PromisePolyfill<Array<any>>} 返回包含所有结果的 Promise
|
||||
*/
|
||||
PromisePolyfill.join = function(aPromises) {
|
||||
return PromisePolyfill.all(aPromises);
|
||||
};
|
||||
/**
|
||||
* 任意 Promise 完成即返回
|
||||
* @param {Array<PromisePolyfill|any>} aPromises 待处理的 Promise 或普通值数组
|
||||
* @returns {PromisePolyfill<any>} 最先完成的 Promise 的值,若都失败则 reject 一个错误数组
|
||||
*/
|
||||
PromisePolyfill.any = function(aPromises) {
|
||||
return new PromisePolyfill(function(resolve, reject) {
|
||||
var nRemaining = aPromises.length;
|
||||
@@ -156,6 +270,12 @@
|
||||
}
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 给 Promise 添加超时处理
|
||||
* @param {PromisePolyfill|any} pPromise 要处理的 Promise
|
||||
* @param {number} nMilliseconds 超时时间(毫秒)
|
||||
* @returns {PromisePolyfill<any>} 超时或原 Promise 完成后 resolve/reject
|
||||
*/
|
||||
PromisePolyfill.timeout = function(pPromise, nMilliseconds) {
|
||||
return new PromisePolyfill(function(resolve, reject) {
|
||||
var hTimer = setTimeout(function() {
|
||||
@@ -179,6 +299,12 @@
|
||||
PromisePolyfill.wrapError = function(vError) {
|
||||
return PromisePolyfill.reject(vError);
|
||||
};
|
||||
/**
|
||||
* 将数组的每个值依次执行回调
|
||||
* @param {Array<any>} aValues 数组
|
||||
* @param {function(any, number): any | PromisePolyfill<any>} pfCallback 回调函数
|
||||
* @returns {PromisePolyfill<Array<any>>} 所有回调完成的结果数组
|
||||
*/
|
||||
PromisePolyfill.thenEach = function(aValues, pfCallback) {
|
||||
var aPromises = [];
|
||||
for (var i = 0; i < aValues.length; i++) {
|
||||
@@ -187,10 +313,20 @@
|
||||
return PromisePolyfill.all(aPromises);
|
||||
};
|
||||
var hListeners = {};
|
||||
/**
|
||||
* 全局事件注册
|
||||
* @param {string} sType 事件类型
|
||||
* @param {function(any):void} pfHandler 回调函数
|
||||
*/
|
||||
PromisePolyfill.addEventListener = function(sType, pfHandler) {
|
||||
if (!hListeners[sType]) hListeners[sType] = [];
|
||||
hListeners[sType].push(pfHandler);
|
||||
};
|
||||
/**
|
||||
* 全局事件移除
|
||||
* @param {string} sType 事件类型
|
||||
* @param {function(any):void} pfHandler 回调函数
|
||||
*/
|
||||
PromisePolyfill.removeEventListener = function(sType, pfHandler) {
|
||||
if (!hListeners[sType]) return;
|
||||
var aList = hListeners[sType];
|
||||
@@ -201,6 +337,11 @@
|
||||
}
|
||||
}
|
||||
};
|
||||
/**
|
||||
* 全局事件派发
|
||||
* @param {string} sType 事件类型
|
||||
* @param {any} vDetail 事件详情
|
||||
*/
|
||||
PromisePolyfill.dispatchEvent = function(sType, vDetail) {
|
||||
if (!hListeners[sType]) return;
|
||||
var aList = hListeners[sType].slice();
|
||||
@@ -210,6 +351,142 @@
|
||||
};
|
||||
PromisePolyfill.supportedForProcessing = true;
|
||||
PromisePolyfill.onerror = null;
|
||||
/**
|
||||
* 创建一个在指定毫秒数后完成的 Promise。
|
||||
*
|
||||
* @param {number} nMilliseconds
|
||||
* 延迟时间(毫秒)。
|
||||
*
|
||||
* @returns {PromisePolyfill}
|
||||
* 返回 Promise,在延迟结束后完成。
|
||||
*
|
||||
* @example
|
||||
* WinJS.Promise.delay(500).then(function () {
|
||||
* console.log("500ms elapsed");
|
||||
* });
|
||||
*/
|
||||
PromisePolyfill.delay = function(nMilliseconds) {
|
||||
/// <param name="nMilliseconds" type="Number">
|
||||
/// 延迟时间(毫秒)。
|
||||
/// </param>
|
||||
/// <returns type="PromisePolyfill"/>
|
||||
var hTimer = null;
|
||||
return new PromisePolyfill(
|
||||
function(complete, error, progress) {
|
||||
hTimer = setTimeout(function() {
|
||||
complete();
|
||||
}, nMilliseconds);
|
||||
},
|
||||
function() {
|
||||
if (hTimer !== null) {
|
||||
clearTimeout(hTimer);
|
||||
hTimer = null;
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
/**
|
||||
* 创建一个循环执行的 Promise,类似 setInterval。
|
||||
*
|
||||
* 该 Promise 不会自动完成,除非:
|
||||
* 1. 调用 promise.cancel()
|
||||
* 2. callback 抛出异常
|
||||
*
|
||||
* @param {function(): (any|PromisePolyfill|WinJS.Promise)} pfCallback
|
||||
* 每次循环执行的回调函数。可以返回 Promise。
|
||||
*
|
||||
* @param {number} nDelay
|
||||
* 每次执行之间的间隔时间(毫秒)。
|
||||
*
|
||||
* @returns {PromisePolyfill}
|
||||
* 返回 Promise 对象,可通过 cancel() 停止循环。
|
||||
*
|
||||
* @example
|
||||
* var p = WinJS.Promise.interval(function () {
|
||||
* console.log("tick");
|
||||
* }, 1000);
|
||||
*
|
||||
* setTimeout(function () {
|
||||
* p.cancel();
|
||||
* }, 5000);
|
||||
*/
|
||||
PromisePolyfill.interval = function(pfCallback, nDelay) {
|
||||
|
||||
/// <param name="pfCallback" type="Function">
|
||||
/// 每次间隔执行的函数。可以返回 Promise。
|
||||
/// </param>
|
||||
/// <param name="nDelay" type="Number">
|
||||
/// 执行间隔(毫秒)。
|
||||
/// </param>
|
||||
/// <returns type="PromisePolyfill"/>
|
||||
|
||||
var bCanceled = false;
|
||||
|
||||
return new PromisePolyfill(
|
||||
|
||||
function(complete, error, progress) {
|
||||
|
||||
function loop() {
|
||||
|
||||
if (bCanceled) {
|
||||
complete();
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
var vResult = pfCallback();
|
||||
|
||||
if (vResult && typeof vResult.then === "function") {
|
||||
|
||||
vResult.then(waitNext, error);
|
||||
|
||||
} else {
|
||||
|
||||
waitNext();
|
||||
|
||||
}
|
||||
|
||||
} catch (ex) {
|
||||
|
||||
error(ex);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function waitNext() {
|
||||
|
||||
if (bCanceled) {
|
||||
complete();
|
||||
return;
|
||||
}
|
||||
|
||||
setTimeout(loop, nDelay);
|
||||
|
||||
}
|
||||
|
||||
loop();
|
||||
|
||||
},
|
||||
|
||||
function() {
|
||||
|
||||
bCanceled = true;
|
||||
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
};
|
||||
if (typeof global.Promise !== "undefined") {
|
||||
global.Promise.delay = PromisePolyfill.delay;
|
||||
global.Promise.interval = PromisePolyfill.interval;
|
||||
}
|
||||
if (typeof global.WinJS !== "undefined" && typeof global.WinJS.Promise !== "undefined") {
|
||||
global.WinJS.Promise.delay = PromisePolyfill.delay;
|
||||
global.WinJS.Promise.interval = PromisePolyfill.interval;
|
||||
}
|
||||
if (typeof global.Promise !== "undefined") {
|
||||
var p = global.Promise;
|
||||
if (!p.join) p.join = p.all;
|
||||
|
||||
33
shared/html/js/rdinit.js
Normal file
33
shared/html/js/rdinit.js
Normal file
@@ -0,0 +1,33 @@
|
||||
(function(global) {
|
||||
var strres = external.StringResources;
|
||||
var conf = external.Config.current;
|
||||
var set = conf.getSection("Settings");
|
||||
|
||||
function createLocalizedCompare(locale) {
|
||||
return function(a, b) {
|
||||
a = a || "";
|
||||
b = b || "";
|
||||
|
||||
return a.localeCompare(b, locale, {
|
||||
numeric: true, // 2 < 10
|
||||
sensitivity: "base" // 不区分大小写 / 重音
|
||||
});
|
||||
};
|
||||
}
|
||||
var pagemgr = new PageManager();
|
||||
OnLoad.add(function() {
|
||||
var mgr = Package.manager;
|
||||
var nstr = Bridge.NString;
|
||||
var datasrc = new DataView.DataSource();
|
||||
datasrc.setKeySelector(function(item) {
|
||||
if (item === null || item === void 0) return null;
|
||||
return Bridge.String.tolower(Bridge.String.trim(item.Identity.FullName));
|
||||
});
|
||||
var themeColor = Bridge.UI.themeColor;
|
||||
var appbar = document.getElementById("appBar");
|
||||
var appbarControl = new AppBar.AppBar(appbar);
|
||||
appbarControl.enabled = false;
|
||||
pagemgr.register("reader", document.getElementById("tag-reader"), document.getElementById("page-reader"));
|
||||
pagemgr.go("reader");
|
||||
});
|
||||
})(this);
|
||||
110
shared/html/libs/contentdlg/contentdlg.css
Normal file
110
shared/html/libs/contentdlg/contentdlg.css
Normal file
@@ -0,0 +1,110 @@
|
||||
.win-contentdialog {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
transition: all 0.15s linear;
|
||||
opacity: 1;
|
||||
z-index: 100;
|
||||
}
|
||||
.win-contentdialog.hide {
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
.win-contentdialog .win-contentdialog-dialog {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 20px 0;
|
||||
background-color: rgb(31, 0, 104);
|
||||
transition: all 0.5s cubic-bezier(0.1, 0.9, 0.2, 1);
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
.win-contentdialog .win-contentdialog-title {
|
||||
font-size: 20pt;
|
||||
font-weight: normal;
|
||||
padding: 0 172px;
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.win-contentdialog .win-contentdialog-content {
|
||||
padding: 0 172px;
|
||||
overflow-y: auto;
|
||||
box-sizing: border-box;
|
||||
max-height: calc(100vh - 200px);
|
||||
margin: 10px 0 20px 0;
|
||||
}
|
||||
|
||||
.win-contentdialog .win-contentdialog-commands {
|
||||
padding: 0 172px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
align-content: flex-start;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.win-contentdialog .win-contentdialog-commands > button {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.win-contentdialog .win-contentdialog-content p {
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.win-contentdialog .win-contentdialog-content dl dt,
|
||||
.win-contentdialog .win-contentdialog-content dl dd {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
vertical-align: middle;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.win-contentdialog .win-contentdialog-content dl {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
box-sizing: border-box;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.win-contentdialog .win-contentdialog-content dl dt {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
text-align: left;
|
||||
padding-right: 8px;
|
||||
}
|
||||
|
||||
.win-contentdialog .win-contentdialog-content dl dd {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.win-contentdialog .win-contentdialog-content dl dd * {
|
||||
max-width: 100%;
|
||||
}
|
||||
.win-contentdialog-dialog-template {
|
||||
display: none;
|
||||
}
|
||||
.win-contentdialog .win-contentdialog-content .win-contentdialog-dialog-template {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.win-ui-light .win-contentdialog .win-contentdialog-dialog,
|
||||
.win-contentdialog.win-ui-light .win-contentdialog-dialog {
|
||||
background-color: white;
|
||||
}
|
||||
.win-ui-dark .win-contentdialog .win-contentdialog-dialog,
|
||||
.win-contentdialog.win-ui-dark .win-contentdialog-dialog {
|
||||
background-color: rgb(31, 0, 104);
|
||||
}
|
||||
315
shared/html/libs/contentdlg/contentdlg.js
Normal file
315
shared/html/libs/contentdlg/contentdlg.js
Normal file
@@ -0,0 +1,315 @@
|
||||
/// <reference path="//Microsoft.WinJS.2.0/js/base.js" />
|
||||
/// <reference path="//Microsoft.WinJS.2.0/js/ui.js" />
|
||||
|
||||
(function (global) {
|
||||
"use strict";
|
||||
|
||||
if (typeof global.WinJS === "undefined" || !global.WinJS) global.WinJS = {};
|
||||
if (typeof global.WinJS.UI === "undefined" || !global.WinJS.UI) global.WinJS.UI = {};
|
||||
|
||||
// 事件混入
|
||||
function mixEventMixin(target) {
|
||||
var eventMixin = WinJS.Utilities.eventMixin;
|
||||
target.addEventListener = eventMixin.addEventListener;
|
||||
target.removeEventListener = eventMixin.removeEventListener;
|
||||
target.dispatchEvent = eventMixin.dispatchEvent;
|
||||
target._listeners = target._listeners || {};
|
||||
}
|
||||
|
||||
/**
|
||||
* 表示 ContentDialog 中的一个按钮命令。
|
||||
* @class
|
||||
* @param {string} label 按钮显示文本
|
||||
* @param {function(Event=): (boolean|void)} [handler] 按钮点击处理函数
|
||||
* @param {string} [commandId] 命令唯一标识
|
||||
*/
|
||||
function ContentDialogCommand(label, handler, commandId) {
|
||||
this.label = label;
|
||||
this.handler = handler;
|
||||
this.commandId = commandId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 模拟 WinRT ContentDialog 的对话框
|
||||
* @class
|
||||
* @memberof WinJS.UI
|
||||
* @param {HTMLElement} element 容器
|
||||
* @param {Object} [options] 初始化选项
|
||||
*/
|
||||
function ContentDialog(element, options) {
|
||||
var container = element;
|
||||
container.innerHTML = toStaticHTML('<div class="win-contentdialog-dialog"><div class="win-contentdialog-title"></div><div class="win-contentdialog-content"></div><div class="win-contentdialog-commands"></div></div>');
|
||||
container.classList.add("win-contentdialog");
|
||||
container.classList.add("hide");
|
||||
|
||||
var title = container.querySelector(".win-contentdialog-title");
|
||||
var content = container.querySelector(".win-contentdialog-content");
|
||||
var commandContainer = container.querySelector(".win-contentdialog-commands");
|
||||
var _isdisposed = false;
|
||||
|
||||
mixEventMixin(this);
|
||||
var self = this;
|
||||
|
||||
// 命令集合
|
||||
this._commands = new WinJS.Binding.List();
|
||||
var _showAsyncPromise = null;
|
||||
var _showAsyncResolve = null;
|
||||
|
||||
// 渲染按钮
|
||||
function renderCommands() {
|
||||
while (commandContainer.firstChild) {
|
||||
commandContainer.removeChild(commandContainer.firstChild);
|
||||
}
|
||||
self._commands.forEach(function (cmd, index) {
|
||||
var btn = document.createElement("button");
|
||||
btn.textContent = cmd.label;
|
||||
btn.setAttribute("data-command-id", cmd.commandId || index);
|
||||
|
||||
btn.addEventListener("click", function (evt) {
|
||||
handleCommandClick(cmd, evt);
|
||||
});
|
||||
|
||||
commandContainer.appendChild(btn);
|
||||
});
|
||||
if (self._commands.length > 0) {
|
||||
self.primaryCommandIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// 按钮点击处理
|
||||
function handleCommandClick(cmd, evt) {
|
||||
var result;
|
||||
|
||||
if (typeof cmd.handler === "function") {
|
||||
result = cmd.handler.call(self, evt);
|
||||
}
|
||||
|
||||
function complete() {
|
||||
self.hide().then(function () {
|
||||
if (_showAsyncResolve) {
|
||||
_showAsyncResolve(cmd.commandId);
|
||||
clearAsyncState();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// handler 返回 false → 不关闭
|
||||
if (result === false) return;
|
||||
|
||||
// handler 返回 Promise → 等待
|
||||
if (result && typeof result.then === "function") {
|
||||
result.then(complete);
|
||||
return;
|
||||
}
|
||||
|
||||
complete();
|
||||
}
|
||||
|
||||
function clearAsyncState() {
|
||||
_showAsyncPromise = null;
|
||||
_showAsyncResolve = null;
|
||||
}
|
||||
|
||||
// 可取消事件
|
||||
function createCancelableEvent(type) {
|
||||
var defaultPrevented = false;
|
||||
return {
|
||||
type: type,
|
||||
target: self,
|
||||
preventDefault: function () { defaultPrevented = true; },
|
||||
get defaultPrevented() { return defaultPrevented; }
|
||||
};
|
||||
}
|
||||
|
||||
function raiseEvent(type, cancelable) {
|
||||
var eventObj = cancelable ? createCancelableEvent(type) : { type: type, target: self };
|
||||
self.dispatchEvent(type, eventObj);
|
||||
var handler = self["on" + type];
|
||||
if (typeof handler === "function") {
|
||||
handler.call(self, eventObj);
|
||||
}
|
||||
return eventObj;
|
||||
}
|
||||
|
||||
// 命令列表事件
|
||||
this._commands.addEventListener("iteminserted", renderCommands);
|
||||
this._commands.addEventListener("itemremoved", renderCommands);
|
||||
this._commands.addEventListener("itemchanged", renderCommands);
|
||||
this._commands.addEventListener("reload", renderCommands);
|
||||
|
||||
// 属性
|
||||
Object.defineProperty(this, "element", { get: function () { return container; }, enumerable: true });
|
||||
Object.defineProperty(this, "hidden", { get: function () { return container.classList.contains("hide"); }, enumerable: true });
|
||||
Object.defineProperty(this, "title", { get: function () { return title.textContent; }, set: function (v) { title.textContent = v; }, enumerable: true });
|
||||
Object.defineProperty(this, "content", {
|
||||
get: function () { return content.firstChild; },
|
||||
set: function (v) {
|
||||
if (typeof v === "string" || typeof v === "number") v = document.createTextNode(v);
|
||||
while (content.firstChild) content.removeChild(content.firstChild);
|
||||
content.appendChild(v);
|
||||
},
|
||||
enumerable: true
|
||||
});
|
||||
Object.defineProperty(this, "commands", { get: function () { return self._commands; }, enumerable: true });
|
||||
Object.defineProperty(this, "primaryCommandIndex", {
|
||||
get: function () {
|
||||
var btns = commandContainer.querySelectorAll("button");
|
||||
for (var i = 0; i < btns.length; i++) {
|
||||
if (btns[i].type === "submit") return i;
|
||||
}
|
||||
return -1;
|
||||
},
|
||||
set: function (value) {
|
||||
var btns = commandContainer.querySelectorAll("button");
|
||||
for (var i = 0; i < btns.length; i++) {
|
||||
btns[i].removeAttribute("type");
|
||||
if (i === value) btns[i].type = "submit";
|
||||
}
|
||||
},
|
||||
enumerable: true
|
||||
});
|
||||
this._darkMode = true;
|
||||
this._backgroundColor = null;
|
||||
this._foregroundColor = null;
|
||||
Object.defineProperty(this, "darkMode", {
|
||||
get: function () {
|
||||
return self._darkMode;
|
||||
},
|
||||
set: function (value) {
|
||||
self._darkMode = !!value;
|
||||
if (self._backgroundColor === null) {
|
||||
if (self._darkMode) {
|
||||
container.classList.add("win-ui-dark");
|
||||
container.classList.remove("win-ui-light");
|
||||
} else {
|
||||
container.classList.add("win-ui-light");
|
||||
container.classList.remove("win-ui-dark");
|
||||
}
|
||||
}
|
||||
},
|
||||
enumerable: true
|
||||
});
|
||||
Object.defineProperty(this, "backgroundColor", {
|
||||
get: function () {
|
||||
return self._backgroundColor;
|
||||
},
|
||||
set: function (value) {
|
||||
self._backgroundColor = value;
|
||||
var dialog = container.querySelector(".win-contentdialog-dialog");
|
||||
if (dialog) {
|
||||
if (value !== null) {
|
||||
dialog.style.backgroundColor = value;
|
||||
} else {
|
||||
// 还原暗/亮模式背景
|
||||
if (self._darkMode) {
|
||||
dialog.style.backgroundColor = "rgb(31, 0, 104)";
|
||||
} else {
|
||||
dialog.style.backgroundColor = "white";
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
enumerable: true
|
||||
});
|
||||
Object.defineProperty(this, "foregroundColor", {
|
||||
get: function () {
|
||||
return self._foregroundColor;
|
||||
},
|
||||
set: function (value) {
|
||||
self._foregroundColor = value;
|
||||
var titleEl = container.querySelector(".win-contentdialog-title");
|
||||
var contentEl = container.querySelector(".win-contentdialog-content");
|
||||
if (titleEl) titleEl.style.color = value || "";
|
||||
if (contentEl) contentEl.style.color = value || "";
|
||||
},
|
||||
enumerable: true
|
||||
});
|
||||
container.classList.add("win-ui-dark");
|
||||
// 显示 / 隐藏
|
||||
this.show = function () {
|
||||
if (!container.classList.contains("hide")) return Promise.as();
|
||||
var ev = raiseEvent("beforeshow", true);
|
||||
if (ev.defaultPrevented) return Promise.as(); // 取消显示时直接返回
|
||||
container.classList.remove("hide");
|
||||
return new WinJS.Promise(function (complete) {
|
||||
setTimeout(function () {
|
||||
raiseEvent("aftershow", false);
|
||||
complete();
|
||||
}, 150);
|
||||
});
|
||||
};
|
||||
|
||||
this.hide = function () {
|
||||
if (container.classList.contains("hide")) return Promise.as();
|
||||
var ev = raiseEvent("beforehide", true);
|
||||
if (ev.defaultPrevented) return Promise.as();
|
||||
container.classList.add("hide");
|
||||
return new WinJS.Promise(function (complete) {
|
||||
setTimeout(function () {
|
||||
raiseEvent("afterhide", false);
|
||||
complete();
|
||||
}, 150);
|
||||
});
|
||||
};
|
||||
|
||||
// 释放资源
|
||||
this.dispose = function () {
|
||||
if (!_isdisposed) {
|
||||
_isdisposed = true;
|
||||
try { container.removeNode(false); } catch (e) { }
|
||||
}
|
||||
};
|
||||
|
||||
// 事件回调
|
||||
this.onbeforeshow = null;
|
||||
this.onaftershow = null;
|
||||
this.onbeforehide = null;
|
||||
this.onafterhide = null;
|
||||
|
||||
// showAsync
|
||||
this.showAsync = function () {
|
||||
if (_showAsyncPromise) return _showAsyncPromise;
|
||||
_showAsyncPromise = new WinJS.Promise(function (resolve) {
|
||||
_showAsyncResolve = resolve;
|
||||
self.show();
|
||||
});
|
||||
return _showAsyncPromise;
|
||||
};
|
||||
|
||||
// 初始化 options
|
||||
if (options) {
|
||||
if (options.title !== undefined) this.title = options.title;
|
||||
if (options.content !== undefined) this.content = options.content;
|
||||
if (options.commands && options.commands.length) {
|
||||
options.commands.forEach(function (c) {
|
||||
if (c instanceof ContentDialogCommand) {
|
||||
self._commands.push(c);
|
||||
} else {
|
||||
self._commands.push(new ContentDialogCommand(c.label, c.handler, c.commandId));
|
||||
}
|
||||
});
|
||||
renderCommands();
|
||||
}
|
||||
if (typeof options.primaryCommandIndex === "number") this.primaryCommandIndex = options.primaryCommandIndex;
|
||||
if (typeof options.onbeforeshow === "function") this.onbeforeshow = options.onbeforeshow;
|
||||
if (typeof options.onaftershow === "function") this.onaftershow = options.onaftershow;
|
||||
if (typeof options.onbeforehide === "function") this.onbeforehide = options.onbeforehide;
|
||||
if (typeof options.onafterhide === "function") this.onafterhide = options.onafterhide;
|
||||
if (options.autoShow === true) this.show();
|
||||
}
|
||||
}
|
||||
|
||||
// 快速创建 ContentDialog
|
||||
ContentDialog.create = function (content, title) {
|
||||
var container = document.createElement("div");
|
||||
document.body.appendChild(container);
|
||||
return new ContentDialog(container, {
|
||||
title: title,
|
||||
content: content
|
||||
});
|
||||
};
|
||||
|
||||
global.WinJS.UI.ContentDialogCommand = ContentDialogCommand;
|
||||
global.WinJS.UI.ContentDialog = ContentDialog;
|
||||
|
||||
})(this);
|
||||
7
shared/html/libs/winjs/3.0/License.txt
Normal file
7
shared/html/libs/winjs/3.0/License.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
7969
shared/html/libs/winjs/3.0/css/ui-dark.css
Normal file
7969
shared/html/libs/winjs/3.0/css/ui-dark.css
Normal file
File diff suppressed because it is too large
Load Diff
2
shared/html/libs/winjs/3.0/css/ui-dark.min.css
vendored
Normal file
2
shared/html/libs/winjs/3.0/css/ui-dark.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
7969
shared/html/libs/winjs/3.0/css/ui-light.css
Normal file
7969
shared/html/libs/winjs/3.0/css/ui-light.css
Normal file
File diff suppressed because it is too large
Load Diff
2
shared/html/libs/winjs/3.0/css/ui-light.min.css
vendored
Normal file
2
shared/html/libs/winjs/3.0/css/ui-light.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
shared/html/libs/winjs/3.0/fonts/Symbols.ttf
Normal file
BIN
shared/html/libs/winjs/3.0/fonts/Symbols.ttf
Normal file
Binary file not shown.
73635
shared/html/libs/winjs/3.0/js/WinJS.js
Normal file
73635
shared/html/libs/winjs/3.0/js/WinJS.js
Normal file
File diff suppressed because it is too large
Load Diff
35
shared/html/libs/winjs/3.0/js/WinJS.min.js
vendored
Normal file
35
shared/html/libs/winjs/3.0/js/WinJS.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
shared/html/libs/winjs/3.0/js/WinJS.min.js.map
Normal file
1
shared/html/libs/winjs/3.0/js/WinJS.min.js.map
Normal file
File diff suppressed because one or more lines are too long
24880
shared/html/libs/winjs/3.0/js/base.js
Normal file
24880
shared/html/libs/winjs/3.0/js/base.js
Normal file
File diff suppressed because it is too large
Load Diff
12
shared/html/libs/winjs/3.0/js/base.min.js
vendored
Normal file
12
shared/html/libs/winjs/3.0/js/base.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
shared/html/libs/winjs/3.0/js/base.min.js.map
Normal file
1
shared/html/libs/winjs/3.0/js/base.min.js.map
Normal file
File diff suppressed because one or more lines are too long
460
shared/html/libs/winjs/3.0/js/en-US/ui.strings.js
Normal file
460
shared/html/libs/winjs/3.0/js/en-US/ui.strings.js
Normal file
@@ -0,0 +1,460 @@
|
||||
/*!
|
||||
Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
Build: 3.0.0.winjs.2014.10.2
|
||||
Version: WinJS.3.0
|
||||
*/
|
||||
|
||||
(function (global) {
|
||||
global.strings = global.strings || {};
|
||||
|
||||
var appxVersion = "WinJS.3.0";
|
||||
var developerPrefix = "Developer.";
|
||||
if (appxVersion.indexOf(developerPrefix) === 0) {
|
||||
appxVersion = appxVersion.substring(developerPrefix.length);
|
||||
}
|
||||
|
||||
function addStrings(keyPrefix, strings) {
|
||||
Object.keys(strings).forEach(function (key) {
|
||||
global.strings[keyPrefix + key.replace("\\", "/")] = strings[key];
|
||||
});
|
||||
}
|
||||
addStrings("ms-resource://"+appxVersion+"/ui/",
|
||||
{
|
||||
"appBarAriaLabel": "App Bar",
|
||||
"appBarCommandAriaLabel": "App Bar Item",
|
||||
"averageRating": "Average Rating",
|
||||
"backbuttonarialabel": "Back",
|
||||
"clearYourRating" : "Clear your rating",
|
||||
"closeOverlay" : "Close",
|
||||
"datePicker": "Date Picker",
|
||||
"flipViewPanningContainerAriaLabel": "Scrolling Container",
|
||||
"flyoutAriaLabel": "Flyout",
|
||||
"hubViewportAriaLabel": "Scrolling Container",
|
||||
"listViewViewportAriaLabel": "Scrolling Container",
|
||||
"menuCommandAriaLabel": "Menu Item",
|
||||
"menuAriaLabel": "Menu",
|
||||
"navBarContainerViewportAriaLabel": "Scrolling Container",
|
||||
"off" : "Off",
|
||||
"on" : "On",
|
||||
"pivotAriaLabel": "Pivot",
|
||||
"pivotViewportAriaLabel": "Scrolling Container",
|
||||
"searchBoxAriaLabel": "Searchbox",
|
||||
"searchBoxAriaLabelInputNoPlaceHolder": "Searchbox, enter to submit query, esc to clear text",
|
||||
"searchBoxAriaLabelInputPlaceHolder": "Searchbox, {0}, enter to submit query, esc to clear text",
|
||||
"searchBoxAriaLabelButton": "Click to submit query",
|
||||
"searchBoxAriaLabelQuery": "Suggestion: {0}",
|
||||
"_searchBoxAriaLabelQuery.comment": "Suggestion: query text (example: Suggestion: contoso)",
|
||||
"searchBoxAriaLabelSeparator": "Separator: {0}",
|
||||
"_searchBoxAriaLabelSeparator.comment": "Separator: separator text (example: Separator: People or Separator: Apps)",
|
||||
"searchBoxAriaLabelResult": "Result: {0}, {1}",
|
||||
"_searchBoxAriaLabelResult.comment": "Result: text, detailed text (example: Result: contoso, www.contoso.com)",
|
||||
"selectAMPM": "Select A.M P.M",
|
||||
"selectDay": "Select Day",
|
||||
"selectHour": "Select Hour",
|
||||
"selectMinute": "Select Minute",
|
||||
"selectMonth": "Select Month",
|
||||
"selectYear": "Select Year",
|
||||
"settingsFlyoutAriaLabel": "Settings Flyout",
|
||||
"tentativeRating": "Tentative Rating",
|
||||
"timePicker": "Time Picker",
|
||||
"unrated": "Unrated",
|
||||
"userRating": "User Rating",
|
||||
// AppBar Icons follow, the format of the ui.js and ui.resjson differ for
|
||||
// the AppBarIcon namespace. The remainder of the file therefore differs.
|
||||
// Code point comments are the icon glyphs in the 'Segoe UI Symbol' font.
|
||||
"appBarIcons\\previous": "\uE100", // group:Media
|
||||
"_appBarIcons\\previous.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\next": "\uE101", // group:Media
|
||||
"_appBarIcons\\next.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\play": "\uE102", // group:Media
|
||||
"_appBarIcons\\play.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\pause": "\uE103", // group:Media
|
||||
"_appBarIcons\\pause.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\edit": "\uE104", // group:File
|
||||
"_appBarIcons\\edit.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\save": "\uE105", // group:File
|
||||
"_appBarIcons\\save.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\clear": "\uE106", // group:File
|
||||
"_appBarIcons\\clear.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\delete": "\uE107", // group:File
|
||||
"_appBarIcons\\delete.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\remove": "\uE108", // group:File
|
||||
"_appBarIcons\\remove.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\add": "\uE109", // group:File
|
||||
"_appBarIcons\\add.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\cancel": "\uE10A", // group:Editing
|
||||
"_appBarIcons\\cancel.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\accept": "\uE10B", // group:General
|
||||
"_appBarIcons\\accept.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\more": "\uE10C", // group:General
|
||||
"_appBarIcons\\more.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\redo": "\uE10D", // group:Editing
|
||||
"_appBarIcons\\redo.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\undo": "\uE10E", // group:Editing
|
||||
"_appBarIcons\\undo.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\home": "\uE10F", // group:General
|
||||
"_appBarIcons\\home.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\up": "\uE110", // group:General
|
||||
"_appBarIcons\\up.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\forward": "\uE111", // group:General
|
||||
"_appBarIcons\\forward.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\right": "\uE111", // group:General
|
||||
"_appBarIcons\\right.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\back": "\uE112", // group:General
|
||||
"_appBarIcons\\back.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\left": "\uE112", // group:General
|
||||
"_appBarIcons\\left.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\favorite": "\uE113", // group:Media
|
||||
"_appBarIcons\\favorite.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\camera": "\uE114", // group:System
|
||||
"_appBarIcons\\camera.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\settings": "\uE115", // group:System
|
||||
"_appBarIcons\\settings.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\video": "\uE116", // group:Media
|
||||
"_appBarIcons\\video.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\sync": "\uE117", // group:Media
|
||||
"_appBarIcons\\sync.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\download": "\uE118", // group:Media
|
||||
"_appBarIcons\\download.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\mail": "\uE119", // group:Mail and calendar
|
||||
"_appBarIcons\\mail.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\find": "\uE11A", // group:Data
|
||||
"_appBarIcons\\find.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\help": "\uE11B", // group:General
|
||||
"_appBarIcons\\help.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\upload": "\uE11C", // group:Media
|
||||
"_appBarIcons\\upload.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\emoji": "\uE11D", // group:Communications
|
||||
"_appBarIcons\\emoji.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\twopage": "\uE11E", // group:Layout
|
||||
"_appBarIcons\\twopage.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\leavechat": "\uE11F", // group:Communications
|
||||
"_appBarIcons\\leavechat.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\mailforward": "\uE120", // group:Mail and calendar
|
||||
"_appBarIcons\\mailforward.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\clock": "\uE121", // group:General
|
||||
"_appBarIcons\\clock.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\send": "\uE122", // group:Mail and calendar
|
||||
"_appBarIcons\\send.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\crop": "\uE123", // group:Editing
|
||||
"_appBarIcons\\crop.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\rotatecamera": "\uE124", // group:System
|
||||
"_appBarIcons\\rotatecamera.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\people": "\uE125", // group:Communications
|
||||
"_appBarIcons\\people.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\closepane": "\uE126", // group:Layout
|
||||
"_appBarIcons\\closepane.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\openpane": "\uE127", // group:Layout
|
||||
"_appBarIcons\\openpane.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\world": "\uE128", // group:General
|
||||
"_appBarIcons\\world.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\flag": "\uE129", // group:Mail and calendar
|
||||
"_appBarIcons\\flag.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\previewlink": "\uE12A", // group:General
|
||||
"_appBarIcons\\previewlink.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\globe": "\uE12B", // group:Communications
|
||||
"_appBarIcons\\globe.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\trim": "\uE12C", // group:Editing
|
||||
"_appBarIcons\\trim.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\attachcamera": "\uE12D", // group:System
|
||||
"_appBarIcons\\attachcamera.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\zoomin": "\uE12E", // group:Layout
|
||||
"_appBarIcons\\zoomin.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\bookmarks": "\uE12F", // group:Editing
|
||||
"_appBarIcons\\bookmarks.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\document": "\uE130", // group:File
|
||||
"_appBarIcons\\document.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\protecteddocument": "\uE131", // group:File
|
||||
"_appBarIcons\\protecteddocument.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\page": "\uE132", // group:Layout
|
||||
"_appBarIcons\\page.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\bullets": "\uE133", // group:Editing
|
||||
"_appBarIcons\\bullets.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\comment": "\uE134", // group:Communications
|
||||
"_appBarIcons\\comment.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\mail2": "\uE135", // group:Mail and calendar
|
||||
"_appBarIcons\\mail2.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\contactinfo": "\uE136", // group:Communications
|
||||
"_appBarIcons\\contactinfo.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\hangup": "\uE137", // group:Communications
|
||||
"_appBarIcons\\hangup.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\viewall": "\uE138", // group:Data
|
||||
"_appBarIcons\\viewall.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\mappin": "\uE139", // group:General
|
||||
"_appBarIcons\\mappin.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\phone": "\uE13A", // group:Communications
|
||||
"_appBarIcons\\phone.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\videochat": "\uE13B", // group:Communications
|
||||
"_appBarIcons\\videochat.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\switch": "\uE13C", // group:Communications
|
||||
"_appBarIcons\\switch.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\contact": "\uE13D", // group:Communications
|
||||
"_appBarIcons\\contact.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\rename": "\uE13E", // group:File
|
||||
"_appBarIcons\\rename.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\pin": "\uE141", // group:System
|
||||
"_appBarIcons\\pin.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\musicinfo": "\uE142", // group:Media
|
||||
"_appBarIcons\\musicinfo.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\go": "\uE143", // group:General
|
||||
"_appBarIcons\\go.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\keyboard": "\uE144", // group:System
|
||||
"_appBarIcons\\keyboard.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\dockleft": "\uE145", // group:Layout
|
||||
"_appBarIcons\\dockleft.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\dockright": "\uE146", // group:Layout
|
||||
"_appBarIcons\\dockright.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\dockbottom": "\uE147", // group:Layout
|
||||
"_appBarIcons\\dockbottom.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\remote": "\uE148", // group:System
|
||||
"_appBarIcons\\remote.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\refresh": "\uE149", // group:Data
|
||||
"_appBarIcons\\refresh.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\rotate": "\uE14A", // group:Layout
|
||||
"_appBarIcons\\rotate.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\shuffle": "\uE14B", // group:Media
|
||||
"_appBarIcons\\shuffle.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\list": "\uE14C", // group:Editing
|
||||
"_appBarIcons\\list.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\shop": "\uE14D", // group:General
|
||||
"_appBarIcons\\shop.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\selectall": "\uE14E", // group:Data
|
||||
"_appBarIcons\\selectall.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\orientation": "\uE14F", // group:Layout
|
||||
"_appBarIcons\\orientation.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\import": "\uE150", // group:Data
|
||||
"_appBarIcons\\import.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\importall": "\uE151", // group:Data
|
||||
"_appBarIcons\\importall.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\browsephotos": "\uE155", // group:Media
|
||||
"_appBarIcons\\browsephotos.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\webcam": "\uE156", // group:System
|
||||
"_appBarIcons\\webcam.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\pictures": "\uE158", // group:Media
|
||||
"_appBarIcons\\pictures.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\savelocal": "\uE159", // group:File
|
||||
"_appBarIcons\\savelocal.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\caption": "\uE15A", // group:Media
|
||||
"_appBarIcons\\caption.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\stop": "\uE15B", // group:Media
|
||||
"_appBarIcons\\stop.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\showresults": "\uE15C", // group:Data
|
||||
"_appBarIcons\\showresults.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\volume": "\uE15D", // group:Media
|
||||
"_appBarIcons\\volume.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\repair": "\uE15E", // group:System
|
||||
"_appBarIcons\\repair.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\message": "\uE15F", // group:Communications
|
||||
"_appBarIcons\\message.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\page2": "\uE160", // group:Layout
|
||||
"_appBarIcons\\page2.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\calendarday": "\uE161", // group:Mail and calendar
|
||||
"_appBarIcons\\calendarday.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\calendarweek": "\uE162", // group:Mail and calendar
|
||||
"_appBarIcons\\calendarweek.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\calendar": "\uE163", // group:Mail and calendar
|
||||
"_appBarIcons\\calendar.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\characters": "\uE164", // group:Editing
|
||||
"_appBarIcons\\characters.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\mailreplyall": "\uE165", // group:Mail and calendar
|
||||
"_appBarIcons\\mailreplyall.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\read": "\uE166", // group:Mail and calendar
|
||||
"_appBarIcons\\read.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\link": "\uE167", // group:Communications
|
||||
"_appBarIcons\\link.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\accounts": "\uE168", // group:Communications
|
||||
"_appBarIcons\\accounts.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\showbcc": "\uE169", // group:Mail and calendar
|
||||
"_appBarIcons\\showbcc.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\hidebcc": "\uE16A", // group:Mail and calendar
|
||||
"_appBarIcons\\hidebcc.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\cut": "\uE16B", // group:Editing
|
||||
"_appBarIcons\\cut.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\attach": "\uE16C", // group:Mail and calendar
|
||||
"_appBarIcons\\attach.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\paste": "\uE16D", // group:Editing
|
||||
"_appBarIcons\\paste.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\filter": "\uE16E", // group:Data
|
||||
"_appBarIcons\\filter.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\copy": "\uE16F", // group:Editing
|
||||
"_appBarIcons\\copy.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\emoji2": "\uE170", // group:Mail and calendar
|
||||
"_appBarIcons\\emoji2.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\important": "\uE171", // group:Mail and calendar
|
||||
"_appBarIcons\\important.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\mailreply": "\uE172", // group:Mail and calendar
|
||||
"_appBarIcons\\mailreply.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\slideshow": "\uE173", // group:Media
|
||||
"_appBarIcons\\slideshow.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\sort": "\uE174", // group:Data
|
||||
"_appBarIcons\\sort.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\manage": "\uE178", // group:System
|
||||
"_appBarIcons\\manage.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\allapps": "\uE179", // group:System
|
||||
"_appBarIcons\\allapps.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\disconnectdrive": "\uE17A", // group:System
|
||||
"_appBarIcons\\disconnectdrive.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\mapdrive": "\uE17B", // group:System
|
||||
"_appBarIcons\\mapdrive.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\newwindow": "\uE17C", // group:System
|
||||
"_appBarIcons\\newwindow.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\openwith": "\uE17D", // group:System
|
||||
"_appBarIcons\\openwith.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\contactpresence": "\uE181", // group:Communications
|
||||
"_appBarIcons\\contactpresence.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\priority": "\uE182", // group:Mail and calendar
|
||||
"_appBarIcons\\priority.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\uploadskydrive": "\uE183", // group:File
|
||||
"_appBarIcons\\uploadskydrive.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\gototoday": "\uE184", // group:Mail and calendar
|
||||
"_appBarIcons\\gototoday.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\font": "\uE185", // group:Editing
|
||||
"_appBarIcons\\font.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\fontcolor": "\uE186", // group:Editing
|
||||
"_appBarIcons\\fontcolor.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\contact2": "\uE187", // group:Communications
|
||||
"_appBarIcons\\contact2.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\folder": "\uE188", // group:File
|
||||
"_appBarIcons\\folder.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\audio": "\uE189", // group:Media
|
||||
"_appBarIcons\\audio.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\placeholder": "\uE18A", // group:General
|
||||
"_appBarIcons\\placeholder.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\view": "\uE18B", // group:Layout
|
||||
"_appBarIcons\\view.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\setlockscreen": "\uE18C", // group:System
|
||||
"_appBarIcons\\setlockscreen.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\settile": "\uE18D", // group:System
|
||||
"_appBarIcons\\settile.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\cc": "\uE190", // group:Media
|
||||
"_appBarIcons\\cc.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\stopslideshow": "\uE191", // group:Media
|
||||
"_appBarIcons\\stopslideshow.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\permissions": "\uE192", // group:System
|
||||
"_appBarIcons\\permissions.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\highlight": "\uE193", // group:Editing
|
||||
"_appBarIcons\\highlight.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\disableupdates": "\uE194", // group:System
|
||||
"_appBarIcons\\disableupdates.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\unfavorite": "\uE195", // group:Media
|
||||
"_appBarIcons\\unfavorite.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\unpin": "\uE196", // group:System
|
||||
"_appBarIcons\\unpin.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\openlocal": "\uE197", // group:File
|
||||
"_appBarIcons\\openlocal.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\mute": "\uE198", // group:Media
|
||||
"_appBarIcons\\mute.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\italic": "\uE199", // group:Editing
|
||||
"_appBarIcons\\italic.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\underline": "\uE19A", // group:Editing
|
||||
"_appBarIcons\\underline.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\bold": "\uE19B", // group:Editing
|
||||
"_appBarIcons\\bold.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\movetofolder": "\uE19C", // group:File
|
||||
"_appBarIcons\\movetofolder.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\likedislike": "\uE19D", // group:Data
|
||||
"_appBarIcons\\likedislike.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\dislike": "\uE19E", // group:Data
|
||||
"_appBarIcons\\dislike.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\like": "\uE19F", // group:Data
|
||||
"_appBarIcons\\like.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\alignright": "\uE1A0", // group:Editing
|
||||
"_appBarIcons\\alignright.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\aligncenter": "\uE1A1", // group:Editing
|
||||
"_appBarIcons\\aligncenter.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\alignleft": "\uE1A2", // group:Editing
|
||||
"_appBarIcons\\alignleft.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\zoom": "\uE1A3", // group:Layout
|
||||
"_appBarIcons\\zoom.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\zoomout": "\uE1A4", // group:Layout
|
||||
"_appBarIcons\\zoomout.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\openfile": "\uE1A5", // group:File
|
||||
"_appBarIcons\\openfile.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\otheruser": "\uE1A6", // group:System
|
||||
"_appBarIcons\\otheruser.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\admin": "\uE1A7", // group:System
|
||||
"_appBarIcons\\admin.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\street": "\uE1C3", // group:General
|
||||
"_appBarIcons\\street.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\map": "\uE1C4", // group:General
|
||||
"_appBarIcons\\map.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\clearselection": "\uE1C5", // group:Data
|
||||
"_appBarIcons\\clearselection.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\fontdecrease": "\uE1C6", // group:Editing
|
||||
"_appBarIcons\\fontdecrease.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\fontincrease": "\uE1C7", // group:Editing
|
||||
"_appBarIcons\\fontincrease.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\fontsize": "\uE1C8", // group:Editing
|
||||
"_appBarIcons\\fontsize.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\cellphone": "\uE1C9", // group:Communications
|
||||
"_appBarIcons\\cellphone.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\reshare": "\uE1CA", // group:Communications
|
||||
"_appBarIcons\\reshare.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\tag": "\uE1CB", // group:Data
|
||||
"_appBarIcons\\tag.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\repeatone": "\uE1CC", // group:Media
|
||||
"_appBarIcons\\repeatone.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\repeatall": "\uE1CD", // group:Media
|
||||
"_appBarIcons\\repeatall.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\outlinestar": "\uE1CE", // group:Data
|
||||
"_appBarIcons\\outlinestar.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\solidstar": "\uE1CF", // group:Data
|
||||
"_appBarIcons\\solidstar.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\calculator": "\uE1D0", // group:General
|
||||
"_appBarIcons\\calculator.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\directions": "\uE1D1", // group:General
|
||||
"_appBarIcons\\directions.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\target": "\uE1D2", // group:General
|
||||
"_appBarIcons\\target.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\library": "\uE1D3", // group:Media
|
||||
"_appBarIcons\\library.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\phonebook": "\uE1D4", // group:Communications
|
||||
"_appBarIcons\\phonebook.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\memo": "\uE1D5", // group:Communications
|
||||
"_appBarIcons\\memo.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\microphone": "\uE1D6", // group:System
|
||||
"_appBarIcons\\microphone.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\postupdate": "\uE1D7", // group:Communications
|
||||
"_appBarIcons\\postupdate.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\backtowindow": "\uE1D8", // group:Layout
|
||||
"_appBarIcons\\backtowindow.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\fullscreen": "\uE1D9", // group:Layout
|
||||
"_appBarIcons\\fullscreen.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\newfolder": "\uE1DA", // group:File
|
||||
"_appBarIcons\\newfolder.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\calendarreply": "\uE1DB", // group:Mail and calendar
|
||||
"_appBarIcons\\calendarreply.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\unsyncfolder": "\uE1DD", // group:File
|
||||
"_appBarIcons\\unsyncfolder.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\reporthacked": "\uE1DE", // group:Communications
|
||||
"_appBarIcons\\reporthacked.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\syncfolder": "\uE1DF", // group:File
|
||||
"_appBarIcons\\syncfolder.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\blockcontact": "\uE1E0", // group:Communications
|
||||
"_appBarIcons\\blockcontact.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\switchapps": "\uE1E1", // group:System
|
||||
"_appBarIcons\\switchapps.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\addfriend": "\uE1E2", // group:Communications
|
||||
"_appBarIcons\\addfriend.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\touchpointer": "\uE1E3", // group:System
|
||||
"_appBarIcons\\touchpointer.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\gotostart": "\uE1E4", // group:System
|
||||
"_appBarIcons\\gotostart.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\zerobars": "\uE1E5", // group:System
|
||||
"_appBarIcons\\zerobars.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\onebar": "\uE1E6", // group:System
|
||||
"_appBarIcons\\onebar.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\twobars": "\uE1E7", // group:System
|
||||
"_appBarIcons\\twobars.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\threebars": "\uE1E8", // group:System
|
||||
"_appBarIcons\\threebars.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\fourbars": "\uE1E9", // group:System
|
||||
"_appBarIcons\\fourbars.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\scan": "\uE294", // group:General
|
||||
"_appBarIcons\\scan.comment": "{Locked:qps-ploc,qps-plocm}",
|
||||
"appBarIcons\\preview": "\uE295", // group:General
|
||||
"_appBarIcons\\preview.comment": "{Locked:qps-ploc,qps-plocm}"
|
||||
}
|
||||
|
||||
);
|
||||
}(this));
|
||||
48796
shared/html/libs/winjs/3.0/js/ui.js
Normal file
48796
shared/html/libs/winjs/3.0/js/ui.js
Normal file
File diff suppressed because it is too large
Load Diff
26
shared/html/libs/winjs/3.0/js/ui.min.js
vendored
Normal file
26
shared/html/libs/winjs/3.0/js/ui.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
shared/html/libs/winjs/3.0/js/ui.min.js.map
Normal file
1
shared/html/libs/winjs/3.0/js/ui.min.js.map
Normal file
File diff suppressed because one or more lines are too long
@@ -23,6 +23,7 @@
|
||||
<link rel="stylesheet" href="manager/page.css">
|
||||
<link rel="stylesheet" href="manager/appitem.css">
|
||||
<link rel="stylesheet" href="manager/appbar.css">
|
||||
<script type="text/javascript" src="js/handler.js"></script>
|
||||
<script type="text/javascript" src="js/event.js"></script>
|
||||
<script type="text/javascript" src="js/tileback.js"></script>
|
||||
<script type="text/javascript" src="js/load.js"></script>
|
||||
@@ -198,6 +199,31 @@
|
||||
</div>
|
||||
<button id="ins-btn" data-res-resxml="MANAGER_LOAD_INSTALL_BTN"></button>
|
||||
<br><br>
|
||||
<h3 data-res-resxml="MANAGER_LOAD_UPDATE"></h3>
|
||||
<p data-res-resxml="MANAGER_LOAD_UPDATE_DESC"></p>
|
||||
<div class="checklist" id="upd-deployoptions">
|
||||
<span class="title" data-res-resxml="MANAGER_LOAD_DEPLOY_OPTIONS"></span>
|
||||
<div class="item">
|
||||
<input type="checkbox" value="2" id="upd-devmode">
|
||||
<label for="upd-devmode" data-res-resxml="MANAGER_LOAD_DEPLOY_OPTIONS_DEVELOPMENT_MODE"></label>
|
||||
</div>
|
||||
<div class="item">
|
||||
<input type="checkbox" value="1" id="upd-force-appshutdown">
|
||||
<label for="upd-force-appshutdown" data-res-resxml="MANAGER_LOAD_DEPLOY_OPTIONS_FORCE_APP_SHUTDOWN"></label>
|
||||
</div>
|
||||
<div class="item">
|
||||
<input type="checkbox" value="32" id="upd-all-resources">
|
||||
<label for="upd-all-resources" data-res-resxml="MANAGER_LOAD_DEPLOY_OPTIONS_INSTALL_ALL_RESOURCES"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="statusbar" id="upd-progress">
|
||||
<div class="container" style="padding-bottom: 10px;">
|
||||
<span class="status"></span><br>
|
||||
<progress class="win-progress progress" min="0" max="100"></progress>
|
||||
</div>
|
||||
</div>
|
||||
<button id="upd-btn" data-res-resxml="MANAGER_LOAD_UPDATE_BTN"></button>
|
||||
<br><br>
|
||||
<h3 data-res-resxml="MANAGER_LOAD_REGISTER"></h3>
|
||||
<p data-res-resxml="MANAGER_LOAD_REGISTER_DESC"></p>
|
||||
<div class="checklist" id="reg-deployoptions">
|
||||
@@ -246,11 +272,12 @@
|
||||
<div class="bottom-compensate"></div>
|
||||
<script>
|
||||
(function(global) {
|
||||
var prefixs = ["ins", "reg", "sta"];
|
||||
var prefixs = ["ins", "reg", "sta", "upd"];
|
||||
var statusbars = [
|
||||
document.getElementById("ins-progress"),
|
||||
document.getElementById("reg-progress"),
|
||||
document.getElementById("sta-progress")
|
||||
document.getElementById("sta-progress"),
|
||||
document.getElementById("upd-progress")
|
||||
];
|
||||
statusbars.forEach(function(statusbar) {
|
||||
statusbar.bar = new TransitionPanel(statusbar, {
|
||||
|
||||
170
shared/html/reader.html
Normal file
170
shared/html/reader.html
Normal file
@@ -0,0 +1,170 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Package Manager</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<script type="text/javascript" src="js/module.js"></script>
|
||||
<script type="text/javascript" src="js/polyfill-ie.js"></script>
|
||||
<link rel="stylesheet" href="libs/winjs/1.0/css/ui-light.css" id="winjs-style-1">
|
||||
<link rel="stylesheet" href="libs/winjs/2.0/css/ui-light.css" id="winjs-style">
|
||||
<script type="text/javascript" src="libs/winjs/1.0/js/base.js"></script>
|
||||
<script type="text/javascript" src="libs/winjs/1.0/js/ui.js"></script>
|
||||
<script type="text/javascript" src="js/color.js"></script>
|
||||
<script type="text/javascript" src="js/promise.js"></script>
|
||||
<script type="text/javascript" src="js/bridge.js"></script>
|
||||
<script type="text/javascript" src="js/dpimodes.js"></script>
|
||||
<script type="text/javascript" src="js/resources.js"></script>
|
||||
<script type="text/javascript" src="js/animation.js"></script>
|
||||
<link rel="stylesheet" href="fonts/fonts.css">
|
||||
<link rel="stylesheet" href="fonts/segx.css">
|
||||
<link rel="stylesheet" href="manager/page.css">
|
||||
<link rel="stylesheet" href="manager/appitem.css">
|
||||
<link rel="stylesheet" href="manager/appbar.css">
|
||||
<script type="text/javascript" src="js/handler.js"></script>
|
||||
<script type="text/javascript" src="js/event.js"></script>
|
||||
<script type="text/javascript" src="js/tileback.js"></script>
|
||||
<script type="text/javascript" src="js/load.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="libs/msgbox/msgbox.css">
|
||||
<script type="text/javascript" src="libs/msgbox/msgbox.js"></script>
|
||||
<script type="text/javascript" src="js/init.js"></script>
|
||||
<script type="text/javascript" src="js/pkginfo.js"></script>
|
||||
<script type="text/javascript" src="js/datasrc.js"></script>
|
||||
<script type="text/javascript" src="js/appbar.js"></script>
|
||||
<script type="text/javascript" src="js/pagemgr.js"></script>
|
||||
<script type="text/javascript" src="js/search.js"></script>
|
||||
<link rel="stylesheet" href="css/statusbar.css">
|
||||
<script type="text/javascript" src="js/statusbar.js"></script>
|
||||
<script type="text/javascript" src="js/rdinit.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="readerpage" class="pagecontainer full">
|
||||
<div class="page full guide fold">
|
||||
<main class="main padding">
|
||||
<div id="page-reader" style="display: none;" class="ispage">
|
||||
<h2>读取</h2>
|
||||
<p>请选择一个包,获取其信息。</p>
|
||||
<label for="read-pkgpath">文件路径</label>
|
||||
<input type="file" id="read-pkgpath">
|
||||
<input type="checkbox" id="read-usepri">
|
||||
<label for="read-usepri">需要解析 PRI 资源文件</label>
|
||||
<button id="read-btn">读取</button>
|
||||
<p>读取结果:</p>
|
||||
<div id="read-result"></div>
|
||||
<script>
|
||||
(function() {
|
||||
var readBtn = document.getElementById("read-btn");
|
||||
var readResult = document.getElementById("read-result");
|
||||
var readPkgpath = document.getElementById("read-pkgpath");
|
||||
var readUsepri = document.getElementById("read-usepri");
|
||||
readBtn.onclick = function() {
|
||||
var self = this;
|
||||
var pr = Package.reader;
|
||||
pr.readFromPackage(readPkgpath.value, readUsepri.checked).then(function(pi) {
|
||||
readResult.textContent = JSON.stringify(pi);
|
||||
}, function(err) {
|
||||
readResult.textContent = JSON.stringify(err);
|
||||
}).done(function() {
|
||||
self.disabled = false;
|
||||
}, function() {
|
||||
self.disabled = false;
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
</div>
|
||||
</main>
|
||||
<aside class="win-ui-dark">
|
||||
<nav class="container">
|
||||
<ul class="list top">
|
||||
<li class="title">
|
||||
<div role="img"></div>
|
||||
<!--<div role="placeholder"></div>-->
|
||||
<span class="win-type-base" data-res-resxml="MANAGER_APPTITLE"></span>
|
||||
</li>
|
||||
<script>
|
||||
(function($) {
|
||||
var foldBtn = document.querySelector(".page aside nav ul li.title");
|
||||
var page = document.querySelector(".pagecontainer .page");
|
||||
Windows.UI.Event.Util.addEvent(foldBtn, "dblclick", function() {
|
||||
page.classList.toggle("fold");
|
||||
});
|
||||
})(this);
|
||||
</script>
|
||||
</ul>
|
||||
<hr>
|
||||
<ul class="list">
|
||||
<li id="tag-reader">
|
||||
<div role="img"></div>
|
||||
<span class="win-type-base" data-res-resxml="MANAGER_MANAGE"></span>
|
||||
</li>
|
||||
<li id="tag-settings">
|
||||
<div role="img"></div>
|
||||
<span class="win-type-base" data-res-resxml="MANAGER_SETTINGS"></span>
|
||||
</li>
|
||||
<script>
|
||||
(function(global) {
|
||||
var isexec = false;
|
||||
var settag = document.getElementById("tag-settings");
|
||||
Windows.UI.Event.Util.addEvent(settag, "click", function() {
|
||||
if (isexec) return;
|
||||
var self = this;
|
||||
try {
|
||||
var settingpath = external.Storage.Path.combine(external.Storage.Path.root, "settings.exe");
|
||||
//var cmdline = "\"{execfile}\" manager".replace("{execfile}", settingpath);
|
||||
external.Process.runAsync(
|
||||
"manager",
|
||||
settingpath,
|
||||
1,
|
||||
"",
|
||||
function(ret) {
|
||||
isexec = false;
|
||||
self.classList.remove("selected");
|
||||
}
|
||||
);
|
||||
isexec = true;
|
||||
self.classList.add("selected");
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
});
|
||||
})(this);
|
||||
</script>
|
||||
</ul>
|
||||
</nav>
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
<div class="win-overlay win-commandlayout win-appbar win-bottom appbar win-ui-dark" id="appBar" role="menubar">
|
||||
</div>
|
||||
<div data-win-control="WinJS.UI.Flyout" id="app-uninstall-flyout" style="position: absolute; width: 336px; padding: 0; max-height: 284px;">
|
||||
<div class="top" style="padding: 20px 20px 0 20px;">
|
||||
<span data-res-resxml="MANAGER_APP_UNINSTALL_DESC"></span>
|
||||
</div>
|
||||
<div class="sapplist applist"></div>
|
||||
<style>
|
||||
#app-uninstall-flyout {
|
||||
/*min-height: 88px;
|
||||
transition: all 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);*/
|
||||
}
|
||||
|
||||
#app-uninstall-flyout .sapplist {
|
||||
padding: 0 20px;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
-ms-overflow-style: -ms-autohiding-scrollbar;
|
||||
max-height: 160px;
|
||||
}
|
||||
</style>
|
||||
<div class="bottom" style="padding: 20px 20px 20px 20px; height: 32px;">
|
||||
<button class="confirm" data-res-resxml="MANAGER_APP_UNINSTALL" style="float: right;"></button>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -470,7 +470,7 @@
|
||||
<lang name="zh-CN">正在生成快捷方式</lang>
|
||||
<lang name="en-US">Generating Shortcut</lang>
|
||||
</resource>
|
||||
<resource id="MANAGER_APP_SHORTCUTCREATE_BACK_TEXT_ING">
|
||||
<resource id="MANAGER_APP_SHORTCUTCREATE_BACK_TEXT_ING">
|
||||
<lang name="zh-CN">正在生成快捷方式...</lang>
|
||||
<lang name="en-US">Generating Shortcut...</lang>
|
||||
</resource>
|
||||
@@ -502,7 +502,7 @@
|
||||
<lang name="zh-CN">在这里,可以进行对应用的安装、注册等操作。</lang>
|
||||
<lang name="en-US">Here, you can perform installations, registrations, and other operations on apps.</lang>
|
||||
</resource>
|
||||
<resource id="MANAGER_LOAD_INSTALL">
|
||||
<resource id="MANAGER_LOAD_INSTALL">
|
||||
<lang name="zh-CN">安装</lang>
|
||||
<lang name="en-US">Install</lang>
|
||||
</resource>
|
||||
@@ -510,7 +510,7 @@
|
||||
<lang name="zh-CN">安装</lang>
|
||||
<lang name="en-US">Install</lang>
|
||||
</resource>
|
||||
<resource id="MANAGER_LOAD_INSTALL_DESC">
|
||||
<resource id="MANAGER_LOAD_INSTALL_DESC">
|
||||
<lang name="zh-CN">将应用部署到系统中。</lang>
|
||||
<lang name="en-US">Deploy the app to the system.</lang>
|
||||
</resource>
|
||||
@@ -530,7 +530,7 @@
|
||||
<lang name="zh-CN">安装所有资源 (对于捆绑包)</lang>
|
||||
<lang name="en-US">Install All Resources (for Bundle Packages)</lang>
|
||||
</resource>
|
||||
<resource id="MANAGER_LOAD_REGISTER">
|
||||
<resource id="MANAGER_LOAD_REGISTER">
|
||||
<lang name="zh-CN">注册</lang>
|
||||
<lang name="en-US">Register</lang>
|
||||
</resource>
|
||||
@@ -538,11 +538,11 @@
|
||||
<lang name="zh-CN">注册</lang>
|
||||
<lang name="en-US">Register</lang>
|
||||
</resource>
|
||||
<resource id="MANAGER_LOAD_REGISTER_DESC">
|
||||
<resource id="MANAGER_LOAD_REGISTER_DESC">
|
||||
<lang name="zh-CN">将应用清单注册到系统中。</lang>
|
||||
<lang name="en-US">Register the app manifest to the system.</lang>
|
||||
</resource>
|
||||
<resource id="MANAGER_LOAD_STAGE">
|
||||
<resource id="MANAGER_LOAD_STAGE">
|
||||
<lang name="zh-CN">预部署</lang>
|
||||
<lang name="en-US">Stage</lang>
|
||||
</resource>
|
||||
@@ -586,7 +586,7 @@
|
||||
<lang name="zh-CN">Windows 商店应用清单文件 (*.appxmanifest, *AppxManifest.xml)</lang>
|
||||
<lang name="en-US">Windows Store App Manifest File (*.appxmanifest, *AppxManifest.xml)</lang>
|
||||
</resource>
|
||||
<resource id="MANAGER_LOAD_ALLFILES">
|
||||
<resource id="MANAGER_LOAD_ALLFILES">
|
||||
<lang name="zh-CN">所有文件 (*.*)</lang>
|
||||
<lang name="en-US">All Files (*.*)</lang>
|
||||
</resource>
|
||||
@@ -594,4 +594,24 @@
|
||||
<lang name="zh-CN">设置</lang>
|
||||
<lang name="en-US">Settings</lang>
|
||||
</resource>
|
||||
<resource id="MANAGER_LOAD_UPDATE">
|
||||
<lang name="zh-CN">更新</lang>
|
||||
<lang name="en-US">Update</lang>
|
||||
</resource>
|
||||
<resource id="MANAGER_LOAD_UPDATE_BTN">
|
||||
<lang name="zh-CN">更新</lang>
|
||||
<lang name="en-US">Update</lang>
|
||||
</resource>
|
||||
<resource id="MANAGER_LOAD_UPDATE_DESC">
|
||||
<lang name="zh-CN">更新已有的应用。</lang>
|
||||
<lang name="en-US">Update existing apps.</lang>
|
||||
</resource>
|
||||
<resource id="MANAGER_LOAD_UPDATE_ING">
|
||||
<lang name="zh-CN">正在更新... {0}</lang>
|
||||
<lang name="en-US">Updating... {0}</lang>
|
||||
</resource>
|
||||
<resource id="MANAGER_LOAD_UPDATE_SUCCEED">
|
||||
<lang name="zh-CN">更新完成</lang>
|
||||
<lang name="en-US">Update Complete.</lang>
|
||||
</resource>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user