npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

yeditor

v1.0.1

Published

Front-end editor for web page

Downloads

2

Readme

Yeditor

Yeditor

Front-End Editor for web page

npm

$npm install yeditor --save

Init

Add Yeditor file into your html file

<head>
  <link rel="stylesheet" href="Yeditor.min.css" />
  <script src="Yeditor.min.js"></script>
</head>

Yeditor includes two parts:

  • Main function
  • Editable elements

Main function

Initialize Yeditor (add Element prototype and plugin navigations)

var Editor = new Yeditor({
  // OPTIONS
});

Options

  • openNavigation: (Boolean) (default: true) - if the main navigation is open in the begining

  • uploadImage: (function) (defalut: null) - when the user using images (as backgound or image) what to do with the src (image url) ? if this value is empty (null) - the src will be base64 data url. but if do you want to upload the image to your server and get the url from there, use this function see example below:

uploadImage: function(file, callback){
  // Demo jquery ajax 
  // send the @file 
  <SEND THE @FILE TO YOUR SERVER>.then(function(url){
    // the server response is the file url
    // call to @callback fn with @url as argument
    callback(url);
  });
}
  • url: (String) (default: null) - the ajax url (for save function) - if this value is empty (null) the save button will stay hidden and dont show up

  • method: (String) (default: 'POST') the ajax request method

  • done: (Function) (defalut: null) the ajax requset done status

  • success: (Function) (defalut: null) the ajax requset success status

  • failed: (Function) (defalut: null) the ajax requset failed status

  • navMainOrder: (Array) (defalut: null) the order of main navigation button the order is by buttons name (use navigation api), (optional: insert html into the navigation). see example below:

// regular order
navMainOrder: ['button 1', 'button 2']

// with html
navMainOrder: ['button 1', 'button 2', ['<span>THE HTML NEED TO BE INSIDE ARRAY</span>'], 'button 3']

** IMPORTANT **
You must use in the button name for this options, 
get all the navigation buttons name by using the api
  • navImageOrder: the order of image navigation - use it same as navMainOrder

  • navBackgroundOrder: the order of background navigation - use it same as navMainOrder

Editable function

For editing Element:

// element
var title = document.getElementById('title');

// edit
title.editable({
  // OPTIONS
});

Options

  • name: (String) (default: null) the name of the editable element. the name is 'key', the 'value' = this element content, for ajax request - sending it to the server