markdown 2018年EMEA峰会实验室备忘单

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 2018年EMEA峰会实验室备忘单相关的知识,希望对你有一定的参考价值。

# TL8 - Programming Adobe Launch Extensions

## Brief Introduction

* Lab intro and house keeping items
* Key concepts
* User interface review & highlights

## Part 1: Scaffold setup (HTML pattern)

### Sandbox

* From `master` branch type `npm run sandbox`
* Review view & lib sandbox with tag firing

### Scaffold tool & configuration view

#### Prep

* `cd extension-html-pattern`
* `git checkout lab`
* `git checkout html-start`

#### Scaffold tool

* `npm run scaffold`
* **First Checkpoint**: `git checkout -f after-scaffold`

#### configuration.html

* A simple form and three functions

Form:  

    ```
    <form>
      <label>
        <span>Hotjar ID</span>
      <input id="hjid">
      </label>
    </form>
    ```

`init` method:  

    ```
    document.getElementById('hjid').value = (info.settings.hjid) || '';
    ```

`getSettings` method:  

    ```
    return {
      hjid: Number(document.getElementById('hjid').value)
    };
    ```

`validate` method:  

    ```
    var hjidField = document.getElementById('hjid');
    var hjid = Number(hjidField.value);
    hjidField.invalid = isNaN(hjid) || hjid < 1;
    return !hjidField.invalid;
    ```

**Second Checkpoint**: `git checkout -f after-config`  

#### Library Module

* loadHotjarCode.js  

`getExtensionSettings()`:  

    ```
    var extensionSettings = turbine.getExtensionSettings();
    ```

**`// hotjar code`**:

    ```
    (function (h, o, t, j, a, r) {
      h.hj = h.hj || function () { (h.hj.q = h.hj.q || []).push(arguments) };
      h._hjSettings = { hjid: extensionSettings.hjid, hjsv: 6 };
      a = o.getElementsByTagName('head')[0];
      r = o.createElement('script'); r.async = 1;
      r.src = t + h._hjSettings.hjid + j + h._hjSettings.hjsv;
      a.appendChild(r);
    })(window, document, 'https://static.hotjar.com/c/hotjar-', '.js?sv=');
    ```

**Third Checkpoint**: `git checkout -f after-lib`  

#### Sandbox (Take 2)

* `npm run sandbox` (check action)
* `control c`
* Fixes
* Fourth Checkpoint: `git checkout -f fixed-sandbox`  

## Part 2: JS Template setup (JS pattern)

* What's the same?
* What's different?

## Part 3: Q&A & Resources

* Thank you!

以上是关于markdown 2018年EMEA峰会实验室备忘单的主要内容,如果未能解决你的问题,请参考以下文章

CSS2018 | 腾讯安全联合实验室发布《CSS视角下的2018年全球网络安全十大议题》

CSS2018互联网安全领袖峰会在京召开

CSS2018安全领袖峰会:汇聚全球安全领袖 共建数字安全新生态

最新观点 | 2018年Kubernetes发展预测

Docker 出席 2018 年政府峰会,看新技术如何改善服务

重磅预告|分布式存储2020年度峰会暨雅典娜2021年50亿投产建设发布会将在成都举行