text
stringlengths
7
3.69M
import { useEffect, useState } from "react"; import { Spinner } from "react-bootstrap"; import ProductView from "./ProductView"; import { getAllProducts, deleteProductStateOnLoad, } from "../actions/productsActions"; import ProductSearch from "./ProductSearch"; import TableView from "./TableView"; import { useDispatch, useSelector } from "react-redux"; const ProductList = () => { const dispatch = useDispatch(); const allProducts = useSelector((state) => state.products); const [isCard, setIsCard] = useState(true); const setAsCards = () => { setIsCard(true); }; const setAsTable = () => { setIsCard(false); }; useEffect(() => { dispatch(getAllProducts()); dispatch(deleteProductStateOnLoad()); return () => { dispatch(deleteProductStateOnLoad()); }; // eslint-disable-next-line }, []); if (allProducts.getAllLoading) { return ( <div style={{ textAlign: "center", display: "flex", flexDirection: "column", alignItems: "center", margin: "10%", }} > <Spinner animation='border' style={{ width: "50px", height: "50px" }} /> </div> ); } return ( <div> <div className='element.style'> <h3 style={{ textAlign: "center", marginTop: "20px", fontWeight: "bold", }} > Product List </h3> <ProductSearch /> <div style={{ textAlign: "center" }}> <button className='btn btn-light m-2' onClick={setAsCards} style={{ fontWeight: "bold", borderWidth: "1px", borderStyle: "solid", borderColor: "black", }} > View As Cards </button> <button className='btn btn-dark m-2' onClick={setAsTable}> View As Table </button> </div> {!allProducts.getAllLoading && allProducts.products.length === 0 ? ( <div style={{ textAlign: "center", marginTop: "30px", }} > <h3>Sorry, No records to Display</h3> </div> ) : ( <div style={{ padding: "10px 30px", display: "flex", justifyContent: "center", flexWrap: "wrap", backgroundSize: "cover", }} > {isCard ? ( <div style={{ width: "95%" }}> {allProducts.products.map((e) => ( <ProductView key={e.id} e={e} /> ))} </div> ) : ( <div style={{ width: "95%" }}> <TableView /> </div> )} </div> )} </div> </div> ); }; export default ProductList;
"use strict"; module.exports = function(grunt){ grunt.initConfig({ jshint: { all: [ 'Gruntfile.js', 'dest/*.js', ], options: { jshintrc: '.jshintrc' } }, copy:{ default:{ files:{ 'dest/index.js':['src/index.js'] } } }, uglify:{ default:{ files:{ 'dest/index-min.js':['dest/index.js'] } } } }); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.registerTask('default', ['copy','uglify']); };
(function() { 'use strict'; angular .module('NikApp') .directive('nikFooter', nikFooter); function nikFooter() { var directive = { restrict: 'E', templateUrl: 'js/app/views/nik-footer.html' }; return directive; } })();
// h/t https://github.com/raywo/MMM-NowPlayingOnSpotify import moment from 'moment'; import axios from 'axios'; import { Buffer } from 'buffer'; import qs from 'query-string'; import keys from '../keys'; const { spotifyConfig } = keys; class SpotifyService { constructor() { this.credentials = spotifyConfig; this.tokenExpiresAt = moment(); } async retrieveCurrentlyPlaying() { let currentlyPlaying; try { if (moment().isAfter(this.tokenExpiresAt)) { await this.refreshAccessToken(); } const options = { headers: { Authorization: `Bearer ${this.credentials.accessToken}`, }, timeout: 1500, }; const { data } = await axios.get('https://api.spotify.com/v1/me/player/currently-playing', options); // Spotify API 204 if (data === '') { currentlyPlaying = { isPlaying: false, }; } else { const { progress_ms: songProgress, item: { name: title, duration_ms: songDuration, artists, }, } = data; currentlyPlaying = { title, songDuration, songProgress, isPlaying: true, artist: artists.map(artist => artist.name).join(', '), }; } } catch (e) { // eslint-disable-next-line no-console console.warn('Error retrieving Spotify info:', e && e.message); currentlyPlaying = { hasError: true, }; } return currentlyPlaying; } async refreshAccessToken() { try { const { clientId, clientSecret } = this.credentials; const encodedCreds = Buffer.from(`${clientId}:${clientSecret}`).toString('base64'); const options = { headers: { Authorization: `Basic ${encodedCreds}`, 'Content-Type': 'application/x-www-form-urlencoded', }, timeout: 1500, }; const { data: { expires_in: expiresIn, access_token: accessToken } } = await axios.post( 'https://accounts.spotify.com/api/token', qs.stringify({ grant_type: 'refresh_token', refresh_token: this.credentials.refreshToken, }), options, ); this.credentials.accessToken = accessToken; this.tokenExpiresAt = moment().add(expiresIn, 'seconds'); } catch (e) { // eslint-disable-next-line no-console console.warn('Error refreshing Spotify token:', e && e.message); } } } export default new SpotifyService();
define(['frame'], function (ngApp) { 'use strict'; ngApp.provider.controller('ctrlPreview', ['$scope', 'srvSigninApp', function ($scope, srvSigninApp) { function refresh() { $scope.previewURL = previewURL + '&openAt=' + params.openAt + '&page=' + params.page.name + '&_=' + (new Date() * 1); } var previewURL, params; $scope.params = params = { openAt: 'ontime' }; $scope.showPage = function (page) { params.page = page; }; srvSigninApp.get().then(function (app) { if (app.pages && app.pages.length) { $scope.gotoPage = function (page) { var url = "/rest/pl/fe/matter/signin/page"; url += "?site=" + app.siteid; url += "&id=" + app.id; url += "&page=" + page.name; location.href = url; }; previewURL = '/rest/site/fe/matter/signin/preview?site=' + app.siteid + '&app=' + app.id; params.page = app.pages[0]; $scope.$watch('params', function () { refresh(); }, true); $scope.$watch('app.use_site_header', function (nv, ov) { nv !== ov && refresh(); }); $scope.$watch('app.use_site_footer', function (nv, ov) { nv !== ov && refresh(); }); $scope.$watch('app.use_mission_header', function (nv, ov) { nv !== ov && refresh(); }); $scope.$watch('app.use_mission_header', function (nv, ov) { nv !== ov && refresh(); }); } }); }]); });
var aImg = document.querySelectorAll('.images'); var aBtn = document.querySelectorAll ('.content-btn'); var now = 0; function aa(){ for(var i = 0;i<aImg.length;i++){ aImg[i].style.opacity = '1'; // aImg[i].style.zIndex='0'; aBtn[i].className='content-btn'; } aImg[now].style.opacity='1'; // aImg[now].style.zIndex='20'; aBtn[now].className='content-btn actives'; } for(var i = 0;i<aBtn.length;i++){ // console.log(aBtn) aBtn[i].index=i; aBtn[i].onclick=setInterval(function(){ now=this.index; aa() },3000) }
var _viewer = this; var updateId = _viewer.getParHandler().getPKCode(); var kcId = _viewer.getParHandler().getItem("KC_ID").getValue(); _viewer.getBtn("impData").unbind("click").bind("click", function(event) { var param = {}; param["SOURCE"] = "IPZ_IP~IPZ_ZWH~IPZ_DESC~IPZ_ID"; param["TYPE"] = "multi"; param["HIDE"] = "IPZ_ID"; param["EXTWHERE"] = "and kc_id = '"+kcId+"'"; var configStr = "TS_KCGL_IPZWH,"+JsonToStr(param); var options = { "config" :configStr, "parHandler":_viewer, "formHandler":_viewer.form, "replaceCallBack":function(idArray) { var ipzIds = idArray.IPZ_ID; var ipzNums = ipzIds.split(",").length; for(var i = 0;i < ipzNums;i++){ var ipzId = ipzIds.split(",")[i]; FireFly.doAct("TS_KCGL_IPZWH","byid",{"_PK_":ipzId},true,false,function(data){ var bean = {}; bean["UPDATE_ID"] = updateId; bean["IPZ_ACTION"] = "update";//引入数据默认为修改 bean["IPZ_IP"] = data.IPZ_IP; bean["IPZ_ZWH"] = data.IPZ_ZWH; bean["IPZ_DESC"] = data.IPZ_DESC; bean["ROOT_ID"] = data.IPZ_ID; FireFly.doAct("TS_KCGL_UPDATE_IPZWH","save",bean); }); } } }; //2.用系统的查询选择组件 rh.vi.rhSelectListView() var queryView = new rh.vi.rhSelectListView(options); queryView.show(event); }); $("#TS_KCGL_UPDATE_IPZWH .rhGrid").find("tr").each(function(index, item) { if(index != 0){ var dataId = item.id; $(item).find("td[icode='BUTTONS']").append( '<a class="rhGrid-td-rowBtnObj rh-icon" operCode="optEditBtn" rowpk="'+dataId+'"><span class="rh-icon-inner">编辑</span><span class="rh-icon-img btn-edit"></span></a>' // '<a class="rhGrid-td-rowBtnObj rh-icon" operCode="optDeleteBtn" rowpk="'+dataId+'"><span class="rh-icon-inner">删除</span><span class="rh-icon-img btn-delete"></span></a>' ); // 为每个按钮绑定卡片 bindCard(); } }); //绑定的事件 function bindCard(){ //当行删除事件 jQuery("td [operCode='optDeleteBtn']").unbind("click").bind("click", function(){ var pkCode = jQuery(this).attr("rowpk"); rowDelete(pkCode,_viewer); }); //当行编辑事件 jQuery("td [operCode='optEditBtn']").unbind("click").bind("click", function(){ var pkCode = jQuery(this).attr("rowpk"); openMyCard(pkCode); }); }; rh.vi.listView.prototype.beforeDelete = function(pkArray) { showVerify(pkArray,_viewer); }; //列表操作按钮 弹dialog function openMyCard(dataId,readOnly,showTab){ var height = jQuery(window).height()-200; var width = jQuery(window).width()-200; var temp = {"act":UIConst.ACT_CARD_MODIFY,"sId":_viewer.servId,"parHandler":_viewer,"widHeiArray":[width,height],"xyArray":[100,100]}; temp[UIConst.PK_KEY] = dataId; if(readOnly != ""){ temp["readOnly"] = readOnly; } if(showTab != ""){ temp["showTab"] = showTab; } var cardView = new rh.vi.cardView(temp); cardView.show(); }
const BaseRest = require('../_rest.js'); module.exports = class extends BaseRest { async getAction() { const data = { "i_like": false, "like_count": 30, "site_ID": 2916284, "post_ID": 1, "meta": { } } return this.success(data) // const appsModel = this.model('apps') // const app = await appsModel.get(this.appId) // return this.success(app) } };
var fs = require('fs'); module.exports = (function(){ var _stream = {}; _stream.fileread = function(req,callback){ var readerStream = fs.createReadStream(req.file.path); var text = ''; readerStream.on('data',function(chunk){ text += chunk; return callback(null, text); }) } _stream.jsonread = function(req,callback){ var readerStream = fs.readFile('./junk/testObjects.json',function(err, obj){ if(err){ console.log('Error is : ' + err); } return callback(null, JSON.parse(obj)); }); } return _stream; })();
var settingsDefault = { fadeVal: 0.2, hoverVal: 0.3, offsetVal: 25, addHistory: "true", blacklists: "", scrollAlbum: "false", cssVal: "#hvzoom_img_container_main {\n text-align: center;\n background-color: rgba(0,0,0,0.75);\n box-shadow: 0 0 15px rgba(0,0,0,0.5);\n}\n\n#hvzoom_img_container_caption {\n width: 100%; left: 0;\n bottom: 0;\n padding: 3px;\n background-color: rgba(0, 0, 0, 0.75);\n color: #fff;\n box-sizing: border-box;\n word-wrap: break-word;\n}\n\n#hvzoom_img_album_index {\n top: 0px; left: 0px;\n padding: 2px;\n background-color: rgba(0, 0, 0, 0.75);\n color: #fff;\n box-sizing: border-box;\n}\n\n#hvzoom_img_container_image {\n height: 100%; top: 0;\n width: 100%; left: 0;\n}\n\n#hvzoom_img_container_video {\n height: 100%; top: 0;\n width: 100%; left: 0;\n}", updateIntervalVal: 5 }; chrome.runtime.onMessage.addListener(function (request, sender, response) { if (request.getSettings) { var settings = {}; for (var key in settingsDefault) { if (localStorage[key]) { settings[key] = localStorage[key]; } else { settings[key] = settingsDefault[key]; } } response(settings); } });
class ServerApi { constructor() {} getCards = () => { return fetch(`http://localhost:4000/graphql`, { method: "post", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ query: `{ lists { title, subtitle, image} }` }) }) .then((res) => { if (res.ok) { return res.json(); } else { return Promise.reject(`Ошибка: ${res.status}`); } }) } }
import mongoose from 'mongoose'; const UserSchema = new mongoose.Schema({ name: String, email: String, password: String, roles: [String], // ['superadmin', 'admin', 'basic'] }, { timestamps: true, }); const UserModel = mongoose.model('User', UserSchema); export default UserModel;
Page({ onLoad: function (options) { if (parseInt(options.groupId)) { this.setData({ groupId: parseInt(options.groupId) }) } }, formSubmit: function (e) { console.log('formSubmit=>') console.log(e.detail.value) var that = this var app = getApp() var uid = app.globalData.uid var formData = e.detail.value if (!formData.title || !formData.vision || !formData.intro) { wx.showToast({ title: '内容不可为空!', icon: 'loading' }) return } formData.uid = uid wx.showToast({ title: '提交成功,跳转中……', icon: 'loading', duration: 5000, mask: true }) wx.request({ url: 'https://www.kingco.tech/freeman/api/createProj.php', data: formData, success: function (res) { console.log('createProj success=>') console.log(res) var reqData = JSON.parse(res.data.trim()) var projId = parseInt(reqData.proj_id) if (!projId) { return } app.globalData.projId = projId app.globalData.projUpdated = true if (that.data.groupId) { wx.request({ url: 'https://www.kingco.tech/freeman/api/addGroupProj.php', data: { proj_id: projId, group_id: that.data.groupId }, success: function (res) { console.log('addGroupProj success=>') console.log(res) that.globalData.groupId = that.data.groupId } }) } app.updateMarker() wx.hideToast() wx.switchTab({ url: '/pages/project/project' }) } }) } })
'use strict' var api=require('../controllers/api'); var multer = require('multer'); var upload = multer({ dest: '../../../sinaWeiboPictures/upload/' }); let config = require('config'); module.exports=function (router) { router.get('/signup',api.checkLogin,api.getSignup); router.post('/signup',api.checkLogin,api.checkFormData,api.postSignup); router.get('/login',api.checkLogin,api.getLogin); router.post('/login',api.checkLogin,api.postLogin); router.get('/',api.getIndex); router.get('/logout',api.logout); router.get('/create',api.getCreate); router.post('/create',api.postCreate); router.post('/messageUpload',upload.array('photos'),api.messageUpLoad); router.get('/user/:email',api.getUserInfo); router.get('/comment/:id',api.getMessageAndComment); router.post('/comment',api.checkLogout,api.postComment); router.post('/good',api.checkLogout,api.postGoodForMessage); router.get('/forward',api.getForwardAndMessage); router.post('/forward',api.postForwardComment); router.get('/search',api.searchUser); }
module.exports = [ require('./config/webpack.electron'), require('./config/webpack.client') ];
import AppBar from '@material-ui/core/AppBar'; import Tab from '@material-ui/core/Tab'; import Tabs from '@material-ui/core/Tabs'; import React from 'react'; export default function TabPane() { const value = 0; const handleChange = () => { } return ( <div className=""> <AppBar position="relative"> <Tabs value={value} onChange={handleChange} aria-label=""> <Tab label="All" /> <Tab label="Pending" /> <Tab label="Completed" /> </Tabs> </AppBar> </div> ); }
function dataAtualFormatada() { try { let data = new Date(), dia = data.getDate().toString(), diaF = dia.length == 1 ? "0" + dia : dia, mes = (data.getMonth() + 1).toString(), //+1 pois no getMonth Janeiro começa com zero. mesF = mes.length == 1 ? "0" + mes : mes, anoF = data.getFullYear(); return diaF + "/" + mesF + "/" + anoF; } catch (error) { console.error(error.message); return res.status(500).json({ message: error }); } } module.exports = { dataAtualFormatada, };
function zero(parameter) { return parameter ? parameter(0) : 0; } function one(parameter) { return parameter ? parameter(1) : 1; } function two(parameter) { return parameter ? parameter(2) : 2; } function three(parameter) { return parameter ? parameter(3) : 3; } function four(param) { return param ? param(4) : 4; } function five(parameter) { return parameter ? parameter(5) : 5; } function six(parameter) { return parameter ? parameter(6) : 6; } function seven(parameter) { return parameter ? parameter(7) : 7; } function eight(parameter) { return parameter ? parameter(8) : 8; } function nine(parameter) { return parameter ? parameter(9) : 9; } function plus(value1) { return function(value2) { return value1 + value2; }; } function minus(value1) { return function(value2) { return value2 - value1; }; } function times(value1) { return function(value2) { return value1 * value2; }; } function dividedBy(value1) { return function(value2) { return Math.floor(value2 / value1); }; }
import styled from 'styled-components/native'; import Colors from '../../theme/Colors'; export const PlayTouchable = styled.TouchableOpacity` background: ${Colors.primary}; padding: 10px 20px; border-radius: 30px; `; export const Row = styled.View` border-radius: 30px; `; export const SliderWrapper = styled.View` width: 60%; `; export const IconsWrapper = styled.View` flex-direction: row; align-items: flex-end; `;
import React, { Component } from 'react'; import Avatar from 'material-ui/Avatar' import {connect} from 'react-redux' import Dislike from '@material-ui/icons/ThumbDown' import Like from '@material-ui/icons/ThumbUp' import Edit from '@material-ui/icons/Edit' import Vote from '@material-ui/icons/ThumbsUpDown' import Delete from '@material-ui/icons/Delete' import IconButton from 'material-ui/IconButton' import Badge from 'material-ui/Badge'; import TextField from 'material-ui/TextField' import {getCommentsByPostID, addCommentsByPostID, voteComments, deleteComment, editComment, getNewCommentObject } from '../../Store/CommentsReducer/ActionCreator' import {uuidv4} from '../../Services/common' class Comments extends Component { constructor () { super() this.state = { add: false, isEdit: '', body: '' } this.textInput = React.createRef(); this.addComment = this.addComment.bind(this) this.fetchComments = this.fetchComments.bind(this) this.vote = this.vote.bind(this) this.handleChange = this.handleChange.bind(this) } handleChange = (e,type) => { this.setState({[e.target.name]: e.target.value}) } fetchComments = () => { this.props._getCommentsByPostID({postId:this.props.postId, community:this.props.community}) } addComment = () => { this.props._getNewCommentObject() let NewComment = Object.assign({},this.props._newCommnet) NewComment.id = uuidv4() NewComment.body = this.textInput.current.value NewComment.author = this.props.author NewComment.parentId = this.props.postId NewComment.timestamp = Date.parse(new Date()) this.props._addCommentsByPostID({NewComment: NewComment, community: this.props.community}) this.textInput.current.value = "" this.setState({add:true}) } edit = (commentId, CommentBody) => { if(CommentBody !== this.state.body){ this.props._editComment({ commentId, body:{body: this.state.body, timestamp: Date.parse(new Date())}, community: this.props.community, postId: this.props.postId }); } this.setState({isEdit: ''}) } delete = (commentId) => { this.props._deleteComment({ commentId, community: this.props.community, postId: this.props.postId }) } vote = (vote, commentId) => { if (commentId !== '') { this.props._voteComments({ commentId: commentId, vote:vote, community:this.props.community, postId:this.props.postId }) } } componentDidMount() { this.props.view && (this.props.expand === this.props.postId) && !this.state.add && this.fetchComments() } render() { const {_comments, postId, expand, author,community, commentCount} = this.props const {isEdit, body} = this.state console.log(expand, postId) let path = community === '' ? 'all': community return ( <div className="comments-box"> {postId === expand && _comments[path].length > 0 && _comments[path].map((comment, index) => <div key={comment.id} className="comment"> <div className="author-details"> <div className="avatar"> <Avatar aria-label="avatar">{comment.author.toUpperCase().charAt(0)}</Avatar> </div> <div className="author-name"> <IconButton className="vote"><Badge badgeContent={comment.voteScore} color="primary" ><Vote /></Badge></IconButton> <IconButton className="vote"><Dislike onClick={() => this.vote('downVote', comment.id)}/></IconButton> <IconButton className="vote"><Like onClick={() => this.vote('upVote', comment.id)}/></IconButton> <IconButton className="vote"><Edit onClick={() => this.setState({isEdit: comment.id, body: comment.body})}/></IconButton> <IconButton className="vote"><Delete onClick={() => this.delete(comment.id)} /></IconButton> <div>Posted by : {comment.author} on : {new Date(comment.timestamp).toLocaleDateString()}</div> {isEdit !== comment.id && <div className="com-body">{comment.body}</div>} {isEdit === comment.id && <div className="com-body"> <TextField multiline rowsMin="4" id="body" label="write your comment here ..." value={body} name="body" className="inputFields" onChange={(e) => this.handleChange(e,'body')} margin="normal"/> <button onClick={() => this.edit(comment.id, comment.body)}>Post</button> </div>} </div> </div> </div>)} {commentCount === 0 && <div>No Comments yets...</div>} <div className="add-comment"> <Avatar className="avatar" style={{background: 'red'}}> {author.toUpperCase().charAt(0)} </Avatar> <input type="text" ref={this.textInput} placeHolder="Comment here..." /> <button onClick={() => this.addComment()}>Post</button> </div> </div> ); } } const mapStateToProps = (state, ownProps) => { const {Comments} = state return { _comments: Comments.comment, _newCommnet: Comments.newComment, } } const mapDispatchToProps = (dispatch, ownProps) => { return { _getCommentsByPostID: (data) => {dispatch(getCommentsByPostID(data))}, _addCommentsByPostID : (data) => {dispatch(addCommentsByPostID(data))}, _voteComments: (data) => {dispatch(voteComments(data))}, _deleteComment: (data) => {dispatch(deleteComment(data))}, _editComment: (data) => {dispatch(editComment(data))}, _getNewCommentObject: () => {dispatch(getNewCommentObject())} } } export default connect(mapStateToProps, mapDispatchToProps)(Comments)
import { useState } from 'react'; function Tabs({ children }) { const [activeTab, setActiveTab] = useState(0); return ( <div className='mt-6'> <div className='mx-6 mb-4 border-b border-grey-200'> <ul className='flex flex-wrap text-sm font-medium text-center'> {children.map((child, index) => ( <li key={index} role='presentation' className={`${ activeTab === index ? 'border-grey-400' : 'border-transparent opacity-40 hover:text-grey hover:border-grey-200' } text-black-900 whitespace-nowrap py-2 px-4 border-b-2 rounded-tl-full rounded-tr-full font-medium text-sm focus:outline-none mr-2 cursor-pointer`} onClick={() => setActiveTab(index)} > {child.props.label} </li> ))} </ul> </div> <div>{children[activeTab]}</div> </div> ); } export default Tabs;
//Calcular la distancia entre 2 puntos var x1 = prompt("Introduce el valor de X1: "); var y1 = prompt("Introduce el valor de Y1: "); var x2 = prompt("Introduce el valor de X2: "); var y2 = prompt("Introduce el valor de Y2: "); var distancia = Math.sqrt((Math.pow((x2-x1),2))+(Math.pow((y2-y1),2))); alert("El area es: " + distancia);
$('#page-1').on('inview', function () { $(this).addClass('fadeInLeft').addClass('show-page'); }); $('#page-2').on('inview', function () { $(this).addClass('fadeInLeft').addClass('show-page'); }); $('#page-3').on('inview', function () { $(this).addClass('fadeInLeft').addClass('show-page'); }); $('#page-4').on('inview', function () { $(this).addClass('fadeInLeft').addClass('show-page'); });
var day=prompt('Inserte un día (número): '); var month=prompt('Inserte un mes(en número): '); if (day>=20 && month>=5) { if (day<21 && month<=6) { console.log('Está en la estación de Primavera.'); } } else if(day>=21 && month>=6) { if (day>=1 && month>=7) { console.log('Está en la estación de Primavera.'); } else if (day<20 && month<=9) { console.log('Está en la estación de verano.'); } else { console.log('Está en la estación de Primavera.'); } } else if(day>=20 && month>=9 || day<21 && month==12) { console.log('Está en la temporada de Otoño.'); } else if (day<=20 && month<=5 || day>=21 && month==12 ) { console.log('Está en la temporada de Invierno'); } else { console.log('Día inexistente'); }
import React,{useState} from 'react'; import diceEmpty from '../assets/img/dice-empty.png'; import dice1 from '../assets/img/dice1.png'; import dice2 from '../assets/img/dice2.png'; import dice3 from '../assets/img/dice3.png'; import dice4 from '../assets/img/dice4.png'; import dice5 from '../assets/img/dice5.png'; import dice6 from '../assets/img/dice6.png'; const Dice = ()=>{ const diceImages = [dice1,dice2,dice3,dice4,dice5,dice6]; const [imgBg,setImgBg] = useState(diceImages[Math.floor(Math.random() * (diceImages.length - 1))]); const generateRandomImg = ()=>{ setImgBg(diceImages[Math.floor(Math.random() * (diceImages.length - 1))]) } const bg = {backgroundImage:`url(${imgBg})`} const handleDiceNumber = ()=>{ setImgBg(diceEmpty) setTimeout(()=>{ generateRandomImg(); },1000); } return( <div onClick={handleDiceNumber} className="Dice" style={bg}/> ) }; export default Dice;
const express = require('express'); const router = express.Router(); const bcrypt = require('bcrypt'); const { users } = require('../data/users'); const { urlDatabase } = require('../data/urlDatabase'); const { getUserByEmail, getUserById, getUrlsByUserId } = require('../helpers/helpers'); router.get('/', function(req, res) { const templateVars = { urls: urlDatabase, user: getUserById(req.session.user_id) }; res.render('urls_login', templateVars); }); router.post("/", (req, res) => { const { email, password } = req.body; const user = getUserByEmail(email, users); if (!user) { res.redirect(`/`); } else if (!bcrypt.compareSync(password, user.password)) { res.redirect(`/`); } else { req.session.user_id = user.id; res.redirect("/urls"); } }); module.exports = router;
var M1S11A_serDel_mark='M1S11A_success' function M1S11A_serDel_Judgment(e){ } var M1S11Q_serDel_mark='M1S11Q_success' function M1S11Q_serDel_Judgment(e){ } var M1S11D_serDel_mark='M1S11D_success' function M1S11D_serDel_Judgment(e){ } var M1S13MSG_serDel_mark='M1S13MSG_success' function M1S13MSG_serDel_Judgment(e){ } var M1S12MSG_serDel_mark='M1S12MSG_success' function M1S12MSG_serDel_Judgment(e){ } var M1S11U_serDel_mark='M1S11U_success' function M1S11U_serDel_Judgment(e){ }
function solve(arr, order) { switch (order) { case 'asc': return arr.sort((a, b) => a - b); case 'desc': return arr.sort((a, b) => b - a); } } solve([14, 7, 17, 6, 8], 'asc'); solve([14, 7, 17, 6, 8], 'desc');
$(function () { var Arc = $('#Arc'); var Arc_image = $('#main-page'); Arc.click(function () { Arc_image.fadeOut(); setTimeout("location.href='/main'", 400); }); });
import { Axios, getAllOrdersURL } from "."; import { ORDER } from "./endpoints";
var searchData= [ ['check_5fwin',['check_win',['../classjeu.html#a7da98d2c8eaccacc01abb6d25777a7a0',1,'jeu::check_win()'],['../classplateau.html#a064f80a5451965f1efbe982ff9fc6366',1,'plateau::check_win()'],['../classplayer.html#a5eddf905f6904f5737b4f36f7f0ab428',1,'player::check_win()']]] ];
OC.L10N.register( "federatedfilesharing", { "Periodically synchronize outdated federated shares for active users" : "Synchronisiere veraltete Federated-Shares für aktive Benutzer regelmäßig" }, "nplurals=2; plural=(n != 1);");
var dialogsModule = require("ui/dialogs"); var observableModule = require("data/observable"); var ObservableArray = require("data/observable-array").ObservableArray; var page; var groceryList = new GroceryListViewModel([]); var pageData = new observableModule.fromObject({ groceryList: groceryList }); exports.loaded = function(args) { page = args.object; page.bindingContext = pageData; };
'use strict'; const EVENTS = require('./../../common/scripts/constants/EVENTS'); const block = 'popup'; const elems = { bg: block + '__bg', buttonSend: block + '__button' }; const mods = { phonePopup: block + '--phone', loginPopup: block + '--login', opened: block + '--opened' }; $(document).ready(function () { const $block = $('.' + block), $phonePopup = $('.' + mods.phonePopup), $loginPopup = $('.' + mods.loginPopup), $bg = $block.find('.' + elems.bg); $('#phone').usPhoneFormat({ format: '(xxx) xxx-xxxx', }); $bg.on(EVENTS.ELEMENT.CLICK, function () { closePopup($phonePopup); closePopup($loginPopup); $(document).trigger(EVENTS.CUSTOM.PHONE_POPUP.CLOSED); $(document).trigger(EVENTS.CUSTOM.LOGIN_POPUP.CLOSED); }); $(document).on(EVENTS.CUSTOM.PHONE_POPUP.OPENED, function () { openPopup($phonePopup); }); $(document).on(EVENTS.CUSTOM.LOGIN_POPUP.OPENED, function () { openPopup($loginPopup); }); }); function openPopup($block) { $block.addClass(mods.opened); } function closePopup($block) { $block.removeClass(mods.opened); }
import expect from 'expect' import todos from '../../src/reducers' describe('todos reducer', () => { it('should have an initial state', () => { expect(todos(undefined, {})).toEqual([]) }) it('should add a todo item', () => { expect( todos([], { type: 'ADD_TODO', text: 'hello', id: 0 } ) ).toEqual( [{ text: 'hello', id: 0 }] ) }) it('should delete a todo item', () => { expect( todos( [{ text: 'hello', id: 0}], { type: 'DELETE_TODO', id: 0} ) ) .toEqual([]) }) })
/* eslint-env jest */ const { setupServer, setupModels, stopServer } = require('../test/integration-setup.js')() describe('Test list order', () => { const STATUS_OK = 200 const STATUS_BAD_QUERY = 502 let server let instances let sequelize beforeEach(async () => { const { server: _server, sequelize: _sequelize } = await setupServer() server = _server sequelize = _sequelize instances = await setupModels(sequelize) }) afterEach(() => stopServer(server)) test('/players?order=name', async () => { const { player1, player2, player3 } = instances const url = '/players?order=name' const method = 'GET' const { result, statusCode } = await server.inject({ url, method }) expect(statusCode).toBe(STATUS_OK) // this is the order we'd expect the names to be in expect(result[0].name).toBe(player1.name) expect(result[1].name).toBe(player2.name) expect(result[2].name).toBe(player3.name) }) test('/players?order=name%20ASC', async () => { const { player1, player2, player3 } = instances const url = '/players?order=name%20ASC' const method = 'GET' const { result, statusCode } = await server.inject({ url, method }) expect(statusCode).toBe(STATUS_OK) // this is the order we'd expect the names to be in expect(result[0].name).toBe(player1.name) expect(result[1].name).toBe(player2.name) expect(result[2].name).toBe(player3.name) }) test('/players?order=name%20DESC', async () => { const { player1, player2, player3 } = instances const url = '/players?order=name%20DESC' const method = 'GET' const { result, statusCode } = await server.inject({ url, method }) expect(statusCode).toBe(STATUS_OK) // this is the order we'd expect the names to be in expect(result[0].name).toBe(player3.name) expect(result[1].name).toBe(player2.name) expect(result[2].name).toBe(player1.name) }) test('/players?order[]=name', async () => { const { player1, player2, player3 } = instances const url = '/players?order[]=name' const method = 'GET' const { result, statusCode } = await server.inject({ url, method }) expect(statusCode).toBe(STATUS_OK) // this is the order we'd expect the names to be in expect(result[0].name).toBe(player1.name) expect(result[1].name).toBe(player2.name) expect(result[2].name).toBe(player3.name) }) test('/players?order[0]=name&order[0]=DESC', async () => { const { player1, player2, player3 } = instances const url = '/players?order[0]=name&order[0]=DESC' const method = 'GET' const { result, statusCode } = await server.inject({ url, method }) expect(statusCode).toBe(STATUS_OK) // this is the order we'd expect the names to be in expect(result[0].name).toBe(player3.name) expect(result[1].name).toBe(player2.name) expect(result[2].name).toBe(player1.name) }) // multiple sorts test('/players?order[0]=active&order[0]=DESC&order[1]=name&order[1]=DESC', async () => { const { player1, player2, player3 } = instances const url = '/players?order[0]=name&order[0]=DESC&order[1]=teamId&order[1]=DESC' const method = 'GET' const { result, statusCode } = await server.inject({ url, method }) expect(statusCode).toBe(STATUS_OK) // this is the order we'd expect the names to be in expect(result[0].name).toBe(player3.name) expect(result[1].name).toBe(player2.name) expect(result[2].name).toBe(player1.name) }) // Sif this test fails, that's great! Just remove the workaround note in the docs test('sequelize bug /players?order[0]={"model":"Team"}&order[0]=name&order[0]=DESC', async () => { const url = '/players?order[0]={"model":"Team"}&order[0]=name&order[0]=DESC' const method = 'GET' const { statusCode } = await server.inject({ url, method }) expect(statusCode).toBe(STATUS_BAD_QUERY) }) // b/c the above fails, this is a work-around test('/players?order[0]={"model":"Team"}&order[0]=name&order[0]=DESC&include=team', async () => { const { player1, player2, player3 } = instances const url = '/players?order[0]={"model":"Team"}&order[0]=name&order[0]=DESC&include=team' const method = 'GET' const { result, statusCode } = await server.inject({ url, method }) expect(statusCode).toBe(STATUS_OK) // this is the order we'd expect the names to be in expect(result[0].name).toBe(player3.name) expect(result[1].name).toBe(player1.name) expect(result[2].name).toBe(player2.name) }) test('invalid column /players?order[0]=invalid', async () => { const url = '/players?order[]=invalid' const method = 'GET' const { statusCode, result } = await server.inject({ url, method }) expect(statusCode).toBe(STATUS_BAD_QUERY) expect(result.message).toEqual(expect.stringContaining('invalid')) }) })
import { addLanguageSupportForGithubStyleCode, minIndent, stripHeredoc } from './support-for-github'; const minIndentExample = ` One Two Three`; const githubCodeExample = `\`\`\`[javascript] One Two Three \`\`\``; describe('Minimum indentation', () => { it('Should return the minimum indentation level of a string', () => { expect(minIndent(minIndentExample)).toBe(4); }); }); describe('Strip minimum indentation', () => { it('Should return the string with reduced indentation levels', () => { expect(stripHeredoc(minIndentExample)).toBe(` One Two Three`); }); }); describe('Add language support for GitHub style code', () => { it('Should replace line breaks with {{github_br}} & backticks with bc. blocks', () => { expect(addLanguageSupportForGithubStyleCode(githubCodeExample)).toBe(`bc[javascript]. One {{{github_br}}} Two {{{github_br}}} Three {{{github_br}}}`); }); });
import React, { useState, useEffect, useRef } from "react"; import ReactDOM from "react-dom"; import "./index.css"; function useInterval(callback, delay) { const savedCallback = useRef(); useEffect(() => { savedCallback.current = callback; }); useEffect(() => { function tick() { savedCallback.current(); } if (delay !== null) { let id = setInterval(tick, delay); return () => clearInterval(id); } }, [delay]); } function App() { const [breakLength, setBreakLength] = useState(parseInt(localStorage.getItem("BL")) || 1); const [sessionLength, setSessionLength] = useState(parseInt(localStorage.getItem("SL")) || 1); const [timer, setTimer] = useState(parseInt(localStorage.getItem("TM")) || 60); //60*timer const [timerState, setTimerState] = useState(localStorage.getItem("TS") || "stopped"); // "running" "stopped" const [timerType, setTimerType] = useState(localStorage.getItem("TT") || ""); //"session" "break" "" const [completedList, setCompletedList] = useState( (localStorage.getItem("CL") && JSON.parse(localStorage.getItem("CL"))) || [] ); const [sumOfDay, setSumOfDay] = useState( (localStorage.getItem("SD") && JSON.parse(localStorage.getItem("SD"))) || [] ); useEffect(() => { localStorage.setItem("BL", breakLength); localStorage.setItem("SL", sessionLength); localStorage.setItem("TM", timer); localStorage.setItem("TS", timerState); localStorage.setItem("TT", timerType); localStorage.setItem("CL", JSON.stringify(completedList)); localStorage.setItem("SD", JSON.stringify(sumOfDay)); }); function changeLength(name, action) { if (timerType !== "") return; const BL = breakLength; const SL = sessionLength; if (name === "break") { if (action === "add") { setBreakLength(BL < 60 ? BL + 1 : BL); } else { setBreakLength(BL > 1 ? BL - 1 : BL); } } else { if (action === "add") { if (SL < 60) { setSessionLength(SL + 1); setTimer(60 * SL + 60); } } else { if (SL > 1) { setSessionLength(SL - 1); setTimer(60 * SL - 60); } } } } useInterval( () => { setTimer(timer - 1); if (timer < 1) changeState(); }, timerState === "running" ? 1000 : null ); function startOrStopSession() { if (timerType === "") setTimerType("session"); setTimerState(timerState === "running" ? "stopped" : "running"); } function changeState() { if (timerType === "session") { setTimer(60 * breakLength); setTimerType("break"); setCompletedList([...completedList, { end: Date.now(), length: sessionLength }]); } else { setTimer(60 * sessionLength); setTimerType("session"); } } function resetSession() { setTimer(60 * sessionLength); setTimerState("stopped"); setTimerType(""); } function displayCompleted(i) { console.dir(i.end); const date = new Date(parseInt(i.end)); let month = addZero(date.getMonth()); let day = addZero(date.getDate()); let hour = addZero(date.getHours()); let minute = addZero(date.getMinutes()); return `${month}.${day} ${hour}:${minute}`; } function sumOfToday(x) { let sum = 0; for (let i = x.length - 1; i >= 0; i--) { const date = new Date(parseInt(x[i].end)); if (date.getDate() !== new Date().getDate()) { setSumOfDay([...sumOfDay, { date: date, sum: sum }]); break; } sum += x[i].length; } return sum; } function addZero(x) { return x < 10 ? "0" + x : x; } function displayTime() { let minutes = Math.floor(timer / 60); let seconds = timer - minutes * 60; seconds = seconds < 10 ? "0" + seconds : seconds; minutes = minutes < 10 ? "0" + minutes : minutes; return minutes + ":" + seconds; } return ( <div className={`app ${timerType}`}> <div className="title">Pomodoro</div> <div className="label"> <div id="break-label"> <div>休息时间</div> <div className="length-button"> <button onClick={() => { changeLength("break", "minus"); }}> <svg className="icon" aria-hidden="true"> <use xlinkHref={timerType === "break" ? "#icon-minus-copy" : "#icon-minus"}></use> </svg> </button> <p>{breakLength}</p> <button onClick={() => { changeLength("break", "add"); }}> <svg className="icon" aria-hidden="true"> <use xlinkHref={timerType === "break" ? "#icon-add-copy" : "#icon-add"}></use> </svg> </button> </div> </div> <div id="session-label"> <div>番茄时间</div> <div className="length-button"> <button onClick={() => { changeLength("session", "minus"); }}> <svg className="icon" aria-hidden="true"> <use xlinkHref={timerType === "break" ? "#icon-minus-copy" : "#icon-minus"}></use> </svg> </button> <p>{sessionLength}</p> <button onClick={() => { changeLength("session", "add"); }}> <svg className="icon" aria-hidden="true"> <use xlinkHref={timerType === "break" ? "#icon-add-copy" : "#icon-add"}></use> </svg> </button> </div> </div> </div> <div className="clock"> {/* <div id="timer-label">{timerType}</div> */} <div className="wrapper"> <div id="time-left"> <div>{displayTime()}</div> <div className="action-button"> <button onClick={startOrStopSession}> {timerState === "running" ? ( <svg className="icon" aria-hidden="true"> <use xlinkHref={timerType === "break" ? "#icon-stop-copy" : "#icon-stop"}></use> </svg> ) : ( <svg className="icon" aria-hidden="true"> <use xlinkHref={timerType === "break" ? "#icon-start-copy" : "#icon-start"}></use> </svg> )} </button> <button onClick={resetSession}> <svg className="icon" aria-hidden="true"> <use xlinkHref={timerType === "break" ? "#icon-reset-copy" : "#icon-reset"}></use> </svg> </button> </div> </div> </div> <div class="info"> <div className="infoTitle"> <svg className="icon" aria-hidden="true"> <use xlinkHref={timerType === "break" ? "#icon-completed-copy" : "#icon-completed"}></use> </svg> <p className="todayTomato">今日番茄总计</p> <svg className="icon" aria-hidden="true"> <use xlinkHref={timerType === "break" ? "#icon-completed-copy" : "#icon-completed"}></use> </svg> </div> <div className="sum"> {sumOfToday(completedList)} <p className="min">分钟</p> </div> </div> {/* <div className="completed"> {completedList.map(i => ( <li key={i.end}>{displayCompleted(i)}</li> ))} </div> */} </div> </div> ); } ReactDOM.render(<App />, document.getElementById("root"));
const express = require("express"); const axios = require("axios") //all the routes being routed here, no need to use "express.Router()" // controller function is to handler all the logic const API_KEY = "Rd3VRDQoDp"; // all my keys are free, so its ok not to set an env variable var unirest = require('unirest'); exports.renderHomePage = (req, res) => { const currentYear = new Date().getFullYear(); res.render("index", { _currentYear: currentYear }); } exports.getWord = (req, res) => { const currentYear = new Date().getFullYear(); var inputWord = req.body.inputWord; const URL = `https://voicecup.com/api?key=Rd3VRDQoDp&q=${inputWord}&lang=eng`; var startPoint =""; var endDuration = ""; var audioPart = ""; var title =""; var subs_id =""; var finalURL = ""; var error = ""; const objectArray = []; // axios.get(URL).then((response) => { // console.log(response.data.hits.length); // var audiolength = response.data.hits.length; // for (var i = 0; i < audiolength; i++) { // const {id, start, body, duration, filename_audio} = response.data.hits[i]; // finalURL = `https://voicecup.com/play?key=${API_KEY}&filename=${filename_audio}&filetype=mp4&start=${start}&duration=${duration}&subs_id=${id}`; // var object = { // "url": finalURL, // "title": body, // } // objectArray.push(object); // } // // // res.render("index", { // _objectArray: objectArray, // _inputWord: inputWord, // _currentYear: currentYear, // }); // }).catch((err) => { // console.log(err); // error = err; // res.render("index", { // _error : "No Results, try another word.", // _currentYear: currentYear, // }); // }); var request = unirest("GET", "https://mashape-community-urban-dictionary.p.rapidapi.com/define"); request.query({ "term": inputWord }); request.headers({ "x-rapidapi-host": "mashape-community-urban-dictionary.p.rapidapi.com", "x-rapidapi-key": "6f31b66feemshf5ce006ba4fbc2fp190221jsn4dd00294079a", "useQueryString": true }); var wordObject = { definition: "", example: "", soundUrl: "", } request.end(function (respond) { if (respond.error) { throw new Error(res.error); res.render("index", { _error : "No Results, try another word.", _currentYear: currentYear, }); } console.log(respond.body.list[0]); if (typeof respond.body.list[0] == 'undefined') { res.render("index", { _error : "No Results, try another word.", _currentYear: currentYear, }) } else { wordObject.definition = respond.body.list[0].definition; wordObject.example = respond.body.list[0].example; wordObject.soundUrl = respond.body.list[0].sound_urls[0]; var sanitizedDefinition = wordObject.definition.replace(/\[|\]/g,""); // use regex to get rid of "[" "]"" // learn regex through : https://www.youtube.com/watch?v=rhzKDrUiJVk wordObject.definition = sanitizedDefinition; var sanitizedExample = wordObject.example.replace(/\[|\]/g,""); // use regex to get rid of "[" "]"" wordObject.example = sanitizedExample; axios.get(URL).then((response) => { console.log(response.data.hits.length); var audiolength = response.data.hits.length; for (var i = 0; i < audiolength; i++) { const {id, start, body, duration, filename_audio} = response.data.hits[i]; finalURL = `https://voicecup.com/play?key=${API_KEY}&filename=${filename_audio}&filetype=mp4&start=${start}&duration=${duration}&subs_id=${id}`; var object = { "url": finalURL, "title": body, } objectArray.push(object); } res.render("index", { _objectArray: objectArray, _inputWord: inputWord, _currentYear: currentYear, _inputWord: inputWord, _wordObject : wordObject, _audioTitle: "Audio Examples:", // _currentYear: currentYear, }); }).catch((err) => { // console.log(err); error = err; res.render("index", { _error : "No Results, try another word.", _currentYear: currentYear, }); }); } // end of else statement }); }// end of getWord function
const webpack = require('webpack'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const CleanWebpackPlugin = require('clean-webpack-plugin'); const path = require('path'); const extractCss = new ExtractTextPlugin('[name].[hash].css'); exports.devServer = function(options) { return { watchOptions: { // Delay the rebuild after the first change //aggregateTimeout: 300, // Poll using interval (in ms, accepts boolean too) //poll: 1000 }, devServer: { // Enable history API fallback so HTML5 History API based // routing works. This is a good default that will come // in handy in more complicated setups. historyApiFallback: true, // Unlike the cli flag, this doesn't set // HotModuleReplacementPlugin! hot: true, inline: true, // Display only errors to reduce the amount of output. stats: 'errors-only', // Parse host and port from env to allow customization. // // If you use Vagrant or Cloud9, set // host: options.host || '0.0.0.0'; // // 0.0.0.0 is available to all network devices // unlike default `localhost`. host: options.host, // Defaults to `localhost` port: options.port, // Defaults to 8080 proxy: { '/api*': { target: 'http://localhost:3000', secure: false } } }, plugins: [ // Enable multi-pass compilation for enhanced performance // in larger projects. Good default. new webpack.HotModuleReplacementPlugin({ multiStep: true }) ] }; } exports.setupLoaders = function() { return { module: { preLoaders: [ /*{ test: /\.jsx?$/, loaders: ['jshint'] },*/ { test: /\.json$/, loaders: ['json'] } ], loaders: [ { test: /\.html$/, exclude: /index\.template\.html$/, // you need to exclude your base template (unless you do not want this plugin own templating feature) loader: 'html' }, /*{ test: /_\w+\.html$/, // all underscored prefixed html files will be available as ng-include=... loader: 'ngtemplate?relativeTo=client/src/components/layout' },*/ { test: /\.(jpg|png)$/, loader: 'file?name=[path][name].[hash].[ext]' }, { test: /\.(woff|woff2)$/, loader: 'url?limit=10000&mimetype=application/font-woff' }, { test: /\.ttf$/, loader: 'url?limit=10000&mimetype=application/octet-stream' }, { test: /\.eot$/, loader: 'file' }, { test: /\.svg$/, loader: 'url?limit=10000&mimetype=image/svg+xml' }, { test: /\.css$/, loader: extractCss.extract('style','css?sourceMap') }, { test: /\.less$/, loader: extractCss.extract('style', 'css!less?sourceMap') } ] }, plugins: [ extractCss ] }; } exports.minify = function() { return { plugins: [ new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false } }) ] }; } exports.setFreeVariable = function(key, value) { const env = {}; env[key] = JSON.stringify(value); return { plugins: [ new webpack.DefinePlugin(env) ] }; } exports.clean = function(path) { return { plugins: [ new CleanWebpackPlugin([path], { // Without `root` CleanWebpackPlugin won't point to our // project and will fail to work. root: process.cwd() }) ] }; } exports.setupSourceMap = function(type){ return { devtool: type } } /*TODO: get manifest http://survivejs.com/webpack/building-with-webpack/splitting-bundles/#setting-up-commonschunkplugin- exports.extractBundle = function(options) { const entry = {}; entry[options.name] = options.entries; return { // Define an entry point needed for splitting. entry: entry, plugins: [ // Extract bundle and manifest files. Manifest is // needed for reliable caching. new webpack.optimize.CommonsChunkPlugin({names:[options.name,'manifest']}) ] }; } */
import React from "react"; import styled from "styled-components"; import Copy from "../../global/locales/en_us"; import Colors from "../../global/styles/colors"; import { Text, Screen, Link } from "../../global/styles/styles"; const CreatorImg = styled.img` width: 40px; height: 40px; border-radius: 100px; align-self: center; transition: 0.3s ease; `; const CreatorTextContainer = styled.div` padding-left: 6px; `; const CreatorName = styled(Text)` font-size: 16px; line-height: 14px; font-weight: 700; padding-top: 6px; padding-left: 2px; letter-spacing: 0.5px; @media ${Screen.tinyQuery} { max-width: 170px; } @media ${Screen.smallQuery} { max-width: 220px; } @media ${Screen.largeQuery} { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; } @media ${Screen.mediumQuery} { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; } `; const PresentsText = styled(Text)` font-size: 11px; font-weight: 700; letter-spacing: 0.2px; color: ${Colors.presentsAccent}; padding-left: 2px; `; const CreatorContainer = styled.div` display: flex; &:hover ${CreatorImg} { transform: scale(1.2); box-shadow: 2px 6px 18px 0 rgba(183, 183, 183, 0.5); } `; const Creator = creator => { const { id, type } = creator; return ( <Link to={{ pathname: "/user/" + id }}> <CreatorContainer> <CreatorImg src={creator.imageUrl} /> <CreatorTextContainer> <CreatorName>{creator.displayName}</CreatorName> <PresentsText>{type === "Broadcast" ? Copy.presents : Copy.submits}</PresentsText> </CreatorTextContainer> </CreatorContainer> </Link> ); }; export default Creator;
class Claim{ constructor(string){ console.log('*<') console.log(string) const regex = /#(?<id>\d) @ (?<left>\d*),(?<top>\d*): (?<width>\d*)x(?<height>\d*)/gm; let res = regex.exec(string) this.id = res[1] this.left = parseInt(res[2]) this.top = parseInt(res[3]) this.width = parseInt(res[4]) this.height = parseInt(res[5]) } } class ManageMaterial{ static AreaOfIntersect(d1, d2){ var x_overlap = Math.max(0, Math.min(d1.left + d1.width ,d2.left + d2.width) - Math.max(d1.left,d2.left)) var y_overlap = Math.max(0, Math.min(d1.top + d1.height, d2.top + d2.height) - Math.max(d1.top,d2.top)); return (x_overlap * y_overlap) } static Intersect(claim1, claim2){ // is Top Left of claim in claim function pointInZone(x,y,zone){ var topLeftInClaim2 = (x >= claim2.left) && (x <= claim2.left + claim2.width) && (y >= claim2.top) && (y <= claim2.top + claim2.height) return topLeftInClaim2 } var topLeftInClaim2 = pointInZone(claim1.left,claim1.top,claim2) var topRightInClaim2 = pointInZone(claim1.left + claim1.width,claim1.top,claim2) var bottomLeftInClaim2 = pointInZone(claim1.left ,claim1.top +claim1.top,claim2) // var intersectVertical = (claim1.top >= claim2.top) &&(claim1.top <= claim2.top + claim2.height) // return intersectHorizontal && intersectVertical } } module.exports = {ManageMaterial, Claim}
module.exports = { index: (req, res) => { res.render('home_Page'); }, signin: (req, res) => { res.render('signin_Page', {message: req.flash('signinMessage')}); }, signup: (req, res) => { res.render('signup_Page', {message: req.flash('signupMessage')}); }, logout: (req, res) => { res.clearCookie('userCookie'); req.logout(); res.redirect('/'); } }
self.__precacheManifest = (self.__precacheManifest || []).concat([ { "revision": "6032e7e22680cc39dc0ee028cc7241dc", "url": "/react/tests/react-pen-2/index.html" }, { "revision": "1da14976c1f102819833", "url": "/react/tests/react-pen-2/static/css/main.34de6062.chunk.css" }, { "revision": "419a1f8b3c03c4515bed", "url": "/react/tests/react-pen-2/static/js/2.1ba12362.chunk.js" }, { "revision": "1da14976c1f102819833", "url": "/react/tests/react-pen-2/static/js/main.9125c3bf.chunk.js" }, { "revision": "604da09a6691f7d0727f", "url": "/react/tests/react-pen-2/static/js/runtime~main.3583a8a3.js" } ]);
import { createSelector } from 'reselect'; // BEGIN (write your solution here) const getTasks = (state) => state.tasks; export const filteredTasksSelector = createSelector( getTasks, (tasks) => { const { currentFilterName } = tasks; const { byId, allIds } = tasks; const mappedTasks = allIds.map((id) => byId[id]); if (currentFilterName === 'all') { return mappedTasks; } return mappedTasks.filter((task) => task.state === currentFilterName); }, ); // END
(function () { "use strict"; /*global mockModalInstance, $q, $scope*/ describe("DomainDeviceListModalCtrl", function () { var ctrl, chosenDomains, DomainMgmtService, AlertsService, ResultsHandlerService, resolveFetch, resolveDelete, domainDevices; beforeEach(inject(function (_$injector_) { DomainMgmtService = _$injector_.get("DomainMgmtService"); AlertsService = _$injector_.get("AlertsService"); ResultsHandlerService = _$injector_.get("ResultsHandlerService"); resolveFetch = resolveDelete = true; chosenDomains = {"smsDomainId": "1"}; domainDevices = [ {device: {smsDeviceId: "000111"}}, {device: {smsDeviceId: "000222"}}, {device: {smsDeviceId: "000333"}}, ]; spyOn(DomainMgmtService, "getDomainDeviceList").and.callFake(function () { return $q(function (resolve) { if (resolveFetch) { resolve({ domainDevices: domainDevices }); } }); }); })); describe("initialize", function () { beforeEach(function () { spyOn(ResultsHandlerService, "toArray").and.callThrough(); initializeCtrl(); }); it("should initialize the expected controller properties", function () { expect(ctrl.chosenDomains).toEqual(jasmine.any(Object)); expect(ctrl.chosenDomains).toEqual(chosenDomains); expect(ctrl.closeModal).toEqual(jasmine.any(Function)); expect(ctrl.dismissModal).toEqual(jasmine.any(Function)); expect(ctrl.removeDomainDevices).toEqual(jasmine.any(Function)); }); it("should call DomainMgmtService.getDomainDeviceList with the smsDomainId of the chosenDomain", function () { expect(DomainMgmtService.getDomainDeviceList).toHaveBeenCalledWith("1"); }); it("should call ResultsHandlerService.toArray with the domainDevices", function () { expect(ResultsHandlerService.toArray).toHaveBeenCalledWith(domainDevices); }); it("should set ctrl.deviceDomains to the return value of ResultsHandlerService.toArray", function () { var res = ResultsHandlerService.toArray(domainDevices); expect(ctrl.domainDevices).toEqual(res); }); }); describe("closeModal", function () { it("should call $modaInstance.close", function () { initializeCtrl(); spyOn(mockModalInstance, "close"); ctrl.closeModal(); expect(mockModalInstance.close).toHaveBeenCalled(); }); }); describe("dismissModal", function () { it("should call $modaInstance.dismiss", function () { initializeCtrl(); spyOn(mockModalInstance, "dismiss"); ctrl.dismissModal(); expect(mockModalInstance.dismiss).toHaveBeenCalled(); }); }); describe("removeDomainDevices", function () { var target; beforeEach(function () { target = domainDevices[1].device; }); beforeEach(function () { spyOn(DomainMgmtService, "removeDomainDevices").and.callFake(function () { return $q(function (resolve) { if (resolveDelete) { resolve(); } }); }); spyOn(AlertsService, "addSuccess"); initializeCtrl(); }); it("should call DomainMgmtService.removeDomainDevices with the chosen Domain's ID and the given Device", function () { ctrl.removeDomainDevices(target); expect(DomainMgmtService.removeDomainDevices).toHaveBeenCalledWith("1", target); }); it("should notify the user if the Device was removed from the Domain", function () { ctrl.removeDomainDevices(target); $scope.$digest(); expect(AlertsService.addSuccess).toHaveBeenCalledWith("Successfully removed Device ID 000222"); }); it("should not notify the user if the Device was not removed from the Domain", function () { resolveDelete = false; ctrl.removeDomainDevices(target); $scope.$digest(); expect(AlertsService.addSuccess).not.toHaveBeenCalled(); }); it("should remove successfully removed Devices from ctrl.domainDevices", function () { var res = [domainDevices[0], domainDevices[2]]; ctrl.removeDomainDevices(target); $scope.$digest(); expect(ctrl.domainDevices).toEqual(res); }); }); function initializeCtrl() { ctrl = $controller("DomainDeviceListModalCtrl", { $modalInstance: mockModalInstance, chosenDomains: chosenDomains, }); $scope.$digest(); } }); }());
import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; function Poop(props) { return (<div> <h1>{props.title}</h1> <p>{props.content}</p> </div>) } class App extends React.Component { render() { return (<Poop title="mohannad hisham" content="I am the biggest poop ever."/>) } } ReactDOM.render(<App />, document.getElementById('root'));
import React, { Component } from 'react'; import { Button } from '../components'; class Login extends Component { render() { return ( <Button bsStyle="primary" text="Facebook Login" faName="facebook-official" /> ); } } export default Login;
const Validator = require("validator"); const isEmpty = require("./is-empty"); module.exports = function validateReviewInput(data) { let errors = {}; data.movieName = !isEmpty(data.movieName) ? data.movieName : ""; data.review = !isEmpty(data.review) ? data.review : ""; data.rating = !isEmpty(data.rating) ? data.rating : ""; if (Validator.isEmpty(data.movieName)) { errors.movieName = "Movie name is required"; } if (Validator.isEmpty(data.review)) { errors.review = "Review is required"; } if (Validator.isEmpty(data.rating)) { errors.rating = "Rating is required"; } if (!Validator.isInt(data.rating)) { errors.rating = "Rating has to be a number"; } if (!Validator.isLength(data.review, { max: 300 })) { errors.name = "Review must be less than 300 characters"; } return { errors, isValid: isEmpty(errors) }; };
import React, { Component } from 'react'; import { View, StyleSheet, Text, Image} from 'react-native'; import ExplainScreen from '../screens/ExplainScreen'; import SearchScreen from '../screens/SearchScreen'; import {createBottomTabNavigator} from 'react-navigation-tabs'; import {AppStackNavigator} from './AppStackNavigator'; import {Icon} from 'react-native-elements'; export const AppTabNavigator = createBottomTabNavigator({ ExplainScreen: { screen: ExplainScreen, navigationOptions: { tabBarIcon: <Icon name='plus' type='font-awesome' style={{width: 20, height: 20}} color='grey'/>, tabBarLabel: "Post" } }, SearchScreen: { screen: AppStackNavigator, navigationOptions: { tabBarIcon: <Icon name='search' type='font-awesome' color='grey' style={{width: 20, height: 20}}/>, tabBarLabel: "Search" } } });
import React from "react"; import ReactDOM from "react-dom"; import App from "./App"; import "./index.less"; /* TODO - UI - Liquid Background https://www.youtube.com/watch?v=yclxov7uRXE https://www.youtube.com/watch?v=O5wq9DsQ_Lc - User info in corner - Sidebar with available pages? or dropdown at user TODO - Code - Call login directly from login component - add error message displaying in login */ ReactDOM.render( <App />, document.getElementById("root") );
import React from 'react'; import Nav from "./nav"; import CuriosityImg from "./rover1_pics"; //import {useHistory} from 'react-router-dom'; const Rover1 = () => { return ( <div> <Nav/> <div class = "rover-page"> <div class = "name-holder"><text class = "rover-name">Curiosity</text></div> <div class = "description-holder"><text class = "rover-description">Curiosity is the third rover sent to Mars, launching on November 26, 2011 and landing nine months later on August 5, 2012. The Curiosity rover has six wheels and eight cameras, containing a functional arm that can reach up to seven feet. Curiosity is built using a hardened body to protect itself from the harsh environment on Mars. The rover is still functioning today, sending and recieving informtation from NASA every day.</text></div> <div class = "name-holder"><text class = "rover-name">About</text></div> <div class = "whole-card-holder"> <div class = "card-holder"><img class = "rover-card" src = "https://mars.nasa.gov/system/feature_items/images/6037_msl_banner.jpg" alt = "curiosity"/></div> <div class = "card-table-holder"><table class = "card-table" cellSpacing = "0"> <tr class = "row-type-b"> <td>Mission Name</td> <td>Mars Science Laboritory</td> </tr> <tr class = "row-type-a"> <td>Rover Name</td> <td>Curiosity</td> </tr> <tr class = "row-type-b"> <td>Size</td> <td>10 feet</td> </tr> <tr class = "row-type-a"> <td>Rover Mass</td> <td>1,982 Pounds</td> </tr> <tr class = "row-type-b"> <td>Rocket</td> <td>Atlas V 541</td> </tr> <tr class = "row-type-a"> <td>Launch Date</td> <td>November 26, 2011</td> </tr> <tr class = "row-type-b"> <td>Land Date</td> <td>August 5, 2012</td> </tr> </table></div> </div> <div class = "name-holder"><text class = "rover-name">Recent Photos</text></div> <CuriosityImg/> </div> </div> ); }; export default Rover1;
import R from 'ramda' import builder from './builder' const Conditions = { byQuery: R.curry(() => { return true }) } // todo default extractor function extractValueForCondition(conditionName, values) { switch (conditionName) { case 'byQuery': return values.query } return values[conditionName] } export default builder(Conditions, extractValueForCondition)
import React from 'react'; import styled, {css} from 'styled-components' const StyledButton = styled.button` font-size: 16px; color: white; border: none; background: hsl(225, 21%, 49%); box-shadow: 0 3px 0 hsl(224, 28%, 35%); font-family: 'Spartan', sans-serif; margin: ${props => props.margin}; height: 32px; line-height: 32px; &:hover { background: hsl(225, 21%, 40%) } &:active { transform: translateY(3px); box-shadow: none; } border-radius: 5px; text-transform: uppercase; // Conditional formatting /* ${props => (props.value === "=" || props.value === "reset") && css` grid-column: span 2; `} */ ${props => props.delete && css` background: hsl(6, 63%, 50%); box-shadow: 0 3px 0 hsl(6, 70%, 34%); &:hover { background: hsl(6, 63%, 40%) } `} ${props => props.disabled && css` background: hsl(0, 0%, 50%); box-shadow: 0 3px 0 hsl(0, 0%, 34%); &:hover { background: hsl(0, 0%, 40%) } `} `; class Button extends React.Component { render() { return ( <StyledButton type={this.props.type} value={this.props.value} onClick={this.props.onClick} disabled={this.props.disabled} delete={this.props.delete} margin={this.props.margin} > {this.props.children} </StyledButton> ) } onClick = () => { console.log(`Clicked ${this.props.value}!`) } } export default Button;
var host='192.168.1.185'; //修改服务器地址 var port='7001'; //修改服务器端口 var vuePort='8080'; var max1 = 1e8; //修改普通管理员最大加钱数 var max0 = 1e12; //修改超级管理员最大加钱数 webpackJsonp([1], { 10: function (e, t, n) { "use strict"; (function (e) { function r(t, r) { n.i(l.a)("/user/loginVue", e(t).serialize(), function (e) { if (1 != e.data) return u.a.commit("login", e.data), void r.$router.push("/indexPage"); alert("账号/密码错误") }, function (e) { alert(e) }) } t.b = r, n.d(t, "a", function () { return c }), n.d(t, "c", function () { return d }), n.d(t, "h", function () { return f }), n.d(t, "g", function () { return p }), n.d(t, "f", function () { return h }), n.d(t, "d", function () { return m }), n.d(t, "e", function () { return v }); var i = n(12), o = n.n(i), s = n(11), a = n.n(s), l = n(20), u = n(9), c = function () { var e = a()(o.a.mark(function e() { var t; return o.a.wrap(function (e) { for (; ;) switch (e.prev = e.next) { case 0: return e.next = 2, n.i(l.b)("/user/getLoginBean"); case 2: return t = e.sent, "1" == t.data ? u.a.commit("login", null) : u.a.commit("login", t.data), e.abrupt("return", t.data); case 5: case"end": return e.stop() } }, e, this) })); return function () { return e.apply(this, arguments) } }(), d = function () { var e = a()(o.a.mark(function e() { var t; return o.a.wrap(function (e) { for (; ;) switch (e.prev = e.next) { case 0: return e.next = 2, n.i(l.b)("/user/loginout"); case 2: return t = e.sent, u.a.commit("login", null), e.abrupt("return", t.data); case 5: case"end": return e.stop() } }, e, this) })); return function () { return e.apply(this, arguments) } }(), f = function () { var e = a()(o.a.mark(function e(t, r) { var i; return o.a.wrap(function (e) { for (; ;) switch (e.prev = e.next) { case 0: return e.next = 2, n.i(l.b)("/user/updpwd?id=" + t + "&pwd=" + r); case 2: return i = e.sent, e.abrupt("return", i.data); case 4: case"end": return e.stop() } }, e, this) })); return function (t, n) { return e.apply(this, arguments) } }(), p = function () { var e = a()(o.a.mark(function e() { var t; return o.a.wrap(function (e) { for (; ;) switch (e.prev = e.next) { case 0: return e.next = 2, n.i(l.b)("/user/getGMList"); case 2: return t = e.sent, e.abrupt("return", t.data); case 4: case"end": return e.stop() } }, e, this) })); return function () { return e.apply(this, arguments) } }(), h = function () { var e = a()(o.a.mark(function e(t) { var r; return o.a.wrap(function (e) { for (; ;) switch (e.prev = e.next) { case 0: return e.next = 2, n.i(l.b)("/user/delGM?id=" + t); case 2: return r = e.sent, e.abrupt("return", r.data); case 4: case"end": return e.stop() } }, e, this) })); return function (t) { return e.apply(this, arguments) } }(), m = function () { var e = a()(o.a.mark(function e(t) { var r; return o.a.wrap(function (e) { for (; ;) switch (e.prev = e.next) { case 0: return e.next = 2, n.i(l.b)("/item/getReceiveItemList?pageNum=" + t); case 2: return r = e.sent, e.abrupt("return", r.data); case 4: case"end": return e.stop() } }, e, this) })); return function (t) { return e.apply(this, arguments) } }(), v = function () { var e = a()(o.a.mark(function e(t, r, i) { var s; return o.a.wrap(function (e) { for (; ;) switch (e.prev = e.next) { case 0: return e.next = 2, n.i(l.b)("/item/getUidList?uid=" + r + "&dateObj=" + i + "&pageNum=" + t); case 2: return s = e.sent, e.abrupt("return", s.data); case 4: case"end": return e.stop() } }, e, this) })); return function (t, n, r) { return e.apply(this, arguments) } }() }).call(t, n(315)) }, 176: function (e, t, n) { function r(e) { n(308) } var i = n(3)(n(210), n(344), r, "data-v-08fa2eba", null); e.exports = i.exports }, 179: function (e, t, n) { "use strict"; var r = n(1), i = n(177), o = n(337), s = n.n(o), a = n(339), l = n.n(a), u = n(176), c = n.n(u); r.default.use(i.a), t.a = new i.a({ routes: [{path: "/indexPage", name: "indexPage", meta: {requireAuth: !0}, component: s.a}, { path: "/onlineUsers", name: "onlineUsers", meta: {requireAuth: !0}, component: c.a }, {path: "/", name: "login", component: l.a}] }) }, 180: function (e, t) { }, 182: function (e, t, n) { var r = n(3)(n(202), n(347), null, null, null); e.exports = r.exports }, 20: function (e, t, n) { "use strict"; function r(e, t, n) { var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : function (e) { }; u.a.post(e, t).then(function (e) { n(e) }).catch(function (e) { r(e) }) } t.a = r, n.d(t, "b", function () { return c }); var i = n(12), o = n.n(i), s = n(11), a = n.n(s), l = n(184), u = n.n(l), c = function () { var e = a()(o.a.mark(function e(t) { var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null; return o.a.wrap(function (e) { for (; ;) switch (e.prev = e.next) { case 0: return e.next = 2, u.a.get(t, r); case 2: return n = e.sent, e.abrupt("return", n); case 4: case"end": return e.stop() } }, e, this) })); return function (t) { return e.apply(this, arguments) } }() }, 202: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", {value: !0}), t.default = { data: function () { return {} }, mounted: function () { }, beforeDestroy: function () { }, methods: {} } }, 203: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", {value: !0}); var r, i = n(218), o = n.n(i), s = n(12), a = n.n(s), l = n(11), u = n.n(l), c = (n(9), n(20)), d = n(10); t.default = { data: function () { var e = this; return { delId: "", delIndex: "", delModal: !1, formName: "", addform: {uname: "", password: "", roleList: [{value: "1", label: "程序"}, {value: "2", label: "测试"}, {value: "3", label: "运维"}], selectRole: ""}, updform: {id: "", uname: "", password: "", dept: "", roleList: [{value: "1", label: "程序"}, {value: "2", label: "测试"}, {value: "3", label: "运维"}], selectRole: ""}, GMColumn: [{title: "编号", key: "id"}, { title: "账户名", key: "account", render: function (e, t) { return e("div", [e("Icon", {props: {type: "person"}}), e("strong", t.row.account)]) } }, {title: "部门", key: "dept"}, { title: "操作", key: "action", width: 150, align: "center", render: function (t, n) { return t("div", [t("i-button", { props: {type: "primary", size: "small"}, style: {marginRight: "5px"}, on: { click: function () { e.upd(n.index) } } }, "编辑"), t("i-button", { props: {type: "error", size: "small"}, on: { click: function () { e.affirmRemove(n.index) } } }, "删除")]) } }], GMList: [] } }, methods: (r = { cancel: function () { this.formName = "" }, addSubmit: function () { var e = this, t = {uname: this.addform.uname, password: this.addform.password, role: this.addform.selectRole}; n.i(c.a)("/user/addGM", t, function (t) { 1 == t.data ? e.$Message.error("账户已存在,请更换!") : 2 == t.data ? e.$Message.error("未知的数据库错误!") : e.$Message.success("添加GM账户成功!") }, function (t) { e.$Message.error("请求发送错误!" + t) }), this.getGMList() }, upd: function (e) { var t = (this.GMList[e].dept, this); t.formName = "updi-form", t.updform.id = this.GMList[e].id, t.updform.uname = this.GMList[e].account, t.updform.dept = this.GMList[e].dept }, affirmRemove: function (e) { var t = this; t.delId = this.GMList[e].id, t.delIndex = e, t.delModal = !0 }, ok: function () { var e = this; return u()(a.a.mark(function t() { var r, i; return a.a.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return e.GMList.splice(e.delIndex, 1), r = e.delId, t.next = 4, n.i(d.f)(r); case 4: i = t.sent, 0 == i && e.$Message.success("删除成功"); case 6: case"end": return t.stop() } }, t, e) }))() } }, o()(r, "cancel", function () { this.$Message.info("已取消") }), o()(r, "add", function () { this.formName = "addi-form" }), o()(r, "updSubmit", function () { var e = this, t = {id: this.updform.id, uname: this.updform.uname, role: this.updform.selectRole}; n.i(c.a)("/user/updGM", t, function (t) { 1 == t.data ? e.$Message.error("账户已存在,请更换!") : 2 == t.data ? e.$Message.error("未知的数据库错误!") : e.$Message.success("更改GM账户成功!") }, function (t) { e.$Message.error("请求发送错误!" + t) }), this.getGMList() }), o()(r, "handleReset", function (e) { this.$refs[e].resetFields() }), o()(r, "getGMList", function () { var e = this; return u()(a.a.mark(function t() { var r, i, o, s, l, u, c, f; return a.a.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return r = [], i = e, t.next = 4, n.i(d.g)(); case 4: o = t.sent; for (s in o) l = function (e) { switch (e) { case 1: return "程序"; case 2: return "测试"; case 3: return "运营" } }, u = o[s].role, c = l(u), f = {id: o[s].id, account: o[s].uname, dept: c}, r.push(f); i.GMList = r; case 7: case"end": return t.stop() } }, t, e) }))() }), o()(r, "oldPwdCheck", function () { var e = this; e.addform.oldpassword != e.addform.oldpwdinput ? (this.$Message.error("旧密码不正确"), this.submitFlag = !1) : this.submitFlag = !0 }), o()(r, "oldNewCheck", function () { var e = this; e.addform.passwdCheck != e.addform.passwd ? (this.$Message.error("两次密码不一致"), this.submitFlag = !1) : this.submitFlag = !0 }), r), mounted: function () { this.getGMList() } } }, 204: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", {value: !0}), t.default = { created: function () { }, mounted: function () { }, data: function () { return {} }, methods: {}, computed: {} } }, 205: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", {value: !0}); var r = n(9), i = n(26); t.default = { data: function () { return { formInline: {uidValue: "", moneyValue: 1, assetType: ""}, ruleInline: {uidValue: [{required: !0, message: "请填写用户uid", trigger: "blur"}], moneyValue: [{required: !0, message: "请填写添加金额", trigger: "blur"}]}, disabled: !0, addMoneyModal: !1, role: "", max1: i.max1, max0: i.max0 } }, mounted: function () { this.getRole() }, beforeDestroy: function () { }, methods: { getRole: function () { var e = this; if (r.a.state.loginbean) { var t = r.a.state.loginbean; e.role = t.role } else window.location.href = "/" }, addMoneyModalShow: function () { if ("" === this.formInline.uidValue || "" === this.formInline.moneyValue) return void this.$Message.info("请输入收件人的uid/添加金币额"); this.addMoneyModal = !0 }, ok: function () { var e = this; if ("1" == this.role && this.formInline.moneyValue > i.max1) return void e.$Message.error("您的权限每次只能添加1亿"); window.parent.client.request("interface", { action: "addAsset", uid: this.formInline.uidValue, amount: this.formInline.moneyValue, type: this.formInline.assetType }, function (t, n) { if ("101" == t) return void e.$Message.error("抱歉,该用户不在线"); "0" == n && (console.log(n), e.$Message.succes("用户id:" + this.formInline.uidValue + ",增加金额:" + this.formInline.moneyValue + ",成功")) }) }, cancel: function () { this.$Message.info("点击了取消") } } } }, 206: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", {value: !0}); var r = n(12), i = n.n(r), o = n(11), s = n.n(o), a = (n(20), n(9)), l = n(10), u = n(176), c = n.n(u), d = n(340), f = n.n(d), p = n(343), h = n.n(p), m = n(336), v = n.n(m), g = n(342), y = n.n(g), b = n(341), w = n.n(b), x = n(334), k = n.n(x), _ = n(338), C = n.n(_), T = n(335), I = n.n(T); n(364), n(361), n(362), n(363); var j = n(26); t.default = { data: function () { return {uname: "未登录", role: "", myComponent: "hello2"} }, methods: { clickCompon: function (e) { this.myComponent = e }, getLoginerInfo: function () { var e = this; return s()(i.a.mark(function t() { var r, o, s; return i.a.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return r = e, t.next = 3, n.i(l.a)(); case 3: o = t.sent, a.a.state.loginbean ? (s = a.a.state.loginbean, r.uname = s.uname, r.role = s.role, e.connectAnget()) : window.location.href = "/"; case 5: case"end": return t.stop() } }, t, e) }))() }, connectAnget: function () { var e = new Date, t = j.host, n = j.port; (window.client = new ConsoleClient({ username: "", password: "", md5: !0 })).connect("bowser-" + e.getFullYear() + "-" + e.getMonth() + "-" + e.getDate() + " " + e.getHours() + ":" + e.getMinutes() + ":" + e.getSeconds(), t, n, function (e) { e ? (console.error("fail to connect to admin console server:"), console.error(e), alert(e)) : console.info("admin console connected.") }) }, getLoginbeanFun: function () { n.i(l.a)(), this.getLoginerInfo() }, loginout: function () { var e = this; return s()(i.a.mark(function t() { var r; return i.a.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return t.next = 2, n.i(l.c)(); case 2: r = t.sent, "0" == r && (e.$Message.info("用户已注销"), setTimeout(function () { location.reload() }, 1e3)); case 4: case"end": return t.stop() } }, t, e) }))() } }, beforeMount: function () { this.getLoginbeanFun() }, mounted: function () { }, beforeDestroy: function () { }, components: {onlineUsers: c.a, nodeInfo: f.a, systemInfo: h.a, addMoney: v.a, sendEmail: y.a, pwdUpdate: w.a, GMManager: k.a, itemReceivedList: C.a, hello2: I.a} } }, 207: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", {value: !0}); var r = n(12), i = n.n(r), o = n(11), s = n.n(o), a = n(10), l = n(38); t.default = { data: function () { return { changePageType: "allPage", pageNum: 1, count: 0, uid: null, columns6: [{title: "编号", key: "id", width: "85"}, {title: "玩家编号", key: "uid", width: "85"}, {title: "物品名称", key: "itemId", width: "115"}, { title: "物品数量", key: "num", width: "85" }, {title: "真实姓名", key: "name", width: "85"}, {title: "手机号", key: "mobile", width: "150"}, {title: "微信号", key: "wx", width: "150"}, { title: "玩家地址", key: "address", width: "300" }, {title: "邮编", key: "zipCode", width: "85"}, {title: "运营商", key: "operators", width: "85"}, {title: "记录日期", key: "createAt"}, {title: "发放状态", key: "status", width: "85"}], options2: { shortcuts: [{ text: "最近一周", value: function () { var e = new Date, t = new Date; return t.setTime(t.getTime() - 6048e5), [t, e] } }, { text: "最近一个月", value: function () { var e = new Date, t = new Date; return t.setTime(t.getTime() - 2592e6), [t, e] } }, { text: "最近三个月", value: function () { var e = new Date, t = new Date; return t.setTime(t.getTime() - 7776e6), [t, e] } }] }, data5: [], dateObj: {}, switch1: !1 } }, methods: { onoffSearch: function (e) { e ? this.$Message.info("检索已开启") : this.$Message.info("检索已关闭") }, showAll: function () { var e = this; e.dateObj = {}, e.uid = null, e.changePageType = "allPage", this.getReceivedList(1) }, daterange: function (e) { this.dateObj = e }, changePage: function (e) { this.getReceivedList(e) }, changeSearchPage: function (e) { var t = this.uid, n = this.dateObj; this.getUidList(e, t, n) }, getReceivedList: function (e) { var t = this; return s()(i.a.mark(function r() { var o, s, u, c, d, f, p, h, m; return i.a.wrap(function (r) { for (; ;) switch (r.prev = r.next) { case 0: return p = function (e) { var t = e + ""; for (var n in l) if (n == t) return l[n] }, f = function (e) { switch (e) { case 0: return "未处理"; case 1: return "已发放"; default: return "未知" } }, d = function (e) { switch (e) { case 1: return "移动"; case 2: return "联通"; case 3: return "电信"; default: return "未录入" } }, c = function (e) { return new Date(1e3 * parseInt(e)).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " ") }, o = t, s = [], r.next = 8, n.i(a.d)(e); case 8: u = r.sent, o.count = u[0].count; for (h in u) m = { id: u[h].id, uid: u[h].uid, itemId: p(u[h].itemId), num: u[h].num, name: u[h].name, mobile: u[h].mobile, wx: u[h].wx, address: u[h].address, zipCode: u[h].zipCode, operators: d(u[h].operators), createAt: c(u[h].createAt), status: f(u[h].status) }, s.push(m); o.data5 = s; case 12: case"end": return r.stop() } }, r, t) }))() }, getUidList: function (e, t, r) { var o = this; return s()(i.a.mark(function r() { var s, u, c, d, f, p, h, m, v, g; return i.a.wrap(function (r) { for (; ;) switch (r.prev = r.next) { case 0: return m = function (e) { var t = e + ""; for (var n in l) if (n == t) return l[n] }, h = function (e) { switch (e) { case 0: return "未处理"; case 1: return "已发放"; default: return "未知" } }, p = function (e) { switch (e) { case 1: return "移动"; case 2: return "联通"; case 3: return "电信"; default: return "未录入" } }, f = function (e) { return new Date(1e3 * parseInt(e)).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " ") }, s = o, s.changePageType = "searchPage", s.uid = t, u = [], c = o.dateObj, r.next = 11, n.i(a.e)(e, t, c); case 11: d = r.sent; for (v in d) g = { id: d[v].id, uid: d[v].uid, itemId: m(d[v].itemId), num: d[v].num, name: d[v].name, mobile: d[v].mobile, wx: d[v].wx, address: d[v].address, zipCode: d[v].zipCode, operators: p(d[v].operators), createAt: f(d[v].createAt), status: h(d[v].status) }, u.push(g); s.data5 = u, s.dateObj = c; case 15: case"end": return r.stop() } }, r, o) }))() } }, mounted: function () { this.getReceivedList(1) } } }, 208: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", {value: !0}); var r = n(10); t.default = { data: function () { return { formInline: {user: "", password: ""}, ruleInline: { user: [{required: !0, message: "请填写用户名", trigger: "blur"}], password: [{required: !0, message: "请填写密码", trigger: "blur"}, {type: "string", min: 6, message: "密码长度不能小于6位", trigger: "blur"}] } } }, methods: { handleSubmit: function (e) { var t = this; this.$refs[e].validate(function (e) { e ? t.$Message.success("提交成功!") : t.$Message.error("表单验证失败!") }) }, login: function (e) { n.i(r.b)(loginform, this) } } } }, 209: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", {value: !0}); var r = n(28), i = null; t.default = { created: function () { }, data: function () { return { selectedItem: "cpuAvg", selectedTime: .083, options: ["cpuAvg", "memAvg", "vsz", "rss", "usr", "sys", "gue"], optionsTime: [1, 5, 10], columns: [{title: "Time", key: "time", sortable: !0}, {title: "serverId", key: "serverId", sortable: !0}, {title: "serverType", key: "serverType", sortable: !0}, { title: "pid", key: "pid", sortable: !0 }, {title: "cpuAvg", key: "cpuAvg", sortable: !0}, {title: "memAvg", key: "memAvg", sortable: !0}, {title: "vsz", key: "vsz", sortable: !0}, { title: "rss", key: "rss", sortable: !0 }, {title: "usr(CPU I/O)", key: "usr", sortable: !0}, {title: "sys(CPU I/O)", key: "sys", sortable: !0}, {title: "gue(CPU I/O)", key: "gue", sortable: !0}], msg: "aaaaaa", datacollection: null, data: [] } }, methods: { fillData: function (e, t) { this.datacollection = {labels: e, datasets: t} }, contentUpdate: function (e) { var t = this.selectedItem, n = this.serverDataArr, r = []; this.serverDataArr.length > 0 && (this.serverDataArr = []); var i = this; i.msg = e; for (var o in e) { var s = {}, a = {}; a = { id: o.index + 1, time: e[o].time, serverId: o, serverType: e[o].serverType, pid: e[o].pid, cpuAvg: e[o].cpuAvg, memAvg: e[o].memAvg, vsz: e[o].vsz, rss: e[o].rss, usr: e[o].usr, sys: e[o].sys, gue: e[o].gue }, r.push(a); var l = function () { return "#" + Math.floor(16777215 * Math.random()).toString(16) }() + ""; n[o] || (n[o] = {}), n[o][t] ? this.serverDataArr[o][t].push(e[o][t]) : (n[o] = {}, n[o][t] = [], s = { label: o + "\n", borderColor: l, pointBackgroundColor: "white", borderWidth: 2, pointBorderColor: l, backgroundColor: "rgba(255, 255, 255, 0)", data: n[o][t] }, this.datasetsArr.push(s)) } i.data = r; var u = new Date; this.nowTime.push(u.toLocaleString().toString() + ""), i.fillData(this.nowTime, this.datasetsArr) }, req: function () { var e = this; window.parent.client.request("nodeInfo", null, function (t, n) { if (t) return console.error("fail to request online user:"), void console.error(t); e.contentUpdate(n) }) }, clearValues: function () { this.nowTime = [], this.serverDataArr = {}, this.datasetsArr = [], this.fillData(this.nowTime, this.datasetsArr) }, changeTime: function (e) { var t = this; this.clearValues(), window.clearInterval(i), this.interval = 1e3 * e, i = setInterval(function () { t.req() }, this.interval) } }, mounted: function () { var e = this; i && (window.clearInterval(i), this.clearValues(), i = null), this.interval = 5e3, this.nowTime = [], this.serverDataArr = {}, this.datasetsArr = [], i = setInterval(function () { e.req() }, this.interval) }, computed: {}, distroyed: function () { window.clearTimeInterval(this.req) }, components: {LineChart: r.a} } }, 210: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", {value: !0}); var r = n(28), i = null; t.default = { created: function () { }, data: function () { return {columns: [{title: "服务器名称", key: "serverId", sortable: !0}, {title: "在线人数", key: "loginedCount", sortable: !0}], msg: "aaaaaa", datacollection: null, data: []} }, methods: { fillData: function (e, t) { this.datacollection = {labels: e, datasets: t} }, contentUpdate: function (e) { var t = this.serverDataArr, n = [], r = this; r.msg = e; for (var i in e) { var o = 0, s = {}, a = {}; if (o += e[i].loginedCount, a = { serverId: i, loginedCount: o }, n.push(a), t[i]) this.serverDataArr[i].length > 15 && this.serverDataArr[i].splice(0, 1), this.serverDataArr[i].push(e[i].loginedCount); else { t[i] = []; var l = function () { return "#" + Math.floor(16777215 * Math.random()).toString(16) }() + ""; s = { label: i + " loginedCount", borderColor: l, pointBackgroundColor: "white", borderWidth: 2, pointBorderColor: l, backgroundColor: "rgba(255, 255, 255, 0)", data: t[i] }, this.datasetsArr.push(s) } } r.data = n; var u = new Date; this.nowTime.length > 15 && this.nowTime.splice(0, 1), this.nowTime.push(u.toLocaleString().toString() + ""), r.fillData(this.nowTime, this.datasetsArr) }, req: function () { var e = this; window.parent.client.request("onlineUser", null, function (t, n) { if (t) return console.error("fail to request online user:"), void console.error(t); e.contentUpdate(n) }) }, clearValues: function () { this.nowTime = [], this.serverDataArr = {}, this.datasetsArr = [], this.fillData(this.nowTime, this.datasetsArr) } }, mounted: function () { var e = this; i && (window.clearInterval(i), this.clearValues(), i = null), this.interval = 5e3, this.nowTime = [], this.serverDataArr = {}, this.datasetsArr = [], i = setInterval(function () { e.req() }, 5e3) }, computed: {}, distroyed: function () { window.clearTimeInterval(this.req) }, components: {LineChart: r.a} } }, 211: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", {value: !0}); var r = n(12), i = n.n(r), o = n(11), s = n.n(o), a = n(9), l = (n(20), n(10)); t.default = { data: function () { return {formCustom: {id: "", passwd: "", passwdCheck: "", oldpassword: "aaaaaa", oldpwdinput: ""}} }, methods: { updSubmit: function () { var e = this; return s()(i.a.mark(function t() { var r, o; return i.a.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: if (r = e, !1 !== e.submitFlag) { t.next = 5; break } e.$Message.error("更改密码失败!请检验"), t.next = 9; break; case 5: return t.next = 7, n.i(l.h)(r.i - formCustom.id, r.i - formCustom.passwd); case 7: o = t.sent, "0" == o && (e.$Message.success("密码更改成功!"), setTimeout(function () { location.reload() }, 1e3)); case 9: case"end": return t.stop() } }, t, e) }))() }, handleReset: function (e) { this.$refs[e].resetFields() }, getOldPwd: function () { var e = this; if (a.a.state.loginbean) { var t = a.a.state.loginbean; e.formCustom.oldpassword = t.pwd, e.formCustom.id = t.id } else this.$Message.error("登录已失效,请重新登录"), setTimeout(function () { location.reload() }, 1e3) }, oldPwdCheck: function () { var e = this; e.formCustom.oldpassword != e.formCustom.oldpwdinput ? (this.$Message.error("旧密码不正确"), this.submitFlag = !1) : this.submitFlag = !0 }, oldNewCheck: function () { var e = this; e.formCustom.passwdCheck != e.formCustom.passwd ? (this.$Message.error("两次密码不一致"), this.submitFlag = !1) : this.submitFlag = !0 } }, mounted: function () { this.getOldPwd() } } }, 212: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", {value: !0}); var r = n(9), i = n(26), o = n(38); t.default = { data: function () { return { formInline: {uidValue: "", goldValue: null, beanValue: null, itemValue: "", itemCount: null, content: "", tittle: "", itemName: "", itemList: []}, itemList: [], itemSingle: {}, addMoneyModal: !1, role: "", max1: i.max1, max0: i.max0 } }, mounted: function () { this.getRole(), this.itemCode() }, beforeDestroy: function () { }, methods: { itemCode: function () { var e = this, t = []; for (var n in o) { var r = {value: n, label: o[n]}; t.push(r) } e.formInline.itemList = t }, getRole: function () { var e = this; if (r.a.state.loginbean) { var t = r.a.state.loginbean; e.role = t.role } else window.location.href = "/" }, ok: function () { if ("" === this.formInline.uidValue) return void this.$Message.info("请输入收件人的uid"); var e = this; if ("1" == this.role && this.formInline.goldValue > i.max1 || this.formInline.beanValue > i.max1) return void e.$Message.error("您的权限每次只能添加1亿"); window.parent.client.request("interface", { action: "addMail", uid: this.formInline.uidValue, title: this.formInline.tittle, content: this.formInline.content, gold: this.formInline.goldValue, bean: this.formInline.beanValue, items: this.itemList }, function (t, n) { if ("101" == t) return void e.$Message.error("用户id:" + e.formInline.uidValue + ",不在服务器"); "0" == n && e.$Message.info("用户id:" + e.formInline.uidValue + ",发送邮件成功") }) }, cancel: function () { this.$Message.info("已取消") }, addItems: function () { this.formInline.itemValue; if ("" === this.formInline.itemValue || "" === this.formInline.itemCount) return void this.$Message.info("请输入 物品编号/物品数量"); for (var e in this.itemList) if (this.itemList[e].id == this.formInline.itemValue) return this.itemList[e].number >= 10 ? void this.$Message.error("每次添加数量不能超过10个") : void(this.itemList[e].number = parseInt(this.itemList[e].number) + parseInt(this.formInline.itemCount)); if (this.formInline.itemCount > 10) return void this.$Message.error("每次添加数量不能超过10个"); this.itemSingle = {id: this.formInline.itemValue, number: this.formInline.itemCount}, this.itemList.push(this.itemSingle) }, dele: function (e) { this.itemList.splice(e, 1), this.$Message.info("已删除") } } } }, 213: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", {value: !0}); var r = n(28), i = null; t.default = { data: function () { return { selectedItem: "m_1", selectedTime: .083, options: ["m_1", "m_5", "m_15", "totalmem", "freemem", "cpu_user", "cpu_nice", "cpu_system", "cpu_iowait", "cpu_steal", "cpu_idle", "tps", "kb_read", "kb_wrtn", "kb_read_per", "kb_wrtn_per"], optionsTime: [1, 5, 10], columns: [{title: "Time", key: "time", sortable: !0, width: 100, fixed: "left"}, {title: "serverId", key: "serverId", width: 120, sortable: !0}, { title: "hostname", key: "hostname", width: 120, sortable: !0 }, {title: "1m (loadavg)", key: "m_1", width: 120, sortable: !0}, {title: "5m (loadavg)", key: "m_5", width: 120, sortable: !0}, { title: "15m (loadavg)", key: "m_15", width: 120, sortable: !0 }, {title: "totalmem(mem)", key: "totalmen", width: 100, sortable: !0}, {title: "freemem(mem)", key: "freemem", width: 100, sortable: !0}, { title: "free/total(mem)", key: "free_total", width: 100, sortable: !0 }, {title: "user(CPU I/O)", key: "cpu_user", width: 75, sortable: !0}, {title: "nice(CPU I/O)", key: "cpu_nice", width: 75, sortable: !0}, { title: "system(CPU I/O)", key: "cpu_system", width: 75, sortable: !0 }, {title: "iowait(CPU I/O)", key: "cpu_iowait", width: 75, sortable: !0}, {title: "steal(CPU I/O)", key: "cpu_steal", width: 75, sortable: !0}, { title: "idle(CPU I/O)", key: "cpu_idle", width: 75, sortable: !0 }, {title: "tps(CPU I/O)", key: "tps", width: 75, sortable: !0}, {title: "read(CPU I/O)", key: "kb_read", width: 75, sortable: !0}, { title: "wrtn(CPU I/O)", key: "kb_wrtn", width: 75, sortable: !0 }, {title: "kb_read/s(CPU I/O)", key: "kb_read_per", width: 75, sortable: !0}, { title: "kb_wrtn/s(CPU I/O) ", key: "kb_wrtn_per", sortable: !0, width: 150, height: 250, fixed: "right" }], msg: "aaaaaa", datacollection: null, data: [] } }, methods: { fillData: function (e, t) { for (var n in t) for (var r in t[n]) ; this.datacollection = {labels: e, datasets: t} }, contentUpdate: function (e) { var t = this.selectedItem, n = this.serverDataArr, r = []; this.serverDataArr.length > 0 && (this.serverDataArr = []); var i = this; i.msg = e; for (var o in e) { var s = {}, a = {}; a = { time: e[o].Time, serverId: o, hostname: e[o].hostname, cpu_user: e[o].cpu_user, cpu_nice: e[o].cpu_nice, cpu_system: e[o].cpu_system, cpu_iowait: e[o].cpu_iowait, cpu_steal: e[o].cpu_steal, cpu_idle: e[o].cpu_idle, tps: e[o].tps, kb_read: e[o].kb_read, kb_wrtn: e[o].kb_wrtn, kb_read_per: e[o].kb_read_per, kb_wrtn_per: e[o].kb_wrtn_per, totalmem: e[o].totalmem, freemem: e[o].freemem, free_total: e[o].freemem / e[o].totalmem, m_1: e[o].m_1, m_5: e[o].m_5, m_15: e[o].m_15 }, r.push(a); var l = function () { return "#" + Math.floor(16777215 * Math.random()).toString(16) }() + ""; n[o] || (n[o] = {}), n[o][t] ? this.serverDataArr[o][t].push(e[o][t]) : (n[o] = {}, n[o][t] = [], s = { label: o + "\n", borderColor: l, pointBackgroundColor: "white", borderWidth: 2, pointBorderColor: l, backgroundColor: "rgba(255, 255, 255, 0)", data: n[o][t] }, this.datasetsArr.push(s)) } i.data = r; var u = new Date; this.nowTime.push(u.toLocaleString().toString() + ""), i.fillData(this.nowTime, this.datasetsArr) }, req: function () { var e = this; window.parent.client.request("systemInfo", null, function (t, n) { if (t) return console.error("fail to request online user:"), void console.error(t); e.contentUpdate(n) }) }, clearValues: function () { this.nowTime = [], this.serverDataArr = {}, this.datasetsArr = [], this.fillData(this.nowTime, this.datasetsArr) }, changeTime: function (e) { var t = this; this.clearValues(), window.clearInterval(i), this.interval = 1e3 * e, i = setInterval(function () { t.req() }, this.interval) } }, mounted: function () { var e = this; i && (window.clearInterval(i), this.clearValues(), i = null), this.interval = 5e3, this.nowTime = [], this.serverDataArr = {}, this.datasetsArr = [], i = setInterval(function () { e.req() }, this.interval) }, computed: {}, distroyed: function () { window.clearTimeInterval(this.req) }, components: {LineChart: r.a} } }, 214: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", {value: !0}); var r = n(1), i = n(182), o = n.n(i), s = n(179), a = n(181), l = n.n(a), u = n(180), c = (n.n(u), n(9)); r.default.use(l.a), r.default.use(n(183)), r.default.config.productionTip = !0, new r.default({ el: "#app", router: s.a, template: "<App/>", components: {App: o.a} }), s.a.beforeEach(function (e, t, n) { e.meta.requireAuth ? null != c.a.state.loginbean ? setTimeout(function () { n() }, 1e3) : setTimeout(function () { n({path: "/", query: {redirect: e.fullPath}}) }, 500) : n() }) }, 26: function (e, t) { e.exports = {host: host, port: port, vuePort: vuePort, max1: max1, max0: max0} }, 28: function (e, t, n) { "use strict"; var r = n(329), i = (n.n(r), r.mixins.reactiveProp); t.a = r.Line.extend({ mixins: [i], props: ["options"], mounted: function () { this.renderChart(this.chartData, this.options) } }) }, 308: function (e, t) { }, 309: function (e, t) { }, 310: function (e, t) { }, 311: function (e, t) { }, 312: function (e, t) { }, 313: function (e, t) { }, 316: function (e, t, n) { function r(e) { return n(i(e)) } function i(e) { var t = o[e]; if (!(t + 1)) throw new Error("Cannot find module '" + e + "'."); return t } var o = { "./af": 61, "./af.js": 61, "./ar": 68, "./ar-dz": 62, "./ar-dz.js": 62, "./ar-kw": 63, "./ar-kw.js": 63, "./ar-ly": 64, "./ar-ly.js": 64, "./ar-ma": 65, "./ar-ma.js": 65, "./ar-sa": 66, "./ar-sa.js": 66, "./ar-tn": 67, "./ar-tn.js": 67, "./ar.js": 68, "./az": 69, "./az.js": 69, "./be": 70, "./be.js": 70, "./bg": 71, "./bg.js": 71, "./bn": 72, "./bn.js": 72, "./bo": 73, "./bo.js": 73, "./br": 74, "./br.js": 74, "./bs": 75, "./bs.js": 75, "./ca": 76, "./ca.js": 76, "./cs": 77, "./cs.js": 77, "./cv": 78, "./cv.js": 78, "./cy": 79, "./cy.js": 79, "./da": 80, "./da.js": 80, "./de": 83, "./de-at": 81, "./de-at.js": 81, "./de-ch": 82, "./de-ch.js": 82, "./de.js": 83, "./dv": 84, "./dv.js": 84, "./el": 85, "./el.js": 85, "./en-au": 86, "./en-au.js": 86, "./en-ca": 87, "./en-ca.js": 87, "./en-gb": 88, "./en-gb.js": 88, "./en-ie": 89, "./en-ie.js": 89, "./en-nz": 90, "./en-nz.js": 90, "./eo": 91, "./eo.js": 91, "./es": 93, "./es-do": 92, "./es-do.js": 92, "./es.js": 93, "./et": 94, "./et.js": 94, "./eu": 95, "./eu.js": 95, "./fa": 96, "./fa.js": 96, "./fi": 97, "./fi.js": 97, "./fo": 98, "./fo.js": 98, "./fr": 101, "./fr-ca": 99, "./fr-ca.js": 99, "./fr-ch": 100, "./fr-ch.js": 100, "./fr.js": 101, "./fy": 102, "./fy.js": 102, "./gd": 103, "./gd.js": 103, "./gl": 104, "./gl.js": 104, "./gom-latn": 105, "./gom-latn.js": 105, "./he": 106, "./he.js": 106, "./hi": 107, "./hi.js": 107, "./hr": 108, "./hr.js": 108, "./hu": 109, "./hu.js": 109, "./hy-am": 110, "./hy-am.js": 110, "./id": 111, "./id.js": 111, "./is": 112, "./is.js": 112, "./it": 113, "./it.js": 113, "./ja": 114, "./ja.js": 114, "./jv": 115, "./jv.js": 115, "./ka": 116, "./ka.js": 116, "./kk": 117, "./kk.js": 117, "./km": 118, "./km.js": 118, "./kn": 119, "./kn.js": 119, "./ko": 120, "./ko.js": 120, "./ky": 121, "./ky.js": 121, "./lb": 122, "./lb.js": 122, "./lo": 123, "./lo.js": 123, "./lt": 124, "./lt.js": 124, "./lv": 125, "./lv.js": 125, "./me": 126, "./me.js": 126, "./mi": 127, "./mi.js": 127, "./mk": 128, "./mk.js": 128, "./ml": 129, "./ml.js": 129, "./mr": 130, "./mr.js": 130, "./ms": 132, "./ms-my": 131, "./ms-my.js": 131, "./ms.js": 132, "./my": 133, "./my.js": 133, "./nb": 134, "./nb.js": 134, "./ne": 135, "./ne.js": 135, "./nl": 137, "./nl-be": 136, "./nl-be.js": 136, "./nl.js": 137, "./nn": 138, "./nn.js": 138, "./pa-in": 139, "./pa-in.js": 139, "./pl": 140, "./pl.js": 140, "./pt": 142, "./pt-br": 141, "./pt-br.js": 141, "./pt.js": 142, "./ro": 143, "./ro.js": 143, "./ru": 144, "./ru.js": 144, "./sd": 145, "./sd.js": 145, "./se": 146, "./se.js": 146, "./si": 147, "./si.js": 147, "./sk": 148, "./sk.js": 148, "./sl": 149, "./sl.js": 149, "./sq": 150, "./sq.js": 150, "./sr": 152, "./sr-cyrl": 151, "./sr-cyrl.js": 151, "./sr.js": 152, "./ss": 153, "./ss.js": 153, "./sv": 154, "./sv.js": 154, "./sw": 155, "./sw.js": 155, "./ta": 156, "./ta.js": 156, "./te": 157, "./te.js": 157, "./tet": 158, "./tet.js": 158, "./th": 159, "./th.js": 159, "./tl-ph": 160, "./tl-ph.js": 160, "./tlh": 161, "./tlh.js": 161, "./tr": 162, "./tr.js": 162, "./tzl": 163, "./tzl.js": 163, "./tzm": 165, "./tzm-latn": 164, "./tzm-latn.js": 164, "./tzm.js": 165, "./uk": 166, "./uk.js": 166, "./ur": 167, "./ur.js": 167, "./uz": 169, "./uz-latn": 168, "./uz-latn.js": 168, "./uz.js": 169, "./vi": 170, "./vi.js": 170, "./x-pseudo": 171, "./x-pseudo.js": 171, "./yo": 172, "./yo.js": 172, "./zh-cn": 173, "./zh-cn.js": 173, "./zh-hk": 174, "./zh-hk.js": 174, "./zh-tw": 175, "./zh-tw.js": 175 }; r.keys = function () { return Object.keys(o) }, r.resolve = i, e.exports = r, r.id = 316 }, 333: function (e, t) { e.exports = { name: "vue-chartjs", version: "2.8.3", description: "vue.js wrapper for chart.js", author: "Jakub Juszczak <jakub@posteo.de>", homepage: "http://vue-chartjs.org", license: "MIT", contributors: [{name: "Thorsten Lünborg", web: "https://github.com/LinusBorg"}, {name: "Juan Carlos Alonso", web: "https://github.com/jcalonso"}], maintainers: [{name: "Jakub Juszczak", email: "jakub@posteo.de", web: "http://www.jakubjuszczak.de"}], repository: {type: "git", url: "git+ssh://git@github.com:apertureless/vue-chartjs.git"}, bugs: {url: "https://github.com/apertureless/vue-chartjs/issues"}, keywords: ["ChartJs", "Vue", "Visualisation", "Wrapper", "Charts"], main: "dist/vue-chartjs.js", unpkg: "dist/vue-chartjs.full.min.js", module: "es/index.js", "jsnext:main": "es/index.js", files: ["src", "dist", "es"], scripts: { dev: "node build/dev-server.js", build: "yarn run release && yarn run build:es", "build:es": "cross-env BABEL_ENV=es babel src --out-dir es", unit: "karma start test/unit/karma.conf.js --single-run", e2e: "node test/e2e/runner.js", test: "npm run unit", lint: "eslint --ext .js,.vue src test/unit/specs test/e2e/specs", release: "webpack --progress --hide-modules --config ./build/webpack.release.js && NODE_ENV=production webpack --progress --hide-modules --config ./build/webpack.release.min.js && webpack --progress --hide-modules --config ./build/webpack.release.full.js && NODE_ENV=production webpack --progress --hide-modules --config ./build/webpack.release.full.min.js", prepublish: "yarn run lint && yarn run test && yarn run build" }, dependencies: {}, peerDependencies: {"chart.js": "^2.6.0", vue: "^2.4.2"}, devDependencies: { "babel-cli": "^6.24.1", "babel-core": "^6.25.0", "babel-loader": "^7.0.0", "babel-plugin-transform-object-assign": "^6.22.0", "babel-plugin-transform-runtime": "^6.23.0", "babel-preset-es2015": "^6.24.1", "babel-preset-stage-2": "^6.24.1", "babel-runtime": "^6.23.0", chai: "^3.5.0", "chart.js": "^2.6.0", chromedriver: "^2.28.0", "connect-history-api-fallback": "^1.1.0", "cross-env": "^3.2.4", "cross-spawn": "^5.1.0", "css-loader": "^0.28.0", eslint: "^3.19.0", "eslint-config-standard": "^10.2.1", "eslint-friendly-formatter": "^2.0.7", "eslint-loader": "^1.7.1", "eslint-plugin-html": "^2.0.1", "eslint-plugin-import": "^2.2.0", "eslint-plugin-node": "^4.2.2", "eslint-plugin-promise": "^3.5.0", "eslint-plugin-standard": "^3.0.1", "eventsource-polyfill": "^0.9.6", express: "^4.15.2", "extract-text-webpack-plugin": "^1.0.1", "file-loader": "^0.10.1", "function-bind": "^1.0.2", "html-webpack-plugin": "^2.28.0", "http-proxy-middleware": "^0.17.4", "inject-loader": "^3.0.0", "isparta-loader": "^2.0.0", "jasmine-core": "^2.5.2", "json-loader": "^0.5.4", karma: "^1.5.0", "karma-coverage": "^1.1.1", "karma-jasmine": "^1.0.2", "karma-mocha": "^1.2.0", "karma-phantomjs-launcher": "^1.0.4", "karma-sinon-chai": "^1.2.0", "karma-sourcemap-loader": "^0.3.7", "karma-spec-reporter": "0.0.30", "karma-webpack": "1.8.1", lolex: "^1.6.0", mocha: "^3.1.0", nightwatch: "^0.9.14", ora: "^1.2.0", "phantomjs-prebuilt": "^2.1.13", "selenium-server": "^3.3.1", shelljs: "^0.7.7", sinon: "^2.1.0", "sinon-chai": "^2.9.0", "url-loader": "^0.5.8", vue: "^2.4.2", "vue-hot-reload-api": "^2.1.0", "vue-html-loader": "^1.2.4", "vue-loader": "^12.2.2", "vue-style-loader": "^3.0.1", "vue-template-compiler": "^2.4.2", webpack: "^1.13.2", "webpack-dev-middleware": "^1.10.1", "webpack-hot-middleware": "^2.17.1", "webpack-merge": "1.1.1" }, engines: {node: ">=6.9.0"}, babel: {presets: ["es2015"]}, browserify: {transform: ["babelify"]}, greenkeeper: {ignore: ["extract-text-webpack-plugin", "karma-webpack", "webpack", "webpack-merge"]}, _from: "vue-chartjs@2.8.3", _resolved: "http://registry.npm.taobao.org/vue-chartjs/download/vue-chartjs-2.8.3.tgz" } }, 334: function (e, t, n) { var r = n(3)(n(203), n(346), null, null, null); e.exports = r.exports }, 335: function (e, t, n) { function r(e) { n(311) } var i = n(3)(n(204), n(349), r, "data-v-287d54fc", null); e.exports = i.exports }, 336: function (e, t, n) { var r = n(3)(n(205), n(350), null, null, null); e.exports = r.exports }, 337: function (e, t, n) { function r(e) { n(313) } var i = n(3)(n(206), n(355), r, "data-v-cedf99a2", null); e.exports = i.exports }, 338: function (e, t, n) { var r = n(3)(n(207), n(352), null, null, null); e.exports = r.exports }, 339: function (e, t, n) { function r(e) { n(309) } var i = n(3)(n(208), n(345), r, "data-v-09c039d2", null); e.exports = i.exports }, 340: function (e, t, n) { function r(e) { n(312) } var i = n(3)(n(209), n(354), r, "data-v-c10a19dc", null); e.exports = i.exports }, 341: function (e, t, n) { var r = n(3)(n(211), n(353), null, null, null); e.exports = r.exports }, 342: function (e, t, n) { var r = n(3)(n(212), n(351), null, null, null); e.exports = r.exports }, 343: function (e, t, n) { function r(e) { n(310) } var i = n(3)(n(213), n(348), r, "data-v-1d3537bf", null); e.exports = i.exports }, 344: function (e, t) { e.exports = { render: function () { var e = this, t = e.$createElement, n = e._self._c || t; return n("div", {staticClass: "hello"}, [n("div", [n("Table", { staticClass: "table-area", attrs: {border: "", columns: e.columns, data: e.data} }), e._v(" "), "aaaaaa" === e.msg ? n("div", [n("Spin", {attrs: {fix: ""}}, [n("Icon", { staticClass: "demo-spin-icon-load", attrs: {type: "load-c", size: "18"} }), e._v(" "), n("div", [e._v("Loading")])], 1)], 1) : e._e()], 1), e._v(" "), n("div", {staticClass: "chart"}, [n("line-chart", { attrs: { "chart-data": e.datacollection, options: {responsive: !1, maintainAspectRatio: !1}, width: 1024, height: 300 } }), e._v(" "), n("i-button", {on: {click: e.clearValues}}, [e._v("清除数据")])], 1)]) }, staticRenderFns: [] } }, 345: function (e, t) { e.exports = { render: function () { var e = this, t = e.$createElement, n = e._self._c || t; return n("Row", {staticClass: "RowStyle"}, [n("Col", {attrs: {span: "8"}}, [e._v(" ")]), e._v(" "), n("Col", {attrs: {span: "8"}}, [n("div", { staticClass: "RowStyle", staticStyle: {"margin-top": "50%"} }, [n("span", {}, [e._v("请登录")]), e._v(" "), n("i-form", { ref: "formInline", attrs: {model: e.formInline, rules: e.ruleInline, name: "loginform"} }, [n("FormItem", {attrs: {prop: "user"}}, [n("Input", { attrs: {type: "text", placeholder: "Username", name: "user"}, model: { value: e.formInline.user, callback: function (t) { e.formInline.user = t }, expression: "formInline.user" } }, [n("Icon", {attrs: {type: "ios-person-outline"}, slot: "prepend"})], 1)], 1), e._v(" "), n("FormItem", {attrs: {prop: "password"}}, [n("Input", { attrs: { type: "password", placeholder: "Password", name: "password" }, model: { value: e.formInline.password, callback: function (t) { e.formInline.password = t }, expression: "formInline.password" } }, [n("Icon", {attrs: {type: "ios-locked-outline"}, slot: "prepend"})], 1)], 1), e._v(" "), n("FormItem", [n("i-button", { attrs: {type: "primary"}, on: {click: e.login} }, [e._v("登录")])], 1)], 1)], 1)]), e._v(" "), n("Col", {attrs: {span: "8"}}, [e._v(" ")])], 1) }, staticRenderFns: [] } }, 346: function (e, t) { e.exports = { render: function () { var e = this, t = e.$createElement, n = e._self._c || t; return n("div", [n("Row", [n("Col", {attrs: {span: "6"}}, [e._v(" \n\t "), n("Modal", { attrs: {title: "确认删除提示框"}, on: {"on-ok": e.ok, "on-cancel": e.cancel}, model: { value: e.delModal, callback: function (t) { e.delModal = t }, expression: "delModal" } }, [n("p", [e._v("确认删除?")])])], 1), e._v(" "), n("Col", {attrs: {span: "8"}}, [n("div", { directives: [{ name: "show", rawName: "v-show", value: "addi-form" == e.formName, expression: "formName=='addi-form'" }] }, [e._v("\n\t \t\t添加GM\n\t \t"), n("i-form", {ref: "addform", attrs: {model: e.addform, "label-width": 80}}, [n("FormItem", { attrs: { label: "GM账户", prop: "uname" } }, [n("Input", { attrs: {type: "text"}, on: {"on-blur": e.oldPwdCheck}, model: { value: e.addform.uname, callback: function (t) { e.addform.uname = t }, expression: "addform.uname" } })], 1), e._v(" "), n("FormItem", {attrs: {label: "GM密码", prop: "password"}}, [n("Input", { attrs: {type: "password"}, model: { value: e.addform.password, callback: function (t) { e.addform.password = t }, expression: "addform.password" } })], 1), e._v(" "), n("FormItem", {attrs: {label: "GM部门", prop: "role"}}, [n("Select", { staticStyle: {width: "200px"}, model: { value: e.addform.selectRole, callback: function (t) { e.addform.selectRole = t }, expression: "addform.selectRole" } }, e._l(e.addform.roleList, function (t) { return n("Option", {key: t.value, attrs: {value: t.value}}, [e._v(e._s(t.label))]) }))], 1), e._v(" "), n("FormItem", [n("i-button", {attrs: {type: "primary"}, on: {click: e.addSubmit}}, [e._v("提交")]), e._v(" "), n("i-button", { staticStyle: {"margin-left": "10%"}, attrs: {type: "ghost"}, on: { click: function (t) { e.handleReset("addform") } } }, [e._v("重置")]), e._v(" "), n("i-button", { staticStyle: {"margin-left": "10%"}, attrs: {type: "ghost"}, on: {click: e.cancel} }, [e._v("取消")])], 1)], 1)], 1), e._v(" "), n("div", { directives: [{ name: "show", rawName: "v-show", value: "updi-form" == e.formName, expression: "formName=='updi-form'" }] }, [e._v("\n\t\t \t\t修改GM\n\t\t \t"), n("i-form", {ref: "updform", attrs: {model: e.updform, "label-width": 80}}, [n("input", { directives: [{ name: "model", rawName: "v-model", value: e.updform.id, expression: "updform.id" }], attrs: {type: "hidden"}, domProps: {value: e.updform.id}, on: { input: function (t) { t.target.composing || (e.updform.id = t.target.value) } } }), e._v(" "), n("FormItem", {attrs: {label: "GM账户", prop: "uname"}}, [n("Input", { attrs: {type: "text"}, on: {"on-blur": e.oldPwdCheck}, model: { value: e.updform.uname, callback: function (t) { e.updform.uname = t }, expression: "updform.uname" } })], 1), e._v(" "), n("FormItem", { attrs: { label: "原部门", prop: "role" } }, [e._v("\n\t\t\t\t\t \t" + e._s(e.updi - e.form.dept) + "\n\t\t\t\t\t ")]), e._v(" "), n("FormItem", { attrs: { label: "新部门", prop: "role" } }, [n("Select", { staticStyle: {width: "200px"}, attrs: {placeholder: "请选择新部门"}, model: { value: e.updform.selectRole, callback: function (t) { e.updform.selectRole = t }, expression: "updform.selectRole" } }, e._l(e.updform.roleList, function (t) { return n("Option", {key: t.value, attrs: {value: t.value}}, [e._v(e._s(t.label))]) }))], 1), e._v(" "), n("FormItem", [n("i-button", {attrs: {type: "primary"}, on: {click: e.updSubmit}}, [e._v("提交")]), e._v(" "), n("i-button", { staticStyle: {"margin-left": "10%"}, attrs: {type: "ghost"}, on: { click: function (t) { e.handleReset("addform") } } }, [e._v("重置")]), e._v(" "), n("i-button", { staticStyle: {"margin-left": "10%"}, attrs: {type: "ghost"}, on: {click: e.cancel} }, [e._v("取消")])], 1)], 1)], 1), e._v(" "), n("Table", { attrs: { border: "", columns: e.GMColumn, data: e.GMList } })], 1), e._v(" "), n("Col", {attrs: {span: "10"}}, [n("div", { directives: [{ name: "show", rawName: "v-show", value: "updi-form" == e.formName || "" == e.formName, expression: "formName=='updi-form'||formName==''" }] }, [n("i-button", {attrs: {shape: "circle"}, on: {click: e.add}}, [n("Icon", {attrs: {type: "plus-round"}}, [e._v("添加GM")])], 1)], 1)])], 1)], 1) }, staticRenderFns: [] } }, 347: function (e, t) { e.exports = { render: function () { var e = this, t = e.$createElement, n = e._self._c || t; return n("div", [n("router-view")], 1) }, staticRenderFns: [] } }, 348: function (e, t) { e.exports = { render: function () { var e = this, t = e.$createElement, n = e._self._c || t; return n("div", {staticClass: "hello"}, [n("div", [n("Table", { staticClass: "table-area", attrs: {width: "1500", border: "", columns: e.columns, data: e.data, size: "small"} }), e._v(" "), "aaaaaa" === e.msg ? n("div", [n("Spin", {attrs: {fix: ""}}, [n("Icon", { staticClass: "demo-spin-icon-load", attrs: {type: "load-c", size: "18"} }), e._v(" "), n("div", [e._v("Loading")])], 1)], 1) : e._e()], 1), e._v(" "), n("div", {staticClass: "chart"}, [n("label", {staticClass: "name "}, [e._v("请选择所显示的项目")]), e._v(" "), n("Select", { staticStyle: {width: "100px"}, attrs: {size: "small"}, on: {"on-change": e.clearValues}, model: { value: e.selectedItem, callback: function (t) { e.selectedItem = t }, expression: "selectedItem" } }, e._l(e.options, function (t) { return n("Option", {key: t, attrs: {value: t}}, [e._v(e._s(t))]) })), e._v(" "), n("label", {staticClass: "name "}, [e._v("请选择时间间隔(M)")]), e._v(" "), n("Select", { staticStyle: {width: "100px"}, attrs: {size: "small"}, on: { "on-change": function (t) { e.changeTime(e.selectedTime) } }, model: { value: e.selectedTime, callback: function (t) { e.selectedTime = t }, expression: "selectedTime" } }, e._l(e.optionsTime, function (t) { return n("Option", {key: t, attrs: {value: t}}, [e._v(e._s(t))]) })), e._v(" "), n("line-chart", { attrs: { "chart-data": e.datacollection, options: {responsive: !1, maintainAspectRatio: !1}, width: 1024, height: 300 } }), e._v(" "), n("i-button", {on: {click: e.clearValues}}, [e._v("clearValues")])], 1)]) }, staticRenderFns: [] } }, 349: function (e, t) { e.exports = { render: function () { var e = this, t = e.$createElement; e._self._c; return e._m(0) }, staticRenderFns: [function () { var e = this, t = e.$createElement, n = e._self._c || t; return n("div", {staticClass: "hello"}, [n("div", {staticClass: "layout-body"}, [e._v("欢迎来到ACE德州扑克的后台管理系统")])]) }] } }, 350: function (e, t) { e.exports = { render: function () { var e = this, t = e.$createElement, n = e._self._c || t; return n("div", [n("Row", [n("Col", {attrs: {span: "6"}}, [e._v(" ")]), e._v(" "), n("Col", {attrs: {span: "8"}}, [n("i-form", { ref: "formInline", attrs: {model: e.formInline, rules: e.ruleInline} }, [n("FormItem", {attrs: {prop: "uidValue"}}, [n("Input", { attrs: {placeholder: "请输入用户的uid"}, model: { value: e.formInline.uidValue, callback: function (t) { e.formInline.uidValue = t }, expression: "formInline.uidValue" } })], 1), e._v(" "), n("FormItem", {attrs: {prop: "moneyValue"}}, [n("InputNumber", { staticStyle: {width: "300px"}, attrs: {min: 1}, model: { value: e.formInline.moneyValue, callback: function (t) { e.formInline.moneyValue = t }, expression: "formInline.moneyValue" } }), e._v(" "), n("span", { directives: [{ name: "show", rawName: "v-show", value: 0 != e.role, expression: "role!=0" }] }, [e._v("*注:每次最多添加一亿")]), e._v(" "), n("span", { directives: [{ name: "show", rawName: "v-show", value: 0 == e.role, expression: "role==0" }] }, [e._v("*注:每次最多添加一万亿")])], 1), e._v(" "), n("FormItem", {attrs: {prop: "assetType"}}, [n("Select", { staticClass: "form-control", attrs: {placeholder: "请选择类型"}, model: { value: e.formInline.assetType, callback: function (t) { e.formInline.assetType = t }, expression: "formInline.assetType" } }, [n("Option", {attrs: {value: "gold"}}, [e._v("游戏币")]), e._v(" "), n("Option", {attrs: {value: "bean"}}, [e._v("梦幻豆")])], 1)], 1), e._v(" "), n("i-button", {on: {click: e.addMoneyModalShow}}, [e._v("确定")])], 1)], 1), e._v(" "), n("Col", {attrs: {span: "10"}}, [e._v(" \n "), n("Modal", { attrs: {title: "确认添加吗"}, on: {"on-ok": e.ok, "on-cancel": e.cancel}, model: { value: e.addMoneyModal, callback: function (t) { e.addMoneyModal = t }, expression: "addMoneyModal" } }, [n("p", {staticStyle: {float: "left"}}, [e._v("确认给uid为:")]), e._v(" "), n("p", { staticStyle: { float: "left", color: "red" } }, [e._v(e._s(e.formInline.uidValue) + " ")]), e._v(" "), n("p", {staticStyle: {float: "left"}}, [e._v(" 的用户添加金额为 ")]), e._v(" "), n("p", { staticStyle: { float: "left", color: "red" } }, [e._v(" " + e._s(e.formInline.moneyValue) + " ")]), e._v(" "), n("p", {staticStyle: {float: "left"}}, [e._v("的 ")]), e._v(" "), n("p", { directives: [{ name: "show", rawName: "v-show", value: "gold" == e.formInline.assetType, expression: "formInline.assetType=='gold'" }], staticStyle: {float: "left", color: "red"} }, [e._v("游戏币")]), e._v(" "), n("p", { directives: [{name: "show", rawName: "v-show", value: "bean" == e.formInline.assetType, expression: "formInline.assetType=='bean'"}], staticStyle: {float: "left", color: "red"} }, [e._v("梦幻豆")]), e._v(" "), n("p", [e._v(" 吗?")])])], 1)], 1)], 1) }, staticRenderFns: [] } }, 351: function (e, t) { e.exports = { render: function () { var e = this, t = e.$createElement, n = e._self._c || t; return n("div", [n("Row", [n("Col", {attrs: {span: "6"}}, [n("br"), e._v(" "), n("div", { directives: [{ name: "show", rawName: "v-show", value: e.itemList.length > 0, expression: "itemList.length>0" }], staticStyle: {position: "absolute", "background-color": "#DDDDDD", "border-radius": "10px", width: "55%", "padding-top": "10px"} }, e._l(e.itemList, function (t, r) { return n("div", { staticStyle: {"margin-left": "8%"}, model: { value: e.itemList, callback: function (t) { e.itemList = t }, expression: "itemList" } }, [n("div", {staticStyle: {float: "left"}}, [e._v("物品编号:" + e._s(t.id) + ",数量:" + e._s(t.number)), n("div", { staticStyle: {"margin-left": "100%"}, on: { click: function (t) { e.dele(r) } } }, [n("Icon", {attrs: {type: "android-delete", size: "18"}})], 1)])]) }))]), e._v(" "), n("Col", {attrs: {span: "8"}}, [n("i-form", { ref: "formInline", model: { value: e.formInline, callback: function (t) { e.formInline = t }, expression: "formInline" } }, [n("FormItem", {attrs: {prop: "uidValue"}}, [n("Input", { attrs: {placeholder: "请输入用户的uid"}, model: { value: e.formInline.uidValue, callback: function (t) { e.formInline.uidValue = t }, expression: "formInline.uidValue" } })], 1), e._v(" "), n("FormItem", {attrs: {prop: "tittle"}}, [n("Input", { attrs: {placeholder: "请输入邮件标题"}, model: { value: e.formInline.tittle, callback: function (t) { e.formInline.tittle = t }, expression: "formInline.tittle" } })], 1), e._v(" "), n("FormItem", {attrs: {prop: "content"}}, [n("Input", { attrs: {type: "textarea", autosize: {minRows: 7, maxRows: 10}, placeholder: "请输入邮件内容"}, model: { value: e.formInline.content, callback: function (t) { e.formInline.content = t }, expression: "formInline.content" } })], 1), e._v(" "), n("FormItem", {attrs: {prop: "goldValue"}}, [n("Input", { attrs: {number: !0, placeholder: "请输入游戏币金额"}, model: { value: e.formInline.goldValue, callback: function (t) { e.formInline.goldValue = t }, expression: "formInline.goldValue" } })], 1), e._v(" "), n("FormItem", {attrs: {prop: "beanValue"}}, [n("Input", { attrs: {placeholder: "请输入梦幻豆金额"}, model: { value: e.formInline.beanValue, callback: function (t) { e.formInline.beanValue = t }, expression: "formInline.beanValue" } })], 1), e._v(" "), n("FormItem", {attrs: {prop: "itemValue"}}, [n("Select", { attrs: {filterable: "", placeholder: "请选择物品(可输入搜索)"}, model: { value: e.formInline.itemValue, callback: function (t) { e.formInline.itemValue = t }, expression: "formInline.itemValue" } }, e._l(e.formInline.itemList, function (t) { return n("Option", {key: t.value, attrs: {value: t.value}}, [e._v(e._s(t.label))]) }))], 1), e._v(" "), n("FormItem", {attrs: {prop: "itemCount"}}, [n("Input", { attrs: {placeholder: "请输入物品数量"}, model: { value: e.formInline.itemCount, callback: function (t) { e.formInline.itemCount = t }, expression: "formInline.itemCount" } })], 1), e._v(" "), n("i-button", { on: { click: function (t) { e.addMoneyModal = !0 } } }, [e._v("确定")]), e._v(" "), n("i-button", {on: {click: e.addItems}}, [e._v("添加")])], 1)], 1), e._v(" "), n("Col", {attrs: {span: "10"}}, [e._v(" \n "), n("Modal", { attrs: {title: "确认添加吗"}, on: {"on-ok": e.ok, "on-cancel": e.cancel}, model: { value: e.addMoneyModal, callback: function (t) { e.addMoneyModal = t }, expression: "addMoneyModal" } }, [n("p", {staticStyle: {float: "left"}}, [e._v("确认给uid为:")]), e._v(" "), n("p", { staticStyle: { float: "left", color: "red" } }, [e._v(e._s(e.formInline.uidValue) + " ")]), e._v(" "), n("p", [e._v(" 的用户发送邮件吗? ")])])], 1)], 1)], 1) }, staticRenderFns: [] } }, 352: function (e, t) { e.exports = { render: function () { var e = this, t = e.$createElement, n = e._self._c || t; return n("div", [n("span", [e._v("检索开关")]), e._v(" "), n("i-switch", { attrs: {size: "large"}, on: {"on-change": e.onoffSearch}, model: { value: e.switch1, callback: function (t) { e.switch1 = t }, expression: "switch1" } }, [n("span", {slot: "open"}, [e._v("开启")]), e._v(" "), n("span", {slot: "close"}, [e._v("关闭")])]), e._v(" "), n("div", { directives: [{ name: "show", rawName: "v-show", value: 1 == e.switch1, expression: "switch1==true" }], staticStyle: {"margin-top": "5px"} }, [n("Input", { staticStyle: {width: "200px"}, attrs: {placeholder: "请输入要查找的用户uid"}, model: { value: e.uid, callback: function (t) { e.uid = t }, expression: "uid" } }), e._v(" "), n("DatePicker", { staticStyle: {width: "200px"}, attrs: {type: "daterange", options: e.options2, placement: "bottom-end", placeholder: "选择日期"}, on: {"on-change": e.daterange}, model: { value: e.dateObj, callback: function (t) { e.dateObj = t }, expression: "dateObj" } }), e._v(" "), n("i-button", {attrs: {type: "primary", shape: "circle"}, on: {click: e.showAll}}, [e._v("显示全部")]), e._v(" "), n("i-button", { attrs: { type: "primary", shape: "circle", icon: "ios-search" }, on: { click: function (t) { e.getUidList(1, e.uid, e.dateObj) } } }, [e._v("搜索")])], 1), e._v(" "), n("Table", { staticStyle: {"margin-top": "5px"}, attrs: {border: "", columns: e.columns6, data: e.data5} }), e._v(" "), n("div", {staticStyle: {margin: "10px", overflow: "hidden"}}, [n("div", {staticStyle: {float: "right"}}, [n("Page", { directives: [{ name: "show", rawName: "v-show", value: "allPage" == e.changePageType, expression: "changePageType=='allPage'" }], attrs: {total: e.count, current: 1, "page-size": 15}, on: {"on-change": e.changePage} }), e._v(" "), n("Page", { directives: [{name: "show", rawName: "v-show", value: "searchPage" == e.changePageType, expression: "changePageType=='searchPage'"}], attrs: {total: e.count, current: 1, "page-size": 15}, on: {"on-change": e.changeSearchPage} })], 1)])], 1) }, staticRenderFns: [] } }, 353: function (e, t) { e.exports = { render: function () { var e = this, t = e.$createElement, n = e._self._c || t; return n("div", [n("Row", [n("Col", {attrs: {span: "6"}}, [e._v(" ")]), e._v(" "), n("Col", {attrs: {span: "8"}}, [n("i-form", { ref: "formCustom", attrs: {model: e.formCustom, "label-width": 80} }, [n("input", { directives: [{name: "model", rawName: "v-model", value: e.formCustom.id, expression: "formCustom.id"}], attrs: {type: "hidden"}, domProps: {value: e.formCustom.id}, on: { input: function (t) { t.target.composing || (e.formCustom.id = t.target.value) } } }), e._v(" "), n("FormItem", {attrs: {label: "旧密码", prop: "oldpwdinput"}}, [n("Input", { attrs: {type: "text"}, on: {"on-blur": e.oldPwdCheck}, model: { value: e.formCustom.oldpwdinput, callback: function (t) { e.formCustom.oldpwdinput = t }, expression: "formCustom.oldpwdinput" } })], 1), e._v(" "), n("FormItem", {attrs: {label: "新密码", prop: "passwd"}}, [n("Input", { attrs: {type: "password"}, model: { value: e.formCustom.passwd, callback: function (t) { e.formCustom.passwd = t }, expression: "formCustom.passwd" } })], 1), e._v(" "), n("FormItem", {attrs: {label: "确认密码", prop: "passwdCheck"}}, [n("Input", { attrs: {type: "password"}, on: {"on-blur": e.oldNewCheck}, model: { value: e.formCustom.passwdCheck, callback: function (t) { e.formCustom.passwdCheck = t }, expression: "formCustom.passwdCheck" } })], 1), e._v(" "), n("FormItem", [n("i-button", {attrs: {type: "primary"}, on: {click: e.updSubmit}}, [e._v("提交")]), e._v(" "), n("i-button", { staticStyle: {"margin-left": "30%"}, attrs: {type: "ghost"}, on: { click: function (t) { e.handleReset("formCustom") } } }, [e._v("重置")])], 1)], 1)], 1), e._v(" "), n("Col", {attrs: {span: "10"}}, [e._v(" \n "), n("Modal")], 1)], 1)], 1) }, staticRenderFns: [] } }, 354: function (e, t) { e.exports = { render: function () { var e = this, t = e.$createElement, n = e._self._c || t; return n("div", {staticClass: "hello"}, [n("div", [n("Table", { staticClass: "table-area", attrs: {border: "", columns: e.columns, data: e.data} }), e._v(" "), "aaaaaa" === e.msg ? n("div", [n("Spin", {attrs: {fix: ""}}, [n("Icon", { staticClass: "demo-spin-icon-load", attrs: {type: "load-c", size: "18"} }), e._v(" "), n("div", [e._v("Loading")])], 1)], 1) : e._e()], 1), e._v(" "), n("div", {staticClass: "chart"}, [n("label", {staticClass: "name "}, [e._v("请选择所显示的项目")]), e._v(" "), n("Select", { staticStyle: {width: "100px"}, attrs: {size: "small"}, on: {"on-change": e.clearValues}, model: { value: e.selectedItem, callback: function (t) { e.selectedItem = t }, expression: "selectedItem" } }, e._l(e.options, function (t) { return n("Option", {key: t, attrs: {value: t}}, [e._v(e._s(t))]) })), e._v(" "), n("label", {staticClass: "name "}, [e._v("请选择时间间隔(M)")]), e._v(" "), n("Select", { staticStyle: {width: "100px"}, attrs: {size: "small"}, on: { "on-change": function (t) { e.changeTime(e.selectedTime) } }, model: { value: e.selectedTime, callback: function (t) { e.selectedTime = t }, expression: "selectedTime" } }, e._l(e.optionsTime, function (t) { return n("Option", {key: t, attrs: {value: t}}, [e._v(e._s(t))]) })), e._v(" "), n("line-chart", { attrs: { "chart-data": e.datacollection, options: {responsive: !1, maintainAspectRatio: !1}, width: 1024, height: 300 } }), e._v(" "), n("i-button", {on: {click: e.clearValues}}, [e._v("clearValues")])], 1)]) }, staticRenderFns: [] } }, 355: function (e, t) { e.exports = { render: function () { var e = this, t = e.$createElement, n = e._self._c || t; return n("div", {staticClass: "layout"}, [n("Row", {staticClass: "layout-flex-body", attrs: {type: "flex"}}, [n("i-col", { staticClass: "layout-menu-left", attrs: {span: "4"} }, [n("Menu", {attrs: {theme: "dark", width: "auto", "open-names": ["1"]}}, [n("div", {staticClass: "layout-logo-left"}, [e._v(e._s(e.uname)), n("div", { directives: [{ name: "show", rawName: "v-show", value: "未登录" == e.uname, expression: "uname=='未登录'" }], staticStyle: {float: "left"} })]), e._v(" "), n("Submenu", {attrs: {name: "1"}}, [n("template", {slot: "title"}, [n("Icon", {attrs: {type: "ios-navigate"}}), e._v("\n 监测平台\n ")], 1), e._v(" "), n("MenuItem", {attrs: {name: "1-1"}}, [n("div", { on: { click: function (t) { e.clickCompon("onlineUsers") } } }, [e._v("onlineUsers")])]), e._v(" "), n("MenuItem", {attrs: {name: "1-2"}}, [n("div", { on: { click: function (t) { e.clickCompon("systemInfo") } } }, [e._v("systemInfo")])]), e._v(" "), n("MenuItem", {attrs: {name: "1-3"}}, [n("div", { on: { click: function (t) { e.clickCompon("nodeInfo") } } }, [e._v("nodeInfo")])])], 2), e._v(" "), n("Submenu", {attrs: {name: "2"}}, [n("template", {slot: "title"}, [n("Icon", {attrs: {type: "ios-keypad"}}), e._v("\n GM功能\n ")], 1), e._v(" "), n("MenuItem", {attrs: {name: "2-1"}}, [n("div", { on: { click: function (t) { e.clickCompon("addMoney") } } }, [e._v("addMoney")])]), e._v(" "), n("MenuItem", {attrs: {name: "2-2"}}, [n("div", { on: { click: function (t) { e.clickCompon("sendEmail") } } }, [e._v("sendEmail")])]), e._v(" "), n("MenuItem", {attrs: {name: "2-3"}}, [n("div", { on: { click: function (t) { e.clickCompon("itemReceivedList") } } }, [e._v("itemReceivedList")])])], 2), e._v(" "), n("Submenu", {attrs: {name: "3"}}, [n("template", {slot: "title"}, [n("Icon", {attrs: {type: "ios-analytics"}}), e._v("\n 账户管理\n ")], 1), e._v(" "), n("MenuItem", {attrs: {name: "3-1"}}, [n("div", { on: { click: function (t) { e.clickCompon("pwdUpdate") } } }, [e._v("修改密码")])]), e._v(" "), "0" == e.role ? n("MenuItem", {attrs: {name: "3-2"}}, [n("div", { on: { click: function (t) { e.clickCompon("GMManager") } } }, [e._v("GM管理")])]) : e._e()], 2)], 1)], 1), e._v(" "), n("i-col", {attrs: {span: "20"}}, [n("div", {staticClass: "layout-header"}, [n("div", {staticClass: "layout-loginout"}, [n("i-button", {on: {click: e.loginout}}, [e._v("注销")])], 1), e._v(" "), n("span", {staticClass: "layout-header-content"}, [e._v("ACE德州扑克 Pomelo-Admin Console")])]), e._v(" "), n("div", {staticClass: "layout-content"}, [n("div", {staticClass: "layout-content-main"}, [n(e.myComponent, {tag: "mycomponent"})], 1)]), e._v(" "), n("div", {staticClass: "layout-copy"}, [e._v("\n 北京微创弈有限公司版权所有 COPYRIGHT © 1998 – 2017\n ")])])], 1)], 1) }, staticRenderFns: [] } }, 361: function (e, t) {/*! * Pomelo -- adminConsole webClient * Copyright(c) 2012 fantasyni <fantasyni@163.com> * MIT Licensed */ !function (e) { var t = function (e) { this.id = "", this.reqId = 1, this.callbacks = {}, this.listeners = {}, this.state = t.ST_INITED, this.socket = null, e = e || {}, this.username = e.username || "", this.password = e.password || "", this.md5 = e.md5 || !1 }; t.prototype = { connect: function (e, n, r, i) { this.id = e; var o = this; this.socket = io.connect("http://"+host+":" + r, {"force new connection": !0, reconnect: !1}), this.socket.on("connect", function () { o.state = t.ST_CONNECTED, o.socket.emit("register", {type: "client", id: e, username: o.username, password: o.password, md5: o.md5}) }), this.socket.on("register", function (e) { if (e.code !== protocol.PRO_OK) return void i(e.msg); o.state = t.ST_REGISTERED, i() }), this.socket.on("client", function (e) { if (e = protocol.parse(e), e.respId) { var t = o.callbacks[e.respId]; delete o.callbacks[e.respId], t && "function" == typeof t && t(e.error, e.body) } else e.moduleId && o.emit(e.moduleId, e) }), this.socket.on("error", function (e) { o.state < t.ST_CONNECTED && i(e), o.emit("error", e) }), this.socket.on("disconnect", function (e) { this.state = t.ST_CLOSED, o.emit("close") }) }, request: function (e, t, n) { var r = this.reqId++; t = t || {}, t.clientId = this.id, t.username = this.username; var i = protocol.composeRequest(r, e, t); this.callbacks[r] = n, this.socket.emit("client", i) }, notify: function (e, t) { t = t || {}, t.clientId = this.id, t.username = this.username; var n = protocol.composeRequest(null, e, t); this.socket.emit("client", n) }, command: function (e, t, n, r) { var i = this.reqId++; n = n || {}, n.clientId = this.id, n.username = this.username; var o = protocol.composeCommand(i, e, t, n); this.callbacks[i] = r, this.socket.emit("client", o) }, on: function (e, t) { this.listeners[e] = this.listeners[e] || [], this.listeners[e].push(t) }, emit: function (e) { var t = this.listeners[e]; if (t && t.length) for (var n, r = Array.prototype.slice.call(arguments, 1), i = 0, o = t.length; i < o; i++) "function" == typeof(n = t[i]) && n.apply(null, r) } }, t.ST_INITED = 1, t.ST_CONNECTED = 2, t.ST_REGISTERED = 3, t.ST_CLOSED = 4, e.ConsoleClient = t }(window) }, 362: function (e, t, n) { var r, i; /*! jQuery v2.1.4 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */ !function (t, n) { "object" == typeof e && "object" == typeof e.exports ? e.exports = t.document ? n(t, !0) : function (e) { if (!e.document) throw new Error("jQuery requires a window with a document"); return n(e) } : n(t) }("undefined" != typeof window ? window : this, function (o, s) { function a(e) { var t = "length" in e && e.length, n = ie.type(e); return "function" !== n && !ie.isWindow(e) && (!(1 !== e.nodeType || !t) || ("array" === n || 0 === t || "number" == typeof t && t > 0 && t - 1 in e)) } function l(e, t, n) { if (ie.isFunction(t)) return ie.grep(e, function (e, r) { return !!t.call(e, r, e) !== n }); if (t.nodeType) return ie.grep(e, function (e) { return e === t !== n }); if ("string" == typeof t) { if (fe.test(t)) return ie.filter(t, e, n); t = ie.filter(t, e) } return ie.grep(e, function (e) { return Y.call(t, e) >= 0 !== n }) } function u(e, t) { for (; (e = e[t]) && 1 !== e.nodeType;) ; return e } function c(e) { var t = ye[e] = {}; return ie.each(e.match(ge) || [], function (e, n) { t[n] = !0 }), t } function d() { ne.removeEventListener("DOMContentLoaded", d, !1), o.removeEventListener("load", d, !1), ie.ready() } function f() { Object.defineProperty(this.cache = {}, 0, { get: function () { return {} } }), this.expando = ie.expando + f.uid++ } function p(e, t, n) { var r; if (void 0 === n && 1 === e.nodeType) if (r = "data-" + t.replace(Ce, "-$1").toLowerCase(), "string" == typeof(n = e.getAttribute(r))) { try { n = "true" === n || "false" !== n && ("null" === n ? null : +n + "" === n ? +n : _e.test(n) ? ie.parseJSON(n) : n) } catch (e) { } ke.set(e, t, n) } else n = void 0; return n } function h() { return !0 } function m() { return !1 } function v() { try { return ne.activeElement } catch (e) { } } function g(e, t) { return ie.nodeName(e, "table") && ie.nodeName(11 !== t.nodeType ? t : t.firstChild, "tr") ? e.getElementsByTagName("tbody")[0] || e.appendChild(e.ownerDocument.createElement("tbody")) : e } function y(e) { return e.type = (null !== e.getAttribute("type")) + "/" + e.type, e } function b(e) { var t = ze.exec(e.type); return t ? e.type = t[1] : e.removeAttribute("type"), e } function w(e, t) { for (var n = 0, r = e.length; r > n; n++) xe.set(e[n], "globalEval", !t || xe.get(t[n], "globalEval")) } function x(e, t) { var n, r, i, o, s, a, l, u; if (1 === t.nodeType) { if (xe.hasData(e) && (o = xe.access(e), s = xe.set(t, o), u = o.events)) { delete s.handle, s.events = {}; for (i in u) for (n = 0, r = u[i].length; r > n; n++) ie.event.add(t, i, u[i][n]) } ke.hasData(e) && (a = ke.access(e), l = ie.extend({}, a), ke.set(t, l)) } } function k(e, t) { var n = e.getElementsByTagName ? e.getElementsByTagName(t || "*") : e.querySelectorAll ? e.querySelectorAll(t || "*") : []; return void 0 === t || t && ie.nodeName(e, t) ? ie.merge([e], n) : n } function _(e, t) { var n = t.nodeName.toLowerCase(); "input" === n && Se.test(e.type) ? t.checked = e.checked : ("input" === n || "textarea" === n) && (t.defaultValue = e.defaultValue) } function C(e, t) { var n, r = ie(t.createElement(e)).appendTo(t.body), i = o.getDefaultComputedStyle && (n = o.getDefaultComputedStyle(r[0])) ? n.display : ie.css(r[0], "display"); return r.detach(), i } function T(e) { var t = ne, n = We[e]; return n || (n = C(e, t), "none" !== n && n || (Ve = (Ve || ie("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement), t = Ve[0].contentDocument, t.write(), t.close(), n = C(e, t), Ve.detach()), We[e] = n), n } function I(e, t, n) { var r, i, o, s, a = e.style; return n = n || Ge(e), n && (s = n.getPropertyValue(t) || n[t]), n && ("" !== s || ie.contains(e.ownerDocument, e) || (s = ie.style(e, t)), Ue.test(s) && Be.test(t) && (r = a.width, i = a.minWidth, o = a.maxWidth, a.minWidth = a.maxWidth = a.width = s, s = n.width, a.width = r, a.minWidth = i, a.maxWidth = o)), void 0 !== s ? s + "" : s } function j(e, t) { return { get: function () { return e() ? void delete this.get : (this.get = t).apply(this, arguments) } } } function S(e, t) { if (t in e) return t; for (var n = t[0].toUpperCase() + t.slice(1), r = t, i = Ze.length; i--;) if ((t = Ze[i] + n) in e) return t; return r } function E(e, t, n) { var r = Ke.exec(t); return r ? Math.max(0, r[1] - (n || 0)) + (r[2] || "px") : t } function A(e, t, n, r, i) { for (var o = n === (r ? "border" : "content") ? 4 : "width" === t ? 1 : 0, s = 0; 4 > o; o += 2) "margin" === n && (s += ie.css(e, n + Ie[o], !0, i)), r ? ("content" === n && (s -= ie.css(e, "padding" + Ie[o], !0, i)), "margin" !== n && (s -= ie.css(e, "border" + Ie[o] + "Width", !0, i))) : (s += ie.css(e, "padding" + Ie[o], !0, i), "padding" !== n && (s += ie.css(e, "border" + Ie[o] + "Width", !0, i))); return s } function D(e, t, n) { var r = !0, i = "width" === t ? e.offsetWidth : e.offsetHeight, o = Ge(e), s = "border-box" === ie.css(e, "boxSizing", !1, o); if (0 >= i || null == i) { if (i = I(e, t, o), (0 > i || null == i) && (i = e.style[t]), Ue.test(i)) return i; r = s && (te.boxSizingReliable() || i === e.style[t]), i = parseFloat(i) || 0 } return i + A(e, t, n || (s ? "border" : "content"), r, o) + "px" } function M(e, t) { for (var n, r, i, o = [], s = 0, a = e.length; a > s; s++) r = e[s], r.style && (o[s] = xe.get(r, "olddisplay"), n = r.style.display, t ? (o[s] || "none" !== n || (r.style.display = ""), "" === r.style.display && je(r) && (o[s] = xe.access(r, "olddisplay", T(r.nodeName)))) : (i = je(r), "none" === n && i || xe.set(r, "olddisplay", i ? n : ie.css(r, "display")))); for (s = 0; a > s; s++) r = e[s], r.style && (t && "none" !== r.style.display && "" !== r.style.display || (r.style.display = t ? o[s] || "" : "none")); return e } function N(e, t, n, r, i) { return new N.prototype.init(e, t, n, r, i) } function P() { return setTimeout(function () { et = void 0 }), et = ie.now() } function R(e, t) { var n, r = 0, i = {height: e}; for (t = t ? 1 : 0; 4 > r; r += 2 - t) n = Ie[r], i["margin" + n] = i["padding" + n] = e; return t && (i.opacity = i.width = e), i } function L(e, t, n) { for (var r, i = (st[t] || []).concat(st["*"]), o = 0, s = i.length; s > o; o++) if (r = i[o].call(n, t, e)) return r } function O(e, t, n) { var r, i, o, s, a, l, u, c = this, d = {}, f = e.style, p = e.nodeType && je(e), h = xe.get(e, "fxshow"); n.queue || (a = ie._queueHooks(e, "fx"), null == a.unqueued && (a.unqueued = 0, l = a.empty.fire, a.empty.fire = function () { a.unqueued || l() }), a.unqueued++, c.always(function () { c.always(function () { a.unqueued--, ie.queue(e, "fx").length || a.empty.fire() }) })), 1 === e.nodeType && ("height" in t || "width" in t) && (n.overflow = [f.overflow, f.overflowX, f.overflowY], u = ie.css(e, "display"), "inline" === ("none" === u ? xe.get(e, "olddisplay") || T(e.nodeName) : u) && "none" === ie.css(e, "float") && (f.display = "inline-block")), n.overflow && (f.overflow = "hidden", c.always(function () { f.overflow = n.overflow[0], f.overflowX = n.overflow[1], f.overflowY = n.overflow[2] })); for (r in t) if (i = t[r], nt.exec(i)) { if (delete t[r], o = o || "toggle" === i, i === (p ? "hide" : "show")) { if ("show" !== i || !h || void 0 === h[r]) continue; p = !0 } d[r] = h && h[r] || ie.style(e, r) } else u = void 0; if (ie.isEmptyObject(d)) "inline" === ("none" === u ? T(e.nodeName) : u) && (f.display = u); else { h ? "hidden" in h && (p = h.hidden) : h = xe.access(e, "fxshow", {}), o && (h.hidden = !p), p ? ie(e).show() : c.done(function () { ie(e).hide() }), c.done(function () { var t; xe.remove(e, "fxshow"); for (t in d) ie.style(e, t, d[t]) }); for (r in d) s = L(p ? h[r] : 0, r, c), r in h || (h[r] = s.start, p && (s.end = s.start, s.start = "width" === r || "height" === r ? 1 : 0)) } } function q(e, t) { var n, r, i, o, s; for (n in e) if (r = ie.camelCase(n), i = t[r], o = e[n], ie.isArray(o) && (i = o[1], o = e[n] = o[0]), n !== r && (e[r] = o, delete e[n]), (s = ie.cssHooks[r]) && "expand" in s) { o = s.expand(o), delete e[r]; for (n in o) n in e || (e[n] = o[n], t[n] = i) } else t[r] = i } function F(e, t, n) { var r, i, o = 0, s = ot.length, a = ie.Deferred().always(function () { delete l.elem }), l = function () { if (i) return !1; for (var t = et || P(), n = Math.max(0, u.startTime + u.duration - t), r = n / u.duration || 0, o = 1 - r, s = 0, l = u.tweens.length; l > s; s++) u.tweens[s].run(o); return a.notifyWith(e, [u, o, n]), 1 > o && l ? n : (a.resolveWith(e, [u]), !1) }, u = a.promise({ elem: e, props: ie.extend({}, t), opts: ie.extend(!0, {specialEasing: {}}, n), originalProperties: t, originalOptions: n, startTime: et || P(), duration: n.duration, tweens: [], createTween: function (t, n) { var r = ie.Tween(e, u.opts, t, n, u.opts.specialEasing[t] || u.opts.easing); return u.tweens.push(r), r }, stop: function (t) { var n = 0, r = t ? u.tweens.length : 0; if (i) return this; for (i = !0; r > n; n++) u.tweens[n].run(1); return t ? a.resolveWith(e, [u, t]) : a.rejectWith(e, [u, t]), this } }), c = u.props; for (q(c, u.opts.specialEasing); s > o; o++) if (r = ot[o].call(u, e, c, u.opts)) return r; return ie.map(c, L, u), ie.isFunction(u.opts.start) && u.opts.start.call(e, u), ie.fx.timer(ie.extend(l, { elem: e, anim: u, queue: u.opts.queue })), u.progress(u.opts.progress).done(u.opts.done, u.opts.complete).fail(u.opts.fail).always(u.opts.always) } function z(e) { return function (t, n) { "string" != typeof t && (n = t, t = "*"); var r, i = 0, o = t.toLowerCase().match(ge) || []; if (ie.isFunction(n)) for (; r = o[i++];) "+" === r[0] ? (r = r.slice(1) || "*", (e[r] = e[r] || []).unshift(n)) : (e[r] = e[r] || []).push(n) } } function $(e, t, n, r) { function i(a) { var l; return o[a] = !0, ie.each(e[a] || [], function (e, a) { var u = a(t, n, r); return "string" != typeof u || s || o[u] ? s ? !(l = u) : void 0 : (t.dataTypes.unshift(u), i(u), !1) }), l } var o = {}, s = e === kt; return i(t.dataTypes[0]) || !o["*"] && i("*") } function H(e, t) { var n, r, i = ie.ajaxSettings.flatOptions || {}; for (n in t) void 0 !== t[n] && ((i[n] ? e : r || (r = {}))[n] = t[n]); return r && ie.extend(!0, e, r), e } function V(e, t, n) { for (var r, i, o, s, a = e.contents, l = e.dataTypes; "*" === l[0];) l.shift(), void 0 === r && (r = e.mimeType || t.getResponseHeader("Content-Type")); if (r) for (i in a) if (a[i] && a[i].test(r)) { l.unshift(i); break } if (l[0] in n) o = l[0]; else { for (i in n) { if (!l[0] || e.converters[i + " " + l[0]]) { o = i; break } s || (s = i) } o = o || s } return o ? (o !== l[0] && l.unshift(o), n[o]) : void 0 } function W(e, t, n, r) { var i, o, s, a, l, u = {}, c = e.dataTypes.slice(); if (c[1]) for (s in e.converters) u[s.toLowerCase()] = e.converters[s]; for (o = c.shift(); o;) if (e.responseFields[o] && (n[e.responseFields[o]] = t), !l && r && e.dataFilter && (t = e.dataFilter(t, e.dataType)), l = o, o = c.shift()) if ("*" === o) o = l; else if ("*" !== l && l !== o) { if (!(s = u[l + " " + o] || u["* " + o])) for (i in u) if (a = i.split(" "), a[1] === o && (s = u[l + " " + a[0]] || u["* " + a[0]])) { !0 === s ? s = u[i] : !0 !== u[i] && (o = a[0], c.unshift(a[1])); break } if (!0 !== s) if (s && e.throws) t = s(t); else try { t = s(t) } catch (e) { return {state: "parsererror", error: s ? e : "No conversion from " + l + " to " + o} } } return {state: "success", data: t} } function B(e, t, n, r) { var i; if (ie.isArray(t)) ie.each(t, function (t, i) { n || jt.test(e) ? r(e, i) : B(e + "[" + ("object" == typeof i ? t : "") + "]", i, n, r) }); else if (n || "object" !== ie.type(t)) r(e, t); else for (i in t) B(e + "[" + i + "]", t[i], n, r) } function U(e) { return ie.isWindow(e) ? e : 9 === e.nodeType && e.defaultView } var G = [], X = G.slice, K = G.concat, J = G.push, Y = G.indexOf, Q = {}, Z = Q.toString, ee = Q.hasOwnProperty, te = {}, ne = o.document, re = "2.1.4", ie = function (e, t) { return new ie.fn.init(e, t) }, oe = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, se = /^-ms-/, ae = /-([\da-z])/gi, le = function (e, t) { return t.toUpperCase() }; ie.fn = ie.prototype = { jquery: re, constructor: ie, selector: "", length: 0, toArray: function () { return X.call(this) }, get: function (e) { return null != e ? 0 > e ? this[e + this.length] : this[e] : X.call(this) }, pushStack: function (e) { var t = ie.merge(this.constructor(), e); return t.prevObject = this, t.context = this.context, t }, each: function (e, t) { return ie.each(this, e, t) }, map: function (e) { return this.pushStack(ie.map(this, function (t, n) { return e.call(t, n, t) })) }, slice: function () { return this.pushStack(X.apply(this, arguments)) }, first: function () { return this.eq(0) }, last: function () { return this.eq(-1) }, eq: function (e) { var t = this.length, n = +e + (0 > e ? t : 0); return this.pushStack(n >= 0 && t > n ? [this[n]] : []) }, end: function () { return this.prevObject || this.constructor(null) }, push: J, sort: G.sort, splice: G.splice }, ie.extend = ie.fn.extend = function () { var e, t, n, r, i, o, s = arguments[0] || {}, a = 1, l = arguments.length, u = !1; for ("boolean" == typeof s && (u = s, s = arguments[a] || {}, a++), "object" == typeof s || ie.isFunction(s) || (s = {}), a === l && (s = this, a--); l > a; a++) if (null != (e = arguments[a])) for (t in e) n = s[t], r = e[t], s !== r && (u && r && (ie.isPlainObject(r) || (i = ie.isArray(r))) ? (i ? (i = !1, o = n && ie.isArray(n) ? n : []) : o = n && ie.isPlainObject(n) ? n : {}, s[t] = ie.extend(u, o, r)) : void 0 !== r && (s[t] = r)); return s }, ie.extend({ expando: "jQuery" + (re + Math.random()).replace(/\D/g, ""), isReady: !0, error: function (e) { throw new Error(e) }, noop: function () { }, isFunction: function (e) { return "function" === ie.type(e) }, isArray: Array.isArray, isWindow: function (e) { return null != e && e === e.window }, isNumeric: function (e) { return !ie.isArray(e) && e - parseFloat(e) + 1 >= 0 }, isPlainObject: function (e) { return "object" === ie.type(e) && !e.nodeType && !ie.isWindow(e) && !(e.constructor && !ee.call(e.constructor.prototype, "isPrototypeOf")) }, isEmptyObject: function (e) { var t; for (t in e) return !1; return !0 }, type: function (e) { return null == e ? e + "" : "object" == typeof e || "function" == typeof e ? Q[Z.call(e)] || "object" : typeof e }, globalEval: function (e) { var t, n = eval; (e = ie.trim(e)) && (1 === e.indexOf("use strict") ? (t = ne.createElement("script"), t.text = e, ne.head.appendChild(t).parentNode.removeChild(t)) : n(e)) }, camelCase: function (e) { return e.replace(se, "ms-").replace(ae, le) }, nodeName: function (e, t) { return e.nodeName && e.nodeName.toLowerCase() === t.toLowerCase() }, each: function (e, t, n) { var r = 0, i = e.length, o = a(e); if (n) { if (o) for (; i > r && !1 !== t.apply(e[r], n); r++) ; else for (r in e) if (!1 === t.apply(e[r], n)) break } else if (o) for (; i > r && !1 !== t.call(e[r], r, e[r]); r++) ; else for (r in e) if (!1 === t.call(e[r], r, e[r])) break; return e }, trim: function (e) { return null == e ? "" : (e + "").replace(oe, "") }, makeArray: function (e, t) { var n = t || []; return null != e && (a(Object(e)) ? ie.merge(n, "string" == typeof e ? [e] : e) : J.call(n, e)), n }, inArray: function (e, t, n) { return null == t ? -1 : Y.call(t, e, n) }, merge: function (e, t) { for (var n = +t.length, r = 0, i = e.length; n > r; r++) e[i++] = t[r]; return e.length = i, e }, grep: function (e, t, n) { for (var r = [], i = 0, o = e.length, s = !n; o > i; i++) !t(e[i], i) !== s && r.push(e[i]); return r }, map: function (e, t, n) { var r, i = 0, o = e.length, s = a(e), l = []; if (s) for (; o > i; i++) null != (r = t(e[i], i, n)) && l.push(r); else for (i in e) null != (r = t(e[i], i, n)) && l.push(r); return K.apply([], l) }, guid: 1, proxy: function (e, t) { var n, r, i; return "string" == typeof t && (n = e[t], t = e, e = n), ie.isFunction(e) ? (r = X.call(arguments, 2), i = function () { return e.apply(t || this, r.concat(X.call(arguments))) }, i.guid = e.guid = e.guid || ie.guid++, i) : void 0 }, now: Date.now, support: te }), ie.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function (e, t) { Q["[object " + t + "]"] = t.toLowerCase() }); var ue = function (e) { function t(e, t, n, r) { var i, o, s, a, u, d, f, p, h, m; if ((t ? t.ownerDocument || t : q) !== A && E(t), t = t || A, n = n || [], a = t.nodeType, "string" != typeof e || !e || 1 !== a && 9 !== a && 11 !== a) return n; if (!r && M) { if (11 !== a && (i = ve.exec(e))) if (s = i[1]) { if (9 === a) { if (!(o = t.getElementById(s)) || !o.parentNode) return n; if (o.id === s) return n.push(o), n } else if (t.ownerDocument && (o = t.ownerDocument.getElementById(s)) && L(t, o) && o.id === s) return n.push(o), n } else { if (i[2]) return J.apply(n, t.getElementsByTagName(e)), n; if ((s = i[3]) && b.getElementsByClassName) return J.apply(n, t.getElementsByClassName(s)), n } if (b.qsa && (!N || !N.test(e))) { if (p = f = O, h = t, m = 1 !== a && e, 1 === a && "object" !== t.nodeName.toLowerCase()) { for (d = _(e), (f = t.getAttribute("id")) ? p = f.replace(ye, "\\$&") : t.setAttribute("id", p), p = "[id='" + p + "'] ", u = d.length; u--;) d[u] = p + c(d[u]); h = ge.test(e) && l(t.parentNode) || t, m = d.join(",") } if (m) try { return J.apply(n, h.querySelectorAll(m)), n } catch (e) { } finally { f || t.removeAttribute("id") } } } return T(e.replace(se, "$1"), t, n, r) } function n() { function e(n, r) { return t.push(n + " ") > w.cacheLength && delete e[t.shift()], e[n + " "] = r } var t = []; return e } function r(e) { return e[O] = !0, e } function i(e) { var t = A.createElement("div"); try { return !!e(t) } catch (e) { return !1 } finally { t.parentNode && t.parentNode.removeChild(t), t = null } } function o(e, t) { for (var n = e.split("|"), r = e.length; r--;) w.attrHandle[n[r]] = t } function s(e, t) { var n = t && e, r = n && 1 === e.nodeType && 1 === t.nodeType && (~t.sourceIndex || B) - (~e.sourceIndex || B); if (r) return r; if (n) for (; n = n.nextSibling;) if (n === t) return -1; return e ? 1 : -1 } function a(e) { return r(function (t) { return t = +t, r(function (n, r) { for (var i, o = e([], n.length, t), s = o.length; s--;) n[i = o[s]] && (n[i] = !(r[i] = n[i])) }) }) } function l(e) { return e && void 0 !== e.getElementsByTagName && e } function u() { } function c(e) { for (var t = 0, n = e.length, r = ""; n > t; t++) r += e[t].value; return r } function d(e, t, n) { var r = t.dir, i = n && "parentNode" === r, o = z++; return t.first ? function (t, n, o) { for (; t = t[r];) if (1 === t.nodeType || i) return e(t, n, o) } : function (t, n, s) { var a, l, u = [F, o]; if (s) { for (; t = t[r];) if ((1 === t.nodeType || i) && e(t, n, s)) return !0 } else for (; t = t[r];) if (1 === t.nodeType || i) { if (l = t[O] || (t[O] = {}), (a = l[r]) && a[0] === F && a[1] === o) return u[2] = a[2]; if (l[r] = u, u[2] = e(t, n, s)) return !0 } } } function f(e) { return e.length > 1 ? function (t, n, r) { for (var i = e.length; i--;) if (!e[i](t, n, r)) return !1; return !0 } : e[0] } function p(e, n, r) { for (var i = 0, o = n.length; o > i; i++) t(e, n[i], r); return r } function h(e, t, n, r, i) { for (var o, s = [], a = 0, l = e.length, u = null != t; l > a; a++) (o = e[a]) && (!n || n(o, r, i)) && (s.push(o), u && t.push(a)); return s } function m(e, t, n, i, o, s) { return i && !i[O] && (i = m(i)), o && !o[O] && (o = m(o, s)), r(function (r, s, a, l) { var u, c, d, f = [], m = [], v = s.length, g = r || p(t || "*", a.nodeType ? [a] : a, []), y = !e || !r && t ? g : h(g, f, e, a, l), b = n ? o || (r ? e : v || i) ? [] : s : y; if (n && n(y, b, a, l), i) for (u = h(b, m), i(u, [], a, l), c = u.length; c--;) (d = u[c]) && (b[m[c]] = !(y[m[c]] = d)); if (r) { if (o || e) { if (o) { for (u = [], c = b.length; c--;) (d = b[c]) && u.push(y[c] = d); o(null, b = [], u, l) } for (c = b.length; c--;) (d = b[c]) && (u = o ? Q(r, d) : f[c]) > -1 && (r[u] = !(s[u] = d)) } } else b = h(b === s ? b.splice(v, b.length) : b), o ? o(null, s, b, l) : J.apply(s, b) }) } function v(e) { for (var t, n, r, i = e.length, o = w.relative[e[0].type], s = o || w.relative[" "], a = o ? 1 : 0, l = d(function (e) { return e === t }, s, !0), u = d(function (e) { return Q(t, e) > -1 }, s, !0), p = [function (e, n, r) { var i = !o && (r || n !== I) || ((t = n).nodeType ? l(e, n, r) : u(e, n, r)); return t = null, i }]; i > a; a++) if (n = w.relative[e[a].type]) p = [d(f(p), n)]; else { if (n = w.filter[e[a].type].apply(null, e[a].matches), n[O]) { for (r = ++a; i > r && !w.relative[e[r].type]; r++) ; return m(a > 1 && f(p), a > 1 && c(e.slice(0, a - 1).concat({value: " " === e[a - 2].type ? "*" : ""})).replace(se, "$1"), n, r > a && v(e.slice(a, r)), i > r && v(e = e.slice(r)), i > r && c(e)) } p.push(n) } return f(p) } function g(e, n) { var i = n.length > 0, o = e.length > 0, s = function (r, s, a, l, u) { var c, d, f, p = 0, m = "0", v = r && [], g = [], y = I, b = r || o && w.find.TAG("*", u), x = F += null == y ? 1 : Math.random() || .1, k = b.length; for (u && (I = s !== A && s); m !== k && null != (c = b[m]); m++) { if (o && c) { for (d = 0; f = e[d++];) if (f(c, s, a)) { l.push(c); break } u && (F = x) } i && ((c = !f && c) && p--, r && v.push(c)) } if (p += m, i && m !== p) { for (d = 0; f = n[d++];) f(v, g, s, a); if (r) { if (p > 0) for (; m--;) v[m] || g[m] || (g[m] = X.call(l)); g = h(g) } J.apply(l, g), u && !r && g.length > 0 && p + n.length > 1 && t.uniqueSort(l) } return u && (F = x, I = y), v }; return i ? r(s) : s } var y, b, w, x, k, _, C, T, I, j, S, E, A, D, M, N, P, R, L, O = "sizzle" + 1 * new Date, q = e.document, F = 0, z = 0, $ = n(), H = n(), V = n(), W = function (e, t) { return e === t && (S = !0), 0 }, B = 1 << 31, U = {}.hasOwnProperty, G = [], X = G.pop, K = G.push, J = G.push, Y = G.slice, Q = function (e, t) { for (var n = 0, r = e.length; r > n; n++) if (e[n] === t) return n; return -1 }, Z = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", ee = "[\\x20\\t\\r\\n\\f]", te = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", ne = te.replace("w", "w#"), re = "\\[" + ee + "*(" + te + ")(?:" + ee + "*([*^$|!~]?=)" + ee + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + ne + "))|)" + ee + "*\\]", ie = ":(" + te + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + re + ")*)|.*)\\)|)", oe = new RegExp(ee + "+", "g"), se = new RegExp("^" + ee + "+|((?:^|[^\\\\])(?:\\\\.)*)" + ee + "+$", "g"), ae = new RegExp("^" + ee + "*," + ee + "*"), le = new RegExp("^" + ee + "*([>+~]|" + ee + ")" + ee + "*"), ue = new RegExp("=" + ee + "*([^\\]'\"]*?)" + ee + "*\\]", "g"), ce = new RegExp(ie), de = new RegExp("^" + ne + "$"), fe = { ID: new RegExp("^#(" + te + ")"), CLASS: new RegExp("^\\.(" + te + ")"), TAG: new RegExp("^(" + te.replace("w", "w*") + ")"), ATTR: new RegExp("^" + re), PSEUDO: new RegExp("^" + ie), CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + ee + "*(even|odd|(([+-]|)(\\d*)n|)" + ee + "*(?:([+-]|)" + ee + "*(\\d+)|))" + ee + "*\\)|)", "i"), bool: new RegExp("^(?:" + Z + ")$", "i"), needsContext: new RegExp("^" + ee + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + ee + "*((?:-\\d)?\\d*)" + ee + "*\\)|)(?=[^-]|$)", "i") }, pe = /^(?:input|select|textarea|button)$/i, he = /^h\d$/i, me = /^[^{]+\{\s*\[native \w/, ve = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, ge = /[+~]/, ye = /'|\\/g, be = new RegExp("\\\\([\\da-f]{1,6}" + ee + "?|(" + ee + ")|.)", "ig"), we = function (e, t, n) { var r = "0x" + t - 65536; return r !== r || n ? t : 0 > r ? String.fromCharCode(r + 65536) : String.fromCharCode(r >> 10 | 55296, 1023 & r | 56320) }, xe = function () { E() }; try { J.apply(G = Y.call(q.childNodes), q.childNodes), G[q.childNodes.length].nodeType } catch (e) { J = { apply: G.length ? function (e, t) { K.apply(e, Y.call(t)) } : function (e, t) { for (var n = e.length, r = 0; e[n++] = t[r++];) ; e.length = n - 1 } } } b = t.support = {}, k = t.isXML = function (e) { var t = e && (e.ownerDocument || e).documentElement; return !!t && "HTML" !== t.nodeName }, E = t.setDocument = function (e) { var t, n, r = e ? e.ownerDocument || e : q; return r !== A && 9 === r.nodeType && r.documentElement ? (A = r, D = r.documentElement, n = r.defaultView, n && n !== n.top && (n.addEventListener ? n.addEventListener("unload", xe, !1) : n.attachEvent && n.attachEvent("onunload", xe)), M = !k(r), b.attributes = i(function (e) { return e.className = "i", !e.getAttribute("className") }), b.getElementsByTagName = i(function (e) { return e.appendChild(r.createComment("")), !e.getElementsByTagName("*").length }), b.getElementsByClassName = me.test(r.getElementsByClassName), b.getById = i(function (e) { return D.appendChild(e).id = O, !r.getElementsByName || !r.getElementsByName(O).length }), b.getById ? (w.find.ID = function (e, t) { if (void 0 !== t.getElementById && M) { var n = t.getElementById(e); return n && n.parentNode ? [n] : [] } }, w.filter.ID = function (e) { var t = e.replace(be, we); return function (e) { return e.getAttribute("id") === t } }) : (delete w.find.ID, w.filter.ID = function (e) { var t = e.replace(be, we); return function (e) { var n = void 0 !== e.getAttributeNode && e.getAttributeNode("id"); return n && n.value === t } }), w.find.TAG = b.getElementsByTagName ? function (e, t) { return void 0 !== t.getElementsByTagName ? t.getElementsByTagName(e) : b.qsa ? t.querySelectorAll(e) : void 0 } : function (e, t) { var n, r = [], i = 0, o = t.getElementsByTagName(e); if ("*" === e) { for (; n = o[i++];) 1 === n.nodeType && r.push(n); return r } return o }, w.find.CLASS = b.getElementsByClassName && function (e, t) { return M ? t.getElementsByClassName(e) : void 0 }, P = [], N = [], (b.qsa = me.test(r.querySelectorAll)) && (i(function (e) { D.appendChild(e).innerHTML = "<a id='" + O + "'></a><select id='" + O + "-\f]' msallowcapture=''><option selected=''></option></select>", e.querySelectorAll("[msallowcapture^='']").length && N.push("[*^$]=" + ee + "*(?:''|\"\")"), e.querySelectorAll("[selected]").length || N.push("\\[" + ee + "*(?:value|" + Z + ")"), e.querySelectorAll("[id~=" + O + "-]").length || N.push("~="), e.querySelectorAll(":checked").length || N.push(":checked"), e.querySelectorAll("a#" + O + "+*").length || N.push(".#.+[+~]") }), i(function (e) { var t = r.createElement("input"); t.setAttribute("type", "hidden"), e.appendChild(t).setAttribute("name", "D"), e.querySelectorAll("[name=d]").length && N.push("name" + ee + "*[*^$|!~]?="), e.querySelectorAll(":enabled").length || N.push(":enabled", ":disabled"), e.querySelectorAll("*,:x"), N.push(",.*:") })), (b.matchesSelector = me.test(R = D.matches || D.webkitMatchesSelector || D.mozMatchesSelector || D.oMatchesSelector || D.msMatchesSelector)) && i(function (e) { b.disconnectedMatch = R.call(e, "div"), R.call(e, "[s!='']:x"), P.push("!=", ie) }), N = N.length && new RegExp(N.join("|")), P = P.length && new RegExp(P.join("|")), t = me.test(D.compareDocumentPosition), L = t || me.test(D.contains) ? function (e, t) { var n = 9 === e.nodeType ? e.documentElement : e, r = t && t.parentNode; return e === r || !(!r || 1 !== r.nodeType || !(n.contains ? n.contains(r) : e.compareDocumentPosition && 16 & e.compareDocumentPosition(r))) } : function (e, t) { if (t) for (; t = t.parentNode;) if (t === e) return !0; return !1 }, W = t ? function (e, t) { if (e === t) return S = !0, 0; var n = !e.compareDocumentPosition - !t.compareDocumentPosition; return n || (n = (e.ownerDocument || e) === (t.ownerDocument || t) ? e.compareDocumentPosition(t) : 1, 1 & n || !b.sortDetached && t.compareDocumentPosition(e) === n ? e === r || e.ownerDocument === q && L(q, e) ? -1 : t === r || t.ownerDocument === q && L(q, t) ? 1 : j ? Q(j, e) - Q(j, t) : 0 : 4 & n ? -1 : 1) } : function (e, t) { if (e === t) return S = !0, 0; var n, i = 0, o = e.parentNode, a = t.parentNode, l = [e], u = [t]; if (!o || !a) return e === r ? -1 : t === r ? 1 : o ? -1 : a ? 1 : j ? Q(j, e) - Q(j, t) : 0; if (o === a) return s(e, t); for (n = e; n = n.parentNode;) l.unshift(n); for (n = t; n = n.parentNode;) u.unshift(n); for (; l[i] === u[i];) i++; return i ? s(l[i], u[i]) : l[i] === q ? -1 : u[i] === q ? 1 : 0 }, r) : A }, t.matches = function (e, n) { return t(e, null, null, n) }, t.matchesSelector = function (e, n) { if ((e.ownerDocument || e) !== A && E(e), n = n.replace(ue, "='$1']"), !(!b.matchesSelector || !M || P && P.test(n) || N && N.test(n))) try { var r = R.call(e, n); if (r || b.disconnectedMatch || e.document && 11 !== e.document.nodeType) return r } catch (e) { } return t(n, A, null, [e]).length > 0 }, t.contains = function (e, t) { return (e.ownerDocument || e) !== A && E(e), L(e, t) }, t.attr = function (e, t) { (e.ownerDocument || e) !== A && E(e); var n = w.attrHandle[t.toLowerCase()], r = n && U.call(w.attrHandle, t.toLowerCase()) ? n(e, t, !M) : void 0; return void 0 !== r ? r : b.attributes || !M ? e.getAttribute(t) : (r = e.getAttributeNode(t)) && r.specified ? r.value : null }, t.error = function (e) { throw new Error("Syntax error, unrecognized expression: " + e) }, t.uniqueSort = function (e) { var t, n = [], r = 0, i = 0; if (S = !b.detectDuplicates, j = !b.sortStable && e.slice(0), e.sort(W), S) { for (; t = e[i++];) t === e[i] && (r = n.push(i)); for (; r--;) e.splice(n[r], 1) } return j = null, e }, x = t.getText = function (e) { var t, n = "", r = 0, i = e.nodeType; if (i) { if (1 === i || 9 === i || 11 === i) { if ("string" == typeof e.textContent) return e.textContent; for (e = e.firstChild; e; e = e.nextSibling) n += x(e) } else if (3 === i || 4 === i) return e.nodeValue } else for (; t = e[r++];) n += x(t); return n }, w = t.selectors = { cacheLength: 50, createPseudo: r, match: fe, attrHandle: {}, find: {}, relative: {">": {dir: "parentNode", first: !0}, " ": {dir: "parentNode"}, "+": {dir: "previousSibling", first: !0}, "~": {dir: "previousSibling"}}, preFilter: { ATTR: function (e) { return e[1] = e[1].replace(be, we), e[3] = (e[3] || e[4] || e[5] || "").replace(be, we), "~=" === e[2] && (e[3] = " " + e[3] + " "), e.slice(0, 4) }, CHILD: function (e) { return e[1] = e[1].toLowerCase(), "nth" === e[1].slice(0, 3) ? (e[3] || t.error(e[0]), e[4] = +(e[4] ? e[5] + (e[6] || 1) : 2 * ("even" === e[3] || "odd" === e[3])), e[5] = +(e[7] + e[8] || "odd" === e[3])) : e[3] && t.error(e[0]), e }, PSEUDO: function (e) { var t, n = !e[6] && e[2]; return fe.CHILD.test(e[0]) ? null : (e[3] ? e[2] = e[4] || e[5] || "" : n && ce.test(n) && (t = _(n, !0)) && (t = n.indexOf(")", n.length - t) - n.length) && (e[0] = e[0].slice(0, t), e[2] = n.slice(0, t)), e.slice(0, 3)) } }, filter: { TAG: function (e) { var t = e.replace(be, we).toLowerCase(); return "*" === e ? function () { return !0 } : function (e) { return e.nodeName && e.nodeName.toLowerCase() === t } }, CLASS: function (e) { var t = $[e + " "]; return t || (t = new RegExp("(^|" + ee + ")" + e + "(" + ee + "|$)")) && $(e, function (e) { return t.test("string" == typeof e.className && e.className || void 0 !== e.getAttribute && e.getAttribute("class") || "") }) }, ATTR: function (e, n, r) { return function (i) { var o = t.attr(i, e); return null == o ? "!=" === n : !n || (o += "", "=" === n ? o === r : "!=" === n ? o !== r : "^=" === n ? r && 0 === o.indexOf(r) : "*=" === n ? r && o.indexOf(r) > -1 : "$=" === n ? r && o.slice(-r.length) === r : "~=" === n ? (" " + o.replace(oe, " ") + " ").indexOf(r) > -1 : "|=" === n && (o === r || o.slice(0, r.length + 1) === r + "-")) } }, CHILD: function (e, t, n, r, i) { var o = "nth" !== e.slice(0, 3), s = "last" !== e.slice(-4), a = "of-type" === t; return 1 === r && 0 === i ? function (e) { return !!e.parentNode } : function (t, n, l) { var u, c, d, f, p, h, m = o !== s ? "nextSibling" : "previousSibling", v = t.parentNode, g = a && t.nodeName.toLowerCase(), y = !l && !a; if (v) { if (o) { for (; m;) { for (d = t; d = d[m];) if (a ? d.nodeName.toLowerCase() === g : 1 === d.nodeType) return !1; h = m = "only" === e && !h && "nextSibling" } return !0 } if (h = [s ? v.firstChild : v.lastChild], s && y) { for (c = v[O] || (v[O] = {}), u = c[e] || [], p = u[0] === F && u[1], f = u[0] === F && u[2], d = p && v.childNodes[p]; d = ++p && d && d[m] || (f = p = 0) || h.pop();) if (1 === d.nodeType && ++f && d === t) { c[e] = [F, p, f]; break } } else if (y && (u = (t[O] || (t[O] = {}))[e]) && u[0] === F) f = u[1]; else for (; (d = ++p && d && d[m] || (f = p = 0) || h.pop()) && ((a ? d.nodeName.toLowerCase() !== g : 1 !== d.nodeType) || !++f || (y && ((d[O] || (d[O] = {}))[e] = [F, f]), d !== t));) ; return (f -= i) === r || f % r == 0 && f / r >= 0 } } }, PSEUDO: function (e, n) { var i, o = w.pseudos[e] || w.setFilters[e.toLowerCase()] || t.error("unsupported pseudo: " + e); return o[O] ? o(n) : o.length > 1 ? (i = [e, e, "", n], w.setFilters.hasOwnProperty(e.toLowerCase()) ? r(function (e, t) { for (var r, i = o(e, n), s = i.length; s--;) r = Q(e, i[s]), e[r] = !(t[r] = i[s]) }) : function (e) { return o(e, 0, i) }) : o } }, pseudos: { not: r(function (e) { var t = [], n = [], i = C(e.replace(se, "$1")); return i[O] ? r(function (e, t, n, r) { for (var o, s = i(e, null, r, []), a = e.length; a--;) (o = s[a]) && (e[a] = !(t[a] = o)) }) : function (e, r, o) { return t[0] = e, i(t, null, o, n), t[0] = null, !n.pop() } }), has: r(function (e) { return function (n) { return t(e, n).length > 0 } }), contains: r(function (e) { return e = e.replace(be, we), function (t) { return (t.textContent || t.innerText || x(t)).indexOf(e) > -1 } }), lang: r(function (e) { return de.test(e || "") || t.error("unsupported lang: " + e), e = e.replace(be, we).toLowerCase(), function (t) { var n; do { if (n = M ? t.lang : t.getAttribute("xml:lang") || t.getAttribute("lang")) return (n = n.toLowerCase()) === e || 0 === n.indexOf(e + "-") } while ((t = t.parentNode) && 1 === t.nodeType); return !1 } }), target: function (t) { var n = e.location && e.location.hash; return n && n.slice(1) === t.id }, root: function (e) { return e === D }, focus: function (e) { return e === A.activeElement && (!A.hasFocus || A.hasFocus()) && !!(e.type || e.href || ~e.tabIndex) }, enabled: function (e) { return !1 === e.disabled }, disabled: function (e) { return !0 === e.disabled }, checked: function (e) { var t = e.nodeName.toLowerCase(); return "input" === t && !!e.checked || "option" === t && !!e.selected }, selected: function (e) { return e.parentNode && e.parentNode.selectedIndex, !0 === e.selected }, empty: function (e) { for (e = e.firstChild; e; e = e.nextSibling) if (e.nodeType < 6) return !1; return !0 }, parent: function (e) { return !w.pseudos.empty(e) }, header: function (e) { return he.test(e.nodeName) }, input: function (e) { return pe.test(e.nodeName) }, button: function (e) { var t = e.nodeName.toLowerCase(); return "input" === t && "button" === e.type || "button" === t }, text: function (e) { var t; return "input" === e.nodeName.toLowerCase() && "text" === e.type && (null == (t = e.getAttribute("type")) || "text" === t.toLowerCase()) }, first: a(function () { return [0] }), last: a(function (e, t) { return [t - 1] }), eq: a(function (e, t, n) { return [0 > n ? n + t : n] }), even: a(function (e, t) { for (var n = 0; t > n; n += 2) e.push(n); return e }), odd: a(function (e, t) { for (var n = 1; t > n; n += 2) e.push(n); return e }), lt: a(function (e, t, n) { for (var r = 0 > n ? n + t : n; --r >= 0;) e.push(r); return e }), gt: a(function (e, t, n) { for (var r = 0 > n ? n + t : n; ++r < t;) e.push(r); return e }) } }, w.pseudos.nth = w.pseudos.eq; for (y in{radio: !0, checkbox: !0, file: !0, password: !0, image: !0}) w.pseudos[y] = function (e) { return function (t) { return "input" === t.nodeName.toLowerCase() && t.type === e } }(y); for (y in{submit: !0, reset: !0}) w.pseudos[y] = function (e) { return function (t) { var n = t.nodeName.toLowerCase(); return ("input" === n || "button" === n) && t.type === e } }(y); return u.prototype = w.filters = w.pseudos, w.setFilters = new u, _ = t.tokenize = function (e, n) { var r, i, o, s, a, l, u, c = H[e + " "]; if (c) return n ? 0 : c.slice(0); for (a = e, l = [], u = w.preFilter; a;) { (!r || (i = ae.exec(a))) && (i && (a = a.slice(i[0].length) || a), l.push(o = [])), r = !1, (i = le.exec(a)) && (r = i.shift(), o.push({ value: r, type: i[0].replace(se, " ") }), a = a.slice(r.length)); for (s in w.filter) !(i = fe[s].exec(a)) || u[s] && !(i = u[s](i)) || (r = i.shift(), o.push({value: r, type: s, matches: i}), a = a.slice(r.length)); if (!r) break } return n ? a.length : a ? t.error(e) : H(e, l).slice(0) }, C = t.compile = function (e, t) { var n, r = [], i = [], o = V[e + " "]; if (!o) { for (t || (t = _(e)), n = t.length; n--;) o = v(t[n]), o[O] ? r.push(o) : i.push(o); o = V(e, g(i, r)), o.selector = e } return o }, T = t.select = function (e, t, n, r) { var i, o, s, a, u, d = "function" == typeof e && e, f = !r && _(e = d.selector || e); if (n = n || [], 1 === f.length) { if (o = f[0] = f[0].slice(0), o.length > 2 && "ID" === (s = o[0]).type && b.getById && 9 === t.nodeType && M && w.relative[o[1].type]) { if (!(t = (w.find.ID(s.matches[0].replace(be, we), t) || [])[0])) return n; d && (t = t.parentNode), e = e.slice(o.shift().value.length) } for (i = fe.needsContext.test(e) ? 0 : o.length; i-- && (s = o[i], !w.relative[a = s.type]);) if ((u = w.find[a]) && (r = u(s.matches[0].replace(be, we), ge.test(o[0].type) && l(t.parentNode) || t))) { if (o.splice(i, 1), !(e = r.length && c(o))) return J.apply(n, r), n; break } } return (d || C(e, f))(r, t, !M, n, ge.test(e) && l(t.parentNode) || t), n }, b.sortStable = O.split("").sort(W).join("") === O, b.detectDuplicates = !!S, E(), b.sortDetached = i(function (e) { return 1 & e.compareDocumentPosition(A.createElement("div")) }), i(function (e) { return e.innerHTML = "<a href='#'></a>", "#" === e.firstChild.getAttribute("href") }) || o("type|href|height|width", function (e, t, n) { return n ? void 0 : e.getAttribute(t, "type" === t.toLowerCase() ? 1 : 2) }), b.attributes && i(function (e) { return e.innerHTML = "<input/>", e.firstChild.setAttribute("value", ""), "" === e.firstChild.getAttribute("value") }) || o("value", function (e, t, n) { return n || "input" !== e.nodeName.toLowerCase() ? void 0 : e.defaultValue }), i(function (e) { return null == e.getAttribute("disabled") }) || o(Z, function (e, t, n) { var r; return n ? void 0 : !0 === e[t] ? t.toLowerCase() : (r = e.getAttributeNode(t)) && r.specified ? r.value : null }), t }(o); ie.find = ue, ie.expr = ue.selectors, ie.expr[":"] = ie.expr.pseudos, ie.unique = ue.uniqueSort, ie.text = ue.getText, ie.isXMLDoc = ue.isXML, ie.contains = ue.contains; var ce = ie.expr.match.needsContext, de = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, fe = /^.[^:#\[\.,]*$/; ie.filter = function (e, t, n) { var r = t[0]; return n && (e = ":not(" + e + ")"), 1 === t.length && 1 === r.nodeType ? ie.find.matchesSelector(r, e) ? [r] : [] : ie.find.matches(e, ie.grep(t, function (e) { return 1 === e.nodeType })) }, ie.fn.extend({ find: function (e) { var t, n = this.length, r = [], i = this; if ("string" != typeof e) return this.pushStack(ie(e).filter(function () { for (t = 0; n > t; t++) if (ie.contains(i[t], this)) return !0 })); for (t = 0; n > t; t++) ie.find(e, i[t], r); return r = this.pushStack(n > 1 ? ie.unique(r) : r), r.selector = this.selector ? this.selector + " " + e : e, r }, filter: function (e) { return this.pushStack(l(this, e || [], !1)) }, not: function (e) { return this.pushStack(l(this, e || [], !0)) }, is: function (e) { return !!l(this, "string" == typeof e && ce.test(e) ? ie(e) : e || [], !1).length } }); var pe, he = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/; (ie.fn.init = function (e, t) { var n, r; if (!e) return this; if ("string" == typeof e) { if (!(n = "<" === e[0] && ">" === e[e.length - 1] && e.length >= 3 ? [null, e, null] : he.exec(e)) || !n[1] && t) return !t || t.jquery ? (t || pe).find(e) : this.constructor(t).find(e); if (n[1]) { if (t = t instanceof ie ? t[0] : t, ie.merge(this, ie.parseHTML(n[1], t && t.nodeType ? t.ownerDocument || t : ne, !0)), de.test(n[1]) && ie.isPlainObject(t)) for (n in t) ie.isFunction(this[n]) ? this[n](t[n]) : this.attr(n, t[n]); return this } return r = ne.getElementById(n[2]), r && r.parentNode && (this.length = 1, this[0] = r), this.context = ne, this.selector = e, this } return e.nodeType ? (this.context = this[0] = e, this.length = 1, this) : ie.isFunction(e) ? void 0 !== pe.ready ? pe.ready(e) : e(ie) : (void 0 !== e.selector && (this.selector = e.selector, this.context = e.context), ie.makeArray(e, this)) }).prototype = ie.fn, pe = ie(ne); var me = /^(?:parents|prev(?:Until|All))/, ve = {children: !0, contents: !0, next: !0, prev: !0}; ie.extend({ dir: function (e, t, n) { for (var r = [], i = void 0 !== n; (e = e[t]) && 9 !== e.nodeType;) if (1 === e.nodeType) { if (i && ie(e).is(n)) break; r.push(e) } return r }, sibling: function (e, t) { for (var n = []; e; e = e.nextSibling) 1 === e.nodeType && e !== t && n.push(e); return n } }), ie.fn.extend({ has: function (e) { var t = ie(e, this), n = t.length; return this.filter(function () { for (var e = 0; n > e; e++) if (ie.contains(this, t[e])) return !0 }) }, closest: function (e, t) { for (var n, r = 0, i = this.length, o = [], s = ce.test(e) || "string" != typeof e ? ie(e, t || this.context) : 0; i > r; r++) for (n = this[r]; n && n !== t; n = n.parentNode) if (n.nodeType < 11 && (s ? s.index(n) > -1 : 1 === n.nodeType && ie.find.matchesSelector(n, e))) { o.push(n); break } return this.pushStack(o.length > 1 ? ie.unique(o) : o) }, index: function (e) { return e ? "string" == typeof e ? Y.call(ie(e), this[0]) : Y.call(this, e.jquery ? e[0] : e) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1 }, add: function (e, t) { return this.pushStack(ie.unique(ie.merge(this.get(), ie(e, t)))) }, addBack: function (e) { return this.add(null == e ? this.prevObject : this.prevObject.filter(e)) } }), ie.each({ parent: function (e) { var t = e.parentNode; return t && 11 !== t.nodeType ? t : null }, parents: function (e) { return ie.dir(e, "parentNode") }, parentsUntil: function (e, t, n) { return ie.dir(e, "parentNode", n) }, next: function (e) { return u(e, "nextSibling") }, prev: function (e) { return u(e, "previousSibling") }, nextAll: function (e) { return ie.dir(e, "nextSibling") }, prevAll: function (e) { return ie.dir(e, "previousSibling") }, nextUntil: function (e, t, n) { return ie.dir(e, "nextSibling", n) }, prevUntil: function (e, t, n) { return ie.dir(e, "previousSibling", n) }, siblings: function (e) { return ie.sibling((e.parentNode || {}).firstChild, e) }, children: function (e) { return ie.sibling(e.firstChild) }, contents: function (e) { return e.contentDocument || ie.merge([], e.childNodes) } }, function (e, t) { ie.fn[e] = function (n, r) { var i = ie.map(this, t, n); return "Until" !== e.slice(-5) && (r = n), r && "string" == typeof r && (i = ie.filter(r, i)), this.length > 1 && (ve[e] || ie.unique(i), me.test(e) && i.reverse()), this.pushStack(i) } }); var ge = /\S+/g, ye = {}; ie.Callbacks = function (e) { e = "string" == typeof e ? ye[e] || c(e) : ie.extend({}, e); var t, n, r, i, o, s, a = [], l = !e.once && [], u = function (c) { for (t = e.memory && c, n = !0, s = i || 0, i = 0, o = a.length, r = !0; a && o > s; s++) if (!1 === a[s].apply(c[0], c[1]) && e.stopOnFalse) { t = !1; break } r = !1, a && (l ? l.length && u(l.shift()) : t ? a = [] : d.disable()) }, d = { add: function () { if (a) { var n = a.length; !function t(n) { ie.each(n, function (n, r) { var i = ie.type(r); "function" === i ? e.unique && d.has(r) || a.push(r) : r && r.length && "string" !== i && t(r) }) }(arguments), r ? o = a.length : t && (i = n, u(t)) } return this }, remove: function () { return a && ie.each(arguments, function (e, t) { for (var n; (n = ie.inArray(t, a, n)) > -1;) a.splice(n, 1), r && (o >= n && o--, s >= n && s--) }), this }, has: function (e) { return e ? ie.inArray(e, a) > -1 : !(!a || !a.length) }, empty: function () { return a = [], o = 0, this }, disable: function () { return a = l = t = void 0, this }, disabled: function () { return !a }, lock: function () { return l = void 0, t || d.disable(), this }, locked: function () { return !l }, fireWith: function (e, t) { return !a || n && !l || (t = t || [], t = [e, t.slice ? t.slice() : t], r ? l.push(t) : u(t)), this }, fire: function () { return d.fireWith(this, arguments), this }, fired: function () { return !!n } }; return d }, ie.extend({ Deferred: function (e) { var t = [["resolve", "done", ie.Callbacks("once memory"), "resolved"], ["reject", "fail", ie.Callbacks("once memory"), "rejected"], ["notify", "progress", ie.Callbacks("memory")]], n = "pending", r = { state: function () { return n }, always: function () { return i.done(arguments).fail(arguments), this }, then: function () { var e = arguments; return ie.Deferred(function (n) { ie.each(t, function (t, o) { var s = ie.isFunction(e[t]) && e[t]; i[o[1]](function () { var e = s && s.apply(this, arguments); e && ie.isFunction(e.promise) ? e.promise().done(n.resolve).fail(n.reject).progress(n.notify) : n[o[0] + "With"](this === r ? n.promise() : this, s ? [e] : arguments) }) }), e = null }).promise() }, promise: function (e) { return null != e ? ie.extend(e, r) : r } }, i = {}; return r.pipe = r.then, ie.each(t, function (e, o) { var s = o[2], a = o[3]; r[o[1]] = s.add, a && s.add(function () { n = a }, t[1 ^ e][2].disable, t[2][2].lock), i[o[0]] = function () { return i[o[0] + "With"](this === i ? r : this, arguments), this }, i[o[0] + "With"] = s.fireWith }), r.promise(i), e && e.call(i, i), i }, when: function (e) { var t, n, r, i = 0, o = X.call(arguments), s = o.length, a = 1 !== s || e && ie.isFunction(e.promise) ? s : 0, l = 1 === a ? e : ie.Deferred(), u = function (e, n, r) { return function (i) { n[e] = this, r[e] = arguments.length > 1 ? X.call(arguments) : i, r === t ? l.notifyWith(n, r) : --a || l.resolveWith(n, r) } }; if (s > 1) for (t = new Array(s), n = new Array(s), r = new Array(s); s > i; i++) o[i] && ie.isFunction(o[i].promise) ? o[i].promise().done(u(i, r, o)).fail(l.reject).progress(u(i, n, t)) : --a; return a || l.resolveWith(r, o), l.promise() } }); var be; ie.fn.ready = function (e) { return ie.ready.promise().done(e), this }, ie.extend({ isReady: !1, readyWait: 1, holdReady: function (e) { e ? ie.readyWait++ : ie.ready(!0) }, ready: function (e) { (!0 === e ? --ie.readyWait : ie.isReady) || (ie.isReady = !0, !0 !== e && --ie.readyWait > 0 || (be.resolveWith(ne, [ie]), ie.fn.triggerHandler && (ie(ne).triggerHandler("ready"), ie(ne).off("ready")))) } }), ie.ready.promise = function (e) { return be || (be = ie.Deferred(), "complete" === ne.readyState ? setTimeout(ie.ready) : (ne.addEventListener("DOMContentLoaded", d, !1), o.addEventListener("load", d, !1))), be.promise(e) }, ie.ready.promise(); var we = ie.access = function (e, t, n, r, i, o, s) { var a = 0, l = e.length, u = null == n; if ("object" === ie.type(n)) { i = !0; for (a in n) ie.access(e, t, a, n[a], !0, o, s) } else if (void 0 !== r && (i = !0, ie.isFunction(r) || (s = !0), u && (s ? (t.call(e, r), t = null) : (u = t, t = function (e, t, n) { return u.call(ie(e), n) })), t)) for (; l > a; a++) t(e[a], n, s ? r : r.call(e[a], a, t(e[a], n))); return i ? e : u ? t.call(e) : l ? t(e[0], n) : o }; ie.acceptData = function (e) { return 1 === e.nodeType || 9 === e.nodeType || !+e.nodeType }, f.uid = 1, f.accepts = ie.acceptData, f.prototype = { key: function (e) { if (!f.accepts(e)) return 0; var t = {}, n = e[this.expando]; if (!n) { n = f.uid++; try { t[this.expando] = {value: n}, Object.defineProperties(e, t) } catch (r) { t[this.expando] = n, ie.extend(e, t) } } return this.cache[n] || (this.cache[n] = {}), n }, set: function (e, t, n) { var r, i = this.key(e), o = this.cache[i]; if ("string" == typeof t) o[t] = n; else if (ie.isEmptyObject(o)) ie.extend(this.cache[i], t); else for (r in t) o[r] = t[r]; return o }, get: function (e, t) { var n = this.cache[this.key(e)]; return void 0 === t ? n : n[t] }, access: function (e, t, n) { var r; return void 0 === t || t && "string" == typeof t && void 0 === n ? (r = this.get(e, t), void 0 !== r ? r : this.get(e, ie.camelCase(t))) : (this.set(e, t, n), void 0 !== n ? n : t) }, remove: function (e, t) { var n, r, i, o = this.key(e), s = this.cache[o]; if (void 0 === t) this.cache[o] = {}; else { ie.isArray(t) ? r = t.concat(t.map(ie.camelCase)) : (i = ie.camelCase(t), t in s ? r = [t, i] : (r = i, r = r in s ? [r] : r.match(ge) || [])), n = r.length; for (; n--;) delete s[r[n]] } }, hasData: function (e) { return !ie.isEmptyObject(this.cache[e[this.expando]] || {}) }, discard: function (e) { e[this.expando] && delete this.cache[e[this.expando]] } }; var xe = new f, ke = new f, _e = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, Ce = /([A-Z])/g; ie.extend({ hasData: function (e) { return ke.hasData(e) || xe.hasData(e) }, data: function (e, t, n) { return ke.access(e, t, n) }, removeData: function (e, t) { ke.remove(e, t) }, _data: function (e, t, n) { return xe.access(e, t, n) }, _removeData: function (e, t) { xe.remove(e, t) } }), ie.fn.extend({ data: function (e, t) { var n, r, i, o = this[0], s = o && o.attributes; if (void 0 === e) { if (this.length && (i = ke.get(o), 1 === o.nodeType && !xe.get(o, "hasDataAttrs"))) { for (n = s.length; n--;) s[n] && (r = s[n].name, 0 === r.indexOf("data-") && (r = ie.camelCase(r.slice(5)), p(o, r, i[r]))); xe.set(o, "hasDataAttrs", !0) } return i } return "object" == typeof e ? this.each(function () { ke.set(this, e) }) : we(this, function (t) { var n, r = ie.camelCase(e); if (o && void 0 === t) { if (void 0 !== (n = ke.get(o, e))) return n; if (void 0 !== (n = ke.get(o, r))) return n; if (void 0 !== (n = p(o, r, void 0))) return n } else this.each(function () { var n = ke.get(this, r); ke.set(this, r, t), -1 !== e.indexOf("-") && void 0 !== n && ke.set(this, e, t) }) }, null, t, arguments.length > 1, null, !0) }, removeData: function (e) { return this.each(function () { ke.remove(this, e) }) } }), ie.extend({ queue: function (e, t, n) { var r; return e ? (t = (t || "fx") + "queue", r = xe.get(e, t), n && (!r || ie.isArray(n) ? r = xe.access(e, t, ie.makeArray(n)) : r.push(n)), r || []) : void 0 }, dequeue: function (e, t) { t = t || "fx"; var n = ie.queue(e, t), r = n.length, i = n.shift(), o = ie._queueHooks(e, t), s = function () { ie.dequeue(e, t) }; "inprogress" === i && (i = n.shift(), r--), i && ("fx" === t && n.unshift("inprogress"), delete o.stop, i.call(e, s, o)), !r && o && o.empty.fire() }, _queueHooks: function (e, t) { var n = t + "queueHooks"; return xe.get(e, n) || xe.access(e, n, { empty: ie.Callbacks("once memory").add(function () { xe.remove(e, [t + "queue", n]) }) }) } }), ie.fn.extend({ queue: function (e, t) { var n = 2; return "string" != typeof e && (t = e, e = "fx", n--), arguments.length < n ? ie.queue(this[0], e) : void 0 === t ? this : this.each(function () { var n = ie.queue(this, e, t); ie._queueHooks(this, e), "fx" === e && "inprogress" !== n[0] && ie.dequeue(this, e) }) }, dequeue: function (e) { return this.each(function () { ie.dequeue(this, e) }) }, clearQueue: function (e) { return this.queue(e || "fx", []) }, promise: function (e, t) { var n, r = 1, i = ie.Deferred(), o = this, s = this.length, a = function () { --r || i.resolveWith(o, [o]) }; for ("string" != typeof e && (t = e, e = void 0), e = e || "fx"; s--;) (n = xe.get(o[s], e + "queueHooks")) && n.empty && (r++, n.empty.add(a)); return a(), i.promise(t) } }); var Te = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, Ie = ["Top", "Right", "Bottom", "Left"], je = function (e, t) { return e = t || e, "none" === ie.css(e, "display") || !ie.contains(e.ownerDocument, e) }, Se = /^(?:checkbox|radio)$/i; !function () { var e = ne.createDocumentFragment(), t = e.appendChild(ne.createElement("div")), n = ne.createElement("input"); n.setAttribute("type", "radio"), n.setAttribute("checked", "checked"), n.setAttribute("name", "t"), t.appendChild(n), te.checkClone = t.cloneNode(!0).cloneNode(!0).lastChild.checked, t.innerHTML = "<textarea>x</textarea>", te.noCloneChecked = !!t.cloneNode(!0).lastChild.defaultValue }(); var Ee = "undefined"; te.focusinBubbles = "onfocusin" in o; var Ae = /^key/, De = /^(?:mouse|pointer|contextmenu)|click/, Me = /^(?:focusinfocus|focusoutblur)$/, Ne = /^([^.]*)(?:\.(.+)|)$/; ie.event = { global: {}, add: function (e, t, n, r, i) { var o, s, a, l, u, c, d, f, p, h, m, v = xe.get(e); if (v) for (n.handler && (o = n, n = o.handler, i = o.selector), n.guid || (n.guid = ie.guid++), (l = v.events) || (l = v.events = {}), (s = v.handle) || (s = v.handle = function (t) { return typeof ie !== Ee && ie.event.triggered !== t.type ? ie.event.dispatch.apply(e, arguments) : void 0 }), t = (t || "").match(ge) || [""], u = t.length; u--;) a = Ne.exec(t[u]) || [], p = m = a[1], h = (a[2] || "").split(".").sort(), p && (d = ie.event.special[p] || {}, p = (i ? d.delegateType : d.bindType) || p, d = ie.event.special[p] || {}, c = ie.extend({ type: p, origType: m, data: r, handler: n, guid: n.guid, selector: i, needsContext: i && ie.expr.match.needsContext.test(i), namespace: h.join(".") }, o), (f = l[p]) || (f = l[p] = [], f.delegateCount = 0, d.setup && !1 !== d.setup.call(e, r, h, s) || e.addEventListener && e.addEventListener(p, s, !1)), d.add && (d.add.call(e, c), c.handler.guid || (c.handler.guid = n.guid)), i ? f.splice(f.delegateCount++, 0, c) : f.push(c), ie.event.global[p] = !0) }, remove: function (e, t, n, r, i) { var o, s, a, l, u, c, d, f, p, h, m, v = xe.hasData(e) && xe.get(e); if (v && (l = v.events)) { for (t = (t || "").match(ge) || [""], u = t.length; u--;) if (a = Ne.exec(t[u]) || [], p = m = a[1], h = (a[2] || "").split(".").sort(), p) { for (d = ie.event.special[p] || {}, p = (r ? d.delegateType : d.bindType) || p, f = l[p] || [], a = a[2] && new RegExp("(^|\\.)" + h.join("\\.(?:.*\\.|)") + "(\\.|$)"), s = o = f.length; o--;) c = f[o], !i && m !== c.origType || n && n.guid !== c.guid || a && !a.test(c.namespace) || r && r !== c.selector && ("**" !== r || !c.selector) || (f.splice(o, 1), c.selector && f.delegateCount--, d.remove && d.remove.call(e, c)); s && !f.length && (d.teardown && !1 !== d.teardown.call(e, h, v.handle) || ie.removeEvent(e, p, v.handle), delete l[p]) } else for (p in l) ie.event.remove(e, p + t[u], n, r, !0); ie.isEmptyObject(l) && (delete v.handle, xe.remove(e, "events")) } }, trigger: function (e, t, n, r) { var i, s, a, l, u, c, d, f = [n || ne], p = ee.call(e, "type") ? e.type : e, h = ee.call(e, "namespace") ? e.namespace.split(".") : []; if (s = a = n = n || ne, 3 !== n.nodeType && 8 !== n.nodeType && !Me.test(p + ie.event.triggered) && (p.indexOf(".") >= 0 && (h = p.split("."), p = h.shift(), h.sort()), u = p.indexOf(":") < 0 && "on" + p, e = e[ie.expando] ? e : new ie.Event(p, "object" == typeof e && e), e.isTrigger = r ? 2 : 3, e.namespace = h.join("."), e.namespace_re = e.namespace ? new RegExp("(^|\\.)" + h.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, e.result = void 0, e.target || (e.target = n), t = null == t ? [e] : ie.makeArray(t, [e]), d = ie.event.special[p] || {}, r || !d.trigger || !1 !== d.trigger.apply(n, t))) { if (!r && !d.noBubble && !ie.isWindow(n)) { for (l = d.delegateType || p, Me.test(l + p) || (s = s.parentNode); s; s = s.parentNode) f.push(s), a = s; a === (n.ownerDocument || ne) && f.push(a.defaultView || a.parentWindow || o) } for (i = 0; (s = f[i++]) && !e.isPropagationStopped();) e.type = i > 1 ? l : d.bindType || p, c = (xe.get(s, "events") || {})[e.type] && xe.get(s, "handle"), c && c.apply(s, t), (c = u && s[u]) && c.apply && ie.acceptData(s) && (e.result = c.apply(s, t), !1 === e.result && e.preventDefault()); return e.type = p, r || e.isDefaultPrevented() || d._default && !1 !== d._default.apply(f.pop(), t) || !ie.acceptData(n) || u && ie.isFunction(n[p]) && !ie.isWindow(n) && (a = n[u], a && (n[u] = null), ie.event.triggered = p, n[p](), ie.event.triggered = void 0, a && (n[u] = a)), e.result } }, dispatch: function (e) { e = ie.event.fix(e); var t, n, r, i, o, s = [], a = X.call(arguments), l = (xe.get(this, "events") || {})[e.type] || [], u = ie.event.special[e.type] || {}; if (a[0] = e, e.delegateTarget = this, !u.preDispatch || !1 !== u.preDispatch.call(this, e)) { for (s = ie.event.handlers.call(this, e, l), t = 0; (i = s[t++]) && !e.isPropagationStopped();) for (e.currentTarget = i.elem, n = 0; (o = i.handlers[n++]) && !e.isImmediatePropagationStopped();) (!e.namespace_re || e.namespace_re.test(o.namespace)) && (e.handleObj = o, e.data = o.data, void 0 !== (r = ((ie.event.special[o.origType] || {}).handle || o.handler).apply(i.elem, a)) && !1 === (e.result = r) && (e.preventDefault(), e.stopPropagation())); return u.postDispatch && u.postDispatch.call(this, e), e.result } }, handlers: function (e, t) { var n, r, i, o, s = [], a = t.delegateCount, l = e.target; if (a && l.nodeType && (!e.button || "click" !== e.type)) for (; l !== this; l = l.parentNode || this) if (!0 !== l.disabled || "click" !== e.type) { for (r = [], n = 0; a > n; n++) o = t[n], i = o.selector + " ", void 0 === r[i] && (r[i] = o.needsContext ? ie(i, this).index(l) >= 0 : ie.find(i, this, null, [l]).length), r[i] && r.push(o); r.length && s.push({elem: l, handlers: r}) } return a < t.length && s.push({elem: this, handlers: t.slice(a)}), s }, props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function (e, t) { return null == e.which && (e.which = null != t.charCode ? t.charCode : t.keyCode), e } }, mouseHooks: { props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function (e, t) { var n, r, i, o = t.button; return null == e.pageX && null != t.clientX && (n = e.target.ownerDocument || ne, r = n.documentElement, i = n.body, e.pageX = t.clientX + (r && r.scrollLeft || i && i.scrollLeft || 0) - (r && r.clientLeft || i && i.clientLeft || 0), e.pageY = t.clientY + (r && r.scrollTop || i && i.scrollTop || 0) - (r && r.clientTop || i && i.clientTop || 0)), e.which || void 0 === o || (e.which = 1 & o ? 1 : 2 & o ? 3 : 4 & o ? 2 : 0), e } }, fix: function (e) { if (e[ie.expando]) return e; var t, n, r, i = e.type, o = e, s = this.fixHooks[i]; for (s || (this.fixHooks[i] = s = De.test(i) ? this.mouseHooks : Ae.test(i) ? this.keyHooks : {}), r = s.props ? this.props.concat(s.props) : this.props, e = new ie.Event(o), t = r.length; t--;) n = r[t], e[n] = o[n]; return e.target || (e.target = ne), 3 === e.target.nodeType && (e.target = e.target.parentNode), s.filter ? s.filter(e, o) : e }, special: { load: {noBubble: !0}, focus: { trigger: function () { return this !== v() && this.focus ? (this.focus(), !1) : void 0 }, delegateType: "focusin" }, blur: { trigger: function () { return this === v() && this.blur ? (this.blur(), !1) : void 0 }, delegateType: "focusout" }, click: { trigger: function () { return "checkbox" === this.type && this.click && ie.nodeName(this, "input") ? (this.click(), !1) : void 0 }, _default: function (e) { return ie.nodeName(e.target, "a") } }, beforeunload: { postDispatch: function (e) { void 0 !== e.result && e.originalEvent && (e.originalEvent.returnValue = e.result) } } }, simulate: function (e, t, n, r) { var i = ie.extend(new ie.Event, n, {type: e, isSimulated: !0, originalEvent: {}}); r ? ie.event.trigger(i, null, t) : ie.event.dispatch.call(t, i), i.isDefaultPrevented() && n.preventDefault() } }, ie.removeEvent = function (e, t, n) { e.removeEventListener && e.removeEventListener(t, n, !1) }, ie.Event = function (e, t) { return this instanceof ie.Event ? (e && e.type ? (this.originalEvent = e, this.type = e.type, this.isDefaultPrevented = e.defaultPrevented || void 0 === e.defaultPrevented && !1 === e.returnValue ? h : m) : this.type = e, t && ie.extend(this, t), this.timeStamp = e && e.timeStamp || ie.now(), void(this[ie.expando] = !0)) : new ie.Event(e, t) }, ie.Event.prototype = { isDefaultPrevented: m, isPropagationStopped: m, isImmediatePropagationStopped: m, preventDefault: function () { var e = this.originalEvent; this.isDefaultPrevented = h, e && e.preventDefault && e.preventDefault() }, stopPropagation: function () { var e = this.originalEvent; this.isPropagationStopped = h, e && e.stopPropagation && e.stopPropagation() }, stopImmediatePropagation: function () { var e = this.originalEvent; this.isImmediatePropagationStopped = h, e && e.stopImmediatePropagation && e.stopImmediatePropagation(), this.stopPropagation() } }, ie.each({mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", pointerleave: "pointerout"}, function (e, t) { ie.event.special[e] = { delegateType: t, bindType: t, handle: function (e) { var n, r = this, i = e.relatedTarget, o = e.handleObj; return (!i || i !== r && !ie.contains(r, i)) && (e.type = o.origType, n = o.handler.apply(this, arguments), e.type = t), n } } }), te.focusinBubbles || ie.each({focus: "focusin", blur: "focusout"}, function (e, t) { var n = function (e) { ie.event.simulate(t, e.target, ie.event.fix(e), !0) }; ie.event.special[t] = { setup: function () { var r = this.ownerDocument || this, i = xe.access(r, t); i || r.addEventListener(e, n, !0), xe.access(r, t, (i || 0) + 1) }, teardown: function () { var r = this.ownerDocument || this, i = xe.access(r, t) - 1; i ? xe.access(r, t, i) : (r.removeEventListener(e, n, !0), xe.remove(r, t)) } } }), ie.fn.extend({ on: function (e, t, n, r, i) { var o, s; if ("object" == typeof e) { "string" != typeof t && (n = n || t, t = void 0); for (s in e) this.on(s, t, n, e[s], i); return this } if (null == n && null == r ? (r = t, n = t = void 0) : null == r && ("string" == typeof t ? (r = n, n = void 0) : (r = n, n = t, t = void 0)), !1 === r) r = m; else if (!r) return this; return 1 === i && (o = r, r = function (e) { return ie().off(e), o.apply(this, arguments) }, r.guid = o.guid || (o.guid = ie.guid++)), this.each(function () { ie.event.add(this, e, r, n, t) }) }, one: function (e, t, n, r) { return this.on(e, t, n, r, 1) }, off: function (e, t, n) { var r, i; if (e && e.preventDefault && e.handleObj) return r = e.handleObj, ie(e.delegateTarget).off(r.namespace ? r.origType + "." + r.namespace : r.origType, r.selector, r.handler), this; if ("object" == typeof e) { for (i in e) this.off(i, t, e[i]); return this } return (!1 === t || "function" == typeof t) && (n = t, t = void 0), !1 === n && (n = m), this.each(function () { ie.event.remove(this, e, n, t) }) }, trigger: function (e, t) { return this.each(function () { ie.event.trigger(e, t, this) }) }, triggerHandler: function (e, t) { var n = this[0]; return n ? ie.event.trigger(e, t, n, !0) : void 0 } }); var Pe = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, Re = /<([\w:]+)/, Le = /<|&#?\w+;/, Oe = /<(?:script|style|link)/i, qe = /checked\s*(?:[^=]|=\s*.checked.)/i, Fe = /^$|\/(?:java|ecma)script/i, ze = /^true\/(.*)/, $e = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, He = { option: [1, "<select multiple='multiple'>", "</select>"], thead: [1, "<table>", "</table>"], col: [2, "<table><colgroup>", "</colgroup></table>"], tr: [2, "<table><tbody>", "</tbody></table>"], td: [3, "<table><tbody><tr>", "</tr></tbody></table>"], _default: [0, "", ""] }; He.optgroup = He.option, He.tbody = He.tfoot = He.colgroup = He.caption = He.thead, He.th = He.td, ie.extend({ clone: function (e, t, n) { var r, i, o, s, a = e.cloneNode(!0), l = ie.contains(e.ownerDocument, e); if (!(te.noCloneChecked || 1 !== e.nodeType && 11 !== e.nodeType || ie.isXMLDoc(e))) for (s = k(a), o = k(e), r = 0, i = o.length; i > r; r++) _(o[r], s[r]); if (t) if (n) for (o = o || k(e), s = s || k(a), r = 0, i = o.length; i > r; r++) x(o[r], s[r]); else x(e, a); return s = k(a, "script"), s.length > 0 && w(s, !l && k(e, "script")), a }, buildFragment: function (e, t, n, r) { for (var i, o, s, a, l, u, c = t.createDocumentFragment(), d = [], f = 0, p = e.length; p > f; f++) if ((i = e[f]) || 0 === i) if ("object" === ie.type(i)) ie.merge(d, i.nodeType ? [i] : i); else if (Le.test(i)) { for (o = o || c.appendChild(t.createElement("div")), s = (Re.exec(i) || ["", ""])[1].toLowerCase(), a = He[s] || He._default, o.innerHTML = a[1] + i.replace(Pe, "<$1></$2>") + a[2], u = a[0]; u--;) o = o.lastChild; ie.merge(d, o.childNodes), o = c.firstChild, o.textContent = "" } else d.push(t.createTextNode(i)); for (c.textContent = "", f = 0; i = d[f++];) if ((!r || -1 === ie.inArray(i, r)) && (l = ie.contains(i.ownerDocument, i), o = k(c.appendChild(i), "script"), l && w(o), n)) for (u = 0; i = o[u++];) Fe.test(i.type || "") && n.push(i); return c }, cleanData: function (e) { for (var t, n, r, i, o = ie.event.special, s = 0; void 0 !== (n = e[s]); s++) { if (ie.acceptData(n) && (i = n[xe.expando]) && (t = xe.cache[i])) { if (t.events) for (r in t.events) o[r] ? ie.event.remove(n, r) : ie.removeEvent(n, r, t.handle); xe.cache[i] && delete xe.cache[i] } delete ke.cache[n[ke.expando]] } } }), ie.fn.extend({ text: function (e) { return we(this, function (e) { return void 0 === e ? ie.text(this) : this.empty().each(function () { (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) && (this.textContent = e) }) }, null, e, arguments.length) }, append: function () { return this.domManip(arguments, function (e) { if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { g(this, e).appendChild(e) } }) }, prepend: function () { return this.domManip(arguments, function (e) { if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { var t = g(this, e); t.insertBefore(e, t.firstChild) } }) }, before: function () { return this.domManip(arguments, function (e) { this.parentNode && this.parentNode.insertBefore(e, this) }) }, after: function () { return this.domManip(arguments, function (e) { this.parentNode && this.parentNode.insertBefore(e, this.nextSibling) }) }, remove: function (e, t) { for (var n, r = e ? ie.filter(e, this) : this, i = 0; null != (n = r[i]); i++) t || 1 !== n.nodeType || ie.cleanData(k(n)), n.parentNode && (t && ie.contains(n.ownerDocument, n) && w(k(n, "script")), n.parentNode.removeChild(n)); return this }, empty: function () { for (var e, t = 0; null != (e = this[t]); t++) 1 === e.nodeType && (ie.cleanData(k(e, !1)), e.textContent = ""); return this }, clone: function (e, t) { return e = null != e && e, t = null == t ? e : t, this.map(function () { return ie.clone(this, e, t) }) }, html: function (e) { return we(this, function (e) { var t = this[0] || {}, n = 0, r = this.length; if (void 0 === e && 1 === t.nodeType) return t.innerHTML; if ("string" == typeof e && !Oe.test(e) && !He[(Re.exec(e) || ["", ""])[1].toLowerCase()]) { e = e.replace(Pe, "<$1></$2>"); try { for (; r > n; n++) t = this[n] || {}, 1 === t.nodeType && (ie.cleanData(k(t, !1)), t.innerHTML = e); t = 0 } catch (e) { } } t && this.empty().append(e) }, null, e, arguments.length) }, replaceWith: function () { var e = arguments[0]; return this.domManip(arguments, function (t) { e = this.parentNode, ie.cleanData(k(this)), e && e.replaceChild(t, this) }), e && (e.length || e.nodeType) ? this : this.remove() }, detach: function (e) { return this.remove(e, !0) }, domManip: function (e, t) { e = K.apply([], e); var n, r, i, o, s, a, l = 0, u = this.length, c = this, d = u - 1, f = e[0], p = ie.isFunction(f); if (p || u > 1 && "string" == typeof f && !te.checkClone && qe.test(f)) return this.each(function (n) { var r = c.eq(n); p && (e[0] = f.call(this, n, r.html())), r.domManip(e, t) }); if (u && (n = ie.buildFragment(e, this[0].ownerDocument, !1, this), r = n.firstChild, 1 === n.childNodes.length && (n = r), r)) { for (i = ie.map(k(n, "script"), y), o = i.length; u > l; l++) s = n, l !== d && (s = ie.clone(s, !0, !0), o && ie.merge(i, k(s, "script"))), t.call(this[l], s, l); if (o) for (a = i[i.length - 1].ownerDocument, ie.map(i, b), l = 0; o > l; l++) s = i[l], Fe.test(s.type || "") && !xe.access(s, "globalEval") && ie.contains(a, s) && (s.src ? ie._evalUrl && ie._evalUrl(s.src) : ie.globalEval(s.textContent.replace($e, ""))) } return this } }), ie.each({appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith"}, function (e, t) { ie.fn[e] = function (e) { for (var n, r = [], i = ie(e), o = i.length - 1, s = 0; o >= s; s++) n = s === o ? this : this.clone(!0), ie(i[s])[t](n), J.apply(r, n.get()); return this.pushStack(r) } }); var Ve, We = {}, Be = /^margin/, Ue = new RegExp("^(" + Te + ")(?!px)[a-z%]+$", "i"), Ge = function (e) { return e.ownerDocument.defaultView.opener ? e.ownerDocument.defaultView.getComputedStyle(e, null) : o.getComputedStyle(e, null) }; !function () { function e() { s.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute", s.innerHTML = "", r.appendChild(i); var e = o.getComputedStyle(s, null); t = "1%" !== e.top, n = "4px" === e.width, r.removeChild(i) } var t, n, r = ne.documentElement, i = ne.createElement("div"), s = ne.createElement("div"); s.style && (s.style.backgroundClip = "content-box", s.cloneNode(!0).style.backgroundClip = "", te.clearCloneStyle = "content-box" === s.style.backgroundClip, i.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute", i.appendChild(s), o.getComputedStyle && ie.extend(te, { pixelPosition: function () { return e(), t }, boxSizingReliable: function () { return null == n && e(), n }, reliableMarginRight: function () { var e, t = s.appendChild(ne.createElement("div")); return t.style.cssText = s.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0", t.style.marginRight = t.style.width = "0", s.style.width = "1px", r.appendChild(i), e = !parseFloat(o.getComputedStyle(t, null).marginRight), r.removeChild(i), s.removeChild(t), e } })) }(), ie.swap = function (e, t, n, r) { var i, o, s = {}; for (o in t) s[o] = e.style[o], e.style[o] = t[o]; i = n.apply(e, r || []); for (o in t) e.style[o] = s[o]; return i }; var Xe = /^(none|table(?!-c[ea]).+)/, Ke = new RegExp("^(" + Te + ")(.*)$", "i"), Je = new RegExp("^([+-])=(" + Te + ")", "i"), Ye = {position: "absolute", visibility: "hidden", display: "block"}, Qe = {letterSpacing: "0", fontWeight: "400"}, Ze = ["Webkit", "O", "Moz", "ms"]; ie.extend({ cssHooks: { opacity: { get: function (e, t) { if (t) { var n = I(e, "opacity"); return "" === n ? "1" : n } } } }, cssNumber: {columnCount: !0, fillOpacity: !0, flexGrow: !0, flexShrink: !0, fontWeight: !0, lineHeight: !0, opacity: !0, order: !0, orphans: !0, widows: !0, zIndex: !0, zoom: !0}, cssProps: {float: "cssFloat"}, style: function (e, t, n, r) { if (e && 3 !== e.nodeType && 8 !== e.nodeType && e.style) { var i, o, s, a = ie.camelCase(t), l = e.style; return t = ie.cssProps[a] || (ie.cssProps[a] = S(l, a)), s = ie.cssHooks[t] || ie.cssHooks[a], void 0 === n ? s && "get" in s && void 0 !== (i = s.get(e, !1, r)) ? i : l[t] : (o = typeof n, "string" === o && (i = Je.exec(n)) && (n = (i[1] + 1) * i[2] + parseFloat(ie.css(e, t)), o = "number"), void(null != n && n === n && ("number" !== o || ie.cssNumber[a] || (n += "px"), te.clearCloneStyle || "" !== n || 0 !== t.indexOf("background") || (l[t] = "inherit"), s && "set" in s && void 0 === (n = s.set(e, n, r)) || (l[t] = n)))) } }, css: function (e, t, n, r) { var i, o, s, a = ie.camelCase(t); return t = ie.cssProps[a] || (ie.cssProps[a] = S(e.style, a)), s = ie.cssHooks[t] || ie.cssHooks[a], s && "get" in s && (i = s.get(e, !0, n)), void 0 === i && (i = I(e, t, r)), "normal" === i && t in Qe && (i = Qe[t]), "" === n || n ? (o = parseFloat(i), !0 === n || ie.isNumeric(o) ? o || 0 : i) : i } }), ie.each(["height", "width"], function (e, t) { ie.cssHooks[t] = { get: function (e, n, r) { return n ? Xe.test(ie.css(e, "display")) && 0 === e.offsetWidth ? ie.swap(e, Ye, function () { return D(e, t, r) }) : D(e, t, r) : void 0 }, set: function (e, n, r) { var i = r && Ge(e); return E(e, n, r ? A(e, t, r, "border-box" === ie.css(e, "boxSizing", !1, i), i) : 0) } } }), ie.cssHooks.marginRight = j(te.reliableMarginRight, function (e, t) { return t ? ie.swap(e, {display: "inline-block"}, I, [e, "marginRight"]) : void 0 }), ie.each({margin: "", padding: "", border: "Width"}, function (e, t) { ie.cssHooks[e + t] = { expand: function (n) { for (var r = 0, i = {}, o = "string" == typeof n ? n.split(" ") : [n]; 4 > r; r++) i[e + Ie[r] + t] = o[r] || o[r - 2] || o[0]; return i } }, Be.test(e) || (ie.cssHooks[e + t].set = E) }), ie.fn.extend({ css: function (e, t) { return we(this, function (e, t, n) { var r, i, o = {}, s = 0; if (ie.isArray(t)) { for (r = Ge(e), i = t.length; i > s; s++) o[t[s]] = ie.css(e, t[s], !1, r); return o } return void 0 !== n ? ie.style(e, t, n) : ie.css(e, t) }, e, t, arguments.length > 1) }, show: function () { return M(this, !0) }, hide: function () { return M(this) }, toggle: function (e) { return "boolean" == typeof e ? e ? this.show() : this.hide() : this.each(function () { je(this) ? ie(this).show() : ie(this).hide() }) } }), ie.Tween = N, N.prototype = { constructor: N, init: function (e, t, n, r, i, o) { this.elem = e, this.prop = n, this.easing = i || "swing", this.options = t, this.start = this.now = this.cur(), this.end = r, this.unit = o || (ie.cssNumber[n] ? "" : "px") }, cur: function () { var e = N.propHooks[this.prop]; return e && e.get ? e.get(this) : N.propHooks._default.get(this) }, run: function (e) { var t, n = N.propHooks[this.prop]; return this.options.duration ? this.pos = t = ie.easing[this.easing](e, this.options.duration * e, 0, 1, this.options.duration) : this.pos = t = e, this.now = (this.end - this.start) * t + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), n && n.set ? n.set(this) : N.propHooks._default.set(this), this } }, N.prototype.init.prototype = N.prototype, N.propHooks = { _default: { get: function (e) { var t; return null == e.elem[e.prop] || e.elem.style && null != e.elem.style[e.prop] ? (t = ie.css(e.elem, e.prop, ""), t && "auto" !== t ? t : 0) : e.elem[e.prop] }, set: function (e) { ie.fx.step[e.prop] ? ie.fx.step[e.prop](e) : e.elem.style && (null != e.elem.style[ie.cssProps[e.prop]] || ie.cssHooks[e.prop]) ? ie.style(e.elem, e.prop, e.now + e.unit) : e.elem[e.prop] = e.now } } }, N.propHooks.scrollTop = N.propHooks.scrollLeft = { set: function (e) { e.elem.nodeType && e.elem.parentNode && (e.elem[e.prop] = e.now) } }, ie.easing = { linear: function (e) { return e }, swing: function (e) { return .5 - Math.cos(e * Math.PI) / 2 } }, ie.fx = N.prototype.init, ie.fx.step = {}; var et, tt, nt = /^(?:toggle|show|hide)$/, rt = new RegExp("^(?:([+-])=|)(" + Te + ")([a-z%]*)$", "i"), it = /queueHooks$/, ot = [O], st = { "*": [function (e, t) { var n = this.createTween(e, t), r = n.cur(), i = rt.exec(t), o = i && i[3] || (ie.cssNumber[e] ? "" : "px"), s = (ie.cssNumber[e] || "px" !== o && +r) && rt.exec(ie.css(n.elem, e)), a = 1, l = 20; if (s && s[3] !== o) { o = o || s[3], i = i || [], s = +r || 1; do { a = a || ".5", s /= a, ie.style(n.elem, e, s + o) } while (a !== (a = n.cur() / r) && 1 !== a && --l) } return i && (s = n.start = +s || +r || 0, n.unit = o, n.end = i[1] ? s + (i[1] + 1) * i[2] : +i[2]), n }] }; ie.Animation = ie.extend(F, { tweener: function (e, t) { ie.isFunction(e) ? (t = e, e = ["*"]) : e = e.split(" "); for (var n, r = 0, i = e.length; i > r; r++) n = e[r], st[n] = st[n] || [], st[n].unshift(t) }, prefilter: function (e, t) { t ? ot.unshift(e) : ot.push(e) } }), ie.speed = function (e, t, n) { var r = e && "object" == typeof e ? ie.extend({}, e) : {complete: n || !n && t || ie.isFunction(e) && e, duration: e, easing: n && t || t && !ie.isFunction(t) && t}; return r.duration = ie.fx.off ? 0 : "number" == typeof r.duration ? r.duration : r.duration in ie.fx.speeds ? ie.fx.speeds[r.duration] : ie.fx.speeds._default, (null == r.queue || !0 === r.queue) && (r.queue = "fx"), r.old = r.complete, r.complete = function () { ie.isFunction(r.old) && r.old.call(this), r.queue && ie.dequeue(this, r.queue) }, r }, ie.fn.extend({ fadeTo: function (e, t, n, r) { return this.filter(je).css("opacity", 0).show().end().animate({opacity: t}, e, n, r) }, animate: function (e, t, n, r) { var i = ie.isEmptyObject(e), o = ie.speed(t, n, r), s = function () { var t = F(this, ie.extend({}, e), o); (i || xe.get(this, "finish")) && t.stop(!0) }; return s.finish = s, i || !1 === o.queue ? this.each(s) : this.queue(o.queue, s) }, stop: function (e, t, n) { var r = function (e) { var t = e.stop; delete e.stop, t(n) }; return "string" != typeof e && (n = t, t = e, e = void 0), t && !1 !== e && this.queue(e || "fx", []), this.each(function () { var t = !0, i = null != e && e + "queueHooks", o = ie.timers, s = xe.get(this); if (i) s[i] && s[i].stop && r(s[i]); else for (i in s) s[i] && s[i].stop && it.test(i) && r(s[i]); for (i = o.length; i--;) o[i].elem !== this || null != e && o[i].queue !== e || (o[i].anim.stop(n), t = !1, o.splice(i, 1)); (t || !n) && ie.dequeue(this, e) }) }, finish: function (e) { return !1 !== e && (e = e || "fx"), this.each(function () { var t, n = xe.get(this), r = n[e + "queue"], i = n[e + "queueHooks"], o = ie.timers, s = r ? r.length : 0; for (n.finish = !0, ie.queue(this, e, []), i && i.stop && i.stop.call(this, !0), t = o.length; t--;) o[t].elem === this && o[t].queue === e && (o[t].anim.stop(!0), o.splice(t, 1)); for (t = 0; s > t; t++) r[t] && r[t].finish && r[t].finish.call(this); delete n.finish }) } }), ie.each(["toggle", "show", "hide"], function (e, t) { var n = ie.fn[t]; ie.fn[t] = function (e, r, i) { return null == e || "boolean" == typeof e ? n.apply(this, arguments) : this.animate(R(t, !0), e, r, i) } }), ie.each({slideDown: R("show"), slideUp: R("hide"), slideToggle: R("toggle"), fadeIn: {opacity: "show"}, fadeOut: {opacity: "hide"}, fadeToggle: {opacity: "toggle"}}, function (e, t) { ie.fn[e] = function (e, n, r) { return this.animate(t, e, n, r) } }), ie.timers = [], ie.fx.tick = function () { var e, t = 0, n = ie.timers; for (et = ie.now(); t < n.length; t++) (e = n[t])() || n[t] !== e || n.splice(t--, 1); n.length || ie.fx.stop(), et = void 0 }, ie.fx.timer = function (e) { ie.timers.push(e), e() ? ie.fx.start() : ie.timers.pop() }, ie.fx.interval = 13, ie.fx.start = function () { tt || (tt = setInterval(ie.fx.tick, ie.fx.interval)) }, ie.fx.stop = function () { clearInterval(tt), tt = null }, ie.fx.speeds = {slow: 600, fast: 200, _default: 400}, ie.fn.delay = function (e, t) { return e = ie.fx ? ie.fx.speeds[e] || e : e, t = t || "fx", this.queue(t, function (t, n) { var r = setTimeout(t, e); n.stop = function () { clearTimeout(r) } }) }, function () { var e = ne.createElement("input"), t = ne.createElement("select"), n = t.appendChild(ne.createElement("option")); e.type = "checkbox", te.checkOn = "" !== e.value, te.optSelected = n.selected, t.disabled = !0, te.optDisabled = !n.disabled, e = ne.createElement("input"), e.value = "t", e.type = "radio", te.radioValue = "t" === e.value }(); var at, lt = ie.expr.attrHandle; ie.fn.extend({ attr: function (e, t) { return we(this, ie.attr, e, t, arguments.length > 1) }, removeAttr: function (e) { return this.each(function () { ie.removeAttr(this, e) }) } }), ie.extend({ attr: function (e, t, n) { var r, i, o = e.nodeType; if (e && 3 !== o && 8 !== o && 2 !== o) return typeof e.getAttribute === Ee ? ie.prop(e, t, n) : (1 === o && ie.isXMLDoc(e) || (t = t.toLowerCase(), r = ie.attrHooks[t] || (ie.expr.match.bool.test(t) ? at : void 0)), void 0 === n ? r && "get" in r && null !== (i = r.get(e, t)) ? i : (i = ie.find.attr(e, t), null == i ? void 0 : i) : null !== n ? r && "set" in r && void 0 !== (i = r.set(e, n, t)) ? i : (e.setAttribute(t, n + ""), n) : void ie.removeAttr(e, t)) }, removeAttr: function (e, t) { var n, r, i = 0, o = t && t.match(ge); if (o && 1 === e.nodeType) for (; n = o[i++];) r = ie.propFix[n] || n, ie.expr.match.bool.test(n) && (e[r] = !1), e.removeAttribute(n) }, attrHooks: { type: { set: function (e, t) { if (!te.radioValue && "radio" === t && ie.nodeName(e, "input")) { var n = e.value; return e.setAttribute("type", t), n && (e.value = n), t } } } } }), at = { set: function (e, t, n) { return !1 === t ? ie.removeAttr(e, n) : e.setAttribute(n, n), n } }, ie.each(ie.expr.match.bool.source.match(/\w+/g), function (e, t) { var n = lt[t] || ie.find.attr; lt[t] = function (e, t, r) { var i, o; return r || (o = lt[t], lt[t] = i, i = null != n(e, t, r) ? t.toLowerCase() : null, lt[t] = o), i } }); var ut = /^(?:input|select|textarea|button)$/i; ie.fn.extend({ prop: function (e, t) { return we(this, ie.prop, e, t, arguments.length > 1) }, removeProp: function (e) { return this.each(function () { delete this[ie.propFix[e] || e] }) } }), ie.extend({ propFix: {for: "htmlFor", class: "className"}, prop: function (e, t, n) { var r, i, o, s = e.nodeType; if (e && 3 !== s && 8 !== s && 2 !== s) return o = 1 !== s || !ie.isXMLDoc(e), o && (t = ie.propFix[t] || t, i = ie.propHooks[t]), void 0 !== n ? i && "set" in i && void 0 !== (r = i.set(e, n, t)) ? r : e[t] = n : i && "get" in i && null !== (r = i.get(e, t)) ? r : e[t] }, propHooks: { tabIndex: { get: function (e) { return e.hasAttribute("tabindex") || ut.test(e.nodeName) || e.href ? e.tabIndex : -1 } } } }), te.optSelected || (ie.propHooks.selected = { get: function (e) { var t = e.parentNode; return t && t.parentNode && t.parentNode.selectedIndex, null } }), ie.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function () { ie.propFix[this.toLowerCase()] = this }); var ct = /[\t\r\n\f]/g; ie.fn.extend({ addClass: function (e) { var t, n, r, i, o, s, a = "string" == typeof e && e, l = 0, u = this.length; if (ie.isFunction(e)) return this.each(function (t) { ie(this).addClass(e.call(this, t, this.className)) }); if (a) for (t = (e || "").match(ge) || []; u > l; l++) if (n = this[l], r = 1 === n.nodeType && (n.className ? (" " + n.className + " ").replace(ct, " ") : " ")) { for (o = 0; i = t[o++];) r.indexOf(" " + i + " ") < 0 && (r += i + " "); s = ie.trim(r), n.className !== s && (n.className = s) } return this }, removeClass: function (e) { var t, n, r, i, o, s, a = 0 === arguments.length || "string" == typeof e && e, l = 0, u = this.length; if (ie.isFunction(e)) return this.each(function (t) { ie(this).removeClass(e.call(this, t, this.className)) }); if (a) for (t = (e || "").match(ge) || []; u > l; l++) if (n = this[l], r = 1 === n.nodeType && (n.className ? (" " + n.className + " ").replace(ct, " ") : "")) { for (o = 0; i = t[o++];) for (; r.indexOf(" " + i + " ") >= 0;) r = r.replace(" " + i + " ", " "); s = e ? ie.trim(r) : "", n.className !== s && (n.className = s) } return this }, toggleClass: function (e, t) { var n = typeof e; return "boolean" == typeof t && "string" === n ? t ? this.addClass(e) : this.removeClass(e) : this.each(ie.isFunction(e) ? function (n) { ie(this).toggleClass(e.call(this, n, this.className, t), t) } : function () { if ("string" === n) for (var t, r = 0, i = ie(this), o = e.match(ge) || []; t = o[r++];) i.hasClass(t) ? i.removeClass(t) : i.addClass(t); else (n === Ee || "boolean" === n) && (this.className && xe.set(this, "__className__", this.className), this.className = this.className || !1 === e ? "" : xe.get(this, "__className__") || "") }) }, hasClass: function (e) { for (var t = " " + e + " ", n = 0, r = this.length; r > n; n++) if (1 === this[n].nodeType && (" " + this[n].className + " ").replace(ct, " ").indexOf(t) >= 0) return !0; return !1 } }); var dt = /\r/g; ie.fn.extend({ val: function (e) { var t, n, r, i = this[0]; return arguments.length ? (r = ie.isFunction(e), this.each(function (n) { var i; 1 === this.nodeType && (i = r ? e.call(this, n, ie(this).val()) : e, null == i ? i = "" : "number" == typeof i ? i += "" : ie.isArray(i) && (i = ie.map(i, function (e) { return null == e ? "" : e + "" })), (t = ie.valHooks[this.type] || ie.valHooks[this.nodeName.toLowerCase()]) && "set" in t && void 0 !== t.set(this, i, "value") || (this.value = i)) })) : i ? (t = ie.valHooks[i.type] || ie.valHooks[i.nodeName.toLowerCase()], t && "get" in t && void 0 !== (n = t.get(i, "value")) ? n : (n = i.value, "string" == typeof n ? n.replace(dt, "") : null == n ? "" : n)) : void 0 } }), ie.extend({ valHooks: { option: { get: function (e) { var t = ie.find.attr(e, "value"); return null != t ? t : ie.trim(ie.text(e)) } }, select: { get: function (e) { for (var t, n, r = e.options, i = e.selectedIndex, o = "select-one" === e.type || 0 > i, s = o ? null : [], a = o ? i + 1 : r.length, l = 0 > i ? a : o ? i : 0; a > l; l++) if (n = r[l], !(!n.selected && l !== i || (te.optDisabled ? n.disabled : null !== n.getAttribute("disabled")) || n.parentNode.disabled && ie.nodeName(n.parentNode, "optgroup"))) { if (t = ie(n).val(), o) return t; s.push(t) } return s }, set: function (e, t) { for (var n, r, i = e.options, o = ie.makeArray(t), s = i.length; s--;) r = i[s], (r.selected = ie.inArray(r.value, o) >= 0) && (n = !0); return n || (e.selectedIndex = -1), o } } } }), ie.each(["radio", "checkbox"], function () { ie.valHooks[this] = { set: function (e, t) { return ie.isArray(t) ? e.checked = ie.inArray(ie(e).val(), t) >= 0 : void 0 } }, te.checkOn || (ie.valHooks[this].get = function (e) { return null === e.getAttribute("value") ? "on" : e.value }) }), ie.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function (e, t) { ie.fn[t] = function (e, n) { return arguments.length > 0 ? this.on(t, null, e, n) : this.trigger(t) } }), ie.fn.extend({ hover: function (e, t) { return this.mouseenter(e).mouseleave(t || e) }, bind: function (e, t, n) { return this.on(e, null, t, n) }, unbind: function (e, t) { return this.off(e, null, t) }, delegate: function (e, t, n, r) { return this.on(t, e, n, r) }, undelegate: function (e, t, n) { return 1 === arguments.length ? this.off(e, "**") : this.off(t, e || "**", n) } }); var ft = ie.now(), pt = /\?/; ie.parseJSON = function (e) { return JSON.parse(e + "") }, ie.parseXML = function (e) { var t, n; if (!e || "string" != typeof e) return null; try { n = new DOMParser, t = n.parseFromString(e, "text/xml") } catch (e) { t = void 0 } return (!t || t.getElementsByTagName("parsererror").length) && ie.error("Invalid XML: " + e), t }; var ht = /#.*$/, mt = /([?&])_=[^&]*/, vt = /^(.*?):[ \t]*([^\r\n]*)$/gm, gt = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, yt = /^(?:GET|HEAD)$/, bt = /^\/\//, wt = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, xt = {}, kt = {}, _t = "*/".concat("*"), Ct = o.location.href, Tt = wt.exec(Ct.toLowerCase()) || []; ie.extend({ active: 0, lastModified: {}, etag: {}, ajaxSettings: { url: Ct, type: "GET", isLocal: gt.test(Tt[1]), global: !0, processData: !0, async: !0, contentType: "application/x-www-form-urlencoded; charset=UTF-8", accepts: {"*": _t, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript"}, contents: {xml: /xml/, html: /html/, json: /json/}, responseFields: {xml: "responseXML", text: "responseText", json: "responseJSON"}, converters: {"* text": String, "text html": !0, "text json": ie.parseJSON, "text xml": ie.parseXML}, flatOptions: {url: !0, context: !0} }, ajaxSetup: function (e, t) { return t ? H(H(e, ie.ajaxSettings), t) : H(ie.ajaxSettings, e) }, ajaxPrefilter: z(xt), ajaxTransport: z(kt), ajax: function (e, t) { function n(e, t, n, s) { var l, c, g, y, w, k = t; 2 !== b && (b = 2, a && clearTimeout(a), r = void 0, o = s || "", x.readyState = e > 0 ? 4 : 0, l = e >= 200 && 300 > e || 304 === e, n && (y = V(d, x, n)), y = W(d, y, x, l), l ? (d.ifModified && (w = x.getResponseHeader("Last-Modified"), w && (ie.lastModified[i] = w), (w = x.getResponseHeader("etag")) && (ie.etag[i] = w)), 204 === e || "HEAD" === d.type ? k = "nocontent" : 304 === e ? k = "notmodified" : (k = y.state, c = y.data, g = y.error, l = !g)) : (g = k, (e || !k) && (k = "error", 0 > e && (e = 0))), x.status = e, x.statusText = (t || k) + "", l ? h.resolveWith(f, [c, k, x]) : h.rejectWith(f, [x, k, g]), x.statusCode(v), v = void 0, u && p.trigger(l ? "ajaxSuccess" : "ajaxError", [x, d, l ? c : g]), m.fireWith(f, [x, k]), u && (p.trigger("ajaxComplete", [x, d]), --ie.active || ie.event.trigger("ajaxStop"))) } "object" == typeof e && (t = e, e = void 0), t = t || {}; var r, i, o, s, a, l, u, c, d = ie.ajaxSetup({}, t), f = d.context || d, p = d.context && (f.nodeType || f.jquery) ? ie(f) : ie.event, h = ie.Deferred(), m = ie.Callbacks("once memory"), v = d.statusCode || {}, g = {}, y = {}, b = 0, w = "canceled", x = { readyState: 0, getResponseHeader: function (e) { var t; if (2 === b) { if (!s) for (s = {}; t = vt.exec(o);) s[t[1].toLowerCase()] = t[2]; t = s[e.toLowerCase()] } return null == t ? null : t }, getAllResponseHeaders: function () { return 2 === b ? o : null }, setRequestHeader: function (e, t) { var n = e.toLowerCase(); return b || (e = y[n] = y[n] || e, g[e] = t), this }, overrideMimeType: function (e) { return b || (d.mimeType = e), this }, statusCode: function (e) { var t; if (e) if (2 > b) for (t in e) v[t] = [v[t], e[t]]; else x.always(e[x.status]); return this }, abort: function (e) { var t = e || w; return r && r.abort(t), n(0, t), this } }; if (h.promise(x).complete = m.add, x.success = x.done, x.error = x.fail, d.url = ((e || d.url || Ct) + "").replace(ht, "").replace(bt, Tt[1] + "//"), d.type = t.method || t.type || d.method || d.type, d.dataTypes = ie.trim(d.dataType || "*").toLowerCase().match(ge) || [""], null == d.crossDomain && (l = wt.exec(d.url.toLowerCase()), d.crossDomain = !(!l || l[1] === Tt[1] && l[2] === Tt[2] && (l[3] || ("http:" === l[1] ? "80" : "443")) === (Tt[3] || ("http:" === Tt[1] ? "80" : "443")))), d.data && d.processData && "string" != typeof d.data && (d.data = ie.param(d.data, d.traditional)), $(xt, d, t, x), 2 === b) return x; u = ie.event && d.global, u && 0 == ie.active++ && ie.event.trigger("ajaxStart"), d.type = d.type.toUpperCase(), d.hasContent = !yt.test(d.type), i = d.url, d.hasContent || (d.data && (i = d.url += (pt.test(i) ? "&" : "?") + d.data, delete d.data), !1 === d.cache && (d.url = mt.test(i) ? i.replace(mt, "$1_=" + ft++) : i + (pt.test(i) ? "&" : "?") + "_=" + ft++)), d.ifModified && (ie.lastModified[i] && x.setRequestHeader("If-Modified-Since", ie.lastModified[i]), ie.etag[i] && x.setRequestHeader("If-None-Match", ie.etag[i])), (d.data && d.hasContent && !1 !== d.contentType || t.contentType) && x.setRequestHeader("Content-Type", d.contentType), x.setRequestHeader("Accept", d.dataTypes[0] && d.accepts[d.dataTypes[0]] ? d.accepts[d.dataTypes[0]] + ("*" !== d.dataTypes[0] ? ", " + _t + "; q=0.01" : "") : d.accepts["*"]); for (c in d.headers) x.setRequestHeader(c, d.headers[c]); if (d.beforeSend && (!1 === d.beforeSend.call(f, x, d) || 2 === b)) return x.abort(); w = "abort"; for (c in{success: 1, error: 1, complete: 1}) x[c](d[c]); if (r = $(kt, d, t, x)) { x.readyState = 1, u && p.trigger("ajaxSend", [x, d]), d.async && d.timeout > 0 && (a = setTimeout(function () { x.abort("timeout") }, d.timeout)); try { b = 1, r.send(g, n) } catch (e) { if (!(2 > b)) throw e; n(-1, e) } } else n(-1, "No Transport"); return x }, getJSON: function (e, t, n) { return ie.get(e, t, n, "json") }, getScript: function (e, t) { return ie.get(e, void 0, t, "script") } }), ie.each(["get", "post"], function (e, t) { ie[t] = function (e, n, r, i) { return ie.isFunction(n) && (i = i || r, r = n, n = void 0), ie.ajax({url: e, type: t, dataType: i, data: n, success: r}) } }), ie._evalUrl = function (e) { return ie.ajax({url: e, type: "GET", dataType: "script", async: !1, global: !1, throws: !0}) }, ie.fn.extend({ wrapAll: function (e) { var t; return ie.isFunction(e) ? this.each(function (t) { ie(this).wrapAll(e.call(this, t)) }) : (this[0] && (t = ie(e, this[0].ownerDocument).eq(0).clone(!0), this[0].parentNode && t.insertBefore(this[0]), t.map(function () { for (var e = this; e.firstElementChild;) e = e.firstElementChild; return e }).append(this)), this) }, wrapInner: function (e) { return this.each(ie.isFunction(e) ? function (t) { ie(this).wrapInner(e.call(this, t)) } : function () { var t = ie(this), n = t.contents(); n.length ? n.wrapAll(e) : t.append(e) }) }, wrap: function (e) { var t = ie.isFunction(e); return this.each(function (n) { ie(this).wrapAll(t ? e.call(this, n) : e) }) }, unwrap: function () { return this.parent().each(function () { ie.nodeName(this, "body") || ie(this).replaceWith(this.childNodes) }).end() } }), ie.expr.filters.hidden = function (e) { return e.offsetWidth <= 0 && e.offsetHeight <= 0 }, ie.expr.filters.visible = function (e) { return !ie.expr.filters.hidden(e) }; var It = /%20/g, jt = /\[\]$/, St = /\r?\n/g, Et = /^(?:submit|button|image|reset|file)$/i, At = /^(?:input|select|textarea|keygen)/i; ie.param = function (e, t) { var n, r = [], i = function (e, t) { t = ie.isFunction(t) ? t() : null == t ? "" : t, r[r.length] = encodeURIComponent(e) + "=" + encodeURIComponent(t) }; if (void 0 === t && (t = ie.ajaxSettings && ie.ajaxSettings.traditional), ie.isArray(e) || e.jquery && !ie.isPlainObject(e)) ie.each(e, function () { i(this.name, this.value) }); else for (n in e) B(n, e[n], t, i); return r.join("&").replace(It, "+") }, ie.fn.extend({ serialize: function () { return ie.param(this.serializeArray()) }, serializeArray: function () { return this.map(function () { var e = ie.prop(this, "elements"); return e ? ie.makeArray(e) : this }).filter(function () { var e = this.type; return this.name && !ie(this).is(":disabled") && At.test(this.nodeName) && !Et.test(e) && (this.checked || !Se.test(e)) }).map(function (e, t) { var n = ie(this).val(); return null == n ? null : ie.isArray(n) ? ie.map(n, function (e) { return {name: t.name, value: e.replace(St, "\r\n")} }) : {name: t.name, value: n.replace(St, "\r\n")} }).get() } }), ie.ajaxSettings.xhr = function () { try { return new XMLHttpRequest } catch (e) { } }; var Dt = 0, Mt = {}, Nt = {0: 200, 1223: 204}, Pt = ie.ajaxSettings.xhr(); o.attachEvent && o.attachEvent("onunload", function () { for (var e in Mt) Mt[e]() }), te.cors = !!Pt && "withCredentials" in Pt, te.ajax = Pt = !!Pt, ie.ajaxTransport(function (e) { var t; return te.cors || Pt && !e.crossDomain ? { send: function (n, r) { var i, o = e.xhr(), s = ++Dt; if (o.open(e.type, e.url, e.async, e.username, e.password), e.xhrFields) for (i in e.xhrFields) o[i] = e.xhrFields[i]; e.mimeType && o.overrideMimeType && o.overrideMimeType(e.mimeType), e.crossDomain || n["X-Requested-With"] || (n["X-Requested-With"] = "XMLHttpRequest"); for (i in n) o.setRequestHeader(i, n[i]); t = function (e) { return function () { t && (delete Mt[s], t = o.onload = o.onerror = null, "abort" === e ? o.abort() : "error" === e ? r(o.status, o.statusText) : r(Nt[o.status] || o.status, o.statusText, "string" == typeof o.responseText ? {text: o.responseText} : void 0, o.getAllResponseHeaders())) } }, o.onload = t(), o.onerror = t("error"), t = Mt[s] = t("abort"); try { o.send(e.hasContent && e.data || null) } catch (e) { if (t) throw e } }, abort: function () { t && t() } } : void 0 }), ie.ajaxSetup({ accepts: {script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"}, contents: {script: /(?:java|ecma)script/}, converters: { "text script": function (e) { return ie.globalEval(e), e } } }), ie.ajaxPrefilter("script", function (e) { void 0 === e.cache && (e.cache = !1), e.crossDomain && (e.type = "GET") }), ie.ajaxTransport("script", function (e) { if (e.crossDomain) { var t, n; return { send: function (r, i) { t = ie("<script>").prop({async: !0, charset: e.scriptCharset, src: e.url}).on("load error", n = function (e) { t.remove(), n = null, e && i("error" === e.type ? 404 : 200, e.type) }), ne.head.appendChild(t[0]) }, abort: function () { n && n() } } } }); var Rt = [], Lt = /(=)\?(?=&|$)|\?\?/; ie.ajaxSetup({ jsonp: "callback", jsonpCallback: function () { var e = Rt.pop() || ie.expando + "_" + ft++; return this[e] = !0, e } }), ie.ajaxPrefilter("json jsonp", function (e, t, n) { var r, i, s, a = !1 !== e.jsonp && (Lt.test(e.url) ? "url" : "string" == typeof e.data && !(e.contentType || "").indexOf("application/x-www-form-urlencoded") && Lt.test(e.data) && "data"); return a || "jsonp" === e.dataTypes[0] ? (r = e.jsonpCallback = ie.isFunction(e.jsonpCallback) ? e.jsonpCallback() : e.jsonpCallback, a ? e[a] = e[a].replace(Lt, "$1" + r) : !1 !== e.jsonp && (e.url += (pt.test(e.url) ? "&" : "?") + e.jsonp + "=" + r), e.converters["script json"] = function () { return s || ie.error(r + " was not called"), s[0] }, e.dataTypes[0] = "json", i = o[r], o[r] = function () { s = arguments }, n.always(function () { o[r] = i, e[r] && (e.jsonpCallback = t.jsonpCallback, Rt.push(r)), s && ie.isFunction(i) && i(s[0]), s = i = void 0 }), "script") : void 0 }), ie.parseHTML = function (e, t, n) { if (!e || "string" != typeof e) return null; "boolean" == typeof t && (n = t, t = !1), t = t || ne; var r = de.exec(e), i = !n && []; return r ? [t.createElement(r[1])] : (r = ie.buildFragment([e], t, i), i && i.length && ie(i).remove(), ie.merge([], r.childNodes)) }; var Ot = ie.fn.load; ie.fn.load = function (e, t, n) { if ("string" != typeof e && Ot) return Ot.apply(this, arguments); var r, i, o, s = this, a = e.indexOf(" "); return a >= 0 && (r = ie.trim(e.slice(a)), e = e.slice(0, a)), ie.isFunction(t) ? (n = t, t = void 0) : t && "object" == typeof t && (i = "POST"), s.length > 0 && ie.ajax({ url: e, type: i, dataType: "html", data: t }).done(function (e) { o = arguments, s.html(r ? ie("<div>").append(ie.parseHTML(e)).find(r) : e) }).complete(n && function (e, t) { s.each(n, o || [e.responseText, t, e]) }), this }, ie.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function (e, t) { ie.fn[t] = function (e) { return this.on(t, e) } }), ie.expr.filters.animated = function (e) { return ie.grep(ie.timers, function (t) { return e === t.elem }).length }; var qt = o.document.documentElement; ie.offset = { setOffset: function (e, t, n) { var r, i, o, s, a, l, u, c = ie.css(e, "position"), d = ie(e), f = {}; "static" === c && (e.style.position = "relative"), a = d.offset(), o = ie.css(e, "top"), l = ie.css(e, "left"), u = ("absolute" === c || "fixed" === c) && (o + l).indexOf("auto") > -1, u ? (r = d.position(), s = r.top, i = r.left) : (s = parseFloat(o) || 0, i = parseFloat(l) || 0), ie.isFunction(t) && (t = t.call(e, n, a)), null != t.top && (f.top = t.top - a.top + s), null != t.left && (f.left = t.left - a.left + i), "using" in t ? t.using.call(e, f) : d.css(f) } }, ie.fn.extend({ offset: function (e) { if (arguments.length) return void 0 === e ? this : this.each(function (t) { ie.offset.setOffset(this, e, t) }); var t, n, r = this[0], i = {top: 0, left: 0}, o = r && r.ownerDocument; return o ? (t = o.documentElement, ie.contains(t, r) ? (typeof r.getBoundingClientRect !== Ee && (i = r.getBoundingClientRect()), n = U(o), { top: i.top + n.pageYOffset - t.clientTop, left: i.left + n.pageXOffset - t.clientLeft }) : i) : void 0 }, position: function () { if (this[0]) { var e, t, n = this[0], r = {top: 0, left: 0}; return "fixed" === ie.css(n, "position") ? t = n.getBoundingClientRect() : (e = this.offsetParent(), t = this.offset(), ie.nodeName(e[0], "html") || (r = e.offset()), r.top += ie.css(e[0], "borderTopWidth", !0), r.left += ie.css(e[0], "borderLeftWidth", !0)), { top: t.top - r.top - ie.css(n, "marginTop", !0), left: t.left - r.left - ie.css(n, "marginLeft", !0) } } }, offsetParent: function () { return this.map(function () { for (var e = this.offsetParent || qt; e && !ie.nodeName(e, "html") && "static" === ie.css(e, "position");) e = e.offsetParent; return e || qt }) } }), ie.each({scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function (e, t) { var n = "pageYOffset" === t; ie.fn[e] = function (r) { return we(this, function (e, r, i) { var s = U(e); return void 0 === i ? s ? s[t] : e[r] : void(s ? s.scrollTo(n ? o.pageXOffset : i, n ? i : o.pageYOffset) : e[r] = i) }, e, r, arguments.length, null) } }), ie.each(["top", "left"], function (e, t) { ie.cssHooks[t] = j(te.pixelPosition, function (e, n) { return n ? (n = I(e, t), Ue.test(n) ? ie(e).position()[t] + "px" : n) : void 0 }) }), ie.each({Height: "height", Width: "width"}, function (e, t) { ie.each({padding: "inner" + e, content: t, "": "outer" + e}, function (n, r) { ie.fn[r] = function (r, i) { var o = arguments.length && (n || "boolean" != typeof r), s = n || (!0 === r || !0 === i ? "margin" : "border"); return we(this, function (t, n, r) { var i; return ie.isWindow(t) ? t.document.documentElement["client" + e] : 9 === t.nodeType ? (i = t.documentElement, Math.max(t.body["scroll" + e], i["scroll" + e], t.body["offset" + e], i["offset" + e], i["client" + e])) : void 0 === r ? ie.css(t, n, s) : ie.style(t, n, r, s) }, t, o ? r : void 0, o, null) } }) }), ie.fn.size = function () { return this.length }, ie.fn.andSelf = ie.fn.addBack, n(359) && (r = [], void 0 !== (i = function () { return ie }.apply(t, r)) && (e.exports = i)); var Ft = o.jQuery, zt = o.$; return ie.noConflict = function (e) { return o.$ === ie && (o.$ = zt), e && o.jQuery === ie && (o.jQuery = Ft), ie }, typeof s === Ee && (o.jQuery = o.$ = ie), ie }) }, 363: function (e, t, n) { var r, i, o; /*! Papa Parse v4.3.2 https://github.com/mholt/PapaParse */ !function (n, s) { i = [], r = s, void 0 !== (o = "function" == typeof r ? r.apply(t, i) : r) && (e.exports = o) }(0, function () { "use strict"; function e(e, t) { t = t || {}; var n = t.dynamicTyping || !1; if (v(n) && (t.dynamicTypingFunction = n, n = {}), t.dynamicTyping = n, t.worker && C.WORKERS_SUPPORTED) { var a = u(); return a.userStep = t.step, a.userChunk = t.chunk, a.userComplete = t.complete, a.userError = t.error, t.step = v(t.step), t.chunk = v(t.chunk), t.complete = v(t.complete), t.error = v(t.error), delete t.worker, void a.postMessage({ input: e, config: t, workerId: a.id }) } var l = null; return "string" == typeof e ? l = t.download ? new r(t) : new o(t) : !0 === e.readable && v(e.read) && v(e.on) ? l = new s(t) : (y.File && e instanceof File || e instanceof Object) && (l = new i(t)), l.stream(e) } function t(e, t) { function n(e) { if ("object" != typeof e) return []; var t = []; for (var n in e) t.push(n); return t } function r(e, t) { var n = ""; "string" == typeof e && (e = JSON.parse(e)), "string" == typeof t && (t = JSON.parse(t)); var r = e instanceof Array && e.length > 0, o = !(t[0] instanceof Array); if (r && a) { for (var s = 0; s < e.length; s++) s > 0 && (n += l), n += i(e[s], s); t.length > 0 && (n += u) } for (var c = 0; c < t.length; c++) { for (var d = r ? e.length : t[c].length, f = 0; f < d; f++) { f > 0 && (n += l); var p = r && o ? e[f] : f; n += i(t[c][p], f) } c < t.length - 1 && (n += u) } return n } function i(e, t) { return void 0 === e || null === e ? "" : (e = e.toString().replace(d, c + c), "boolean" == typeof s && s || s instanceof Array && s[t] || o(e, C.BAD_DELIMITERS) || e.indexOf(l) > -1 || " " === e.charAt(0) || " " === e.charAt(e.length - 1) ? c + e + c : e) } function o(e, t) { for (var n = 0; n < t.length; n++) if (e.indexOf(t[n]) > -1) return !0; return !1 } var s = !1, a = !0, l = ",", u = "\r\n", c = '"'; !function () { "object" == typeof t && ("string" == typeof t.delimiter && 1 === t.delimiter.length && -1 === C.BAD_DELIMITERS.indexOf(t.delimiter) && (l = t.delimiter), ("boolean" == typeof t.quotes || t.quotes instanceof Array) && (s = t.quotes), "string" == typeof t.newline && (u = t.newline), "string" == typeof t.quoteChar && (c = t.quoteChar), "boolean" == typeof t.header && (a = t.header)) }(); var d = new RegExp(c, "g"); if ("string" == typeof e && (e = JSON.parse(e)), e instanceof Array) { if (!e.length || e[0] instanceof Array) return r(null, e); if ("object" == typeof e[0]) return r(n(e[0]), e) } else if ("object" == typeof e) return "string" == typeof e.data && (e.data = JSON.parse(e.data)), e.data instanceof Array && (e.fields || (e.fields = e.meta && e.meta.fields), e.fields || (e.fields = e.data[0] instanceof Array ? e.fields : n(e.data[0])), e.data[0] instanceof Array || "object" == typeof e.data[0] || (e.data = [e.data])), r(e.fields || [], e.data || []); throw"exception: Unable to serialize unrecognized input" } function n(e) { function t(e) { var t = h(e); t.chunkSize = parseInt(t.chunkSize), e.step || e.chunk || (t.chunkSize = null), this._handle = new a(t), this._handle.streamer = this, this._config = t } this._handle = null, this._paused = !1, this._finished = !1, this._input = null, this._baseIndex = 0, this._partialLine = "", this._rowCount = 0, this._start = 0, this._nextChunk = null, this.isFirstChunk = !0, this._completeResults = { data: [], errors: [], meta: {} }, t.call(this, e), this.parseChunk = function (e) { if (this.isFirstChunk && v(this._config.beforeFirstChunk)) { var t = this._config.beforeFirstChunk(e); void 0 !== t && (e = t) } this.isFirstChunk = !1; var n = this._partialLine + e; this._partialLine = ""; var r = this._handle.parse(n, this._baseIndex, !this._finished); if (!this._handle.paused() && !this._handle.aborted()) { var i = r.meta.cursor; this._finished || (this._partialLine = n.substring(i - this._baseIndex), this._baseIndex = i), r && r.data && (this._rowCount += r.data.length); var o = this._finished || this._config.preview && this._rowCount >= this._config.preview; if (w) y.postMessage({results: r, workerId: C.WORKER_ID, finished: o}); else if (v(this._config.chunk)) { if (this._config.chunk(r, this._handle), this._paused) return; r = void 0, this._completeResults = void 0 } return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(r.data), this._completeResults.errors = this._completeResults.errors.concat(r.errors), this._completeResults.meta = r.meta), !o || !v(this._config.complete) || r && r.meta.aborted || this._config.complete(this._completeResults, this._input), o || r && r.meta.paused || this._nextChunk(), r } }, this._sendError = function (e) { v(this._config.error) ? this._config.error(e) : w && this._config.error && y.postMessage({workerId: C.WORKER_ID, error: e, finished: !1}) } } function r(e) { function t(e) { var t = e.getResponseHeader("Content-Range"); return null === t ? -1 : parseInt(t.substr(t.lastIndexOf("/") + 1)) } e = e || {}, e.chunkSize || (e.chunkSize = C.RemoteChunkSize), n.call(this, e); var r; this._nextChunk = b ? function () { this._readChunk(), this._chunkLoaded() } : function () { this._readChunk() }, this.stream = function (e) { this._input = e, this._nextChunk() }, this._readChunk = function () { if (this._finished) return void this._chunkLoaded(); if (r = new XMLHttpRequest, this._config.withCredentials && (r.withCredentials = this._config.withCredentials), b || (r.onload = m(this._chunkLoaded, this), r.onerror = m(this._chunkError, this)), r.open("GET", this._input, !b), this._config.downloadRequestHeaders) { var e = this._config.downloadRequestHeaders; for (var t in e) r.setRequestHeader(t, e[t]) } if (this._config.chunkSize) { var n = this._start + this._config.chunkSize - 1; r.setRequestHeader("Range", "bytes=" + this._start + "-" + n), r.setRequestHeader("If-None-Match", "webkit-no-cache") } try { r.send() } catch (e) { this._chunkError(e.message) } b && 0 === r.status ? this._chunkError() : this._start += this._config.chunkSize }, this._chunkLoaded = function () { if (4 == r.readyState) { if (r.status < 200 || r.status >= 400) return void this._chunkError(); this._finished = !this._config.chunkSize || this._start > t(r), this.parseChunk(r.responseText) } }, this._chunkError = function (e) { var t = r.statusText || e; this._sendError(t) } } function i(e) { e = e || {}, e.chunkSize || (e.chunkSize = C.LocalChunkSize), n.call(this, e); var t, r, i = "undefined" != typeof FileReader; this.stream = function (e) { this._input = e, r = e.slice || e.webkitSlice || e.mozSlice, i ? (t = new FileReader, t.onload = m(this._chunkLoaded, this), t.onerror = m(this._chunkError, this)) : t = new FileReaderSync, this._nextChunk() }, this._nextChunk = function () { this._finished || this._config.preview && !(this._rowCount < this._config.preview) || this._readChunk() }, this._readChunk = function () { var e = this._input; if (this._config.chunkSize) { var n = Math.min(this._start + this._config.chunkSize, this._input.size); e = r.call(e, this._start, n) } var o = t.readAsText(e, this._config.encoding); i || this._chunkLoaded({target: {result: o}}) }, this._chunkLoaded = function (e) { this._start += this._config.chunkSize, this._finished = !this._config.chunkSize || this._start >= this._input.size, this.parseChunk(e.target.result) }, this._chunkError = function () { this._sendError(t.error) } } function o(e) { e = e || {}, n.call(this, e); var t, r; this.stream = function (e) { return t = e, r = e, this._nextChunk() }, this._nextChunk = function () { if (!this._finished) { var e = this._config.chunkSize, t = e ? r.substr(0, e) : r; return r = e ? r.substr(e) : "", this._finished = !r, this.parseChunk(t) } } } function s(e) { e = e || {}, n.call(this, e); var t = [], r = !0; this.stream = function (e) { this._input = e, this._input.on("data", this._streamData), this._input.on("end", this._streamEnd), this._input.on("error", this._streamError) }, this._nextChunk = function () { t.length ? this.parseChunk(t.shift()) : r = !0 }, this._streamData = m(function (e) { try { t.push("string" == typeof e ? e : e.toString(this._config.encoding)), r && (r = !1, this.parseChunk(t.shift())) } catch (e) { this._streamError(e) } }, this), this._streamError = m(function (e) { this._streamCleanUp(), this._sendError(e.message) }, this), this._streamEnd = m(function () { this._streamCleanUp(), this._finished = !0, this._streamData("") }, this), this._streamCleanUp = m(function () { this._input.removeListener("data", this._streamData), this._input.removeListener("end", this._streamEnd), this._input.removeListener("error", this._streamError) }, this) } function a(e) { function t() { if (_ && m && (d("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" + C.DefaultDelimiter + "'"), m = !1), e.skipEmptyLines) for (var t = 0; t < _.data.length; t++) 1 === _.data[t].length && "" === _.data[t][0] && _.data.splice(t--, 1); return n() && r(), s() } function n() { return e.header && 0 === k.length } function r() { if (_) { for (var e = 0; n() && e < _.data.length; e++) for (var t = 0; t < _.data[e].length; t++) k.push(_.data[e][t]); _.data.splice(0, 1) } } function i(t) { return e.dynamicTypingFunction && void 0 === e.dynamicTyping[t] && (e.dynamicTyping[t] = e.dynamicTypingFunction(t)), !0 === (e.dynamicTyping[t] || e.dynamicTyping) } function o(e, t) { return i(e) ? "true" === t || "TRUE" === t || "false" !== t && "FALSE" !== t && c(t) : t } function s() { if (!_ || !e.header && !e.dynamicTyping) return _; for (var t = 0; t < _.data.length; t++) { for (var n = e.header ? {} : [], r = 0; r < _.data[t].length; r++) { var i = r, s = _.data[t][r]; e.header && (i = r >= k.length ? "__parsed_extra" : k[r]), s = o(i, s), "__parsed_extra" === i ? (n[i] = n[i] || [], n[i].push(s)) : n[i] = s } _.data[t] = n, e.header && (r > k.length ? d("FieldMismatch", "TooManyFields", "Too many fields: expected " + k.length + " fields but parsed " + r, t) : r < k.length && d("FieldMismatch", "TooFewFields", "Too few fields: expected " + k.length + " fields but parsed " + r, t)) } return e.header && _.meta && (_.meta.fields = k), _ } function a(t, n) { for (var r, i, o, s = [",", "\t", "|", ";", C.RECORD_SEP, C.UNIT_SEP], a = 0; a < s.length; a++) { var u = s[a], c = 0, d = 0; o = void 0; for (var f = new l({delimiter: u, newline: n, preview: 10}).parse(t), p = 0; p < f.data.length; p++) { var h = f.data[p].length; d += h, void 0 !== o ? h > 1 && (c += Math.abs(h - o), o = h) : o = h } f.data.length > 0 && (d /= f.data.length), (void 0 === i || c < i) && d > 1.99 && (i = c, r = u) } return e.delimiter = r, {successful: !!r, bestDelimiter: r} } function u(e) { e = e.substr(0, 1048576); var t = e.split("\r"), n = e.split("\n"), r = n.length > 1 && n[0].length < t[0].length; if (1 === t.length || r) return "\n"; for (var i = 0, o = 0; o < t.length; o++) "\n" === t[o][0] && i++; return i >= t.length / 2 ? "\r\n" : "\r" } function c(e) { return g.test(e) ? parseFloat(e) : e } function d(e, t, n, r) { _.errors.push({type: e, code: t, message: n, row: r}) } var f, p, m, g = /^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i, y = this, b = 0, w = !1, x = !1, k = [], _ = {data: [], errors: [], meta: {}}; if (v(e.step)) { var T = e.step; e.step = function (r) { if (_ = r, n()) t(); else { if (t(), 0 === _.data.length) return; b += r.data.length, e.preview && b > e.preview ? p.abort() : T(_, y) } } } this.parse = function (n, r, i) { if (e.newline || (e.newline = u(n)), m = !1, e.delimiter) v(e.delimiter) && (e.delimiter = e.delimiter(n), _.meta.delimiter = e.delimiter); else { var o = a(n, e.newline); o.successful ? e.delimiter = o.bestDelimiter : (m = !0, e.delimiter = C.DefaultDelimiter), _.meta.delimiter = e.delimiter } var s = h(e); return e.preview && e.header && s.preview++, f = n, p = new l(s), _ = p.parse(f, r, i), t(), w ? {meta: {paused: !0}} : _ || {meta: {paused: !1}} }, this.paused = function () { return w }, this.pause = function () { w = !0, p.abort(), f = f.substr(p.getCharIndex()) }, this.resume = function () { w = !1, y.streamer.parseChunk(f) }, this.aborted = function () { return x }, this.abort = function () { x = !0, p.abort(), _.meta.aborted = !0, v(e.complete) && e.complete(_), f = "" } } function l(e) { e = e || {}; var t = e.delimiter, n = e.newline, r = e.comments, i = e.step, o = e.preview, s = e.fastMode, a = e.quoteChar || '"'; if (("string" != typeof t || C.BAD_DELIMITERS.indexOf(t) > -1) && (t = ","), r === t) throw"Comment character same as delimiter"; !0 === r ? r = "#" : ("string" != typeof r || C.BAD_DELIMITERS.indexOf(r) > -1) && (r = !1), "\n" != n && "\r" != n && "\r\n" != n && (n = "\n"); var l = 0, u = !1; this.parse = function (e, c, d) { function f(e) { _.push(e), I = l } function p(t) { return d ? m() : (void 0 === t && (t = e.substr(l)), T.push(t), l = y, f(T), k && g(), m()) } function h(t) { l = t, f(T), T = [], A = e.indexOf(n, l) } function m(e) { return {data: _, errors: C, meta: {delimiter: t, linebreak: n, aborted: u, truncated: !!e, cursor: I + (c || 0)}} } function g() { i(m()), _ = [], C = [] } if ("string" != typeof e) throw"Input must be a string"; var y = e.length, b = t.length, w = n.length, x = r.length, k = v(i); l = 0; var _ = [], C = [], T = [], I = 0; if (!e) return m(); if (s || !1 !== s && -1 === e.indexOf(a)) { for (var j = e.split(n), S = 0; S < j.length; S++) { var T = j[S]; if (l += T.length, S !== j.length - 1) l += n.length; else if (d) return m(); if (!r || T.substr(0, x) !== r) { if (k) { if (_ = [], f(T.split(t)), g(), u) return m() } else f(T.split(t)); if (o && S >= o) return _ = _.slice(0, o), m(!0) } } return m() } for (var E = e.indexOf(t, l), A = e.indexOf(n, l), D = new RegExp(a + a, "g"); ;) if (e[l] !== a) if (r && 0 === T.length && e.substr(l, x) === r) { if (-1 === A) return m(); l = A + w, A = e.indexOf(n, l), E = e.indexOf(t, l) } else if (-1 !== E && (E < A || -1 === A)) T.push(e.substring(l, E)), l = E + b, E = e.indexOf(t, l); else { if (-1 === A) break; if (T.push(e.substring(l, A)), h(A + w), k && (g(), u)) return m(); if (o && _.length >= o) return m(!0) } else { var M = l; for (l++; ;) { var M = e.indexOf(a, M + 1); if (-1 === M) return d || C.push({type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: _.length, index: l}), p(); if (M === y - 1) { var N = e.substring(l, M).replace(D, a); return p(N) } if (e[M + 1] !== a) { if (e[M + 1] === t) { T.push(e.substring(l, M).replace(D, a)), l = M + 1 + b, E = e.indexOf(t, l), A = e.indexOf(n, l); break } if (e.substr(M + 1, w) === n) { if (T.push(e.substring(l, M).replace(D, a)), h(M + 1 + w), E = e.indexOf(t, l), k && (g(), u)) return m(); if (o && _.length >= o) return m(!0); break } } else M++ } } return p() }, this.abort = function () { u = !0 }, this.getCharIndex = function () { return l } } function u() { if (!C.WORKERS_SUPPORTED) return !1; if (!x && null === C.SCRIPT_PATH) throw new Error("Script path cannot be determined automatically when Papa Parse is loaded asynchronously. You need to set Papa.SCRIPT_PATH manually."); var e = C.SCRIPT_PATH || g; e += (-1 !== e.indexOf("?") ? "&" : "?") + "papaworker"; var t = new y.Worker(e); return t.onmessage = c, t.id = _++, k[t.id] = t, t } function c(e) { var t = e.data, n = k[t.workerId], r = !1; if (t.error) n.userError(t.error, t.file); else if (t.results && t.results.data) { var i = function () { r = !0, d(t.workerId, {data: [], errors: [], meta: {aborted: !0}}) }, o = {abort: i, pause: f, resume: f}; if (v(n.userStep)) { for (var s = 0; s < t.results.data.length && (n.userStep({data: [t.results.data[s]], errors: t.results.errors, meta: t.results.meta}, o), !r); s++) ; delete t.results } else v(n.userChunk) && (n.userChunk(t.results, o, t.file), delete t.results) } t.finished && !r && d(t.workerId, t.results) } function d(e, t) { var n = k[e]; v(n.userComplete) && n.userComplete(t), n.terminate(), delete k[e] } function f() { throw"Not implemented." } function p(e) { var t = e.data; if (void 0 === C.WORKER_ID && t && (C.WORKER_ID = t.workerId), "string" == typeof t.input) y.postMessage({ workerId: C.WORKER_ID, results: C.parse(t.input, t.config), finished: !0 }); else if (y.File && t.input instanceof File || t.input instanceof Object) { var n = C.parse(t.input, t.config); n && y.postMessage({workerId: C.WORKER_ID, results: n, finished: !0}) } } function h(e) { if ("object" != typeof e) return e; var t = e instanceof Array ? [] : {}; for (var n in e) t[n] = h(e[n]); return t } function m(e, t) { return function () { e.apply(t, arguments) } } function v(e) { return "function" == typeof e } var g, y = function () { return "undefined" != typeof self ? self : "undefined" != typeof window ? window : void 0 !== y ? y : {} }(), b = !y.document && !!y.postMessage, w = b && /(\?|&)papaworker(=|&|$)/.test(y.location.search), x = !1, k = {}, _ = 0, C = {}; if (C.parse = e, C.unparse = t, C.RECORD_SEP = String.fromCharCode(30), C.UNIT_SEP = String.fromCharCode(31), C.BYTE_ORDER_MARK = "\ufeff", C.BAD_DELIMITERS = ["\r", "\n", '"', C.BYTE_ORDER_MARK], C.WORKERS_SUPPORTED = !b && !!y.Worker, C.SCRIPT_PATH = null, C.LocalChunkSize = 10485760, C.RemoteChunkSize = 5242880, C.DefaultDelimiter = ",", C.Parser = l, C.ParserHandle = a, C.NetworkStreamer = r, C.FileStreamer = i, C.StringStreamer = o, C.ReadableStreamStreamer = s, y.jQuery) { var T = y.jQuery; T.fn.parse = function (e) { function t() { if (0 === o.length) return void(v(e.complete) && e.complete()); var t = o[0]; if (v(e.before)) { var i = e.before(t.file, t.inputElem); if ("object" == typeof i) { if ("abort" === i.action) return void n("AbortError", t.file, t.inputElem, i.reason); if ("skip" === i.action) return void r(); "object" == typeof i.config && (t.instanceConfig = T.extend(t.instanceConfig, i.config)) } else if ("skip" === i) return void r() } var s = t.instanceConfig.complete; t.instanceConfig.complete = function (e) { v(s) && s(e, t.file, t.inputElem), r() }, C.parse(t.file, t.instanceConfig) } function n(t, n, r, i) { v(e.error) && e.error({name: t}, n, r, i) } function r() { o.splice(0, 1), t() } var i = e.config || {}, o = []; return this.each(function (e) { if ("INPUT" !== T(this).prop("tagName").toUpperCase() || "file" !== T(this).attr("type").toLowerCase() || !y.FileReader || !this.files || 0 === this.files.length) return !0; for (var t = 0; t < this.files.length; t++) o.push({file: this.files[t], inputElem: this, instanceConfig: T.extend({}, i)}) }), t(), this } } return w ? y.onmessage = p : C.WORKERS_SUPPORTED && (g = function () { var e = document.getElementsByTagName("script"); return e.length ? e[e.length - 1].src : "" }(), document.body ? document.addEventListener("DOMContentLoaded", function () { x = !0 }, !0) : x = !0), r.prototype = Object.create(n.prototype), r.prototype.constructor = r, i.prototype = Object.create(n.prototype), i.prototype.constructor = i, o.prototype = Object.create(o.prototype), o.prototype.constructor = o, s.prototype = Object.create(n.prototype), s.prototype.constructor = s, C }) }, 364: function (e, t) { !function (e) { var t = function (e) { return e instanceof Error ? {message: e.message, stack: e.stack} : e }, n = function () { this.PRO_OK = 1, this.PRO_FAIL = -1 }; n.prototype = { composeRequest: function (e, t, n) { return e ? JSON.stringify({reqId: e, moduleId: t, body: n}) : {moduleId: t, body: n} }, composeResponse: function (e, n, r) { return e.reqId ? JSON.stringify({respId: e.reqId, error: t(n), body: r}) : null }, composeCommand: function (e, t, n, r) { return e ? JSON.stringify({reqId: e, command: t, moduleId: n, body: r}) : JSON.stringify({command: t, moduleId: n, body: r}) }, parse: function (e) { return "string" == typeof e ? JSON.parse(e) : e }, isRequest: function (e) { return e && e.reqId } }, n.PRO_OK = 1, n.PRO_FAIL = -1, e.protocol = new n }(window) }, 365: function (e, t) { }, 38: function (e, t) { e.exports = { 1000: "6万ACE币", 1001: "30万ACE币", 1002: "68万ACE币", 1003: "128万ACE币", 1004: "328万ACE币", 1005: "648万ACE币", 1006: "默认男头像", 1007: "默认女头像", 1008: "狍狍", 1009: "晴子", 1010: "Tina", 1011: "麦克", 1012: "穷鬼附身", 1013: "拖鞋", 1014: "冠军徽章", 1016: "超级炸弹", 1018: "大喇叭", 1019: "改名卡", 1020: "10元微信红包", 1021: "50元微信红包", 1022: "100元微信红包", 1023: "Apple iPhone 6S", 1024: "Apple iPad Air", 1025: "Apple Watch", 1026: "10元充值卡", 1027: "50元充值卡", 1028: "100元充值卡", 1029: "小米NOTE", 1030: "3亿锦标赛门票", 1031: "百万筹码", 1032: "三亿筹码", 1033: "默认牌面1", 1034: "默认牌面2", 1035: "默认牌背1", 1036: "默认牌背2", 1037: "龙哥", 1038: "Duke", 1039: "鸡蛋", 1040: "啤酒", 1041: "玫瑰花", 1042: "水晶扑克", 1043: "高清扑克", 1044: "鲨鱼牌背", 1045: "ACE简约牌背", 1046: "iPhone6S争夺赛门票", 1047: "30元微信红包", 1048: "88元微信红包", 1049: "888元微信红包", 1050: "888888ACE币", 1051: "6888888ACE币", 1052: "Apple iPad mini", 1053: "500元微信红包", 1054: "300元微信红包", 1055: "200元微信红包", 1056: "上线庆典赛门票", 1057: "3000万快速赛门票", 1058: "666元红包(30级)", 1059: "1亿ACE币赛门票", 1060: "开业回馈赛门票", 1061: "新年迎春赛门票", 1062: "迎春晋级赛门票", 1063: "iPad mini订阅专属赛门票", 1064: "30元红包(15级)", 1065: "50元红包(30级以上)", 1066: "70元红包(30级)", 1067: "1888元红包(50级)", 1068: "扑克大师赛一门票", 1069: "扑克大师赛二门票", 1070: "扑克大师赛三门票", 1071: "亚巡赛红牛券", 1072: "CPG主赛门票", 1073: "CPG主赛门票争夺赛门票", 1074: "MacBook", 1075: "1000面值京东卡", 1076: "500面值京东卡", 1077: "200面值京东卡", 1078: "CPG卫星赛门票", 1079: "CPG边赛门票", 1080: "CPG边赛门票赛门票", 1081: "南洋杯门票赛门票", 1082: "南洋杯/IPO门票", 1083: "南洋杯门票", 1084: "南洋杯/IPO卫星赛门票", 1085: "1亿卫星赛门票", 1086: "1亿大奖赛门票", 1087: "iPhone7卫星赛门票", 1088: "iPhone7贺岁赛门票", 1089: "iPhone7plus", 1090: "iPad Pro", 1091: "iPhone7 Plus 32G", 1092: "爱马仕腰带", 1093: "奥迪A6L 2016款", 1094: "百达翡丽5711", 1095: "宝马X5 2016款", 1096: "上海迪士尼3日自助游", 1097: "大溪地6晚8日自助游", 1098: "法拉利488", 1099: "劳力士-黑水鬼", 1100: "路易威登腰带", 1101: "欧米茄-星座系列18K", 1102: "帕劳4晚5日自助游", 1103: "其他车型预定", 1104: "1000元京东卡", 1105: "500元京东卡", 1106: "200元京东卡", 1107: "50元充值卡", 1108: "100元充值卡", 1109: "百万热身赛门票", 1110: "iPhone7 Plus 128G", 1111: "百万大奖赛门票", 1112: "百万新人赛门票", 1113: "百万卫星赛门票", 1114: "iPhone7 128G", 1115: "底牌专属赛门票", 1116: "超级周五回馈赛门票", 1117: "ACE新人福利赛门票", 1118: "新春集字.新", 1119: "新春集字.春", 1120: "新春集字.快", 1121: "新春集字.乐", 1122: "iPad新人邀请赛门票", 1123: "“我是王牌”猎人赛门票", 1124: "MacBook新人邀请赛门票", 1125: "iPhone7P新人邀请赛门票", 1126: "ACE6人徽章赛门票", 1127: "20元充值卡", 1128: "MacBook Pro新款", 1129: "新款外星人笔记本", 1130: "iPhone7 Plus 128G 红色版", 1901: "偷鸡", 1902: "抓鸡", 1903: "女神玫瑰", 1904: "VIP卡", 1905: "月卡", 1906: "5000万快速赛门票", 1907: "200元微信红包", 1908: "100元微信红包", 1909: "50元微信红包", 1910: "110万菠萝卫星赛门票CDK", 1911: "39万菠萝卫星赛门票CDK", 2000: "牌桌1", 2001: "牌桌2", 2002: "牌桌3", 2003: "牌桌4", 2004: "500万ACE币", 2005: "1000万ACE币", 2010: "荷官1", 2011: "荷官2", 2012: "荷官3", 11008: "狍狍", 11009: "晴子", 11010: "Tina", 11011: "麦克", 11012: "穷鬼附身", 11013: "拖鞋", 11014: "冠军徽章", 11016: "超级炸弹", 11018: "大喇叭", 11019: "改名卡", 11020: "10元微信红包", 11021: "50元微信红包", 11022: "100元微信红包", 11023: "Apple iPhone 6S", 11024: "Apple iPad Air", 11025: "Apple Watch", 11026: "10元充值卡", 11027: "50元充值卡", 11028: "100元充值卡", 11029: "小米NOTE", 11030: "3亿锦标赛门票", 11031: "百万筹码", 11032: "三亿筹码", 11037: "龙哥", 11038: "Duke", 11039: "鸡蛋", 11040: "啤酒", 11041: "玫瑰花", 11046: "iPhone6S争夺赛门票", 11047: "30元微信红包", 11048: "88元微信红包", 11049: "888元微信红包", 11050: "888888ACE币", 11051: "6888888ACE币", 11052: "Apple iPad mini", 11053: "500元微信红包", 11054: "300元微信红包", 11055: "200元微信红包", 11056: "上线庆典赛门票", 11057: "3000万快速赛门票", 11058: "666元微信红包", 11059: "1亿ACE币赛门票", 11060: "开业回馈赛门票", 11061: "新年迎春赛门票", 11062: "迎春晋级赛门票", 11063: "iPad mini订阅专属赛门票", 11064: "30元红包(15级)", 11065: "50元红包(30级以上)", 11066: "70元红包(30级)", 11067: "1888元红包(50级)", 11068: "扑克大师赛一门票", 11069: "扑克大师赛二门票", 11070: "扑克大师赛三门票", 11071: "亚巡赛红牛券", 11072: "CPG主赛门票", 11073: "CPG主赛门票争夺赛门票", 11074: "MacBook", 11075: "1000面值京东卡", 11076: "500面值京东卡", 11077: "200面值京东卡", 11078: "CPG卫星赛门票", 11079: "CPG边赛门票", 11080: "CPG边赛门票赛门票", 11081: "南洋杯门票赛门票", 11082: "南洋杯/IPO门票", 11083: "南洋杯门票", 11084: "南洋杯/IPO卫星赛门票", 11085: "1亿卫星赛门票", 11086: "1亿大奖赛门票", 11087: "iPhone7卫星赛门票", 11088: "iPhone7贺岁赛门票", 11089: "iPhone7plus", 11090: "iPad Pro", 11091: "iPhone7 Plus 32G", 11092: "爱马仕腰带", 11093: "奥迪A6L 2016款", 11094: "百达翡丽5711", 11095: "宝马X5 2016款", 11096: "上海迪士尼3日自助游", 11097: "大溪地6晚8日自助游", 11098: "法拉利488", 11099: "劳力士-黑水鬼", 11100: "路易威登腰带", 11101: "欧米茄-星座系列18K", 11102: "帕劳4晚5日自助游", 11103: "其他车型预定", 11104: "1000元京东卡", 11105: "500元京东卡", 11106: "200元京东卡", 11107: "50元充值卡", 11108: "100元充值卡", 11109: "百万热身赛门票", 11110: "iPhone7 Plus 128G", 11111: "百万大奖赛门票", 11112: "百万新人赛门票", 11113: "百万卫星赛门票", 11114: "iPhone7 128G", 11115: "底牌专属赛门票", 11116: "超级周五回馈赛门票", 11117: "ACE新人福利赛门票", 11118: "新春集字.新", 11119: "新春集字.春", 11120: "新春集字.快", 11121: "新春集字.乐", 11122: "iPad新人邀请赛门票", 11123: "“我是王牌”猎人赛门票", 11124: "MacBook新人邀请赛门票", 11125: "iPhone7P新人邀请赛门票", 11126: "ACE6人徽章赛门票", 11127: "20元充值卡", 11128: "MacBook Pro新款", 11129: "新款外星人笔记本", 11130: "iPhone7 Plus 128G 红色版", 11901: "偷鸡", 11902: "抓鸡", 11903: "女神玫瑰", 11904: "VIP卡", 11905: "月卡", 11906: "5000万快速赛门票", 11907: "200元微信红包", 11908: "100元微信红包", 11909: "50元微信红包", 11910: "110万菠萝卫星赛门票CDK", 11911: "39万菠萝卫星赛门票CDK", 12000: "牌桌1", 12001: "牌桌2", 12002: "牌桌3", 12003: "牌桌4", 12010: "荷官1", 12011: "荷官2", 12012: "荷官3" } }, 9: function (e, t, n) { "use strict"; var r = n(12), i = n.n(r), o = n(11), s = n.n(o), a = n(1), l = n(358), u = n(10); a.default.use(l.a); var c = new l.a.Store({ state: {loginbean: null}, mutations: { zhuce: function (e, t) { e.loginbean = t }, login: function (e, t) { e.loginbean = t } } }); c.getLoginbean = s()(i.a.mark(function e() { var t; return i.a.wrap(function (e) { for (; ;) switch (e.prev = e.next) { case 0: if (t = this.state.loginbean, alert(t), null == t) { e.next = 6; break } return e.abrupt("return", t); case 6: return e.next = 8, n.i(u.a)(); case 8: return e.abrupt("return", e.sent); case 9: case"end": return e.stop() } }, e, this) })), t.a = c } }, [214]);
window.treeData = [ // 结点名称、父节点名称 ["手绘", null], ["水粉", "手绘"], ["油画", "手绘"], ["素描", "手绘"], ["中国画", "手绘"], ["空间透视", "素描"], ["色彩五大调", "素描"] ];
var storage=window.sessionStorage; var datalists=""; $(document).ready(function() { $(document).bind("contextmenu",function(e) { //alert("sorry! No right-clicking!"); return false; }); }); $('#test_table').html("<thead>"+$("#thead").html()+"</thead><tbody>"+$("#tbody").html()+"</tbody>"); var pagerows=9; $('.loadimg').css('display','none'); $("#exp").click(function(){ tablelist1(); setTimeout(function(){ var numcol=$('#tbody tr:eq(1) td').size(); console.log(numcol) $('#test_table').html("<table class='table'><thead><tr style='height:20px;'><th colspan='"+(numcol)+"' rowspan='1'><p>"+$('.tbTitle').html()+"</p></th></tr><tr style='height:20px;'><th colspan='"+(numcol)+"' rowspan='1'><p>"+$('.getTimes').html()+"</p></th></tr>"+$("#thead").html()+"</thead><tbody>"+$("#tbody").html()+"</tbody></table>"); $("#test_table").css('display',''); $("#test_table").tableExport({ type:"excel", escape:"true" }); setTimeout(function(){ $("#test_table").css('display','none'); }, 100); },2000); }); var URL = "http://"+window.location.host+"/FinancialStatistics"; // function killDatabase(){ console.log(URL +"/KillSessionController/suo") $.ajax({ type:"get", url:URL +"/KillSessionController/suo", async: true,//异步 data: {},//数据,这里使用的是Json格式进行传输 dataType: "json", //这两句指定回调函数为:CallBackUser jsonp: 'callback', jsonpCallback: 'CallBackUserSuo' }).then(function (res) { console.log("成功",res); }, function (err) { // console.log("失败", err); }); function CallBackUserSuo(jsonData) { //console.log('callback',jsonData); } } $('.menuSearch').click(function(event){ event.stopPropagation(); // $(this).attr('disabled',true); //killDatabase(); }); $(document).on('click','.menuSearch',function(event){ event.stopPropagation(); }) var zoomListeners = []; (function(){ // Poll the pixel width of the window; invoke zoom listeners // if the width has been changed. var lastWidth = 0; function pollZoomFireEvent() { var widthNow = jQuery(window).width(); // console.log(widthNow) if (lastWidth == widthNow) return; lastWidth = widthNow; // Length changed, user must have zoomed, invoke listeners. for (i = zoomListeners.length - 1; i >= 0; --i) { zoomListeners[i](); } tablelist(); kstablelist(); } setInterval(pollZoomFireEvent, 100); })(); var si =0; function datatable(){ si = $('tbody tr td').length; $('td:contains(合计)').css("text-align","right"); $('td:contains(总计)').css("text-align","right"); for(var i=0;i<si;i++){ $('tbody tr td:eq('+i+'):contains(%)').css('text-align','right'); if(Number.isFinite(Number($('tbody tr td:eq('+i+')').text())) == true){ $('tbody tr td:eq('+i+')' ).css('text-align','right'); } } } $('#pagenum').change(function(){ pagerows=$(this).val(); if(pagerows <=2000){ tablelist(); }else{ alert("对不起!您设置范围超出设定范围,本系统允许数据最大限度为2000~"); return false; } }) //阻止鼠标选中页面文字及图标 document.body.onselectstart = function () { return false; };
/* LAÇO FOR * REPRETIÇÃO * FOR, WHILE */ for(var i = 0; i<10; i++) { // 1 declaração da variavel, 2 condição, 3 incremento console.log(i) } // repete o valor de i até a condição dar false console.log('i - saiu do laço em =', i) // valor de i é 10, valor que fez ele sair do laço /* BLOCO DE CONDIÇÃO * IF E ELSE */
import http from "http"; import EventEmitter from "events"; import createApp from "./app.js"; import Arena from "./arena.js"; import Conduit from "./conduit.js"; import Sockets from "./sockets.js"; export default class Web extends EventEmitter { constructor({ redis, games, logger }) { super(); this.redis = redis; this.games = games; this.logger = logger; this.app = createApp({ games: this.games, logger: this.logger }); this.arena = new Arena({ redis: this.redis, games: this.games }); this.server = http.createServer(this.app); this.conduit = new Conduit({ redis: this.redis }); this.sockets = new Sockets({ server: this.server }); this.sockets.on("connect", (client) => { this.logger.info({ client }, "player connected"); }); this.sockets.on("disconnect", async (client) => { this.logger.info({ client }, "player disconnected"); await this.arena.part(client, "Player left the game."); }); this.sockets.on("command", async (client, command) => { this.logger.debug({ client, command }, "player sent command"); try { switch (command.action) { case "join": return await this.arena.join( client, command.game, this.conduit.channel ); case "move": return await this.arena.move(client, command.move); default: throw new Error("invalid command"); } } catch (err) { this.logger.error(err); this.sockets.send(client, { error: "unable to perform command" }); } }); this.arena.on("command", async (channel, client, command) => { this.logger.trace({ channel, client, command }, "relaying command"); await this.conduit.send(channel, client, command); }); this.arena.on("error", (err) => { this.logger.error(err); }); this.conduit.on("command", (client, command) => { this.logger.trace({ client, command }, "sending command to client"); this.sockets.send(client, command); }); this.server.on("close", async () => { this.logger.info("http server closing"); }); } listen() { this.server.listen(process.env.PORT, async () => { const { port } = this.server.address(); this.logger.info({ port }, "http server listening"); }); } async close() { const command = { action: "end", reason: "Server shutting down." }; for (const id of this.sockets.clients.keys()) { this.sockets.send(id, command); } await this.sockets.close(); await new Promise((resolve) => { this.server.close(resolve); }); } }
import React, { Component } from 'react'; import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'; import styled from 'styled-components'; import './App.css'; import Header from './components/Header/Header.component'; import Footer from './components/Footer/Footer.component'; import Home from './routes/Home/Home'; import About from './routes/Author/Author'; import Contact from './routes/Contact/Contact'; import Post from './routes/Post/Post'; import Default from './routes/404/404'; const PageContainer = styled.div` width: 80vw; max-width: 1200px; margin: 0 auto; padding: 0 15px; `; class App extends Component { state = { fixedHeader : false } componentDidMount = () => { window.addEventListener('scroll', this.handleScroll); } handleScroll = () => { if(window.scrollY >= 80) { this.setState({ fixedHeader : true }) } else { this.setState({ fixedHeader: false }) } } render() { return ( <Router> <Header fixedHeader={this.state.fixedHeader} /> <PageContainer> <Switch> <Route exact path="/" component={Home} /> <Route path="/autor" component={About} /> <Route path="/kontakt" component={Contact} /> <Route path="/post/:id" component={Post} /> <Route path="*" component={Default} /> </Switch> </PageContainer> <Footer /> </Router> ); } } export default App;
/* global document */ /** @constructor */ const Element = function(element) { this[0] = element; element.$elt = this; element.addEventListener('dispose', function() { setTimeout(function() { // allow other dispose event listeners this[0].$elt = undefined; // ie does not allow deletion of properties on elements. delete this[0].$elt; Object.keys(this).forEach(function(key) { delete this[key]; }.bind(this)); }.bind(this), 1); }.bind(this), false); }; module.exports = Element; const elements = require('./elements'); Element.prototype = { /** * Set value * * @param {string} value * @return {Element} */ setValue: function(value) { elements.setValue(this[0], value); return this; }, }; class ElementBasic extends Element { constructor(tagName) { super(document.createElement(tagName)); } } /** * @constructor * @augments {Element} * @param {string} tagName */ Element.Basic = ElementBasic; /** * @constructor * @augments {Element} * @param {string} tagName */ Element.WithContent = Element.Basic;
import "./modules/blog"; import "./modules/parallax"; import "./modules/hamburger"; import "./modules/button"; import "./modules/preloader";
function makeTask(data) { const completed = false; const category = 'Общее'; const priority = 'Обычный'; // Пиши код ниже этой строки const defaultSettings = { category, priority, completed, }; const finalSettings = { ...defaultSettings, ...data }; return finalSettings; // Пиши код выше этой строки }
import React, { Component } from 'react'; import HomePage from './containers/HomePage'; import AppPage from './containers/AppPage'; class App extends Component { state = { display : 0, userId : '' } display = () => { switch (this.state.display) { case 1:{ return <AppPage userId={this.state.userId}/> } default: return <HomePage login={this.login} /> } } login = (userId) => { this.setState({ userId : userId, display : 1 }) } render() { return ( <div className="App"> {this.display()} </div> ); } } export default App;
__resources__["/__builtin__/level.js"] = {meta: {mimetype: "application/javascript"}, data: function(exports, require, module, __filename, __dirname) { var util = require("util") , debug = require("debug") , pipe = require('pipe') , TimeStamper = require("director").TimeStamper , Scene = require('scene').TreeScene , geo = require('geometry'); var Klass = require("base").Klass , Trait = require("oo").Trait; var levelTrait = Trait.extend({ initialize:function(param) { this.execProto("initialize"); this.slot("_timeStamper", TimeStamper.create()); this.slot("_sysPipe", pipe.createSwitcher()); //this.slot("_sysPipe", pipe.createEventTrigger(this.slot("_timeStamper"))); if (param && param.scene) this.slot("_scene", param.scene); else this.slot("_scene", Scene.create()); this.slot("_deciders", {}); // this.exec("registerDecider", 'hoverDecider', HoverEventDecider.create()); // this.exec("registerDecider", 'mouseButtonDecider', MouseButtonEventDecider.create()); // this.exec("registerDecider", 'keyDecider', KeyEventDecider.create()); // this.exec("registerDecider", 'commonEventDecider', CommonEventDecider.create()); this.exec("registerDecider", 'decider', CommonEventDecider.create()); return this; }, onActive: function(director) { this.slot("_sourcePipe", pipe.createEventTrigger(this.slot("_timeStamper"))); pipe.switchSource(this.slot("_sysPipe"), this.slot("_sourcePipe")); this.slot("_scene").exec("onActive"); }, onDeactive: function() { this.slot("_scene").exec("onDeactive"); }, update: function(t, dt) { this.slot("_timeStamper").exec("stepForward", dt); this.slot("_scene").exec("update", t, dt); this.exec("decideEvents"); }, sysPipe:function() { return this.slot("_sysPipe"); }, switchPipeTriggerEvent:function(evt) { if(this.slot("_sourcePipe")) pipe.triggerEvent(this.slot("_sourcePipe"), evt); }, scene: function() { return this.slot("_scene"); }, setScene:function(scene) { this.slot("_scene", scene); }, decideEvents:function() { var type, deciders = this.slot("_deciders"); for (type in deciders) { if (!deciders.hasOwnProperty(type)) continue; deciders[type].exec("decideEvent"); } }, registerDecider:function(type, decider) { this.slot("_deciders")[type] = decider; }, removeDecider:function(type) { delete this.slot("_deciders")[type]; }, queryDecider:function(type) { return this.slot("_deciders")[type]; }, }); var Level = Klass.extend([levelTrait]); //resolve the events which nodes do not know how to dispatch var deciderTrait = Trait.extend({ initialize : function(param) { this.execProto("initialize"); //hashmap<id, {event, waiters}> //waiters--> [{node,pipe}...] this.slot("_waiters", {}); }, decide:function(node, event, destPipe) { //FIXME: how to distinguish events var evtId = event.identifier; if (!this.slot("_waiters")[evtId]) this.slot("_waiters")[evtId] = {event:event, waiters:[]}; this.slot("_waiters")[evtId].waiters.push({node:node, pipe:destPipe}); }, decideEvent:function() { var evtId, waiter, waiters = this.slot("_waiters"); for (evtId in waiters) { if (!waiters.hasOwnProperty(evtId)) continue; waiter = waiters[evtId]; this.exec("doDecideEvent", waiter.event, waiter.waiters); delete waiters[evtId]; } }, doDecideEvent:function(evt, dests) { debug.assert('cannot be here:decideEvent is base'); }, painter:function() { if (this.slot("_painter")) return this.slot("_painter"); this.slot("_painter", require('director').director().exec("defaultPainter")); return this.slot("_painter"); }, }); var Decider = Klass.extend([deciderTrait]); var hitTest = function(painter, pos, node) { var matrix = geo.matrixInvert(node.exec('matrix')); var newpos = geo.pointApplyMatrix({x:pos.x, y:pos.y}, matrix); //FIXME:test node._model return painter.exec("inside", node.exec("model"), newpos); } var hitTestNodesByZIndex = function(painter, pos, waiters) { var hitOne, modelPath; var view = require("director").director().exec("defaultView"); waiters.sort(function(a, b){ //return b.node.exec('matrix').tz - a.node.exec('matrix').tz; return view.comparator(b.node, a.node, painter); }).some(function(waiter) { modelPath = hitTest(painter, pos, waiter.node); if (modelPath != false) { hitOne = waiter; return true; } return false; }); if (hitOne) { return {waiter:hitOne, modelPath:typeof(modelPath) == "string" ? modelPath : undefined}; } } var hoverEventDeciderTrait = Trait.extend({ initialize : function(param) { this.execProto("initialize"); }, doDecideEvent:function(evt, waiters) { debug.assert(evt.type == 'mouseMoved', 'hovereventDecider receive unknown evtType:'+evt.type); var hitInfo = hitTestNodesByZIndex(this.exec("painter"), {x:evt.mouseX, y:evt.mouseY}, waiters); var targetNode = hitInfo ? hitInfo.waiter.node : undefined; //check mouseout if (this.slot("_activeNode") && ((targetNode !== this.slot("_activeNode")) || hitInfo.modelPath != this.slot("_activeModelPath"))) { var newEvt = util.copy(evt); newEvt.type = 'mouseOut'; newEvt.modelPath = this.slot("_activeModelPath"); pipe.triggerEvent(this.slot("_activePipe"), newEvt); this.slot("_activeNode", undefined); this.slot("_activeModelPath", undefined); this.slot("_activePipe", undefined); } //check mouseover if (targetNode && targetNode !== this.slot("_activeNode")) { this.slot("_activeNode", hitInfo.waiter.node); this.slot("_activeModelPath", hitInfo.modelPath); this.slot("_activePipe", hitInfo.waiter.pipe); var newEvt = util.copy(evt); newEvt.type = 'mouseOver'; newEvt.modelPath = hitInfo.modelPath; pipe.triggerEvent(this.slot("_activePipe"), newEvt); } }, }); //HoverEventDecider = Decider.extend([hoverEventDeciderTrait]); var shakeSpan = 10; var mouseButtonEventDeciderTrait = Trait.extend({ initialize : function(param) { this.execProto("initialize"); this.slot("_hasPendDragEvt", false); this.slot("_dragTriggered", false); }, doDecideEvent:function(evt, waiters) { debug.assert(evt.type == 'mouseClicked' || evt.type == 'mousePressed' || evt.type == 'mouseReleased' || evt.type == 'mouseDragged', 'I cannot decide event type:'+evt.type); switch (evt.type) { case 'mousePressed': if (this.slot("_pressedInfo")) { var evt1 = util.copy(this.slot("_pressedEvent")); if (this.slot("_hasPendDragEvt")) { evt1.type = 'mouseClicked'; pipe.triggerEvent(this.slot("_pressedInfo").waiter.pipe, evt1); debug.assert(!this.slot("_dragTriggered"), 'mouseButtonDecider:logical error'); this.slot("_hasPendDragEvt", false); this.slot("_dragTriggered", false); } evt1.type = 'mouseReleased'; pipe.triggerEvent(this.slot("_pressedInfo").waiter.pipe, evt1); this.slot("_pressedInfo", undefined); this.slot("_pressedEvent", undefined); } var pressedInfo = hitTestNodesByZIndex(this.exec("painter"), {x:evt.mouseX, y:evt.mouseY}, waiters); if (pressedInfo) { this.slot("_pressedInfo", pressedInfo); this.slot("_pressedEvent", util.copy(evt)); this.slot("_pressedEvent").modelPath = pressedInfo.modelPath; pipe.triggerEvent(this.slot("_pressedInfo").waiter.pipe, this.slot("_pressedEvent")); } break; case 'mouseReleased': if (this.slot("_pressedInfo")) { debug.assert(this.slot("_pressedEvent"), 'logical error!'); if (this.slot("_hasPendDragEvt")) { var clickevt = util.copy(this.slot("_pressedEvent")); clickevt.type = 'mouseClicked'; pipe.triggerEvent(this.slot("_pressedInfo").waiter.pipe, clickevt); this.slot("_hasPendDragEvt", false); } var releaseEvt = util.copy(evt); releaseEvt.modelPath = this.slot("_pressedInfo").modelPath; pipe.triggerEvent(this.slot("_pressedInfo").waiter.pipe, releaseEvt); this.slot("_pressedInfo", undefined); this.slot("_pressedEvent", undefined); this.slot("_dragTriggered", false); } break; case 'mouseClicked': if (this.slot("_pressedInfo")) { var clickedEvt = util.copy(evt); clickedEvt.modelPath = this.slot("_pressedEvent").modelPath; pipe.triggerEvent(this.slot("_pressedInfo").waiter.pipe, clickedEvt); } break; case 'mouseDragged': if (this.slot("_pressedInfo")) { var dragEvt = util.copy(evt); dragEvt.modelPath = this.slot("_pressedInfo").modelPath; if (this.slot("_dragTriggered")) { pipe.triggerEvent(this.slot("_pressedInfo").waiter.pipe, dragEvt); break; } this.slot("_hasPendDragEvt", true); if (!this.exec("testShake", this.slot("_pressedEvent"), evt)) { this.slot("_hasPendDragEvt", false); this.slot("_dragTriggered", true); pipe.triggerEvent(this.slot("_pressedInfo").waiter.pipe, dragEvt); } } break; default: debug.assert(false, 'cannot be here!'); break; } }, testShake:function(evtPressed, evtDragged) { var distX = evtDragged.mouseX - evtPressed.mouseX; var distY = evtDragged.mouseY - evtPressed.mouseY; return (distX * distX + distY * distY) < shakeSpan * shakeSpan; }, }); //MouseButtonEventDecider = Decider.extend([mouseButtonEventDeciderTrait]); var keyEventDeciderTrait = Trait.extend({ initialize : function(param) { this.execProto("initialize"); }, doDecideEvent:function(evt, waiters) { debug.assert(evt.type == 'keyPressed' || evt.type == 'keyReleased', 'I cannot decide event type:'+evt.type); var i, waiter; for (i=0; i<waiters.length; i++) { waiter = waiters[i]; pipe.triggerEvent(waiter.pipe, evt); } }, }); //var KeyEventDecider = Decider.extend([keyEventDeciderTrait]); var commonEventDeciderTrait = Trait.extend({ initialize : function(param) { this.execProto("initialize"); }, doDecideEvent:function(evt, waiters) { var i, waiter; for (i=0; i<waiters.length; i++) { waiter = waiters[i]; pipe.triggerEvent(waiter.pipe, evt); } }, }); //var CommonEventDecider = Decider.extend([commonEventDeciderTrait]); var CommonEventDecider = Decider.extend( [ hoverEventDeciderTrait.rename({ initialize:"hoverEvtDeciderInit", doDecideEvent:"doDecideHoverEvent", }), mouseButtonEventDeciderTrait.rename({ initialize:"mouseEvtDeciderInit", doDecideEvent:"doDecideMouseButtonEvent" }), keyEventDeciderTrait.rename({ initialize:"keyEvtDeciderInit", doDecideEvent:"doDecideKeyEvent" }), commonEventDeciderTrait.rename({ initialize:"commonEvtDeciderInit", doDecideEvent:"doDecideCommonEvent" })], { initialize:function(param) { this.exec("hoverEvtDeciderInit"); this.exec("mouseEvtDeciderInit"); this.exec("keyEvtDeciderInit"); this.exec("commonEvtDeciderInit"); }, doDecideEvent:function(evt, waiters) { switch(evt.type) { case "mouseMoved": return this.exec("doDecideHoverEvent", evt ,waiters); case "mouseClicked": case "mousePressed": case "mouseReleased": case "mouseDragged": return this.exec("doDecideMouseButtonEvent", evt, waiters); case "keyPressed": case "keyReleased": return this.exec("doDecideKeyEvent", evt, waiters); case "mouseOver": case "mouseOut": return; default: return this.exec("doDecideCommonEvent", evt, waiters); } }, } ); exports.Level = Level; }};
({ getTokenAction: function(component, event, helper) { var getTokenAction = component.get('c.getEmptyFilterToken'); getTokenAction.setParams({ searchHub: component.get('v.searchHub') }); var getTokenPromise = new Promise(function (resolve, reject) { getTokenAction.setCallback(this, function (response) { if (response.getState() === 'SUCCESS') { var token = response.getReturnValue(); resolve({ token: token, platformUri: 'https://platform.cloud.coveo.com', analyticUri: 'https://usageanalytics.coveo.com', isGuestUser: true, allowQueriesWithoutKeywords: true }); } else if (response.getState() === 'ERROR') { var errors = response.getError(); var message = 'Unknown error'; // Retrieve the error message sent by the server if (errors && Array.isArray(errors) && errors.length > 0) { message = errors[0].message; } console.error(message); reject(Error('Error generating token')); } }); }); $A.enqueueAction(getTokenAction); return getTokenPromise; } });
const ipcRenderer = require('electron').ipcRenderer; import Vue from 'vue'; import style from './components/player/style.styl'; import videoPlayer from './components/player/video-player'; import webView from './components/player/webview'; window.app = new Vue({ el: 'body', components: { 'video-player': videoPlayer, 'webview': webView }, data: { viewMode: 'webview', clickThrough: true }, events: { 'filer:select-file': function(fileStr) { let file = JSON.parse(fileStr); this.viewMode = 'video-player'; this.$nextTick(function() { this.$broadcast('player:receive-file', file); }); }, 'url:submit-url': function(url) { this.viewMode = 'webview'; this.$nextTick(function() { this.$broadcast('player:receive-url', url); }); } }, ready: function() { ipcRenderer.on('main:ipc-bridge', (event, channel, data) => { this.$emit(channel, data); }); ipcRenderer.on('main:toggle-player', (event, flag) => { console.log(flag); this.clickThrough = flag ? true : false; }); } });
import App from './App.vue' import Main from '../../../utils/start' let start = new Main.Start(App) start.ready()
import React from 'react' import PropTypes from 'prop-types' import {chunk} from 'lodash' import {outputField} from '../../components/GenericForm/DynamicField' class DocumentDynamicForm extends React.PureComponent { constructor (props) { super(props) this.renderControl = this.renderControl.bind(this) } renderControl (controlId) { const {controlsById, locale, controlIdsByParentId} = this.props const field = controlsById[controlId] if (field.controlType === 'grid') { const children = controlIdsByParentId[controlId] || [] const rows = chunk(children, field.columnCount) return ( <div key={controlId} className="form-zone"> {rows.map((row, index) => ( <div className="row" key={index}> {row.map((fieldId) => ( <div className="col" key={fieldId}>{this.renderControl(fieldId)}</div> ))} </div> ))} </div> ) } else { return outputField(field, locale, this.props.handlers) } } render () { const rootControls = this.props.controlIdsByParentId['c0'] if (!rootControls) return null return ( <div> {rootControls.map(this.renderControl)} </div> ) } } DocumentDynamicForm.propTypes = { controlIdsByParentId: PropTypes.object.isRequired, controlsById: PropTypes.object.isRequired, handlers: PropTypes.object.isRequired, locale: PropTypes.string.isRequired } export default DocumentDynamicForm
import React from 'react'; const Footer = () => ( <footer> Developed By <a href='http://barancezayirli.com/'>Baran Cezayirli</a> | Source <a href='https://github.com/barancezayirli/tic-tac-toe'>GitHub</a> </footer> ); export default Footer;
import React from 'react'; const CharOutput = (props) => { return <div className="inlineBox">{props.character}</div>; }; export default CharOutput;
app.controller("CreateStoryCtrl", ["$scope", "$location", "$firebaseObject", "$firebaseArray", "$firebaseAuth", "Upload","$timeout", function($scope, $location, $firebaseObject, $firebaseArray, $firebaseAuth, Upload, $timeout ) { var ref = new Firebase("https://first-hand-accounts.firebaseio.com/"); var storyRef = new Firebase("https://first-hand-accounts.firebaseio.com/stories") $scope.allStories = $firebaseArray(storyRef); var categoriesRef = new Firebase("https://first-hand-accounts.firebaseio.com/categories"); $scope.allCategories = $firebaseArray(categoriesRef); $scope.authData = $firebaseAuth(ref).$getAuth(); $scope.selectedCategory = ""; var createdCategoryId = ""; $scope.categoryTitle = ""; $scope.storyTitle = ""; $scope.locationInput = ""; var storyCreated = {}; $scope.checkedInput = false; $('#CategoryModal').modal(); storyCreated.userImages = ""; storyCreated.Category = ""; storyCreated.CatTitle = ""; $scope.logout = function(){ $firebaseAuth(ref).$unauth(); console.log("logged out"); }; $scope.userLoggedIn = function(auth) { if ($scope.authData) { return true; } }; //if user doesn't create category, then category is stored from the dropdown categories $scope.Categories = function () { if ($scope.categoryTitle === "") { storyCreated.Category = $scope.selectedCategory.$id; storyCreated.CatTitle = $scope.selectedCategory.title; } else { //if category is created, then run sendCategory function $scope.sendCategory(); } } $scope.sendCategory = function() { //add the category to categories in firebase $scope.allCategories.$add({ userId: $scope.authData.uid, title: $scope.categoryTitle }).then(function(createdcat){ createdCategoryId = createdcat.key(); //stores the new category id in storyCreated storyCreated.Category = createdCategoryId; storyCreated.CatTitle = $scope.categoryTitle; }) } //stores story information when you click submit on create view $scope.Stories = function () { storyCreated.push({ User: $scope.authData.uid, name: $scope.authData.facebook.displayName, input: $scope.storyInput, title: $scope.storyTitle, rating: 0, anonymous: $scope.checkedInput, location: $scope.locationInput, profileImage: $scope.authData.facebook.profileImageURL }) $scope.allStories.$add(storyCreated); $location.path("#/user/" + $scope.authData.uid); } //code for drop down $('.dropdown-menu').find('input').click(function (e) { e.stopPropagation(); }); // testing images $scope.AddImages = function(files) { Upload.base64DataUrl(files).then(function(base64Urls){ storyCreated.userImages = base64Urls; }); }; $(document).ready(function(){ $('.alert-photo').click(function(){ $('.alert').show() }) }); }]);
var d = document; btnIrArriba = d.querySelector('.scroll-up'); function arriba(evento){ evento.preventDefault(); $("body, html").animate({ scrollTop: "0px" },300); } function main() { btnIrArriba.addEventListener( 'click', arriba ); $(window).scroll(function(){ if ( $(this).scrollTop() > 0 ) { $(".scroll-up").slideDown(300); } else{ $(".scroll-up").slideUp(300); }; }); } window.addEventListener('load', main);
const express = require('express'); const logger = require('morgan'); const bodyParser = require('body-parser'); const credentials = require('./credentials.js'); const cookieParser = require('cookie-parser'); const session = require('express-session'); const passport = require('passport'); const cors = require('cors'); // Set up the express app const app = express(); // Log requests to the console. app.use(logger('dev')); app.disable('x-powered-by'); app.use(cookieParser(credentials.secret)); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: false })); app.use(cors({ credentials: true })); app.set('view engine', 'ejs'); // set up ejs for templating // required for passport app.use(session({ secret: credentials.secret, resave: true, saveUninitialized: true })); // session secret app.use(passport.initialize()); app.use(passport.session()); // persistent login sessions require('./server/routes')(app, passport); require('./server/oauth-login/config/passport')(passport); // send reminder mail for unreturned books require('./server/email/notifyUser').sendReminder(); module.exports = app;
/** * Created with IntelliJ IDEA. * User: siguang * Date: 14-2-27 * Time: 下午4:23 * 百家欧赔 */ jQuery('td[id^=avg_]').mouseenter(function() { setDiv(jQuery(this)); }); jQuery('td[id^=avg_]').mouseleave(function() { jQuery('#div_display').css('display', 'none'); }); function setDiv(obj_this) { var obj = jQuery("#div_display"); var obj_local = jQuery("#avg_lost"); var offset = obj_local.offset(); var left = offset.left + obj_local.width(); var top = offset.top + obj_local.height(); obj.css("top", top); obj.css("left", left); obj.css("display", "block"); } (function() { var d; //数据集合 var i; //数据索引 //插入弹层 var c = $( '<div class="data-layer data-layer-op" style="display:none;">' + ' <div class="datalayer-con">' + ' <h2>' + ' <img style="position:absolute; left:10px; top:10px;" src="../content/images/oploading.gif" /><span></span>' + ' </h2>' + ' <ul>' + ' </ul>' + ' </div>' + '</div>' ).appendTo(document.body)[0]; // 将鼠标移到一条数据时将这条数据的信息插入到弹层中 var data = function() { if(d[i]) { var e = $(c).find('ul')[0]; var h = ''; for(var v = d[i].value, j = 0; v[j]; j++) { h += '<li>' + ' <span class="time-1">' + $a(v[j]) + '</span>' + ' <span class="time-2">' + $b(v[j]) + '</span>' + ' <i>' + $c(v[j]) + '</i>' + ' <i>' + $d(v[j]) + '</i>' + ' <i>' + $e(v[j]) + '</i>' + ' <i>' + $f(v[j]) + '</i>' + ' <i class="spe">' + $g(v[j]) + '</i>' + ' <i>' + $h(v[j]) + '</i>' + '</li>'; } if(j == 10) { h += '<li>' + '<span style="width:auto; color:#090; font-weight:bold;">点击指数查看更多变化</span>' + '</li>'; } e.innerHTML = h + e.innerHTML; } }; // data var $a = function(v) { return v['wdate'].substring(5,16); }; var $b = function(v) { //初始化变量 var t = Math.floor((parseInt(matchData) - v['wdate1']) / 6e4); var h = t > 0 ? Math.floor(t / 60) : 0; var m = t > 0 ? t % 60 : 0; return '赛前' + (h ? h + '时' : '') + (m + '分'); }; var $c = function(v) { return '<span style="color:' + (v['winch'] == 1 ? '#f00' : v['winch'] == 2 ? '#0e66c1' : '') + ';">' + v['win'] + (v['winch'] == 1 ? '↑' : v['winch'] == 2 ? '↓' : '→') + '</span>'; }; var $d = function(v) { return '<span style="color:' + (v['samech'] == 1 ? '#f00' : v['samech'] == 2 ? '#0e66c1' : '') + ';">' + v['same'] + (v['samech'] == 1 ? '↑' : v['samech'] == 2 ? '↓' : '→') + '</span>'; }; var $e = function(v) { return '<span style="color:' + (v['lostch'] == 1 ? '#f00' : v['lostch'] == 2 ? '#0e66c1' : '') + ';">' + v['lost'] + (v['lostch'] == 1 ? '↑' : v['lostch'] == 2 ? '↓' : '→') + '</span>'; }; var $f = function(v) { return v['awin']; }; var $g = function(v) { return v['arq']; }; var $h = function(v) { return v['alost']; }; var request = function() { //确保只请求一次 request = function() {}; $.ajax({ 'type' : 'get', 'dataType' : 'json', 'url' : '/json/'+ mid +'/bjop', 'async' : true, 'success' : success }); }; var success = function(j) { d = {}; //重新组合对象 for(var i = 0, j = j['company5List']; j[i]; i++) { var id = j[i]['attribute']['cid']; var name = j[i]['attribute']['name']; for(var value = [], _i = 0, _j = j[i]['c']; _j[_i]; _i++) { value[_i] = _j[_i]['attribute']; } d[id] = { name : name, value : value }; } //隐藏加载图片 $(c).find('img').css('display', 'none'); //执行数据 data(); }; var innerHTML = function(t) { var p = t.parentNode; //插入标题 $(c).find('span').html($(p).find('td:eq(1)').html() + ' 指数变化'); //插入初指 $(c).find('ul').html( '<li class="fb">' + ' <span class="time-1">' + p.getAttribute('firsttime').substring(5,16) + '</span>' + ' <span class="time-2">初</span>' + ' <i>' + $(p).find('td:eq(2)').html() + '</i>' + ' <i>' + $(p).find('td:eq(3)').html() + '</i>' + ' <i>' + $(p).find('td:eq(4)').html() + '</i>' + '</li>' ); //判断执行 if(d) { data(); } else { request(); } }; var cssText = function(e) { c.style.display = 'block'; var $1 = $(c).width(); var $2 = $(c).height(); var $3 = $(document).width(); var $4 = $(document).height(); var $5 = $(window).scrollLeft() + e.clientX + 20; var $6 = $(window).scrollLeft() + e.clientX - $1 - 20; var $7 = $(window).scrollTop() + e.clientY + 10; var $8 = $(window).scrollTop() + e.clientY - $2 - 10; c.style.left = ($1 + $5 < $3 ? $5 : $6) + 'px'; c.style.top = ($2 + $7 < $4 ? $7 : $8) + 'px'; }; $('.bf-tab-02').mouseover(function(e) { var t = e.target; //判断查找 if(t.tagName == 'A') { t = t.parentNode; } //判断显示 if(t.getAttribute('cid')) { //保存数据索引 i = t.getAttribute('cid'); //显示数据层 innerHTML(t); cssText(e); e.stopPropagation(); } }); $(document).mouseover(function(e) { c.style.display = 'none'; }); })(); initUpdateTime = function() { var mtime = parseInt(matchData); // 指数弹层中的赛前时间 $('#data-body tr').each(function(i, e) { var t = Math.floor((mtime - parseInt(e.getAttribute('lasttime'))) / 6e4); var h = t > 0 ? Math.floor(t / 60) : 0; var m = t > 0 ? t % 60 : 0; $(e).find('em:eq(0)') .attr('class', t > 120 ? 'gengxin-4' : t > 30 ? 'gengxin-3' : t > 5 ? 'gengxin-2' : 'gengxin-1') .attr('title', '更新时间:赛前' + (h ? h + '时' : '') + (m + '分')) ; }); }; initHeader = function() { //变量 var com_count = $('#com-count')[0].innerHTML; //头部 var tr = $('#data-body tbody tr').each(function(i, tr) { var td = $(tr).find('td'); tr.$a = i; tr.$b = Number(td[2] .getAttribute('data')); tr.$c = Number(td[3] .getAttribute('data')); tr.$d = Number(td[4] .getAttribute('data')); tr.$e = Number(td[5] .getAttribute('data')); tr.$f = Number(td[6] .getAttribute('data')); tr.$g = Number(td[7] .getAttribute('data')); tr.$h = Number(td[9] .getAttribute('data')); tr.$i = Number(td[10].getAttribute('data')); tr.$j = Number(td[11].getAttribute('data')); tr.$k = Number(td[12].getAttribute('data')); tr.$l = Number(td[13].getAttribute('data')); tr.$m = Number(td[14].getAttribute('data')); tr.$n = Number(td[15].getAttribute('data')); //公司类型 tr.$com_type = td[1].getAttribute('data'); }); var sort = function(n/* String name */, r/* Boolean reverse */) { if(r) { tr.sort(function(a, b) {return a[n] - b[n]}); } else { tr.sort(function(a, b) {return b[n] - a[n]}); } for(var e = $('#data-body tbody')[0], i = 0; tr[i]; i++) { e.appendChild(tr[i]); } }; // 筛选数据 var sift = function() { var select = document.getElementById('com-type'); var input = document.getElementsByName('data-sift'); $b1 = Number(input[0].value || -Infinity); $b2 = Number(input[1].value || Infinity); $c1 = Number(input[2].value || -Infinity); $c2 = Number(input[3].value || Infinity); $d1 = Number(input[4].value || -Infinity); $d2 = Number(input[5].value || Infinity); $e1 = Number(input[6].value || -Infinity); $e2 = Number(input[7].value || Infinity); $f1 = Number(input[8].value || -Infinity); $f2 = Number(input[9].value || Infinity); $g1 = Number(input[10].value || -Infinity); $g2 = Number(input[11].value || Infinity); $h1 = Number(input[12].value || -Infinity); $h2 = Number(input[13].value || Infinity); $i1 = Number(input[14].value || -Infinity); $i2 = Number(input[15].value || Infinity); $j1 = Number(input[16].value || -Infinity); $j2 = Number(input[17].value || Infinity); $k1 = Number(input[18].value || -Infinity); $k2 = Number(input[19].value || Infinity); $l1 = Number(input[20].value || -Infinity); $l2 = Number(input[21].value || Infinity); $m1 = Number(input[22].value || -Infinity); $m2 = Number(input[23].value || Infinity); for(var e, c = 0, i = 0; e = tr[i]; i++) { //公司筛选 if(select.value != 'x' && e.$com_type.indexOf(select.value) < 0) {e.style.display = 'none'; c++; continue} //高级筛选 if((!isNaN($b1) && $b1 > e.$b) || (!isNaN($b2) && $b2 < e.$b)) {e.style.display = 'none'; c++; continue} if((!isNaN($c1) && $c1 > e.$c) || (!isNaN($c2) && $c2 < e.$c)) {e.style.display = 'none'; c++; continue} if((!isNaN($d1) && $d1 > e.$d) || (!isNaN($d2) && $d2 < e.$d)) {e.style.display = 'none'; c++; continue} if((!isNaN($e1) && $e1 > e.$e) || (!isNaN($e2) && $e2 < e.$e)) {e.style.display = 'none'; c++; continue} if((!isNaN($f1) && $f1 > e.$f) || (!isNaN($f2) && $f2 < e.$f)) {e.style.display = 'none'; c++; continue} if((!isNaN($g1) && $g1 > e.$g) || (!isNaN($g2) && $g2 < e.$g)) {e.style.display = 'none'; c++; continue} if((!isNaN($h1) && $h1 > e.$h) || (!isNaN($h2) && $h2 < e.$h)) {e.style.display = 'none'; c++; continue} if((!isNaN($i1) && $i1 > e.$i) || (!isNaN($i2) && $i2 < e.$i)) {e.style.display = 'none'; c++; continue} if((!isNaN($j1) && $j1 > e.$j) || (!isNaN($j2) && $j2 < e.$j)) {e.style.display = 'none'; c++; continue} if((!isNaN($k1) && $k1 > e.$k) || (!isNaN($k2) && $k2 < e.$k)) {e.style.display = 'none'; c++; continue} if((!isNaN($l1) && $l1 > e.$l) || (!isNaN($l2) && $l2 < e.$l)) {e.style.display = 'none'; c++; continue} if((!isNaN($m1) && $m1 > e.$m) || (!isNaN($m2) && $m2 < e.$m)) {e.style.display = 'none'; c++; continue} e.style.display = ''; } $('#com-count')[0].innerHTML = com_count - c; }; // 处理表头 $('#data-header').click(function(e) { var t = e.target; var b = document.body; if(t.className.indexOf('pm') > -1) { $('tr.tabtit a.pm').each(function(i, e) { if(e !== t) {e.className = 'pm'} }); if(t.className == 'pm') { t.className = 'pm up'; } else if(t.className == 'pm up') { t.className = 'pm down'; } else if(t.className == 'pm down') { t.className = 'pm up'; } sort(t.getAttribute('data'), t.className.indexOf('up') > -1); } if(t.value == '筛 选') { sift(); position(); scroll(); OP.init(); // 生成 } if(t.innerHTML == '筛选') { $('tr.shaixuan').css('display', function(i, v) { if(v != 'none') { $('span.sx-tag-h').attr('class', 'sx-tag'); return 'none'; } else { $('span.sx-tag').attr('class', 'sx-tag-h'); return ''; } }); } if(t.innerHTML == '关闭') { $('span.sx-tag-h').attr('class', 'sx-tag'); $('tr.shaixuan').css('display', 'none'); } if(t.innerHTML == "初始") { $('button.showBtn').css('display', 'none'); b.className = b.className.replace(/#1/g, ''); position(); scroll(); } if(t.innerHTML == "隐藏") { $('button.showBtn').css('display', ''); b.className += ' #1'; position(); scroll(); } }); // 选择公司 $('#com-type').change(function(e) { sift(); position(); scroll(); dobusiness(); OP.init(); // 生成 }); /* 底部内容控制 */ var dh = $('#data-header')[0]; var db = $('#data-body')[0]; var df = $('#data-footer')[0]; var y1 = 0; var y2 = 0; // 返回top位置 var position = function() { y1 = $(db).offset().top - $(dh).height() - 60; y2 = $(db).offset().top + $(db).height() - $(df).height() - $(window).height(); }; // 头、尾加浮动样式 var scroll = function() { if($('#checkbox-scroll')[0].checked) { dh.className = ($(window).scrollTop() > y1) ? 'header-fix' : 'data-header'; df.className = ($(window).scrollTop() < y2) ? 'footer-fix' : 'data-footer'; } else { dh.className = 'data-header'; df.className = 'data-footer'; } }; $(df).click(function(e) { var t = e.target; // 显示选择处理 if(t.value == "显示选择") { var c = 0; $(db).find('tr').each(function(i, e) { if(!$(e).find('input')[0].checked) { e.style.display = 'none'; c++; } }); $('#com-count')[0].innerHTML = com_count - c; position(); scroll(); dobusiness(); OP.init(); // 生成 } // 处理恢复数据 if(t.innerHTML == "恢复") { $(db).find('tr').each(function(i, e) { e.style.display = ''; }); $('#com-count')[0].innerHTML = com_count; position(); scroll(); dobusiness(); OP.init(); // 生成 } // 全选处理 if(t.innerHTML == "全选") { $(db).find('input').each(function(i, e) {e.checked = true}); } // 反选处理 if(t.innerHTML == "反选") { $(db).find('input').each(function(i, e) {e.checked = !e.checked}); } // 浮动处理 if(t.value == '头尾浮动') { position(); scroll(); } }); position(); scroll(); $(window).scroll(scroll).resize(function() {position(); scroll()}); }; // 计算均值 var dobusiness = function(){ //建立数组 var arr = new Array(); var ar = new Array(); //初始化数组 for(var i=0;i<4;i++){ arr[i]= new Array(); for(var j=0;j<=15;j++) arr[i][j]=0; } //公司总数 var count = $("#com-count").text(); for(var i=2;i<=7;i++){ ar[i]= new Array(); for(var j=0;j<count;j++) ar[i][j]=0; } //计数 var sum =0; //遍历数据存入数组 $("#data-body table tr").each(function(i,e){ //显示的tr if($(e).is(":visible")){ $(e).find("td").each(function(j,ee){ //需要统计的td if(j!=8&&j<=15&&j>=2){ //得到值 var v = parseFloat($(ee).text()); //均值累计 arr[0][j] += v; //最大 if(v>arr[1][j]) arr[1][j]=v; //最小 if(arr[2][j]==0 || v<arr[2][j]){ arr[2][j]=v; } //储存胜水位 if(j>=2 && j<=7) ar[j][sum] = v; } }); sum++; } }); //页面显示 $("#data-footer table tr").each(function(i,e){ if(i<=2){ $(e).find("td").each(function(j,ee){ if(j!=8 && j<=15 && j>=2){ if(i==0) arr[i][j]/=sum==0?1:sum; $(ee).text(arr[i][j].toFixed(2)); } }); } }); //计算方差 var init_fc_win = fcsj(sum,ar[2],arr[0][2]);//初始胜方差 var init_fc_draw = fcsj(sum,ar[3],arr[0][3]);//初始平方差 var init_fc_lost = fcsj(sum,ar[4],arr[0][4]);//初始负方差 var t1 = fcsj(sum,ar[5],arr[0][5]); var t2 = fcsj(sum,ar[6],arr[0][6]); var t3 = fcsj(sum,ar[7],arr[0][7]); //页面显示 $(".otherodds").text("离散度% "+ Math.sqrt(t1).toFixed(2) +" "+ Math.sqrt(t2).toFixed(2)+ " "+ Math.sqrt(t3).toFixed(2) +" | 中足网方差% "+t1+" "+ t2 +" "+ t3); var fcObj = [ {init_win:init_fc_win, init_draw:init_fc_draw, init_lost:init_fc_lost}, {new_win:t1, new_draw:t2, new_lost:t3} ] return fcObj; // 返回初始和最新方差对象 }; // 方差计算 function fcsj(sum,ar,arr){ var tota=0; for(var i=0;i<sum;i++){ tota += Math.pow((ar[i]-arr),2); } tota /= sum == 0 ? 1 : sum; return (tota*100).toFixed(2); }; //---------------------------------------------------------------------------------- // 创建欧赔对象 var OP = OP || {}; OP = { // 返回一组数据中有重复的数和重复的次数 dataLogic : function(oArr){ var oDataJson={}; var oFinallyArr = []; for(var i=0; i<oArr.length; i++){ var ret = oArr[i]; if(!oDataJson[ret]){ oDataJson[ret]=1; } else { oDataJson[ret]++; } }; for(var key in oDataJson){ oFinallyArr.push([parseFloat(key), oDataJson[key], key+","+oDataJson[key]]); // 转成一个二维数姐 }; return oFinallyArr; }, // 获取显示的td getVisibleData : function(){ this.clearChars(); var oIS = []; // 初始赔率-胜 var oIP = []; // 初始赔率-平 var oIF = []; // 初始赔率-负 var oNS = []; // 最新赔率-胜 var oNP = []; // 最新赔率-平 var oNF = []; // 最新赔率-负 $("#data-body tr:visible").each(function(){ oIS.push($(this).find("td").eq(2).attr("data")); oIP.push($(this).find("td").eq(3).attr("data")); oIF.push($(this).find("td").eq(4).attr("data")); oNS.push($(this).find("td").eq(5).attr("data")) oNP.push($(this).find("td").eq(6).attr("data")) oNF.push($(this).find("td").eq(7).attr("data")) }) /* 数据模型 var oDefault = { grid : { // 网格 drawGridlines : false, shadow : false }, seriesDefaults : { //线 renderer : $.jqplot.BarRenderer, rendererOptions : { varyBarColor : true, barWidth : 3, shadowOffset : 0.5 } }, seriesColors : ["#cccccc"], //线颜色 highlighter : { //荧光笔 show : true, tooltipLocation : 'n', sizeAdjust : 4, yvalues : 3, formatString : '<span style="display:none;">%s,%s,</span>%s' } } if(oIS.length>0 && oIP.length>0 && oIF.length>0){ jQuery.jqplot("initOdds1", [this.dataLogic(oIS)], $.extend(oDefault, {seriesColors : ["#C70000"]})); jQuery.jqplot("initOdds2", [this.dataLogic(oIP)], $.extend(oDefault, {seriesColors : ["#333333"]})); jQuery.jqplot("initOdds3", [this.dataLogic(oIF)], $.extend(oDefault, {seriesColors : ["#0E66C1"]})); } if(oNS.length>0 && oNP.length>0 && oNF.length>0){ jQuery.jqplot("newsOdds1", [this.dataLogic(oNS)], $.extend(oDefault, {seriesColors : ["#C70000"]})); jQuery.jqplot("newsOdds2", [this.dataLogic(oNP)], $.extend(oDefault, {seriesColors : ["#333333"]})); jQuery.jqplot("newsOdds3", [this.dataLogic(oNF)], $.extend(oDefault, {seriesColors : ["#0E66C1"]})); } */ }, // 清除图表 clearChars:function(){ $("#initOdds1").empty(); $("#initOdds2").empty(); $("#initOdds3").empty(); $("#newsOdds1").empty(); $("#newsOdds2").empty(); $("#newsOdds3").empty(); }, // 获取表值 getOddsVal: function(){ var oInitCharsBox = $("#initCharsBox .var-ps-2"); var oNewCharsBox = $("#newCharsBox .var-ps-2"); var opath0 = $("#data-footer tr:eq(0)"); var opath1 = $("#data-footer tr:eq(1)"); var opath2 = $("#data-footer tr:eq(2)"); /* initOdds:初赔数据 * 0:胜 1:平 2:负 * [平均, 最大, 最小, 方差] * */ var getDobusiness = dobusiness(); // 获取初始、最新方差 var initOdds = { 0:[$("td", opath0).eq(2).text(), $("td", opath1).eq(2).text(), $("td", opath2).eq(2).text(), getDobusiness[0].init_win], 1:[$("td", opath0).eq(3).text(), $("td", opath1).eq(3).text(), $("td", opath2).eq(3).text(), getDobusiness[0].init_draw], 2:[$("td", opath0).eq(4).text(), $("td", opath1).eq(4).text(), $("td", opath2).eq(4).text(), getDobusiness[0].init_lost] } var newOdds ={ 0:[$("td", opath0).eq(5).text(), $("td", opath1).eq(5).text(), $("td", opath2).eq(5).text(), getDobusiness[1].new_win], 1:[$("td", opath0).eq(6).text(), $("td", opath1).eq(6).text(), $("td", opath2).eq(6).text(), getDobusiness[1].new_draw], 2:[$("td", opath0).eq(7).text(), $("td", opath1).eq(7).text(), $("td", opath2).eq(7).text(), getDobusiness[1].new_lost] } oInitCharsBox.each(function(i){ $(this).empty().html('<span class="red">最大:'+ initOdds[i][1] +'</span><span class="green">最小:'+ initOdds[i][2] +'</span><span>平均:'+ initOdds[i][0] +'</span><span>方差%:'+ initOdds[i][3] +'</span>'); }) oNewCharsBox.each(function(i){ $(this).empty().html('<span class="red">最大:'+ newOdds[i][1] +'</span><span class="green">最小:'+ newOdds[i][2] +'</span><span>平均:'+ newOdds[i][0] +'</span><span>方差%:'+ newOdds[i][3] +'</span>'); }) }, init: function(){ this.getVisibleData(); this.getOddsVal(); } }
var App = require('app'); /** * Users View * * @namespace App * @extends {Ember.View} */ App.UsersView = Em.View.extend({ templateName: 'users' });
/** * @function Home * @constructor * * @desc When constructed instantiates a series of elements that build out to * a simple counter. The count is held in a state object which is accessed by * other methods. When the state object is altered, the UI element containing * a visual representation of the state is updated. This is all done explicitly * in this function. */ function Home() { /****** Elements ******/ // Containers const counter = document.createElement('div'); const count = document.createElement('div'); const controls = document.createElement('div'); // Controls const btnIncr = document.createElement('button'); const btnDcr = document.createElement('button'); // Header const header = document.createElement('h1'); /****** State ******/ this.state = { count: 0 }; /****** Methods ******/ /** * @method increaseCount * @param e<Event> - Native event object. * @desc Accesses the local state. Increases it by 1 and updates the UI accordingly. */ this.increaseCount = e => { this.state.count = this.state.count + 1; // Set the state to the current state + 1 console.log('Increased ', this.state.count); // Log the change count.innerText = this.state.count; // Update the UI element with the new count }; /** * @method decreaseCount * @param e<Event> - Native event object. * @desc Accesses the local state. Decreases it by 1 and updates the UI accordingly. */ this.decreaseCount = e => { this.state.count = this.state.count - 1; console.log('Decreased ', this.state.count); count.innerText = this.state.count; }; /** * @method render * @param e<Event> - Native Event object. * @desc Returns the generated `counter` element containing all of the other * generated elements from within this function. This is used to append the * element to the HTML file calling for the application. */ this.render = e => { console.log('Rendered Home Component'); return counter; } /****** Setup ******/ /** * Give the containers classes so they can be * styled or accessed explicitly by other functions. */ counter.classList.add('counter'); count.classList.add('count'); controls.classList.add('count'); /** * Add event listeners to the increase and decress buttons. * This associates the above defined methods with each button. */ btnIncr.addEventListener('click', this.increaseCount); btnDcr.addEventListener('click', this.decreaseCount); /** * Add clear labelling to the buttons. */ btnIncr.innerText = '++'; btnDcr.innerText = '--'; /** * Our heading message */ header.innerText = 'Hello, World!'; /** * Display the initial state of the function */ count.innerText = this.state.count; /****** Assemble ******/ /** * Elements are added to containers in a specific order. * Note that they are appended, so they are added to the * respective container element in the order the `appendChild` * function is called here. */ controls.appendChild(btnIncr); controls.appendChild(btnDcr); counter.appendChild(header); counter.appendChild(count); counter.appendChild(controls); } export { Home }
import React,{useState,useEffect} from 'react' import axios from 'axios' import { navigate} from '@reach/router' const People= ({id}) =>{ const [SWPL,setSWPL]=useState({name:""}); const [SWP,setSWP]=useState({ name:"", height:0, mass:0, hair_color:"", skin_color:"", homeworld:"" }) useEffect(()=>{ axios.get("https://swapi.dev/api/people/"+id) .then( res => setSWP(res.data)) .catch( err => console.log(err)); axios.get(`${SWP.homeworld}`) .then( res => setSWPL(res.data)) .catch( err => console.log(err)); }) const click=(e)=>{ const Pid = SWP.homeworld.match(/\d+/)[0]; navigate(`/planets/${Pid}`) } return( <div> <h1>{SWP.name}</h1> <h2 onClick={click}>Home World:{SWPL.name} </h2> <h5>Height: {SWP.height} cm</h5> <h5>Mass: {SWP.mass} kg</h5> <h5>Hair Color: {SWP.hair_color}</h5> <h5>Skin Color: {SWP.skin_color}</h5> </div> ) } export default People;
; (function() { // CommonJS SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined' ? require('shCore').SyntaxHighlighter : null); function getFunctions(str) { return str .split(/\s+/) .filter(v => v) .map(v => `\\b${v}(?=\\s*\\()`) .join('|'); } function Brush() { // Based on shBrushCpp.js // Copyright 2006 Shin, YoungJin, Rai var datatypes = 'unsigned signed const constexpr scope static volatile' + 'String array bool boolean byte char double float int long short string void word ' + 'size_t wchar_t char16_t char32_t int8_t int16_t int32_t int64_t uint8_t uint16_t uint32_t uint64_t div_t ldiv_t'; var keywords = 'alignas alignof auto break case catch class decltype __finally __exception __try ' + 'const_cast continue private public protected __declspec ' + 'default delete deprecated dllexport dllimport do dynamic_cast ' + 'else enum explicit extern if for friend goto inline ' + 'mutable naked namespace new noinline noreturn nothrow noexcept nullptr ' + 'ref register reinterpret_cast return selectany ' + 'sizeof static static_cast static_assert struct switch template this ' + 'thread thread_local throw true false try typedef typeid typename union ' + 'using uuid virtual volatile whcar_t while ' + 'setup loop Serial Serial1 Serial2 Serial3 PROGMEM'; var constants = 'HIGH LOW INPUT OUTPUT INPUT_PULLUP LED_BUILTIN'; var functions = 'delay delayMicroseconds micros millis ' + 'pinMode digitalRead digitalWrite analogRead analogReference analogWrite analogReadResolution analogWriteResolution noTone pulseIn pulseInLong shiftIn shiftOut tone ' + 'abs constrain map max min pow sq sqrt cos sin tan random randomSeed bit bitClear bitRead bitSet bitWrite highByte lowByte ' + 'isAlpha isAlphaNumeric isAscii isControl isDigit isGraph isHexadecimalDigit isLowerCase isPrintable isPunct isSpace isUpperCase isWhitespace ' + 'attachInterrupt detachInterrupt interrupts noInterrupts ' + 'available availableForWrite begin end find findUntil flush parseFloat parseInt peek print println read readBytes readBytesUntil setTimeout write serialEvent ' + 'charAt compareTo concat c_str endsWith equals equalsIgnoreCase getBytes indexOf lastIndexOf length remove replace reserve setCharAt StartsWith substring toCharArray toInt toFloat toLowerCase toUpperCase trim ' + 'assert isalnum isalpha iscntrl isdigit isgraph islower isprint' + 'ispunct isspace isupper isxdigit tolower toupper errno localeconv ' + 'setlocale acos asin atan atan2 ceil cos cosh exp fabs floor fmod ' + 'frexp ldexp log log10 modf pow sin sinh sqrt tan tanh ' + 'longjmp setjmp raise signal va_arg va_end va_start ' + 'clearerr fclose feof ferror fflush fgetc fgetpos fgets fopen ' + 'fprintf fputc fputs fread freopen fscanf fseek fsetpos ftell ' + 'fwrite getc getchar gets perror printf putc putchar puts remove ' + 'rename rewind scanf setbuf setvbuf sprintf sscanf tmpfile tmpnam ' + 'ungetc vfprintf vprintf vsprintf abort abs atexit atof atoi atol ' + 'bsearch calloc div exit free getenv labs ldiv malloc mblen mbstowcs ' + 'mbtowc qsort rand realloc srand strtod strtol strtoul system ' + 'wcstombs wctomb memchr memcmp memcpy memmove memset strcat strchr ' + 'strcmp strcoll strcpy strcspn strerror strlen strncat strncmp ' + 'strncpy strpbrk strrchr strspn strstr strtok strxfrm asctime ' + 'clock ctime difftime gmtime localtime mktime strftime time'; this.regexList = [ {regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments'}, // one line comments {regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments'}, // multiline comments {regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string'}, // strings {regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string'}, // strings {regex: /^ *#.*/gm, css: 'preprocessor'}, {regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'color1 bold'}, {regex: new RegExp(getFunctions(functions), 'gm'), css: 'functions bold'}, {regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword bold'}, {regex: new RegExp(this.getKeywords(constants), 'gm'), css: 'constants bold'}, //{regex: /[A-Za-z_]\w*(?=\s*\()/gm, css: 'functions bold'}, //{regex: /\b(?:[A-Z_][\dA-Z_]*)\b/gm, css: 'constants bold'}, ]; }; Brush.prototype = new SyntaxHighlighter.Highlighter(); Brush.aliases = ['arduino', 'ino']; SyntaxHighlighter.brushes.Arduino = Brush; // CommonJS typeof (exports) != 'undefined' ? exports.Brush = Brush : null; })();
/* * Page object for the navigation block in a customer's account * * @package: Blueacorn AccountNavigation.js * @version: 1.0 * @Author: Blue Acorn, Inc. <code@blueacorn.com> * @Copyright: Copyright 2015-06-24 09:57:07 Blue Acorn, Inc. */ function AccountNavigation() { var accountInformationLinkPath = 'body > div.wrapper > div > div.main-container.col2-left-layout > div > div.col-left.sidebar.col-left-first > div > div.block-content > ul > li:nth-child(2) > a'; var addressBookLinkPath = 'body > div.wrapper > div > div.main-container.col2-left-layout > div > div.col-left.sidebar.col-left-first > div > div.block-content > ul > li:nth-child(3) > a'; var myOrdersLinkPath = 'body > div.wrapper > div > div.main-container.col2-left-layout > div > div.col-left.sidebar.col-left-first > div > div.block-content > ul > li:nth-child(4) > a'; var billingAgreementsLinkPath = 'body > div.wrapper > div > div.main-container.col2-left-layout > div > div.col-left.sidebar.col-left-first > div > div.block-content > ul > li:nth-child(5) > a'; var recurringProfilesLinkPath = 'body > div.wrapper > div > div.main-container.col2-left-layout > div > div.col-left.sidebar.col-left-first > div > div.block-content > ul > li:nth-child(6) > a'; var myProductReviewsLinkPath = 'body > div.wrapper > div > div.main-container.col2-left-layout > div > div.col-left.sidebar.col-left-first > div > div.block-content > ul > li:nth-child(7) > a'; var myTagsLinkPath = 'body > div.wrapper > div > div.main-container.col2-left-layout > div > div.col-left.sidebar.col-left-first > div > div.block-content > ul > li:nth-child(8) > a'; var myWishlistLinkPath = 'body > div.wrapper > div > div.main-container.col2-left-layout > div > div.col-left.sidebar.col-left-first > div > div.block-content > ul > li:nth-child(9) > a'; var myApplicationsLinkPath = 'body > div.wrapper > div > div.main-container.col2-left-layout > div > div.col-left.sidebar.col-left-first > div > div.block-content > ul > li:nth-child(10) > a'; var newsletterSubscriptionsLinkPath = 'body > div.wrapper > div > div.main-container.col2-left-layout > div > div.col-left.sidebar.col-left-first > div > div.block-content > ul > li:nth-child(11) > a'; var myDownloadableProductsLinkPath = 'body > div.wrapper > div > div.main-container.col2-left-layout > div > div.col-left.sidebar.col-left-first > div > div.block-content > ul > li:nth-child(12) > a'; var storeCreditLinkPath = 'body > div.wrapper > div > div.main-container.col2-left-layout > div > div.col-left.sidebar.col-left-first > div > div.block-content > ul > li:nth-child(13) > a'; var giftCardLinkPath = 'body > div.wrapper > div > div.main-container.col2-left-layout > div > div.col-left.sidebar.col-left-first > div > div.block-content > ul > li:nth-child(14) > a'; var giftRegistryLinkPath = 'body > div.wrapper > div > div.main-container.col2-left-layout > div > div.col-left.sidebar.col-left-first > div > div.block-content > ul > li:nth-child(15) > a'; var rewardPointsLinkPath = 'body > div.wrapper > div > div.main-container.col2-left-layout > div > div.col-left.sidebar.col-left-first > div > div.block-content > ul > li:nth-child(16) > a'; var myInvitationsLinkPath = 'body > div.wrapper > div > div.main-container.col2-left-layout > div > div.col-left.sidebar.col-left-first > div > div.block-content > ul > li:nth-child(16) > a'; this.clickAccountInformationLink = function() { casper.then(function() { casper.click(accountInformationLinkPath); }); }; this.clickAddressBookLink = function() { casper.then(function() { casper.click(addressBookLinkPath); }); }; this.clickMyOrdersLink = function() { casper.then(function() { casper.click(myOrdersLinkPath); }); }; this.clickBillingAgreementsLink = function() { casper.then(function() { casper.click(billingAgreementsLinkPath); }); }; this.clickRecurringProfilesLink = function() { casper.then(function() { casper.click(recurringProfilesLinkPath); }); }; this.clickMyProductReviewsLink = function() { casper.then(function() { casper.click(myProductReviewsLinkPath); }); }; this.clickMyTagsLink = function() { capser.then(function() { casper.click(myTagsLinkPath); }); }; this.clickMyWishlistLink = function() { casper.then(function() { casper.click(myWishlistLinkPath); }); }; this.clickMyApplicationsLink = function() { casper.then(function() { casper.click(myApplicationsLinkPath); }); }; this.clickNewsletterSubscriptionLink = function() { casper.then(function() { casper.click(newsletterSubscriptionsLinkPath); }); }; this.clickMyDownloadableProductsLink = function() { capser.then(function() { casper.click(myDownloadableProductsLinkPath); }); }; this.clickStoreCreditLink = function() { casper.then(function() { casper.click(storeCreditLinkPath); }); }; this.clickGiftCardLink = function() { casper.then(function() { casper.click(giftCardLinkPath); }); }; this.clickGiftRegistryLink = function() { casper.then(function() { casper.click(giftRegistryLinkPath); }); }; this.clickRewardsPointsLink = function() { casper.then(function() { casper.click(rewardPointsLinkPath); }); }; this.clickMyInvitationsLink = function() { casper.then(function() { casper.click(myInvitationsLinkPath); }); }; }
import React from "react"; import ReactDOM from "react-dom"; import { Card, ProgressBar, Button, Container, Row, Col, Form } from 'react-bootstrap'; import NumbersCount from './NumbersCount'; class Dashboard extends React.Component { isToggleOn = false; handleClick = () => { this.isToggleOn = true; console.log(this.isToggleOn); } render() { return ( <Container> <Row> <Col Col xs={6} md={4}> <Card bg="dark" text="white" style={{ width: '18rem', margin:'20px', borderColor: 'white' }}> <Card.Header style={{ borderColor:'white' }}><h2>Exam 1</h2></Card.Header> <Card.Body> <Card.Title>A2-C1</Card.Title> <Card.Text style={{ fontSize:'16px'}}> <Button variant="outline-light" size="lg">Listening</Button> <Button variant="outline-light" size="lg">Speaking</Button> <Button variant="outline-light" size="lg">Reading</Button> <Button variant="outline-light" size="lg">Writing</Button> <ProgressBar animated now={45} style={{margin:'10px'}}/> </Card.Text> </Card.Body> </Card> </Col> </Row> <Form.Control size="lg" type="text" placeholder="Large text" /> <Button variant="outline-light" size="lg" onClick={this.handleClick}>Submit</Button> <div><NumbersCount /></div> </Container> ); } } export default Dashboard;
'use strict'; const {calculate} = require('./statistics'); module.exports.statistics = (event, context, callback) => { try { console.log("=== Request body: ==="); console.log(event.body); console.log("===\n"); const stats = calculate(JSON.parse(event.body)); const response = { statusCode: 200, body: JSON.stringify(stats), }; console.log("=== Response body: ==="); console.log(response); console.log("===\n"); callback(null, response); } catch (err) { console.log(err); const response = { statusCode: 500, body: JSON.stringify({ message: err.message, status: "error" }) }; callback(null, response); } }; module.exports.welcome = (event, context, callback) => { const response = { statusCode: 200, headers: { "Content-Type" : "text/html" }, body: 'It\'s alive. Please send data via POST.', }; callback(null, response); }; module.exports.metadata = (event, context, callback) => { var pjson = require('./package.json'); const response = { statusCode: 200, body: JSON.stringify({ [pjson.name]: { version: pjson.version, description: pjson.description, lastcommitsha: process.env.GIT_ENV }, }), }; callback(null, response); };
const BrowserWaits = require('../../support/customWaits'); const { browser, $ } = require('protractor'); const CucumberReportLog = require('../../support/reportLogger'); const ShareCaseData = require('../../utils/shareCaseData'); class ShareCaseCheckAndConfirmPage { constructor(){ this.pageContainer = $('xuilib-share-case-confirm'); this.summarySelectionContainer = $('#summarySections'); this.selectedCaseConfirmList = $$('xuilib-selected-case-confirm #user-access-block'); this.backLink = $('.govuk-back-link'); this.confirmBtn = $('#share-case-nav button'); this.changesSubmissionConfirmationContainer = $('.govuk-panel--confirmation'); } async waitForPageToLoad(){ await BrowserWaits.waitForElement(this.pageContainer, 'Share Case Conform your selection page not displayed.'); await BrowserWaits.waitForElement(this.summarySelectionContainer, 'Share Case confirm selection summary not displayed'); } async amOnPage(){ await this.waitForPageToLoad(); return await this.pageContainer.isDisplayed(); } async getCaseIdOfCaseContainer(containerIndex){ let caseContainer = await this.selectedCaseConfirmList.get(containerIndex); if (!caseContainer){ throw Error('no Case at position ' + containerIndex); } await BrowserWaits.waitForElement(caseContainer.$('.case-share-confirm__caption-area .case-share-confirm__caption'), 'case sub title not displayed for case at pos ' + containerIndex); let caseId = await caseContainer.$('.case-share-confirm__caption-area .case-share-confirm__caption').getText(); return caseId; } async getcaseContainerWithId(caseid){ let casesCount = await this.selectedCaseConfirmList.count(); for (let caseCounter = 0; caseCounter < casesCount; caseCounter++){ let caseContainer = await this.selectedCaseConfirmList.get(caseCounter); await BrowserWaits.waitForElement(caseContainer.$('.case-share-confirm__caption-area .case-share-confirm__caption'), 'case sub title not displayed for case at pos ' + caseCounter); let caseId = await caseContainer.$('.case-share-confirm__caption-area .case-share-confirm__caption').getText(); if (caseId.includes(caseid)){ return caseContainer; } } return null; } async getUserActionForCaseId(caseId, email){ let caseContainer = await this.getcaseContainerWithId(caseId); let userRows = caseContainer.$$('tbody tr'); let usersCount = await userRows.count(); for(let userCounter = 0; userCounter < usersCount; userCounter++){ let userRow = await userRows.get(userCounter); let userEmail = await userRow.$('td:nth-of-type(2)').getText(); if (userEmail.includes(email)){ return await userRow.$('td:nth-of-type(3)').getText(); } } return null; } async isUserMarkedToBeRemovedIncase(caseId, email){ let userActionStatus = await this.getUserActionForCaseId(caseId, email); return userActionStatus ? userActionStatus.toLowerCase().includes('remove') : false; } async isUserMarkedToBeAddedIncase(caseId, email) { let userActionStatus = await this.getUserActionForCaseId(caseId, email); return userActionStatus ? userActionStatus.toLowerCase().includes('added'): false; } async validateShareCaseChangesForListedCases(){ let casesCount = await this.selectedCaseConfirmList.count(); let issuesList = []; for(let caseCounter = 0; caseCounter < casesCount; caseCounter++){ let caseid = await this.getCaseIdOfCaseContainer(caseCounter); let caseShareData = ShareCaseData.getCaseWithId(caseid); for (let shareWithCounter = 0; shareWithCounter < caseShareData.markedForShare.length; shareWithCounter++) { let email = caseShareData.markedForShare[shareWithCounter]; if (!(await this.isUserMarkedToBeAddedIncase(caseid, email))) { issuesList.push(email + 'marked for added in not persisted ' + caseId); } } for (let shareWithCounter = 0; shareWithCounter < caseShareData.markedForUnShare.length; shareWithCounter++) { let email = caseShareData.markedForUnShare[shareWithCounter]; if (!(await this.isUserMarkedToBeRemovedIncase(caseid, email))) { issuesList.push(email + 'marked to remove in not persisted ' + caseId); } } } CucumberReportLog.AddScreenshot(screenShotUtils); return issuesList; } async clickBack(){ await this.backLink.click(); } async clickChangeLinkForCase(caseNum){ let caseContainer = await this.getcaseContainerWithId(caseNum); await caseContainer.$('a').click(); } async clickConfirmBtn(){ await this.confirmBtn.click(); ShareCaseData.changesCommited(); } async isSubmissionSuccessful(){ await BrowserWaits.waitForElement(this.changesSubmissionConfirmationContainer); const message = await this.changesSubmissionConfirmationContainer.getText(); return message.includes('Your cases have been updated'); } } module.exports = ShareCaseCheckAndConfirmPage;
(function ($, undefined) { $.namespace('inews.property.animation'); inews.property.animation.AnimationEditorDlg = function (options) { var body, field, select, table, thead, tr, footer, button; var el, self = this; this._options = options; // 창을 열기전 상태 저장 this._oldEditorLockSet = {}; this._oldSelectObjects = $('.editor-area .selected'); this._oldEditorLockSet[EDITOR_LOCK_MOVE] = $('.editor-area').IEditor('getLock', EDITOR_LOCK_MOVE); this._oldEditorLockSet[EDITOR_LOCK_SELECT] = $('.editor-area').IEditor('getLock', EDITOR_LOCK_SELECT); this._oldEditorLockSet[EDITOR_LOCK_RESIZE] = $('.editor-area').IEditor('getLock', EDITOR_LOCK_RESIZE); this._oldEditorLockSet[EDITOR_LOCK_CREATE] = $('.editor-area').IEditor('getLock', EDITOR_LOCK_CREATE); $('.editor-area').IEditor('setLock', EDITOR_LOCK_MOVE, true); $('.editor-area').IEditor('setLock', EDITOR_LOCK_SELECT, false); $('.editor-area').IEditor('setLock', EDITOR_LOCK_RESIZE, true); $('.editor-area').IEditor('setLock', EDITOR_LOCK_CREATE, true); propertySetLock(true); $(this._oldSelectObjects).IObject('unselect'); body = $('<div></div>').addClass('ia-animation-editor').addClass('ia-animation-dlg'); if (options.id) body.attr('id', options.id); field = $('<div></div>').addClass('field').appendTo(body); $('<label></label>').html(MESSAGE['IA_ANIMATION_EDITOR_NAME']).appendTo(field); $('<input></input>').attr('id', 'ia-animation-editor-name').attr('type', 'text').appendTo(field); $('<hr></hr>').appendTo(body); field = $('<div></div>').addClass('list').appendTo(body); table = $('<table></table>').addClass('ia-animation-editor-list').width(361).appendTo(field); thead = $('<thead></thead>').appendTo(table); tr = $('<tr></tr>').appendTo(thead); $('<th></th>').attr('id', 'ia-animation-editor-header-keyframe').html(MESSAGE['IA_ANIMATION_EDITOR_HEADER_KEYFRAME']).appendTo(tr); $('<th></th>').attr('id', 'ia-animation-editor-header-values').html(MESSAGE['IA_ANIMATION_EDITOR_HEADER_VALUES']).appendTo(tr); $('<tbody></tbody>').appendTo(table); footer = $('<div></div>').addClass('footer').appendTo(field); $('<a></a>').addClass('button').attr('id', 'btn-ia-animation-editor-footer-add').attr('data-action', BTN_ADD).attr('title', MESSAGE['IA_ANIMATION_EDITOR_TOOLTIP_ADD']).appendTo(footer); $('<a></a>').addClass('button').attr('id', 'btn-ia-animation-editor-footer-modify').attr('data-action', BTN_MODIFY).attr('title', MESSAGE['IA_ANIMATION_EDITOR_TOOLTIP_MODIFY']).appendTo(footer); $('<a></a>').addClass('button').attr('id', 'btn-ia-animation-editor-footer-delete').attr('data-action', BTN_DELETE).attr('title', MESSAGE['IA_ANIMATION_EDITOR_TOOLTIP_DELETE']).appendTo(footer); $('<a></a>').addClass('button').attr('id', 'btn-ia-animation-style-footer-detect').attr('data-action', BTN_DETECT).attr('title', MESSAGE['IA_ANIMATION_EDITOR_TOOLTIP_DETECT']).appendTo(footer); $('<hr></hr>').appendTo(body); field = $('<div></div>').addClass('field').appendTo(body); $('<label></label>').html(MESSAGE['IA_ANIMATION_EDITOR_TARGETOBJ']).appendTo(field); $('<input></input>').attr('id', 'ia-animation-editor-targetobj').attr('type', 'text').attr('readonly', true).appendTo(field); $('<button></button>').attr('id', 'ia-animation-editor-targetobj-select').html(MESSAGE['IA_ANIMATION_EDITOR_TARGETOBJ_SELECT']).appendTo(field); $('<hr></hr>').appendTo(body); button = $('<div></div>').addClass('buttonset').appendTo(body); $('<button></button>').attr('id', 'ia-animation-editor-ok').attr('data-action', BTN_OK).html(MESSAGE['OK']).appendTo(button); $('<button></button>').attr('id', 'ia-animation-editor-cancel').attr('data-action', BTN_CANCEL).html(MESSAGE['CANCEL']).appendTo(button); this.dlg = new inews.Dialog({ width: 361, //height: 'auto', modal: true, el: body, title: MESSAGE['IA_ANIMATION_EDITOR'], showCloseBtn: false }); this._addEmptyRow(); this._el = this.dlg.getEl(); if (options.data) { if (options.data.name) { $(this._el).find('#ia-animation-editor-name').val(options.data.name); $(this._el).find('#ia-animation-editor-name').attr('disabled', true); } if (options.data.targetObject) { $(this._el).find('#ia-animation-editor-targetobj').val(options.data.targetObject); $('.editor-area #'+options.data.targetObject).IObject('select'); } if (options.data.datas) { $.each(options.data.datas, function (idx, val) { self._add(val); }); } } $(this._el).find('.ia-animation-editor-list tbody').on(EVT_MOUSECLICK, 'tr', function (e) { $(self._el).find('.ia-animation-editor-list tbody tr').removeClass('selected'); $(this).addClass('selected'); e.preventDefault(); e.stopPropagation(); }); this.dlg.center(); $(this._el).find('.footer .button').on(EVT_MOUSECLICK, function (e) { var action = $(this).attr('data-action'); var el; switch (action) { case BTN_ADD: self._onAdd(); break; case BTN_MODIFY: self._onModify(); break; case BTN_DELETE: el = $(self._el).find('.ia-animation-editor-list .selected'); if (el.length > 0) { self._remove(el.attr('data-keyframe')); } case BTN_DETECT: self._onDetect(); break; default: break; } e.preventDefault(); e.stopPropagation(); }); $(this._el).find('#ia-animation-editor-targetobj-select').on(EVT_MOUSECLICK, function (e) { self._onSelectTargetObj(); e.preventDefault(); e.stopPropagation(); }); $(this._el).find('.buttonset button').on(EVT_MOUSECLICK, function (e) { var action = $(this).attr('data-action'); if (action == BTN_OK) { if (!$(self._el).find('#ia-animation-editor-name').val()) { alert(MESSAGE['IA_ANIMATION_EDITOR_NAME_IS_NOT_INPUTTED']); return; } if ($(self._el).find('.ia-animation-editor-list tbody tr').length < 1) { alert(MESSAGE['IA_ANIMATION_EDITOR_DEFINED_KEYFRAME_NOT_FOUND']); return; } } self._el.triggerHandler(EVT_BUTTONCLICK, [action]); self.close(); e.preventDefault(); e.stopPropagation(); }); }; inews.property.animation.AnimationEditorDlg.prototype._getRowWidth = function () { var ths = $('.ia-animation-editor-list thead th'); var width = 0; ths.each(function (idx, th) { width += $(th).outerWidth(); }); return width - parseInt($(ths[0]).css('padding-right')) - parseInt($(ths[ths.length - 1]).css('padding-left')) - 2; }; inews.property.animation.AnimationEditorDlg.prototype._addEmptyRow = function () { var listEl = $('.ia-animation-editor-list'); var tbody = $(listEl).find('tbody'); var colCnt = $(listEl).find('thead th').length; if ($(tbody).find('> *').length > 0) return; $('<tr><td colspan="' + colCnt + '">&nbsp;</td></tr>').addClass('empty').appendTo(tbody).find('td').width(this._getRowWidth()); }; inews.property.animation.AnimationEditorDlg.prototype._add = function (data) { var listEl = $(this._el).find('.ia-animation-editor-list'); var li, val = ''; $(listEl).find('.empty').remove(); li = listEl.find('tr[data-keyframe="'+data.keyframe+'"]'); if (li.length < 1) { li = $('<tr></tr>').appendTo(listEl.find('tbody')); li.addClass('ia-animation-editor-item'); li.attr('data-keyframe', data.keyframe); } li.empty(); li.data('keyframe', data.keyframe); li.data('datas', data.datas); $('<td></td>').html(data.keyframe).appendTo(li); $.each(data.datas, function (idx, css) { if (val != '') val += ','; val += css.css; }); $('<td></td>').html(val).appendTo(li); this._el.find('.ia-animation-editor-list').append(li); return true; }; inews.property.animation.AnimationEditorDlg.prototype._remove = function (keyframe) { var li = this._el.find('.ia-animation-editor-list tr[data-keyframe="'+keyframe+'"]'); li.remove(); this._addEmptyRow(); }; inews.property.animation.AnimationEditorDlg.prototype._onSelectTargetObj = function () { var self = this; var selDlg = selDlg = new inews.property.animation.AnimationSelectTargetObjDlg({ id: 'ia-animation-editor-target' }); this.dlg.hide(); $(selDlg._el).on(EVT_SELECT, function (e, objId) { $(self._el).find('#ia-animation-editor-targetobj').val(objId); }); $(selDlg._el).on(EVT_CLOSE, function () { $(this).off(EVT_SELECT); $(this).off(EVT_CLOSE); self.dlg.show(); }); }; inews.property.animation.AnimationEditorDlg.prototype._onAdd = function () { var dlg, self = this; this.dlg.hide(); dlg = new inews.property.animation.AnimationStyleDlg({ id: 'ia-animation-keyframe-add', targetObject: $(this._el).find('#ia-animation-editor-targetobj').val(), }); dlg.getEl().one(EVT_BUTTONCLICK, function (e, action) { if (action == BTN_OK) { var data = dlg.getData(); self._add({ keyframe: data.keyframe, datas: data.datas }); } self.dlg.show(); }); }; inews.property.animation.AnimationEditorDlg.prototype._onModify = function () { var dlg, dlgOption, li; var self = this; li = $(this._el).find('.ia-animation-editor-list tr.selected'); if (li.length < 1) { alert(MESSAGE['IA_ANIMATION_EDITOR_SELECTED_KEYFRAME_NOT_FOUND']); return; } this.dlg.hide(); dlgOption = { id: 'ia-animation-keyframe-modify', targetObject: $(this._el).find('#ia-animation-editor-targetobj').val(), data: { keyframe: li.data('keyframe'), datas: li.data('datas') } }; dlg = new inews.property.animation.AnimationStyleDlg(dlgOption); dlg.getEl().one(EVT_BUTTONCLICK, function (e, action) { if (action == BTN_OK) { var data = dlg.getData(); self._add({ keyframe: data.keyframe, datas: data.datas }); } self.dlg.show(); }); }; inews.property.animation.AnimationEditorDlg.prototype._onDetect = function () { var self = this; var detectDlg, li, nowData; var targetId = $(this._el).find('#ia-animation-editor-targetobj').val(); li = $(this._el).find('.ia-animation-editor-list tr.selected'); if (li.length < 1) { alert(MESSAGE['IA_ANIMATION_EDITOR_SELECTED_KEYFRAME_NOT_FOUND']); return; } if (!targetId) { alert(MESSAGE['IA_ANIMATION_EDITOR_TARGET_OBJECT_NOT_SELECTED']); return; } nowData = { keyframe: li.data('keyframe'), datas: li.data('datas') }; detectDlg = new inews.property.animation.AnimationStyleDetectDlg({ id: 'ia-animation-style-detect', css: nowData.datas, targetObj: targetId }); this.dlg.hide(); $(detectDlg._el).on(EVT_BUTTONCLICK, function (e, action) { if (action == BTN_APPLY) { var targetObj = $('.editor-area #'+targetId); var detectedCSS = $(targetObj).IObject('css'); var findIdx = function (css) { var idx = -1; $.each(nowData.datas, function (i, val) { if (val['css'] == css) idx = i; }); return idx; } detectedCSS = $.JSON.decode($.JSON.encode(detectedCSS)); // object copy $.each(detectedCSS, function (key, val) { var rowIdx; rowIdx = findIdx(key); if (rowIdx < 0) return; nowData.datas[rowIdx]['value'][0] = val[0]; if (val.length > 1) nowData.datas[rowIdx]['value'][1] = val[1]; }); self._add(nowData); } }); $(detectDlg._el).on(EVT_CLOSE, function (e) { $(this).off(EVT_BUTTONCLICK); $(this).off(EVT_CLOSE); self.dlg.show(); }); }; inews.property.animation.AnimationEditorDlg.prototype.close = function () { var el = this.dlg.getEl(); $(el).find('.ia-animation-editor-list tbody').off(EVT_MOUSECLICK, 'tr'); $(el).find('.buttonset button').off(EVT_MOUSECLICK); this.dlg.close(); // 창을 열기전 상태로 회귀 $('.editor-area .selected').IObject('unselect'); $(this._oldSelectObjects).IObject('select'); $('.editor-area').IEditor('setLock', EDITOR_LOCK_MOVE, this._oldEditorLockSet[EDITOR_LOCK_MOVE]); $('.editor-area').IEditor('setLock', EDITOR_LOCK_SELECT, this._oldEditorLockSet[EDITOR_LOCK_SELECT]); $('.editor-area').IEditor('setLock', EDITOR_LOCK_RESIZE, this._oldEditorLockSet[EDITOR_LOCK_RESIZE]); $('.editor-area').IEditor('setLock', EDITOR_LOCK_CREATE, this._oldEditorLockSet[EDITOR_LOCK_CREATE]); propertySetLock(false); }; inews.property.animation.AnimationEditorDlg.prototype.getData = function () { var datas = []; $(this._el).find('.ia-animation-editor-list tbody tr').each(function (idx, row) { var value = $(row).find('td .value'); var data = {}; data.keyframe = $(row).data('keyframe'); data.datas = $(row).data('datas'); datas.push(data); }); return { name: $(this._el).find('#ia-animation-editor-name').val(), targetObject: $(this._el).find('#ia-animation-editor-targetobj').val(), datas: datas }; }; inews.property.animation.AnimationEditorDlg.prototype.getEl = function () { return this._el; }; }(jQuery));
import isFunction from 'lodash/lang/isFunction'; export default function (elementId) { return { componentDidMount: function() { const el = document.getElementById(elementId); el.addEventListener('scroll', this.handleScrollChange); window.addEventListener('resize', this.handleScrollChange); }, componentWillUnmount: function() { const el = document.getElementById(elementId); el.removeEventListener('scroll', this.handleScrollChange); window.removeEventListener('resize', this.handleScrollChange); }, handleScrollChange: function() { const el = document.getElementById(elementId); if (isFunction(this.handleScroll)) { this.handleScroll({ top: el.scrollTop }); } else { this.setState({ scroll: { top: el.scrollTop } }); } }, scrollTo: function(y) { const el = document.getElementById(elementId); el.scrollTop = y; } }; };
/* eslint-disable import/prefer-default-export */ import LikeButtonInitiator from '../../src/scripts/utils/like-button-presenter'; const createLikeButtonPresenterWithMovie = async (resto) => { await LikeButtonInitiator.init({ likeButtonContainer: document.querySelector('#likeButtonContainer'), resto, }); }; export { createLikeButtonPresenterWithMovie };
import React from 'react' import { BrowserRouter } from 'react-router-dom' import Menu from './template' import Router from './routes' import './App.css' function App() { return ( <BrowserRouter> <div className='containerCentral' > <Menu /> <Router /> </div> </BrowserRouter> ) } export default App
var searchData= [ ['load',['load',['../class_file_persistence.html#a84d4001532cb827502fed807af22874a',1,'FilePersistence::load()'],['../class_persistence.html#a45c45470464c63fb0f7d6a75734dc684',1,'Persistence::load()']]], ['loadfile',['loadFile',['../class_load_game_menu.html#a6b65ba1ea2f3f12e0525f13f07efecc6',1,'LoadGameMenu']]] ];
import http from './http'; import transformData from './transformData'; import combineURL from '../helpers/combineURL'; import isAbsoluteURL from '../helpers/isAbsoluteURL'; /** * Dispatch a request to the server using the configured adapter * * @param {object} config The config that is to be used for the request * @returns {Promise} The Promise to be fulfilled */ function dispatchRequest(config) { if (config.baseURL && !isAbsoluteURL(config.url)) { config.url = combineURL(config.baseURL, config.url); } // Ensure header exist config.header = config.header || {}; // Flatten headers config.header = Object.assign( {}, config.header.common || {}, config.header[config.method] || {}, config.header || {} ); ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'].forEach(key => { delete config.header[key]; }); return http(config).then(response => { response.data = transformData( response.data, response.headers, config.transformResponse ); return response; }) } export default dispatchRequest;
try { var iisApp = GetObject("IIS://localhost/w3svc/1/root/atlanta"); iisApp.AppUnload(); } catch (e) { WScript.StdErr.WriteLine("Exception caught"); for (p in e) WScript.StdErr.WriteLine(p + "=" + e[p]); // don't error //WScript.Quit(1); }
const JwtStrategy = require('passport-jwt').Strategy; const ExtractJwt = require('passport-jwt').ExtractJwt; const User = require('../models/users.model'); const config = require('./config'); module.exports = function(passport) { let opts = {}; opts.jwtFromRequest = ExtractJwt.fromAuthHeaderWithScheme('jwt'); opts.secretOrKey = config.jwtSecret; passport.use(new JwtStrategy(opts, async(jwt_payload, done) => { try{ let user = await User.findOne({ _id: jwt_payload.data._id}) return user ? done(null, user) : done(null, false) } catch (e) { return done(e, false) } // User.findOne({_id: jwt_payload.data._id}, (err, user) => { // if(err) { // return done(err, false); // } // if(user) { // return done(null, user); // } else { // return done(null, false); // } // }); })); }
export const increment = (id) => ({ type: 'INCREMENT', payload: id }); export const decrement = (id) => ({ type: 'DECREMENT', payload: id }); export const select = (object) => ({ type: 'SELECT', payload: object }); export const next = (id) => ({ type: 'NEXT', payload:id }); export const before = (id) => ({ type: 'BEFORE', payload:id }); export const showList=(data)=> ({ type: 'SHOW_LIST', payload: data }) export const searchAlbum=(data)=> ({ type: 'SEARCH_ALBUM', payload: data })
var fs = require('fs'); var newLine = "\n哈哈哈哈哈哈"; // fs.writeFile('output.txt',newLine,function(err){ // if(err){ // throw err; // }else{ // console.log('ok'); // } // }); fs.appendFile('output.txt',newLine,function(err){ if(err){ throw err; } console.log('ok'); });
const { getDb } = require('../config/mongodb') const db = getDb() const series = db.collection('TV_Series') const { ObjectID } = require('mongodb') class SeriesModel { static getAllSeries() { return series.find().toArray() } static addSeries(seriesData) { return series.insertOne(seriesData) } static getSeriesById(id) { return series.findOne({ _id: ObjectID(id) }) } static updateSeries(id, seriesData) { return series.findOneAndUpdate({ _id: ObjectID(id)}, {$set: seriesData}, {returnOriginal: false }) } static deleteSeries(id) { return series.deleteOne({ _id: ObjectID(id) }) } } module.exports = SeriesModel
const path = require('path'); const getLessVariables = require('./src/utils/get-less-variables'); module.exports = { css: { loaderOptions: { less: { // modifyVars: { // 'base-color': '#409EFF', // }, modifyVars: getLessVariables('./src/assets/less/variable.less'), javascriptEnabled: true, }, }, }, configureWebpack: { resolve: { alias: { api: path.resolve(__dirname, 'static/api'), }, }, devServer: { port: '8081', }, }, };
! function() { "use strict"; var e = { ANIMATION_CUBIC_BEZIER: "cubic-bezier(.3,.95,.5,1)", MAX_ANIMATION_TIME_MS: 400 }, n = Polymer({ is: "paper-menu-button", behaviors: [Polymer.IronA11yKeysBehavior, Polymer.IronControlState], properties: { opened: { type: Boolean, value: !1, notify: !0, observer: "_openedChanged" }, horizontalAlign: { type: String, value: "left", reflectToAttribute: !0 }, verticalAlign: { type: String, value: "top", reflectToAttribute: !0 }, dynamicAlign: { type: Boolean }, horizontalOffset: { type: Number, value: 0, notify: !0 }, verticalOffset: { type: Number, value: 0, notify: !0 }, noOverlap: { type: Boolean }, noAnimations: { type: Boolean, value: !1 }, ignoreSelect: { type: Boolean, value: !1 }, closeOnActivate: { type: Boolean, value: !1 }, openAnimationConfig: { type: Object, value: function() { return [{ name: "fade-in-animation", timing: { delay: 100, duration: 200 } }, { name: "paper-menu-grow-width-animation", timing: { delay: 100, duration: 150, easing: e.ANIMATION_CUBIC_BEZIER } }, { name: "paper-menu-grow-height-animation", timing: { delay: 100, duration: 275, easing: e.ANIMATION_CUBIC_BEZIER } }] } }, closeAnimationConfig: { type: Object, value: function() { return [{ name: "fade-out-animation", timing: { duration: 150 } }, { name: "paper-menu-shrink-width-animation", timing: { delay: 100, duration: 50, easing: e.ANIMATION_CUBIC_BEZIER } }, { name: "paper-menu-shrink-height-animation", timing: { duration: 200, easing: "ease-in" } }] } }, allowOutsideScroll: { type: Boolean, value: !1 }, restoreFocusOnClose: { type: Boolean, value: !0 }, _dropdownContent: { type: Object } }, hostAttributes: { role: "group", "aria-haspopup": "true" }, listeners: { "iron-activate": "_onIronActivate", "iron-select": "_onIronSelect" }, get contentElement() { return Polymer.dom(this.$.content).getDistributedNodes()[0] }, toggle: function() { this.opened ? this.close() : this.open() }, open: function() { this.disabled || this.$.dropdown.open() }, close: function() { this.$.dropdown.close() }, _onIronSelect: function(e) { this.ignoreSelect || this.close() }, _onIronActivate: function(e) { this.closeOnActivate && this.close() }, _openedChanged: function(e, n) { e ? (this._dropdownContent = this.contentElement, this.fire("paper-dropdown-open")) : null != n && this.fire("paper-dropdown-close") }, _disabledChanged: function(e) { Polymer.IronControlState._disabledChanged.apply(this, arguments), e && this.opened && this.close() }, __onIronOverlayCanceled: function(e) { var n = e.detail, t = (Polymer.dom(n).rootTarget, this.$.trigger), o = Polymer.dom(n).path; o.indexOf(t) > -1 && e.preventDefault() } }); Object.keys(e).forEach(function(t) { n[t] = e[t] }), Polymer.PaperMenuButton = n }();
/* ============================================================ * File: app.js * Configure global module dependencies. * will be loaded on demand using ocLazyLoad * ============================================================ */ 'use strict'; angular.module('app', [ 'ui.router', 'ui.utils', 'oc.lazyLoad', 'infinite-scroll', 'angularMoment', 'wu.masonry', 'ngSanitize', 'LocalStorageModule', // 'angularGrid' ]).config(['$compileProvider', function ($compileProvider) { // $compileProvider.debugInfoEnabled(false); }]); /* ============================================================ * File: config.js * Configure routing * ============================================================ */ angular.module('app') .constant('constants', { SEARCH_MIN_LEN: 3, VIDEO_VIEW_PER: 0.2 }) .config(['$stateProvider', '$urlRouterProvider', '$ocLazyLoadProvider', '$locationProvider', function ($stateProvider, $urlRouterProvider, $ocLazyLoadProvider, $locationProvider) { $urlRouterProvider.otherwise('/'); $stateProvider .state('feed', { url: "/", templateUrl: 'feeds', controller: 'ShowFeedCtrl', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Feeds | SWOLK"; $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { $("html, body").removeClass("sidebar-open bodyHidden"); $("#sidebarOuter").removeClass("show"); return $ocLazyLoad.load([ 'nvd3', 'mapplic', 'rickshaw', 'metrojs', 'sparkline', 'skycons', 'switchery' ], { insertBefore: '#lazyload_placeholder' }) .then(function () { return $ocLazyLoad.load([ 'assets/js/controllers/feed/show.js?rev='+_uuid4 ]); }); }] } }) .state('profile', { url: "/profile?src", templateUrl: "tpl.profile", controller: 'ProfileCtrl', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Profile | SWOLK"; $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { $("html, body").removeClass("sidebar-open bodyHidden scrollHidden modal-open"); $("#sidebarOuter").removeClass("show"); return $ocLazyLoad.load([ 'mapplic' ], { insertBefore: '#lazyload_placeholder' }) .then(function () { return $ocLazyLoad.load([ 'assets/js/controllers/profile.js?rev='+_uuid4 ]); }); }] } }) .state('account', { url: "/profile/:username", templateUrl: "tpl.profile", controller: 'ProfileCtrl', resolve: { meta: ['$rootScope', '$stateParams', function ($rootScope, $stateParams) { var title = "Profile | SWOLK"; $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { $("html, body").removeClass("scrollHidden modal-open"); return $ocLazyLoad.load([ 'mapplic', 'switchery', 'select' ], { insertBefore: '#lazyload_placeholder' }) .then(function () { return $ocLazyLoad.load([ 'assets/js/controllers/profile.js?rev='+_uuid4 ]); }); }] } }) /*------- Post Add start -------*/ .state('post-add', { url: '/post-add', templateUrl: 'post-ad', controller: 'AddPostCtrl', redirectTo: 'post-add.photo', resolve: { deps: ['$ocLazyLoad', function ($ocLazyLoad) { $("html, body").removeClass("sidebar-open bodyHidden"); $("#sidebarOuter").removeClass("show"); return $ocLazyLoad.load([ 'switchery', 'select', 'inputMask', 'js-tag' ], { insertBefore: '#lazyload_placeholder' }) .then(function () { return $ocLazyLoad.load([ 'assets/js/controllers/post/add-post.js?rev='+_uuid4, 'assets/js/modules/uploader.js?rev='+_uuid4 ]); }); }] } }) // All post types.. .state('post-add.photo', { templateUrl: 'post-ad/container/photo', controller: 'AddImagePostCtrl', redirectTo: 'post-add.photo.start', resolve: { stateData: ['$rootScope', function ($rootScope) { $rootScope.stateData = { postType: 'photo' }; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { return $ocLazyLoad.load([ 'assets/js/controllers/post/add-image.js?rev='+_uuid4 ]); }] } }) .state('post-add.video', { templateUrl: 'post-ad/container/video', controller: 'AddVideoPostCtrl', redirectTo: 'post-add.video.start', resolve: { stateData: ['$rootScope', function ($rootScope) { $rootScope.stateData = { postType: 'video' }; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { return $ocLazyLoad.load([ 'assets/js/controllers/post/add-video.js?rev='+_uuid4 ]); }] } }) .state('post-add.article', { templateUrl: 'post-ad/container/article', controller: 'AddArticlePostCtrl', redirectTo: 'post-add.article.start', resolve: { stateData: ['$rootScope', function ($rootScope) { $rootScope.stateData = { postType: 'article' }; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { return $ocLazyLoad.load([ 'assets/js/controllers/post/add-article.js?rev='+_uuid4 ]); }] } }) .state('post-add.link', { templateUrl: 'post-ad/container/link', controller: 'AddLinkPostCtrl', redirectTo: 'post-add.link.start', resolve: { stateData: ['$rootScope', function ($rootScope) { $rootScope.stateData = { postType: 'link' }; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { return $ocLazyLoad.load([ 'assets/js/controllers/post/add-link.js?rev='+_uuid4 ]); }] } }) .state('post-add.status', { templateUrl: 'post-ad/container/status', controller: 'AddStatusPostCtrl', redirectTo: 'post-add.status.start', resolve: { stateData: ['$rootScope', function ($rootScope) { $rootScope.stateData = { postType: 'status' }; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { setTimeout(function () { $('.uploadFileNew .needsclick, .uploadFile input, .form-group input, label input').on( "touchstart", function(){ $(this).trigger('mouseenter'); }); $('.form-group, label').on( "touchstart", function(){ $(this).find("input").trigger('mouseenter'); }); }, 200); return $ocLazyLoad.load([ 'assets/js/controllers/post/add-status.js?rev='+_uuid4 ]); }] } }) /*****************************write code for question sction(26-12-17)*******************************************/ .state('post-add.question', { templateUrl: 'post-ad/container/question', controller: 'AddQuestionPostCtrl', redirectTo: 'post-add.question.start', resolve: { stateData: ['$rootScope', function ($rootScope) { $rootScope.stateData = { postType: 'question' }; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { setTimeout(function () { $('.uploadFileNew .needsclick, .uploadFile input, .form-group input, label input').on( "touchstart", function(){ $(this).trigger('mouseenter'); }); $('.form-group, label').on( "touchstart", function(){ $(this).find("input").trigger('mouseenter'); }); }, 200); return $ocLazyLoad.load([ 'assets/js/controllers/post/add-question.js?rev='+_uuid4 ]); }] } }) .state('post-add.question.start', { url: '/question', templateUrl: 'post-ad/question', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Post new question | SWOLK"; $rootScope.meta = {title: title}; }] } }) /********************************write code for question sction(26-12-17)*******************************************/ // For photo post.. .state('post-add.photo.start', { url: '/general', templateUrl: 'post-ad/general/photo', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Post new photo - General | SWOLK"; $rootScope.meta = {title: title}; }] } }) .state('post-add.photo.general', { url: '/general', templateUrl: 'post-ad/general/photo', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Post new photo - General | SWOLK"; $rootScope.meta = {title: title}; }] } }) .state('post-add.photo.advance', { url: '/advance', templateUrl: 'post-ad/advance', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Post new photo - Advance | SWOLK"; $rootScope.meta = {title: title}; }] } }) .state('post-add.photo.social', { url: '/social', templateUrl: 'post-ad/social', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Post new photo - Social | SWOLK"; $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { return $ocLazyLoad.load([ // 'js-tag', // 'typehead' ], { insertBefore: '#lazyload_placeholder' }); }] } }) // For video post.. .state('post-add.video.start', { url: '/general', templateUrl: 'post-ad/general/video', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Post new video - General | SWOLK"; $rootScope.meta = {title: title}; }] } }) .state('post-add.video.general', { url: '/general', templateUrl: 'post-ad/general/video', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Post new video - General | SWOLK"; $rootScope.meta = {title: title}; }] } }) .state('post-add.video.advance', { url: '/advance', templateUrl: 'post-ad/advance', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Post new video - Advance | SWOLK"; $rootScope.meta = {title: title}; }] } }) .state('post-add.video.social', { url: '/social', templateUrl: 'post-ad/social', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Post new video - Social | SWOLK"; $rootScope.meta = {title: title}; }] } }) // For Article post.. .state('post-add.article.start', { url: '/general', templateUrl: 'post-ad/general/article', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Post new article - General | SWOLK"; $rootScope.meta = {title: title}; }] } }) .state('post-add.article.general', { url: '/general', templateUrl: 'post-ad/general/article', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Post new article - General | SWOLK"; $rootScope.meta = {title: title}; }] } }) .state('post-add.article.content', { url: '/content', templateUrl: 'post-ad/content', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Post new article - Content | SWOLK"; $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { return $ocLazyLoad.load([ 'angular-froala' ], { insertBefore: '#lazyload_placeholder' }); }] } }) .state('post-add.article.advance', { url: '/advance', templateUrl: 'post-ad/advance', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Post new article - Advance | SWOLK"; $rootScope.meta = {title: title}; }] } }) .state('post-add.article.social', { url: '/social', templateUrl: 'post-ad/social', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Post new article - Social | SWOLK"; $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { return $ocLazyLoad.load([ // 'js-tag', // 'typehead' ], { insertBefore: '#lazyload_placeholder' }); }] } }) // For Link post.. .state('post-add.link.start', { url: '/general', templateUrl: 'post-ad/general/link', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Post new link - General | SWOLK"; $rootScope.meta = {title: title}; }] } }) .state('post-add.link.general', { url: '/general', templateUrl: 'post-ad/general/link', controller: 'AddLinkPostCtrl', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Post new link - General | SWOLK"; $rootScope.meta = {title: title}; }] } }) .state('post-add.link.advance', { url: '/advance', templateUrl: 'post-ad/advance', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Post new link - Advance | SWOLK"; $rootScope.meta = {title: title}; }] } }) .state('post-add.link.social', { url: '/social', templateUrl: 'post-ad/social', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Post new link - Social | SWOLK"; $rootScope.meta = {title: title}; }] } }) .state('post-add.status.start', { url: '/status', templateUrl: 'post-ad/status', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Post new status | SWOLK"; $rootScope.meta = {title: title}; }] } }) /*------- Post Add end -------*/ /*------- Post Edit start -------*/ .state('post-edit', { url: '/post-edit?id', templateUrl: 'post-ad', controller: 'AddPostCtrl', //redirectTo: 'post-edit.photo', resolve: { deps: ['$ocLazyLoad', function ($ocLazyLoad) { $("html, body").removeClass("sidebar-open bodyHidden"); $("#sidebarOuter").removeClass("show"); return $ocLazyLoad.load([ 'switchery', 'select', 'inputMask', 'js-tag' ], { insertBefore: '#lazyload_placeholder' }) .then(function () { return $ocLazyLoad.load([ 'assets/js/controllers/post/add-post.js?rev='+_uuid4, 'assets/js/modules/uploader.js?rev='+_uuid4 ]); }); }] } }) // All post types.. .state('post-edit.photo', { templateUrl: 'post-ad/container/photo', controller: 'EditImageCtrl', redirectTo: 'post-edit.photo.general', resolve: { stateData: ['$rootScope', function ($rootScope) { $rootScope.stateData = { postType: 'photo', editPost: true }; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { return $ocLazyLoad.load([ 'assets/js/controllers/post/edit/image.js?rev='+_uuid4 ]); }] } }) .state('post-edit.video', { templateUrl: 'post-ad/container/video', controller: 'EditVideoCtrl', redirectTo: 'post-edit.video.general', resolve: { stateData: ['$rootScope', function ($rootScope) { $rootScope.stateData = { postType: 'video', editPost: true }; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { return $ocLazyLoad.load([ 'assets/js/controllers/post/edit/video.js?rev='+_uuid4 ]); }] } }) .state('post-edit.link', { templateUrl: 'post-ad/container/link', controller: 'EditLinkCtrl', redirectTo: 'post-edit.link.general', resolve: { stateData: ['$rootScope', function ($rootScope) { $rootScope.stateData = { postType: 'link', editPost: true }; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { return $ocLazyLoad.load([ 'assets/js/controllers/post/edit/link.js?rev='+_uuid4 ]); }] } }) .state('post-edit.article', { templateUrl: 'post-ad/container/article', controller: 'EditArticleCtrl', redirectTo: 'post-edit.article.general', resolve: { stateData: ['$rootScope', function ($rootScope) { $rootScope.stateData = { postType: 'article', editPost: true }; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { return $ocLazyLoad.load([ 'assets/js/controllers/post/edit/article.js?rev='+_uuid4 ]); }] } }) .state('post-edit.status', { templateUrl: 'post-ad/container/status', controller: 'EditStatusCtrl', redirectTo: 'post-edit.status.start', resolve: { stateData: ['$rootScope', function ($rootScope) { $rootScope.stateData = { postType: 'status', editPost: true }; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { setTimeout(function () { $('.uploadFileNew .needsclick, .uploadFile input, .form-group input, label input').on( "touchstart", function(){ $(this).trigger('mouseenter'); }); $('.form-group, label').on( "touchstart", function(){ $(this).find("input").trigger('mouseenter'); }); }, 200); return $ocLazyLoad.load([ 'assets/js/controllers/post/edit/status.js?rev='+_uuid4 ]); }] } }) /**************************************Add for edit question(04-01-17) start*****************************************/ .state('post-edit.question', { templateUrl: 'post-ad/container/question', controller: 'EditQuestionCtrl', redirectTo: 'post-edit.question.start', resolve: { stateData: ['$rootScope', function ($rootScope) { $rootScope.stateData = { postType: 'question', editPost: true }; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { setTimeout(function () { $('.uploadFileNew .needsclick, .uploadFile input, .form-group input, label input').on( "touchstart", function(){ $(this).trigger('mouseenter'); }); $('.form-group, label').on( "touchstart", function(){ $(this).find("input").trigger('mouseenter'); }); }, 200); return $ocLazyLoad.load([ 'assets/js/controllers/post/edit/question.js?rev='+_uuid4 ]); }] } }) .state('post-edit.question.start', { url: '/question', templateUrl: 'post-ad/question', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Edit question | SWOLK"; $rootScope.meta = {title: title}; }] } }) /**************************************Add for edit question(04-01-17) end*****************************************/ // For photo post.. .state('post-edit.photo.general', { url: '/general', templateUrl: 'post-ad/general/edit-photo', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Edit post - General | SWOLK"; $rootScope.meta = {title: title}; }] } }) .state('post-edit.photo.advance', { url: '/advance', templateUrl: 'post-ad/advance', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Edit post - Advance | SWOLK"; $rootScope.meta = {title: title}; }] } }) .state('post-edit.photo.social', { url: '/social', templateUrl: 'post-ad/social', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Edit post - Social | SWOLK"; $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { return $ocLazyLoad.load([ // 'js-tag', // 'typehead' ], { insertBefore: '#lazyload_placeholder' }); }] } }) // For video post.. .state('post-edit.video.general', { url: '/general', templateUrl: 'post-ad/general/edit-video', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Edit video - General | SWOLK"; $rootScope.meta = {title: title}; }] } }) .state('post-edit.video.advance', { url: '/advance', templateUrl: 'post-ad/advance', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Edit video - Advance | SWOLK"; $rootScope.meta = {title: title}; }] } }) .state('post-edit.video.social', { url: '/social', templateUrl: 'post-ad/social', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Edit video - Social | SWOLK"; $rootScope.meta = {title: title}; }] } }) // For Article post.. .state('post-edit.article.general', { url: '/general', templateUrl: 'post-ad/general/edit-article', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Edit article - General | SWOLK"; $rootScope.meta = {title: title}; }] } }) .state('post-edit.article.content', { url: '/content', templateUrl: 'post-ad/content', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Edit article - Content | SWOLK"; $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { return $ocLazyLoad.load([ 'angular-froala' ], { insertBefore: '#lazyload_placeholder' }); }] } }) .state('post-edit.article.advance', { url: '/advance', templateUrl: 'post-ad/advance', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Edit article - Advance | SWOLK"; $rootScope.meta = {title: title}; }] } }) .state('post-edit.article.social', { url: '/social', templateUrl: 'post-ad/social', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Edit article - Social | SWOLK"; $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { return $ocLazyLoad.load([ // 'js-tag', // 'typehead' ], { insertBefore: '#lazyload_placeholder' }); }] } }) // For Link post.. .state('post-edit.link.general', { url: '/general', templateUrl: 'post-ad/general/edit-link', controller: 'EditLinkCtrl', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Edit link - General | SWOLK"; $rootScope.meta = {title: title}; }] } }) .state('post-edit.link.advance', { url: '/advance', templateUrl: 'post-ad/advance', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Edit link - Advance | SWOLK"; $rootScope.meta = {title: title}; }] } }) .state('post-edit.link.social', { url: '/social', templateUrl: 'post-ad/social', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Edit link - Social | SWOLK"; $rootScope.meta = {title: title}; }] } }) .state('post-edit.status.start', { url: '/status', templateUrl: 'post-ad/status', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Edit status | SWOLK"; $rootScope.meta = {title: title}; }] } }) /*------- Post Edit end -------*/ // Post details page.. .state('post-details', { // category is caption when post type is status.. url: "/post/:category/:subcategory/:title/{id:int}", templateUrl: "post-details", controller: 'PostDetailsCtrl', params: { category: { squash: true, value: null }, subcategory: { squash: true, value: null }, title: { squash: true, value: null }, }, resolve: { meta: ['$rootScope', '$stateParams', function ($rootScope, $stateParams) { if ($stateParams.title) { var title = $stateParams.title + " | SWOLK"; } else { // category is placeholder for caption var title = $stateParams.category + " | SWOLK"; } $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { return $ocLazyLoad.load([ 'mapplic', ], { insertBefore: '#lazyload_placeholder' }) .then(function () { return $ocLazyLoad.load([ 'assets/js/controllers/post/details.js?rev='+_uuid4 ]); }); }] } }) // Category-tags page. .state('category-tags', { url: "/tag/:name", templateUrl: "category-tags", controller: 'CategoryTagsListingCtrl', params: { subcategory: { squash: true, value: null }, }, resolve: { meta: ['$rootScope', '$stateParams', function ($rootScope, $stateParams) { var title = $stateParams.name + " | SWOLK"; $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { $("html, body").removeClass("scrollHidden modal-open mob-hideModal").css({"paddingRight":""}); $(".header").removeClass("nav-up"); return $ocLazyLoad.load([ 'switchery', 'select' ], { insertBefore: '#lazyload_placeholder' }) .then(function () { return $ocLazyLoad.load([ 'assets/js/controllers/post/category-tags.js?rev='+_uuid4 ]); }); }] } }) /******************************* for question tag (31-1-18) done by ps */ .state('question-tags', { url: "/questions/:name", templateUrl: "category-tags", controller: 'CategoryTagsListingCtrl', params: { subcategory: { squash: true, value: null }, }, resolve: { meta: ['$rootScope', '$stateParams', function ($rootScope, $stateParams) { var title = $stateParams.name + " | SWOLK"; $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { $("html, body").removeClass("scrollHidden modal-open mob-hideModal").css({"paddingRight":""}); $(".header").removeClass("nav-up"); return $ocLazyLoad.load([ 'switchery', 'select' ], { insertBefore: '#lazyload_placeholder' }) .then(function () { return $ocLazyLoad.load([ 'assets/js/controllers/post/category-tags.js?rev='+_uuid4 ]); }); }] } }) /******************************* for question tag (31-1-18) done by ps */ // Category-tags page. .state('place', { url: "/place?location&city&state&country&region&continent", templateUrl: "tpl/placeIndex", controller: 'PlaceCtrl', onEnter: ["$location", "$state", function($location, $state){ if (angular.equals($location.search(), {})) { $state.go('profile'); } }], /*params: { subcategory: { squash: true, value: null } },*/ resolve: { meta: ['$rootScope', '$stateParams', function ($rootScope, $stateParams) { var title = "SWOLK"; $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { $("html, body").removeClass("scrollHidden modal-open mob-hideModal").css({"paddingRight":""}); $(".header").removeClass("nav-up"); return $ocLazyLoad.load([ 'switchery', 'select' ], { insertBefore: '#lazyload_placeholder' }) .then(function () { return $ocLazyLoad.load([ 'assets/js/controllers/place/show.js?rev='+_uuid4 ]); }); }] } }) .state('edit-profile', { url: '/edit-profile', templateUrl: 'tpl.edit-my-profile', controller: 'EditProfileCtrl', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "SWOLK"; $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { $("html, body").removeClass("sidebar-open bodyHidden"); $("#sidebarOuter").removeClass("show"); setTimeout(function () { $('.uploadProfilePicBtn input').on( "touchstart", function(){ alert("1"); $(this).trigger('mouseenter'); }); $('.uploadProfilePicBtn').on( "touchstart", function(){ $(this).find("input").trigger('mouseenter'); }); }, 200); return $ocLazyLoad.load([ 'switchery', 'select', 'moment', 'datepicker', 'daterangepicker', 'timepicker', 'inputMask', 'autonumeric', 'wysihtml5', 'summernote', 'tagsInput', 'dropzone', 'typehead' ], { insertBefore: '#lazyload_placeholder' }) .then(function () { return $ocLazyLoad.load('assets/js/controllers/edit_profile.js?rev='+_uuid4); }); }] } }) .state('feedmodal', { url: "/feedmodal", templateUrl: "tpl/feed-modal.html", controller: 'ProfileCtrl', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "SWOLK"; $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { return $ocLazyLoad.load([ 'mapplic', ], { insertBefore: '#lazyload_placeholder' }) .then(function () { return $ocLazyLoad.load([ 'assets/js/controllers/profile.js?rev='+_uuid4 ]); }); }] } }) .state('explore', { url: "/explore", templateUrl: "tpl.explore", controller: 'ExploreCtrl', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Explore | SWOLK"; $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { $("html, body").removeClass("sidebar-open bodyHidden"); $("#sidebarOuter").removeClass("show"); return $ocLazyLoad.load([ 'mapplic', ], { insertBefore: '#lazyload_placeholder' }) .then(function () { return $ocLazyLoad.load([ 'assets/js/controllers/explore.js?rev='+_uuid4 ]); }); }] } }) /*.state('test', { url: "/explore-test", templateUrl: "tpl.test", controller: 'TestCtrl', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Test | SWOLK"; $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { $("html, body").removeClass("sidebar-open bodyHidden"); $("#sidebarOuter").removeClass("show"); return $ocLazyLoad.load([ 'mapplic', ], { insertBefore: '#lazyload_placeholder' }) .then(function () { return $ocLazyLoad.load([ 'assets/js/controllers/test.js' ]); }); }] } })*/ .state('allNotification', { url: "/all-notification", templateUrl: "tpl.allNotification", controller: 'AllNotificationCtrl', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "All Notification | SWOLK"; $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { $("html, body").removeClass("sidebar-open bodyHidden"); $("#sidebarOuter").removeClass("show"); return $ocLazyLoad.load([ 'mapplic', ], { insertBefore: '#lazyload_placeholder' }) .then(function () { return $ocLazyLoad.load([ 'assets/js/controllers/allNotification.js?rev='+_uuid4 ]); }); }] } }) .state('my-analytics', { url: "/my-analytics", templateUrl: "tpl.my-analytics", controller: 'analyticsCtrl', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Analytics | SWOLK"; $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { $("html, body").removeClass("sidebar-open bodyHidden"); $("#sidebarOuter").removeClass("show"); return $ocLazyLoad.load([ 'nvd3', 'mapplic', 'rickshaw', 'metrojs', 'sparkline', 'skycons', 'switchery' ], { insertBefore: '#lazyload_placeholder' }) .then(function () { return $ocLazyLoad.load([ 'assets/js/controllers/analytics.js?rev='+_uuid4 ]); }); }] } }) .state('search', { url: '/search?q&ref', templateUrl: "tpl.search", controller: 'SearchCtrl', reloadOnSearch: false, resolve: { meta: ['$rootScope', '$stateParams', function ($rootScope, $stateParams) { if ($stateParams.q) { var title = encodeURIComponent($stateParams.q).replace(/%20/g, '+'); title += " | SWOLK SEARCH"; } else { // category is placeholder for caption var title = "Enter atleast 4 characters | SWOLK SEARCH"; } $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { $("html, body").removeClass("sidebar-open bodyHidden wh"); $("#sidebarOuter").removeClass("show"); /*return $ocLazyLoad.load([ 'mapplic', ], { insertBefore: '#lazyload_placeholder' }) .then(function () { return $ocLazyLoad.load([ 'assets/js/controllers/search.js?rev='+_uuid4 ]); });*/ }] } }) .state('following-topics', { url: "/following-topics", templateUrl: "tpl.following-topics", controller: 'CategoryCtrl', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Following Topics | SWOLK"; $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { $("html, body").removeClass("sidebar-open bodyHidden"); $("#sidebarOuter").removeClass("show"); return $ocLazyLoad.load([ 'mapplic', ], { insertBefore: '#lazyload_placeholder' }) .then(function () { return $ocLazyLoad.load([ 'assets/js/controllers/category.js?rev='+_uuid4 ]); }); }] } }) // Saved post.. .state('saved-post', { url: "/saved-post", templateUrl: "tpl.saved-post", controller: 'SavePostCtrl', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Save Post | SWOLK"; $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { $("html, body").removeClass("sidebar-open bodyHidden"); $("#sidebarOuter").removeClass("show"); return $ocLazyLoad.load([ 'mapplic' ], { insertBefore: '#lazyload_placeholder' }) .then(function () { return $ocLazyLoad.load([ 'assets/js/controllers/savepost.js?rev='+_uuid4 ]); }); }] } }) // nearby.. .state('nearby', { url: "/nearby", templateUrl: "tpl.nearby", controller: 'NearByCtrl', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Nearby | SWOLK"; $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { $("html, body").removeClass("sidebar-open bodyHidden"); $("#sidebarOuter").removeClass("show"); // window.location.href = '/nearby' return $ocLazyLoad.load([ 'mapplic' ], { insertBefore: '#lazyload_placeholder' }) .then(function () { return $ocLazyLoad.load([ 'assets/js/controllers/nearby.js?rev='+_uuid4 ]); }); }] } }) // invite friend.. .state('invite-friend', { url: "/invite-friend", templateUrl: "tpl.invite_friend", controller: 'InviteFriendCtrl', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Invite Friend | SWOLK"; $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { $("html, body").removeClass("sidebar-open bodyHidden"); $("#sidebarOuter").removeClass("show"); return $ocLazyLoad.load([ 'mapplic' ], { insertBefore: '#lazyload_placeholder' }) .then(function () { return $ocLazyLoad.load([ 'assets/js/controllers/invite_friend.js?rev='+_uuid4 ]); }); }] } }) // copy invite friend .. .state('send-feedback', { url: "/send-feedback", templateUrl: "tpl.send_feedback", controller: 'FeedbackCtrl', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Feedback | SWOLK"; $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { $("html, body").removeClass("sidebar-open bodyHidden"); $("#sidebarOuter").removeClass("show"); return $ocLazyLoad.load([ 'mapplic' ], { insertBefore: '#lazyload_placeholder' }) .then(function () { return $ocLazyLoad.load([ 'assets/js/controllers/feedback.js' ]); }); }] } }) // Error 404 .state('error-404', { url: "/error-404", templateUrl: "tpl.error_404", resolve: { meta: ['$rootScope', function ($rootScope) { var title = "404 | SWOLK"; $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { $("html, body").removeClass("sidebar-open bodyHidden"); $("#sidebarOuter").removeClass("show"); return $ocLazyLoad.load([ 'mapplic' ], { insertBefore: '#lazyload_placeholder' }); }] } }) // privacy policy.. .state('privacy-policy', { url: "/privacy-policy", templateUrl: "tpl.privacy_policy", //controller: 'NearByCtrl', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Privacy Policy | SWOLK"; $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { $("html, body").removeClass("sidebar-open bodyHidden"); $("#sidebarOuter").removeClass("show"); return $ocLazyLoad.load([ 'mapplic' ], { insertBefore: '#lazyload_placeholder' }) .then(function () { /*return $ocLazyLoad.load([ ]);*/ }); }] } }) // terms and conditions.. .state('terms-and-conditions', { url: "/terms-and-conditions", templateUrl: "tpl.terms-and-conditions", // controller: 'NearByCtrl', resolve: { meta: ['$rootScope', function ($rootScope) { var title = "Terms And Conditions | SWOLK"; $rootScope.meta = {title: title}; }], deps: ['$ocLazyLoad', function ($ocLazyLoad) { $("html, body").removeClass("sidebar-open bodyHidden"); $("#sidebarOuter").removeClass("show"); return $ocLazyLoad.load([ 'mapplic' ], { insertBefore: '#lazyload_placeholder' }) .then(function () { /*return $ocLazyLoad.load([ ]);*/ }); }] } }); $locationProvider.html5Mode(true); } ]); /* | --------------------------------------------------------------------- | <Tuhin Subhra Mandal> Load child stat | --------------------------------------------------------------------- */ angular.module('app').run(['$rootScope', '$state', '$stateParams', '$window', '$location', 'socket', 'localStorageService', function ($rootScope, $state, $stateParams, $window, $location, socket, localStorageService) { $rootScope.$state = $state; $rootScope.$stateParams = $stateParams; $rootScope.$on('$stateChangeStart', function(evt, to, params, fromState, fromParams, options) { /*Pace.stop(); Pace.bar.render();*/ // Remove paceDisable class from <body> $("body").removeClass('paceDisable'); // Handle session start event. if (fromState.name === '') { localStorageService.remove('opened_posts'); } if (to.redirectTo) { evt.preventDefault(); $state.go(to.redirectTo, params, {location: 'replace'}); } if (tsmPlayerPool != undefined) { tsmPlayerPool = []; } }); $rootScope.$on('$stateChangeSuccess', function(evt, toState, toParams, fromState) { // Call modal close event if post details modal is open. var $detailModal = $('#myModal'); if ($detailModal.is(':visible')) { $detailModal.modal('toggle'); } // Hide search modal. $('#searchCloseBtn').trigger('click'); // Broadcast post closed event. var post_id = sessionStorage.o_pid; if (post_id && toState.name != 'post-details') { var user_id = sessionStorage.o_uid ? sessionStorage.o_uid : null; var opened_post = { post_id: post_id, uuid: browserTabID, user_id: user_id, type: 'leave' } socket.emit('post closed', opened_post); sessionStorage.removeItem('o_pid'); sessionStorage.removeItem('o_uid'); // console.log('post closed'); } $("body").animate({scrollTop: 0},600); // Add paceDisable class to <body> and disable for the page for future. setTimeout(function() { $("body").addClass('paceDisable'); }, 20000); }); $rootScope.$on('$stateChangeError', function(event, toState, toParams, fromState, fromParams, error) { if (error.status == 401) { // Logout. document.cookie = "showHeroImage=; expires=Thu, 01 Jan 1970 00:00:00 UTC"; $window.location.href = 'logout'; } event.preventDefault(); }); $rootScope.sillyQA = function() { if($state.current.name === 'feed') { $state.go('feed', {}, { reload: true }); } } }]); /* ============================================================ * File: config.lazyload.js * Configure modules for ocLazyLoader. These are grouped by * vendor libraries. * ============================================================ */ angular.module('app') .config(['$ocLazyLoadProvider', function($ocLazyLoadProvider) { $ocLazyLoadProvider.config({ debug: false, events: true, modules: [{ name: 'isotope', files: [ 'assets/plugins/imagesloaded/imagesloaded.pkgd.min.js', 'assets/plugins/jquery-isotope/isotope.pkgd.min.js' ] }, { name: 'codropsDialogFx', files: [ 'assets/plugins/codrops-dialogFx/dialogFx.js', 'assets/plugins/codrops-dialogFx/dialog.css', 'assets/plugins/codrops-dialogFx/dialog-sandra.css' ] }, { name: 'metrojs', files: [ 'assets/plugins/jquery-metrojs/MetroJs.min.js', 'assets/plugins/jquery-metrojs/MetroJs.css' ] }, { name: 'owlCarousel', files: [ 'assets/plugins/owl-carousel/owl.carousel.min.js', 'assets/plugins/owl-carousel/assets/owl.carousel.css' ] }, { name: 'noUiSlider', files: [ 'assets/plugins/jquery-nouislider/jquery.nouislider.min.js', 'assets/plugins/jquery-nouislider/jquery.liblink.js', 'assets/plugins/jquery-nouislider/jquery.nouislider.css' ] }, { name: 'nvd3', files: [ 'assets/plugins/nvd3/lib/d3.v3.js', 'assets/plugins/nvd3/nv.d3.min.js', 'assets/plugins/nvd3/src/utils.js', 'assets/plugins/nvd3/src/tooltip.js', 'assets/plugins/nvd3/src/interactiveLayer.js', 'assets/plugins/nvd3/src/models/axis.js', 'assets/plugins/nvd3/src/models/line.js', 'assets/plugins/nvd3/src/models/lineWithFocusChart.js', 'assets/plugins/angular-nvd3/angular-nvd3.js', 'assets/plugins/nvd3/nv.d3.min.css' ], serie: true // load in the exact order }, { name: 'rickshaw', files: [ 'assets/plugins/nvd3/lib/d3.v3.js', 'assets/plugins/rickshaw/rickshaw.min.js', 'assets/plugins/angular-rickshaw/rickshaw.js', 'assets/plugins/rickshaw/rickshaw.min.css', ], serie: true }, { name: 'sparkline', files: [ 'assets/plugins/jquery-sparkline/jquery.sparkline.min.js', 'assets/plugins/angular-sparkline/angular-sparkline.js' ] }, { name: 'mapplic', files: [ 'assets/plugins/mapplic/js/hammer.js', 'assets/plugins/mapplic/js/jquery.mousewheel.js', 'assets/plugins/mapplic/js/mapplic.js', 'assets/plugins/mapplic/css/mapplic.css' ] }, { name: 'skycons', files: ['assets/plugins/skycons/skycons.js'] }, { name: 'switchery', files: [ 'assets/plugins/switchery/js/switchery.min.js', 'assets/plugins/ng-switchery/ng-switchery.js', 'assets/plugins/switchery/css/switchery.min.css', ] }, { name: 'menuclipper', files: [ 'assets/plugins/jquery-menuclipper/jquery.menuclipper.css', 'assets/plugins/jquery-menuclipper/jquery.menuclipper.js' ] }, { name: 'wysihtml5', files: [ 'assets/plugins/bootstrap3-wysihtml5/bootstrap3-wysihtml5.min.css', 'assets/plugins/bootstrap3-wysihtml5/bootstrap3-wysihtml5.all.min.js' ] }, { name: 'stepsForm', files: [ 'assets/plugins/codrops-stepsform/css/component.css', 'assets/plugins/codrops-stepsform/js/stepsForm.js' ] }, { name: 'jquery-ui', files: ['assets/plugins/jquery-ui-touch/jquery.ui.touch-punch.min.js'] }, { name: 'moment', files: ['assets/plugins/moment/moment.min.js', 'assets/plugins/moment/moment-with-locales.min.js' ] }, { name: 'moment-locales', files: ['assets/plugins/moment/moment-with-locales.min.js' ] }, { name: 'hammer', files: ['assets/plugins/hammer.min.js'] }, { name: 'sieve', files: ['assets/plugins/jquery.sieve.min.js'] }, { name: 'line-icons', files: ['assets/plugins/simple-line-icons/simple-line-icons.css'] }, { name: 'ionRangeSlider', files: [ 'assets/plugins/ion-slider/css/ion.rangeSlider.css', 'assets/plugins/ion-slider/css/ion.rangeSlider.skinFlat.css', 'assets/plugins/ion-slider/js/ion.rangeSlider.min.js' ] }, { name: 'navTree', files: [ 'assets/plugins/angular-bootstrap-nav-tree/abn_tree_directive.js', 'assets/plugins/angular-bootstrap-nav-tree/abn_tree.css' ] }, { name: 'nestable', files: [ 'assets/plugins/jquery-nestable/jquery.nestable.css', 'assets/plugins/jquery-nestable/jquery.nestable.js', 'assets/plugins/angular-nestable/angular-nestable.js' ] }, { //https://github.com/angular-ui/ui-select name: 'select', files: [ 'assets/plugins/bootstrap-select2/select2.css', 'assets/plugins/angular-ui-select/select.min.css', 'assets/plugins/angular-ui-select/select.min.js' ] }, { name: 'datepicker', files: [ 'assets/plugins/bootstrap-datepicker/css/datepicker3.css', 'assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js', ] }, { name: 'daterangepicker', files: [ 'assets/plugins/moment/moment.min.js', 'assets/plugins/bootstrap-daterangepicker/daterangepicker-bs3.css', 'assets/plugins/bootstrap-daterangepicker/daterangepicker.js', 'assets/plugins/angular-daterangepicker/angular-daterangepicker.min.js' ], serie: true }, { name: 'timepicker', files: [ 'assets/plugins/bootstrap-timepicker/bootstrap-timepicker.min.css', 'assets/plugins/bootstrap-timepicker/bootstrap-timepicker.min.js' ] }, { name: 'inputMask', files: [ 'assets/plugins/jquery-inputmask/jquery.inputmask.min.js' ] }, { name: 'autonumeric', files: [ 'assets/plugins/jquery-autonumeric/autoNumeric.js' ] }, { name: 'summernote', files: [ 'assets/plugins/summernote/css/summernote.css', 'assets/plugins/summernote/js/summernote.min.js', 'assets/plugins/angular-summernote/angular-summernote.min.js' ], serie: true // load in the exact order }, { name: 'tagsInput', files: [ 'assets/plugins/bootstrap-tag/bootstrap-tagsinput.css', 'assets/plugins/bootstrap-tag/bootstrap-tagsinput.min.js' ] }, { name: 'dropzone', files: [ 'assets/plugins/dropzone/css/dropzone.css', 'assets/plugins/dropzone/dropzone.min.js', 'assets/plugins/angular-dropzone/angular-dropzone.js' ], serie: true }, { name: 'wizard', files: [ 'assets/plugins/lodash/lodash.min.js', 'assets/plugins/angular-wizard/angular-wizard.min.css', 'assets/plugins/angular-wizard/angular-wizard.min.js' ] }, { name: 'dataTables', files: [ 'assets/plugins/jquery-datatable/media/css/dataTables.bootstrap.min.css', 'assets/plugins/jquery-datatable/extensions/FixedColumns/css/dataTables.fixedColumns.min.css', 'assets/plugins/datatables-responsive/css/datatables.responsive.css', 'assets/plugins/jquery-datatable/media/js/jquery.dataTables.min.js', 'assets/plugins/jquery-datatable/extensions/TableTools/js/dataTables.tableTools.min.js', 'assets/plugins/jquery-datatable/media/js/dataTables.bootstrap.js', 'assets/plugins/jquery-datatable/extensions/Bootstrap/jquery-datatable-bootstrap.js', 'assets/plugins/datatables-responsive/js/datatables.responsive.js', 'assets/plugins/datatables-responsive/js/lodash.min.js' ], serie: true // load in the exact order }, { name: 'google-map', files: [ 'assets/plugins/angular-google-map-loader/google-map-loader.js', 'assets/plugins/angular-google-map-loader/google-maps.js' ] }, { name: 'interact', files: [ 'assets/plugins/interactjs/interact.min.js' ] }, { name: 'tabcollapse', files: [ 'assets/plugins/bootstrap-collapse/bootstrap-tabcollapse.js' ] }, { name: 'ui-grid', files: [ 'assets/plugins/angular-ui-grid/ui-grid.min.css', 'assets/plugins/angular-ui-grid/ui-grid.min.js'] },{ name: 'typehead', files: [ 'assets/plugins/angular-typehead/typeahead.bundle.min.js', 'assets/plugins/angular-typehead/angular-typeahead.min.js' ] },{ name: 'js-tag', files: [ 'assets/plugins/angular-js-tags/jsTag.js', 'assets/plugins/angular-js-tags/jsTag.css' ] },{ name: 'angular-froala', files: [ 'assets/plugins/froala/css/froala_editor.min.css', // 'assets/plugins/froala/css/froala_style.css', 'assets/plugins/froala/css/plugins/image.min.css', 'assets/plugins/froala/css/plugins/video.min.css', 'assets/plugins/froala/css/plugins/line_breaker.min.css', 'assets/plugins/froala/css/plugins/quick_insert.min.css', 'assets/plugins/froala/css/plugins/code_view.min.css', 'assets/plugins/froala/css/plugins/fullscreen.min.css', 'assets/plugins/froala/angular/src/angular-froala.js', ] } ] }); }]); /* ============================================================ * File: main.js * Main Controller to set global scope variables. * Directives, Services, Filters. * ============================================================ */ angular.module('app') .factory('ajaxService', ["$http", function ($http) { return { serverCall: function (url, data) { return $http.post(url, data).then(function (response) { return response.data; }); } }; }]) .controller('AppCtrl', ['$scope', '$http','$location', '$rootScope', '$state', '$stateParams', '$sce', '$filter', '$timeout', '$interval', '$location', '$window', '$anchorScroll', 'refreshService', 'userDataService', 'YT_event', 'socket', 'postOpened', 'localStorageService', 'haversineDistanceCalculationService', function ($scope, $http,$location, $rootScope, $state, $stateParams, $sce, $filter, $timeout, $interval, $location, $window, $anchorScroll, refreshService, userDataService, YT_event, socket, postOpened, localStorageService, haversineDistanceCalculationService) { $scope.checkUrl=function () { var urlArray = $location.path().split("/"); if(urlArray[1]!='post-add') { $scope.checkUrlParam=urlArray[1]; // alert($scope.checkUrlParam); } if(urlArray[1]=='tag' || urlArray[1]=='questions') { var tagName=urlArray[2] var url = '/api/tag-details/' + tagName; $http.get(url).then(function (response) { $scope.urlParamText=response.data.tag_text; }); } else if(urlArray[1]=='place') { function getParameterByName(name) { url=document.URL; name = name.replace(/[\[\]]/g, "\\$&"); var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), results = regex.exec(url); if (!results) return null; if (!results[2]) return ''; return decodeURIComponent(results[2].replace(/\+/g, " ")); } var address=''; if(getParameterByName('location')) { address=getParameterByName('location'); } else if(getParameterByName('city')) { address=getParameterByName('city'); } else if(getParameterByName('state')) { address=getParameterByName('state'); } else if(getParameterByName('country')) { address=getParameterByName('country'); } else if(getParameterByName('region')) { address=getParameterByName('region'); } else if(getParameterByName('continent')) { address=getParameterByName('continent'); } $scope.urlParamText=address; } } // App globals $scope.app = { name: 'Swolk', description: 'Social networking website', layout: { menuPin: false, menuBehind: false, theme: 'assets/pages/css/pages.css', // paceThemeFlash: 'assets/plugins/pace/pace-theme-flash.css', bootstrap: 'assets/plugins/bootstrapv3/css/bootstrap.min.css', fontAwesome: 'assets/plugins/font-awesome/css/font-awesome.css', jqueryScrollbar: 'assets/plugins/jquery-scrollbar/jquery.scrollbar.css', pagesIcons: 'assets/pages/css/pages-icons.css', customCss: 'assets/pages/css/custom.css', owlCarousel: 'assets/plugins/carousel/owl.carousel.css', slickCarousel: 'assets/plugins/slick-carousel/slick.css', // Othres ie9: 'assets/pages/css/ie9.css', mapplicIe: 'assets/plugins/mapplic/css/mapplic-ie.css', chromeFix: 'assets/pages/css/windows.chrome.fix.css', }, author: 'tuhin.tsm.mandal@gmail.com' }; $scope.mySwitch = false; $scope.masonryColumnWidth = '350px'; //$scope.current_state=$state.current.name; //console.log($scope.current_state); // User Background Colors $scope.usercolors = [ "#a12c3e", "#c73935", "#ad2a76", "#dc6092", "#bfb8da", "#1e3a6c", "#f5c5d1", "#e68f74", "#ed8958", "#efae6a", "#224b3d", "#5b1434", "#f0ce74", "#f9f4bc", "#f8dd72", "#d6ce83", "#4f295a", "#76804e", "#adca6e", "#adca6e", "#7ca954", "#95cccf", "#4385a7", "#4295a3", "#c9e2cd", "#8f5494" ]; // Constants.. $scope.default_profile_img = 'assets/img/default-profile.png'; $scope.default_post_img = 'assets/img/post-placeholder.png'; $scope.default_post_vid = 'assets/img/video_placeholder.jpg'; $scope.default_cover_img = 'assets/img/default-cover-img.jpg'; $scope.loadMoreCommentsLimit = 10; // Initializing as object to shared through child controllers. $scope.commonData = {}; $scope.userFollowing = []; $scope.userFollower = []; $scope.isFollowingCategory = []; $scope.loggedIn = false; $http.get('angular/auth-json').then(function (response) { if (response.data && response.data.id > 0) { $scope.root_url = ROOT_URL; $scope.user = response.data; // invoke initialy and load 10 notifications. if ($scope.user.guest == 0) { $scope.loadNotifications(1, 10); $scope.loggedIn = true; // Listen for user activity. $scope.emitUserOpened($scope.user.id); } $scope.userProfileview = response.data.userProfileview; $scope.userTotalPost = response.data.userTotalPost; $scope.userFollowingData = $scope.user.following; $scope.userFollowerData = $scope.user.follower; if (angular.isArray($scope.userFollowingData)) { angular.forEach($scope.userFollowingData, function (value, key) { $scope.userFollowing.push(parseInt(value.user_id)); }); } if (angular.isArray($scope.userFollowerData)) { angular.forEach($scope.userFollowerData, function (value, key) { $scope.userFollower.push(parseInt(value.user_id)); }); } if (angular.isArray($scope.user.category_follow)) { angular.forEach($scope.user.category_follow, function (value, key) { $scope.isFollowingCategory.push(parseInt(value.category_id)); }); } if (angular.isArray($scope.user.category_follow)) { angular.forEach($scope.user.category_follow, function (value, key) { $scope.isFollowingCategory.push(parseInt(value.category_id)); }); } } }, function (response) { // $scope.logout(); }); $scope.showStatus = function (tags) { res=false; tags.forEach(function(tag) { // alert(tag.tag_name); if(tag.question_tag_created_at) { if( post.created_at < tag.question_tag_created_at) { res=true; return res; } } else { res=true; return res; } }); return res; }; /*------ Logout From the app ------*/ $scope.logout = function () { $scope.loggedIn = false; localStorageService.remove('userLocationSaved'); document.cookie = "showHeroImage=; expires=Thu, 01 Jan 1970 00:00:00 UTC"; $window.location.href = 'logout'; }; $scope.refreshUserData = function() { refreshService.userData().then(function(data){ $scope.user = data; $scope.userProfileview = data.userProfileview; $scope.userTotalPost = data.userTotalPost; $scope.userFollowingData = $scope.user.following; $scope.userFollowerData = $scope.user.follower; if (angular.isArray($scope.userFollowingData)) { var userFollowing = []; angular.forEach($scope.userFollowingData, function (value, key) { userFollowing.push(parseInt(value.user_id)); }); $scope.userFollowing = userFollowing; } if (angular.isArray($scope.userFollowerData)) { var userFollower = []; angular.forEach($scope.userFollowerData, function (value, key) { userFollower.push(parseInt(value.user_id)); }); $scope.userFollower = userFollower; } }); }; $scope.openPostPage = function (post) { var id = $stateParams.id; if ($state.current.name != 'post-details' || id != post.child_post_id) $window.open(post.post_url, '_blank'); }; /*$scope.$on(YT_event.STATUS_CHANGE, function(event, data) { console.log(data); });*/ //*=================== Refresh common contents ====================*// $scope.notifications = []; var notificationLoaded = []; $scope.loadNotifiBusy = false; $scope.noMoreloadNotifi = false; /** * Loads and populates the notifications */ $scope.loadNotifications = function (page, perpage, type) { if ($scope.loadNotifiBusy) { return; } if (type == 'loadMore') { // Stop loading more notification through infinite scroll. if ($scope.noMoreloadNotifi == true) { return; } $scope.loadNotifiBusy = true; } refreshService.notification(page, perpage).then(function (data) { var uniqueNotifiID; data.notifications.forEach(function (notification, index) { uniqueNotifiID = notification.id + '-' + notification.activity_id; // Push to notifications if not already available. if (notificationLoaded.indexOf(uniqueNotifiID) == -1) { $scope.notifications.push(notification); notificationLoaded.push(uniqueNotifiID); } }); // $scope.notifications = data.notifications; $scope.total_notifications = data.total_notifications; $scope.loadNotifiBusy = false; if (type == 'loadMore') { $scope.notificationPopUpOpen(); // Stop showing loader, no more notification for loadMore. if (data.notifications.length > 0) { $scope.noMoreloadNotifi = true; } } }, function (error) { $scope.loadNotifiBusy = false; }); }; // Trigger every 30 seconds for logged in user. $interval(function () { if ($scope.user && $scope.user.guest == 0) { $scope.loadNotifications(1, 10); $scope.refreshUserData(); } }, 30000); // invoke initially and load 10 notifications. // $scope.loadNotifications(1, 10); // Load more notification through infinite scrolling. var notificationPage = 1; var perpage = 10; var isFirstLoadMore = true; var type = 'loadMore'; $scope.loadMoreNotification = function (calledFrom) { // Limit max 5 page fetch on popup or prevent for first load more from notification. if (calledFrom == 'notification' && (notificationPage > 5 || isFirstLoadMore)) { isFirstLoadMore = false; return; } if ($scope.loadNotifiBusy) { return; } $scope.loadNotifications(notificationPage, perpage, type); notificationPage++; }; $scope.notificationPopUpOpen = function () { /* * Old Code >> Don not DELETE!! var notifi = []; var n = {}; angular.forEach($scope.notifications, function(notification, i) { if (notification.status != 1) { return; } // Reset object. n = {}; n.id = notification.id; n.activity_id = notification.activity_id; n.type = notification.type; n.total = notification.total; if ("comment_id" in notification) { n.comment_id = notification.comment_id; } notifi.push(n); }); var postData = { notifi: notifi }; */ // console.log(postData); // Mark popup notifications as seen. var url = 'api/mark-notification-seen'; $http.post(url/*, postData*/) .then(function (response) { $scope.loadNotifications(); }, function (response) { } ); }; // Mark notification as read. $scope.markNotificationRead = function (notification, clear_type, index) { /*--- Notifications stays.. ---*/ // Remove the notification from popup. /*setTimeout(function() { $scope.notifications.splice(index,1); }, 500);*/ // For notification popup. // No need for api call as opening popup will clear if (clear_type == 'all') { notification.status = 3; $timeout(function () { /*--- Notifications stays.. ---*/ // $scope.notifications.splice(index,1); $scope.loadNotifications(); }, 1200); return; } // For all notifications page. // No need for api call as opening popup will clear else if (clear_type == 'allNotifi') { // Make notification as read. $('.allNotifi-' + notification.post.id).addClass('notification-read'); $timeout(function () { $scope.loadNotifications(); }, 800); return; } else if (clear_type == 'single_ac') { // For all notifications page only. $('#allNotifi-' + index).addClass('notification-read'); } var url = 'api/mark-notification-read'; var id = notification.id; var total = notification.total; var type = notification.type; var activity_id = notification.activity_id; var postData = { id: id, total: total, type: type, activity_id: activity_id, clear_type: clear_type }; $http.post(url, postData) .then(function (response) { $scope.loadNotifications(); }, function (response) { $scope.loadNotifications(); } ); }; // Get notification text. $scope.getNotificationMsg = function (notification) { var message, notificationTotal; // Add user first name message = $filter('cut')(notification.user.first_name, true, 25); // For upvote and downvote. if ([1, 2, 3, 4, 5, 6, 7, 12, 13].indexOf(Number(notification.activity_id)) != -1) { if (notification.total > 1) { notificationTotal = (notification.total - 1); if (notificationTotal > 9999) { notificationTotal = $filter('thousandSuffix')(notificationTotal); } message += ' and ' + notificationTotal; message += notification.total == 2 ? ' other' : ' others'; } if (notification.activity_id == 1) { if (notification.type == 'comment' || notification.type == 'reply') { message += ' upvote your comment on'; } else { message += ' upvote'; } } else if (notification.activity_id == 2) { if (notification.type == 'comment' || notification.type == 'reply') { message += ' downvote your comment on'; } else { message += ' downvote'; } } else if ( notification.activity_id == 3 || notification.activity_id == 4 || notification.activity_id == 5 || notification.activity_id == 6 ) { message += ' shared'; } else if (notification.activity_id == 7) { message += ' comment on'; } else if (notification.activity_id == 12) { message += ' replied to your comment on'; } else if (notification.activity_id == 13) { message += ' follows you'; } } // Skip for other than post related notifications. var postRelatedActivities = [1, 2, 3, 4, 5, 6, 7, 12]; if (postRelatedActivities.indexOf(Number(notification.activity_id)) != -1) { var postName = ''; if (notification.post.title) { postName = notification.post.title; } else if (notification.post.post_type == 5 && notification.post.orginal_post) { postName = notification.post.orginal_post.caption; } else { postName = notification.post.caption; } // Add post title. message += '<i title="' + postName + '"> ' + $filter('cut')(postName, true, 25) + '</i>'; } if (notification.activity_id == 4) { message += ' to facebook'; } else if (notification.activity_id == 5) { message += ' to twitter'; } else if (notification.activity_id == 6) { message += ' to linkedin'; } message = $sce.trustAsHtml(message); return message; }; /* * Code for web socket * @author Tuhin Subhra Mandal */ // Emit user opened event. $scope.emitUserOpened = function (user_id) { var data = { user: { id: user_id } }; socket.emit('user opened', data); } // Emit post opened event. $scope.emitPostOpened = function (post, type) { var user_id = $scope.user && $scope.user.id > 1 ? $scope.user.id : null; var post_id = post.id; var relUserIds = []; if (post.getUser) { post.getUser.forEach(function (user) { relUserIds.push(user.id); }); } var opened_post = { post_id: post_id, relUserIds: relUserIds, uuid: browserTabID, user_id: user_id, type: type } socket.emit('post opened', opened_post); }; // Emit post closed event. $scope.emitPostClosed = function (post_id, type) { var user_id = $scope.user && $scope.user.id > 1 ? $scope.user.id : null; var opened_post = { post_id: post_id, uuid: browserTabID, user_id: user_id, type: type } socket.emit('post closed', opened_post); }; // Listen to total people here event. $scope.listenTotalPeopleEvent = function (callback) { socket.on('total_people_here', function (data) { callback(data.total); }); }; /* END Code for web socket */ $scope.openProfileFollow = function (src, index) { $scope.total_notifications = $scope.total_notifications - 1; $('#notifi-' + index).addClass('notification-read'); // $location.path('/profile').search('src', src); $state.go('profile', {src: src}, {reload: true}); /*--- Notifications stays.. ---*/ /*setTimeout(function () { $scope.notifications.splice(index, 1); }, 1000);*/ }; //*=================================================================*// /*----------------------------------------------------------------------*/ $scope.mySmNavClk = function () { if (!angular.element("#sidebarOuter").hasClass("show")) { angular.element("html, body").addClass("sidebar-open bodyHidden"); //angular.element(".page-sidebar").addClass("visible"); angular.element("#sidebarOuter").addClass("show"); angular.element(".page-sidebar").addClass("open"); } else { angular.element("html, body").removeClass("sidebar-open"); // angular.element(".page-sidebar").removeClass("visible"); angular.element("#sidebarOuter").removeClass("show"); setTimeout(function () { angular.element(".page-sidebar").removeClass("open"); angular.element("html, body").removeClass("bodyHidden"); }, 600); } }; $scope.navsmClose = function () { angular.element("body").on("click", "#sidebarOuter", function () { angular.element("html, body").removeClass("sidebar-open"); //angular.element(".page-sidebar").removeClass("visible"); angular.element("#sidebarOuter").removeClass("show"); setTimeout(function () { angular.element(".page-sidebar").removeClass("open"); angular.element("html, body").removeClass("bodyHidden"); }, 600); }); }; // Checks if the given state is the current state $scope.is = function (name) { return $state.is(name); }; // Checks if the given state/child states are present $scope.includes = function (name) { return $state.includes(name); }; $scope.closeOverLayout = function () { //$scope.popUpDropdrow = 0; // $scope.popUpReportDropdrow = 0; $(".subOverlaysh , .otherSubsh").hide(); }; $scope.bookmark = function (postID, type) { // M : Modal ,P: Postcard if (angular.isArray($scope.commonData.allPosts)) { var isChange = 0; angular.forEach($scope.commonData.allPosts, function (value, key) { if ($scope.commonData.allPosts[key].id == postID) { if ($scope.commonData.allPosts[key].isBookMark == 'Y') { $scope.commonData.allPosts[key].isBookMark = 'N'; // For left panel update total book marks // $scope.user.totalBookMarks= $scope.user.totalBookMarks-1; isChange = 1; } else { $scope.commonData.allPosts[key].isBookMark = 'Y'; // For left panel update total book marks // $scope.user.totalBookMarks= $scope.user.totalBookMarks+1; isChange = 2; } return; } }); // if (isChange == 1) { $scope.user.totalBookMarks = $scope.user.totalBookMarks - 1; } if (isChange == 2) { $scope.user.totalBookMarks = $scope.user.totalBookMarks + 1; } } if (type == 'M') { // Dynamick binding for postcard modal if ($scope.post.isBookMark == 'Y') { $scope.post.isBookMark = 'N'; $scope.post.totalBookMark = $scope.post.totalBookMark - 1; // post total bookmark $scope.user.totalBookMarks = $scope.user.totalBookMarks - 1; // user total bookmark } else { $scope.post.isBookMark = 'Y'; $scope.post.totalBookMark = $scope.post.totalBookMark + 1; // post total book mark $scope.user.totalBookMarks = $scope.user.totalBookMarks + 1; // user total bookmark } } $http({ method: 'POST', url: "angular/bookmark", data: {postID: postID} }).then(function (response) { }, function (error) { console.log('Sorry! we cannot process your request.'); }); } // Enable scroll lock on notification popup & prevent body scrolling when scrolling notification. $scope.notifiScrollLock = function () { $("#notifiBody").scrollLock(); }; // Broadcasts a message to pgSearch directive to toggle search overlay $scope.showSearchOverlay = function () { $scope.$broadcast('toggleSearchOverlay', { show: true }); }; $scope.hidePostFilter = false; $scope.removeFlikityLoader = false; $scope.postTypeNavItems = [ { name: 'All', value: 'all' }, { name: 'Status', value: 5 }, { name: 'Image', value: 1 }, { name: 'Video', value: 2 }, { name: 'link', value: 4 }, { name: 'Article', value: 3 }, { name: 'Question', value: 6 }, ]; $scope.flickityTagOptions = { prevNextButtons: false, pageDots: false, wrapAround: true, contain: true, cellAlign: 'left' //freeScroll: true, }; // Calculate post card total column width. var positionCards = function () { // No need for mobile. if ($(window).width() < 567) return; var $blockContent = $(".blockContent"); // var $blockContent = $(".masonry-brick"); var totalPostWidth = 0; var loopLimit = 15; var post_card_containerWidth = $(".post_card_container").innerWidth(); if ($blockContent.length) { $blockContent.each(function () { if (!loopLimit) { return; } loopLimit--; if ($(this).css('top') == '0px') { totalPostWidth += $(this).innerWidth(); } }); var widthDiff = (post_card_containerWidth - totalPostWidth) / 2; var $blckCntParent = $("#blckCntParent"); $blckCntParent.css({"left": widthDiff}); } }; $("body").on('click', '.modal-body .customPlayPause', function (e) { var videoDomObj = $(this).parent().children().children("video").get(0); if (videoDomObj.paused) { videoDomObj.play(); $(this).parent().children(".customPlayPause").addClass("out"); } }); $("body").on('click', '.modal-body .videoTag', function (e) { var videoDomObj2 = $(this).parent().children("video").get(0); if (videoDomObj2.paused) { videoDomObj2.play(); $(this).parent().parent().children(".customPlayPause").addClass("out"); } else { videoDomObj2.pause(); //$(this).parent().parent().children(".customPlayPause").removeClass("out"); } }); var positionCardTimer; /* * Start positioning cards. * @param time int -- time in milliseconds */ $scope.startPositionCards = function (time) { positionCards(); if (!time) { time = 300; } positionCardTimer = $interval(function () { positionCards(); }, time); }; /* * Stop positioning cards in interval. */ $scope.stopPositionCards = function (time) { if (!time) { time = 2000; } setTimeout(function () { $interval.cancel(positionCardTimer); }, time); } var reloadCardMasonryTimer; /* * Start masonry reloads. * @param time int -- time in milliseconds */ $scope.startReloadCardMasonry = function (time) { // No need for mobile. if ($(window).width() < 600) return; // Reload at first. $rootScope.$broadcast('masonry.reload'); if (!time) { time = 300; } reloadCardMasonryTimer = $interval(function () { $rootScope.$broadcast('masonry.reload'); }, time); }; /* * Stop positioning cards in interval. */ $scope.stopReloadCardMasonry = function (time) { if (!time) { time = 2100; } $timeout(function () { $interval.cancel(reloadCardMasonryTimer); }, time); } setTimeout(function () { positionCards(); // $rootScope.$broadcast('masonry.reload'); }, 100); /*-------------------------------------------*/ /*$interval(function () { $rootScope.$broadcast('masonry.reload'); }, 300);*/ /*=============================================*/ /* Call after resizing is done. */ var isCalled = false; var resizeId; $(window).resize(function () { if (!isCalled) { positionCards(); isCalled = true; } clearTimeout(resizeId); resizeId = setTimeout(doneMyResizing, 500); }); function doneMyResizing() { isCalled = false; setTimeout(function () { positionCards(); }, 100); } /*----------------------------------------------------------------------*/ $scope.showLocation = function (location) { var formatted_location = ''; if (location) { var charLimit = 14; var indexOfComma = location.indexOf(','); // comma not found if (indexOfComma === -1) { if (location.length > charLimit) { formatted_location = location.substring(0, charLimit) + ".."; } else { formatted_location = location; } } else { location = location.substring(0, indexOfComma); if (location.length > charLimit) { formatted_location = location.substring(0, charLimit) + ".."; } else { formatted_location = location; } } } return formatted_location; }; $scope.showPostViewTxt = function (post, referrer) { if (!post) { return ''; } else if (post.post_type == 1 || post.post_type == 5 || post.post_type == 6) { if (referrer == 'card') { return 'seen'; } return 'viewed'; } else if (post.post_type == 2) { return 'played'; } else if (post.post_type == 3) { return 'read'; } else if (post.post_type == 4) { return 'linked'; } }; $scope.redirecToLogin = function () { $('#signInNotifi, .signInoverlay, .loginDropWrap').css('display','block'); $('.forgotPassWrap').css('display','none'); setTimeout(function () { //$scope.goToLogin(); //$("#signInNotifi.in .signIN").trigger("click"); }, 3000); $("body").on("click", "#signInNotifi", function () { if ($("#myModal").hasClass("in")) { setTimeout(function () { //$("body").addClass("modal-open"); }, 500); } }); }; $('body').on('click','.signInoverlay', function(){ $('#signInNotifi, .signInoverlay').css('display','none'); }); $scope.goToLogin = function () { window.location = ROOT_URL; } $scope.showElapsedTime = function (post_date) { post_date = moment(post_date).toDate(); var oldLimit = new Date(); oldLimit.setDate(oldLimit.getDate() - 7); // 7 days old return post_date > oldLimit; }; $scope.$on('$viewContentLoaded', function () { notificationWidth(); angular.element(window).resize(function () { notificationWidth(); }); //owlCenterAlign(); $(window).resize(function () { setTimeout(function () { $scope.owlCenterAlign(); }, 600); }); }); $scope.upvoteDownvoteTxt = function (vote) { vote = parseInt(vote); if (vote > 1) return 'upvotes'; else if (vote >= 0) return 'upvote'; else if (vote < -1) return 'downvotes'; else if (vote < 0) return 'downvote'; }; function notificationWidth() { if ($(window).width() <= 599) { var winWidth = $(window).width(); $('.notification-panel').css({"width": winWidth}); } else { $('.notification-panel').css({"width": ""}); } } $scope.owlCenterAlign = function () { var owlCarousel = $(".owl-carousel"); if (owlCarousel.length > 0) { owlCarousel.each(function () { var owlOuterWidth = $(this).children(".owl-stage-outer").width(); var owlWidth = $(this).children().children(".owl-stage").innerWidth(); if (owlWidth < owlOuterWidth) { $(this).removeClass("centerItem"); $(this).addClass("centerItem"); } else { $(this).removeClass("centerItem"); } }); } }; $scope.initFlickity = function (element) { $(element).show(); var defaultOptions = { freeScroll: true, contain: true, prevNextButtons: false, pageDots: false, wrapAround: true, cellAlign: 'left' }; var customOptions = $scope.$eval($(element).attr('data-options')); for (var key in customOptions) { defaultOptions[key] = customOptions[key]; } $(element).flickity(defaultOptions); }; $scope.removePostLoading = function (postLoading) { /*postLoading = $("#" + postLoading); postLoading.removeClass('postLoading');*/ }; // For post details popup.. $scope.postPopupClose = function (post_id) { var $detailModal = $("#myModal"); // Code for mobile device if ($.Pages.getUserAgent() == 'mobile') { $("html").removeClass("mob-hideModal"); $(".loaderImage").hide(); window.scrollTo(0, $scope.winScrollPos); setTimeout(function () { if ($detailModal.is(':visible')) { $detailModal.modal('toggle'); } }, 100); } $detailModal.unbind(); $("html, body").removeClass("sidebar-open bodyHidden scrollHidden mob-hideModal modal-open"); // Reset the post. $scope.post = {}; // console.log('postPopupClose called: ' + post_id); // Code for socket. $scope.emitPostClosed(post_id, 1); // For Online people here. var opened_posts = localStorageService.get('opened_posts'); opened_posts = JSON.parse(opened_posts); if (opened_posts) { // Decrease count. opened_posts[post_id]--; if (opened_posts[post_id] == 0) { var p; for (p in $scope.commonData.allPosts) { if ($scope.commonData.allPosts[p].id == post_id) { // console.log($scope.commonData.allPosts[p].people_here); if ($scope.commonData.allPosts[p].people_here > 0) { $scope.commonData.allPosts[p].people_here -= 1; } break; } } delete opened_posts[post_id]; } localStorageService.set('opened_posts', JSON.stringify(opened_posts)); } }; $scope.winScrollPos = 0; $scope.showPostDetails = function (post_id, childPostId, is_scroll, postCardIndex, comment_id) { $scope.winScrollPos = $(window).scrollTop(); var myModal = $("#myModal"); myModal.on('hide.bs.modal', function () { $scope.postPopupClose(post_id); $(".barLong").hide(); }); myModal.on('show.bs.modal', function () { $(".barLong").show(); }); $scope.displayBestTab = false; myModal.addClass("modalLoader"); myModal.modal(); $(".barLong, .mobileBarLong").css({"display": "none"}); // Scroll bar loader $(".modalMobileScroll, .modal, .postModalOuter").animate({scrollTop: 0}); $("html").addClass("scrollHidden"); $('.scrollbar-inner').scrollbar(); // For Mobile scrollbar $scope.showSendBtn = true; // reset post data ... $scope.post = {}; // console.log($scope.post); /*------- Code for socket -------*/ $scope.totalPeopleHere = 0; $timeout(function () { // Scroll bar loader $(".barLong, .mobileBarLong").css({"width": "0px", "display": "block"}); $(".modalMsg").val(''); // for empty comment box }, 1000); // Show loader.. $scope.removePostLoader = false; $scope.postCardModal = "tpl_postcardmodal"; // $scope.comments=[]; $http({ method: "POST", url: "angular/showPostDetails", params: {post_id: post_id, child_post_id: childPostId, is_briefed: 0} }).then(function (response) { $scope.post = response.data.post; //$scope.post.distance = null; /*------- Code for socket -------*/ postOpened.init(); socket.removeAllListeners('total_people_here'); $scope.emitPostOpened($scope.post, 1); $scope.listenTotalPeopleEvent(function (totalPeopleHere) { $scope.totalPeopleHere = totalPeopleHere; if ($scope.loggedIn) { var p; for (p in $scope.commonData.allPosts) { if ($scope.commonData.allPosts[p].id == post_id) { $scope.commonData.allPosts[p].people_here = $scope.totalPeopleHere; break; } } } }); // For real time data if ($scope.loggedIn) { // Track opened post postOpened.trackPostOpened(post_id); // Listen for user followed event postOpened.userFollowedEvent(function (response) { if ($scope.post.getUser) { $scope.post.getUser.forEach(function (user) { if (user.id == response.user_id) { user.is_follow = response.data.totalFollowers; } }); } }); // Listen for user viewed event postOpened.userViewedEvent(function (response) { if ($scope.post.getUser) { $scope.post.getUser.forEach(function (user) { if (user.id == response.user_id) { user.userDataProfileViews = response.data.userDataProfileViews; } }); } }); // Listen for user point updated event postOpened.userPointUpdatedEvent(function (response) { if ($scope.post.getUser) { $scope.post.getUser.forEach(function (user) { if (user.id == response.user_id) { user.points = response.data.points; } }); } }); // Listen for post view updated event postOpened.listenPostViewUpdatedEvent(function (response) { if ($scope.post && $scope.post.id == response.post_id) { $scope.post.totalPostViews = response.data.totalPostViews; } }); // Listen for post point updated event postOpened.listenPostPointUpdatedEvent(function (response) { if ($scope.post && $scope.post.id == response.post_id) { $scope.post.points = response.data.points; } }); // Listen for post upvoted event postOpened.listenPostUpvotedEvent(function (response) { if ($scope.post && $scope.post.id == response.post_id) { $scope.post.upvotes = response.data.upvotes; $scope.post.downvotes = response.data.downvotes; } }); // Listen for post bookmarked event postOpened.listenPostSharedEvent(function (response) { if ($scope.post && $scope.post.id == response.post_id) { $scope.post.normalShare = response.data.normalShare; $scope.post.totalFBshare = response.data.totalFBshare; $scope.post.totalTwittershare = response.data.totalTwittershare; $scope.post.totalShare = $scope.post.normalShare + $scope.post.totalFBshare + $scope.post.totalTwittershare; } }); // Listen for usersTypingInChannel event postOpened.listenPostBookmarkedEvent(function (response) { if ($scope.post && $scope.post.id == response.post_id) { $scope.post.totalBookMark = response.data.totalBookMark; } }); } /*------- END Code for socket -------*/ /*** Calculate user distance ***/ /*if(navigator.geolocation){ navigator.geolocation.getCurrentPosition(function(position){ var lat = position.coords.latitude; var lng = position.coords.longitude; $scope.post.distance = haversineDistanceCalculationService.findDistance(lat, lng, $scope.post.lat, $scope.post.lon); console.log($scope.post.distance); }, function(PositionError){ },{ enableHighAccuracy: true, timeout: 5000, maximumAge: 0 }); }*/ /*** Calculate user distance ***/ // For device and creator name before caption on postcard modal var postModalUser = response.data.post.getUser; angular.forEach(postModalUser, function (value, key) { $scope.postUserName = value.first_name; $scope.createdUsername = value.username; $scope.createdUserFirstName = value.first_name; $scope.createdUserLastName = value.last_name; $scope.createdUserAboutMe = value.about_me; $scope.createdUserColor = value.user_color; $scope.createdUserId = value.id; $scope.creatorProfileImage = value.thumb_image_url; }); // end // using for doDownVotes(post.id,post.child_post_id,openFrom) function // M for modal and C for card . $scope.openFrom = 'M'; // update user points dynamically if ($state.current.name == 'profile' || $state.current.name == 'account') { var points = postModalUser[0].points; userDataService.updateUserData(points); userDataService.getData(); } if (!$scope.postData) { $scope.postData = {}; } $scope.postData.post_id = $scope.post.id; // Update dynamically total number of post view var p; for (p in $scope.commonData.allPosts) { if ($scope.commonData.allPosts[p].id == post_id) { $scope.commonData.allPosts[p].totalPostViews = response.data.post.totalPostViews; // break; } } // reset video $("video").load(); // *** END *** // // Hide Loader.. $scope.removePostLoader = true; $timeout(function () { myModal.removeClass("modalLoader"); $("html").addClass("mob-hideModal"); $('.modalMsg').on("touchstart", function () { $(this).trigger('mouseenter'); }); }, 100); if (is_scroll == 1) { $timeout(function () { $location.hash('commentfilter' + post_id); $anchorScroll(); }, 2000); } // For notification. else if (is_scroll == 3) { if (comment_id) { $timeout(function () { /*$("#newcomments").trigger('click'); $(".more_comment_div .loadMoreBtn").trigger('click'); $location.hash('pc' + post_id);*/ $location.hash('commentfilter' + post_id); $anchorScroll(); }, 2000); } } offset = 5; $timeout(function () { if ($scope.post.bestTab > 0) { $("#bestComments").trigger("click"); } else { $("#newcomments").trigger("click"); } }, 400); }); if (postCardIndex) { $scope.postCardIndex = postCardIndex; } else { $scope.postCardIndex = 0; } }; $(document).on("click", ".shareModal", function () { if (!$('.shareModal').hasClass("in")) { var sharelastScrollPos = $(window).scrollTop(); $("html, body").animate({scrollTop: sharelastScrollPos}, 0); $("html").removeClass("mob-hideModal"); } }); $scope.videoPlay = function (post, index, type) { if ($(window).width() > 600) { if (type == 'C') { if (post.video) { var vIndex = $("#cardVideo-" + post.cardID); cardVideo = vIndex.find(".videoTag"); cardVideo[0].play(); vIndex.next(".customPlayPause").hide(); } else if (post.embed_code) { var embed_code = post.embed_code; var videoURL = embed_code.toLowerCase(); if (videoURL.search('youtube') != -1) { var index = 'yc-' + post.cardID; if (typeof tsmPlayerPool[index] === 'undefined' || typeof tsmPlayerPool[index].playVideo !== 'function') { return; } tsmPlayerPool[index].playVideo(); } else if (videoURL.search('vimeo') != -1) { var index = 'vc-' + post.cardID; var iframe = $("#" + index).find('iframe')[0]; var player = new Vimeo.Player(iframe); player.play(); } else if (videoURL.search('dailymotion') != -1) { var index = 'dc-' + post.cardID; $("#" + index).find('iframe')[0].contentWindow.postMessage('play', "*"); } } } else { if (post.video) { var video = $(".profileNewLeft").find('.videoTag'); video[0].play(); video.next().hide(); } else if (post.embed_code) { var embed_code = post.embed_code; var videoURL = embed_code.toLowerCase(); if (videoURL.search('youtube') != -1) { var index = 'yc-' + post.cardID; tsmPlayerPool[index].playVideo(); } else if (videoURL.search('vimeo') != -1) { var index = 'vc-' + post.cardID; var iframe = $("#" + index).find('iframe')[0]; var player = new Vimeo.Player(iframe); player.play(); } else if (videoURL.search('dailymotion') != -1) { var index = 'dc-' + post.cardID; $("#" + index).find('iframe')[0].contentWindow.postMessage('play', "*"); } } } } }; $scope.videoPause = function (post, index, type) { if ($(window).width() > 600) { if (type == 'C') { if (post.video) { var vIndex = $("#cardVideo-" + post.cardID); var vid = vIndex.find(".videoTag"); vid[0].pause(); vIndex.next(".customPlayPause").show(); } else if (post.embed_code) { var embed_code = post.embed_code; var videoURL = embed_code.toLowerCase(); if (videoURL.search('youtube') != -1) { var index = 'yc-' + post.cardID; var currentPlayer = tsmPlayerPool[index]; if ( !currentPlayer || typeof currentPlayer === 'undefined' || typeof currentPlayer.getPlayerState !== 'function' ) { return; } var currentPlayerState = currentPlayer.getPlayerState(); // Pause if it is playing. if (currentPlayerState == 1 || currentPlayerState == 3) { currentPlayer.pauseVideo(); } /*var ct = currentPlayer.getCurrentTime(); var vDuration = currentPlayer.getDuration(); // var vData = currentPlayer.getVideoData(); if (ct >= vDuration * constants.VIDEO_VIEW_PER) { $scope.viewVideoPost(post); }*/ } else if (videoURL.search('vimeo') != -1) { var index = 'vc-' + post.cardID; var iframe = $("#" + index).find('iframe')[0]; var player = new Vimeo.Player(iframe); player.pause(); /*player.getCurrentTime().then(function (seconds) { if (seconds >= 5) { $scope.viewVideoPost(post); } }).catch(function (error) { console.log(error); });*/ } else if (videoURL.search('dailymotion') != -1) { var index = 'dc-' + post.cardID; $("#" + index).find('iframe')[0].contentWindow.postMessage('pause', "*"); } } } else { if (post.video) { var video = $(".profileNewLeft").find(".videoTag"); video[0].pause(); var currentTime = video[0].currentTime; if (Math.round(currentTime) >= 5) { $scope.viewVideoPost(post); } video.next().show(); } else if (post.embed_code) { var embed_code = post.embed_code; var videoURL = embed_code.toLowerCase(); if (videoURL.search('youtube') != -1) { var currentPlayer = tsmPlayerPool[index]; currentPlayer.pauseVideo(); } else if (videoURL.search('vimeo') != -1) { var index = 'vc-' + post.cardID; var iframe = $("#" + index).find('iframe')[0]; var player = new Vimeo.Player(iframe); player.pause(); /*player.getCurrentTime().then(function (seconds) { if (seconds >= 5) { $scope.viewVideoPost(post); } }).catch(function (error) { console.log(error); });*/ } else if (videoURL.search('dailymotion') != -1) { var index = 'dc-' + post.cardID; $("#" + index).find('iframe')[0].contentWindow.postMessage('pause', "*"); } } } } }; $scope.viewVideoPost = function (post) { var postID = post.id; var childPostID = post.child_post_id; var postType = post.post_type; $http({ method: "POST", url: "angular/viewPost", data: { postID: postID, childPostID: childPostID, postType: postType } }).then(function (response) { // userData is update on proilfe or account . if ($state.current.name == 'profile' || $state.current.name == 'account') { var points = response.data.post.getUsers[0].points; userDataService.updateUserData(points); userDataService.getData(); } // Update dynamically total number of post view var p; for (p in $scope.commonData.allPosts) { if ($scope.commonData.allPosts[p].id == postID) { $scope.commonData.allPosts[p].totalPostViews = response.data.post.totalPostViews; // break; } } // Update postcard modal :: post.points = response.data.post.points; post.totalPostViews = response.data.post.totalPostViews; if (angular.isArray(post.getUser)) { angular.forEach(post.getUser, function (value, key) { angular.forEach(response.data.post.getUsers, function (val, k) { if (value.id == val.id) { post.getUser[k].points = val.points; } }); }); } }, function (error) { // console.log('Error occurred.'); }); }; $(window).load(function () { postCardPosition(); }); $(document).on('scroll', function () { postCardPosition(); }); // var checkArray=[]; /******* Changes for new activity seen algo(20-12-17) ********/ /* function postCardPosition() { var pCFnoBorder; $(".image_status_post.na").each(function () { pCFnoBorder = $(this).find(".profileCommentFooter.noBorderPos"); if (pCFnoBorder.length > 0) { var topPos = pCFnoBorder.offset().top - 0; // var thisHeight = $(this).innerHeight(); var screenHeight = $(window).height(); var lastPos = topPos - screenHeight; if ($(window).scrollTop() >= lastPos) { var postID = $(this).attr("custompostid"); $scope.imageAndStatusView(postID); $(this).removeClass('na'); /*if(checkArray.indexOf(postID)==-1 ) { $scope.imageAndStatusView(postID); checkArray.push(postID); }*/ /* } } }); // .exploreTest $(".blockContent").each(function () { if (!$(this).hasClass("showNow")) { var thisPos = $(this).offset().top; var screenPos = $(window).scrollTop(); var winHeight = $(window).height() - 160; if (thisPos <= (screenPos + winHeight)) { $(".exploreTest .blockContent").addClass("hideNow"); $(this).removeClass("hideNow").addClass("showNow"); } } }); } */ function postCardPosition() { var pCFnoBorder; $(".post.na").each(function () { pCFnoBorder = $(this).find(".profileCommentFooter.noBorderPos"); if (pCFnoBorder.length > 0) { var topPos = pCFnoBorder.offset().top - 0; // var thisHeight = $(this).innerHeight(); var screenHeight = $(window).height(); var lastPos = topPos - screenHeight; if ($(window).scrollTop() >= lastPos) { var postID = $(this).attr("custompostid"); $scope.postSeenView(postID); $(this).removeClass('na'); /*if(checkArray.indexOf(postID)==-1 ) { $scope.imageAndStatusView(postID); checkArray.push(postID); }*/ } } }); // .exploreTest $(".blockContent").each(function () { if (!$(this).hasClass("showNow")) { var thisPos = $(this).offset().top; var screenPos = $(window).scrollTop(); var winHeight = $(window).height() - 160; if (thisPos <= (screenPos + winHeight)) { $(".exploreTest .blockContent").addClass("hideNow"); $(this).removeClass("hideNow").addClass("showNow"); } } }); } $scope.postSeenView = function (postID) { // console.log("Recording activity for: " + postID); if (angular.isArray($scope.commonData.allPosts)) { angular.forEach($scope.commonData.allPosts, function (value, key) { if ($scope.commonData.allPosts[key].id == postID) { if ($scope.commonData.allPosts[key].created_by != $scope.user.id) { $http({ method: "POST", url: "angular/viewSeenPost", data: { postID: postID, childPostID: $scope.commonData.allPosts[key].child_post_id, postType: $scope.commonData.allPosts[key].post_type } }).then(function (response) { //this block is only accessed profile and account page if ($state.current.name == 'profile' || $state.current.name == 'account') { if (response.data.post) { var points = response.data.post.getUsers[0].points; userDataService.updateUserData(points); } userDataService.getData(); } }, function (error) { console.log('Error occurred.'); }); } return; } }); } }; /******* Changes for new activity seen algo(20-12-17) ********/ $scope.imageAndStatusView = function (postID) { // console.log("Recording activity for: " + postID); if (angular.isArray($scope.commonData.allPosts)) { angular.forEach($scope.commonData.allPosts, function (value, key) { if ($scope.commonData.allPosts[key].id == postID) { if ($scope.commonData.allPosts[key].created_by != $scope.user.id) { $http({ method: "POST", url: "angular/viewPost", data: { postID: postID, childPostID: $scope.commonData.allPosts[key].child_post_id, postType: $scope.commonData.allPosts[key].post_type } }).then(function (response) { //this block is only accessed profile and account page if ($state.current.name == 'profile' || $state.current.name == 'account') { if (response.data.post) { var points = response.data.post.getUsers[0].points; userDataService.updateUserData(points); } userDataService.getData(); } }, function (error) { console.log('Error occurred.'); }); } return; } }); } }; // Direct post to twitter from create post page (IMAGE, LINK, ARTICLE and VIDEO) $scope.connectTwitter = function () { if ($("#twitter").prop('checked') == true) { var left = screen.width / 2 - 200; var top = screen.height / 2 - 250; var interval = 1000; $window.$scope = $scope; $http({ method: "POST", url: "accessTokenVerify", }).then(function (response) { if (parseInt(response.data) == 0) { var popup = $window.open('auth-twitter', '', 'left=' + left + ',top=' + top + ',width=550,height=450,personalbar=0,toolbar=0,scrollbars=0,resizable=0'); // create an ever increasing interval to check a certain global value getting assigned in the var i = $interval(function () { interval += 500; try { // value is the user_id returned from paypal if (popup.value) { $interval.cancel(i); popup.close(); } } catch (e) { console.error(e); } }, interval); } }, function (response) { console.log('some error is occurred'); }) } }; /*** Start Geolocation watchposition ***/ /*var watchId; $scope.watchForPosition = function(){ if (navigator.geolocation) { // timeout at 60000 milliseconds (60 seconds) var options = {timeout:60000}; var geoLoc = navigator.geolocation; watchId = geoLoc.watchPosition(saveLocation, errorHandler, options); } }; var saveLocation = function(position){ console.log("Geolocation : "+JSON.stringify(position)); }; var errorHandler = function(err){ switch(err.code){ case 1: console.log("Error: Access is denied!");break; case 2: console.log("Error: Position is unavailable!");break; } }; $scope.watchForPosition();*/ /*** End Geolocation watchposition ***/ }]) .controller('SignInCtrl', ['$scope', '$http', '$rootScope', '$state', '$stateParams', '$sce', '$filter', '$timeout', '$interval', '$location', '$window', '$anchorScroll', 'refreshService', 'userDataService', 'YT_event', 'socket', 'postOpened', 'localStorageService', 'haversineDistanceCalculationService', function ($scope, $http, $rootScope, $state, $stateParams, $sce, $filter, $timeout, $interval, $location, $window, $anchorScroll, refreshService, userDataService, YT_event, socket, postOpened, localStorageService, haversineDistanceCalculationService) { $scope.popupsigninH = { email: '', password: '' } // this will make the login submit $scope.loginPopSubmit = function(e) { document.getElementById("signSubmit").classList.add('disabled'); // console.log('$("#form-signin").serializeArray()') // alert('login') // this will parse the serialize array data from the form field function objectifyForm(formArray) {//serialize data function var returnArray = {}; for (var i = 0; i < formArray.length; i++){ returnArray[formArray[i]['name']] = formArray[i]['value']; } return returnArray; } // make the object so server can accept and give return value $scope.loginPopUpUserData = objectifyForm($("#form-signin").serializeArray()) if($scope.loginPopUpUserData.email != '' && $scope.loginPopUpUserData.password != ''){ var loginPopUp = $http.post('/loginapi', $scope.loginPopUpUserData); loginPopUp.success(function(data, status, headers, config) { document.getElementById("signSubmit").classList.remove('disabled'); if(data.msg == "error"){ $scope.signinerrormsgST = true $scope.signinerrormsg = 'Invalid email and password' } else { // alert('everything ok') document.getElementById('form-signin-h').submit() } // alert('success') $scope.signinsuccessST = true; $scope.signinsuccess = 'success'; }); loginPopUp.error(function(data, status, headers, config) { document.getElementById("signSubmit").classList.remove('disabled'); // alert( "failure message"); $scope.signinerrormsgST = true $scope.signinerrormsg = 'error' }); } else { document.getElementById("signSubmit").classList.remove('disabled'); $scope.signinerrormsgST = true $scope.signinerrormsg = 'Please put the email and password' } // document.getElementById('form-signin').submit() // angular sign in form submit // var loginPopUp = $http.post('/savecompany_json', $scope.loginPopUpUserData); // loginPopUp.success(function(data, status, headers, config) { // // alert('success') // $scope.signinsuccessST = true; // $scope.signinsuccess = 'success'; // }); // loginPopUp.error(function(data, status, headers, config) { // // alert( "failure message"); // $scope.signinerrormsgST = true // $scope.signinerrormsg = 'error' // }); }; }]) .controller('ForgotPasswordCtrl', ['$scope', '$http', '$rootScope', '$state', '$stateParams', '$sce', '$filter', '$timeout', '$interval', '$location', '$window', '$anchorScroll', 'refreshService', 'userDataService', 'YT_event', 'socket', 'postOpened', 'localStorageService', 'haversineDistanceCalculationService', function ($scope, $http, $rootScope, $state, $stateParams, $sce, $filter, $timeout, $interval, $location, $window, $anchorScroll, refreshService, userDataService, YT_event, socket, postOpened, localStorageService, haversineDistanceCalculationService) { // $scope.popupsigninH = { // email: '', // password: '' // } // this will make the login submit $scope.forgotPopupSubmit = function(e) { document.getElementById("forgotPassSubmit").classList.add('disabled'); // console.log('$("#form-signin").serializeArray()') // alert('forgot') // this will parse the serialize array data from the form field function objectifyForm(formArray) {//serialize data function var returnArray = {}; for (var i = 0; i < formArray.length; i++){ returnArray[formArray[i]['name']] = formArray[i]['value']; } return returnArray; } // make the object so server can accept and give return value $scope.forgotPasswordUserData = objectifyForm($("#form-forgot").serializeArray()) // alert($scope.forgotPasswordUserData.email); if($scope.forgotPasswordUserData.email != '' ){ var forgotPopUp = $http.post('/forgotPasswordApi', $scope.forgotPasswordUserData); forgotPopUp.success(function(data, status, headers, config) { document.getElementById("forgotPassSubmit").classList.remove('disabled'); // alert(data.msg) if(data.msg == "error"){ $scope.forgotpasserrormsgST = true $scope.forgotpasserrormsg = 'Invalid email and password' $scope.forgotpasssuccmsgST = false $scope.forgotpasssuccmsg = '' } else { $scope.forgotpasssuccmsgST = true $scope.forgotpasssuccmsg = 'Please check your email.' $scope.forgotEmail='' $scope.forgotpasserrormsgST = false $scope.forgotpasserrormsg = '' } }); // alert('success') } else { document.getElementById("forgotPassSubmit").classList.remove('disabled'); $scope.forgotpasserrormsgST = true $scope.forgotpasserrormsg = 'Please put the email' } // document.getElementById('form-signin').submit() // angular sign in form submit // var loginPopUp = $http.post('/savecompany_json', $scope.loginPopUpUserData); // loginPopUp.success(function(data, status, headers, config) { // // alert('success') // $scope.signinsuccessST = true; // $scope.signinsuccess = 'success'; // }); // loginPopUp.error(function(data, status, headers, config) { // // alert( "failure message"); // $scope.signinerrormsgST = true // $scope.signinerrormsg = 'error' // }); }; }]); /*------- Directives ------*/ angular.module('app') .directive('loading', function () { return { restrict: 'E', replace: true, template: '<div class="coverPhotoLoading"></div>', link: function (scope, element, attr) { scope.$watch('loading', function (val) { if (val) $(element).show(); else $(element).hide(); }); } } }) .filter('ytVideoId', function () { return function (url) { return /[^/]*$/.exec(url)[0]; }; }) .filter('tagreplace', function () { return function (data) { console.log(data); return data.replace(/-/g, ' ').replace(/_/g, ' '); }; }) .directive('imageonload', function () { return { restrict: 'A', link: function (scope, element, attrs) { element.one('load', function () { //call the function that was passed scope.$apply(attrs.imageonload); }).each(function () { if (this.complete) { scope.$apply(attrs.imageonload); } }); element.one('error', function () { //call the function that was passed scope.$apply(attrs.imageonload); }).each(function () { if (this.complete) { scope.$apply(attrs.imageonload); } }); } }; }) .directive('featureImageOnload', function () { return { restrict: 'A', link: function (scope, element, attrs) { element.bind('load', function() { // Remove min-height element.css({ 'min-height' : '' } ); // load actual thumb image. var imgLarge = new Image(); imgLarge.classList.add('largeFeatImage'); imgLarge.src = scope.post.image; imgLarge.onload = function () { imgLarge.classList.add('loaded'); element.replaceWith(imgLarge); clearImage(); }; // element.replaceWith(imgLarge); function clearImage() { imgLarge = null; } }); element.bind('error', function(){ attrs.src = $scope.default_post_img; }); } }; }) .filter('highlightNode', ["$sce", function ($sce) { return function (str, theTerms) { if (!theTerms) { return str; } // Sort terms by length theTerms.sort(function (a, b) { return b.length - a.length; }); // Regex to simultaneously replace terms var regex = new RegExp("<a href='.*?'>|(" + theTerms.join('|') + ')', 'gi'); var replaced = str.replace(regex, function (m, group1) { if (!group1) return m; else return $sce.trustAsHtml('<span class="hlNode">' + group1 + '</span>'); }); return replaced; // return $sce.trustAsHtml(replaced); }; }]) .filter('highlightTag', ["$sce", function ($sce) { return function (str) { if (!str) return '[Caption]'; // Convert new lines to break tag. var str = nl2br(str); var regex = new RegExp('\#([a-z-A-Z0-9]+)', 'gi'); var replaced = str.replace(regex, function (m, group1) { if (!group1) return m; else return $sce.trustAsHtml('<a><span>#</span></span><span class="hlTag">' + group1 + '</span></a>'); }); return replaced; }; }]) .directive('postCard', ["$timeout", "$window", "$http", "$state", function ($timeout, $window, $http, $state) { return { restrict: 'AE', scope: false, templateUrl: "tpl.post-card", link: function ($scope, element, attrs) { if ($scope.$first === true) { $scope.startPositionCards(); $scope.startReloadCardMasonry(); } if ($scope.$last === true) { $scope.stopPositionCards(); $scope.stopReloadCardMasonry(); $timeout(function () { // Remove class. $('.postCard').removeClass('postCardHide'); }, 1200); } /* * determine post card class. * toLoad => removing needs to be done manually */ $scope.cardClass = function (post) { var cssClass = ''; if (post.post_type === 2 || ((post.post_type === 3 || post.post_type === 4 || post.post_type === 5) && !post.image)) { if (!post.image) cssClass = 'toLoad noImg'; else cssClass = 'toLoad'; } return cssClass; }; var elm = element.find("div.postLoading"); $timeout(function () { /* Remove manually(from the house of manual script) */ var timeOutTime = $scope.post.post_type === 2 ? 2000 : 500; $timeout(function () { elm.removeClass("postLoading"); }, timeOutTime); }, 300); // DOM has finished rendering /*$timeout(function () { elm.removeClass("postCard"); });*/ //$scope.popUpReportDropdrow = 0; $scope.report = function (post) { $("#otherSub" + post.child_post_id).show(); $("#closeOverLayout" + post.child_post_id).show(); $scope.reportpostID = post.id; var flag = 0; $scope.openFrom = 'C'; if ($state.current.name === 'profile') { if (post.child_post_user_id != $scope.user.id) { flag = 1; } else { flag = 0; } } else if ($state.current.name == 'account') { if (post.created_by != $scope.user.id) { flag = 1; } else { flag = 0; } } else { if (post.created_by != $scope.user.id) { flag = 1; } else { flag = 0; } } $scope.isShowPostReportLink = flag; }; } }; }]) .directive('searchPostCard', ["$timeout", "$window", "$http", "$state", function ($timeout, $window, $http, $state) { return { restrict: 'AE', scope: false, templateUrl: "tpl.search-post-card", link: function ($scope, element, attrs) { if ($scope.$first === true) { $scope.startPositionCards(); $scope.startReloadCardMasonry(); } if ($scope.$last === true) { $scope.stopPositionCards(); $scope.stopReloadCardMasonry(); } /* * determine post card class. * toLoad => removing needs to be done manually */ $scope.cardClass = function (post) { var cssClass = ''; if (post.post_type === 2 || ((post.post_type === 3 || post.post_type === 4 || post.post_type === 5) && !post.image)) { if (!post.image) cssClass = 'toLoad noImg'; else cssClass = 'toLoad'; } return cssClass; }; $timeout(function () { var elm = element.find("div.postLoading"); /* Remove manually */ $timeout(function () { elm.removeClass("postLoading"); }, 2000); }, 300); //$scope.popUpReportDropdrow = 0; $scope.report = function (post) { $("#otherSub" + post.id).show(); $("#closeOverLayout" + post.id).show(); $scope.reportpostID = post.id; var flag = 0; $scope.openFrom = 'C'; if ($state.current.name == 'profile') { if (post.child_post_user_id != $scope.user.id) { flag = 1; } else { flag = 0; } } else if ($state.current.name == 'account') { if (post.created_by != $scope.user.id) { flag = 1; } else { flag = 0; } } else { if (post.created_by != $scope.user.id) { flag = 1; } else { flag = 0; } } $scope.isShowPostReportLink = flag; }; } }; }]) .directive('testPostCard', ["$timeout", "$window", "$http", "$state", function ($timeout, $window, $http, $state) { return { restrict: 'AE', scope: false, templateUrl: "tpl.test-post-card", link: function ($scope, element, attrs) { if ($scope.$first === true) { $scope.startPositionCards(); // $scope.startReloadCardMasonry(); } if ($scope.$last === true) { $scope.stopPositionCards(); // $scope.stopReloadCardMasonry(); } /* * determine post card class. * toLoad => removing needs to be done manually */ /*$scope.cardClass = function(post) { var cssClass = ''; if (post.post_type === 2 || ((post.post_type === 3 || post.post_type === 4 || post.post_type === 5) && !post.image)) { if (!post.image) cssClass = 'toLoad noImg'; else cssClass = 'toLoad'; } return cssClass; };*/ setTimeout(function () { var elm = element.find("div.postLoading"); /* Remove manually(from the house of manual script) */ setTimeout(function () { elm.css("opacity", 1); elm.removeClass("postLoading"); }, 1200); /*setTimeout(function() { elm.removeClass("postLoading"); }, 1200);*/ /*if (elm.hasClass('toLoad')) { if (elm.hasClass('noImg')) { elm.removeClass("postLoading"); } else { $timeout(function() { elm.removeClass("postLoading"); }, 2000); } }*/ }, 300); //$scope.popUpReportDropdrow = 0; $scope.report = function (post) { // $scope.popUpReportDropdrow = !$scope.popUpReportDropdrow; //$("#otherSub"+post.id).show(); //$("#closeOverLayout"+post.id).show(); $("#otherSub" + post.id).show(); $("#closeOverLayout" + post.id).show(); $scope.reportpostID = post.id; var flag = 0; $scope.openFrom = 'C'; if ($state.current.name == 'profile') { if (post.child_post_user_id != $scope.user.id) { flag = 1; } else { flag = 0; } } else if ($state.current.name == 'account') { if (post.created_by != $scope.user.id) { flag = 1; } else { flag = 0; } } else { if (post.created_by != $scope.user.id) { flag = 1; } else { flag = 0; } } $scope.isShowPostReportLink = flag; }; } }; }]) .directive('contentLoaded', ["$timeout", function ($timeout) { return { restrict: 'A', link: function ($scope, element, attrs) { /*$timeout(function() { var elm = $(element); var imgElm = elm.find("img.cardLoadChk"); if (imgElm.length > 0) { imgElm.bind('load', function () { console.log('img is loaded.'); }); } }, 10);*/ } } }]) .directive('logCardCreation', function () { return { restrict: 'A', link: function ($scope, element, attrs) { console.info( "Card created: " + $scope.$index, $scope.post.title ? $scope.post.title : $scope.post.caption // $scope.post ); } } }) .directive('postTypeNav', ["$state", "$timeout", function ($state, $timeout) { return { restrict: 'E', scope: false, templateUrl: function (elem, attrs) { return "tpl.post-type-nav/" + attrs.navtype }, link: function ($scope, element, attrs) { // OwlCarousel custom options. $scope.navTypeOwlOptions = { loop: false, nav: false, margin: 0, navigation: false, //startPosition:1, items: 7 }; $scope.getPost = function (postType) { if ($scope.mySwitch == true) { return false; } if ($state.current.name === 'profile' || $state.current.name === 'account') { $scope.resetPostData(); $scope.loadMore(postType); } else { $scope.resetData(); $scope.setPostType(postType); if ($state.current.name === 'search') { $scope.fetchPostData($scope.currentTab); } else { $scope.fetchPostData(); } } }; } } }]) /* * Directive for top channel cards. */ .directive('channelCard', function () { return { restrict: 'E', templateUrl: "tpl.channel-card", }; }) .directive('searchChannelCard', function () { return { restrict: 'E', templateUrl: "tpl.search-channel-card", }; }) /* * Directive for followingTopics. */ .directive('followingTopics', function () { return { restrict: 'E', templateUrl: "tpl.topics", }; }) .directive('hitEnter', function () { return function (scope, element, attrs) { element.bind("keydown keypress", function (event) { if (event.which === 13) { scope.$apply(function () { scope.$eval(attrs.hitEnter); }); event.preventDefault(); } }); }; }) .directive('fallbackSrc', function () { return function (scope, element, attrs) { element.bind("error", function () { scope.$apply(function () { scope.$eval(attrs.fallbackSrc); }); }); }; }) // Directives for owl carousal.. .directive("owlCarousel", ['$timeout', '$compile', function ($timeout, $compile) { return { restrict: 'E', transclude: false, link: function (scope) { scope.initCarousel = function (element) { // provide any default options you want var defaultOptions = { margin: 0 }; // Set timeout for owl init. var time = scope.$eval($(element).attr('data-owl-time')); if (!time) { time = 0; } var customOptions = scope.$eval($(element).attr('data-options')); // combine the two options objects for (var key in customOptions) { defaultOptions[key] = customOptions[key]; } $timeout(function () { // init carousel $(element).owlCarousel(defaultOptions); $(element).show(); scope.owlCenterAlign(); // Hide loader if any if ($(".smallLoaderOwl").length > 0) { $(".smallLoaderOwl").remove(); } }, time); }; } }; }]) .directive('owlCarouselItem', ['$timeout', function ($timeout) { return { restrict: 'A', transclude: false, link: function (scope, element) { // wait for the last item in the ng-repeat then call init if (scope.$last) { $timeout(function () { scope.initCarousel(element.parent()); }, 3000); } } }; }]) // Directives for flickity carousal.. .directive('flickityItem', ['$timeout', function ($timeout) { return { restrict: 'A', transclude: false, link: function (scope, element) { // wait for the last item in the ng-repeat then call init. if (scope.$last) { var time = 1000; var parentElm = element.parent(); var dataHideSelector = parentElm.attr('data-hide-selector'); var dataHideTime = parentElm.attr('data-hide-time'); if (dataHideTime) { time = dataHideTime; } setTimeout(function () { scope.initFlickity(element.parent()); // Hide loader element. if (dataHideSelector) { $(dataHideSelector).remove(); } }, time); } } }; }]) .directive('hideLoader', ['$timeout', function ($timeout) { return { restrict: 'A', link: function (scope, element, attrs) { // wait for the last item in the ng-repeat then call init if (scope.$last) { var selector = element.parent().attr('data-hide-selector'); var time = element.parent().attr('data-hide-time'); if (!time) { time = 0; } $timeout(function () { var $selector = $(selector); if ($selector.length > 0) { $selector.hide(); } }, time); } } }; }]) .directive('vimeoVideo', ["$timeout", "$interval", "constants", function ($timeout, $interval, constants) { return { restrict: "E", link: function ($scope, element, attr) { var options = { id: attr.vid, width: 640, loop: true }; var isPlayed; $timeout(function () { var player = new Vimeo.Player(attr.id, options); /*player.on('play', function () { $scope.viewVideoPost(post_id,child_post_id,type); });*/ // player.addEvent('ready', function() { }); player.getDuration().then(function(duration) { $interval(function () { player.getCurrentTime().then(function (seconds) { if (seconds >= duration * constants.VIDEO_VIEW_PER && !isPlayed) { $scope.viewVideoPost($scope.post); isPlayed = true; } }); }, 100); }).catch(function(error) { // an error occurred }); player.pause(); }, 200); } } }]) .directive('dailyMotion', ["$timeout", "constants", function ($timeout, constants) { return { restrict: "E", link: function ($scope, element, attr) { var isPlayed = false; $timeout(function () { var player = DM.player(document.getElementById(attr.id), { video: attr.vid, width: '100%', height: '100%', params: { autoplay: false, mute: false } }); /* Watch for ads */ var isShowingAds = false; player.addEventListener('ad_start', function(event) { isShowingAds = true; player.removeEventListener('ad_start', function () { // Nothing. }); }); player.addEventListener('ad_end', function(event) { isShowingAds = false; player.removeEventListener('ad_end', function () { // Nothing. }); }); var duration; player.addEventListener('timeupdate', function(event) { setTimeout(function () { if (!duration) { duration = player.duration; } var currentTime = player.currentTime; // console.log('timeupdate: duration: '+duration+' currentTime: '+currentTime); if ( currentTime >= duration * constants.VIDEO_VIEW_PER && !isPlayed && !isShowingAds ) { console.info('Total duration: '+duration+' currentTime: '+currentTime); $scope.viewVideoPost($scope.post); isPlayed = true; } }, 100); }); }, 200); } } }]) .directive('manualVideo', ["$sce", "constants", function ($sce, constants) { var linkFunction = function ($scope, element, attrs) { $scope.postcardid = attrs.postcardid; $scope.childpostid = attrs.childpostid; $scope.posttype = attrs.posttype; $scope.type = attrs.type; $scope.url = $sce.trustAsResourceUrl(attrs.url); var isPlayed = false; var video = $(element).find(".videoTag"); video.bind("timeupdate", function () { if (this.currentTime >= this.duration * constants.VIDEO_VIEW_PER && !isPlayed) { $scope.viewVideoPost($scope.post); isPlayed = true; } }); }; return { restrict: "E", template: '<video class="videoTag na" loaded-meta-data="{{type}}" controls loop playsinline webkit-playsinline ng-attr-poster="{{post.video_poster}}" postcardid="{{postcardid}}" id="cardVideo-{{post.cardID}}" type="{{type}}" posttype="{{posttype}}"><source ng-src="{{url}}"></video>', link: linkFunction }; }]) .directive('loadedMetaData', ["$rootScope", "$timeout", function ($rootScope, $timeout) { return { restrict: 'A', link: function (scope, element, attrs) { element[0].addEventListener("loadedmetadata", function () { if (attrs.loadedMetaData === 'C') { $rootScope.$broadcast('masonry.reload'); } }); scope.$on('$destroy', function () { element[0].removeEventListener("loadedmetadata", function(){}); }); } }; }]) /* * Use this directive together with ng-include to include a * template file by replacing the placeholder element */ .directive('includeReplace', function () { return { require: 'ngInclude', restrict: 'A', link: function (scope, el, attrs) { el.replaceWith(el.children()); } }; }) /* * Disable click if condition satified. */ .directive('eatClickIf', ['$parse', '$rootScope', function ($parse, $rootScope) { return { // this ensure eatClickIf be compiled before ngClick priority: 100, restrict: 'A', compile: function ($element, attr) { var fn = $parse(attr.eatClickIf); return { pre: function link(scope, element) { var eventName = 'click'; element.on(eventName, function (event) { var callback = function () { if (fn(scope, {$event: event})) { // prevents ng-click to be executed event.stopImmediatePropagation(); // prevents href event.preventDefault(); return false; } }; if ($rootScope.$$phase) { scope.$evalAsync(callback); } else { scope.$apply(callback); } }); }, post: function () { } } } } } ]) ; /*------ Filters -------*/ angular.module('app') .filter('isEmpty', function () { var bar; return function (obj) { for (bar in obj) { if (obj.hasOwnProperty(bar)) { return false; } } return true; }; }) .filter('trustUrl', ["$sce", function ($sce) { return function (url) { return $sce.trustAsResourceUrl(url); }; }]) .filter('ucfirst', function () { return function (string) { if (string && angular.isString(string)) { return string.charAt(0).toUpperCase() + string.slice(1); } return string; }; }) .filter('limitShortDesc', function () { return function (short_description) { /*if (short_description && short_description.length > 100) { return short_description.substring(0, 100) + "..."; }*/ return short_description; }; }) .filter('limitUserAbout', function () { return function (about) { if (about && about.length > 100) { return about.substring(0, 100) + "..."; } return about; }; }) .filter('lpArticleContent', function () { return function (content) { if (content) { content = content.replace(/<video.*<\/video>|<(?!p\s*\/?)[^>]+>/g, ''); if (content.length > 200) { content = content.substring(0, 200) + "..."; } } return content; }; }) .filter('domainFilter', function () { return function (url) { if (!url) return ''; var domain; // find & remove protocol (http, ftp, etc.) and get domain if (url.indexOf("://") > -1) { domain = url.split('/')[2]; } else { domain = url.split('/')[0]; } // find & remove port number domain = domain.split(':')[0]; domain = domain.replace('www.', ''); return domain; }; }) .filter('ageFilter', function () { function calculateAge(birthday) { // birthday is a date var ageDifMs = Date.now() - birthday.getTime(); var ageDate = new Date(ageDifMs); // miliseconds from epoch return Math.abs(ageDate.getUTCFullYear() - 1970); } function monthDiff(d1, d2) { if (d1 < d2) { if (d2.getMonth() > d1.getMonth()) { var months = d2.getMonth() - d1.getMonth(); } else { var months = (12 - d1.getMonth()) + d2.getMonth(); } return months <= 0 ? 0 : months; } return 0; } return function (birthdate) { if (!birthdate) return ''; if (birthdate.indexOf('-') == 0) { return ''; } birthdate = parseDate(birthdate); var age = calculateAge(birthdate); if (age == 0) return monthDiff(birthdate, new Date()) + ' months old'; return age + ' years old'; }; }) .filter('strLimit', function () { return function (content, limit) { if (content) { content = content.substring(0, limit); } return content; }; }) .filter('thousandSuffix', function () { return function (number, fractionSize) { if (isNaN(number) || number === null) return null; if (number === 0) return "0"; if (number <= 9999) { return number; } if (!fractionSize || fractionSize < 0) fractionSize = 2; var abs = Math.abs(number); var rounder = Math.pow(10, fractionSize); var isNegative = number < 0; var key = ''; var powers = [ {key: "Q", value: Math.pow(10, 15)}, {key: "T", value: Math.pow(10, 12)}, {key: "B", value: Math.pow(10, 9)}, {key: "M", value: Math.pow(10, 6)}, {key: "K", value: 1000} ]; for (var i = 0; i < powers.length; i++) { var reduced = abs / powers[i].value; reduced = Math.round(reduced * rounder) / rounder; if (reduced >= 1) { abs = reduced; key = powers[i].key; break; } } return (isNegative ? '-' : '') + abs + key; }; }) /*.filter('thousandSuffix', function () { return function (number) { var ret; if(number>9999){ var abs = Math.abs(number); var key = ''; var powers = [ {key: "q", value: Math.pow(10,15)}, {key: "t", value: Math.pow(10,12)}, {key: "b", value: Math.pow(10,9)}, {key: "m", value: Math.pow(10,6)}, {key: "k", value: 1000} ]; var num=0; var keyType; for(var i = 0; i < powers.length; i++) { if (number >= powers[i].value) { keyType=powers[i].key; num=number/powers[i].value; break; } } sNumber = num.toString(); //NUMBER CONVERT TO STRING if(sNumber.indexOf(".")!=-1) { // IF NUMBER HOLD POINT THEN EXECUTE THIS BLOCK var arr= sNumber.split('.'); var firstValue=arr[0]; var lastValue=''; if(firstValue.length<3) { if(firstValue.length>1) { lastValue=arr[1].substring(0, 1); } else { var subStr=arr[1].substring(0, 2); if(subStr.length<2) { // SUPPOSE 1.20M lastValue=subStr+"0"; } else { lastValue=subStr; } } finalVal=firstValue+"."+lastValue; } else { finalVal=firstValue; //SUPPOSE POINT IS AFTER 3 DIGITS EXAMPLE :: 121.1234 } } else { finalVal=sNumber; } ret=finalVal+""+keyType } else { ret=number } return ret; }; })*/ .filter('domain', [function () { return function (input) { var elements = angular.element('<a href="' + input + '"/>'); return elements[0].hostname; }; }]) .filter('markupHTMLTags', ["$sce", function ($sce) { return function (text) { return $sce.trustAsHtml(text); }; }]) .filter('htmlToPlaintext', function () { return function (text) { return text ? String(text).replace(/<[^>]+>/gm, '') : ''; } }) .filter('elapsed', ["$filter", function ($filter) { return function (date) { if (!date) return; var time = Date.parse(date), timeNow = new Date().getTime(), difference = timeNow - time, seconds = Math.floor(difference / 1000), minutes = Math.floor(seconds / 60), hours = Math.floor(minutes / 60), days = Math.floor(hours / 24); if (days > 7) { return $filter('date')(time, "MMMM d 'at' h:mm a"); } else if (days > 1) { return days + " days ago"; } else if (days == 1) { return "1 day ago" } else if (hours > 1) { return hours + " hours ago"; } else if (hours == 1) { return "an hour ago"; } else if (minutes > 1) { return minutes + " minutes ago"; } else if (minutes == 1) { return "a minute ago"; } else { return "a few seconds ago"; } } }]) .filter('dateTimeFormat', ["$filter", function ($filter) { return function (date) { if (!date) return; var time = Date.parse(date), timeNow = new Date().getTime(), difference = timeNow - time, seconds = Math.floor(difference / 1000), minutes = Math.floor(seconds / 60), hours = Math.floor(minutes / 60), days = Math.floor(hours / 24); return $filter('date')(time, "MMMM d 'at' h:mm a"); } }]) .filter('formatDistance', function () { return function (distance) { var formattedDistance = parseFloat(distance); if (formattedDistance > 1) { formattedDistance = formattedDistance.toFixed(1) + "km"; } else { formattedDistance = formattedDistance * 1000; formattedDistance = parseInt(formattedDistance) + "m"; } return formattedDistance; }; }) .filter('cut', function () { return function (value, wordwise, max, tail) { if (!value) return ''; max = parseInt(max, 10); if (!max) return value; if (value.length <= max) return value; value = value.substr(0, max); if (wordwise) { var lastspace = value.lastIndexOf(' '); if (lastspace != -1) { //Also remove . and , so its gives a cleaner result. if (value.charAt(lastspace - 1) == '.' || value.charAt(lastspace - 1) == ',') { lastspace = lastspace - 1; } value = value.substr(0, lastspace); } } return value + (tail || ' ...'); }; }) .filter('newlines', function () { return function (text) { return text.replace(/\n/g, '<br/>'); } }) ; /*------ Application Services ------*/ angular.module('app') .factory('refreshService', ['$http', function ($http) { return { userData: function () { var url = 'angular/auth-json'; return $http.post(url).then(function (response) { return response.data; }); }, notification: function (page, perpage) { perpage = perpage > 1 ? perpage : 10; var url = 'api/notification'; var postData = { page: page, perpage: perpage }; return $http.post(url, postData).then(function (response) { return response.data; }); }, top_search: function () { var url = 'api/top-search'; var postData = {}; return $http.post(url, postData).then(function (response) { return response.data; }); } }; }]) .factory('notify', [function () { return function (notification) { var type = notification.type ? notification.type : 'flip'; var timeout = notification.timeout ? notification.timeout : 3000; /* | Placement of the notification | top, top-left, top-right, bottom-right */ var position = notification.position ? notification.position : 'top-right'; var message = notification.message; // Message to display inside the notification // error, info, warning var color = notification.color ? notification.color : 'info'; switch (type) { case 'bar': // Show an bar notification attached to top and bottom of the screen $('body').pgNotification({ style: 'bar', message: message, position: position, timeout: timeout, type: color }).show(); break; case 'flip': // Show a flipping notification animated // using CSS3 transforms and animations $('body').pgNotification({ style: 'flip', message: message, position: position, timeout: timeout, type: color }).show(); break; case 'simple': // Simple notification having bootstrap's .alert class $('body').pgNotification({ style: 'simple', message: message, position: position, timeout: timeout, type: color }).show(); break; } }; }]) //Local Storage Service //Author:Alapan Chatterjee; Date:25-01-2017 .service('myLocalStorage', ["localStorageService", function (localStorageService) { return { submit: function (key, val) { return localStorageService.set(key, val); }, getItem: function (key) { return localStorageService.get(key); }, getAllKeys: function () { return localStorageService.keys(); }, removeItem: function (key) { return localStorageService.remove(key); }, clearAll: function () { return localStorageService.clearAll(); } }; }]) //Distance Calculaton between two given sets of ltitude and longitude //Author:Alapan Chatterjee; Date:26-01-2017 .service('haversineDistanceCalculationService', function () { return { findDistance: function (latitudeFrom, longitudeFrom, latitudeTo, longitudeTo) { var radius = 6371; var toRad = function (x) { return (x * Math.PI) / 180; }; if (latitudeFrom == '' || longitudeFrom == '' || latitudeTo == '' || longitudeTo == '') { return null; } var x1 = latitudeTo - latitudeFrom; var dLat = toRad(x1); var x2 = longitudeTo - longitudeFrom; var dLon = toRad(x2); var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(toRad(latitudeFrom)) * Math.cos(toRad(latitudeTo)) * Math.sin(dLon / 2) * Math.sin(dLon / 2); var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); var d = radius * c; return d; } }; }) .service('userDataService', ["$stateParams", "$http", "$state", function ($stateParams, $http, $state) { // load user details and update user date . var userData = []; return { loadUserData: function () { var url = 'angular/profileList'; var data = {} if ($stateParams.username) { data = {username: $stateParams.username}; } return $http.post(url, data).then(function (response) { userData = response.data; return userData; }, function (error) { window.location.href = "error-404"; }); }, updateUserData: function (user_points) { userData.user.points = user_points; }, getData: function () { return userData; } }; }]) .service('inArray', function () { this.arrayIndexOf = function (array, value) { var index = -1; if (angular.isArray(array)) { angular.forEach(array, function (val, key) { if (val == value) { index = key; return false; } }); } return index; } }); /* POST CARD SHARE POPUP SHOW HIDE */ $("body").on("click", ".shrClk", function () { var shrClk = $(".shrClk"); shrClk.parent().children(".subOverlay").hide(); shrClk.parent().children(".sub").hide(); $(this).parent().children(".subOverlay").show(); $(this).parent().children(".sub").show(); }); $("body").on("click", ".subOverlay", function () { $(this).hide(); $(this).parent().children(".sub").hide(); }); $("body").on("click", ".cardSmNav .sub ul li", function () { var shrClk = $(".shrClk"); shrClk.parent().children(".subOverlay").hide(); shrClk.parent().children(".sub").hide(); }); /* Report comment box */ $("body").on("click", ".comntInlineModal a", function () { if (!$(this).parent().children().children(".reporPopupVW").is(":visible")) { $('.reporPopupVW').hide(); $(this).parent().children().children(".reporPopupVW").show(); } else { $('.reporPopupVW').hide(); } }); $(document).click(function (e) { var containerList = $('.comntInlineModal a'); if (!containerList.is(e.target) && containerList.has(e.target).length == 0) { $('.reporPopupVW').hide(); } }); $("body").on("click", ".cardSmNav.last .moreBtnN", function () { $('.profileCommentFooter.addNew .left, .profileCommentFooter.addNew .right').addClass("show2"); $(this).parent().parent(".right").removeClass("show2"); }); $("body").on("click", ".subOverlay", function () { $('.profileCommentFooter.addNew .left, .profileCommentFooter.addNew .right').removeClass("show2"); }); /* VIDEO PLAY PAUSE */ /* $("body").on("mouseenter",".blockContent .profileCommentBox", function() { //console.log("Video Play"); if($(this).find(".videoTag").is(":visible")){ $(this).find(".videoTag").parent().children(".customPlayPause").addClass("out"); $(this).find(".videoTag")[0].play(); }else if($(this).find(".iframeTag").is(":visible")){ //console.log("Youtube Play"); //$('.iframeTag')[0].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*'); } }); $("body").on("mouseleave",".blockContent .profileCommentBox", function() { //console.log("Video Pause"); $(".videoTag")[0].pause(); $(".videoTag").parent().children(".customPlayPause").removeClass("out"); //$('.iframeTag')[0].contentWindow.postMessage('{"event":"command","func":"' + 'pauseVideo' + '","args":""}', '*'); }); */ /* $("body").on("mouseover",".profileCommentBox", function () { $(this).find('.iframeTag')[0].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*'); }); $("body").on("mouseout",".profileCommentBox", function () { $(this).find('.iframeTag')[0].contentWindow.postMessage('{"event":"command","func":"' + 'pauseVideo' + '","args":""}', '*'); }); */ /* $("body").on("click",".saveDel", function () { if(!$(this).children(".saveIcon").is(":visible")){ $(this).children(".saveIcon").css({"display":"inline-block"}); $(this).children(".savedIcon").css({"display":"none"}); }else{ $(this).children(".saveIcon").css({"display":"none"}); $(this).children(".savedIcon").css({"display":"inline-block"}); } }); */ /* Suggested Users Remove */ $("body").on("click", ".suggestedUsers .cls", function () { $(".suggestedUsers").remove(); }); $("body").on("click", ".suggestedUsers .floBtn .followBtn", function () { if (!$(this).children(".ico").is(":visible")) { $(this).children("span").css({"display": "none"}); $(this).children(".ico").css({"display": "block"}); } else { $(this).children("span").css({"display": "block"}); $(this).children(".ico").css({"display": "none"}); } }); $("body").on("click", ".exploreDropdown .navTl", function () { if (!$(this).next("ul").is(":visible")) { $(this).next("ul").css({"display": "block"}); } else { $(this).next("ul").css({"display": "none"}); } }); $(document).click(function (e) { var exploreNAV = $('.exploreDropdown .navTl'); if (!exploreNAV.is(e.target) && exploreNAV.has(e.target).length == 0) { $('.exploreDropdown ul').css({"display": "none"}); } }); //Profile userlinks /* $("body").on("click", ".usrLinkArrow", function () { $(this).addClass("sl"); $(".profileUserShow").addClass("vw"); $(".userOwnLinksArea").css({"height": "auto"}); }); $("body").on("click", ".usrLinkArrow.sl", function () { $(this).removeClass("sl"); $(".profileUserShow").removeClass("vw"); $(".userOwnLinksArea").css({"height": "1px"}); }); */ $("body").on("click", ".profileUserShow .userBox", function () { $(".profileUserShow").addClass("vw"); $(".usrLinkArrow").addClass("sl"); $(".userOwnLinksArea").css({"height": "auto"}); }); $("body").on("click", ".profileUserShow.vw", function () { $(".profileUserShow").removeClass("vw"); $(".usrLinkArrow").removeClass("sl"); $(".userOwnLinksArea").css({"height": "1px"}); }); $("body").on("click", ".profileUserShow", function () { if($(window).width() <= 641){ $(".profileUserShow").addClass("vw"); $(".usrLinkArrow").addClass("sl"); $(".userOwnLinksArea").css({"height": "auto"}); } }); $("body").on("click", ".profileUserShow.vw", function () { if($(window).width() <= 641){ $(".profileUserShow").removeClass("vw"); $(".usrLinkArrow").removeClass("sl"); $(".userOwnLinksArea").css({"height": "1px"}); } }); $("body").on("click", ".customSelbox", function () { $(this).next(".customSelectListCont").fadeIn(300); $("html").addClass("categoryovr"); }); $("body").on("click", ".selectOvrlay, .customSelectList .cls", function () { $(".customSelectListCont").fadeOut(300); $("html").removeClass("categoryovr"); }); $("body").on("click", ".customSelectList ul li", function () { /*var thisvalue = $(this).html(); $(this).parent().parent().parent().parent().children().children(".form-control").html(thisvalue);*/ $(".customSelectListCont").fadeOut(300); $("html").removeClass("categoryovr"); }); $(window).on('load', function(){ var headr = $('.coverPhoto'); var range = 120; $(window).on('scroll', function(){ var scrollTop = $(this).scrollTop(), height = headr.height(), offset = height / 2, calc = 1 - (scrollTop - offset + range) / range; calc2 = 1 - calc; $('.header').css({'background':'rgba(255,255,255,' +calc2+')'}); if (calc2 <= 1) { $('.header').css({'background':'rgba(255,255,255,0)'}); } else if ( calc2 >= 2 ) { $('.header').css({'background':'rgba(255,255,255,1)'}); } }); }); /* * Code for comment box. */ (function () { 'use strict'; CommentBoxCtrl.$inject = ["$scope", "$http", "$rootScope", "$timeout", "inArray", "$state", "postOpened", "notify"]; angular.module('app') .directive('commentBox', function () { return { restrict: 'E', templateUrl: 'tpl.comment-box', replace: true, controller: 'CommentBoxCtrl', // controllerAs: 'ctrl' }; }) .controller('CommentBoxCtrl', CommentBoxCtrl); function CommentBoxCtrl($scope, $http, $rootScope, $timeout, inArray, $state, postOpened, notify) { // Initialize comments array. $scope.comments = []; $scope.typingText = ''; $scope.opened_nodes = []; $scope.postComment = function (post_id, child_post_id) { var $parentMsg = $("#parentMsg"); var msg = $parentMsg.val(); var message = msg.replace(/(?:\r\n|\r|\n)/g, '<br />'); if (message == '') { $parentMsg.attr('required', true); alert('Please write something!'); return false; } /*if ($scope.activeItem != 2) { setTimeout(function () { // for new comments $scope.sortByComments(2, post_id); }, 500); }*/ $scope.showSendBtn = false; //For Loading effect. $scope.showSendingBtn = true; var postData = { parent_id: 0, message: message, post_id: post_id, child_post_id: child_post_id }; $http.post('comments/post-comment', postData) .then(function (response) { $("#parentMsg").val(''); // for reset message box $scope.message = ''; $scope.showSendBtn = true; // Remove loading effect . $scope.showSendingBtn = false; // Load comments. if ($scope.activeItem == 1) { $scope.sortByComments(2, post_id); } } ); }; // reply post comments. var cnt = 1; $scope.postReplyComment = function (id) { var elm = angular.element("#commentfrm" + id); var $textarea = elm.find("textarea[name='message']"); var msg = $textarea.val(); var message = msg.replace(/(?:\r\n|\r|\n)/g, '<br />'); if (message == '') { $textarea.attr('required', true); alert('Please write something!'); return false; } var parent_id = elm.find("input[name='parent_id']").val(); var child_post_id = elm.find("input[name='child_post_id']").val(); var post_id = elm.find("input[name='post_id']").val(); $("#send" + id).hide(); $("#sending" + id).show(); $("#sendBtnLoading" + id).prop('disabled', true); var postData = { message: message, parent_id: parent_id, child_post_id: child_post_id, post_id: post_id }; $http.post('comments/post-child-comment', postData) .then(function (response) { $("#sendBtnLoading" + id).prop('disabled', false); $("#send" + id).show(); $("#sending" + id).hide(); } ); elm.find("textarea[name='message']").val(''); elm.find("textarea[class='modalMsg']").val(''); $scope.displayBlock = 0; }; $scope.deleteComments = function (comment_id, parent_id, postId) { var postData = { comment_id: comment_id, parent_id: parent_id, postId: postId }; $http.post('comments/delete', postData) .then(function (response) { $('#commentDeleteModal').modal('toggle'); }, function (error) { var notification = { 'message': 'Sorry! unable to process your request.', 'color': 'error', 'timeout': 5000 }; notify(notification); } ); }; $scope.moreComments = function (post_id, sortType) { // var totalCommentsOnView = $scope.comments.length < 10 ? $scope.comments.length : 10; var totalCommentsOnView = $scope.comments.length; var offsetx = totalCommentsOnView; $http({ method: "POST", url: "angular/showLoadMoreComments", params: { post_id: post_id, offsetx: offsetx, sortType: sortType, showAll: 'showAll' } }).then(function (response) { var getComments = response.data.allComments; var existingComments = []; if ($scope.comments && $scope.comments.length) { $scope.comments.forEach(function(c){ existingComments.push(c.id); }) } if (angular.isArray(getComments)) { angular.forEach(getComments, function (comment) { if (existingComments.indexOf(comment.id) === -1) { comment.message = emojione.toImage(comment.message); $scope.comments.push(comment); } }); } $scope.commentLimitTo = response.data.postParentComment; $scope.postTotalComment = response.data.postTotalComment; }); }; $scope.sortComments = '-created_at'; $scope.displayBlock = 0; $scope.showdiv = 0; $scope.showReplyBox = function (commentId, postId, activeItem) { var dataArray = $scope.comments; // Close the reply box. if($("#cmmtextAreaBlock"+commentId).is(":visible")) { var allFullComments = $scope.spliceNodeAtpos(commentId,$scope.fullComments); $scope.comments = allFullComments; $("#cmmtextAreaBlock"+commentId).css("display","none"); } // Open the reply box. else { $http({ method: 'POST', url: "angular/loadChildComments", data: { commentId: commentId, post_id: postId, activeItem : activeItem } }) .then(function (response) { var all_comments = response.data.allComments; var allFullComments = addReplies(commentId, $scope.fullComments, all_comments); $scope.comments = allFullComments; }, function (error) { console.log('Error has occurred'); }); $(".cmmtextAreaType").css("display","none"); $("#cmmtextAreaBlock"+commentId).css("display","block"); } $scope.commentBoxId = commentId; // $scope.displayBlock = !$scope.displayBlock; }; // Recusrively find insertion postion and push data into array. function addReplies(nodeId, allCommentObj, objToBePushed) { angular.forEach(allCommentObj, function(value,index){ if(value.id == nodeId) { var existingComment = []; if(value.child_comment.length > 0) { value.child_comment.forEach(function(v) { existingComment.push(v.id); }) } if (objToBePushed.length > 0) { // Push the reply to child comment. angular.forEach(objToBePushed, function(v, k) { if (existingComment.indexOf(v.id) === -1) { value.child_comment.push(v); value.showRel = true; } }); } else { value.showRel = true; } } else { if(value.child_comment.length > 0) { addReplies(nodeId, value.child_comment, objToBePushed); } } }); return allCommentObj; } // Recusrively find child node postion and child node replace with empty data. $scope.spliceNodeAtpos = function (nodeId, allCommentObj) { angular.forEach(allCommentObj, function(value,index) { if(value.id == nodeId){ value.child_comment = []; value.showRel = false; } else { if(value.child_comment.length > 0){ $scope.spliceNodeAtpos(nodeId, value.child_comment); } } }); return allCommentObj; } // Comments load more $scope.sortByComments = function (sortType, postId) { // $scope.comments = {}; $scope.commentLimitTo = $scope.loadMoreCommentsLimit; $scope.showCommentLoader = 1; $scope.fullComments = []; var sendData=[]; switch (sortType) { case 1 : $scope.sortComments = "-total_upvotes"; $http({ method: 'POST', url: 'angular/showLoadMoreComments', params: {sortType: sortType, post_id: postId, offsetx: 0} }).then(function (response) { // for emoji var sendData=[]; var responseData=response.data.allComments; if(angular.isArray(responseData)){ angular.forEach(responseData,function(val,key) { responseData[key].message = emojione.toImage(responseData[key].message); sendData.push(responseData[key]); $scope.fullComments.push(responseData[key]); }); } $scope.comments = sendData; $scope.fullComments=sendData; // store data temp array $scope.post.postParentComment = response.data.postParentComment; $scope.postTotalComment = response.data.postTotalComment; $timeout(function () { $(".modal-split-view .split-list .item").removeClass('highLight'); }, 100); $timeout(function () { $scope.showCommentLoader = 0; }, 1600); }, function (error) { console.log('Error has occurred'); }); $scope.activeItem = 1; break; case 2 : $scope.sortComments = "-created_at"; $http({ method: 'POST', url: 'angular/showLoadMoreComments', params: {sortType: sortType, post_id: postId, offsetx: 0} }).then(function (response) { // for emoji var responseData=response.data.allComments; if(angular.isArray(responseData)){ angular.forEach(responseData,function(val,key) { responseData[key].message = emojione.toImage(responseData[key].message); sendData.push(responseData[key]); $scope.fullComments.push(responseData[key]); }); } $scope.comments = sendData; $scope.fullComments = sendData; // store data temp array $scope.post.postParentComment = response.data.postParentComment; $scope.postTotalComment = response.data.postTotalComment; setTimeout(function () { $(".modal-split-view .split-list .item").removeClass('highLight'); }, 200); /*$timeout(function () { $scope.showCommentLoader = 0; }, 1600);*/ $scope.activeItem = 2; $scope.showCommentLoader = 0; }, function (error) { $scope.activeItem = 2; $scope.showCommentLoader = 0; // console.log('Error has occurred'); } ); // $scope.activeItem = 2; break; } }; $scope.showCommentDeleteModal = function (comment_id, post_id, activeItem) { $rootScope.commentID = comment_id; $rootScope.postID = post_id; $rootScope.activeItem = activeItem; }; $scope.cancel = function () { $('#commentDeleteModal').modal('toggle'); }; $scope.commentUpAndDownVote = function (commentID, activityType, post_id) { var postData = { commentID: commentID, activityType: activityType, post_id: post_id }; $http.post('comments/vote', postData) .then(function (response) { // Nothing for now. }); }; /*------- Code for socket --------*/ if ($scope.loggedIn) { // Listen for usersTypingInChannel event postOpened.listenUsersTypingInChannelEvent(function(response) { // console.log(response); $scope.typingText = makeUserTypingText(response); }); // Listen for comment post event. postOpened.listenCommentPostedEvent(function(response) { // console.log(response); CommentPosted(response); }); // Listen for reply posted event. postOpened.listenReplyPostedEvent(function(response) { // console.log(response); ReplyPosted(response); }); // Listen for comment deleted event. postOpened.listenCommentDeletedEvent(function(response) { // console.log(response); CommentDeleted(response); }); // Listen for comment voted event. postOpened.listenCommentVotedEvent(function(response) { // console.log(response); CommentVoted(response); }); } /*-------------- Operations -----------------*/ function makeUserTypingText(response) { var typingText = ''; if (!$scope.loggedIn) { return typingText; } var users = response.users; if (users) { // Remove current user. users.some(function (el, index) { if (el.id == $scope.user.id) { users.splice(index, 1); } }); } var userLength = users.length; if (userLength > 0) { if (userLength == 1) { typingText = response.users[0].name + ' is typing...'; } else if (userLength == 2) { typingText = response.users[0].name + ' and ' + response.users[1].name + ' are typing...'; } else { typingText = response.users[0].name + ' and ' + (userLength - 1) + ' others are typing...'; } } return typingText; } function getRootCommentID(comments, comment_id) { var root_comment_id; if (comments) { comments.every(function(comment) { if (comment.id == comment_id) { root_comment_id = comment.id; return false; } else if(comment.child_comment.length > 0) { // returns id or undefined var childId = getRootCommentID(comment.child_comment, comment_id); if (childId) { root_comment_id = comment.id; return false; } } return true; }); } return root_comment_id; } function CommentPosted(response) { // Add last reply to comments array. if ($scope.activeItem == 2) { var comment = response.data.lastComment; var existingComment = []; if ($scope.comments.length > 0) { $scope.comments.forEach(function(v) { existingComment.push(v.id); }); } if (existingComment.indexOf(comment.id) === -1) { comment.message = emojione.toImage(comment.message); $scope.comments.unshift(comment); } } // For postcard number of comments updates if (angular.isArray($scope.commonData.allPosts)) { angular.forEach($scope.commonData.allPosts, function (value, key) { if (value.id == response.data.lastComment.post_id) { value.totalComments = response.data.postParentComment; return false; } }); } $scope.postTotalComment = response.data.postTotalComment; if ($scope.post) { $scope.post.postParentComment = response.data.postParentComment; } else { $scope.post = {}; $scope.post.postParentComment = response.data.postParentComment; } } function ReplyPosted(response) { var lastComment = response.data.lastComment; var isCommenter = $scope.user.id == lastComment.user_id; // Add last reply to comments array. if ($scope.activeItem == 2 || isCommenter) { lastComment.message = emojione.toImage(lastComment.message); var isNotified = pushReplyComment($scope.comments, lastComment, isCommenter); // Highlight root comment if not highlighted already // in case not parent node is not available. // console.log('isNotified: ' + isNotified + ' isCommenter: ' + isCommenter); if (!isNotified && !isCommenter) { // Add class for background. if ($scope.comments) { var rootNode = $('#pc' + lastComment.root_comment_id); addAndRemoveBackground(rootNode, 5000); } } } // For postcard update all posts array. if (angular.isArray($scope.commonData.allPosts)) { angular.forEach($scope.commonData.allPosts, function (value, key) { if (value.id == response.data.lastComment.post_id) { $scope.commonData.allPosts[key].totalComments = response.data.postParentComment; return false; } }); } $scope.postTotalComment = response.data.postTotalComment; if ($scope.post) { $scope.post.postParentComment = response.data.postParentComment; } else { $scope.post = {}; $scope.post.postParentComment = response.data.postParentComment; } } function CommentDeleted(response) { var comment_id = response.data.comment_id, parent_id = response.data.parent_id, post_id = response.post_id, user_id = response.data.user_id; // Check if commenter. var isCommenter = $scope.user.id == user_id; if ($scope.activeItem == 2 || isCommenter) { // Remove comment from array. // console.log($scope.comments); removeComment($scope.comments, comment_id); // update no of child comment to $scope. countChildComment($scope.comments, comment_id, parent_id); } // Update all posts array. if (angular.isArray($scope.commonData.allPosts)) { angular.forEach($scope.commonData.allPosts, function (value, key) { if (value.id == post_id) { $scope.commonData.allPosts[key].totalComments = response.data.postParentComment; return false; } }); } $rootScope.popUpTotalComments = response.data.postTotalComment; if ($scope.post) { $scope.post.postParentComment = response.data.postParentComment; } else { $scope.post = {}; $scope.post.postParentComment = response.data.postParentComment; } } function CommentVoted(response) { var activityType = response.data.activityType, comment = response.data.comment, user_id = response.data.user_id; // Check if commenter. var isCommenter = $scope.user.id == user_id; if ($scope.activeItem == 2 || isCommenter) { // add vote to comments array. voteComment($scope.comments, comment, user_id, activityType); } /*var commentsArray = $scope.comments; if (angular.isArray(commentsArray)) { angular.forEach(commentsArray, function (value, key) { if (value.id == comment.id) { $scope.comments[key].total_upvotes = parseInt(comment.upvotes) - parseInt(comment.downvotes); } }); }*/ // Update user total comments on profile tab if ($state.current.name == 'profile' || $state.current.name == 'account') { if ($scope.userData && $scope.userData.id == comment.user_id) { $scope.userData.points = response.data.post_user_points; } } if (angular.isArray($scope.post.getUser)) { angular.forEach($scope.post.getUser, function (value, key) { if (value.id == comment.user.id) { $scope.post.getUser[key].points = comment.user.points; } }); } } /*------------ functions for comment array ----------------*/ // Remove comment from comments array. function removeComment(comments, comment_id) { angular.forEach(comments, function(value, index){ if(value.id == comment_id) { comments.splice(index, 1); } else { if(value.child_comment.length > 0){ removeComment(value.child_comment, comment_id); } } }); return comments; } // Update no of child comment to $scope. function countChildComment(comments, comments_id, parent_id) { angular.forEach(comments, function(value, index){ if(value.id == parent_id) { value.count_child = value.child_comment.length; } else { if(value.child_comment.length > 0){ countChildComment(value.child_comment, comments_id, parent_id); } } }); return comments; } // Add reply to comments array. function pushReplyComment(comments, lastComment, isCommenter) { var isNotified = false; angular.forEach(comments, function (comment, index) { if(comment.id == lastComment.parent_id) { // Check whether to show in real time. if (comment.showRel || isCommenter) { var existingComment = []; if(comment.child_comment.length > 0) { comment.child_comment.forEach(function(v) { existingComment.push(v.id); }) } // Push the reply to child comment. if (existingComment.indexOf(lastComment.id) === -1) { comment.child_comment.unshift(lastComment); // Highlight new comment if parent node expanded. if (!isCommenter) { isNotified = true; setTimeout(function() { // Add class for background var commentNode = $('#pc' + lastComment.id); addAndRemoveBackground(commentNode, 5000); }, 100); } } } else { isNotified = true; // Add class for background var parentNode = $('#pc' + lastComment.parent_id); addAndRemoveBackground(parentNode, 5000); } comment.count_child = lastComment.parentCommentTotalchildPost; } else { if(comment.child_comment.length > 0) { isNotified = pushReplyComment(comment.child_comment, lastComment, isCommenter); } } }); return isNotified; } // Add upvote/downvote to comments array. function voteComment(comments, comment, comment_user_id, activityType) { var comment_id = comment.id; angular.forEach(comments, function(value,index) { if(value.id == comment_id) { var isCommenter = $scope.user.id == comment_user_id; if (activityType == 1) { // For cancel comment upvotes .... if(value.isUpvote == 'Y') { if (isCommenter) { value.isUpvote = 'N'; } // value.upvotes = parseInt(value.upvotes) - 1; } else { if (isCommenter) { value.isUpvote = 'Y'; } // value.upvotes = parseInt(value.upvotes)+1 if(value.isDownvote == 'Y') { if (isCommenter) { value.isUpvote = 'N'; } // value.downvotes = parseInt(value.downvotes)-1; } } } else { // For cancel comment downvotes .... if(value.isDownvote == 'Y') { if (isCommenter) { value.isUpvote = 'N'; } // value.downvotes = parseInt(value.downvotes) - 1; } else { if (isCommenter) { value.isUpvote = 'Y'; } // value.downvotes = parseInt(value.downvotes) + 1; if(value.isUpvote == 'Y') { if (isCommenter) { value.isUpvote = 'N'; } // value.upvotes = parseInt(value.upvotes) - 1; } } } value.upvotes = comment.upvotes; value.downvotes = comment.downvotes; return ''; } else { if(value.child_comment.length > 0){ voteComment(value.child_comment, comment, comment_user_id, activityType); } } }); } // Add class for background and remove after specified time. function addAndRemoveBackground(selector, time) { selector.addClass('sl'); setTimeout(function(){ selector.removeClass('sl'); }, time); } } })(); /* * @author <tuhin.tsm.mandal@gmail.com> */ (function () { 'use strict'; socket.$inject = ["$rootScope"]; angular .module('app') .factory('socket', socket); function socket($rootScope) { var socket = io.connect(); var service = {}; service.init = init; service.on = on; service.emit = emit; service.removeAllListeners = removeAllListeners; return service; function init() { socket.removeAllListeners(); } function on(eventName, callback) { socket.on(eventName, function () { var args = arguments; $rootScope.$apply(function () { callback.apply(socket, args); }); }); } function emit(eventName, data, callback) { socket.emit(eventName, data, function () { var args = arguments; $rootScope.$apply(function () { if (callback) { callback.apply(socket, args); } }); }) } function removeAllListeners(eventName) { socket.removeAllListeners(eventName); } } })(); /* * @author <tuhin.tsm.mandal@gmail.com> */ (function () { 'use strict'; postOpened.$inject = ["socket", "localStorageService"]; angular .module('app') .factory('postOpened', postOpened); function postOpened(socket, localStorageService) { var service = {}; service.init = init; service.listenUsersTypingInChannelEvent = listenUsersTypingInChannelEvent; service.userFollowedEvent = userFollowedEvent; service.userViewedEvent = userViewedEvent; service.userPointUpdatedEvent = userPointUpdatedEvent; service.trackPostOpened = trackPostOpened; service.listenPostViewUpdatedEvent = listenPostViewUpdatedEvent; service.listenPostPointUpdatedEvent = listenPostPointUpdatedEvent; service.listenPostUpvotedEvent = listenPostUpvotedEvent; service.listenPostSharedEvent = listenPostSharedEvent; service.listenPostBookmarkedEvent = listenPostBookmarkedEvent; service.listenCommentPostedEvent = listenCommentPostedEvent; service.listenCommentDeletedEvent = listenCommentDeletedEvent; service.listenReplyPostedEvent = listenReplyPostedEvent; service.listenCommentVotedEvent = listenCommentVotedEvent; return service; function init() { // socket.removeAllListeners('users_typing_here'); socket.removeAllListeners('user-followed'); socket.removeAllListeners('user-viewed'); socket.removeAllListeners('user-point-updated'); socket.removeAllListeners('post-view-updated'); socket.removeAllListeners('post-point-updated'); socket.removeAllListeners('post-upvoted'); socket.removeAllListeners('post-shared'); socket.removeAllListeners('post-bookmarked'); /*socket.removeAllListeners('comment-posted'); socket.removeAllListeners('reply-posted'); socket.removeAllListeners('comment-deleted'); socket.removeAllListeners('comment-voted');*/ } function trackPostOpened(post_id) { var opened_posts = localStorageService.get('opened_posts'); opened_posts = JSON.parse(opened_posts); if (opened_posts) { if (typeof opened_posts[post_id] == 'undefined') { opened_posts[post_id] = 1; } else { opened_posts[post_id] += 1; } } else { opened_posts = {}; opened_posts[post_id] = 1; } // Check current key. var opened_posts2 = localStorageService.get('opened_posts'); if (opened_posts2) { // console.log(opened_posts2); opened_posts2 = JSON.parse(opened_posts2); if (opened_posts['sk'] == opened_posts2['sk']) { // Save to local storage. opened_posts['sk'] = uuid4(); // console.log(opened_posts); localStorageService.set('opened_posts', JSON.stringify(opened_posts)); } else { // Try again. trackPostOpened(post_id); } } else { // Save to local storage. opened_posts['sk'] = uuid4(); // console.log(opened_posts); localStorageService.set('opened_posts', JSON.stringify(opened_posts)); } } function listenUsersTypingInChannelEvent(callback) { socket.on('users_typing_here', function(response) { callback(response); }); } /*--------- For real time data ---------*/ function userFollowedEvent(callback) { socket.on('user-followed', function(response) { callback(response); }); } function userViewedEvent(callback) { socket.on('user-viewed', function(response) { callback(response); }); } function userPointUpdatedEvent(callback) { socket.on('user-point-updated', function(response) { callback(response); }); } function listenPostViewUpdatedEvent(callback) { socket.on('post-view-updated', function(response) { callback(response); }); } function listenPostPointUpdatedEvent (callback) { socket.on('post-point-updated', function(response) { callback(response); }); } function listenPostSharedEvent (callback) { socket.on('post-shared', function(response) { callback(response); }); } function listenPostUpvotedEvent (callback) { socket.on('post-upvoted', function(response) { callback(response); }); } function listenPostBookmarkedEvent (callback) { socket.on('post-bookmarked', function(response) { callback(response); }); } /*------- For comments ---------*/ function listenCommentPostedEvent (callback) { socket.on('comment-posted', function(response) { callback(response); }); } function listenReplyPostedEvent (callback) { socket.on('reply-posted', function(response) { callback(response); }); } function listenCommentDeletedEvent (callback) { socket.on('comment-deleted', function(response) { callback(response); }); } function listenCommentVotedEvent (callback) { socket.on('comment-voted', function(response) { callback(response); }); } } })(); (function () { 'use strict'; TypingIndicator.$inject = ["socket"]; angular .module('app') .factory('TypingIndicator', TypingIndicator); function TypingIndicator(socket) { var setTypingState = _.debounce(function(channel, user, isTyping) { // console.info('set typing state: '+ isTyping +' through socket for post: ' +channel); socket.emit('user typing', { user: user, channel: channel, isTyping: isTyping }); }, 400); var startTyping = function(channel, user) { setTypingState(channel, user, true) }; var stopTyping = function(channel, user) { setTypingState(channel, user, false) }; return { startTyping: startTyping, stopTyping: stopTyping } } })(); /* * @author <tuhin.tsm.mandal@gmail.com> */ (function () { 'use strict'; requestProgress.$inject = ["socket"]; angular .module('app') .factory('requestProgress', requestProgress); function requestProgress(socket) { return { init: init, subscribe: subscribe, progress: progress }; function init() { // socket.removeAllListeners('subscribe_script_progress'); } function subscribe() { var data = { uuid: _uuid4 }; socket.emit('subscribe_script_progress', data); } function progress(callback) { socket.on('script-progressed', function(response) { callback(response); }); } } })(); /** * Created by tuhin on 21/3/17. */ (function () { 'use strict'; saveToLocalService.$inject = ["$http"]; angular .module('app') .factory('saveToLocalService', saveToLocalService); function saveToLocalService($http) { // interface var service = { image: image }; return service; // implementation function image(link) { var data = {link: link}; return $http.post('/api/saveImageToLocal', data).then(function (response) { return response.data; }, function (response) { return response.data; }); } } })(); angular.module('app').constant('YT_event', { STOP: 0, PLAY: 1, PAUSE: 2, STATUS_CHANGE: 3 }); angular.module('app').directive('youtube', ["YT_event", "youTubeApiService", "$interval", "constants", function (YT_event, youTubeApiService, $interval, constants) { return { restrict: "E", /* $scope: { height: "@", width: "@", videoid: "@", index: "@", viewVideoPost : '&viewVideoPost' }, */ template: '<div></div>', link: function ($scope, element, attrs, $rootScope) { console.log('Hello Youtube Iframe'); var tag = document.createElement('script'); tag.src = "https://www.youtube.com/iframe_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); console.log(firstScriptTag); /*------------------*/ // var index = attrs.index; // var playerName = $parse('player' + index); var prefix = attrs.type == 'C' ? 'yc-' : 'yo-'; var index = prefix + $scope.post.cardID; var player, playerTimer; youTubeApiService.onReady(function () { // console.log(index); player = tsmPlayerPool[index] = setupPlayer($scope, element); }); function setupPlayer($scope, element) { return new YT.Player(element.children()[0], { playerVars: { autoplay: 0, html5: 1, theme: "light", modesbranding: 0, color: "white", iv_load_policy: 3, showinfo: 1, controls: 1 }, height: $scope.height, width: $scope.width, videoId: attrs.videoid, events: { 'onStateChange': function (event) { var message = { event: YT_event.STATUS_CHANGE, data: "" }; switch (event.data) { case YT.PlayerState.PLAYING: message.data = "PLAYING"; playerTimer = $interval(function () { videoPaused(); }, 100); break; case YT.PlayerState.ENDED: message.data = "ENDED"; $interval.cancel(playerTimer); break; case YT.PlayerState.UNSTARTED: message.data = "NOT PLAYING"; break; case YT.PlayerState.PAUSED: message.data = "PAUSED"; $interval.cancel(playerTimer); break; } /*$scope.$apply(function() { $scope.$emit(message.event, message.data); });*/ } } }); } $scope.$on("$destroy", function() { $interval.cancel(playerTimer); player.destroy(); }); /*$scope.$watch('height + width', function (newValue, oldValue) { if (newValue == oldValue) { return; } player.setSize($scope.width, $scope.height); }); $scope.$watch('videoid', function (newValue, oldValue) { if (newValue == oldValue) { return; } player.cueVideoById($scope.videoid); }); $scope.$on(YT_event.STOP, function () { player.seekTo(0); player.stopVideo(); }); $scope.$on(YT_event.PLAY, function () { player.playVideo(); }); $scope.$on(YT_event.PAUSE, function () { player.pauseVideo(); }); */ var isPlayed = false; function videoPaused() { var ct = player.getCurrentTime(); var vDuration = player.getDuration(); // var vData = player.getVideoData(); if (ct >= vDuration * constants.VIDEO_VIEW_PER && !isPlayed) { console.log('recording..'); $scope.viewVideoPost($scope.post); isPlayed = true; } } } }; }]); angular.module('app').factory("youTubeApiService", ["$q", "$window", function ($q, $window) { var deferred = $q.defer(); var apiReady = deferred.promise; $window.onYouTubeIframeAPIReady = function () { deferred.resolve(); } return { onReady: function (callback) { apiReady.then(callback); } } }]); angular.module('app').directive('typeTracking', ["TypingIndicator", "$timeout", "$stateParams", function (TypingIndicator, $timeout, $stateParams) { return { restrict: 'A', //scope: false, link: function (scope, element, attrs) { element.bind('keyup', function (event) { if (event.keyCode == 13 && event.shiftKey) { event.stopPropagation(); } else if (event.keyCode == 13) { var $btn = element.parent('div').children('button'); if (!$btn.is(":disabled")) { element.parent('div').children('button').trigger('click'); } else { $(this).val(''); scope.$digest(); var c = this.selectionStart; c--; this.setSelectionRange(c, c); } } element.parent('div').children('button').click(function () { scope.message = ''; if (scope.isCurrentlyTyping) { // console.log('Flush the scheduler and stop typing'); // Stop typing immediatly scope.stopTypingScheduler.flush(); scope.isCurrentlyTyping = false; } }); }); scope.$watch(attrs['ngModel'], function (input) { // When to start Typing ? // Content is not empty and was not typing before if (!_.isEmpty(input) && !scope.isCurrentlyTyping) { // console.log('startTyping()'); TypingIndicator.startTyping(scope.conversationChannel, scope.channelUser); scope.isCurrentlyTyping = true; scope.stopTypingScheduler(); // console.log('SCHEDULE stopTypingScheduler() in 5 seconds'); } // When to reschedule ? // when the input is not empty and you are typing else if (!_.isEmpty(input) && scope.isCurrentlyTyping) { // console.log('RE-SCHEDULE call to stopTypingScheduler() in 5 seconds'); scope.stopTypingScheduler(); scope.isCurrentlyTyping = true; } // When to stop typing ? // You erase the input : You were typing and the input is now empty else if (scope.isCurrentlyTyping && _.isEmpty(input)) { // console.log('Flush the scheduler and stop typing'); // Stop typing immediatly scope.stopTypingScheduler.flush(); scope.isCurrentlyTyping = false; } }); }, controller: ["$scope", function ($scope) { $scope.conversationChannel = $scope.post.id; $scope.channelUser = { id: $scope.user.id, name: $scope.user.first_name + ' ' + $scope.user.last_name }; // Time before the stop typing event is fired after stopping to type. $scope.stopTypingTime = 5000 // Keep track of the last action // This boolean is useful in order to know if we should send a stopTyping event in case the user was previously typing. $scope.isCurrentlyTyping = false; // Scheduler that trigger stopTyping if the function has not been invoced after stopTypingTime $scope.stopTypingScheduler = _.debounce(function () { TypingIndicator.stopTyping($scope.conversationChannel, $scope.channelUser); $scope.isCurrentlyTyping = false; }, $scope.stopTypingTime) }] }; }]); /* ============================================================ * Directive: pgSidebar * AngularJS directive for Pages Sidebar jQuery plugin * ============================================================ */ angular.module('app') .directive('pgSidebar', function() { return { restrict: 'A', link: function(scope, element, attrs) { var $sidebar = $(element); $sidebar.sidebar($sidebar.data()); // Bind events // Toggle sub menus $('body').on('click', '.sidebar-menu a', function(e) { if ($(this).parent().children('.sub-menu') === false) { return; } var el = $(this); var parent = $(this).parent().parent(); var li = $(this).parent(); var sub = $(this).parent().children('.sub-menu'); if(li.hasClass("active open")){ el.children('.arrow').removeClass("active open"); sub.slideUp(200, function() { li.removeClass("active open"); }); }else{ parent.children('li.open').children('.sub-menu').slideUp(200); parent.children('li.open').children('a').children('.arrow').removeClass('active open'); parent.children('li.open').removeClass("open active"); el.children('.arrow').addClass("active open"); sub.slideDown(200, function() { li.addClass("active open"); }); } }); } } }); /* ============================================================ * Directive: csSelect * AngularJS directive for SelectFx jQuery plugin * https://github.com/codrops/SelectInspiration * ============================================================ */ angular.module('app') .directive('csSelect', function() { return { restrict: 'A', link: function(scope, el, attrs) { if (!window.SelectFx) return; var el = $(el).get(0); $(el).wrap('<div class="cs-wrapper"></div>'); new SelectFx(el); } }; }); /* ============================================================ * Directive: pgDropdown * Prepare Bootstrap dropdowns to match Pages theme * ============================================================ */ angular.module('app') .directive('pgDropdown', function() { return { restrict: 'A', link: function(scope, element, attrs) { var btn = $(element).find('.dropdown-menu').siblings('.dropdown-toggle'); var offset = 0; var padding = btn.actual('innerWidth') - btn.actual('width'); var menuWidth = $(element).find('.dropdown-menu').actual('outerWidth'); if (btn.actual('outerWidth') < menuWidth) { btn.width(menuWidth - offset); $(element).find('.dropdown-menu').width(btn.actual('outerWidth')); } else { $(element).find('.dropdown-menu').width(btn.actual('outerWidth')); } } } }); /* ============================================================ * Directive: pgFormGroup * Apply Pages default form effects * ============================================================ */ angular.module('app') .directive('pgFormGroup', function() { return { restrict: 'A', link: function(scope, element, attrs) { $(element).on('click', function() { $(this).find(':input').focus(); }); $('body').on('focus', '.form-group.form-group-default :input', function() { $('.form-group.form-group-default').removeClass('focused'); $(this).parents('.form-group').addClass('focused'); }); $('body').on('blur', '.form-group.form-group-default :input', function() { $(this).parents('.form-group').removeClass('focused'); if ($(this).val()) { $(this).closest('.form-group').find('label').addClass('fade'); } else { $(this).closest('.form-group').find('label').removeClass('fade'); } }); $(element).find('.checkbox, .radio').hover(function() { $(this).parents('.form-group').addClass('focused'); }, function() { $(this).parents('.form-group').removeClass('focused'); }); } } }); /* ============================================================ * Directive: pgNavigate * Pre-made view ports to be used for HTML5 mobile hybrid apps * ============================================================ */ angular.module('app') .directive('pgNavigate', function() { return { restrict: 'A', link: function(scope, element, attrs) { $(element).click(function() { var el = $(this).attr('data-view-port'); if ($(this).attr('data-toggle-view') != null) { $(el).children().last().children('.view').hide(); $($(this).attr('data-toggle-view')).show(); } $(el).toggleClass($(this).attr('data-view-animation')); return false; }); } } }); /* ============================================================ * Directive: pgPortlet * AngularJS directive for Pages Portlets jQuery plugin * ============================================================ */ angular.module('app') .directive('pgPortlet', ['$parse', function($parse) { return { restrict: 'A', scope: true, link: function(scope, element, attrs) { var onRefresh = $parse(attrs.onRefresh); var options = {}; if (attrs.progress) options.progress = attrs.progress; if (attrs.overlayOpacity) options.overlayOpacity = attrs.overlayOpacity; if (attrs.overlayColor) options.overlayColor = attrs.overlayColor; if (attrs.progressColor) options.progressColor = attrs.progressColor; if (attrs.onRefresh) options.onRefresh = function() { onRefresh(scope); }; element.portlet(options); } } }]); /* ============================================================ * Directive: pgTab * Makes Bootstrap Tabs compatible with AngularJS and add sliding * effect for tab transitions. * ============================================================ */ angular.module('app') .directive('pgTab', ['$parse', function($parse) { return { link: function(scope, element, attrs) { var slide = attrs.slide; var onShown = $parse(attrs.onShown); // Sliding effect for tabs $(element).on('show.bs.tab', function(e) { e = $(e.target).parent().find('a[data-toggle=tab]'); var hrefCurrent = e.attr('href'); if ($(hrefCurrent).is('.slide-left, .slide-right')) { $(hrefCurrent).addClass('sliding'); setTimeout(function() { $(hrefCurrent).removeClass('sliding'); }, 100); } }); $(element).on('shown.bs.tab', { onShown: onShown }, function(e) { if (e.data.onShown) { e.data.onShown(scope); } }); $(element).click(function(e) { e.preventDefault(); $(element).tab('show'); }); } }; }]); /* ============================================================ * Directive: pgSearch * AngularJS directive for Pages Overlay Search jQuery plugin * ============================================================ */ angular.module('app') .directive('pgSearch', ['$parse', function($parse) { return { restrict: 'A', link: function(scope, element, attrs) { $(element).search(); scope.$on('toggleSearchOverlay', function(scopeDetails, status) { if(status.show){ $(element).data('pg.search').toggleOverlay('show'); } else { $(element).data('pg.search').toggleOverlay('hide'); } }) } } }]); /* ============================================================ * Directive: pgQuickview * AngularJS directive for Pages Overlay Search jQuery plugin * ============================================================ */ angular.module('app') .directive('pgQuickview', ['$parse', function($parse) { return { restrict: 'A', link: function(scope, element, attrs) { var $quickview = $(element) $quickview.quickview($quickview.data()) } } }]); /* ============================================================ * Directive: pgNotificationCenter * Shows a list of notifications in a dropdown in header * ============================================================ */ angular.module('app') .directive('pgNotificationCenter', function() { return { restrict: 'A', link: function(scope, element, attrs) { $(element).on('click', function(event) { event.stopPropagation(); }); $(element).find('.toggle-more-details').on('click', function(event) { var p = $(this).closest('.heading'); p.closest('.heading').children('.more-details').stop().slideToggle('fast', function() { p.toggleClass('open'); }); }); } } }); /* ============================================================ * Directive: pgHorizontalMenu * AngularJS directive for Pages Horizontal Menu * ============================================================ */ angular.module('app') .directive('pgHorizontalMenu', ["$parse", function($parse) { return { restrict: 'A', link: function(scope, element, attrs) { $(document).on('click', '.horizontal-menu .bar-inner > ul > li', function(){ $(this).toggleClass('open').siblings().removeClass('open'); }); $('.content').on('click', function () { $('.horizontal-menu .bar-inner > ul > li').removeClass('open'); }); } } }]); angular.module('app') .directive('pgHorizontalMenuToggle', ["$parse", function($parse) { return { restrict: 'A', link: function(scope, element, attrs) { $(element).click(function(e) { e.preventDefault(); $('body').toggleClass('menu-opened'); }); } } }]); /* ============================================================ * Directive: pgTabDropdownfx * Responsive Tabs with dropdown effect * effect for tab transitions. * ============================================================ */ angular.module('app') .directive('pgTabDropdownfx', function() { return { link: function(scope, element, attrs) { var drop = $(element); drop.addClass("hidden-sm hidden-xs"); var content = '<select class="cs-select cs-skin-slide full-width" data-init-plugin="cs-select">' for(var i = 1; i <= drop.children("li").length; i++){ var li = drop.children("li:nth-child("+i+")"); var selected =""; if(li.hasClass("active")){ selected="selected"; } content +='<option value="'+ li.children('a').attr('href')+'" '+selected+'>'; content += li.children('a').text(); content += '</option>'; } content +='</select>' drop.after(content); var select = drop.next()[0]; $(select).on('change', function (e) { var optionSelected = $("option:selected", this); var valueSelected = this.value; drop.find('a[href="'+valueSelected+'"]').tab('show') }) $(select).wrap('<div class="nav-tab-dropdown cs-wrapper full-width p-t-10 visible-xs visible-sm"></div>'); new SelectFx(select); } }; }); /* ============================================================ * directives.js * All common functionality & their respective directive * ============================================================ */ angular.module('app') .directive('postcardModal', function () { return { restrict: 'EA', templateUrl: "tpl_postcardmodal", link: function ($scope, element, attrs) { element.bind('click', function (event) { $scope.$apply(attrs.postcardModal); }); } }; }); angular.module('app') .directive('postcard', function () { return { restrict: 'A', link: function ($scope, element, attrs) { element.bind('click', function (event) { $scope.$apply(attrs.postcard); }); }, controller: ["$scope", "$http", "$timeout", "inArray", "$state", function ($scope, $http, $timeout, inArray, $state) { // Open share popup.. $scope.popUpDropdrow = 0; $scope.openSharePostPopUp = function (post_id) { }; /*---------- Open popUp drop down menu when user click on .... sing ----------------------- */ // This function user for postcard modal and post card details .. $scope.report = function (post) { var $newShrBtns = $(".newShrBtns"); $newShrBtns.find(".otherSubsh").show(); $newShrBtns.find(".subOverlaysh").show(); // alert('clicked'); // if($newShrBtns.find(".otherSubsh").parents('.profileCommentBoxTop').hasClass('has-big-zindex')){ // $newShrBtns.find(".otherSubsh").parents('.profileCommentBoxTop').removeClass('has-big-zindex') // } else { // $newShrBtns.find(".otherSubsh").parents('.profileCommentBoxTop').addClass('has-big-zindex') // } var flag = 0; if ($state.current.name == 'profile') { if (post.child_post_user_id != $scope.user.id) { flag = 1; } else { flag = 0; } } else if ($state.current.name == 'account') { if (post.created_by != $scope.user.id) { flag = 1; } else { flag = 0; } } else { if (post.created_by == $scope.user.id || post.child_post_user_id == $scope.user.id) { flag = 0; } else { flag = 1; } } $scope.isShowPostReportLink = flag; }; $scope.closeOverLayout = function () { $(".subOverlaysh , .otherSubsh").hide(); }; }] }; }); angular.module('app') .directive('webscrolling', function () { return { restrict: 'A', link: function (scope, element, attrs) { element.bind("scroll", function () { var scrollTopHeightM = 5; var scrollOuterPosM = $(".modalMobileScroll > .row").offset().top - 38; var scrollOuterPosnewM = Math.abs(scrollOuterPosM) var scrollPercentM = 100 * (scrollOuterPosnewM - scrollTopHeightM) / ($("#myModal .profileNewLeft").height() - $(".modalMobileScroll").height()); if ($(".profileNewLeft").innerHeight() >= $(".modalMobileScroll").innerHeight() && scrollOuterPosM <= 0) { $(".mobileBarLong").css("width", scrollPercentM + "%"); } }); } } }); angular.module('app') .directive('webscrolling2', function () { return { restrict: 'A', link: function (scope, element, attrs) { $(window).bind("scroll", function () { var scrollTopHeightM2 = 5; var scrollOuterPosM2 = $("body").scrollTop() - 38; var scrollOuterPosnewM2 = Math.abs(scrollOuterPosM2) var scrollPercentM2 = 100 * (scrollOuterPosnewM2 - scrollTopHeightM2) / ($(".cardDetailsPG_modal .profileNewLeft").height() - $(window).height()); if ($(".cardDetailsPG_modal .profileNewLeft").innerHeight() >= $(window).height() && scrollOuterPosM2 >= 0) { $(".mobileBarLong2").css("width", scrollPercentM2 + "%"); } }); } } }); /* ====================================================================== * Directive: OTHERS , DELETE POSTCARD MODAL AND REPORT POST CARD MODAL * Prepare Bootstrap dropdowns to match Pages theme * ===================================================================== */ angular.module('app') .directive('postCardMenu', ["$rootScope", "$http", function ($rootScope, $http) { return { restrict: 'E', link: function ($scope, element, attrs) { $scope.openDeletePostModal = function (post_id) { $rootScope.mypostid = post_id; $scope.closeOverLayout(); }; // Report post. $scope.openReportPostModal = function (post_id) { // Initialize. $rootScope.report_post_ids = []; $rootScope.reportPostModalLoader = true; var url = '/api/fetchReportPostData'; var postData = { post_id: post_id }; $http.post(url, postData) .then(function (response) { var report_ids = response.data.report_ids; if (report_ids.length > 0) { report_ids.forEach(function (v) { $rootScope.report_post_ids.push(v); }); } $rootScope.reportPostModalLoader = false; }, function (response) { $rootScope.reportPostModalLoader = false; } ); $rootScope.mypostid = post_id; $scope.closeOverLayout(); }; // After clicking downvote then postcard other will be closed $scope.closeOverLayout = function () { $scope.popUpDropdrow = 0; $scope.popUpReportDropdrow = 0; }; }, templateUrl: 'tpl.post-card-menu' }; }]); angular.module('app') .directive('deletePostModal', ["$http", function ($http) { return { restrict: 'E', link: function ($scope, element, attrs) { // Delete postcard and also their child postcard also.. $scope.deleteMyPost = function (post_id) { $scope.disableClick = true; $http({ method: 'POST', url: "angular/deleteMyPost", params: {post_id: post_id} }).then(function (response) { location.href = 'profile'; }, function (response) { alert('Sorry! we cannot process your request.'); }); } }, templateUrl: 'tpl_deletePostModal' }; }]); angular.module('app') .directive('reportPostModal', function () { return { restrict: 'E', link: function (scope, element, attrs) { }, templateUrl: 'tpl_reportPostModal', controller: ["$scope", "$log", "$http", function ($scope, $log, $http) { $scope.doPostReport = function (post_id, report_id) { $("#reportPostModal").modal("toggle"); $http({ method: 'POST', url: "angular/doPostReport", params: { post_id: post_id, report_id: report_id } }).then(function (response) { }, function (response) { // $log.info('Some error is occurred.'); }); } }] }; }); /* ============================================================ * Directive: POST UPVOTES AND DOWNVOTES * Prepare Bootstrap dropdowns to match Pages theme * ============================================================ */ angular.module('app') .directive('upvotes', function () { return { restrict: 'A', link: function (scope, element, attrs) { element.bind('click', function (event) { scope.$apply(attrs.upvotes); }); }, controller: ["$scope", "$http", "inArray", "$state", "userDataService", function ($scope, $http, inArray, $state, userDataService) { $scope.doUpvotes = function (post_id, childPostId, type) { // Dynamic binding new edition 24-11-2016 if (angular.isArray($scope.commonData.allPosts)) { angular.forEach($scope.commonData.allPosts, function (value, key) { if (value.id == post_id) { if ($scope.commonData.allPosts[key].isUpvote == 'N') { $scope.commonData.allPosts[key].isUpvote = 'Y'; $scope.commonData.allPosts[key].upvotes = $scope.commonData.allPosts[key].upvotes + 1; } else { $scope.commonData.allPosts[key].isUpvote = 'N'; //console.log('2'); $scope.commonData.allPosts[key].upvotes = $scope.commonData.allPosts[key].upvotes - 1; } if ($scope.commonData.allPosts[key].isDownvote == 'Y') { $scope.commonData.allPosts[key].downvotes = $scope.commonData.allPosts[key].downvotes - 1; $scope.commonData.allPosts[key].isDownvote = 'N'; } } }); } // For postcard if (type == 'M') { if ($scope.post.isUpvote == 'N') { $scope.post.isUpvote = 'Y'; $scope.post.upvotes = $scope.post.upvotes + 1 // Update post point on modal :: // if logged in user and post creator is same then point is not update if ($scope.post.created_by != $scope.user.id) { $scope.post.points = $scope.post.points + 2; } } else { $scope.post.isUpvote = 'N'; $scope.post.upvotes = $scope.post.upvotes - 1 // Update post point on modal :: // if logged in user and post creator is same then point is not update if ($scope.post.created_by != $scope.user.id) { $scope.post.points = $scope.post.points - 2; } } if ($scope.post.isDownvote == 'Y') { $scope.post.downvotes = $scope.post.downvotes - 1; $scope.post.isDownvote = 'N'; // Update post point on modal :: // if downvote cancel then execute ... // if logged in user and post creator is same then point is not update if ($scope.post.created_by != $scope.user.id) { $scope.post.points = $scope.post.points + 2; } } } // end Dynamic binding new edition 24-11-2016 $http({ method: "POST", url: "angular/upVotePost", params: {post_id: post_id, childPostId: childPostId} }).then(function (response) { if (!$scope.post) { $scope.post = {}; $scope.post.user = {}; } /* ============================================================ * For Updating profile points * ============================================================ */ if (angular.isArray($scope.post.getUser)) { angular.forEach($scope.post.getUser, function (value, key) { angular.forEach(response.data.user, function (val, k) { if (value.id == val.id) { $scope.post.getUser[key].points = val.points; } }); }); } // For updateing profile points if ($state.current.name == 'profile' || $state.current.name == 'account') { if ($scope.userData.id != $scope.user.id) { var user_points = response.data.user[0].points; userDataService.updateUserData(user_points); userDataService.getData(); } } }); }; $scope.doDownVotes = function (post_id, childPostId, type) { // Dynamic binding new edition 24-11-2016 if (angular.isArray($scope.commonData.allPosts)) { angular.forEach($scope.commonData.allPosts, function (value, key) { if (value.id == post_id) { if ($scope.commonData.allPosts[key].isDownvote == 'N') { $scope.commonData.allPosts[key].isDownvote = 'Y'; $scope.commonData.allPosts[key].downvotes = $scope.commonData.allPosts[key].downvotes + 1; } else { $scope.commonData.allPosts[key].isDownvote = 'N'; $scope.commonData.allPosts[key].downvotes = $scope.commonData.allPosts[key].downvotes - 1; } if ($scope.commonData.allPosts[key].isUpvote == 'Y') { $scope.commonData.allPosts[key].upvotes = $scope.commonData.allPosts[key].upvotes - 1; $scope.commonData.allPosts[key].isUpvote = 'N'; } } }); } // For postcard if (type == 'M' || type == 'PD') { // M for modal if ($scope.post.isDownvote == 'N') { $scope.post.isDownvote = 'Y'; $scope.post.downvotes = $scope.post.downvotes + 1 // Update post point on modal :: // if logged in user and post creator is same then point is not update if ($scope.post.created_by != $scope.user.id) { $scope.post.points = $scope.post.points - 2; } } else { $scope.post.isDownvote = 'N'; $scope.post.downvotes = $scope.post.downvotes - 1 // Update post point on modal :: // if logged in user and post creator is same then point is not update if ($scope.post.created_by != $scope.user.id) { $scope.post.points = $scope.post.points + 2; } } if ($scope.post.isUpvote == 'Y') { $scope.post.upvotes = $scope.post.upvotes - 1; $scope.post.isUpvote = 'N'; // Update post point on modal :: // if upvote cancel then execute ... // if logged in user and post creator is same then point is not update if ($scope.post.created_by != $scope.user.id) { $scope.post.points = $scope.post.points + 2; } } } // Dynamic binding new edition 24-11-2016 $http({ method: "POST", url: "angular/downVotePost", params: {post_id: post_id, childPostId: childPostId} }).then(function (response) { if (!$scope.post) { $scope.post = {}; $scope.post.user = {}; } /* ============================================================ * For Updating profile points * * ============================================================ */ if (angular.isArray($scope.post.getUser)) { angular.forEach($scope.post.getUser, function (value, key) { angular.forEach(response.data.user, function (val, k) { if (value.id == val.id) { $scope.post.getUser[key].points = val.points; } }); }); } // For updateing profile points if ($state.current.name == 'profile' || $state.current.name == 'account') { if ($scope.userData.id != $scope.user.id) { var user_points = response.data.user[0].points; userDataService.updateUserData(user_points); userDataService.getData(); } } $(".subOverlaysh , .otherSubsh").hide(); }); }; }] }; }); /* ============================================================ * Directive: Open share post modal, share post * Prepare Bootstrap dropdowns to match Pages theme * ============================================================ */ angular.module('app') .directive('sharepostCard', function () { return { restrict: 'E', templateUrl: "tpl.sharepost-card", link: function (scope, element, attrs) { }, controller: ["$scope", "$http", "$timeout", function ($scope, $http, $timeout) { // Initialize privacies.. $scope.privacies = {}; // Fetch privacies.. $http.get('api/privacy').then(function (response) { if (response.data) { $scope.privacies = response.data; $scope.privacy_id = $scope.privacies[0]; } }); $scope.sharePopUp = function (post_id, childPostUserId, childPostId, is_openFromPostcardModal) { $scope.sharedPost = {}; var url = 'angular/showPostDetails'; var postData = { post_id: post_id, child_post_id: childPostId, is_briefed: 1, initiator: 'share_popup' }; $http.post(url, postData) .then(function (response) { $scope.sharedPost = response.data.post; // $scope.loginUser = response.data.user; $scope.popUpDropdrow = 0; $scope.postId = post_id; $scope.caption = ''; $scope.postUserId = childPostUserId; $scope.childPostId = childPostId; // find original post creator :: var postModalUser = response.data.post.getUser; angular.forEach(postModalUser, function (value, key) { $scope.originalPostUserName = value.username; $scope.originalPostFirstName = value.first_name; $scope.originalPostLastName = value.last_name; $scope.originalPostProfileImage = value.thumb_image_url; $scope.originalPostUserColor = (value.id % 2 == 0) ? 's1' : 's0'; }); $timeout(function () { angular.element("#shareModal").modal(); angular.element(".subOverlay").triggerHandler("click"); $timeout(function () { angular.element("html").addClass("scrollHidden"); angular.element("body").addClass("modal-open"); }, 1000); if (is_openFromPostcardModal == 1) { $("#myModal").modal("toggle"); } }, 100); }); }; }] }; }); angular.module('app') .directive('share', ["notify", "$state", function (notify, $state) { return { restrict: 'A', link: function (scope, element, attrs) { element.bind('click', function () { scope.$apply(attrs.share); }); }, controller: ["$scope", "$http", "$timeout", function ($scope, $http, $timeout) { $scope.shareThisPost = function (post_id, childPostId, postUserId) { $http({ method: "POST", url: "angular/shareThisPost", params: { caption: $scope.caption, post_id: $scope.postId, profile_id: postUserId, childPostId: childPostId, privacy_id: $scope.privacy_id } }).then(function (response) { $("#shareModal").modal('toggle'); $(".sharedSuccessLoader").show(); $timeout(function () { $(".sharedSuccessLoader").hide(); }, 2000); $timeout(function () { var notification = { 'message': 'You have successfully re-share this post.', 'color': 'success', 'timeout': 5000 }; notify(notification); }, 2100); $timeout(function () { $state.go("profile"); }, 3000); }); }; }] }; }]); /* ============================================================ * Directive: Postview Scrolling * ============================================================ */ angular.module('app') .directive('viewpost', ["userDataService", function (userDataService) { return { restrict: "A", link: function (scope, element, attrs) { element.bind("click", function () { scope.$apply(attrs.viewpost); }); }, controller: ["$scope", "$http", "$window", "$state", function ($scope, $http, $window, $state) { $scope.externalLink = function (postID, childPostID) { $http({ method: "POST", url: "angular/viewPost", data: { postID: parseInt(postID), childPostID: childPostID, postType: 4 } }).then(function (response) { // userData is update on proilfe or account . if ($state.current.name == 'profile' || $state.current.name == 'account') { var points = response.data.post.getUsers[0].points; userDataService.updateUserData(points); userDataService.getData(); } // Update dynamically total number of post view var p; for (p in $scope.commonData.allPosts) { if ($scope.commonData.allPosts[p].id == postID) { $scope.commonData.allPosts[p].totalPostViews = response.data.post.totalPostViews; // break; } } // update user points dynamically on popup........ if (angular.isArray($scope.post.getUser)) { angular.forEach($scope.post.getUser, function (value, key) { angular.forEach(response.data.post.getUsers, function (val, k) { if (value.id == val.id) { $scope.post.getUser[key].points = val.points; } }); }); } // update total access on popup :: $scope.post.totalPostViews = response.data.post.totalPostViews; $scope.post.points = response.data.post.points; // $window.open(external_link, '_blank'); }, function (error) { // console.log('Error occurred.'); }); }; }] }; }]); /* ============================================================ * Directive: PROFILE NAV SLIDER * ============================================================ */ angular.module('app') .directive('exploreTab', function () { return { restrict: 'E', templateUrl: "tpl_explore_tab" }; }); /*angular.module("app") .filter('displayBestTab', function () { return function (x) { }; });*/ /* ============================================================ * Directive: Follow users * ============================================================ */ angular.module('app') .directive('allfollowuser', function () { return { restrict: 'A', link: function ($scope, element, attrs) { element.bind('click', function (event) { $scope.$apply(attrs.allfollowuser); }); }, controller: ["$scope", "$http", "$timeout", "inArray", "$state", function ($scope, $http, $timeout, inArray, $state) { /* ============================================================ * Functionality: Profile page follow,unfollow only postcard modal * ============================================================ */ $scope.followUser = function (user_id, type, following) { // For instance update if ($state.current.name == 'profile' || $state.current.name == 'account') { if ($scope.userData.username == $scope.user.username) { if (inArray.arrayIndexOf($scope.userFollowing, user_id) != -1) { $scope.userFollowing.splice(inArray.arrayIndexOf($scope.userFollowing, user_id), 1); angular.isArray($scope.userData.following) { angular.forEach($scope.userData.following, function (val, key) { if (val.user_id == user_id) { $scope.userData.following.splice(key, 1); $scope.userDataTotalFollowing = $scope.userData.following.length; return false; } }); } $scope.userData.userDataTotalFollowing = $scope.userFollowing.length; if (angular.isArray($scope.post.getUser)) { angular.forEach($scope.post.getUser, function (value, key) { if (value.id === user_id) { $scope.post.getUser[key].is_follow = $scope.post.getUser[key].is_follow - 1; } }); } } else { $scope.userFollowing.push(parseInt(user_id)); $scope.userData.userDataTotalFollowing = $scope.userData.following.length; if (angular.isArray($scope.post.getUser)) { angular.forEach($scope.post.getUser, function (value, key) { if (value.id === user_id) { $scope.post.getUser[key].is_follow = $scope.post.getUser[key].is_follow + 1; } }); } } } else { if (inArray.arrayIndexOf($scope.userFollowing, user_id) != -1) { $scope.userFollowing.splice(inArray.arrayIndexOf($scope.userFollowing, user_id), 1); if (angular.isArray($scope.post.getUser)) { angular.forEach($scope.post.getUser, function (value, key) { if (value.id === user_id) { $scope.post.getUser[key].is_follow = $scope.post.getUser[key].is_follow - 1; } }); } $scope.resetPostData(); $scope.loadMore('all'); } else { $scope.userFollowing.push(parseInt(user_id)); if (angular.isArray($scope.post.getUser)) { angular.forEach($scope.post.getUser, function (value, key) { if (value.id === user_id) { $scope.post.getUser[key].is_follow = $scope.post.getUser[key].is_follow + 1; } }); } $scope.userData.userDataTotalFollower = $scope.userData.userDataTotalFollower + 1; $scope.resetPostData(); $scope.loadMore('all'); } } } else { if (inArray.arrayIndexOf($scope.userFollowing, user_id) != -1) { $scope.userFollowing.splice(inArray.arrayIndexOf($scope.userFollowing, user_id), 1); // start this block use for post detail page if ($scope.post && angular.isArray($scope.post.getUser)) { angular.forEach($scope.post.getUser, function (value, key) { if (value.id === user_id) { $scope.post.getUser[key].is_follow = $scope.post.getUser[key].is_follow - 1; } }); } } else { $scope.userFollowing.push(parseInt(user_id)); // start this block use for post detail page if ($scope.post && angular.isArray($scope.post.getUser)) { angular.forEach($scope.post.getUser, function (value, key) { if (value.id === user_id) { $scope.post.getUser[key].is_follow = $scope.post.getUser[key].is_follow + 1; } }); } } } // end $http({ method: "POST", url: "angular/followUser", params: {user_id: user_id, following: following} }).then(function (response) { if ($state.current.name == 'profile' || $state.current.name == 'account') { if ($scope.userData.username == $scope.user.username) { if (inArray.arrayIndexOf($scope.userFollowing, user_id) != -1) { } else { $scope.userData.following.push(response.data.getFollower); } } } }); }; /* ======================================================================= * Functionality: Follow user form follower tab . If login user follow from own profile then increase number of following * ====================================================================== */ $scope.followUserFromFollowerTab = function (user_id, type, following) { if ($scope.userData.username == $scope.user.username) { if (inArray.arrayIndexOf($scope.userFollowing, user_id) != -1) { $scope.userFollowing.splice(inArray.arrayIndexOf($scope.userFollowing, user_id), 1); $scope.userData.userDataTotalFollowing = $scope.userData.userDataTotalFollowing - 1; } else { $scope.userFollowing.push(parseInt(user_id)); $scope.userData.userDataTotalFollowing = $scope.userData.userDataTotalFollowing + 1; } } else { if (inArray.arrayIndexOf($scope.userFollowing, user_id) != -1) { $scope.userFollowing.splice(inArray.arrayIndexOf($scope.userFollowing, user_id), 1); } else { $scope.userFollowing.push(parseInt(user_id)); } } $http({ method: "POST", url: "angular/followUser", params: {user_id: user_id, following: following} }).then(function (response) { }); }; /* ======================================================================= Functionality: Follow user form following tab . If login user follow from own profile then increase number of following ====================================================================== */ $scope.followUserFromFollowingTab = function (user_id, type, following) { if ($scope.userData.username == $scope.user.username) { if (inArray.arrayIndexOf($scope.userFollowing, user_id) != -1) { $scope.userFollowing.splice(inArray.arrayIndexOf($scope.userFollowing, user_id), 1); $scope.userData.userDataTotalFollowing = $scope.userData.userDataTotalFollowing - 1; } else { $scope.userFollowing.push(parseInt(user_id)); $scope.userData.userDataTotalFollowing = $scope.userData.userDataTotalFollowing + 1; } } else { if (inArray.arrayIndexOf($scope.userFollowing, user_id) != -1) { $scope.userFollowing.splice(inArray.arrayIndexOf($scope.userFollowing, user_id), 1); } else { $scope.userFollowing.push(parseInt(user_id)); } } $http({ method: "POST", url: "angular/followUser", params: {user_id: user_id, following: following} }).then(function (response) { }); } /* ======================================================================= * Functionality: Follow user form timeline follow tab and tag page follow button * postcard and postcard modal * ====================================================================== */ $scope.followTab = function (user_id, type, following) { if (type == 'T') { if (inArray.arrayIndexOf($scope.userFollowing, user_id) != -1) { $scope.userFollowing.splice(inArray.arrayIndexOf($scope.userFollowing, user_id), 1); $scope.userData.userDataTotalFollower = $scope.userData.userDataTotalFollower - 1; $scope.resetPostData(); //$scope.loadMore('all'); setTimeout(function () { $scope.loadMore('all'); }, 500); } else { $scope.userFollowing.push(parseInt(user_id)); $scope.userData.userDataTotalFollower = $scope.userData.userDataTotalFollower + 1; $scope.resetPostData(); //$scope.loadMore('all'); setTimeout(function () { $scope.loadMore('all'); }, 500); } } $http({ method: "POST", url: "angular/followUser", params: {user_id: user_id, following: following} }).then(function (response) { }); } }] }; }); /* ============================================================ * Directive: Report comments * ============================================================ */ angular.module('app') .directive('reportCommentModal', function () { return { restrict: 'E', link: function (scope, element, attrs) { }, templateUrl: 'tpl_reportCommentModal', controller: ["$scope", "$log", "$http", function ($scope, $log, $http) { $scope.openReportCommentModal = function (comment_id) { // Initialize. $scope.report_comment_ids = []; $scope.reportCommentModalLoader = true; var url = '/api/fetchReportCommentData'; var postData = { comment_id: comment_id }; $http.post(url, postData) .then(function (response) { var report_ids = response.data.report_ids; if (report_ids.length > 0) { report_ids.forEach(function (v) { $scope.report_comment_ids.push(v); }); } $scope.reportCommentModalLoader = false; }, function () { $scope.reportCommentModalLoader = false; } ); $scope.comment_id = comment_id; $scope.closeOverLayout(); }; $scope.doCommentReport = function (commentId, reportId) { //$("#reportCommentModal").modal("toggle"); $('.reporPopupVW').hide(); $http({ method: 'POST', url: "angular/doCommentReport", data: { commentId: commentId, reportId: reportId } }).then(function (response) { }, function (response) { $log.info('Some error is occurred.'); }); } }] }; }); /* ============================================================ * Directive: Social sharing * Facebook Share API * ============================================================ */ angular.module('app') .directive('socialSharing', ["$window", "$http", "$interval", "notify", "$timeout", function ($window, $http, $interval, notify, $timeout) { return { restrict: "A", link: function ($scope, element, attrs) { element.bind('click', function (event) { $scope.$apply(attrs.socialSharing); }); $scope.facebook = function (post, type) { $window.fbAsyncInit = function () { FB.init({ appId: '1050589168353691', status: true, cookie: true, xfbml: true, version: 'v2.4' }); }; var obj = {}; var thumbnail = ''; obj.method = 'feed'; if (post.post_type == 5) { // :: For status post :: //StrippedString = OriginalString.replace(/(<([^>]+)>)/ig,""); obj.title = post.caption.replace(/(<([^>]+)>)/ig, ""); } else { if (post.title != '') { obj.title = post.title.replace(/(<([^>]+)>)/ig, ""); } else { obj.title = post.caption.replace(/(<([^>]+)>)/ig, ""); } } if (post.post_url != '') { obj.link = post.post_url; } if (post.post_type == 3) { // :: For article post :: if (post.short_description == '') { var OriginalString = post.content; var cont = OriginalString.replace(/(<([^>]+)>)/ig, ""); obj.description = cont.substr(0, 100); } else if (post.short_description != '') { obj.description = post.short_description; } else { obj.description = " "; } } else { if (post.short_description != '') { obj.description = post.short_description; } else { obj.description = " "; } } if (post.post_type == 1 || post.post_type == 3 || post.post_type == 4) { if (post.image != '') { obj.picture = post.image; } } else if (post.post_type == 2) { // For video post .. if (post.embed_code != '') { // for embed code if (post.embed_code_type == 'youtube') { var pic = 'https://img.youtube.com/vi/' + post.videoid + '/0.jpg'; obj.picture = pic; } else if (post.embed_code_type == 'dailymotion') { thumbnail = 'https://www.dailymotion.com/thumbnail/video/' + post.videoid; obj.picture = thumbnail; } else if (post.embed_code_type == 'vimeo') { thumbnail = 'https://i.vimeocdn.com/video/' + post.videoid + '_640.jpg'; obj.picture = thumbnail; } //obj.source=post.embed_code; } else if (post.video != '') { // html5 var video_poster = post.video_poster; obj.picture = video_poster; var url = post.video obj.source = url; } } else if (post.post_type == 5) { // for status post if (post.image != '') { obj.picture = post.image; } else { if (post.embed_code != '') { // for embed code if (post.embed_code_type == 'youtube') { var pic = 'https://img.youtube.com/vi/' + post.videoid + '/0.jpg'; obj.picture = pic; } else if (post.embed_code_type == 'dailymotion') { thumbnail = 'https://www.dailymotion.com/thumbnail/video/' + post.videoid; obj.picture = thumbnail; } else if (post.embed_code_type == 'vimeo') { thumbnail = 'https://i.vimeocdn.com/video/' + post.videoid + '_640.jpg'; obj.picture = thumbnail; } } else if (post.video != '') { // html5 var video_poster = post.video_poster; obj.picture = video_poster; var url = post.video; obj.source = url; } } } FB.ui(obj, function (response) { if (response && !response.error_message) { // update postcard total share ... if (angular.isArray($scope.commonData.allPosts)) { angular.forEach($scope.commonData.allPosts, function (value, key) { if (value.id == post.id) { $scope.commonData.allPosts[key].totalShare = $scope.commonData.allPosts[key].totalShare + 1; return false; } }); } // update postcard modal if (type == 'M') { if ($scope.user.id != $scope.post.child_post_user_id) { $scope.post.points = $scope.post.points + 10; } $scope.post.totalShare = $scope.post.totalShare + 1; $scope.post.totalFBshare = $scope.post.totalFBshare + 1; } $http({ method: 'POST', url: "sharedPostInSocialNetworkingForFacebook", data: { post_id: post.id, child_post_id: post.child_post_id, activityType: 4, // shared to facebook } }).then(function (response) { }, function (response) { console.log('Some error is occurred.'); }); } else { console.log('Error while posting.'); } }); }; // end of a function $window.$scope = $scope; $scope.twitter = function (post, card_type) { flag = 0; var callAjax = 0; if ($scope.user.guest == 0) { $http({ method: "POST", url: "accessTokenVerify", }).then(function (response) { flag = response.data; $scope.twitterPopUp(flag, post, card_type) }, function (eror) { console.log('some error has occurred'); }); } else { flag = 0; $scope.twitterPopUp(flag, post, card_type) } }; // end of a twitter function $scope.twitterPopUp = function (flag, post, card_type) { if (parseInt(flag) == 0) { var left = screen.width / 2 - 200; var top = screen.height / 2 - 250; var popup = $window.open('twitter_connect/' + 1, '', 'left=' + left + ',top=' + top + ',width=550,height=450,personalbar=0,toolbar=0,scrollbars=0,resizable=0'); var interval = 1000; // create an ever increasing interval to check a certain global value getting assigned in the var i = $interval(function () { interval += 500; try { // value is the user_id returned from paypal if (popup.value) { $interval.cancel(i); popup.close(); $scope.postToTwitter(post, card_type); } } catch (e) { console.error(e); } }, interval); } else { $scope.postToTwitter(post, card_type); } }; $scope.postToTwitter = function (post, card_type) { // **** start update scope data ***** // update postcard total share ... if (angular.isArray($scope.commonData.allPosts)) { angular.forEach($scope.commonData.allPosts, function (value, key) { if (value.id == post.id) { $scope.commonData.allPosts[key].totalShare = $scope.commonData.allPosts[key].totalShare + 1; return false; } }); } // update postcard modal if (card_type == 'M') { if ($scope.user.id != $scope.post.child_post_user_id) { $scope.post.points = $scope.post.points + 10; } $scope.post.totalShare = $scope.post.totalShare + 1; $scope.post.totalTwittershare = $scope.post.totalTwittershare + 1; } // ***** end update scope data ****** $timeout(function () { var notification = { 'message': 'You have successfully shared this post to twitter.', 'color': 'success', 'timeout': 5000 }; notify(notification); }, 2100); $http({ method: 'POST', url: "postToTwitter", data: { post_id: post.id, child_post_id: post.child_post_id, } }).then(function (response) { }, function (error) { console.log('Some error is occurred.'); }); }; }, } }]); /* ============================================================ * Directive: Prompt Sign in Box * Alert for Non logged in users * ============================================================ */ angular.module('app') .directive('promptSigninBox', function () { return { restrict: 'E', link: function ($scope, element, attrs) { }, templateUrl: 'tpl_promptSinginBox' }; }); /* ============================================================ * Directive: Book Mark * User can bookmark through * ============================================================ */ angular.module('app') .directive('bookMark', ["$http", function ($http) { return { restrict: "A", link: function ($scope, element, attrs) { element.bind('click', function (event) { $scope.$apply(attrs.bookMark); }); }, controller: ["$scope", function ($scope) { $scope.bookMarkProcess = function (postID, type) { // M : Modal ,P: Postcard if (angular.isArray($scope.commonData.allPosts)) { var isChange = 0; angular.forEach($scope.commonData.allPosts, function (value, key) { if ($scope.commonData.allPosts[key].id == postID) { if ($scope.commonData.allPosts[key].isBookMark == 'Y') { $scope.commonData.allPosts[key].isBookMark = 'N'; // For left panel update total book marks isChange = 1; } else { $scope.commonData.allPosts[key].isBookMark = 'Y'; // For left panel update total book marks isChange = 2; } return; } }); } if (type == 'M') { // Dynamick binding for postcard modal if ($scope.post.isBookMark == 'Y') { $scope.post.isBookMark = 'N'; $scope.post.totalBookMark = $scope.post.totalBookMark - 1; // post total bookmark isChange = 1; } else { $scope.post.isBookMark = 'Y'; $scope.post.totalBookMark = $scope.post.totalBookMark + 1; // post total book mark isChange = 2; } } // user total bookmark if (isChange == 1) { $scope.user.totalBookMarks = $scope.user.totalBookMarks - 1; } if (isChange == 2) { $scope.user.totalBookMarks = $scope.user.totalBookMarks + 1; } $http({ method: 'POST', url: "angular/bookmark", data: {postID: postID} }).then(function (response) { }, function (error) { console.log('Sorry! we cannot process your request.'); }); } }] }; }]); /* ============================================================ * Directive: Connect to social media * facebook * ============================================================ */ angular.module('app') .directive('connectSocialMedia', ["$window", "$http", "$interval", function ($window, $http, $interval) { return { restrict: 'A', link: function ($scope, element, attrs) { element.bind('click', function (event) { $scope.$apply(attrs.connectSocialMedia); }); // connect to facebook $window.$scope = $scope; $scope.connectFacebook = function () { var left = screen.width / 2 - 200; var top = screen.height / 2 - 250; var popup = $window.open('facebookLogin/', '', 'left=' + left + ',top=' + top + ',width=550,height=450,personalbar=0,toolbar=0,scrollbars=0,resizable=0'); var interval = 1000; // create an ever increasing interval to check a certain global value getting assigned in the var i = $interval(function () { interval += 500; try { // value is the user_id returned from paypal if (popup.value) { $interval.cancel(i); popup.close(); } } catch (e) { console.error(e); } }, interval); }; } }; }]); 'use strict'; /* Search Controllers */ angular.module('app') .controller('QuickSearchCtrl', ['$scope', '$state', '$timeout', '$window', 'constants', 'notify', 'refreshService', '$interval', function($scope, $state, $timeout, $window, constants, notify, refreshService, $interval) { setTimeout(function () { $('#overlay-search').on( "touchstart", function(){ $(this).trigger('mouseenter'); }); $('.popupsearch').on( "touchstart", function(){ $(this).children("input").trigger('mouseenter'); }); }, 600); $scope.showSearchInputLoader = false; $scope.search_min_len = constants.SEARCH_MIN_LEN; $scope.goToSearch = function() { $scope.showSearchInputLoader = true; $timeout(function() { if ($scope.search.query && $scope.search.query.length >= constants.SEARCH_MIN_LEN) { if ($state.current.name == 'search') { $window.location.href = 'search?q=' + $scope.search.query; } else { $state.go('search', {q: $scope.search.query}); } $timeout(function() { $scope.showSearchInputLoader = false; }, 2000); } else { $scope.showSearchInputLoader = false; var notification = { 'message': 'Please enter atleast ' + constants.SEARCH_MIN_LEN + ' characters to search.', 'color': 'error' }; notify(notification); } }, 1200); }; $scope.goToTopSearch = function (query) { $window.location.href = '/search?q=' + query; }; /*-------- Top 10 search ----------*/ $scope.topSearches = []; $scope.loadTopSearch = function () { refreshService.top_search().then(function(data) { if(data.length) { $scope.topSearches = []; data.forEach(function (keyword) { $scope.topSearches.push(keyword); }); } }); }; if ($scope.user && $scope.user.guest == 0) { // Load initially. $timeout(function () { $scope.loadTopSearch(); }, 2000); } // Trigger every 30 seconds for logged in user. $interval(function() { if ($scope.user && $scope.user.guest == 0) { $scope.loadTopSearch(); } }, 32000); }]) .controller('SearchCtrl', ['$scope', '$state', '$stateParams', '$http', '$timeout', '$location', 'notify', 'constants', function($scope, $state, $stateParams, $http, $timeout, $location, notify, constants) { // set the post id if (typeof $scope.search == 'undefined') { $scope.search = {}; } if ($stateParams.q) { $scope.search.query = $stateParams.q; } else { var notification = { 'message': 'Please enter at least ' + constants.SEARCH_MIN_LEN + ' characters to search.', 'color': 'error' }; notify(notification); } // Search tabs. $scope.currentTab = 'post'; $scope.searchNavItems = [ { name: 'Post', id: 'post' }, { name: 'Channel', id: 'channel' }, { name: 'Tag', id: 'tag' }, { name: 'Location', id: 'location' } ]; $scope.changeTab = function(index){ $("body").removeClass("wh"); $scope.currentTab = $scope.searchNavItems[index].id; if ($scope.currentTab == 'post') { $scope.startPositionCards(); setTimeout(function() { $scope.stopPositionCards(300); }, 1000); }else if ($scope.currentTab == 'tag' || $scope.currentTab == 'location') { $("body").addClass("wh"); } }; $scope.showSearchInputLoader = false; $scope.goToSearch = function() { $scope.showSearchInputLoader = true; $timeout(function() { if ($scope.search.query && $scope.search.query.length >= constants.SEARCH_MIN_LEN) { $scope.resetData(); $state.go('search', {q: $scope.search.query}); } else { $scope.noPostForSearch = true; $scope.showSearchInputLoader = false; var notification = { 'message': 'Please enter at least ' + constants.SEARCH_MIN_LEN + ' characters to search.', 'color': 'error' }; notify(notification); } }, 1200); }; $scope.searchTabFlickityOptions = { // wrapAround: true, cellAlign: 'center', freeScroll: true, wrapAround: false }; // Angulargrid options. $scope.agOptions = { gridWidth: 350, cssGrid: true, pageSize: 2, infiniteScrollDistance: 100, performantScroll: true, infiniteScrollDelay: 3000, gutterSize: 0, refreshOnImgLoad: true, }; // Initialize data. $scope.showFollowBtn = true; $scope.searchResults = []; $scope.showSearchLoader = false; $scope.noMorePost = false; $scope.noPostForSearch = false; $scope.tagFollowStatus = false; $scope.card_post_type = 'all'; $scope.hidePostFilter = false; $scope.commonData.allPosts = []; $scope.channelUsers = []; $scope.searchTags = []; $scope.places = []; var page = 1; $scope.resetData = function() { page = 1; $scope.busy = false; $scope.noMorePost = false; $scope.hidePostFilter = false; $scope.card_post_type = 'all'; $scope.searchResults = []; $scope.commonData.allPosts = []; $scope.channelUsers = []; $scope.searchTags = []; $scope.places = []; }; // Set post type. $scope.setPostType = function(card_post_type) { $scope.card_post_type = card_post_type; }; $scope.liveSearch = function() { $scope.resetData(); $scope.fetchPostData($scope.currentTab); }; var isFirstLoadMore = true; // Fetch the search results. $scope.fetchPostData = function(initiator) { // Return if initiator is not current tab. if (initiator != $scope.currentTab) { return; } // Minimum character needed for search. if (!$scope.search.query || $scope.search.query.length < constants.SEARCH_MIN_LEN) { $scope.noPostForSearch = true; return; } if ($scope.busy ) { isFirstLoadMore = false; return; } $scope.busy = true; // console.log('loading more data.. ' + initiator); // Do only for 1st page. if (page == 1) { // show loader. $scope.showSearchLoader = true; } // Fetch data from server. var payload = { q: $scope.search.query, orginal_query:$scope.search.query, //q: $scope.search.query.replace(/\s|\s+/g, '-').replace(/-{2,}/, '-').replace(/^\s+|\s+$/g,"").replace(/[^\w\s\-\,]/gi, ''), card_post_type: $scope.card_post_type, page: page }; $http.post('/api/search', payload) .then(function(response) { if (response.data.results) { $location.search('q', payload.q); // Change the page title. var title = encodeURIComponent(payload.q).replace(/%20/g, '+'); title += " | SWOLK SEARCH"; $scope.meta.title = title; $scope.searchResults = response.data.results; // Tag following status. $scope.tagFollowStatus = $scope.searchResults.tagFollowStatus == 1; // For posts tab. if ($scope.searchResults.posts.length < 1) { if (page === 1) { $scope.noPostForSearch = true; } else { $scope.noMorePost = true; } } else { // start positioning cards. // $scope.startPositionCards(); // start reloading masonry. //$scope.startReloadCardMasonry(); /* var allPostsTmp = angular.copy($scope.commonData.allPosts); allPostsTmp = allPostsTmp.concat($scope.searchResults.posts); $scope.commonData.allPosts = allPostsTmp;*/ $scope.searchResults.posts.forEach(function(post) { $scope.commonData.allPosts.push(post); }); } // For channel tab. if ($scope.searchResults.channelUsers.length < 1) { if (page === 1) { $scope.noChannelForSearch = true; } else { $scope.noMoreChannel = true; } } else { $scope.searchResults.channelUsers.forEach(function(user) { $scope.channelUsers.push(user); }); } // For tag tab. if ($scope.searchResults.searchTags.length < 1) { if (page === 1) { $scope.noTagForSearch = true; } else { $scope.noMoreTagSearch = true; } } else { $scope.searchResults.searchTags.forEach(function(user) { $scope.searchTags.push(user); }); } // For location tab. if ($scope.searchResults.places.length < 1) { if (page === 1) { $scope.noLocationForSearch = true; } else { $scope.noMoreLocationSearch = true; } } else { $scope.searchResults.places.forEach(function(place) { $scope.places.push(place); }); } } if (page == 1) { setTimeout(function() { $scope.showSearchLoader = false; }, 1000); } page++; $scope.busy = false; }, function(response) { $scope.busy = false; page++; $scope.showSearchLoader = false; } ); } // Follow or unfollow the tag. $scope.tagFollowUnfollow = function() { if ($scope.tagFollowBusy) { return; } $scope.tagFollowBusy = true; var url = 'api/tag-follow-unfollow'; var postData = { name: $scope.search.query }; $http.post(url, postData) .then(function(response) { var search_lower; if ($scope.search) { search_lower = $scope.search.query.toLowerCase(); search_lower = search_lower.regReplaceAll(' ', '-'); } if (response.data.status == 1) { $scope.tagFollowStatus = true; if ($scope.searchTags) { $scope.searchTags.forEach(function(tag){ if ($scope.search && tag.tag_name.toLowerCase() == search_lower) { tag.isFollow = 1; } }); } $scope.totalFollower += 1; } else { $scope.tagFollowStatus = false; $scope.searchTags.forEach(function(tag){ if (tag.tag_name.toLowerCase() == search_lower) { tag.isFollow = 0; } }); if ($scope.totalFollower > 0) { $scope.totalFollower -= 1; } } // Remove lock. $scope.tagFollowBusy = false; }, function (response) { $scope.tagFollowBusy = false; } ); } $scope.tagFollowEachBusy = false; // Follow or unfollow indivisual tag from tag tab. $scope.tagFollowUnfollowEach = function(tag) { if ($scope.tagFollowEachBusy) { return; } $scope.tagFollowEachBusy = true; var url = 'api/tag-follow-unfollow'; var postData = { name: tag.tag_name }; $http.post(url, postData) .then(function(response) { var search_lower = $scope.search.query.toLowerCase(); search_lower = search_lower.regReplaceAll(' ', '-'); if (response.data.status == 1) { tag.isFollow = 1; if ($scope.search && tag.tag_name.toLowerCase() == search_lower) { $scope.tagFollowStatus = true; } // $scope.users_count += 1; tag.users_count += 1; } else { tag.isFollow = 0; if ($scope.search && tag.tag_name.toLowerCase() == search_lower) { $scope.tagFollowStatus = false; } if (tag.users_count > 0) { tag.users_count -= 1; } } // Remove lock. $scope.tagFollowEachBusy = false; }, function (response) { $scope.tagFollowEachBusy = false; } ); } // Follow or unfollow the place. $scope.placeFollowUnfollow = function(place) { if ($scope.placeFollowBusy) { return; } $scope.placeFollowBusy = true; var postData = { place_url: place.place_url }; var url = 'api/place-follow-unfollow'; $http.post(url, postData) .then(function(response) { if (response.data.status == 1) { place.isFollow = 1; place.users_count += 1; } else { place.isFollow = 0; if (place.users_count > 0) { place.users_count -= 1; } } // Remove lock. $scope.placeFollowBusy = false; }, function (response) { $scope.placeFollowBusy = false; } ); }; }]); /* ng-infinite-scroll - v1.3.0 - 2016-06-30 */ angular.module('infinite-scroll', []).value('THROTTLE_MILLISECONDS', null).directive('infiniteScroll', [ '$rootScope', '$window', '$interval', 'THROTTLE_MILLISECONDS', function($rootScope, $window, $interval, THROTTLE_MILLISECONDS) { return { scope: { infiniteScroll: '&', infiniteScrollContainer: '=', infiniteScrollDistance: '=', infiniteScrollDisabled: '=', infiniteScrollUseDocumentBottom: '=', infiniteScrollListenForEvent: '@' }, link: function(scope, elem, attrs) { var changeContainer, checkInterval, checkWhenEnabled, container, handleInfiniteScrollContainer, handleInfiniteScrollDisabled, handleInfiniteScrollDistance, handleInfiniteScrollUseDocumentBottom, handler, height, immediateCheck, offsetTop, pageYOffset, scrollDistance, scrollEnabled, throttle, unregisterEventListener, useDocumentBottom, windowElement; windowElement = angular.element($window); scrollDistance = null; scrollEnabled = null; checkWhenEnabled = null; container = null; immediateCheck = true; useDocumentBottom = false; unregisterEventListener = null; checkInterval = false; height = function(elem) { elem = elem[0] || elem; if (isNaN(elem.offsetHeight)) { return elem.document.documentElement.clientHeight; } else { return elem.offsetHeight; } }; offsetTop = function(elem) { if (!elem[0].getBoundingClientRect || elem.css('none')) { return; } return elem[0].getBoundingClientRect().top + pageYOffset(elem); }; pageYOffset = function(elem) { elem = elem[0] || elem; if (isNaN(window.pageYOffset)) { return elem.document.documentElement.scrollTop; } else { return elem.ownerDocument.defaultView.pageYOffset; } }; handler = function() { var containerBottom, containerTopOffset, elementBottom, remaining, shouldScroll; if (container === windowElement) { containerBottom = height(container) + pageYOffset(container[0].document.documentElement); elementBottom = offsetTop(elem) + height(elem); } else { containerBottom = height(container); containerTopOffset = 0; if (offsetTop(container) !== void 0) { containerTopOffset = offsetTop(container); } elementBottom = offsetTop(elem) - containerTopOffset + height(elem); } if (useDocumentBottom) { elementBottom = height((elem[0].ownerDocument || elem[0].document).documentElement); } remaining = elementBottom - containerBottom + 750;// 750 added customly to make it 250px. // console.log(remaining); // console.log(height(container) * scrollDistance + 1); shouldScroll = remaining <= height(container) * scrollDistance + 1; if (shouldScroll) { checkWhenEnabled = true; if (scrollEnabled) { if (scope.$$phase || $rootScope.$$phase) { return scope.infiniteScroll(); } else { return scope.$apply(scope.infiniteScroll); } } } else { if (checkInterval) { $interval.cancel(checkInterval); } return checkWhenEnabled = false; } }; throttle = function(func, wait) { var later, previous, timeout; timeout = null; previous = 0; later = function() { previous = new Date().getTime(); $interval.cancel(timeout); timeout = null; return func.call(); }; return function() { var now, remaining; now = new Date().getTime(); remaining = wait - (now - previous); if (remaining <= 0) { $interval.cancel(timeout); timeout = null; previous = now; return func.call(); } else { if (!timeout) { return timeout = $interval(later, remaining, 1); } } }; }; if (THROTTLE_MILLISECONDS != null) { handler = throttle(handler, THROTTLE_MILLISECONDS); } scope.$on('$destroy', function() { container.unbind('scroll', handler); if (unregisterEventListener != null) { unregisterEventListener(); unregisterEventListener = null; } if (checkInterval) { return $interval.cancel(checkInterval); } }); handleInfiniteScrollDistance = function(v) { return scrollDistance = parseFloat(v) || 0; }; scope.$watch('infiniteScrollDistance', handleInfiniteScrollDistance); handleInfiniteScrollDistance(scope.infiniteScrollDistance); handleInfiniteScrollDisabled = function(v) { scrollEnabled = !v; if (scrollEnabled && checkWhenEnabled) { checkWhenEnabled = false; return handler(); } }; scope.$watch('infiniteScrollDisabled', handleInfiniteScrollDisabled); handleInfiniteScrollDisabled(scope.infiniteScrollDisabled); handleInfiniteScrollUseDocumentBottom = function(v) { return useDocumentBottom = v; }; scope.$watch('infiniteScrollUseDocumentBottom', handleInfiniteScrollUseDocumentBottom); handleInfiniteScrollUseDocumentBottom(scope.infiniteScrollUseDocumentBottom); changeContainer = function(newContainer) { if (container != null) { container.unbind('scroll', handler); } container = newContainer; if (newContainer != null) { return container.bind('scroll', handler); } }; changeContainer(windowElement); if (scope.infiniteScrollListenForEvent) { unregisterEventListener = $rootScope.$on(scope.infiniteScrollListenForEvent, handler); } handleInfiniteScrollContainer = function(newContainer) { if ((newContainer == null) || newContainer.length === 0) { return; } if (newContainer.nodeType && newContainer.nodeType === 1) { newContainer = angular.element(newContainer); } else if (typeof newContainer.append === 'function') { newContainer = angular.element(newContainer[newContainer.length - 1]); } else if (typeof newContainer === 'string') { newContainer = angular.element(document.querySelector(newContainer)); } if (newContainer != null) { return changeContainer(newContainer); } else { throw new Error("invalid infinite-scroll-container attribute."); } }; scope.$watch('infiniteScrollContainer', handleInfiniteScrollContainer); handleInfiniteScrollContainer(scope.infiniteScrollContainer || []); if (attrs.infiniteScrollParent != null) { changeContainer(angular.element(elem.parent())); } if (attrs.infiniteScrollImmediateCheck != null) { immediateCheck = scope.$eval(attrs.infiniteScrollImmediateCheck); } return checkInterval = $interval((function() { if (immediateCheck) { handler(); } return $interval.cancel(checkInterval); })); } }; } ]); if (typeof module !== "undefined" && typeof exports !== "undefined" && module.exports === exports) { module.exports = 'infinite-scroll'; }
import React from "react"; import { Row, Col } from "antd"; import { Alert } from "antd"; import sunrise from "../../img/sunrise.jpg"; import sunset from "../../img/sunset.jpg"; import InfoCard from "./InfoCard"; const Cards = ({ data }) => { return ( <div id="cards"> <Row type="flex" justify="space-between"> <Col span={7}> {" "} <InfoCard data={data.temperatureLow} title="Minimum Temperature" unit="&#8451;" /> </Col> <Col span={7}> <Alert message="Summary" description={data.summary} type="info" showIcon /> </Col> <Col span={7}> {" "} <InfoCard data={data.temperatureHigh} title="Maximum Temperature" unit="&#8451;" /> </Col> </Row> <Row type="flex" justify="space-between" style={{ marginTop: 35, marginBottom: 35 }} > <Col span={11}> <InfoCard data={new Date(data.sunriseTime * 1000).toLocaleTimeString()} title="Sunrise" img={sunrise} /> </Col> <Col span={11}> <InfoCard data={new Date(data.sunsetTime * 1000).toLocaleTimeString()} title="Sunset" img={sunset} /> </Col> </Row> <Row type="flex" justify="space-between" style={{ marginTop: 15, marginBottom: 15 }} > <Col span={7}> {" "} <InfoCard data={data.pressure} unit="mBar" title="Pressure" /> </Col> <Col span={7}> <InfoCard data={data.humidity} unit="%" title="Humidity" /> </Col> <Col span={7}> {" "} <InfoCard data={parseFloat(data.windSpeed * 3.6).toFixed(2)} title="Wind Speed" unit="km/h" /> </Col> </Row> </div> ); }; export default Cards; //3 // VM1248:1 4 // VM1248:1 5 // VM1248:1 6 // VM1248:1 0 sun // VM1248:1 1 // VM1248:1 2 // VM1248:1 3
const fs = require('fs'); const path = require('path'); // https://github.com/facebookincubator/create-react-app/issues/637 const appDirectory = fs.realpathSync(process.cwd()); exports.resolveApp = function resolveApp(relativePath) { return path.resolve(appDirectory, relativePath); }; exports.resolveOwn = function resolveOwn(relativePath) { return path.resolve(__dirname, '..', relativePath); }; /** * check file/dir whether exist * * @param {string} path check path * @param {string} type [file, dir] * * @return boolean */ exports.isExist = function(path, type) { let ok = false; try { const stat = fs.statSync(path); if (type === 'file' && stat.isFile()) ok = true; if (type === 'dir' && stat.isDirectory()) ok = true; } catch (e) { ok = false; } return ok; };
import React from 'react' import BookDetailButton from './BookDetailButton' import * as utils from '../../utils/Common' class BookShelfItem extends React.Component { constructor(props) { super(props) this.state = { shelfTitle: null } } getImageLink = (obj) => { const imageList = utils.deepCopy(obj.imageLinks) if (imageList !== null) { return (imageList.smallThumbnail) } } inMyBookList = () => { const myBooks = this.props.myBooks const bookID = this.props.id const isInMyShelf = myBooks.filter(e => e.id === bookID) if (isInMyShelf.length > 0) { this.setState({shelfTitle: isInMyShelf[0].shelf}) } } componentDidMount() { this.inMyBookList() } render() { const book = this.props const bookID = this.props.id const coverStyle = { width: '100%', height: '100%', backgroundImage: `url(${this.getImageLink(this.props)})` } return ( <div className="book"> <div className="book-top"> <div className="book-cover" style={coverStyle}></div> <BookDetailButton shelf={this.state.shelfTitle} updateShelf={this.props.updateShelf} book={book} bookID={bookID} /> </div> <div className="book-title">{this.props.title}</div> <div className="book-authors">{this.props.authors}</div> </div> ) } } export default BookShelfItem