Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add favorite & 收藏夹 & html-imports & dynamic-imports #55

Open
xgqfrms opened this issue Oct 22, 2018 · 30 comments
Open

add favorite & 收藏夹 & html-imports & dynamic-imports #55

xgqfrms opened this issue Oct 22, 2018 · 30 comments
Labels
add favorite & 收藏夹 add favorite & 收藏夹 dynamic-imports dynamic-imports & html imports html-imports & dynamic-imports html-imports & dynamic-imports

Comments

@xgqfrms
Copy link
Owner

xgqfrms commented Oct 22, 2018

add favorite & 收藏夹

// 收藏夹

function favorite (){
    var ctrl = (navigator.userAgent.toLowerCase()).indexOf("mac") !== -1 ? "Command/Cmd" : "Ctrl";
    if (document.all){
        window.external.addFavorite("https://www.xgqfrms.xyz", "");
    } else if (window.sidebar){
        window.sidebar.addPanel("官网", "https://www.xgqfrms.xyz", "");
    } else {
        alert("您可以通过快捷键" + ctrl + " + D 加入到收藏夹");
    }
}
Repository owner locked and limited conversation to collaborators Oct 22, 2018
@xgqfrms
Copy link
Owner Author

xgqfrms commented Oct 22, 2018

shit IE

table border bug

image

> `border-collapse: collapse;`

table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 13px;
    font-weight: normal;
    overflow: hidden;
    margin-bottom: 15px;
    color: #727272;
}

IE table border border-collapse bug?

https://stackoverflow.com/questions/16682591/border-collapse-not-working-in-ie10

table{
    border-collapse: collapse;
}
table td{
    border: 1px solid black;
}

solution

table{
    border-spacing: 0px;
    border-top: 1px solid black;
    border-right: 1px solid black;
}
table td{
    border-left: 1px solid black;
    border-bottom: 1px solid black;
}

https://stackoverflow.com/questions/15747859/border-not-appearing-in-ie9-ie10

table{
    border-top:1px solid #000;
}

tr{
    border-left:1px solid #000;
    border-bottom:1px solid #000;
}

td{
    border-right:1px solid #000;
}

https://stackoverflow.com/questions/19706555/ie-table-cell-border-bug-with-colspan-set

@xgqfrms
Copy link
Owner Author

xgqfrms commented Oct 22, 2018

@xgqfrms
Copy link
Owner Author

xgqfrms commented Oct 22, 2018

@xgqfrms
Copy link
Owner Author

xgqfrms commented Oct 22, 2018

@xgqfrms
Copy link
Owner Author

xgqfrms commented Oct 22, 2018

@xgqfrms
Copy link
Owner Author

xgqfrms commented Oct 22, 2018

solution

/* IE & shit table &  border-collapse: collapse; */

table>tr>td:nth-of-type(n) {
    border-left: 0;
    border-bottom: 0;
}

table {
    border-spacing: 0px;
    border-top: 1px solid #f0f0f0;
    border-right: 0;
}

table td {
    border-left: 1px solid #f0f0f0;
    border-bottom: 0;
    border-right: 0;
}

tbody>tr>td:nth-last-of-type(1) {
    border-right: 1px solid #f0f0f0;
}

tbody>tr:nth-last-of-type(1)>td {
    border-bottom: 1px solid #f0f0f0;
}

@xgqfrms
Copy link
Owner Author

xgqfrms commented Oct 22, 2018

@xgqfrms
Copy link
Owner Author

xgqfrms commented Oct 23, 2018

shit IE

no table border-collapse: collapse;

/* IE & shit table &  border-collapse: collapse; */

table {
    border-spacing: 0px;
    border-top: 1px solid #f0f0f0;
    border-right: 0;
}

table td {
    border-left: 1px solid #f0f0f0;
    border-bottom: 0;
    border-right: 0;
}

tbody>tr>td:nth-last-of-type(1) {
    border-right: 1px solid #f0f0f0;
}

tbody>tr:nth-last-of-type(1)>td {
    border-bottom: 1px solid #f0f0f0;
}

tbody>tr:nth-of-type(2n) {
    background: #f5f5f5;
}

tbody>tr:nth-of-type(2n + 1) {
    background: #fff;
}

tbody[id="tbody2"]>tr:nth-of-type(n) {
    background: #fff;
}
 

@xgqfrms
Copy link
Owner Author

xgqfrms commented Oct 23, 2018

https://github.com/webcomponents/webcomponentsjs/blob/v1/package.json

这个可以自己按需构建,你如果使用 npm 的引用方式,需要导入对应的模块才行。

image

https://github.com/webcomponents/webcomponentsjs/blob/v1/gulpfile.js

@xgqfrms
Copy link
Owner Author

xgqfrms commented Oct 23, 2018

@xgqfrms
Copy link
Owner Author

xgqfrms commented Oct 23, 2018

"use strict";

/**
 *
 * @author xgqfrms
 * @license MIT
 * @copyright xgqfrms
 *
 * @description HTMLImportsTest
 * @augments
 * @example
 *
 */

// no need jQuery
let $$ = {
    qs: function qs(uid) {
        return document.querySelector(uid);
    },
    qsa: function qsa(uid) {
        return document.querySelectorAll(uid);
    },
};

window.$ = $$;

// if (window.$) {
//     window.$ = Object.assign($, $$);
// } else {
//     window.$ = Object.assign({}, $$);
// }

function loadTemplate ()  {
    let templatesBox = document.querySelector('[data-template="template-container"'),
        link = document.querySelector('link[data-rel="containers"]'),
        // #document
        template = link ? link.import : null,
        div = template ? template.querySelector('[data-div="templates-containers"]') : null;
    if (div) {
        // read template once
        templatesBox.appendChild(div);
    } else {
        // exsit template
    }
};

function showDOM () {
    let container = $.qs('[data-test="html-template"]'),
        temp = $.qs('[data-template="template-containers-full-width"]'),
        clone = temp ? temp.content.cloneNode(true) : null;
    if (clone) {
        container.appendChild(clone);
    }
};

let uid = document.querySelector('[data-uid="result"]');

if (Modernizr.htmlimports) {
    // supported
    uid.innerHTML = '<span class="htmlimports">supported<span>';
} else {
    // not-supported
    uid.innerHTML = '<span class="no-htmlimports">not-supported<span>';
}


// DOM fully loaded and parsed!
document.addEventListener("DOMContentLoaded", function () {
    setTimeout(function () {
        if (Modernizr.htmlimports) {
            // preload && delay
            loadTemplate();
            // init
            showDOM();
        } else {
            // not-supported
           alert("template is not supported!");
        }
    }, 100);
});

@xgqfrms
Copy link
Owner Author

xgqfrms commented Oct 23, 2018

table width bug

auto width ???

https://www.layui.com/demo/table/auto.html

@xgqfrms
Copy link
Owner Author

xgqfrms commented Oct 23, 2018

@xgqfrms
Copy link
Owner Author

xgqfrms commented Oct 23, 2018

@xgqfrms
Copy link
Owner Author

xgqfrms commented Oct 23, 2018

@xgqfrms
Copy link
Owner Author

xgqfrms commented Oct 23, 2018

@xgqfrms xgqfrms added the dynamic-imports dynamic-imports & html imports label Oct 23, 2018
@xgqfrms
Copy link
Owner Author

xgqfrms commented Oct 23, 2018

@xgqfrms
Copy link
Owner Author

xgqfrms commented Oct 23, 2018

@xgqfrms
Copy link
Owner Author

xgqfrms commented Oct 23, 2018

Game Bar & YouTube video records

Windows 10

C:\Users\xgqfrms\Videos\Captures

Win + G
Win + Alt + G
Win + Alt + R

Win + Alt + M
Win + Alt + B
Win + Alt + W

Win + Alt + PrtSrc

@xgqfrms
Copy link
Owner Author

xgqfrms commented Oct 23, 2018

@xgqfrms
Copy link
Owner Author

xgqfrms commented Oct 24, 2018

html-imports & dynamic-imports

https://github.com/webcomponents/html-imports#dynamic-imports

@xgqfrms xgqfrms changed the title add favorite & 收藏夹 add favorite & 收藏夹 & html-imports & dynamic-imports Oct 24, 2018
@xgqfrms xgqfrms added the add favorite & 收藏夹 add favorite & 收藏夹 label Oct 24, 2018
@xgqfrms xgqfrms added the html-imports & dynamic-imports html-imports & dynamic-imports label Oct 24, 2018
@xgqfrms
Copy link
Owner Author

xgqfrms commented Oct 24, 2018

@xgqfrms
Copy link
Owner Author

xgqfrms commented Mar 18, 2019

@xgqfrms
Copy link
Owner Author

xgqfrms commented Jul 5, 2020

@xgqfrms
Copy link
Owner Author

xgqfrms commented Mar 25, 2023

ESM & import() & dynamic import All In One

作者:xgqfrms
链接:https://www.cnblogs.com/xgqfrms/p/16965768.html
来源:https://www.cnblogs.com
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
©xgqfrms 2012-2023
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
add favorite & 收藏夹 add favorite & 收藏夹 dynamic-imports dynamic-imports & html imports html-imports & dynamic-imports html-imports & dynamic-imports
Projects
None yet
Development

No branches or pull requests

1 participant