Giter VIP home page Giter VIP logo

wikiembed's Introduction

wikiembed v0.0.1

wikipedia content box plugin

Install

npm install wikiembed --save

yarn add wikiembed -S

Usage

Pure javascript

<div id="container" />
<script>
  var container = document.getElementById('container')
  var options = {
    sampleConfig: 'Overwrite by plugin user',
    onSampleEvent: function (args) {
      console.log('onSampleEvent passed from applicaiton')
    }
  }
  wikiembed(container, options)
</script>

Vue

<template>
  <div id="app">
    <img alt="Vue logo" src="./assets/logo.png">
    <SveltePlugin 
    @onSampleEvent="handleClick" 
    @onSampleEventOver="handleOver" 
    :options="{
       sampleConfig: 'passed from vue js'
    }" />
  </div>
</template>
<script>
import SveltePlugin from '../../../public/wikiembed-vue.js'
export default {
  name: 'app',
  components: { SveltePlugin},
  methods: {
    handleOver () {
      console.log('Vue handle mouse over vue js')
    },
    handleClick () {
      alert('alert from vue js')
    }
  }
}
</script>

React

import React from 'react';
import logo from './logo.svg';
import './App.css';
import SveltePlugin from './wikiembed-react.js'
function App() {
  const handleClick = () => alert('alert from react')
  return (
    <div className="App">
      <header className="App-header">
        <img src={logo} className="App-logo" alt="logo" />
        <SveltePlugin onSvelteclick={handleClick} name="(attr passed from react js to svlete)" />
      </header>
    </div>
  );
}

export default App;

Contribute

Start svelte dev server

npm run dev 

Start pure JavaScript dev server

What is IIFE?

npm run iife 

Install vue demo application packages

npm run install-vue-demo

Start vue dev server

npm run vue 

Install react demo application packages

npm run install-react-demo

Start react dev server

npm run react 

Kill node process on ports

npm run clear 

wikiembed's People

Contributors

fariborzemami avatar

Watchers

 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.