﻿"use strict";

app.filter("extractMainUrl", function () {
    return function (url) {
        if ($.awards.is.nullOrEmpty(url) || url.toLowerCase().indexOf("youtube") > -1) {
            return url;
        }
        else {
            var newUrl = url;
            if (url.indexOf("http://") === 0) {
                newUrl = url.substr(7);
            }
            else if (url.indexOf("https://") === 0) {
                newUrl = url.substr(8);
            }
            return newUrl.split("/")[0];
        }
    };
});