Modules (188)

LiveDevelopmentUtils

Description

Set of utilities for working with files and text content.

Dependencies

Variables

Private

_staticHtmlFileExts Constant

File extensions - hard-coded for now, but may want to make these preferences

Type
Array.
    var _staticHtmlFileExts = ["htm", "html", "xhtml"],
        _serverHtmlFileExts = ["php", "php3", "php4", "php5", "phtm", "phtml", "cfm", "cfml", "asp", "aspx", "jsp", "jspx", "shtm", "shtml"];

Functions

Public API

isHtmlFileExt

Returns true if we think the given extension is for an HTML file.

ext string
The extension to check.
Returns: boolean
true if this is an HTML extension.
    function isHtmlFileExt(ext) {
        return (isStaticHtmlFileExt(ext) ||
                (ProjectManager.getBaseUrl() && isServerHtmlFileExt(ext)));
    }

    // Define public API
    exports.isHtmlFileExt       = isHtmlFileExt;
    exports.isStaticHtmlFileExt = isStaticHtmlFileExt;
    exports.isServerHtmlFileExt = isServerHtmlFileExt;
});
Public API

isServerHtmlFileExt

Determine if file extension is a server html file extension.

filePath string
could be a path, a file name or just a file extension
Returns: boolean
Returns true if fileExt is in the list
    function isServerHtmlFileExt(filePath) {
        if (!filePath) {
            return false;
        }

        return (_serverHtmlFileExts.indexOf(LanguageManager.getLanguageForPath(filePath).getId()) !== -1);
    }
Public API

isStaticHtmlFileExt

Determine if file extension is a static html file extension.

filePath string
could be a path, a file name or just a file extension
Returns: boolean
Returns true if fileExt is in the list
    function isStaticHtmlFileExt(filePath) {
        if (!filePath) {
            return false;
        }

        return (_staticHtmlFileExts.indexOf(LanguageManager.getLanguageForPath(filePath).getId()) !== -1);
    }