mirror of
https://github.com/modernw/App-Installer-For-Windows-8.x-Reset.git
synced 2026-06-18 13:20:09 +10:00
Update reader.
This commit is contained in:
@@ -35,6 +35,8 @@
|
||||
try {
|
||||
inst.sendAsync(body, encoding, function(resp) {
|
||||
if (c) c(resp);
|
||||
}, function(err) {
|
||||
if (e) e(err);
|
||||
});
|
||||
} catch (ex) { if (e) e(ex); }
|
||||
});
|
||||
|
||||
@@ -0,0 +1,285 @@
|
||||
(function(global) {
|
||||
function isString(obj) {
|
||||
return typeof obj === "string" || obj instanceof String;
|
||||
}
|
||||
|
||||
function isFunction(obj) {
|
||||
return typeof obj === "function";
|
||||
}
|
||||
|
||||
function isBool(obj) {
|
||||
return typeof obj === "boolean" || obj instanceof Boolean;
|
||||
}
|
||||
|
||||
function isNumber(obj) {
|
||||
return typeof obj === "number" || obj instanceof Number;
|
||||
}
|
||||
|
||||
function isDate(obj) {
|
||||
return obj instanceof Date;
|
||||
}
|
||||
|
||||
function isDevToolsOpen() {
|
||||
if (window.__IE_DEVTOOLBAR_CONSOLE_COMMAND_LINE) {
|
||||
return true; // IE10 或更早版本
|
||||
}
|
||||
if (window.__BROWSERTOOLS_CONSOLE) {
|
||||
return true; // IE11
|
||||
}
|
||||
if (window.__BROWSERTOOLS_DOMEXPLORER_ADDED) {
|
||||
return true; // IE11
|
||||
}
|
||||
return false;
|
||||
}
|
||||
var APIs = [
|
||||
"Windows.ApplicationModel.DesignMode.designModeEnabled",
|
||||
"Windows.ApplicationModel.Resources.Core.ResourceContext",
|
||||
"Windows.ApplicationModel.Resources.Core.ResourceManager",
|
||||
"Windows.ApplicationModel.Search.Core.SearchSuggestionManager",
|
||||
"Windows.ApplicationModel.Search.SearchQueryLinguisticDetails",
|
||||
"Windows.Data.Text.SemanticTextQuery",
|
||||
"Windows.Foundation.Collections.CollectionChange",
|
||||
"Windows.Foundation.Uri",
|
||||
"Windows.Globalization.ApplicationLanguages",
|
||||
"Windows.Globalization.Calendar",
|
||||
"Windows.Globalization.DateTimeFormatting",
|
||||
"Windows.Globalization.Language",
|
||||
"Windows.Phone.UI.Input.HardwareButtons",
|
||||
"Windows.Storage.ApplicationData",
|
||||
"Windows.Storage.CreationCollisionOption",
|
||||
"Windows.Storage.BulkAccess.FileInformationFactory",
|
||||
"Windows.Storage.FileIO",
|
||||
"Windows.Storage.FileProperties.ThumbnailType",
|
||||
"Windows.Storage.FileProperties.ThumbnailMode",
|
||||
"Windows.Storage.FileProperties.ThumbnailOptions",
|
||||
"Windows.Storage.KnownFolders",
|
||||
"Windows.Storage.Search.FolderDepth",
|
||||
"Windows.Storage.Search.IndexerOption",
|
||||
"Windows.Storage.Streams.RandomAccessStreamReference",
|
||||
"Windows.UI.ApplicationSettings.SettingsEdgeLocation",
|
||||
"Windows.UI.ApplicationSettings.SettingsCommand",
|
||||
"Windows.UI.ApplicationSettings.SettingsPane",
|
||||
"Windows.UI.Core.AnimationMetrics",
|
||||
"Windows.UI.Input.EdgeGesture",
|
||||
"Windows.UI.Input.EdgeGestureKind",
|
||||
"Windows.UI.Input.PointerPoint",
|
||||
"Windows.UI.ViewManagement.HandPreference",
|
||||
"Windows.UI.ViewManagement.InputPane",
|
||||
"Windows.UI.ViewManagement.UISettings",
|
||||
"Windows.UI.WebUI.Core.WebUICommandBar",
|
||||
"Windows.UI.WebUI.Core.WebUICommandBarBitmapIcon",
|
||||
"Windows.UI.WebUI.Core.WebUICommandBarClosedDisplayMode",
|
||||
"Windows.UI.WebUI.Core.WebUICommandBarIconButton",
|
||||
"Windows.UI.WebUI.Core.WebUICommandBarSymbolIcon",
|
||||
"Windows.UI.WebUI.WebUIApplication",
|
||||
];
|
||||
for (var i = 0; i < APIs.length; i++) {
|
||||
var api = APIs[i];
|
||||
apiNs = api.split(".");
|
||||
var lastNs = global;
|
||||
for (var j = 0; j < apiNs.length - 1; j++) {
|
||||
var ns = apiNs[j];
|
||||
if (typeof lastNs[ns] === "undefined") lastNs[ns] = {};
|
||||
lastNs = lastNs[ns];
|
||||
}
|
||||
var leaf = apiNs[apiNs.length - 1];
|
||||
if ("abcdefghijklmnopqrstuvwxyz".indexOf(leaf[0]) < 0) {
|
||||
lastNs[leaf] = {};
|
||||
Object.defineProperty(lastNs[leaf], "current", {
|
||||
get: function() { return null; },
|
||||
enumerable: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
Object.defineProperty(Windows.ApplicationModel.DesignMode, "designModeEnabled", {
|
||||
get: isDevToolsOpen,
|
||||
enumerable: true,
|
||||
});
|
||||
Windows.Foundation.Collections.CollectionChange = {
|
||||
reset: 0,
|
||||
itemInserted: 1,
|
||||
itemRemoved: 2,
|
||||
itemChanged: 3
|
||||
};
|
||||
Windows.Foundation.Uri = function(uri) {
|
||||
var inst = null;
|
||||
if (arguments.length === 2) {
|
||||
inst = external.Utilities.createUri2(uri, arguments[1]);
|
||||
} else {
|
||||
inst = external.Utilities.createUri(uri);
|
||||
}
|
||||
inst.jsType = this;
|
||||
return inst;
|
||||
};
|
||||
Windows.Globalization.ApplicationLanguages = {};
|
||||
Object.defineProperty(Windows.Globalization.ApplicationLanguages, "languages", {
|
||||
get: function() {
|
||||
try {
|
||||
var list = [];
|
||||
var langs = external.System.Locale.recommendLocaleNames;
|
||||
langs.forEach(function(item) {
|
||||
list.push(item);
|
||||
});
|
||||
return list;
|
||||
} catch (e) {
|
||||
return navigator.languages;
|
||||
}
|
||||
},
|
||||
enumerable: true,
|
||||
});
|
||||
Object.defineProperty(Windows.Globalization.ApplicationLanguages, "Languages", {
|
||||
get: function() {
|
||||
return Windows.Globalization.ApplicationLanguages.languages;
|
||||
},
|
||||
enumerable: true,
|
||||
});
|
||||
Windows.Globalization.LanguageLayoutDirection = {
|
||||
ltr: 0,
|
||||
rtl: 1,
|
||||
ttbLtr: 2,
|
||||
ttbRtl: 3
|
||||
};
|
||||
Windows.Globalization.Language = function(languageTag) {
|
||||
var inst = external.System.Locale.createLanguage(languageTag);
|
||||
inst.jsType = this;
|
||||
return inst;
|
||||
};
|
||||
Object.defineProperty(Windows.Globalization.Language, "currentInputMethodLanguageTag", {
|
||||
get: function() {
|
||||
return external.System.Locale.currentInputMethodLanguageTag;
|
||||
},
|
||||
enumerable: true,
|
||||
});
|
||||
Windows.Globalization.Language.isWellFormed = external.System.Locale.isWellFormed;
|
||||
Windows.Globalization.Language.getMuiCompatibleLanguageListFromLanguageTags = external.System.Locale.getMuiCompatibleLanguageListFromLanguageTags;
|
||||
Windows.Globalization.Calendar = function(args) {
|
||||
var inst = null;
|
||||
if (arguments.length === 0) {
|
||||
inst = external.Utilities.createCalendar(args);
|
||||
} else if (arguments.length === 1) {
|
||||
inst = external.Utilities.createCalendar2(args);
|
||||
} else if (arguments.length === 3) {
|
||||
inst = external.Utilities.createCalendar3(args, arguments[1], arguments[2], arguments[3]);
|
||||
} else if (arguments.length === 4) {
|
||||
inst = external.Utilities.createCalendar4(args, arguments[1], arguments[2], arguments[3], arguments[4]);
|
||||
}
|
||||
return inst;
|
||||
};
|
||||
Windows.Globalization.DateTimeFormatting = {};
|
||||
Windows.Globalization.DateTimeFormatting.DayFormat = {
|
||||
default: 1,
|
||||
none: 0
|
||||
};
|
||||
Windows.Globalization.DateTimeFormatting.DayOfWeekFormat = {
|
||||
none: 0,
|
||||
default: 1,
|
||||
abberviated: 2,
|
||||
full: 3
|
||||
};
|
||||
Windows.Globalization.DateTimeFormatting.HourFormat = {
|
||||
none: 0,
|
||||
default: 1
|
||||
};
|
||||
Windows.Globalization.DateTimeFormatting.MinuteFormat = {
|
||||
none: 0,
|
||||
default: 1
|
||||
};
|
||||
Windows.Globalization.DateTimeFormatting.MonthFormat = {
|
||||
none: 0,
|
||||
default: 1,
|
||||
abberviated: 2,
|
||||
full: 3,
|
||||
numeric: 4
|
||||
};
|
||||
Windows.Globalization.DateTimeFormatting.SecondFormat = {
|
||||
default: 1,
|
||||
none: 0
|
||||
};
|
||||
Windows.Globalization.DateTimeFormatting.YearFormat = {
|
||||
default: 1,
|
||||
none: 0,
|
||||
abberviated: 2,
|
||||
full: 3,
|
||||
};
|
||||
Windows.Globalization.DateTimeFormatting.DateTimeFormatter = function() {
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
var inst = null;
|
||||
if (args.length === 1) inst = external.Utilities.createDateTimeFormatterFromTemplate(args[0]);
|
||||
else if (args.length === 2) inst = external.Utilities.CreateDateTimeFormatterFromTemplateAndLanguages(args[0], args[1]);
|
||||
else if (args.length === 3) inst = external.Utilities.CreateDateTimeFormatterFromTimeEnums(args[0], args[1], args[2]);
|
||||
else if (args.length === 4) inst = external.Utilities.CreateDateTimeFormatterFromDateEnums(args[0], args[1], args[2], args[3]);
|
||||
else if (args.length === 5) inst = external.Utilities.CreateDateTimeFormatterFromTemplateFull(args[0], args[1], args[2], args[3], args[4]);
|
||||
else if (args.length === 8) inst = external.Utilities.CreateDateTimeFormatterFromDateTimeEnums(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
|
||||
else if (args.length === 11) inst = external.Utilities.CreateDateTimeFormatterFromDateTimeEnumsFull(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10]);
|
||||
return inst;
|
||||
};
|
||||
Windows.Storage.CreationCollisionOption = {
|
||||
generateUniqueName: 0,
|
||||
replaceExisting: 1,
|
||||
failIfExists: 2,
|
||||
openIfExists: 3
|
||||
};
|
||||
Windows.Storage.FileProperties = {
|
||||
ThumbnailType: {
|
||||
image: 0,
|
||||
icon: 1
|
||||
},
|
||||
ThumbnailMode: {
|
||||
pictureView: 0,
|
||||
videosView: 1,
|
||||
musicView: 2,
|
||||
documentsView: 3,
|
||||
listView: 4,
|
||||
singleItem: 5
|
||||
},
|
||||
ThumbnailType: {
|
||||
image: 0,
|
||||
icon: 1
|
||||
},
|
||||
VideoOrientation: {
|
||||
normal: 0,
|
||||
rotate90: 90,
|
||||
rotate180: 180,
|
||||
rotate270: 270
|
||||
},
|
||||
PhotoOrientation: {
|
||||
unspecified: 0,
|
||||
normal: 1,
|
||||
flipHorizontal: 2,
|
||||
rotate180: 3,
|
||||
flipVertical: 4,
|
||||
transpose: 5,
|
||||
rotate270: 6,
|
||||
transverse: 7,
|
||||
rotate90: 8
|
||||
},
|
||||
};
|
||||
Windows.Storage.Search = {
|
||||
FolderDepth: function() {},
|
||||
IndexerOption: function() {}
|
||||
};
|
||||
Windows.Storage.Search.FolderDepth.deep = 1;
|
||||
Windows.Storage.Search.FolderDepth.shallow = 0;
|
||||
Windows.Storage.Search.IndexerOption.useIndexerWhenAvailable = 0;
|
||||
Windows.Storage.Search.IndexerOption.onlyUseIndexer = 1;
|
||||
Windows.Storage.Search.IndexerOption.doNotUseIndexer = 2;
|
||||
Windows.Storage.Search.IndexerOption.onlyUseIndexerAndOptimizeForIndexedProperties = 3;
|
||||
Windows.UI.ApplicationSettings.SettingsEdgeLocation = {
|
||||
right: 0,
|
||||
left: 1
|
||||
};
|
||||
Windows.UI.Input.EdgeGestureKind = {
|
||||
touch: 0,
|
||||
keyboard: 1,
|
||||
mouse: 2
|
||||
};
|
||||
Windows.UI.ViewManagement.HandPreference = {
|
||||
leftHanded: 0,
|
||||
rightHanded: 1
|
||||
};
|
||||
Windows.UI.WebUI.Core.WebUICommandBarClosedDisplayMode = {
|
||||
default: 0,
|
||||
minimal: 1,
|
||||
compact: 2
|
||||
};
|
||||
})(this);
|
||||
@@ -2,6 +2,7 @@
|
||||
var strres = external.StringResources;
|
||||
var conf = external.Config.current;
|
||||
var set = conf.getSection("Settings");
|
||||
var metadata = conf.getSection("PackageReader:AppMetadatas");
|
||||
|
||||
function createLocalizedCompare(locale) {
|
||||
return function(a, b) {
|
||||
@@ -15,6 +16,26 @@
|
||||
};
|
||||
}
|
||||
var pagemgr = new PageManager();
|
||||
(function() {
|
||||
var nstrutil = Bridge.NString;
|
||||
var boolTrue = ["true", "1", "yes", "on", "y", "t", "zhen", "真"];
|
||||
var boolFalse = ["false", "0", "no", "off", "n", "f", "jia", "假"];
|
||||
global.parseBool = function(str) {
|
||||
if (typeof str === "boolean") return str;
|
||||
str = "" + str;
|
||||
for (var i = 0; i < boolTrue.length; i++) {
|
||||
if (nstrutil.equals(str, boolTrue[i])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < boolFalse.length; i++) {
|
||||
if (nstrutil.equals(str, boolFalse[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
})();
|
||||
OnLoad.add(function() {
|
||||
var mgr = Package.manager;
|
||||
var nstr = Bridge.NString;
|
||||
@@ -24,8 +45,59 @@
|
||||
return Bridge.String.tolower(Bridge.String.trim(item.Identity.FullName));
|
||||
});
|
||||
var themeColor = Bridge.UI.themeColor;
|
||||
var reader = Package.reader;
|
||||
var appitems = [
|
||||
"Id",
|
||||
"StartPage",
|
||||
"EntryPoint",
|
||||
"Executable",
|
||||
"BackgroundColor",
|
||||
"DisplayName",
|
||||
"Description",
|
||||
"ShortName",
|
||||
"ForegroundText",
|
||||
"SmallLogo",
|
||||
"Square30x30Logo",
|
||||
"Square44x44Logo",
|
||||
"Square70x70Logo",
|
||||
"Square71x71Logo",
|
||||
"Logo",
|
||||
"Square150x150Logo",
|
||||
"WideLogo",
|
||||
"Wide310x150Logo",
|
||||
"Square310x310Logo",
|
||||
"Tall150x310Logo",
|
||||
"LockScreenLogo",
|
||||
"LockScreenNotification",
|
||||
"DefaultSize",
|
||||
"AppListEntry",
|
||||
"VisualGroup",
|
||||
"MinWidth",
|
||||
];
|
||||
var defaultItems = [
|
||||
"Id",
|
||||
"DisplayName",
|
||||
"BackgroundColor",
|
||||
"ForegroundText",
|
||||
"ShortName",
|
||||
"Square44x44Logo",
|
||||
"SmallLogo"
|
||||
];
|
||||
var metaitemlist = [];
|
||||
for (var i = 0; i < appitems.length; i++) {
|
||||
var item = appitems[i];
|
||||
var isenable = metadata.getKey(item).value;
|
||||
if (isenable === null || isenable === void 0 || isenable === "") {
|
||||
isenable = defaultItems.indexOf(item) >= 0;
|
||||
}
|
||||
if (parseBool(isenable) == true) {
|
||||
metaitemlist.push(item);
|
||||
}
|
||||
}
|
||||
reader.updateApplicationReadItems(metaitemlist);
|
||||
pagemgr.register("reader", document.getElementById("tag-reader"), document.getElementById("page-reader"));
|
||||
pagemgr.register("acquire", document.getElementById("tag-acquire"), document.getElementById("page-acquire"));
|
||||
pagemgr.register("search", document.getElementById("tag-search"), document.getElementById("page-search"));
|
||||
pagemgr.go("reader");
|
||||
});
|
||||
})(this);
|
||||
@@ -57,6 +57,7 @@
|
||||
try {
|
||||
var obj = nodes[i].getAttribute('data-res-resxml');
|
||||
var strres = external.StringResources;
|
||||
if (!strres) strres = Bridge.External.WinJsStringRes;
|
||||
if (strres) {
|
||||
try {
|
||||
nodes[i].textContent = strres.get(obj);
|
||||
|
||||
Reference in New Issue
Block a user