Add favicon for HTML5
This commit is contained in:
@@ -7,11 +7,13 @@ import lime.tools.helpers.AssetHelper;
|
|||||||
import lime.tools.helpers.DeploymentHelper;
|
import lime.tools.helpers.DeploymentHelper;
|
||||||
import lime.tools.helpers.FileHelper;
|
import lime.tools.helpers.FileHelper;
|
||||||
import lime.tools.helpers.HTML5Helper;
|
import lime.tools.helpers.HTML5Helper;
|
||||||
|
import lime.tools.helpers.IconHelper;
|
||||||
import lime.tools.helpers.LogHelper;
|
import lime.tools.helpers.LogHelper;
|
||||||
import lime.tools.helpers.PathHelper;
|
import lime.tools.helpers.PathHelper;
|
||||||
import lime.tools.helpers.ProcessHelper;
|
import lime.tools.helpers.ProcessHelper;
|
||||||
import lime.project.AssetType;
|
import lime.project.AssetType;
|
||||||
import lime.project.HXProject;
|
import lime.project.HXProject;
|
||||||
|
import lime.project.Icon;
|
||||||
import lime.project.PlatformTarget;
|
import lime.project.PlatformTarget;
|
||||||
import sys.io.File;
|
import sys.io.File;
|
||||||
import sys.FileSystem;
|
import sys.FileSystem;
|
||||||
@@ -179,6 +181,28 @@ class HTML5Platform extends PlatformTarget {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
context.favicons = [];
|
||||||
|
|
||||||
|
var icons = project.icons;
|
||||||
|
|
||||||
|
if (icons.length == 0) {
|
||||||
|
|
||||||
|
icons = [ new Icon (PathHelper.findTemplate (project.templatePaths, "default/icon.svg")) ];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//if (IconHelper.createWindowsIcon (icons, PathHelper.combine (destination, "favicon.ico"))) {
|
||||||
|
//
|
||||||
|
//context.favicons.push ({ rel: "icon", type: "image/x-icon", href: "./favicon.ico" });
|
||||||
|
//
|
||||||
|
//}
|
||||||
|
|
||||||
|
if (IconHelper.createIcon (icons, 192, 192, PathHelper.combine (destination, "favicon.png"))) {
|
||||||
|
|
||||||
|
context.favicons.push ({ rel: "shortcut icon", type: "image/png", href: "./favicon.png" });
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
context.linkedLibraries = [];
|
context.linkedLibraries = [];
|
||||||
|
|
||||||
for (dependency in project.dependencies) {
|
for (dependency in project.dependencies) {
|
||||||
|
|||||||
@@ -10,6 +10,9 @@
|
|||||||
<meta id="viewport" name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
<meta id="viewport" name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
|
||||||
|
::if favicons::::foreach (favicons)::
|
||||||
|
<link rel="::__current__.rel::" type="::__current__.type::" href="::__current__.href::">::end::::end::
|
||||||
|
|
||||||
::if linkedLibraries::::foreach (linkedLibraries)::
|
::if linkedLibraries::::foreach (linkedLibraries)::
|
||||||
<script type="text/javascript" src="::__current__::"></script>::end::::end::
|
<script type="text/javascript" src="::__current__::"></script>::end::::end::
|
||||||
<script type="text/javascript" src="./::APP_FILE::.js"></script>
|
<script type="text/javascript" src="./::APP_FILE::.js"></script>
|
||||||
|
|||||||
Reference in New Issue
Block a user