From 8f0aa2bcbdd51c543e976dbb96d513cbe1c1fed5 Mon Sep 17 00:00:00 2001 From: mohiit1502 Date: Thu, 26 Jul 2018 04:38:05 +0530 Subject: [PATCH] Refactor - stage 1 --- dist/bundle.js | 88 +++++- history.json | 0 public/index.html | 160 +--------- ...event-toggles.js => app-event-triggers.js} | 55 +++- src/js/app.js | 2 +- src/js/bot/bot.js | 57 ---- src/js/bot/config.js | 3 - src/js/bot/recast-ops.js | 92 ------ src/js/bot/server.js | 47 --- src/js/config.js | 18 ++ src/js/data/history.js | 14 + src/js/helper.js | 5 - src/js/helpers/helper.js | 36 +++ src/js/persistent-ops.js | 28 -- src/js/{ => services}/dom-ops.js | 273 +++++------------- src/js/{ => services}/github-ops.js | 17 +- src/js/{ => services}/microbot-ops.js | 11 +- src/js/services/persistent-ops.js | 182 ++++++++++++ src/js/services/recast-ops.js | 50 ++++ src/js/state.js | 7 - src/js/views/addcollab.js | 23 ++ src/js/views/addissuecomment.js | 23 ++ src/js/views/closeissue.js | 18 ++ src/js/views/createissue.js | 33 +++ src/js/views/createrepo.js | 43 +++ src/js/views/displaylastcomment.js | 18 ++ src/js/views/viewrepos.js | 13 + src/styles/scss/base.scss | 4 + 28 files changed, 694 insertions(+), 626 deletions(-) delete mode 100644 history.json rename src/js/{event-toggles.js => app-event-triggers.js} (64%) delete mode 100644 src/js/bot/bot.js delete mode 100644 src/js/bot/config.js delete mode 100644 src/js/bot/recast-ops.js delete mode 100644 src/js/bot/server.js create mode 100644 src/js/data/history.js delete mode 100644 src/js/helper.js create mode 100644 src/js/helpers/helper.js delete mode 100644 src/js/persistent-ops.js rename src/js/{ => services}/dom-ops.js (66%) rename src/js/{ => services}/github-ops.js (95%) rename src/js/{ => services}/microbot-ops.js (92%) create mode 100644 src/js/services/persistent-ops.js create mode 100644 src/js/services/recast-ops.js delete mode 100644 src/js/state.js create mode 100644 src/js/views/addcollab.js create mode 100644 src/js/views/addissuecomment.js create mode 100644 src/js/views/closeissue.js create mode 100644 src/js/views/createissue.js create mode 100644 src/js/views/createrepo.js create mode 100644 src/js/views/displaylastcomment.js create mode 100644 src/js/views/viewrepos.js diff --git a/dist/bundle.js b/dist/bundle.js index 4d32664..1845ccd 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -119,6 +119,18 @@ eval("/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAu /***/ }), +/***/ "./node_modules/redux/es/redux.js": +/*!****************************************!*\ + !*** ./node_modules/redux/es/redux.js ***! + \****************************************/ +/*! exports provided: createStore, combineReducers, bindActionCreators, applyMiddleware, compose, __DO_NOT_USE__ActionTypes */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createStore\", function() { return createStore; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"combineReducers\", function() { return combineReducers; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bindActionCreators\", function() { return bindActionCreators; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"applyMiddleware\", function() { return applyMiddleware; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"compose\", function() { return compose; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__DO_NOT_USE__ActionTypes\", function() { return ActionTypes; });\n/* harmony import */ var symbol_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! symbol-observable */ \"./node_modules/symbol-observable/es/index.js\");\n\n\n/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\nvar ActionTypes = {\n INIT: '@@redux/INIT' + Math.random().toString(36).substring(7).split('').join('.'),\n REPLACE: '@@redux/REPLACE' + Math.random().toString(36).substring(7).split('').join('.')\n};\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\n/**\n * @param {any} obj The object to inspect.\n * @returns {boolean} True if the argument appears to be a plain object.\n */\nfunction isPlainObject(obj) {\n if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object' || obj === null) return false;\n\n var proto = obj;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(obj) === proto;\n}\n\n/**\n * Creates a Redux store that holds the state tree.\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\nfunction createStore(reducer, preloadedState, enhancer) {\n var _ref2;\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = preloadedState;\n preloadedState = undefined;\n }\n\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error('Expected the enhancer to be a function.');\n }\n\n return enhancer(createStore)(reducer, preloadedState);\n }\n\n if (typeof reducer !== 'function') {\n throw new Error('Expected the reducer to be a function.');\n }\n\n var currentReducer = reducer;\n var currentState = preloadedState;\n var currentListeners = [];\n var nextListeners = currentListeners;\n var isDispatching = false;\n\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = currentListeners.slice();\n }\n }\n\n /**\n * Reads the state tree managed by the store.\n *\n * @returns {any} The current state tree of your application.\n */\n function getState() {\n if (isDispatching) {\n throw new Error('You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');\n }\n\n return currentState;\n }\n\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param {Function} listener A callback to be invoked on every dispatch.\n * @returns {Function} A function to remove this change listener.\n */\n function subscribe(listener) {\n if (typeof listener !== 'function') {\n throw new Error('Expected the listener to be a function.');\n }\n\n if (isDispatching) {\n throw new Error('You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.');\n }\n\n var isSubscribed = true;\n\n ensureCanMutateNextListeners();\n nextListeners.push(listener);\n\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n\n if (isDispatching) {\n throw new Error('You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.');\n }\n\n isSubscribed = false;\n\n ensureCanMutateNextListeners();\n var index = nextListeners.indexOf(listener);\n nextListeners.splice(index, 1);\n };\n }\n\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param {Object} action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns {Object} For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');\n }\n\n if (typeof action.type === 'undefined') {\n throw new Error('Actions may not have an undefined \"type\" property. ' + 'Have you misspelled a constant?');\n }\n\n if (isDispatching) {\n throw new Error('Reducers may not dispatch actions.');\n }\n\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n\n var listeners = currentListeners = nextListeners;\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n listener();\n }\n\n return action;\n }\n\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param {Function} nextReducer The reducer for the store to use instead.\n * @returns {void}\n */\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== 'function') {\n throw new Error('Expected the nextReducer to be a function.');\n }\n\n currentReducer = nextReducer;\n dispatch({ type: ActionTypes.REPLACE });\n }\n\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns {observable} A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n function observable() {\n var _ref;\n\n var outerSubscribe = subscribe;\n return _ref = {\n /**\n * The minimal observable subscription method.\n * @param {Object} observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns {subscription} An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe: function subscribe(observer) {\n if ((typeof observer === 'undefined' ? 'undefined' : _typeof(observer)) !== 'object' || observer === null) {\n throw new TypeError('Expected the observer to be an object.');\n }\n\n function observeState() {\n if (observer.next) {\n observer.next(getState());\n }\n }\n\n observeState();\n var unsubscribe = outerSubscribe(observeState);\n return { unsubscribe: unsubscribe };\n }\n }, _ref[symbol_observable__WEBPACK_IMPORTED_MODULE_0__[\"default\"]] = function () {\n return this;\n }, _ref;\n }\n\n // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n dispatch({ type: ActionTypes.INIT });\n\n return _ref2 = {\n dispatch: dispatch,\n subscribe: subscribe,\n getState: getState,\n replaceReducer: replaceReducer\n }, _ref2[symbol_observable__WEBPACK_IMPORTED_MODULE_0__[\"default\"]] = observable, _ref2;\n}\n\n/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nfunction warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n } catch (e) {} // eslint-disable-line no-empty\n}\n\nfunction getUndefinedStateErrorMessage(key, action) {\n var actionType = action && action.type;\n var actionDescription = actionType && 'action \"' + String(actionType) + '\"' || 'an action';\n\n return 'Given ' + actionDescription + ', reducer \"' + key + '\" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state. ' + 'If you want this reducer to hold no value, you can return null instead of undefined.';\n}\n\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n var reducerKeys = Object.keys(reducers);\n var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n\n if (!isPlainObject(inputState)) {\n return 'The ' + argumentName + ' has unexpected type of \"' + {}.toString.call(inputState).match(/\\s([a-z|A-Z]+)/)[1] + '\". Expected argument to be an object with the following ' + ('keys: \"' + reducerKeys.join('\", \"') + '\"');\n }\n\n var unexpectedKeys = Object.keys(inputState).filter(function (key) {\n return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];\n });\n\n unexpectedKeys.forEach(function (key) {\n unexpectedKeyCache[key] = true;\n });\n\n if (action && action.type === ActionTypes.REPLACE) return;\n\n if (unexpectedKeys.length > 0) {\n return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('\"' + unexpectedKeys.join('\", \"') + '\" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('\"' + reducerKeys.join('\", \"') + '\". Unexpected keys will be ignored.');\n }\n}\n\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach(function (key) {\n var reducer = reducers[key];\n var initialState = reducer(undefined, { type: ActionTypes.INIT });\n\n if (typeof initialState === 'undefined') {\n throw new Error('Reducer \"' + key + '\" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined. If you don\\'t want to set a value for this reducer, ' + 'you can use null instead of undefined.');\n }\n\n var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.');\n if (typeof reducer(undefined, { type: type }) === 'undefined') {\n throw new Error('Reducer \"' + key + '\" returned undefined when probed with a random type. ' + ('Don\\'t try to handle ' + ActionTypes.INIT + ' or other actions in \"redux/*\" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined, but can be null.');\n }\n });\n}\n\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @param {Object} reducers An object whose values correspond to different\n * reducer functions that need to be combined into one. One handy way to obtain\n * it is to use ES6 `import * as reducers` syntax. The reducers may never return\n * undefined for any action. Instead, they should return their initial state\n * if the state passed to them was undefined, and the current state for any\n * unrecognized action.\n *\n * @returns {Function} A reducer function that invokes every reducer inside the\n * passed object, and builds a state object with the same shape.\n */\nfunction combineReducers(reducers) {\n var reducerKeys = Object.keys(reducers);\n var finalReducers = {};\n for (var i = 0; i < reducerKeys.length; i++) {\n var key = reducerKeys[i];\n\n if (true) {\n if (typeof reducers[key] === 'undefined') {\n warning('No reducer provided for key \"' + key + '\"');\n }\n }\n\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n var finalReducerKeys = Object.keys(finalReducers);\n\n var unexpectedKeyCache = void 0;\n if (true) {\n unexpectedKeyCache = {};\n }\n\n var shapeAssertionError = void 0;\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n\n return function combination() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var action = arguments[1];\n\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n\n if (true) {\n var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n\n var hasChanged = false;\n var nextState = {};\n for (var _i = 0; _i < finalReducerKeys.length; _i++) {\n var _key = finalReducerKeys[_i];\n var reducer = finalReducers[_key];\n var previousStateForKey = state[_key];\n var nextStateForKey = reducer(previousStateForKey, action);\n if (typeof nextStateForKey === 'undefined') {\n var errorMessage = getUndefinedStateErrorMessage(_key, action);\n throw new Error(errorMessage);\n }\n nextState[_key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n return hasChanged ? nextState : state;\n };\n}\n\nfunction bindActionCreator(actionCreator, dispatch) {\n return function () {\n return dispatch(actionCreator.apply(this, arguments));\n };\n}\n\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass a single function as the first argument,\n * and get a function in return.\n *\n * @param {Function|Object} actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use ES6 `import * as`\n * syntax. You may also pass a single function.\n *\n * @param {Function} dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns {Function|Object} The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\n\n if ((typeof actionCreators === 'undefined' ? 'undefined' : _typeof(actionCreators)) !== 'object' || actionCreators === null) {\n throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators === 'undefined' ? 'undefined' : _typeof(actionCreators)) + '. ' + 'Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?');\n }\n\n var keys = Object.keys(actionCreators);\n var boundActionCreators = {};\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var actionCreator = actionCreators[key];\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n return boundActionCreators;\n}\n\n/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\n\nfunction compose() {\n for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(undefined, arguments));\n };\n });\n}\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\nfunction applyMiddleware() {\n for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function () {\n for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n var store = createStore.apply(undefined, args);\n var _dispatch = function dispatch() {\n throw new Error('Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');\n };\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch() {\n return _dispatch.apply(undefined, arguments);\n }\n };\n var chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = compose.apply(undefined, chain)(store.dispatch);\n\n return _extends({}, store, {\n dispatch: _dispatch\n });\n };\n };\n}\n\n/*\n * This is a dummy function to check if the function name has been altered by minification.\n * If the function has been minified and NODE_ENV !== 'production', warn the user.\n */\nfunction isCrushed() {}\n\nif (\"development\" !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {\n warning(\"You are currently using minified code outside of NODE_ENV === 'production'. \" + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.');\n}\n\n\n\n\n//# sourceURL=webpack:///./node_modules/redux/es/redux.js?"); + +/***/ }), + /***/ "./node_modules/style-loader/lib/addStyles.js": /*!****************************************************!*\ !*** ./node_modules/style-loader/lib/addStyles.js ***! @@ -141,6 +153,52 @@ eval("\n/**\n * When source maps are enabled, `style-loader` uses a link element /***/ }), +/***/ "./node_modules/symbol-observable/es/index.js": +/*!****************************************************!*\ + !*** ./node_modules/symbol-observable/es/index.js ***! + \****************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global, module) {/* harmony import */ var _ponyfill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ponyfill.js */ \"./node_modules/symbol-observable/es/ponyfill.js\");\n/* global window */\n\n\nvar root;\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (true) {\n root = module;\n} else {}\n\nvar result = Object(_ponyfill_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(root);\n/* harmony default export */ __webpack_exports__[\"default\"] = (result);\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\"), __webpack_require__(/*! ./../../webpack/buildin/harmony-module.js */ \"./node_modules/webpack/buildin/harmony-module.js\")(module)))\n\n//# sourceURL=webpack:///./node_modules/symbol-observable/es/index.js?"); + +/***/ }), + +/***/ "./node_modules/symbol-observable/es/ponyfill.js": +/*!*******************************************************!*\ + !*** ./node_modules/symbol-observable/es/ponyfill.js ***! + \*******************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return symbolObservablePonyfill; });\nfunction symbolObservablePonyfill(root) {\n\tvar result;\n\tvar Symbol = root.Symbol;\n\n\tif (typeof Symbol === 'function') {\n\t\tif (Symbol.observable) {\n\t\t\tresult = Symbol.observable;\n\t\t} else {\n\t\t\tresult = Symbol('observable');\n\t\t\tSymbol.observable = result;\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n\n\n//# sourceURL=webpack:///./node_modules/symbol-observable/es/ponyfill.js?"); + +/***/ }), + +/***/ "./node_modules/webpack/buildin/global.js": +/*!***********************************!*\ + !*** (webpack)/buildin/global.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n\n\n//# sourceURL=webpack:///(webpack)/buildin/global.js?"); + +/***/ }), + +/***/ "./node_modules/webpack/buildin/harmony-module.js": +/*!*******************************************!*\ + !*** (webpack)/buildin/harmony-module.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("module.exports = function(originalModule) {\n\tif (!originalModule.webpackPolyfill) {\n\t\tvar module = Object.create(originalModule);\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"exports\", {\n\t\t\tenumerable: true\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n\n\n//# sourceURL=webpack:///(webpack)/buildin/harmony-module.js?"); + +/***/ }), + /***/ "./src/js/app.js": /*!***********************!*\ !*** ./src/js/app.js ***! @@ -171,7 +229,7 @@ eval("module.exports = {\n recasttoken: \"26021d055040a9d9f1ad48476efab4a0\"\ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("const $configBot = __webpack_require__(/*! ./config.js */ \"./src/js/bot/config.js\");\nconst $config = __webpack_require__(/*! ./../config.js */ \"./src/js/config.js\");\nconst Microbot = __webpack_require__(/*! ./../microbot-ops.js */ \"./src/js/microbot-ops.js\");\nconst app = new Microbot();\nconst DomManipulator = __webpack_require__(/*! ./../dom-ops.js */ \"./src/js/dom-ops.js\");\nconst domManipulator = new DomManipulator();\n\nmodule.exports = class Recast {\n constructor() {\n this.recastToken = $configBot.recasttoken;\n this.requestUrl = \"https://api.recast.ai/v2/request\";\n }\n\n getAndCallProcessIntent(command, text) {\n self = this;\n var url = this.requestUrl + \"?text=\" + command;\n var bodyRelevant = '';\n var intent = '';\n fetch(url, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": \"Token \" + this.recastToken\n },\n data: text\n }).then(function (response) {\n response.json().then(function (body) {\n bodyRelevant = body.results;\n intent = bodyRelevant.intents[0][\"slug\"];\n $('#' + $config.costants.hiddenIntentFieldId).val(intent);\n if (intent !== undefined) {\n domManipulator.displayIntentBox(intent);\n domManipulator.showWidget(intent);\n domManipulator.addGitOperationHistory(command, 'command');\n domManipulator.populateRecastData(intent, bodyRelevant);\n // self.processIntent(intent);\n }\n return intent;\n });\n }).catch(function (error) {\n console.error('Fetch Error =\\n', error);\n });\n }\n\n processIntent(intent) {\n switch (intent) {\n case \"createrepo\":\n app.createRepository();\n break;\n case \"updaterepo\":\n app.updateRepository();\n break;\n case \"viewrepos\":\n app.viewRepositories();\n break;\n case \"deleterepo\":\n app.deleteRepository();\n break;\n case \"createissue\":\n app.createIssue();\n break;\n case \"updateissue\":\n app.updateIssue();\n break;\n case \"closeissue\":\n app.closeIssue();\n break;\n case \"reopenissue\":\n app.reopenIssue();\n break;\n case \"displayissue\":\n app.displayIssue();\n break;\n case \"addissuecomment\":\n app.addIssueComment();\n break;\n case \"displaylastcomment\":\n app.displayLastComment();\n break;\n case \"addcollab\":\n app.addCollaborator();\n break;\n case \"removecollab\":\n app.removeCollaborator();\n break;\n default:\n console.log(\"default\");\n }\n }\n};\n\n//# sourceURL=webpack:///./src/js/bot/recast-ops.js?"); +eval("const $configBot = __webpack_require__(/*! ./config.js */ \"./src/js/bot/config.js\");\nconst $config = __webpack_require__(/*! ./../config.js */ \"./src/js/config.js\");\nconst Microbot = __webpack_require__(/*! ./../microbot-ops.js */ \"./src/js/microbot-ops.js\");\nconst app = new Microbot();\nconst DomManipulator = __webpack_require__(/*! ./../dom-ops.js */ \"./src/js/dom-ops.js\");\nconst domManipulator = new DomManipulator();\nconst PersistentOps = __webpack_require__(/*! ./../persistent-ops */ \"./src/js/persistent-ops.js\");\nconst persistentOps = new PersistentOps();\nconst $actions = $config.actions;\n\nmodule.exports = class Recast {\n constructor() {\n this.recastToken = $configBot.recasttoken;\n this.requestUrl = \"https://api.recast.ai/v2/request\";\n }\n\n getAndCallProcessIntent(command, text) {\n self = this;\n var url = this.requestUrl + \"?text=\" + command;\n var bodyRelevant = '';\n var intent = '';\n fetch(url, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": \"Token \" + this.recastToken\n },\n data: text\n }).then(function (response) {\n response.json().then(function (body) {\n bodyRelevant = body.results;\n intent = bodyRelevant.intents[0][\"slug\"];\n $('#' + $config.costants.hiddenIntentFieldId).val(intent);\n if (intent !== undefined) {\n domManipulator.displayIntentBox(intent);\n domManipulator.showWidget(intent);\n persistentOps.store.dispatch($actions.action_add_query);\n domManipulator.addGitOperationHistory(command, 'command');\n domManipulator.populateRecastData(intent, bodyRelevant);\n // self.processIntent(intent);\n }\n return intent;\n });\n }).catch(function (error) {\n console.error('Fetch Error =\\n', error);\n });\n }\n};\n\n//# sourceURL=webpack:///./src/js/bot/recast-ops.js?"); /***/ }), @@ -182,7 +240,7 @@ eval("const $configBot = __webpack_require__(/*! ./config.js */ \"./src/js/bot/c /*! no static exports found */ /***/ (function(module, exports) { -eval("module.exports = {\n gitToken: '96ead73c54cbbf023a73ee57af145b205d460851',\n intentSlugToOperations: {\n createrepo: {\n requestMethod: 'post',\n intentMessage: 'Create a Repository in Github',\n getDataOperation: 'getCreateRepoJson',\n githubOperation: 'createRepository',\n showWidgetOperation: 'showCreateRepoWidget',\n populateDataOperation: 'populateCreateRepoData',\n successMessage: 'Repository Added!',\n cardMsg: 'Requested Repository has been added and is available at ',\n cardDataUrl: 'html_url',\n cardDataName: 'name'\n },\n createissue: {\n requestMethod: 'post',\n intentMessage: 'Raise an issue in Github',\n getDataOperation: 'getCreateIssueJson',\n githubOperation: 'createIssue',\n showWidgetOperation: 'showCreateIssueWidget',\n populateDataOperation: 'populateCreateIssueData',\n successMessage: 'Issue Created!',\n cardMsg: 'Issue Created as requested, issue details available at ',\n cardDataUrl: 'html_url',\n cardDataName: 'title'\n },\n closeissue: {\n requestMethod: 'post',\n intentMessage: 'Close an issue in Github',\n getDataOperation: 'getCloseIssueJson',\n githubOperation: 'closeIssue',\n showWidgetOperation: 'showCloseIssueWidget',\n populateDataOperation: 'populateCloseIssueData',\n successMessage: 'Issue Closed!',\n cardMsg: 'Issue Closed as requested, closed issue available at: ',\n cardDataUrl: 'html_url',\n cardDataName: 'title'\n },\n addissuecomment: {\n requestMethod: 'post',\n intentMessage: 'Add a comment on an issue in Github',\n getDataOperation: 'getAddCommentJson',\n githubOperation: 'addIssueComment',\n showWidgetOperation: 'showAddCommentWidget',\n populateDataOperation: 'populateAddCommentData',\n successMessage: 'Comment Added!',\n cardMsg: 'Comment Added as Requested, view here: ',\n cardDataUrl: 'html_url',\n cardDataName: 'title'\n },\n displaylastcomment: {\n requestMethod: 'get',\n intentMessage: 'Display last comment of an issue in Github',\n getDataOperation: 'getDisplayCommentJson',\n githubOperation: 'displayLastComment',\n showWidgetOperation: 'showDisplayCommentWidget',\n populateDataOperation: 'populateDisplayCommentData',\n successMessage: 'Comment Retrieved!',\n cardMsg: 'Please find requested comment below: ',\n cardDataUrl: 'html_url',\n cardDataName: 'title'\n },\n addcollab: {\n requestMethod: 'post',\n intentMessage: 'Add a collaborator',\n getDataOperation: 'getAddCollaboratorJson',\n githubOperation: 'addCollaborator',\n showWidgetOperation: 'showAddCollaboratorWidget',\n populateDataOperation: 'populateAddCollaboratorData',\n successMessage: 'Collaborator Added!',\n cardMsg: 'Collaborator added, details available at ',\n cardDataUrl: 'html_url',\n cardDataName: 'invitee,login'\n },\n viewrepos: {\n requestMethod: 'get',\n intentMessage: 'View Repositories for current user',\n getDataOperation: 'getViewRepositoryJson',\n githubOperation: 'viewRepositories',\n showWidgetOperation: 'showViewRepoWidget',\n populateDataOperation: 'populateViewRepoData',\n successMessage: 'Showing repositories',\n cardMsg: 'Repository Details available below: ',\n cardDataUrl: 'html_url',\n cardDataName: 'invitee,login'\n }\n },\n costants: {\n hiddenIntentFieldId: 'intentHidden'\n }\n};\n\n//# sourceURL=webpack:///./src/js/config.js?"); +eval("module.exports = {\n gitToken: '96ead73c54cbbf023a73ee57af145b205d460851',\n intentSlugToOperations: {\n createrepo: {\n requestMethod: 'post',\n intentMessage: 'Create a Repository in Github',\n getDataOperation: 'getCreateRepoJson',\n githubOperation: 'createRepository',\n showWidgetOperation: 'showCreateRepoWidget',\n populateDataOperation: 'populateCreateRepoData',\n successMessage: 'Repository Added!',\n cardMsg: 'Requested Repository has been added and is available at ',\n cardDataUrl: 'html_url',\n cardDataName: 'name'\n },\n createissue: {\n requestMethod: 'post',\n intentMessage: 'Raise an issue in Github',\n getDataOperation: 'getCreateIssueJson',\n githubOperation: 'createIssue',\n showWidgetOperation: 'showCreateIssueWidget',\n populateDataOperation: 'populateCreateIssueData',\n successMessage: 'Issue Created!',\n cardMsg: 'Issue Created as requested, issue details available at ',\n cardDataUrl: 'html_url',\n cardDataName: 'title'\n },\n closeissue: {\n requestMethod: 'post',\n intentMessage: 'Close an issue in Github',\n getDataOperation: 'getCloseIssueJson',\n githubOperation: 'closeIssue',\n showWidgetOperation: 'showCloseIssueWidget',\n populateDataOperation: 'populateCloseIssueData',\n successMessage: 'Issue Closed!',\n cardMsg: 'Issue Closed as requested, closed issue available at: ',\n cardDataUrl: 'html_url',\n cardDataName: 'title'\n },\n addissuecomment: {\n requestMethod: 'post',\n intentMessage: 'Add a comment on an issue in Github',\n getDataOperation: 'getAddCommentJson',\n githubOperation: 'addIssueComment',\n showWidgetOperation: 'showAddCommentWidget',\n populateDataOperation: 'populateAddCommentData',\n successMessage: 'Comment Added!',\n cardMsg: 'Comment Added as Requested, view here: ',\n cardDataUrl: 'html_url',\n cardDataName: 'title'\n },\n displaylastcomment: {\n requestMethod: 'get',\n intentMessage: 'Display last comment of an issue in Github',\n getDataOperation: 'getDisplayCommentJson',\n githubOperation: 'displayLastComment',\n showWidgetOperation: 'showDisplayCommentWidget',\n populateDataOperation: 'populateDisplayCommentData',\n successMessage: 'Comment Retrieved!',\n cardMsg: 'Please find requested comment below: ',\n cardDataUrl: 'html_url',\n cardDataName: 'title'\n },\n addcollab: {\n requestMethod: 'post',\n intentMessage: 'Add a collaborator',\n getDataOperation: 'getAddCollaboratorJson',\n githubOperation: 'addCollaborator',\n showWidgetOperation: 'showAddCollaboratorWidget',\n populateDataOperation: 'populateAddCollaboratorData',\n successMessage: 'Collaborator Added!',\n cardMsg: 'Collaborator added, details available at ',\n cardDataUrl: 'html_url',\n cardDataName: 'invitee,login'\n },\n viewrepos: {\n requestMethod: 'get',\n intentMessage: 'View Repositories for current user',\n getDataOperation: 'getViewRepositoryJson',\n githubOperation: 'viewRepositories',\n showWidgetOperation: 'showViewRepoWidget',\n populateDataOperation: 'populateViewRepoData',\n successMessage: 'Showing repositories',\n cardMsg: 'Repository Details available below: ',\n cardDataUrl: 'html_url',\n cardDataName: 'invitee,login'\n }\n },\n costants: {\n hiddenIntentFieldId: 'intentHidden'\n },\n actions: {\n createrepo: { type: 'ADD_REPO' },\n addcollab: { type: 'ADD_COLLAB' },\n createissue: { type: 'ADD_ISSUE' },\n addissuecomment: { type: 'ADD_COMMENT' },\n closeissue: { type: 'CLOSE_ISSUE' },\n displaylastcomment: { type: 'SHOW_LAST_COMMENT' },\n viewrepos: { type: 'VIEW_REPO' },\n action_add_query: { type: 'ADD_QUERY' }\n }\n};\n\n//# sourceURL=webpack:///./src/js/config.js?"); /***/ }), @@ -193,7 +251,7 @@ eval("module.exports = {\n gitToken: '96ead73c54cbbf023a73ee57af145b205d460851' /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("const $config = __webpack_require__(/*! ./config.js */ \"./src/js/config.js\");\nconst GithubHelper = __webpack_require__(/*! ./helper.js */ \"./src/js/helper.js\");\n\nconst githubHelper = new GithubHelper();\n\nmodule.exports = class DomManipulator {\n constructor() {\n this.createRepoWidgetCreated = false;\n this.commandCardCounter = 1;\n }\n\n showWidget(intent) {\n // var intent = $('#' + $config.costants.hiddenIntentFieldId).val();\n const widget = this.createRepoWidget(intent);\n if (!this.isVisible(widget)) {\n widget.classList.remove('hide');\n $('#underWidgetLine').removeClass('hide');\n }\n }\n\n displayIntentBox(intent) {\n const intentBox = document.getElementById('intentBox');\n if (!this.isVisible(intentBox)) {\n intentBox.classList.remove('hide');\n }\n $('#intentName').text(`${$config.intentSlugToOperations[intent].intentMessage} [slug: ${intent}].`);\n }\n\n createRepoWidget(intent) {\n const existingWidget = document.getElementById(intent);\n if (existingWidget) {\n return existingWidget;\n }\n\n // Create Elements\n const widgets = document.getElementById('widgets');\n const createRepoWidget = document.createElement('div');\n const cardBody = document.createElement('div');\n const header = document.createElement('div');\n const form = document.createElement('form');\n\n const formRow1 = document.createElement('div');\n const formGroup1_1 = document.createElement('div');\n const repoNamelabel = document.createElement('label');\n const repoNameTextField = document.createElement('input');\n const formGroup1_2 = document.createElement('div');\n const homePageURLLabel = document.createElement('label');\n const homePageURLTextField = document.createElement('input');\n\n const formRow2 = document.createElement('div');\n const formGroup2_1 = document.createElement('div');\n const formCheck1 = document.createElement('div');\n const privateLabel = document.createElement('label');\n const privateCB = document.createElement('input');\n const formGroup2_2 = document.createElement('div');\n const formCheck2 = document.createElement('div');\n const addIssueLabel = document.createElement('label');\n const addIssueCB = document.createElement('input');\n const formGroup2_3 = document.createElement('div');\n const formCheck3 = document.createElement('div');\n const addWikiLabel = document.createElement('label');\n const addWikiCB = document.createElement('input');\n\n const formGroup3_1 = document.createElement('div');\n const descriptionLabel = document.createElement('label');\n const descriptionTextArea = document.createElement('textarea');\n\n const submitRepoCreate = document.createElement('button');\n\n // Add Attributes\n widgets.classList.add('card-group');\n createRepoWidget.setAttribute('id', 'createrepo');\n createRepoWidget.classList.add('card', 'hide', 'widget', 'good');\n cardBody.classList.add('card-body');\n header.classList.add('card-title');\n\n formRow1.classList.add('form-row');\n formGroup1_1.classList.add('form-group', 'col-md-6', 'col-sm-6', 'col-lg-6', 'col-xs-6', 'mb-3');\n repoNamelabel.setAttribute('for', 'repositoryName');\n repoNameTextField.setAttribute('type', 'text');\n repoNameTextField.setAttribute('id', 'repositoryName');\n repoNameTextField.setAttribute('placeholder', 'Repository Name... ');\n repoNameTextField.required = true;\n repoNameTextField.classList.add('form-control');\n formGroup1_2.classList.add('form-group', 'col-md-6', 'col-sm-6', 'col-lg-6', 'col-xs-6', 'mb-3');\n homePageURLLabel.setAttribute('for', 'homePageURL');\n homePageURLTextField.setAttribute('type', 'text');\n homePageURLTextField.setAttribute('id', 'homePageURL');\n homePageURLTextField.setAttribute('placeholder', 'Home Page URL... ');\n homePageURLTextField.classList.add('form-control');\n\n formRow2.classList.add('form-row');\n formGroup2_1.classList.add('form-group', 'col-md-3', 'col-sm-3', 'col-lg-3', 'col-xs-3', 'mb-3');\n formCheck1.classList.add('form-check', 'form-check-inline');\n privateLabel.setAttribute('for', 'privateRepoChk');\n privateLabel.classList.add('form-check-label');\n privateCB.setAttribute('type', 'checkbox');\n privateCB.setAttribute('id', 'privateRepoChk');\n privateCB.setAttribute('value', 'Option 1');\n privateCB.classList.add('form-check-input');\n\n formGroup2_2.classList.add('form-group', 'col-md-4', 'col-sm-4', 'col-lg-4', 'col-xs-4', 'mb-3');\n formCheck2.classList.add('form-check', 'form-check-inline');\n addIssueLabel.setAttribute('for', 'issuesChk');\n addIssueLabel.classList.add('form-check-label');\n addIssueCB.setAttribute('type', 'checkbox');\n addIssueCB.setAttribute('id', 'issuesChk');\n addIssueCB.setAttribute('value', 'Option 2');\n addIssueCB.classList.add('form-check-input');\n\n formGroup2_3.classList.add('form-group', 'col-md-4', 'col-sm-4', 'col-lg-4', 'col-xs-4', 'mb-3');\n formCheck3.classList.add('form-check', 'form-check-inline');\n addWikiLabel.setAttribute('for', 'wikiChk');\n addWikiLabel.classList.add('form-check-label');\n addWikiCB.setAttribute('type', 'checkbox');\n addWikiCB.setAttribute('id', 'wikiChk');\n addWikiCB.setAttribute('value', 'Option 3');\n addWikiCB.classList.add('form-check-input');\n\n formGroup3_1.classList.add('form-group');\n descriptionLabel.setAttribute('for', 'description');\n descriptionTextArea.setAttribute('rows', '3');\n descriptionTextArea.classList.add('form-control');\n descriptionTextArea.setAttribute('id', 'description');\n\n submitRepoCreate.setAttribute('type', 'button');\n submitRepoCreate.setAttribute('data-toggle', 'modal');\n submitRepoCreate.setAttribute('data-target', '#submitConfirm');\n submitRepoCreate.setAttribute('id', 'submitForm');\n submitRepoCreate.classList.add('btn', 'btn-primary');\n\n // Add inner HTML\n header.innerHTML = 'Create Repository';\n repoNamelabel.innerHTML = 'Repository Name';\n homePageURLLabel.innerHTML = 'Home Page URL';\n privateLabel.innerHTML = 'Private';\n addIssueLabel.innerHTML = 'Allow Adding Issues?';\n addWikiLabel.innerHTML = 'Add Wiki?';\n descriptionLabel.innerHTML = 'Add some Description for this repository:';\n submitRepoCreate.innerHTML = 'Submit';\n\n // Associations\n formCheck1.appendChild(privateCB);\n formCheck1.appendChild(privateLabel);\n\n formCheck2.appendChild(addIssueCB);\n formCheck2.appendChild(addIssueLabel);\n\n formCheck3.appendChild(addWikiCB);\n formCheck3.appendChild(addWikiLabel);\n\n formGroup1_1.appendChild(repoNamelabel);\n formGroup1_1.appendChild(repoNameTextField);\n\n formGroup1_2.appendChild(homePageURLLabel);\n formGroup1_2.appendChild(homePageURLTextField);\n\n formGroup2_1.appendChild(formCheck1);\n formGroup2_2.appendChild(formCheck2);\n formGroup2_3.appendChild(formCheck3);\n\n formGroup3_1.appendChild(descriptionLabel);\n formGroup3_1.appendChild(descriptionTextArea);\n\n formRow1.appendChild(formGroup1_1);\n formRow1.appendChild(formGroup1_2);\n\n formRow2.appendChild(formGroup2_1);\n formRow2.appendChild(formGroup2_2);\n formRow2.appendChild(formGroup2_3);\n\n form.appendChild(formRow1);\n form.appendChild(formRow2);\n form.appendChild(formGroup3_1);\n form.appendChild(submitRepoCreate);\n\n cardBody.appendChild(header);\n cardBody.appendChild(form);\n\n createRepoWidget.appendChild(cardBody);\n widgets.appendChild(createRepoWidget);\n $('#createrepo').insertBefore($('#underWidgetLine'));\n\n this.createRepoWidgetCreated = true;\n\n return createRepoWidget;\n }\n\n showEmptyCommandMessage() {\n $('#emptyCommandMsgDisplayer').click();\n }\n\n populateWidgetWithGithubResponse() {}\n\n populateRecastData(widgetName, recastResponse) {\n // var requestMethod = $config.intentSlugToOperations[widgetName]['requestMethod'];\n const operation = $config.intentSlugToOperations[widgetName].populateDataOperation;\n if (typeof this[operation] === 'function') {\n this[operation](recastResponse);\n }\n }\n\n populateCreateRepoData(recastResponse) {\n const repoNameTextField = document.getElementById('repositoryName');\n if (repoNameTextField && recastResponse && recastResponse.entities['git-repository'] && recastResponse.entities['git-repository'].length > 0 && recastResponse.entities['git-repository']['0'].value) {\n const repoName = recastResponse.entities['git-repository']['0'].value;\n repoNameTextField.value = repoName;\n }\n }\n\n populateCreateIssueData(recastResponse) {\n const issueTitleTextField = document.getElementById('issueTitle');\n const issueRepositoryTextField = document.getElementById('issueRepository');\n if (issueTitleTextField && recastResponse && recastResponse.entities.issue_title && recastResponse.entities.issue_title.length > 0 && recastResponse.entities.issue_title['0'].value) {\n const issueTitle = recastResponse.entities.issue_title['0'].value;\n issueTitleTextField.value = issueTitle;\n }\n if (issueRepositoryTextField && recastResponse && recastResponse.entities['git-repository'] && recastResponse.entities['git-repository'].length > 0 && recastResponse.entities['git-repository']['0'].value) {\n const repoName = recastResponse.entities['git-repository']['0'].value;\n issueRepositoryTextField.value = repoName;\n }\n }\n\n populateCloseIssueData(recastResponse) {\n const issueNumberTextField = document.getElementById('issueNumerToClose');\n const issueRepositoryTextField = document.getElementById('repoForIssueClose');\n if (issueNumberTextField && recastResponse && recastResponse.entities.issue_id && recastResponse.entities.issue_id.length > 0 && recastResponse.entities.issue_id['0'].value) {\n const issueNumber = recastResponse.entities.issue_id['0'].value;\n issueNumberTextField.value = issueNumber;\n }\n if (issueRepositoryTextField && recastResponse && recastResponse.entities['git-repository'] && recastResponse.entities['git-repository'].length > 0 && recastResponse.entities['git-repository']['0'].value) {\n const repoName = recastResponse.entities['git-repository']['0'].value;\n issueRepositoryTextField.value = repoName;\n }\n }\n\n populateAddCollaboratorData(recastResponse) {\n const collaboratorNameTextField = document.getElementById('collaboratorName');\n const repoForCollabTextField = document.getElementById('repoForCollab');\n if (collaboratorNameTextField && recastResponse && recastResponse.entities.git_collaborator && recastResponse.entities.git_collaborator.length > 0 && recastResponse.entities.git_collaborator['0'].value) {\n const collaboratorName = recastResponse.entities.git_collaborator['0'].value;\n collaboratorNameTextField.value = collaboratorName;\n }\n if (repoForCollabTextField && recastResponse && recastResponse.entities['git-repository'] && recastResponse.entities['git-repository'].length > 0 && recastResponse.entities['git-repository']['0'].value) {\n const repoName = recastResponse.entities['git-repository']['0'].value;\n repoForCollabTextField.value = repoName;\n }\n }\n\n populateAddCommentData(recastResponse) {\n const repoForIssueCommentTextField = document.getElementById('repoForIssueComment');\n const issueNumberTextField = document.getElementById('issueNumber');\n const issueCommentTextArea = document.getElementById('issueComment');\n if (repoForIssueCommentTextField && recastResponse && recastResponse.entities['git-repository'] && recastResponse.entities['git-repository'].length > 0 && recastResponse.entities['git-repository']['0'].value) {\n const repoForIssueComment = recastResponse.entities['git-repository']['0'].value;\n repoForIssueCommentTextField.value = repoForIssueComment;\n }\n if (issueNumberTextField && recastResponse && recastResponse.entities.issue_id && recastResponse.entities.issue_id.length > 0 && recastResponse.entities.issue_id['0'].value) {\n const issueNumber = recastResponse.entities.issue_id['0'].value;\n issueNumberTextField.value = issueNumber;\n }\n if (issueCommentTextArea && recastResponse && recastResponse.entities.issue_comment && recastResponse.entities.issue_comment.length > 0 && recastResponse.entities.issue_comment['0'].value) {\n const issueComment = recastResponse.entities.issue_comment['0'].value;\n issueCommentTextArea.value = issueComment;\n }\n }\n\n populateDisplayCommentData(recastResponse) {\n const issueNumberTextField = document.getElementById('issueNumberForCommentView');\n const issueRepositoryTextField = document.getElementById('repoForCommentView');\n if (issueNumberTextField && recastResponse && recastResponse.entities.issue_id && recastResponse.entities.issue_id.length > 0 && recastResponse.entities.issue_id['0'].value) {\n const issueNumber = recastResponse.entities.issue_id['0'].value;\n issueNumberTextField.value = issueNumber;\n }\n if (issueRepositoryTextField && recastResponse && recastResponse.entities['git-repository'] && recastResponse.entities['git-repository'].length > 0 && recastResponse.entities['git-repository']['0'].value) {\n const repoName = recastResponse.entities['git-repository']['0'].value;\n issueRepositoryTextField.value = repoName;\n }\n }\n\n isVisible(element) {\n return element ? !element.classList.contains('hide') : false;\n }\n\n getDataFromFormAsJSON() {\n let data = {};\n const intent = $(`#${$config.costants.hiddenIntentFieldId}`).val();\n const requestMethod = $config.intentSlugToOperations[intent].requestMethod;\n if (intent) {\n const operation = $config.intentSlugToOperations[intent].getDataOperation;\n if (typeof this[operation] === 'function') {\n data = this[operation]();\n }\n }\n return data;\n }\n\n getCreateRepoJson() {\n const data = {};\n const request = {};\n if (this.isVisible(document.getElementById('createrepo'))) {\n request.name = document.getElementById('repositoryName').value;\n request.description = document.getElementById('description').value;\n request.homepage = document.getElementById('homePageURL').value;\n request.private = document.getElementById('privateRepoChk').checked;\n request.has_issues = document.getElementById('issuesChk').checked;\n request.has_wiki = document.getElementById('wikiChk').checked;\n }\n data.request = request;\n return data;\n }\n\n getCreateIssueJson() {\n const data = {};\n data.urlParams = {};\n const request = {};\n if (this.isVisible(document.getElementById('createissue'))) {\n request.title = document.getElementById('issueTitle').value;\n request.body = document.getElementById('description').value;\n request.assignees = document.getElementById('assignees').value ? document.getElementById('assignees').value.split(',') : [];\n request.labels = document.getElementById('labels').value ? document.getElementById('labels').value.split(',') : [];\n data.urlParams.repoName = document.getElementById('issueRepository').value;\n }\n data.request = request;\n return data;\n }\n\n getCloseIssueJson() {\n const data = {};\n data.urlParams = {};\n if (this.isVisible(document.getElementById('closeissue'))) {\n data.urlParams.issueId = document.getElementById('issueNumerToClose').value;\n data.urlParams.repoName = document.getElementById('repoForIssueClose').value;\n }\n return data;\n }\n\n getAddCollaboratorJson() {\n const data = {};\n data.urlParams = {};\n if (this.isVisible(document.getElementById('addcollab'))) {\n data.urlParams.collaborator = document.getElementById('collaboratorName').value;\n data.urlParams.repoName = document.getElementById('repoForCollab').value;\n }\n return data;\n }\n\n getAddCommentJson() {\n const data = {};\n data.urlParams = {};\n const request = {};\n if (this.isVisible(document.getElementById('addissuecomment'))) {\n request.body = document.getElementById('issueComment').value;\n data.urlParams.issueId = document.getElementById('issueNumber').value;\n data.urlParams.repoName = document.getElementById('repoForIssueComment').value;\n }\n data.request = request;\n return data;\n }\n\n getDisplayCommentJson() {\n const data = {};\n data.urlParams = {};\n if (this.isVisible(document.getElementById('displaylastcomment'))) {\n data.urlParams.issueId = document.getElementById('issueNumberForCommentView').value;\n data.urlParams.repoName = document.getElementById('repoForCommentView').value;\n }\n return data;\n }\n\n addGitOperationHistory(data, type) {\n const intent = $(`#${$config.costants.hiddenIntentFieldId}`).val();\n const requestMethod = $config.intentSlugToOperations[intent].requestMethod;\n const conversations = document.getElementById('conversations');\n let table;\n let comment;\n // Create Elements\n const card = document.createElement('div');\n const cardBody = document.createElement('div');\n const cardTitle = document.createElement('h5');\n const closeAnchor = document.createElement('a');\n const closeHeader = document.createElement('h6');\n const cardText = document.createElement('p');\n const cardFooter = document.createElement('div');\n const textMuted = document.createElement('small');\n const underCardLine = document.createElement('div');\n\n // Add Attributes\n card.classList.add('card', type);\n cardBody.classList.add('card-body');\n cardTitle.classList.add('card-title');\n closeAnchor.classList.add('close');\n // closeAnchor.setAttribute('href', '#');\n cardText.classList.add('card-text');\n cardFooter.classList.add('card-footer');\n textMuted.classList.add('text-muted');\n underCardLine.classList.add('line');\n\n // Add content\n closeHeader.innerHTML = 'x';\n\n const x = this.display_ct(0, textMuted);\n if (type === 'command') {\n // Add content\n cardTitle.innerHTML = 'You Said';\n cardText.innerHTML = data;\n const repeat = document.createElement('a');\n repeat.classList.add('btn', 'btn-info', 'float-right');\n repeat.setAttribute('role', 'button');\n repeat.setAttribute('href', '#');\n repeat.setAttribute('id', `btnRepeatCommand${this.commandCardCounter++}`);\n repeat.innerHTML = 'Repeat';\n cardText.appendChild(repeat);\n } else if (type === 'response') {\n // Add content\n cardTitle.innerHTML = 'Server Responded As..';\n if (requestMethod == 'post') {\n cardText.innerHTML = `${$config.intentSlugToOperations[intent].cardMsg}${this.getVariable(data, $config.intentSlugToOperations[intent].cardDataName)}`;\n } else if (requestMethod == 'get') {\n cardText.innerHTML = $config.intentSlugToOperations[intent].cardMsg;\n if (data && data.length && data.length > 0) {\n if (intent === 'viewrepos') {\n table = this.createRepoTable(data);\n } else if (intent === 'displaylastcomment') {\n comment = this.createCommentBody(data);\n }\n }\n }\n } else {\n cardTitle.innerHTML = 'Server Responded As..';\n cardText.innerHTML = `Operation failed with status: ${type}`;\n }\n\n // Associations\n closeAnchor.appendChild(closeHeader);\n cardTitle.appendChild(closeAnchor);\n cardBody.appendChild(cardTitle);\n cardBody.appendChild(cardText);\n if (comment) {\n cardBody.appendChild(comment);\n }\n cardFooter.appendChild(textMuted);\n card.appendChild(cardBody);\n if (table) {\n card.appendChild(table);\n }\n card.appendChild(cardFooter);\n\n conversations.insertBefore(underCardLine, conversations.firstChild);\n conversations.insertBefore(card, conversations.firstChild);\n }\n\n getVariable(data, commaSeparatedValue) {\n const arr = commaSeparatedValue.split(',');\n for (let i = 0; i < arr.length; i++) {\n data = data[arr[i]];\n }\n return data;\n }\n\n createRepoTable(data) {\n // Create Elements\n const table = document.createElement('table');\n const thead = document.createElement('thead');\n const tr_head = document.createElement('tr');\n const th_1 = document.createElement('th');\n const th_2 = document.createElement('th');\n const th_3 = document.createElement('th');\n const th_4 = document.createElement('th');\n const th_5 = document.createElement('th');\n const th_6 = document.createElement('th');\n const th_7 = document.createElement('th');\n\n // Add Attributes\n table.classList.add('table', 'tabled-bordered', 'table-striped', 'table-hover');\n thead.classList.add('thead-dark');\n th_1.setAttribute('scope', 'col');\n th_2.setAttribute('scope', 'col');\n th_3.setAttribute('scope', 'col');\n th_4.setAttribute('scope', 'col');\n th_5.setAttribute('scope', 'col');\n th_6.setAttribute('scope', 'col');\n th_7.setAttribute('scope', 'col');\n\n // Add Inner HTML\n th_1.innerHTML = '#';\n th_2.innerHTML = 'Repository Name';\n th_3.innerHTML = 'Repository ID';\n th_4.innerHTML = 'Created On';\n th_5.innerHTML = 'Created By';\n th_6.innerHTML = 'View Raw';\n th_7.innerHTML = 'Delete Repository';\n\n // Associations\n tr_head.appendChild(th_1);\n tr_head.appendChild(th_2);\n tr_head.appendChild(th_3);\n tr_head.appendChild(th_4);\n tr_head.appendChild(th_5);\n tr_head.appendChild(th_6);\n tr_head.appendChild(th_7);\n thead.appendChild(tr_head);\n table.appendChild(thead);\n\n for (let i = 0; i < data.length; i++) {\n const currentRepo = data[i];\n // Create Elements\n const tbody = document.createElement('tbody');\n const tr_body = document.createElement('tr');\n const th_vertical = document.createElement('th');\n const td_1 = document.createElement('td');\n const td_2 = document.createElement('td');\n const td_3 = document.createElement('td');\n const td_4 = document.createElement('td');\n const td_5 = document.createElement('td');\n const td_6 = document.createElement('td');\n\n // Add Attributes\n th_vertical.setAttribute('scope', 'row');\n tr_body.setAttribute('id', `repoRow${i}`);\n\n // Add Inner HTML\n th_vertical.innerHTML = i + 1;\n td_1.innerHTML = currentRepo.name;\n td_2.innerHTML = `${currentRepo.id}`;\n td_3.innerHTML = currentRepo.created_at;\n td_4.innerHTML = `${currentRepo.owner.login}`;\n td_5.innerHTML = `View`;\n td_6.innerHTML = `Delete`;\n\n // Associations\n tr_body.appendChild(th_vertical);\n tr_body.appendChild(td_1);\n tr_body.appendChild(td_2);\n tr_body.appendChild(td_3);\n tr_body.appendChild(td_4);\n tr_body.appendChild(td_5);\n tr_body.appendChild(td_6);\n tbody.appendChild(tr_body);\n table.appendChild(tbody);\n }\n\n return table;\n }\n\n createCommentBody(data) {\n const commentPara = document.createElement('p');\n const lastComment = githubHelper.getLatestComment(data);\n commentPara.classList.add('card-text');\n commentPara.innerHTML = `COMMENT: ${lastComment}`;\n return commentPara;\n }\n\n concealCodeInUrl() {\n window.location = 'http://localhost:8080';\n }\n\n toggleModals(response) {\n const self = this;\n const promise = response.json();\n const intent = $(`#${$config.costants.hiddenIntentFieldId}`).val();\n $('#submitConfirm').addClass('hide');\n $('#btnCancelConfirm').click();\n $('.modal-backdrop').removeClass('modal-backdrop');\n $('#underWidgetLine').addClass('hide');\n $('#intentBox').addClass('hide');\n if (response && response.status && (response.status === 201 || response.status === 200 || response.status === 204)) {\n $('#successAlert').removeClass('hide');\n $('#widgets').children().addClass('hide');\n promise.then(body => {\n $('#op-msg').text($config.intentSlugToOperations[intent].successMessage);\n $('#successAlert').removeClass('hide');\n self.addGitOperationHistory(body, 'response');\n // clear intent\n $(`#${$config.costants.hiddenIntentFieldId}`).val('');\n });\n } else {\n $('#widgets').children().addClass('hide');\n $('#dangerAlert').removeClass('hide');\n self.addGitOperationHistory(response.status);\n // clear intent\n $(`#${$config.costants.hiddenIntentFieldId}`).val('');\n }\n }\n\n display_ct(start, element) {\n this.start = start;\n this.element = element;\n const days = Math.floor(this.start / 86400);\n const hours = Math.floor((this.start - days * 86400) / 3600);\n const minutes = Math.floor((this.start - days * 86400 - hours * 3600) / 60);\n const secs = Math.floor(this.start - days * 86400 - hours * 3600 - minutes * 60);\n let x = '';\n if (days != 0) {\n x = `${x + days} days`;\n }\n if (hours != 0) {\n x = `${x + hours} hours`;\n }\n if (minutes != 0) {\n x = `${x + minutes} minutes`;\n }\n x = `${x + secs} seconds ago`;\n element.innerHTML = x;\n this.start = this.start + 1;\n // setTimeout(this['display_ct](this.start, this.element)', 1000 )\n }\n};\n\n//# sourceURL=webpack:///./src/js/dom-ops.js?"); +eval("const $config = __webpack_require__(/*! ./config.js */ \"./src/js/config.js\");\nconst Helper = __webpack_require__(/*! ./helper.js */ \"./src/js/helper.js\");\n\nconst helper = new Helper();\n\nmodule.exports = class DomManipulator {\n constructor() {\n this.createRepoWidgetCreated = false;\n this.commandCardCounter = 1;\n }\n\n showWidget(intent) {\n // var intent = $('#' + $config.costants.hiddenIntentFieldId).val();\n const widget = this.createRepoWidget(intent);\n if (!this.isVisible(widget)) {\n widget.classList.remove('hide');\n $('#underWidgetLine').removeClass('hide');\n }\n }\n\n displayIntentBox(intent) {\n const intentBox = document.getElementById('intentBox');\n if (!this.isVisible(intentBox)) {\n intentBox.classList.remove('hide');\n }\n $('#intentName').text(`${$config.intentSlugToOperations[intent].intentMessage} [slug: ${intent}].`);\n }\n\n createRepoWidget(intent) {\n const existingWidget = document.getElementById(intent);\n if (existingWidget) {\n return existingWidget;\n }\n\n // Create Elements\n const widgets = document.getElementById('widgets');\n const createRepoWidget = document.createElement('div');\n const cardBody = document.createElement('div');\n const header = document.createElement('div');\n const form = document.createElement('form');\n\n const formRow1 = document.createElement('div');\n const formGroup1_1 = document.createElement('div');\n const repoNamelabel = document.createElement('label');\n const repoNameTextField = document.createElement('input');\n const formGroup1_2 = document.createElement('div');\n const homePageURLLabel = document.createElement('label');\n const homePageURLTextField = document.createElement('input');\n\n const formRow2 = document.createElement('div');\n const formGroup2_1 = document.createElement('div');\n const formCheck1 = document.createElement('div');\n const privateLabel = document.createElement('label');\n const privateCB = document.createElement('input');\n const formGroup2_2 = document.createElement('div');\n const formCheck2 = document.createElement('div');\n const addIssueLabel = document.createElement('label');\n const addIssueCB = document.createElement('input');\n const formGroup2_3 = document.createElement('div');\n const formCheck3 = document.createElement('div');\n const addWikiLabel = document.createElement('label');\n const addWikiCB = document.createElement('input');\n\n const formGroup3_1 = document.createElement('div');\n const descriptionLabel = document.createElement('label');\n const descriptionTextArea = document.createElement('textarea');\n\n const submitRepoCreate = document.createElement('button');\n\n // Add Attributes\n widgets.classList.add('card-group');\n createRepoWidget.setAttribute('id', 'createrepo');\n createRepoWidget.classList.add('card', 'hide', 'widget', 'good');\n cardBody.classList.add('card-body');\n header.classList.add('card-title');\n\n formRow1.classList.add('form-row');\n formGroup1_1.classList.add('form-group', 'col-md-6', 'col-sm-6', 'col-lg-6', 'col-xs-6', 'mb-3');\n repoNamelabel.setAttribute('for', 'repositoryName');\n repoNameTextField.setAttribute('type', 'text');\n repoNameTextField.setAttribute('id', 'repositoryName');\n repoNameTextField.setAttribute('placeholder', 'Repository Name... ');\n repoNameTextField.required = true;\n repoNameTextField.classList.add('form-control');\n formGroup1_2.classList.add('form-group', 'col-md-6', 'col-sm-6', 'col-lg-6', 'col-xs-6', 'mb-3');\n homePageURLLabel.setAttribute('for', 'homePageURL');\n homePageURLTextField.setAttribute('type', 'text');\n homePageURLTextField.setAttribute('id', 'homePageURL');\n homePageURLTextField.setAttribute('placeholder', 'Home Page URL... ');\n homePageURLTextField.classList.add('form-control');\n\n formRow2.classList.add('form-row');\n formGroup2_1.classList.add('form-group', 'col-md-3', 'col-sm-3', 'col-lg-3', 'col-xs-3', 'mb-3');\n formCheck1.classList.add('form-check', 'form-check-inline');\n privateLabel.setAttribute('for', 'privateRepoChk');\n privateLabel.classList.add('form-check-label');\n privateCB.setAttribute('type', 'checkbox');\n privateCB.setAttribute('id', 'privateRepoChk');\n privateCB.setAttribute('value', 'Option 1');\n privateCB.classList.add('form-check-input');\n\n formGroup2_2.classList.add('form-group', 'col-md-4', 'col-sm-4', 'col-lg-4', 'col-xs-4', 'mb-3');\n formCheck2.classList.add('form-check', 'form-check-inline');\n addIssueLabel.setAttribute('for', 'issuesChk');\n addIssueLabel.classList.add('form-check-label');\n addIssueCB.setAttribute('type', 'checkbox');\n addIssueCB.setAttribute('id', 'issuesChk');\n addIssueCB.setAttribute('value', 'Option 2');\n addIssueCB.classList.add('form-check-input');\n\n formGroup2_3.classList.add('form-group', 'col-md-4', 'col-sm-4', 'col-lg-4', 'col-xs-4', 'mb-3');\n formCheck3.classList.add('form-check', 'form-check-inline');\n addWikiLabel.setAttribute('for', 'wikiChk');\n addWikiLabel.classList.add('form-check-label');\n addWikiCB.setAttribute('type', 'checkbox');\n addWikiCB.setAttribute('id', 'wikiChk');\n addWikiCB.setAttribute('value', 'Option 3');\n addWikiCB.classList.add('form-check-input');\n\n formGroup3_1.classList.add('form-group');\n descriptionLabel.setAttribute('for', 'description');\n descriptionTextArea.setAttribute('rows', '3');\n descriptionTextArea.classList.add('form-control');\n descriptionTextArea.setAttribute('id', 'description');\n\n submitRepoCreate.setAttribute('type', 'button');\n submitRepoCreate.setAttribute('data-toggle', 'modal');\n submitRepoCreate.setAttribute('data-target', '#submitConfirm');\n submitRepoCreate.setAttribute('id', 'submitForm');\n submitRepoCreate.classList.add('btn', 'btn-primary');\n\n // Add inner HTML\n header.innerHTML = 'Create Repository';\n repoNamelabel.innerHTML = 'Repository Name';\n homePageURLLabel.innerHTML = 'Home Page URL';\n privateLabel.innerHTML = 'Private';\n addIssueLabel.innerHTML = 'Allow Adding Issues?';\n addWikiLabel.innerHTML = 'Add Wiki?';\n descriptionLabel.innerHTML = 'Add some Description for this repository:';\n submitRepoCreate.innerHTML = 'Submit';\n\n // Associations\n formCheck1.appendChild(privateCB);\n formCheck1.appendChild(privateLabel);\n\n formCheck2.appendChild(addIssueCB);\n formCheck2.appendChild(addIssueLabel);\n\n formCheck3.appendChild(addWikiCB);\n formCheck3.appendChild(addWikiLabel);\n\n formGroup1_1.appendChild(repoNamelabel);\n formGroup1_1.appendChild(repoNameTextField);\n\n formGroup1_2.appendChild(homePageURLLabel);\n formGroup1_2.appendChild(homePageURLTextField);\n\n formGroup2_1.appendChild(formCheck1);\n formGroup2_2.appendChild(formCheck2);\n formGroup2_3.appendChild(formCheck3);\n\n formGroup3_1.appendChild(descriptionLabel);\n formGroup3_1.appendChild(descriptionTextArea);\n\n formRow1.appendChild(formGroup1_1);\n formRow1.appendChild(formGroup1_2);\n\n formRow2.appendChild(formGroup2_1);\n formRow2.appendChild(formGroup2_2);\n formRow2.appendChild(formGroup2_3);\n\n form.appendChild(formRow1);\n form.appendChild(formRow2);\n form.appendChild(formGroup3_1);\n form.appendChild(submitRepoCreate);\n\n cardBody.appendChild(header);\n cardBody.appendChild(form);\n\n createRepoWidget.appendChild(cardBody);\n widgets.appendChild(createRepoWidget);\n $('#createrepo').insertBefore($('#underWidgetLine'));\n\n this.createRepoWidgetCreated = true;\n\n return createRepoWidget;\n }\n\n showEmptyCommandMessage() {\n $('#emptyCommandMsgDisplayer').click();\n }\n\n populateRecastData(widgetName, recastResponse) {\n // var requestMethod = $config.intentSlugToOperations[widgetName]['requestMethod'];\n const operation = $config.intentSlugToOperations[widgetName].populateDataOperation;\n if (typeof this[operation] === 'function') {\n this[operation](recastResponse);\n }\n }\n\n populateCreateRepoData(recastResponse) {\n const repoNameTextField = document.getElementById('repositoryName');\n if (repoNameTextField && recastResponse && recastResponse.entities['git-repository'] && recastResponse.entities['git-repository'].length > 0 && recastResponse.entities['git-repository']['0'].value) {\n const repoName = recastResponse.entities['git-repository']['0'].value;\n repoNameTextField.value = repoName;\n }\n }\n\n populateCreateIssueData(recastResponse) {\n const issueTitleTextField = document.getElementById('issueTitle');\n const issueRepositoryTextField = document.getElementById('issueRepository');\n if (issueTitleTextField && recastResponse && recastResponse.entities.issue_title && recastResponse.entities.issue_title.length > 0 && recastResponse.entities.issue_title['0'].value) {\n const issueTitle = recastResponse.entities.issue_title['0'].value;\n issueTitleTextField.value = issueTitle;\n }\n if (issueRepositoryTextField && recastResponse && recastResponse.entities['git-repository'] && recastResponse.entities['git-repository'].length > 0 && recastResponse.entities['git-repository']['0'].value) {\n const repoName = recastResponse.entities['git-repository']['0'].value;\n issueRepositoryTextField.value = repoName;\n }\n }\n\n populateCloseIssueData(recastResponse) {\n const issueNumberTextField = document.getElementById('issueNumerToClose');\n const issueRepositoryTextField = document.getElementById('repoForIssueClose');\n if (issueNumberTextField && recastResponse && recastResponse.entities.issue_id && recastResponse.entities.issue_id.length > 0 && recastResponse.entities.issue_id['0'].value) {\n const issueNumber = recastResponse.entities.issue_id['0'].value;\n issueNumberTextField.value = issueNumber;\n }\n if (issueRepositoryTextField && recastResponse && recastResponse.entities['git-repository'] && recastResponse.entities['git-repository'].length > 0 && recastResponse.entities['git-repository']['0'].value) {\n const repoName = recastResponse.entities['git-repository']['0'].value;\n issueRepositoryTextField.value = repoName;\n }\n }\n\n populateAddCollaboratorData(recastResponse) {\n const collaboratorNameTextField = document.getElementById('collaboratorName');\n const repoForCollabTextField = document.getElementById('repoForCollab');\n if (collaboratorNameTextField && recastResponse && recastResponse.entities.git_collaborator && recastResponse.entities.git_collaborator.length > 0 && recastResponse.entities.git_collaborator['0'].value) {\n const collaboratorName = recastResponse.entities.git_collaborator['0'].value;\n collaboratorNameTextField.value = collaboratorName;\n }\n if (repoForCollabTextField && recastResponse && recastResponse.entities['git-repository'] && recastResponse.entities['git-repository'].length > 0 && recastResponse.entities['git-repository']['0'].value) {\n const repoName = recastResponse.entities['git-repository']['0'].value;\n repoForCollabTextField.value = repoName;\n }\n }\n\n populateAddCommentData(recastResponse) {\n const repoForIssueCommentTextField = document.getElementById('repoForIssueComment');\n const issueNumberTextField = document.getElementById('issueNumber');\n const issueCommentTextArea = document.getElementById('issueComment');\n if (repoForIssueCommentTextField && recastResponse && recastResponse.entities['git-repository'] && recastResponse.entities['git-repository'].length > 0 && recastResponse.entities['git-repository']['0'].value) {\n const repoForIssueComment = recastResponse.entities['git-repository']['0'].value;\n repoForIssueCommentTextField.value = repoForIssueComment;\n }\n if (issueNumberTextField && recastResponse && recastResponse.entities.issue_id && recastResponse.entities.issue_id.length > 0 && recastResponse.entities.issue_id['0'].value) {\n const issueNumber = recastResponse.entities.issue_id['0'].value;\n issueNumberTextField.value = issueNumber;\n }\n if (issueCommentTextArea && recastResponse && recastResponse.entities.issue_comment && recastResponse.entities.issue_comment.length > 0 && recastResponse.entities.issue_comment['0'].value) {\n const issueComment = recastResponse.entities.issue_comment['0'].value;\n issueCommentTextArea.value = issueComment;\n }\n }\n\n populateDisplayCommentData(recastResponse) {\n const issueNumberTextField = document.getElementById('issueNumberForCommentView');\n const issueRepositoryTextField = document.getElementById('repoForCommentView');\n if (issueNumberTextField && recastResponse && recastResponse.entities.issue_id && recastResponse.entities.issue_id.length > 0 && recastResponse.entities.issue_id['0'].value) {\n const issueNumber = recastResponse.entities.issue_id['0'].value;\n issueNumberTextField.value = issueNumber;\n }\n if (issueRepositoryTextField && recastResponse && recastResponse.entities['git-repository'] && recastResponse.entities['git-repository'].length > 0 && recastResponse.entities['git-repository']['0'].value) {\n const repoName = recastResponse.entities['git-repository']['0'].value;\n issueRepositoryTextField.value = repoName;\n }\n }\n\n isVisible(element) {\n return element ? !element.classList.contains('hide') : false;\n }\n\n getDataFromFormAsJSON() {\n let data = {};\n const intent = $(`#${$config.costants.hiddenIntentFieldId}`).val();\n const requestMethod = $config.intentSlugToOperations[intent].requestMethod;\n if (intent) {\n const operation = $config.intentSlugToOperations[intent].getDataOperation;\n if (typeof this[operation] === 'function') {\n data = this[operation]();\n }\n }\n return data;\n }\n\n getCreateRepoJson() {\n const data = {};\n const request = {};\n if (this.isVisible(document.getElementById('createrepo'))) {\n request.name = document.getElementById('repositoryName').value;\n request.description = document.getElementById('description').value;\n request.homepage = document.getElementById('homePageURL').value;\n request.private = document.getElementById('privateRepoChk').checked;\n request.has_issues = document.getElementById('issuesChk').checked;\n request.has_wiki = document.getElementById('wikiChk').checked;\n }\n data.request = request;\n return data;\n }\n\n getCreateIssueJson() {\n const data = {};\n data.urlParams = {};\n const request = {};\n if (this.isVisible(document.getElementById('createissue'))) {\n request.title = document.getElementById('issueTitle').value;\n request.body = document.getElementById('description').value;\n request.assignees = document.getElementById('assignees').value ? document.getElementById('assignees').value.split(',') : [];\n request.labels = document.getElementById('labels').value ? document.getElementById('labels').value.split(',') : [];\n data.urlParams.repoName = document.getElementById('issueRepository').value;\n }\n data.request = request;\n return data;\n }\n\n getCloseIssueJson() {\n const data = {};\n data.urlParams = {};\n if (this.isVisible(document.getElementById('closeissue'))) {\n data.urlParams.issueId = document.getElementById('issueNumerToClose').value;\n data.urlParams.repoName = document.getElementById('repoForIssueClose').value;\n }\n return data;\n }\n\n getAddCollaboratorJson() {\n const data = {};\n data.urlParams = {};\n if (this.isVisible(document.getElementById('addcollab'))) {\n data.urlParams.collaborator = document.getElementById('collaboratorName').value;\n data.urlParams.repoName = document.getElementById('repoForCollab').value;\n }\n return data;\n }\n\n getAddCommentJson() {\n const data = {};\n data.urlParams = {};\n const request = {};\n if (this.isVisible(document.getElementById('addissuecomment'))) {\n request.body = document.getElementById('issueComment').value;\n data.urlParams.issueId = document.getElementById('issueNumber').value;\n data.urlParams.repoName = document.getElementById('repoForIssueComment').value;\n }\n data.request = request;\n return data;\n }\n\n getDisplayCommentJson() {\n const data = {};\n data.urlParams = {};\n if (this.isVisible(document.getElementById('displaylastcomment'))) {\n data.urlParams.issueId = document.getElementById('issueNumberForCommentView').value;\n data.urlParams.repoName = document.getElementById('repoForCommentView').value;\n }\n return data;\n }\n\n addGitOperationHistory(data, type) {\n const intent = $(`#${$config.costants.hiddenIntentFieldId}`).val();\n const requestMethod = $config.intentSlugToOperations[intent].requestMethod;\n const conversations = document.getElementById('conversations');\n let table;\n let comment;\n // Create Elements\n const card = document.createElement('div');\n const cardBody = document.createElement('div');\n const cardTitle = document.createElement('h5');\n const closeAnchor = document.createElement('a');\n const closeHeader = document.createElement('h6');\n const cardText = document.createElement('p');\n const cardFooter = document.createElement('div');\n const textMuted = document.createElement('small');\n const underCardLine = document.createElement('div');\n\n // Add Attributes\n card.classList.add('card', type);\n cardBody.classList.add('card-body');\n cardTitle.classList.add('card-title');\n closeAnchor.classList.add('close');\n // closeAnchor.setAttribute('href', '#');\n cardText.classList.add('card-text');\n cardFooter.classList.add('card-footer');\n textMuted.classList.add('text-muted');\n underCardLine.classList.add('line');\n\n // Add content\n closeHeader.innerHTML = 'x';\n\n const x = this.display_ct(0, textMuted);\n if (type === 'command') {\n // Add content\n cardTitle.innerHTML = 'You Said';\n cardText.innerHTML = data;\n const repeat = document.createElement('a');\n repeat.classList.add('btn', 'btn-info', 'float-right');\n repeat.setAttribute('role', 'button');\n repeat.setAttribute('href', '#');\n repeat.setAttribute('id', `btnRepeatCommand${this.commandCardCounter++}`);\n repeat.innerHTML = 'Repeat';\n cardText.appendChild(repeat);\n } else if (type === 'response') {\n // Add content\n cardTitle.innerHTML = 'Server Responded As..';\n if (requestMethod == 'post') {\n cardText.innerHTML = `${$config.intentSlugToOperations[intent].cardMsg}${this.getVariable(data, $config.intentSlugToOperations[intent].cardDataName)}`;\n } else if (requestMethod == 'get') {\n cardText.innerHTML = $config.intentSlugToOperations[intent].cardMsg;\n if (data && data.length && data.length > 0) {\n if (intent === 'viewrepos') {\n table = this.createRepoTable(data);\n } else if (intent === 'displaylastcomment') {\n comment = this.createCommentBody(data);\n }\n }\n }\n } else {\n cardTitle.innerHTML = 'Server Responded As..';\n cardText.innerHTML = `Operation failed with status: ${type}`;\n }\n\n // Associations\n closeAnchor.appendChild(closeHeader);\n cardTitle.appendChild(closeAnchor);\n cardBody.appendChild(cardTitle);\n cardBody.appendChild(cardText);\n if (comment) {\n cardBody.appendChild(comment);\n }\n cardFooter.appendChild(textMuted);\n card.appendChild(cardBody);\n if (table) {\n card.appendChild(table);\n }\n card.appendChild(cardFooter);\n\n conversations.insertBefore(underCardLine, conversations.firstChild);\n conversations.insertBefore(card, conversations.firstChild);\n }\n\n getVariable(data, commaSeparatedValue) {\n const arr = commaSeparatedValue.split(',');\n for (let i = 0; i < arr.length; i++) {\n data = data[arr[i]];\n }\n return data;\n }\n\n createRepoTable(data) {\n // Create Elements\n const table = document.createElement('table');\n const thead = document.createElement('thead');\n const tr_head = document.createElement('tr');\n const th_1 = document.createElement('th');\n const th_2 = document.createElement('th');\n const th_3 = document.createElement('th');\n const th_4 = document.createElement('th');\n const th_5 = document.createElement('th');\n const th_6 = document.createElement('th');\n const th_7 = document.createElement('th');\n\n // Add Attributes\n table.classList.add('table', 'tabled-bordered', 'table-striped', 'table-hover');\n thead.classList.add('thead-dark');\n th_1.setAttribute('scope', 'col');\n th_2.setAttribute('scope', 'col');\n th_3.setAttribute('scope', 'col');\n th_4.setAttribute('scope', 'col');\n th_5.setAttribute('scope', 'col');\n th_6.setAttribute('scope', 'col');\n th_7.setAttribute('scope', 'col');\n\n // Add Inner HTML\n th_1.innerHTML = '#';\n th_2.innerHTML = 'Repository Name';\n th_3.innerHTML = 'Repository ID';\n th_4.innerHTML = 'Created On';\n th_5.innerHTML = 'Created By';\n th_6.innerHTML = 'View Raw';\n th_7.innerHTML = 'Delete Repository';\n\n // Associations\n tr_head.appendChild(th_1);\n tr_head.appendChild(th_2);\n tr_head.appendChild(th_3);\n tr_head.appendChild(th_4);\n tr_head.appendChild(th_5);\n tr_head.appendChild(th_6);\n tr_head.appendChild(th_7);\n thead.appendChild(tr_head);\n table.appendChild(thead);\n\n for (let i = 0; i < data.length; i++) {\n const currentRepo = data[i];\n // Create Elements\n const tbody = document.createElement('tbody');\n const tr_body = document.createElement('tr');\n const th_vertical = document.createElement('th');\n const td_1 = document.createElement('td');\n const td_2 = document.createElement('td');\n const td_3 = document.createElement('td');\n const td_4 = document.createElement('td');\n const td_5 = document.createElement('td');\n const td_6 = document.createElement('td');\n\n // Add Attributes\n th_vertical.setAttribute('scope', 'row');\n tr_body.setAttribute('id', `repoRow${i}`);\n\n // Add Inner HTML\n th_vertical.innerHTML = i + 1;\n td_1.innerHTML = currentRepo.name;\n td_2.innerHTML = `${currentRepo.id}`;\n td_3.innerHTML = currentRepo.created_at;\n td_4.innerHTML = `${currentRepo.owner.login}`;\n td_5.innerHTML = `View`;\n td_6.innerHTML = `Delete`;\n\n // Associations\n tr_body.appendChild(th_vertical);\n tr_body.appendChild(td_1);\n tr_body.appendChild(td_2);\n tr_body.appendChild(td_3);\n tr_body.appendChild(td_4);\n tr_body.appendChild(td_5);\n tr_body.appendChild(td_6);\n tbody.appendChild(tr_body);\n table.appendChild(tbody);\n }\n\n return table;\n }\n\n loadConversations(historyAll) {\n historyAll.forEach(element => {\n this.addGitOperationHistory();\n });\n }\n\n createCommentBody(data) {\n const commentPara = document.createElement('p');\n const lastComment = helper.getLatestComment(data);\n commentPara.classList.add('card-text');\n commentPara.innerHTML = `COMMENT: ${lastComment}`;\n return commentPara;\n }\n\n concealCodeInUrl() {\n window.location = 'http://localhost:8080';\n }\n\n toggleModals(response) {\n const self = this;\n const promise = response.json();\n const intent = $(`#${$config.costants.hiddenIntentFieldId}`).val();\n $('#submitConfirm').addClass('hide');\n $('#btnCancelConfirm').click();\n $('.modal-backdrop').removeClass('modal-backdrop');\n $('#underWidgetLine').addClass('hide');\n $('#intentBox').addClass('hide');\n if (response && response.status && (response.status === 201 || response.status === 200 || response.status === 204)) {\n $('#successAlert').removeClass('hide');\n $('#widgets').children().addClass('hide');\n promise.then(body => {\n $('#op-msg').text($config.intentSlugToOperations[intent].successMessage);\n $('#successAlert').removeClass('hide');\n self.addGitOperationHistory(body, 'response');\n // clear intent\n $(`#${$config.costants.hiddenIntentFieldId}`).val('');\n });\n } else {\n $('#widgets').children().addClass('hide');\n $('#dangerAlert').removeClass('hide');\n self.addGitOperationHistory(response.status);\n // clear intent\n $(`#${$config.costants.hiddenIntentFieldId}`).val('');\n }\n }\n\n display_ct(start, element) {\n this.start = start;\n this.element = element;\n const days = Math.floor(this.start / 86400);\n const hours = Math.floor((this.start - days * 86400) / 3600);\n const minutes = Math.floor((this.start - days * 86400 - hours * 3600) / 60);\n const secs = Math.floor(this.start - days * 86400 - hours * 3600 - minutes * 60);\n let x = '';\n if (days != 0) {\n x = `${x + days} days`;\n }\n if (hours != 0) {\n x = `${x + hours} hours`;\n }\n if (minutes != 0) {\n x = `${x + minutes} minutes`;\n }\n x = `${x + secs} seconds ago`;\n element.innerHTML = x;\n this.start = this.start + 1;\n // setTimeout(this['display_ct](this.start, this.element)', 1000 )\n }\n};\n\n//# sourceURL=webpack:///./src/js/dom-ops.js?"); /***/ }), @@ -204,7 +262,7 @@ eval("const $config = __webpack_require__(/*! ./config.js */ \"./src/js/config.j /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("const Recast = __webpack_require__(/*! ./bot/recast-ops.js */ \"./src/js/bot/recast-ops.js\");\n\nconst recastclient = new Recast();\nconst DomManipulator = __webpack_require__(/*! ./dom-ops.js */ \"./src/js/dom-ops.js\");\n\nconst dom = new DomManipulator();\nconst Microbot = __webpack_require__(/*! ./microbot-ops.js */ \"./src/js/microbot-ops.js\");\n\nconst app = new Microbot();\nconst $config = __webpack_require__(/*! ./config.js */ \"./src/js/config.js\");\n\nmodule.exports = $(document).ready(() => {\n // console.log('test');\n app.setToken();\n $('#sidebarCollapse').on('click', () => {\n $('#sidebar').toggleClass('active');\n $('.hideable').toggleClass('hide');\n });\n $('#content nav div.collapse li a.nav-link i.far.fa-star').hover(() => {\n $('#content nav div.collapse li a.nav-link i.far.fa-star').toggleClass('fas');\n });\n $('#content nav div.collapse li a.nav-link i.far.fa-trash-alt').hover(() => {\n $('#content nav div.collapse li a.nav-link i.far.fa-trash-alt').toggleClass('fas');\n });\n $('#content nav div.collapse li a.nav-link i.far.fa-paper-plane').hover(() => {\n $('#content nav div.collapse li a.nav-link i.far.fa-paper-plane').toggleClass('fas');\n });\n $('#command').keyup(e => {\n const code = e.keyCode ? e.keyCode : e.which;\n if (code == 13) {\n $('#widgets').children().addClass('hide');\n $('#successAlert').addClass('hide');\n $('#dangetAlert').addClass('hide');\n $('#intentBox').addClass('hide');\n const command = document.getElementById('command').value;\n if (command) {\n const text = { text: command };\n recastclient.getAndCallProcessIntent(command, text);\n } else {\n dom.showEmptyCommandMessage();\n }\n }\n });\n $('#btnSubmitConfirm').on('click', () => {\n $('#submitConfirm').removeClass('hide');\n });\n $('#submitGitData').on('click', () => {\n const data = dom.getDataFromFormAsJSON();\n const intent = $(`#${$config.costants.hiddenIntentFieldId}`).val();\n if (intent) {\n const operation = $config.intentSlugToOperations[intent].githubOperation;\n app[operation](data);\n }\n });\n $('#hideInfoAlert').on('click', () => {\n $('#intentBox').addClass('hide');\n });\n $('#hideSuccessAlert').on('click', () => {\n $('#successAlert').addClass('hide');\n });\n $('#conversations').on('click', '.close', function () {\n const $target = $(this).closest('.card');\n const line = $target.next();\n $target.hide('slow', () => {\n $target.remove();\n });\n line.hide('slow', () => {\n line.remove();\n });\n });\n $('#hideDangerAlert').on('click', () => {\n $('#dangerAlert').addClass('hide');\n });\n $('#git_bridge').on('click', () => {\n window.location.href = 'https://github.com/login/oauth/authorize?scope=user:email:repo&client_id=f6f649a1fe2dfea082ba';\n // var user = app.getCurrentUser();\n // if(user) {\n // window.location.href = './../continue.html'\n // } else {\n // window.location.href = 'https://github.com/login/oauth/authorize?scope=user:email:repo&client_id=f6f649a1fe2dfea082ba';\n // }\n });\n if (window.location.href.match(/\\?code=(.*)/)) {\n const code = window.location.href.match(/\\?code=(.*)/)[1];\n app.getToken(code);\n }\n});\n\n//# sourceURL=webpack:///./src/js/event-toggles.js?"); +eval("const Recast = __webpack_require__(/*! ./bot/recast-ops.js */ \"./src/js/bot/recast-ops.js\");\n\nconst recastclient = new Recast();\nconst DomManipulator = __webpack_require__(/*! ./dom-ops.js */ \"./src/js/dom-ops.js\");\n\nconst dom = new DomManipulator();\nconst Microbot = __webpack_require__(/*! ./microbot-ops.js */ \"./src/js/microbot-ops.js\");\n\nconst app = new Microbot();\nconst $config = __webpack_require__(/*! ./config.js */ \"./src/js/config.js\");\n\nconst PersistentOps = __webpack_require__(/*! ./persistent-ops */ \"./src/js/persistent-ops.js\");\nconst persistentOps = new PersistentOps();\n\nmodule.exports = $(document).ready(() => {\n // console.log('test');\n app.setToken();\n $('#sidebarCollapse').on('click', () => {\n $('#sidebar').toggleClass('active');\n $('.hideable').toggleClass('hide');\n });\n $('#content nav div.collapse li a.nav-link i.far.fa-star').hover(() => {\n $('#content nav div.collapse li a.nav-link i.far.fa-star').toggleClass('fas');\n });\n $('#content nav div.collapse li a.nav-link i.far.fa-trash-alt').hover(() => {\n $('#content nav div.collapse li a.nav-link i.far.fa-trash-alt').toggleClass('fas');\n });\n $('#content nav div.collapse li a.nav-link i.far.fa-paper-plane').hover(() => {\n $('#content nav div.collapse li a.nav-link i.far.fa-paper-plane').toggleClass('fas');\n });\n $('#command').keyup(e => {\n const code = e.keyCode ? e.keyCode : e.which;\n if (code == 13) {\n $('#widgets').children().addClass('hide');\n $('#successAlert').addClass('hide');\n $('#dangetAlert').addClass('hide');\n $('#intentBox').addClass('hide');\n const command = document.getElementById('command').value;\n if (command) {\n const text = { text: command };\n recastclient.getAndCallProcessIntent(command, text);\n } else {\n dom.showEmptyCommandMessage();\n }\n }\n });\n $('#btnSubmitConfirm').on('click', () => {\n $('#submitConfirm').removeClass('hide');\n });\n $('#submitGitData').on('click', () => {\n const data = dom.getDataFromFormAsJSON();\n const intent = $(`#${$config.costants.hiddenIntentFieldId}`).val();\n if (intent) {\n const operation = $config.intentSlugToOperations[intent].githubOperation;\n app[operation](data);\n }\n });\n $('#hideInfoAlert').on('click', () => {\n $('#intentBox').addClass('hide');\n });\n $('#hideSuccessAlert').on('click', () => {\n $('#successAlert').addClass('hide');\n });\n $('#conversations').on('click', '.close', function () {\n const $target = $(this).closest('.card');\n const line = $target.next();\n $target.hide('slow', () => {\n $target.remove();\n });\n line.hide('slow', () => {\n line.remove();\n });\n });\n $('#hideDangerAlert').on('click', () => {\n $('#dangerAlert').addClass('hide');\n });\n $('#git_bridge').on('click', () => {\n window.location.href = 'https://github.com/login/oauth/authorize?scope=user:email:repo&client_id=f6f649a1fe2dfea082ba';\n });\n window.onload = persistentOps.loadConversations();\n if (window.location.href.match(/\\?code=(.*)/)) {\n const code = window.location.href.match(/\\?code=(.*)/)[1];\n app.getToken(code);\n }\n});\n\n//# sourceURL=webpack:///./src/js/event-toggles.js?"); /***/ }), @@ -215,7 +273,7 @@ eval("const Recast = __webpack_require__(/*! ./bot/recast-ops.js */ \"./src/js/b /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("const config = __webpack_require__(/*! ./config.js */ \"./src/js/config.js\");\nconst GithubHelper = __webpack_require__(/*! ./helper.js */ \"./src/js/helper.js\");\n\nconst githubHelper = new GithubHelper();\nconst DomManipulator = __webpack_require__(/*! ./dom-ops.js */ \"./src/js/dom-ops.js\");\n\nconst dom = new DomManipulator();\nconst PersistentOps = __webpack_require__(/*! ./persistent-ops.js */ \"./src/js/persistent-ops.js\");\n\nconst persistentOps = new PersistentOps();\n\nmodule.exports = class Github {\n constructor() {\n this.authorizationToken = `token ${config.gitToken}`;\n }\n\n getToken(code) {\n let token = '';\n self = this;\n $.getJSON(`http://localhost:9999/authenticate/${code}`, data => {\n console.log(data.token);\n token = data.token;\n // set cookie here\n persistentOps.setCookie('gitToken', token, 30);\n // self.authorizationToken = \"token \" + persistentOps.getCookie('gitToken');\n dom.concealCodeInUrl();\n });\n return token;\n }\n\n getCurrentUser() {\n let repositories = '';\n const url = 'https://api.github.com/user/';\n fetch(url, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8'\n }\n }).then(response => {\n response.json().then(body => {\n repositories = body;\n console.log(repositories);\n return repositories;\n });\n dom.toggleModals(response);\n }).catch(error => console.error('Fetch Error =\\n', error));\n return repositories;\n }\n\n authenticate() {}\n\n viewRepositories() {\n const repositories = '';\n const url = 'https://api.github.com/user/repos';\n fetch(url, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n Authorization: this.authorizationToken\n }\n }).then(response => {\n // response.json().then(function(body){\n // repositories = body;\n // console.log(repositories);\n // return repositories;\n // });\n dom.toggleModals(response);\n }).catch(error => console.error('Fetch Error =\\n', error));\n return repositories;\n }\n\n createRepository(newRepoJson) {\n const url = 'https://api.github.com/user/repos';\n const responsePromise = '';\n fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n Authorization: this.authorizationToken\n },\n body: JSON.stringify(newRepoJson)\n }).then(response => {\n dom.toggleModals(response);\n }).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n updateRepository(updateRepoJson, repoName) {\n repoName = 'Hello-World3';\n const url = `https://api.github.com/repos/mohiit1502/${repoName}`;\n fetch(url, {\n method: 'PATCH',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n Authorization: this.authorizationToken\n },\n body: JSON.stringify(updateRepoJson)\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n deleteRepository(repoName) {\n repoName = 'Hello-World2';\n const url = `https://api.github.com/repos/mohiit1502/${repoName}`;\n fetch(url, {\n method: 'DELETE',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n Authorization: this.authorizationToken\n }\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n createIssue(newIssueJson, repoName) {\n const url = `https://api.github.com/repos/mohiit1502/${repoName}/issues`;\n fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n Authorization: this.authorizationToken\n },\n body: JSON.stringify(newIssueJson)\n }).then(response => {\n dom.toggleModals(response);\n }).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n updateIssue(updateIssueJson, repoName, issueNumber) {\n repoName = 'stack_route_prj7';\n issueNumber = 2;\n const url = `https://api.github.com/repos/mohiit1502/${repoName}/issues/${issueNumber}`;\n fetch(url, {\n method: 'PATCH',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n Authorization: this.authorizationToken\n },\n body: JSON.stringify(updateIssueJson)\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n closeIssue(closeIssueJson, repoName, issueNumber) {\n const url = `https://api.github.com/repos/mohiit1502/${repoName}/issues/${issueNumber}`;\n fetch(url, {\n method: 'PATCH',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n Authorization: this.authorizationToken\n },\n body: JSON.stringify(closeIssueJson)\n }).then(response => {\n dom.toggleModals(response);\n }).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n reopenIssue(reopenIssueJson, repoName, issueNumber) {\n repoName = 'stack_route_prj7';\n issueNumber = 2;\n const url = `https://api.github.com/repos/mohiit1502/${repoName}/issues/${issueNumber}`;\n fetch(url, {\n method: 'PATCH',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n Authorization: this.authorizationToken\n },\n body: JSON.stringify(reopenIssueJson)\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n displayIssue(repoName, issueNumber) {\n repoName = 'stack_route_prj7';\n issueNumber = 2;\n const url = `https://api.github.com/repos/mohiit1502/${repoName}/issues/${issueNumber}`;\n let issues = '';\n fetch(url, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n Authorization: this.authorizationToken\n }\n }).then(response => {\n response.json().then(body => {\n issues = body;\n console.log(issues);\n return issues;\n });\n }).catch(error => console.error('Fetch Error =\\n', error));\n return issues;\n }\n\n addIssueComment(commentBodyJson, repoName, issueId) {\n const url = `https://api.github.com/repos/mohiit1502/${repoName}/issues/${issueId}/comments`;\n fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n Authorization: this.authorizationToken\n },\n body: JSON.stringify(commentBodyJson)\n }).then(response => {\n dom.toggleModals(response);\n }).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n displayLastComment(repoName, issueNumber) {\n const url = `https://api.github.com/repos/mohiit1502/${repoName}/issues/${issueNumber}/comments`;\n const comments = [];\n const latestComment = '';\n fetch(url, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n Authorization: this.authorizationToken\n }\n }).then(response => {\n dom.toggleModals(response);\n // response.json().then(function(body){\n // comments = body;\n // latestComment = githubHelper.getLatestComment(comments);\n // console.log(comments);\n // console.log(latestComment);\n // });\n }).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n displayIssuesForUser() {\n const url = 'https://api.github.com/user/issues';\n fetch(url, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n Authorization: this.authorizationToken\n }\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n displayIssuesOnRepo() {\n repoName = 'stack_route_prj7';\n issueNumber = 2;\n const url = `https://api.github.com/repos/mohiit1502/${repoName}/issues/`;\n fetch(url, {\n method: 'PATCH',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n Authorization: this.authorizationToken\n },\n body: JSON.stringify(updateIssueJson)\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n addCollaborator(repoName, collaborator) {\n repoName = 'stack_route_prj7';\n collaborator = 'swat1508';\n const url = `https://api.github.com/repos/mohiit1502/${repoName}/collaborators/${collaborator}`;\n fetch(url, {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: this.authorizationToken\n }\n }).then(response => {\n dom.toggleModals(response);\n }).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n removeCollaborator(repoName, collaborator) {\n repoName = 'stack_route_prj7';\n collaborator = 'swat1508';\n const url = `https://api.github.com/repos/mohiit1502/${repoName}/collaborators/${collaborator}`;\n fetch(url, {\n method: 'DELETE',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: this.authorizationToken\n }\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n createUser(newuserJson) {}\n\n updateUser(updateUserJson) {}\n\n deleteUser(userId) {}\n};\n\n//# sourceURL=webpack:///./src/js/github-ops.js?"); +eval("const config = __webpack_require__(/*! ./config.js */ \"./src/js/config.js\");\n\nconst DomManipulator = __webpack_require__(/*! ./dom-ops.js */ \"./src/js/dom-ops.js\");\nconst dom = new DomManipulator();\n\nconst PersistentOps = __webpack_require__(/*! ./persistent-ops.js */ \"./src/js/persistent-ops.js\");\nconst persistentOps = new PersistentOps();\n\nmodule.exports = class Github {\n constructor() {\n this.authorizationToken = `token ${config.gitToken}`;\n }\n\n getToken(code) {\n let token = '';\n self = this;\n $.getJSON(`http://localhost:9999/authenticate/${code}`, data => {\n console.log(data.token);\n token = data.token;\n // set cookie here\n persistentOps.setCookie('gitToken', token, 30);\n // self.authorizationToken = \"token \" + persistentOps.getCookie('gitToken');\n dom.concealCodeInUrl();\n });\n return token;\n }\n\n getCurrentUser() {\n let repositories = '';\n const url = 'https://api.github.com/user/';\n fetch(url, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8'\n }\n }).then(response => {\n response.json().then(body => {\n repositories = body;\n console.log(repositories);\n return repositories;\n });\n dom.toggleModals(response);\n }).catch(error => console.error('Fetch Error =\\n', error));\n return repositories;\n }\n\n authenticate() {}\n\n viewRepositories() {\n const repositories = '';\n const url = 'https://api.github.com/user/repos';\n fetch(url, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n Authorization: this.authorizationToken\n }\n }).then(response => {\n // response.json().then(function(body){\n // repositories = body;\n // console.log(repositories);\n // return repositories;\n // });\n dom.toggleModals(response);\n }).catch(error => console.error('Fetch Error =\\n', error));\n return repositories;\n }\n\n createRepository(newRepoJson) {\n const url = 'https://api.github.com/user/repos';\n const responsePromise = '';\n fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n Authorization: this.authorizationToken\n },\n body: JSON.stringify(newRepoJson)\n }).then(response => {\n dom.toggleModals(response);\n }).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n updateRepository(updateRepoJson, repoName) {\n repoName = 'Hello-World3';\n const url = `https://api.github.com/repos/mohiit1502/${repoName}`;\n fetch(url, {\n method: 'PATCH',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n Authorization: this.authorizationToken\n },\n body: JSON.stringify(updateRepoJson)\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n deleteRepository(repoName) {\n repoName = 'Hello-World2';\n const url = `https://api.github.com/repos/mohiit1502/${repoName}`;\n fetch(url, {\n method: 'DELETE',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n Authorization: this.authorizationToken\n }\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n createIssue(newIssueJson, repoName) {\n const url = `https://api.github.com/repos/mohiit1502/${repoName}/issues`;\n fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n Authorization: this.authorizationToken\n },\n body: JSON.stringify(newIssueJson)\n }).then(response => {\n dom.toggleModals(response);\n }).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n updateIssue(updateIssueJson, repoName, issueNumber) {\n repoName = 'stack_route_prj7';\n issueNumber = 2;\n const url = `https://api.github.com/repos/mohiit1502/${repoName}/issues/${issueNumber}`;\n fetch(url, {\n method: 'PATCH',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n Authorization: this.authorizationToken\n },\n body: JSON.stringify(updateIssueJson)\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n closeIssue(closeIssueJson, repoName, issueNumber) {\n const url = `https://api.github.com/repos/mohiit1502/${repoName}/issues/${issueNumber}`;\n fetch(url, {\n method: 'PATCH',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n Authorization: this.authorizationToken\n },\n body: JSON.stringify(closeIssueJson)\n }).then(response => {\n dom.toggleModals(response);\n }).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n reopenIssue(reopenIssueJson, repoName, issueNumber) {\n repoName = 'stack_route_prj7';\n issueNumber = 2;\n const url = `https://api.github.com/repos/mohiit1502/${repoName}/issues/${issueNumber}`;\n fetch(url, {\n method: 'PATCH',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n Authorization: this.authorizationToken\n },\n body: JSON.stringify(reopenIssueJson)\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n displayIssue(repoName, issueNumber) {\n repoName = 'stack_route_prj7';\n issueNumber = 2;\n const url = `https://api.github.com/repos/mohiit1502/${repoName}/issues/${issueNumber}`;\n let issues = '';\n fetch(url, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n Authorization: this.authorizationToken\n }\n }).then(response => {\n response.json().then(body => {\n issues = body;\n console.log(issues);\n return issues;\n });\n }).catch(error => console.error('Fetch Error =\\n', error));\n return issues;\n }\n\n addIssueComment(commentBodyJson, repoName, issueId) {\n const url = `https://api.github.com/repos/mohiit1502/${repoName}/issues/${issueId}/comments`;\n fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n Authorization: this.authorizationToken\n },\n body: JSON.stringify(commentBodyJson)\n }).then(response => {\n dom.toggleModals(response);\n }).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n displayLastComment(repoName, issueNumber) {\n const url = `https://api.github.com/repos/mohiit1502/${repoName}/issues/${issueNumber}/comments`;\n const comments = [];\n const latestComment = '';\n fetch(url, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n Authorization: this.authorizationToken\n }\n }).then(response => {\n dom.toggleModals(response);\n // response.json().then(function(body){\n // comments = body;\n // latestComment = githubHelper.getLatestComment(comments);\n // console.log(comments);\n // console.log(latestComment);\n // });\n }).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n displayIssuesForUser() {\n const url = 'https://api.github.com/user/issues';\n fetch(url, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n Authorization: this.authorizationToken\n }\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n displayIssuesOnRepo() {\n repoName = 'stack_route_prj7';\n issueNumber = 2;\n const url = `https://api.github.com/repos/mohiit1502/${repoName}/issues/`;\n fetch(url, {\n method: 'PATCH',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n Authorization: this.authorizationToken\n },\n body: JSON.stringify(updateIssueJson)\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n addCollaborator(repoName, collaborator) {\n repoName = 'stack_route_prj7';\n collaborator = 'swat1508';\n const url = `https://api.github.com/repos/mohiit1502/${repoName}/collaborators/${collaborator}`;\n fetch(url, {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: this.authorizationToken\n }\n }).then(response => {\n dom.toggleModals(response);\n }).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n removeCollaborator(repoName, collaborator) {\n repoName = 'stack_route_prj7';\n collaborator = 'swat1508';\n const url = `https://api.github.com/repos/mohiit1502/${repoName}/collaborators/${collaborator}`;\n fetch(url, {\n method: 'DELETE',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: this.authorizationToken\n }\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n createUser(newuserJson) {}\n\n updateUser(updateUserJson) {}\n\n deleteUser(userId) {}\n};\n\n//# sourceURL=webpack:///./src/js/github-ops.js?"); /***/ }), @@ -226,7 +284,18 @@ eval("const config = __webpack_require__(/*! ./config.js */ \"./src/js/config.js /*! no static exports found */ /***/ (function(module, exports) { -eval("module.exports = class GithubHelper {\n getLatestComment(comments) {\n if (comments && comments.length > 0) {\n return comments[comments.length - 1].body;\n }\n }\n};\n\n//# sourceURL=webpack:///./src/js/helper.js?"); +eval("module.exports = class Helper {\n getLatestComment(comments) {\n if (comments && comments.length > 0) {\n return comments[comments.length - 1].body;\n }\n }\n\n compareByProperty(property) {\n return function (a, b) {\n if (a[property] < b[property]) return -1;\n if (a.last_nom > b.last_nom) return 1;\n return 0;\n };\n }\n\n clone(obj) {\n if (null == obj || \"object\" != typeof obj) return obj;\n var copy = Object.assign({}, obj);\n return copy;\n }\n\n};\n\n//# sourceURL=webpack:///./src/js/helper.js?"); + +/***/ }), + +/***/ "./src/js/history.js": +/*!***************************!*\ + !*** ./src/js/history.js ***! + \***************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("const state = {\n createrepo: [],\n createissue: [],\n closeissue: [],\n addissuecomment: [],\n displaylastcomment: [],\n addcollab: [],\n viewrepos: [],\n queries: [],\n insertionCounter: 0\n};\n\nmodule.exports = state;\n\n//# sourceURL=webpack:///./src/js/history.js?"); /***/ }), @@ -245,10 +314,11 @@ eval("const Github = __webpack_require__(/*! ./github-ops.js */ \"./src/js/githu /*!**********************************!*\ !*** ./src/js/persistent-ops.js ***! \**********************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("module.exports = class PersistentOps {\n getLatestComment(comments) {\n if (comments && comments.length > 0) {\n return comments[comments.length - 1].body;\n }\n }\n\n setCookie(cname, cvalue, exdays) {\n const d = new Date();\n d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);\n const expires = `expires=${d.toUTCString()}`;\n document.cookie = `${cname}=${cvalue};${expires};path=/`;\n }\n\n getCookie(cname) {\n const name = `${cname}=`;\n const decodedCookie = decodeURIComponent(document.cookie);\n const ca = decodedCookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) == ' ') {\n c = c.substring(1);\n }\n if (c.indexOf(name) == 0) {\n return c.substring(name.length, c.length);\n }\n }\n return '';\n }\n};\n\n//# sourceURL=webpack:///./src/js/persistent-ops.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! redux */ \"./node_modules/redux/es/redux.js\");\n/* harmony import */ var _history__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./history */ \"./src/js/history.js\");\n/* harmony import */ var _history__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_history__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _helper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./helper */ \"./src/js/helper.js\");\n/* harmony import */ var _helper__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_helper__WEBPACK_IMPORTED_MODULE_2__);\n\n\n\nconst helper = new _helper__WEBPACK_IMPORTED_MODULE_2__[\"Helper\"]();\n\nmodule.exports = class PersistentOps {\n\n constructor() {\n this.store = Object(redux__WEBPACK_IMPORTED_MODULE_0__[\"createStore\"])(this.mbReducer, _history__WEBPACK_IMPORTED_MODULE_1__[\"state\"]);\n this.store.subscribe(this.renderCards);\n }\n setCookie(cname, cvalue, exdays) {\n const d = new Date();\n d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);\n const expires = `expires=${d.toUTCString()}`;\n document.cookie = `${cname}=${cvalue};${expires};path=/`;\n }\n\n getCookie(cname) {\n const name = `${cname}=`;\n const decodedCookie = decodeURIComponent(document.cookie);\n const ca = decodedCookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) == ' ') {\n c = c.substring(1);\n }\n if (c.indexOf(name) == 0) {\n return c.substring(name.length, c.length);\n }\n }\n return '';\n }\n\n mbReducer(currentState, action) {\n var nextState = {};\n switch (action.type) {\n case 'ADD_QUERY':\n let newHistory = {};\n let command = document.getElementById('command').value;\n nextState = helper.clone(currentState);\n newHistory.command = command;\n newHistory.insertionCounter = ++nextState.insertionCounter;\n nextState.queries = [...nextState.queries, newHistory];\n window.localStorage.setItem('currentState', JSON.stringify(nextState));\n return nextState;\n break;\n case 'DELETE':\n let deletedBtnId = action.btnDeleteId;\n nextState.todoList = [...currentState.todoList];\n nextState.counter = currentState.counter;\n return nextState;\n break;\n default:\n return currentState;\n }\n }\n\n renderCards() {\n $('#conversations').html = '';\n let history = store.getState();\n // let counter = 1;\n let historyALl = [];\n for (var property in history) {\n if (history.hasOwnProperty(property) && Array.isArray(history[property])) {\n historyAll = historyAll.concat(history[property]);\n }\n }\n historyAll.sort(helper.compareByProperty('insertionCounter'));\n dom.loadConversations(historyALl);\n }\n\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/webpack/buildin/harmony-module.js */ \"./node_modules/webpack/buildin/harmony-module.js\")(module)))\n\n//# sourceURL=webpack:///./src/js/persistent-ops.js?"); /***/ }), diff --git a/history.json b/history.json deleted file mode 100644 index e69de29..0000000 diff --git a/public/index.html b/public/index.html index 1e8fea4..f762e00 100644 --- a/public/index.html +++ b/public/index.html @@ -7,6 +7,7 @@ Microbot +