Skip to content

Commit

Permalink
Changed name to , also added folder because it is required for the gi…
Browse files Browse the repository at this point in the history
…thub example
  • Loading branch information
unimonkiez committed Apr 14, 2016
1 parent e80634b commit ddff906
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 36 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
node_modules/
dist/
npm-debug.log
59 changes: 59 additions & 0 deletions dist/emoji-window.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};

/******/ // The require function
/******/ function __webpack_require__(moduleId) {

/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;

/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };

/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);

/******/ // Flag the module as loaded
/******/ module.loaded = true;

/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }


/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;

/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;

/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";

/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {

module.exports = __webpack_require__(1);


/***/ },
/* 1 */
/***/ function(module, exports) {

"use strict";

alert(12223);

/***/ }
/******/ ]);
1 change: 1 addition & 0 deletions dist/emoji-window.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions example/example.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import EmojiWindow from 'emoji-window';
import EmojiPanel from 'emoji-panel';

document.getElementById('button-example-1').addEventListener('click', e => {
new EmojiWindow({
position: {
el: e.target
}
});
new EmojiPanel();
});
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<title>Emoji window example</title>
<title>Emoji panel example</title>
</head>
<body>
<div>
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "emoji-window",
"name": "emoji-panel",
"version": "0.0.0",
"description": "Add window picker for emojis with different types of sets on your website. http://TimeToKnow.github.io/emoji-window/",
"main": "dist/emoji-window.js",
"description": "Add panel picker for emojis with different types of sets on your website. http://TimeToKnow.github.io/emoji-panel/",
"main": "dist/emoji-panel.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack --progress",
Expand All @@ -11,12 +11,12 @@
},
"repository": {
"type": "git",
"url": "https://github.com/TimeToKnow/emoji-window"
"url": "https://github.com/TimeToKnow/emoji-panel"
},
"keywords": [
"emoji",
"picker",
"window",
"panel",
"twitter",
"ios",
"android",
Expand Down
20 changes: 0 additions & 20 deletions src/emoji-window.js → src/emoji-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,6 @@ import getImageSetTemplate from './get-image-set-template';
let existingWindowImageSetsWrapper;
const existingWindowImageSets = {};
export default class EmojiWindow {
static getTopLeft({
el, x, y
} = {}) {
if (__DEV__ && el === undefined && (x === undefined || y === undefined)) {
throw new Error('Must provide `position` with `x` and `y`, or `el` to open from.');
}
let left = x;
let top = y;
if (left === undefined) {
left = el.offsetLeft + el.clientWidth;
}
if (top === undefined) {
top = el.offsetTop + el.clientHeight;
}
return {
left,
top
};
}
static getWindowImageSetByImageSet(imageSet) {
const existingWindowImageSet = existingWindowImageSets[imageSet];
// If windowImageSet exists on object, return it,
Expand Down Expand Up @@ -55,7 +36,6 @@ export default class EmojiWindow {
throw new Error('`imageSet` should have one of `EmojiWindow.IMAGE_SET` values, got ${imageSet}.');
}
}
const { left, top } = EmojiWindow.getTopLeft(position);
const windowImageSet = EmojiWindow.getWindowImageSetByImageSet(imageSet);
}
}
Expand Down
6 changes: 3 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const __DEV__ = !__PROD__;
module.exports = {
devtool: false,
entry: {
'emoji-window': [
'./src/emoji-window.js'
'emoji-panel': [
'./src/emoji-panel.js'
],
example: [
'./example/example.js'
Expand Down Expand Up @@ -62,7 +62,7 @@ module.exports = {
},
resolve: {
alias: {
'emoji-window': path.join(__dirname, 'src', 'emoji-window.js')
'emoji-panel': path.join(__dirname, 'src', 'emoji-panel.js')
}
}
};

0 comments on commit ddff906

Please sign in to comment.