/*
    Copyright 2015 Adobe Systems Incorporated.  All rights reserved. 
   
*/
/*jslint vars: true, plusplus: true, devel: true, browser: true, nomen: true, maxerr: 50 
global dw
*/

var CONSTANTS = {
    ImageErrorStyleSheet : "<html><head> <meta charset=\"utf-8\"> <style> .basicBodyStyle { padding: 0; margin: 0; overflow: hidden; } .imageNotFoundHtmlDimension {width: 150px; height: 18px;} .inAccessableImageHtmlDimension {width: 180px; height: 18px;} .basicPStyle { padding: 2; text-align: center; font: 12px 'source_sans_proregular'; } .blackColorThemeP { border: 1px solid rgb(54,54,54);background-color: rgb(75, 75, 75); color: #FFFFFF; font: 12px 'source_sans_proregular'; } .blackColorThemeBody { background-color: rgb(75, 75, 75);} .whiteColorThemeP { background-color: rgb(240, 240, 240); color: #7D7C7C; border: 1px solid rgb(197,197,197); font: 12px 'source_sans_proregular';} .whiteColorThemeBody {background-color: rgb(240, 240, 240);} @font-face {	font: 12px 'source_sans_proregular'; src: url('" + dw.getConfigurationPath() + "/Fonts/sourcesanspro-regular-webfont.eot'); src: url('" + dw.getConfigurationPath() + "/Fonts/sourcesanspro-regular-webfont.eot?#iefix') format('embedded-opentype'), url('" + dw.getConfigurationPath() + "/Fonts/sourcesanspro-regular-webfont.woff') format('woff'), url('" + dw.getConfigurationPath() + "/Fonts/sourcesanspro-regular-webfont.ttf') format('truetype'), url('" + dw.getConfigurationPath() + "/Fonts/sourcesanspro-regular-webfont.svg#source_sans_proregular') format('svg'); font-weight: normal;font-style: normal;} </style></head>",
    ImageNotFoundBlackThemeHtmlFirstPart : "<body class=\"basicBodyStyle blackColorThemeBody imageNotFoundHtmlDimension\"><p class=\"basicPStyle blackColorThemeP imageNotFoundHtmlDimension\">",
    ImageNotFoundWhiteThemeHtmlFirstPart : "<body class=\"basicBodyStyle whiteColorThemeBody imageNotFoundHtmlDimension\"><p class=\"basicPStyle whiteColorThemeP imageNotFoundHtmlDimension\">",
    inAccessableImageBlackThemeHtmlFirstPart : "<body class=\"basicBodyStyle blackColorThemeBody inAccessableImageHtmlDimension\"><p class=\"basicPStyle blackColorThemeP inAccessableImageHtmlDimension\">",
    inAccessableImageWhiteThemeHtmlFirstPart : "<body class=\"basicBodyStyle whiteColorThemeBody inAccessableImageHtmlDimension\"><p class=\"basicPStyle whiteColorThemeP inAccessableImageHtmlDimension\">",
    EndHtml : "</p></body></html>",
    ImageDimension : "var imageToFit",
    ActualImage : "actualImage.src",
    BackGroundImage : "backgroundImage.src",
    imageAssignmentOp : "=",
    urlSeparator : "(",
    DivStartTag : "<div",
    CanvasStartTag : "<canvas",
    DivSelectorWhiteBackGround : " class = \"whiteBackGround\" ",
    CanvasSelectorWhiteBackGround  : " class = \"whiteBackgroundPreview\" ",
    CanvasFillStyleWhiteBackGround : "#7D7C7C",
    DivSelectorBlackBackGround : " class = \"blackBackGround\" ",
    CanvasSelectorBlackBackGround : " class = \"blackBackgroundPreview\" ",
    CanvasFillStyleBlackBackGround : "#FFFFFF",
    WhiteThemeBackGroundColor : "rgb(240, 240, 240)",
    BlackThemeBackGroundColor : "rgb(75, 75, 75)",
    SourceTemplateDir : "/PreviewExtensions/ImagePreviewResources/",
    SourceTemplateURL : "/PreviewExtensions/ImagePreviewResources/Template.html",
    BackGroundImageName : "Checker_bg.png",
    supportedTags : ["img", "embed", "iframe", "object"],
    supportedAttributes :  ["src", "source", "data"],
    TagOpen : "<",
    Url : "url",
    DataUri : "data-uri",
    BrowserControl : "browserControl",
    WhiteTheme :  "white",
    BlackTheme : "black",
    EquiSpaced : "EquiSpaced",
    AtMousePosition : "atmouse",
    imageNotFoundHtmlWidth : 150,
    imageNotFoundHtmlHeight : 18,
    InAccessableImageHtmlWidth : 180,
    InAccessableImageHtmlHeight : 18,
    ErrorMessageFontName: "SourceSansPro-Regular", 
    ErrorMessageFontSize: 12,
    canvasMaxWidth : 150,
    canvasMaxHeight : 150, //Maximum canvas dimension inside which the image is to be fitted in
    canvasMinWidth : 50,
    canvasMinHeight : 50, //Minimum width and height of the canvas , never draw an image lesser than this size , as it'll not be visible
    invalidIndex : -1,
    siteRootRelativePathStartChar : '/',
    localFileSytemHeader : "file:///",
    http : "http://",
    https : "https://",
    www : "www.",
    htmlToLoadRemoteImage : "<!doctype html> <html> <head> <meta charset=\"utf-8\"> <title>Untitled Document</title> <script> function OnLoadOfImage() {\"use strict\"; var image = document.getElementById('remoteImage'); if (image) { window.writeDWImageDimension(image.width, image.height);}} </script>  </head> <body> <img id = \"remoteImage\" onLoad = \"OnLoadOfImage();\" style =\"display:none;\" alt=\"\"/> </body> </html>",
    placeholderRemoteImage : "remoteImage",
    maxTryForRemoteImage : 20,
    maxTryForSvgImage : 4,
    timeIntervalForRemoteImageLoad : 50,
    canhandelRetVal : {WillNotHanlde : 0, WillHandleNow: 1, WillHandleLater: 2},
    embededImageHeader : "data:image/",
    imageStartDelimeterChars : ["\"", "'", "=", "("], //Chars which mark as delemeter between src / url attribute
    imageEndDelimeterChars : ["\"", "'", ")"],
    attributeNameDelimator : [" ", "\"", "'", "\t", "\n", ",", ")", ":"],
    supportedDocTypes : ["html", "css", "htm", "php", "less", "sass", "scss", "html template", "library item"],
    imageExtensions : ["png", "jpg", "jpeg", "gif", "bmp", "svg"],
    svgExtensionName : ".svg"
};
