Git Product home page Git Product logo

vanilla-plugin's Introduction

Sketchfab Vanilla Forums Plugin

This repo contains the code for a plugin that can be installed on instances of Vanilla Forum > 2.2. It's fairly simple : it allows (enforces really) the embedding of sketchfab viewers in topics or comments.

The plugin can either be built by cloning this repo and executing build.sh, or by visiting The Vanilla forums addon marketplace or the plugin page directly.

Scope


There are several limitations which resulted in the current behaviour of the plugin :

  • We have to hook into the advanced editor plugin
  • Vanilla Forums doesn't allow < iframe /> embed to be saved in DB (and many other HTML features : HTML is extremely stripped down before save, and there isn't too much control on that. At all.)
  • Vanilla Forums doesn't handle BBCode too much, it has some basic support for migration from other platforms but is not extensible. Plugins could make it extensible, but dependencies ... Besides, the plugin ecosystem of Vanilla Forums does not seem to be extremely trustworthy (save for the offical plugins, of which Advanced Editor is a part).

How it works


The plugin has a main .php file that describes it (its dependencies, repo, author etc.) and hooks into the rendering process of the Vanilla page to insert its own html/js/css at the relevant places. Most if not all the work is done by the js file.

At page load, two things happen :

  • The plugin initializes the sketchfab button in all the editor instances on the page. Binds events to the button, constructs the popup, etc.
  • The plugin looks for tags on the page that had been saved before and replaces these tags by the sketchfab embed code.

Then, the user can click the sketchfab button and paste his model URI in the ensuing popup, which will insert the correct tag in the body of the text that's being written. This tag will be replaced by the plugin once it is posted.

vanilla-plugin's People

Contributors

arthurjamain avatar linc avatar padrezippo avatar pierreant-p avatar

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.