Code Monkey home page Code Monkey logo

snapprojectembed's Introduction

Build Status code style: prettier

⚠️ This branch is unsuitable for use in production. You should switch to the "stable" branch for production wikis.

Snap! Project Embed

A MediaWiki extension for embedding Snap! projects

Usage

  • Loading a project with Snap!'s default width and height: <snap project="project-name" user="user" />
  • Loading a project with custom width and height:
  • <snap project="project-name" user="user" width="width" height="height" />
  • Loading a project without showing the title and author of the project (defaults to true): <snap project="project-name" user="user" width="width" taa="false" />
  • Loading a project without the edit button (defaults to true): <snap project="project-name" user="user" edit="false" />
  • Loading a project without the pause button (defaults to true): <snap project="project-name" user="user" pause="false" />
  • Loading a project inside a HTML details tag to make it visible only after an arrow has been clicked (defaults to false): <snap project="project-name" user="user" hide="true" />

You can also use the extension like this- <snap project="project-name" user="user"></snap>. Additionally, instead of using the <snap> tag, you can also use the <snap-project> tag.

Filesystem

.
└── 📂 .github # GitHub Configuration - Safe to delete
    └── 📜 dependabot.yml # Dependabot configuration
    └── 📂 workflows # GitHub Workflows
        └── 📜 ci.yml # Continous Integration configuration
└── 📂 .phan # Phan configuration directory - Safe to delete
    └── 📜 config.php # Phan configuration file
└── 📂 i18n # Translations for extension
    └── 📜 bn.json # Bengali translation
    └── 📜 en.json # English translation
    └── 📜 eo.json # Esperanto translation
    └── 📜 it.json # Italian translation
└── 📂 includes # PHP code that power the extension
    └── 📜 EmbedSnap.php # Main extension file - The most important file of all!
└── 📜 .gitignore # Lists files that Git should ignore
└── 📜 LICENSE # License file
└── 📜 README.md # The file you are reading right now!
└── 📜 composer.json # Lists all Composer dependencies - Safe to delete
└── 📜 composer.lock # Lock file for Composer - Safe to delete
└── 📜 extension.json # Extension manifest
└── 📜 phpcs.xml # PHP CodeSniffer configuration - Safe to delete

Installation

  1. Clone this repository with Git into your "Extensions" folder using the following command:
git clone https://github.com/snapwiki/SnapProjectEmbed.git
  1. Update LocalSettings.php to add the following line:
wfLoadExtension( 'SnapProjectEmbed' );
  1. Go to Special:Version in your wiki and look at the "Installed extensions" section. It should now list SnapProjectEmbed and its version, license and contributors.

Credits

A big thank you to mw-embedScratch contributors which was our original design inspiration.

Legal

SnapProjectEmbed - A MediaWiki extension that allows embedding Snap! projects.

Copyright (C) 2020-2024 Radman Siddiki and GrahamSH

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Old Versions

The current version of Snap! Project Embed is 3.x. If you would like to use an older version, please switch to its respective branch-

  • v1: v1
  • v2: v2

snapprojectembed's People

Contributors

dardoro avatar dependabot-preview[bot] avatar dependabot[bot] avatar grahamsh-llk avatar paladox avatar r4356th avatar rubenverg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

snapprojectembed's Issues

Change Our Branch Policy

We have got a lot of continuous integration-related files in our codebase. We should store these in a separate branch along with untested code that are yet to be included in a release to make sure only tested code is downloaded and used everywhere.

  • Make a new branch
  • Delete all unnecessary files from the new branch
  • Update README of the new branch
  • Publish first minor release (v2.6.0) from the new branch
  • Update documentation on MediaWiki.org
  • Get Miraheze to switch to the new branch
  • Backport all changes to master since version 2's release to the v2 branch
  • Delete all old minor version branches (like v2.1.0) with the exception of v1.1 (for now)
  • Make new v1 branch
  • Delete old v1.1 branch
  • Stop advertising minor version branches
  • Document this in the README of the master branch

Also, once MediaWiki 1.36 is released, we should make a new REL1_35 branch. This should continue for all future MediaWiki versions.

N.B.: All the tasks mentioned above may not necessarily be done in the order they have been written in.

Setup Better CI

We should consider using Phan and PHP Code Sniffer (the one published by Wikimedia) instead of GitHub Actions and Prettier as those are widely used, well maintained and good for security.

Tasks:

  • Set up Phan
  • Set up PHP CS
  • Set up PHP Parallel Lint

v2 Features

  • Enable toggling of values such as

    • Project title and author
    • Edit button
    • Pause button
  • Ability to use <details> <summary> </summary></details>

  • Linking the MediaWiki page instead of this repository

  • Adding a class ("snap-project") to the rendered iframe

  • Adding new parser hook "snap-project"

  • Add qqq.json

  • Make renderEmbedSnap a public static function

  • Change extension display name to "Snap! Project Embed"

Polish localization proposal

i18n\pl.json

{
"@metadata": {
"autor": "R4356th, GrahamSH, mw-embedScratch współautorzy"
},
"embedsnap-desc": "Osadzanie projektu Snap!",
"error-project": "<p style="color:red;">Błąd: brak nazwy projektu

",
"error-username": "<p style="color:red;">Błąd: brak nazwy użytkownika

"
}

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.