Giter Club home page Giter Club logo

Comments (2)

thiagopnts avatar thiagopnts commented on May 17, 2024

This is our current approach:

Given the following plugin structure,

src/plugins/spinner_three_bounce
├── index.js
└── public
    ├── spinner.css
    └── spinner.html

The index.js is the plugin's code. In the public/ directory is the plugins assets. We currently only support .css and .html files. The .html file supports underscore templating. These files are loaded during build, it's contents are extracted and parsed to a src/base/jst.js file, which exports a hash with all templating and styles, where the plugin's name is the key. So, for loading a plugins template, you must call it through JST['plugin_name']. To load a style, call JST.CSS['plugin_name']. This file must be used in development when referring to templates or styles. For example:

var JST = require('../../base/jst');
var FooPlugin = BaseObject.extend({
  template: JST['foo'],
  render: function() {
      this.style = JST.CSS['foo']; // here the style variable has all the css file content.
      return this;
  }
});

from clappr.

thiagopnts avatar thiagopnts commented on May 17, 2024

We also have to reset the style of all data attributes used by the player to avoid style collisions

from clappr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.