Skip to content

Instantly share code, notes, and snippets.

@setola
Created August 29, 2014 14:20
Show Gist options
  • Save setola/899ceba68075d7fba5f5 to your computer and use it in GitHub Desktop.
Save setola/899ceba68075d7fba5f5 to your computer and use it in GitHub Desktop.

Revisions

  1. setola created this gist Aug 29, 2014.
    128 changes: 128 additions & 0 deletions test.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,128 @@
    <!DOCTYPE html>
    <html>
    <head lang="en">
    <meta charset="UTF-8">
    <title>Tests for Banana Tool</title>
    <link rel='stylesheet'
    test='file from external cdn without scheme'
    id='reset-css'
    href='//cdnjs.cloudflare.com/ajax/libs/normalize/3.0.0/normalize.min.css'
    type='text/css'
    media='screen'/>
    <link rel='stylesheet'
    test='css from given domain with given scheme'
    id='bootstrap-css'
    href='http://bluhotels.prod.fbcmsv2.fblab.me/wp-content/themes/blu-hotels/css/bootstrap.min.css'
    type='text/css'
    media='screen'/>
    <link rel='stylesheet'
    test='css from given domain on https'
    id='bootstrap-css'
    href='https://bluhotels.prod.fbcmsv2.fblab.me/wp-content/themes/blu-hotels/css/bootstrap.min.css'
    type='text/css'
    media='screen'/>
    <link rel='stylesheet'
    test='css from cdn without scheme and with query string'
    id='bilbo-css'
    href='//fonts.googleapis.com/css?family=Bilbo&#038;subset=latin%2Clatin-ext&#038;ver=3.0.0'
    type='text/css'
    media='screen'/>
    </head>
    <body>
    <div>
    <a class="active"
    test='anchor to domain with scheme'
    href="http://bluhotels.prod.fbcmsv2.fblab.me/">Test domain with Scheme
    </a>
    <a title="Blu Tribe"
    test='anchor with domain and path'
    href="http://bluhotels.prod.fbcmsv2.fblab.me/affiliazione/">Test domain with Scheme and path
    </a>
    <a class="active"
    test='anchor to domain with https'
    href="https://bluhotels.prod.fbcmsv2.fblab.me/">Test domain with Scheme
    </a>
    <a title="Blu Tribe"
    test='anchor with domain and path on https'
    href="https://bluhotels.prod.fbcmsv2.fblab.me/affiliazione/">Test domain with Scheme and path
    </a>

    <p test="paragraph with plain text contain url to domain">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer quis venenatis est. Donec eu est eu
    orci pulvinar semper eu sit amet magna. Duis hendrerit arcu
    http://bluhotels.prod.fbcmsv2.fblab.me/affiliazione/ molestie risus eleifend lacinia. Praesent sodales
    neque
    <p>
    <p test="paragraph with plain text containing relative url to domain"> sit amet felis malesuada. Fusce magna
    mi, porttitor eget nunc eget, fermentum cursus /affiliazione augue. Integer sagittis arcu sapien,
    lobortis dictum urna elementum eu. Vestibulum at sem vitae odio rhoncus vulputate non vitae ex. Interdum
    et malesuada fames ac ante ipsum primis in faucibus.
    </p>
    <p test="paragraph with plain text containing url to domain without scheme - with and without initial slashes">
    Pellentesque mollis urna eget leo viverra, vitae pulvinar lectus tincidunt. Suspendisse in ex diam. Cum
    sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
    bluhotels.prod.fbcmsv2.fblab.me Nulla id nisi nisl. Sed sapien libero, molestie venenatis
    //bluhotels.prod.fbcmsv2.fblab.me laoreet eu, malesuada sed nisi.
    </p>
    <img test="image with full url"
    src="http://bluhotels.prod.fbcmsv2.fblab.me/wp-content/uploads/sites/113/2014/02/offerte-300x300.jpg">
    <img test="image with full url on https"
    src="https://bluhotels.prod.fbcmsv2.fblab.me/wp-content/uploads/sites/113/2014/02/offerte-300x300.jpg">
    <img test="image with full url"
    src="//bluhotels.prod.fbcmsv2.fblab.me/wp-content/uploads/sites/113/2014/02/offerte-300x300.jpg">
    <img test="image with full url"
    src="/wp-content/uploads/sites/113/2014/02/offerte-300x300.jpg">
    <img test="dynamically generated image with full url"
    src="http://bluhotels.prod.fbcmsv2.fblab.me/wp-admin/admin-ajax.php?action=responsive_image&id=403&w=1904&size=slideshow">
    <img test="dynamically generated image with full url on https"
    src="https://bluhotels.prod.fbcmsv2.fblab.me/wp-admin/admin-ajax.php?action=responsive_image&id=403&w=1904&size=slideshow">
    <img test="dynamically generated image with url without scheme"
    src="//bluhotels.prod.fbcmsv2.fblab.me/wp-admin/admin-ajax.php?action=responsive_image&id=403&w=1904&size=slideshow">
    <img test="dynamically generated image with relative url"
    src="/wp-admin/admin-ajax.php?action=responsive_image&id=403&w=1904&size=slideshow">
    </div>

    <div test="this div shouldn't be affected by rewrite">
    <p test="paragraph with plain text contain url to slightly different domain">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer quis venenatis est. Donec eu est eu
    orci pulvinar semper eu sit amet magna. Duis hendrerit arcu
    http://bluhotels2.prod.fbcmsv2.fblab.me/affiliazione/ molestie risus eleifend lacinia. Praesent sodales
    neque
    <p>
    <p test="paragraph with plain text containing relative url to slightly different domain"> sit amet felis
    malesuada. Fusce magna mi, porttitor eget nunc eget, fermentum cursus /affiliazione2 augue. Integer
    sagittis arcu sapien, lobortis dictum urna elementum eu. Vestibulum at sem vitae odio rhoncus vulputate
    non vitae ex. Interdum et malesuada fames ac ante ipsum primis in faucibus.
    </p>
    <p test="paragraph with plain text containing url to slightly different domain without scheme - with and without initial slashes">
    Pellentesque mollis urna eget leo viverra, vitae pulvinar lectus tincidunt. Suspendisse in ex diam. Cum
    sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
    bluhotels2.prod.fbcmsv2.fblab.me Nulla id nisi nisl. Sed sapien libero, molestie venenatis
    //bluhotels2.prod.fbcmsv2.fblab.me laoreet eu, malesuada sed nisi.
    </p>
    </div>
    <script>
    var testBasePath = 'http://bluhotels.prod.fbcmsv2.fblab.me';
    var testBasePathHttps = 'https://bluhotels.prod.fbcmsv2.fblab.me';
    var testBasePathWithoutScheme = '//bluhotels.prod.fbcmsv2.fblab.me';
    var testBasePathWithoutScheme2 = 'bluhotels.prod.fbcmsv2.fblab.me';
    var relativePath = '/affiliazione';
    var relativePath2 = '/affiliazione/';
    var functionTest = function (t) {
    return 'http://bluhotels.prod.fbcmsv2.fblab.me';
    };
    functionTest('http://bluhotels.prod.fbcmsv2.fblab.me');
    functionTest('https://bluhotels.prod.fbcmsv2.fblab.me');
    functionTest('//bluhotels.prod.fbcmsv2.fblab.me');
    functionTest('bluhotels.prod.fbcmsv2.fblab.me');
    functionTest('/affiliazione');
    functionTest('/affiliazione/');
    functionTest("http://bluhotels.prod.fbcmsv2.fblab.me");
    functionTest("https://bluhotels.prod.fbcmsv2.fblab.me");
    functionTest("//bluhotels.prod.fbcmsv2.fblab.me");
    functionTest("bluhotels.prod.fbcmsv2.fblab.me");
    functionTest("/affiliazione");
    functionTest("/affiliazione/");
    </script>
    </body>
    </html>