text
stringlengths
7
3.69M
var model = { init:function() { model.words = [] model.wordCounts =[] }, words:[], wordCounts:[], incrementWordCount:function(word){ var index = $.inArray(word, model.words) if (index == -1) { index = model.words.push(word) - 1 model.wordCounts.push({word:word, count:0}) } model.wordCounts[index].count++ } } var view = { input:"<textarea style='width:500px; height:500px' id='words' placeholder='paste words here to count'></textarea><br>" + "<button id='do'>Count words</button>", resetOutput:function(){ $("#output").text('') }, writeOutput:function(outputArray){$("#output").append(outputArray.join("<br>"))} } var controller = { inputArea:$("#divInput"), init:function(){ controller.inputArea.append(view.input) $("#do").click(controller.doClickHandler) }, doClickHandler:function(){ model.init() view.resetOutput() var input = $("#words").val() input.split(" ").forEach(function(word){ model.incrementWordCount(word) } ) var output = [] $.each(model.wordCounts, function(key, obj){ output.push(obj.word + " count: " + obj.count) }) view.writeOutput(output) } } $(controller.init)
const arr = [1,4,6,7,14,18,29,35,47]; const target = 3; // Use binary search to find the target, return index if found or return -1 iuf not found function binarySearch(arr, target){ let start = 0; let end = arr.length-1; while(start <= end) { let mid = Math.floor((start + end)/2); if(target === arr[mid]) { return mid; } else if(target < arr[mid]) { end = mid - 1; } else { start = mid + 1; } } return -1 } console.log(binarySearch(arr,target));
class linkedListNode{ constructor(data,next){ this.data = data; this.next = null; } } // var linkedListNode(); // const head = var linkedListNode(21); // head.next = new linkedListNode(31); // head.next.next = new linkedListNode(41); // let current = head; // while(current!==null){ // console.log(current.data); // current = current.next; // } const head = new linkedListNode(12); const next = new linkedListNode(122); // const next = new linkedListNode(this.next); console.log(head); console.log(next);
import React from "react" function TodoItem(props) { return ( <div className="todo-item"> <input type="checkbox" checked={props.completed} onChange={() => props.toggleCheck(props.id)} /> <p className={props.completed ? 'checked' : null}>{props.text}</p> </div> ) } export default TodoItem
/** * 创建考试页面 * @param selector 添加的位置 * @param data 数据 * @param config 配置文件 */ var ExamCreate = function (selector, data, fn_submit) { this.data = data || {}; this.fn_submit = fn_submit; this.config = { radio: 'radio', checkbox: 'checkbox', bool: 'bool' }; this.selector = selector; // 创建页面模板 this.tpl = [ '<div class="exam-create-container">', ' <!--题型选择 START-->', ' <div class="exam-create-righttop">', ' <img data-type="radio" src="./imgs/exam_create/exam_type_radio.png" alt="单选" title="单选">', ' <img data-type="checkbox" src="./imgs/exam_create/exam_type_checkbox.png" alt="多选" title="多选">', ' <img data-type="bool" src="./imgs/exam_create/exam_type_bool.png" alt="对错" title="对错">', ' </div>', ' <!--题型选择 END-->', ' <!--顶部工具栏 START-->', ' <div class="exam-create-top">', ' <div class="exam-create-pre"></div>', ' <div class="exam-create-sortid">', ' <span class="eaxm-create-currentIndex">{{currentIndex}}</span>/<span class="eaxm-create-total">{{total}}</span>', ' </div>', ' <div class="exam-create-next"></div>', ' <div class="exam-create-add"></div>', ' <div class="exam-create-del"></div>', ' </div>', ' <!--顶部工具栏 END-->', ' <!--题目 START-->', ' <div class="exam-create-main">', '{{{questionsHTML}}}', ' </div>', ' <!--题目 END-->', ' <!--底部工具栏 START-->', ' <div class="exam-create-bottom">', ' <div class="exam-create-addItem"></div>', ' <div class="exam-create-submit"></div>', ' </div>', ' <!--底部工具栏 END-->', '</div>' ].join(''); // 题目模板 this.questionTpl = [ '<div class="exam-create-main-item" data-id="{{index}}" style="display:{{hide}}">', ' <textarea class="exam-create-question form-control" placeholder="输入题干">{{text}}</textarea>', ' <div class="exam-create-answer">', '{{{answerHTML}}}', ' </div>', '</div>' ].join(''); // 答案模板 this.answerTpl = [ ' <div class="exam-create-answer-item" data-id="{{index}}">', ' <div data-type="{{type}}" class="exam-create-answer-item-{{type}} {{answerClass}}"></div>', ' <div class="exam-create-answer-item-content">', ' <textarea class="form-control" rows="1" placeholder="{{placeholder}}">{{text}}</textarea>', ' </div>', ' </div>', ].join(''); this.questionItem = { radio: { text: '', type: 'radio', answers: [ {}, {}, { placeholder: "输入选项,少于三个请留空" }, { placeholder: "输入选项,少于四个请留空" } ] }, checkbox: { text: '', type: 'checkbox', answers: [ {}, {}, {}, { placeholder: "输入选项,少于四个请留空" } ] } , bool: { text: '', type: 'bool', answers: [ { text: "对 (True)" }, { text: "错 (False)" } ] } } this.render() return this; } /*====================render 方法 START===========================*/ /** * 采用数据驱动,每次都会根据 this.data 重新渲染一次 * [怀念react 和双向数据绑定的开发方法] */ ExamCreate.prototype.render = function () { var html = this.init(); $(this.selector).html(html); this.initVar(); this.bindEvent(); this.setQuestionType(this.currentIndex - 1); } /** * 初始化页面 */ ExamCreate.prototype.init = function () { var tpls = Handlebars.compile(this.tpl); this.data.questions = this.data.questions || [this.getQuestionItemByType('radio')]; // [this.questionItem['radio']]; this.total = this.data.questions.length || 1; this.currentIndex = this.currentIndex || 1; var data = $.extend(true, {}, this.data); data.total = this.total; data.currentIndex = this.currentIndex; data.questionsHTML = this.createQuestion(data.questions); return tpls(data); } /** * 创建问题列表 * @param questions * @returns {string} */ ExamCreate.prototype.createQuestion = function (questions) { var tpls = Handlebars.compile(this.questionTpl); var quetionsHTML = ''; for (var i = 0; i < questions.length; i++) { var question = questions[i]; question.index = i; //题目不等于考卷的当前下标,则隐藏 if (i != this.currentIndex - 1) { question.hide = 'none'; } question.type = question.type || 'radio'; question.answerHTML = this.createAnswer(question.answers || [], this.config[question.type], i); quetionsHTML += tpls(question); } return quetionsHTML; } /** * 创建答案列表 * @param answers * @param type * @param questionIndex * @returns {string} */ ExamCreate.prototype.createAnswer = function (answers, type, questionIndex) { var tpls = Handlebars.compile(this.answerTpl); var answerHTML = ''; for (var i = 0; i < answers.length; i++) { var answer = answers[i]; answer.index = questionIndex + '_' + i; answer.type = type; answer.answerClass = answer.answer ? 'exam-create-active' : ''; answer.placeholder = answer.placeholder || "输入选项"; answerHTML += tpls(answer); } return answerHTML; } /*====================初始化变量 START===========================*/ /** * 初始化变量 */ ExamCreate.prototype.initVar = function () { this.$container = $(this.selector); this.$questionsMain = this.$container.find('.exam-create-main'); this.$questions = this.$container.find('.exam-create-main-item'); this.$add = this.$container.find('.exam-create-add'); this.$del = this.$container.find('.exam-create-del'); this.$currentIndex = this.$container.find('.eaxm-create-currentIndex'); this.$total = this.$container.find('.eaxm-create-total'); this.$addItem = this.$container.find('.exam-create-addItem'); this.$submit = this.$container.find('.exam-create-submit'); this.$pre = this.$container.find('.exam-create-pre'); this.$next = this.$container.find('.exam-create-next'); this.$questionType = this.$container.find('.exam-create-righttop'); this.$answerSelect = this.$container.find('.exam-create-answer-item>div[data-type]'); } /*====================事件绑定 START===========================*/ /** * 事件绑定 */ ExamCreate.prototype.bindEvent = function () { var that = this; /** * 上一题目 */ this.$pre.off().on('click', function () { if (that.currentIndex > 1) { that.currentIndex--; that.$currentIndex.text(that.currentIndex) that.changeQuestion(that.currentIndex - 1); that.setQuestionType(that.currentIndex - 1); autosize.update($(that.selector).find('textarea')); } }); /** * 下一题目 */ this.$next.off().on('click', function () { if (that.currentIndex < that.total) { that.currentIndex++; that.$currentIndex.text(that.currentIndex); that.changeQuestion(that.currentIndex - 1); that.setQuestionType(that.currentIndex - 1); autosize.update($(that.selector).find('textarea')); } }); /** * 题目类型[单选,多选,对错] */ this.$questionType.off().on('click', function (e) { var $cTar = $(e.currentTarget); var $tar = $(e.target); if ($cTar.hasClass('exam-create-righttop-open')) { var type = $tar.attr('data-type'); if (that.data.questions[that.currentIndex - 1].type !== type) { that.data.questions[that.currentIndex - 1]['type'] = type; that.data.questions[that.currentIndex - 1]['answers'] = that.getQuestionItemByType(type)['answers']; //切换题目类型则重置 选项和答案 that.getValue2Data(true); that.render(); } $cTar.removeClass('exam-create-righttop-open'); } else { $cTar.addClass('exam-create-righttop-open') } }); /** * 选择正确项 */ this.$answerSelect.off().on('click', function (e) { var $cTar = $(e.currentTarget); var type = $cTar.attr('data-type'); if (type !== "checkbox") { $cTar.parent().parent().find('div[data-type]').removeClass('exam-create-active'); } if ($cTar.hasClass('exam-create-active')) { $cTar.removeClass('exam-create-active'); } else { $cTar.addClass('exam-create-active'); } }) /** * 添加题目 */ this.$add.off().on('click', function () { that.getValue2Data(); var item = that.getQuestionItemByType('radio');//that.questionItem['radio']; that.currentIndex++; that.data.questions.splice(that.currentIndex - 1, 0, item); that.render(); autosize($(that.selector).find('textarea')); }); /** * 删除题目 */ this.$del.off().on('click', function () { that.getValue2Data(); if (that.total == 1) { var type = that.data.questions[0].type || 'radio'; that.data.questions = [that.getQuestionItemByType('radio')]//[that.questionItem[type]]; } else { that.data.questions.splice(that.currentIndex - 1, 1); that.currentIndex > 1 ? that.currentIndex-- : ''; } that.render(); }); /** * 添加答案项 */ this.$addItem.off().on('click', function () { that.getValue2Data(); that.data.questions[that.currentIndex - 1].answers.push({ text: '' }); that.render(); autosize($(that.selector).find('textarea')); }); /** * 提交 */ this.$submit.off().on('click', function () { that.getValue2Data(); if (that.checkSettingAnswer()) { that.fn_submit && that.fn_submit(that.data); } }); } /*====================工具方法 START===========================*/ /** * 设置指定下标的题目 * @param index 下标 */ ExamCreate.prototype.changeQuestion = function (index) { this.$questions.hide(); this.$questions.eq(index).show(); } /** * 设置指定下标的题目类型 * @param index 下标 */ ExamCreate.prototype.setQuestionType = function (index) { var type = this.data.questions[index] && this.data.questions[index].type || 'radio'; var $tar = this.$questionType.find('img[data-type="' + type + '"]'); $tar.remove(); this.$questionType.prepend($tar); } /** * 把文本框的数据解析出来,放到对象的data 里面 * @param flag 是否重置选项的值 true 是 [目前就切换题型时,重置选项和答案] */ ExamCreate.prototype.getValue2Data = function (flag) { var questions = this.$questions || []; for (var i = 0; i < questions.length; i++) { var $question = $(questions[i]); var id = $question.attr('data-id'); this.data.questions[id]['text'] = $question.find('.exam-create-question').val(); if (!flag) { // 每个答案的内容 var $answerItems = $question.find('.exam-create-answer-item textarea'); for (var j = 0; j < $answerItems.length; j++) { var $item = $($answerItems[j]); if (this.data.questions[id]['answers'][j]) { this.data.questions[id]['answers'][j]['text'] = $item.val(); } } // 正确答案 var $answerSelect = $question.find('div[data-type]'); for (var j = 0; j < $answerSelect.length; j++) { var $item = $($answerSelect[j]); if (this.data.questions[id]['answers'][j]) { if ($item.hasClass('exam-create-active')) { this.data.questions[id]['answers'][j]['answer'] = true; } else { this.data.questions[id]['answers'][j]['answer'] = false; } } } } } } /** * 使用了深复制,不然会导致公用一个引用 * @param type * @returns {*|void} */ ExamCreate.prototype.getQuestionItemByType = function (type) { return $.extend(true, {}, this.questionItem[type]); } /** * 检查所有题目是否设置了答案 * 如果未设置答案,不允许提交 */ ExamCreate.prototype.checkSettingAnswer = function () { var flag = [] var questions = this.data.questions; for (var i = 0; i < questions.length; i++) { var question = questions[i]; for (var j = 0; j < question.answers.length; j++) { if (question.answers[j].answer) { flag.push(true) break; } if (j === question.answers.length - 1) { flag.push(false) } } } for (var i = 0; i < flag.length; i++) { if (!flag[i]) { alert('第' + (i + 1) + '道题目未设置答案,请检查下题目答案哦!') return false; } } return true; }
import React from 'react'; import styled from 'styled-components'; const StyledCard = styled.div` --padding: 1rem 1.5rem; --border: 1px solid #e8e8e8; background-color: white; border: 1px solid #e8e8e8; `; const Header = styled.div` padding: var(--padding); border-bottom: var(--border); `; const Content = styled.div` padding: var(--padding); `; const Card = ({ children, title, }) => ( <StyledCard> <Header> {title} </Header> <Content> {children} </Content> </StyledCard> ); export default Card;
'use strict'; app.controller('menuDetailsController', ['$http','$rootScope','$scope','$state','$modal',"$timeout",'sessionStorageService','uiClassService',"utilService","hintService",function($http, $rootScope, $scope, $state,$modal,$timeout,sessionStorageService,uiClassService,utilService,hintService) { // $scope.needCacheArray = ["menuForDetails","menuListDataTableProperties"]; // sessionStorageService.clearNoCacheItem($scope.needCacheArray); // if($scope.rowIds[0]){ // sessionStorageService.setItem("menuIdForDetails",$scope.rowIds[0]); // }else{ // $scope.rowIds[0] = sessionStorageService.getItemStr("menuIdForDetails"); // } $scope.showChildMenu = false ;//是否显示子菜单,只有在新增或者修改二级菜单的时候才出现 $scope.setShowChildMenu = function(flag){ $scope.showChildMenu = flag ; if(!flag){ $scope.permItemCollection = []; } } $scope.imgArray = uiClassService.getImgArray(); $scope.colorArray = uiClassService.getColorArray(); // if(!$scope.rowIds[0]||$scope.rowIds[0]==""){ // $state.go($scope.state.list);//返回到列表界面 // } $scope.permItemCollection = []; $scope.treeAPI.clickTreeListReload = function(id){ console.info("details中的id",id); if(permItemTable){ permItemTable.clear().draw(); } $scope.formData = {} ; $http({ url:'sys/menuAction!detailsMenu.action', method:"post", data:{ id:id } }).then(function(resp){ if(resp.data.code==1){ $scope.formData = resp.data.details ; if($scope.menuTree.selectedLevel===0){ $scope.setShowChildMenu(false) ; if(permItemTable){ permItemTable = null ; } return ; } initPermItemTable(id);//获取该菜单下面的所有权限子项 }else{ alert(resp.data.message); } }); }; $scope.treeAPI.newMenu = function(parentId){ $scope.formData = {} ; if(parentId){ //新增二级菜单 $scope.setShowChildMenu(true); $scope.formData.parentId = parentId ; $scope.formData.level = 1; initPermItemTable(null); }else{ $scope.setShowChildMenu(false); $scope.formData.level = 0; } } var permItemTable ; function initPermItemTable(id){ $scope.setShowChildMenu(true); if(permItemTable){ refeshData(id); return ; } if($("#permItemTable").length<1){//延迟加载 $timeout(function(){ initPermItemTable(id); },20); return ; } permItemTable = $("#permItemTable").DataTable({ "dom": '<"top">rt<"bottom"><"clear">', "pageLength":10, "oLanguage": { "sLengthMenu": "每页 _MENU_ 条", "sZeroRecords": "没有找到符合条件的数据", "sProcessing": "&lt;img src=’./loading.gif’ /&gt;", "sInfo": "当前第 _START_ - _END_ 条,共 _TOTAL_ 条", "sInfoEmpty": "没有记录", "sInfoFiltered": "(从 _MAX_ 条记录中过滤)", "sSearch": "搜索", "oPaginate": { "sFirst": "<<", "sPrevious": "<", "sNext": ">", "sLast": ">>" } },scrollX:true, "aoColumns": [{ "mDataProp": "number" },{ "mDataProp": "name" },{ "mDataProp": "fType", "render":function(param){ switch(param){ case 0: return "页面资源";break; case 1: return "操作资源";break; default: return "";break; } } },{ "mDataProp": "uiClass" },{ "mDataProp": "action" },{ "mDataProp": "useState", "render":function(param){ switch(param){ case 0: return "使用";break; case 1: return "禁用";break; default: return "";break; } } },{ "render":function(a,b,aData,d){ var buttonStr = '<button type="button" class="btn btn-default btn-sm" name="updateButton" ><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></button>'; if(!aData.id){ buttonStr = buttonStr + '<button type="button" class="btn btn-danger btn-sm" name="deleteButton" ><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button>'; } return buttonStr; } }],"fnCreatedRow": function(nRow, aData, iDataIndex){ $(nRow).attr('data-id', aData['id']); $(nRow).find("button[name=updateButton]").click(function(e){ showModal(nRow,aData); }); $(nRow).find("button[name=deleteButton]").click(function(e){ deletePermItemMenu(iDataIndex); }); } }); refeshData(id); } function deletePermItemMenu(index){ var data = $scope.permItemCollection ; data.splice(index,1); renderData(data); } /** * 刷新数据 */ function refeshData(id,Data){ if(!Data&&id){ $http({ url:"sys/menuAction!listPermItemByMenuId.action", method:"post", data:{ id:id } }).then(function(resp){ if(resp.data.code==1){ renderData(resp.data.data); } }); }else{ renderData(Data); } } /** * 渲染数据 */ function renderData(data){ if(permItemTable){ permItemTable.clear().draw(); } if(data&&data.length>0){ $scope.permItemCollection = data ; permItemTable.rows.add(data).draw(); } } /** * 新增菜单的action操作 */ $scope.addMenuAction = function(){ showModal(); } /** * 弹窗事件 */ var showModal = function(nRow,aData){ var modalInstance = $modal.open({ templateUrl: 'src/tpl/sys/menu/addAction.html', size: 'lg', backdrop:true, controller:"addActionController", resolve: { permItemId:function(){ if(aData){ return aData.id ; } return null ; }, aData:function(){ return aData ; } } }); /** * 弹窗关闭事件 */ modalInstance.result.then(function (permItemFormData) { if(permItemFormData.id){ //修改操作 utilService.updateObjectFromArray("id",permItemFormData.id,$scope.permItemCollection,permItemFormData) ; console.info("修改",$scope.permItemCollection); }else{ //新增操作 $scope.permItemCollection.push(permItemFormData); console.info("新增",$scope.permItemCollection); } renderData($scope.permItemCollection); }); } $scope.submit = function(){ $scope.formData.permItemJsonStr = JSON.stringify($scope.permItemCollection); $scope.formData.parentId = $scope.menuTree.selectedMenuId ; $http({ url:"sys/menuAction!addOrUpdateMenu.action", method:"post", data:$scope.formData }).then(function(resp){ if(resp.data.code==1){ hintService.hint({title: "成功", content: "保存成功!" }); $state.reload(); }else{ alert(resp.data.message); } $scope.isDoing = false ; }); } // $scope.clearRowIds(); }]);
import React from 'react'; import ProgressiveLoadable from './progressive-loadable'; import cleanLoadableTags from './clean-loadable-tags'; import ProgressiveLoadableExtractorContext from './progressive-loadable-extractor'; const ProgressiveLoadableExtractor = ({extractor, children}) => (<ProgressiveLoadableExtractorContext.Provider value={extractor}>{children}</ProgressiveLoadableExtractorContext.Provider>); export { ProgressiveLoadable as default, cleanLoadableTags, ProgressiveLoadableExtractor };
import angular from "/ui/web_modules/angular.js"; import mnAlertsService from "/ui/app/components/mn_alerts.js"; import mnHelper from "/ui/app/components/mn_helper.js"; import _ from "/ui/web_modules/lodash.js"; export default "mnPromiseHelper"; angular .module('mnPromiseHelper', [mnAlertsService, mnHelper]) .factory('mnPromiseHelper', mnPromiseHelperFactory); function mnPromiseHelperFactory(mnAlertsService, mnHelper, $timeout, $rootScope) { return mnPromiseHelper; function mnPromiseHelper(scope, promise, modalInstance) { var spinnerNameOrFunction = 'viewLoading'; var errorsNameOrCallback = 'errors'; var pendingGlobalSpinnerQueries = {}; var spinnerTimeout; var promiseHelper = { applyToScope: applyToScope, getPromise: getPromise, onSuccess: onSuccess, reloadState: reloadState, closeFinally: closeFinally, closeOnSuccess: closeOnSuccess, showErrorsSensitiveSpinner: showErrorsSensitiveSpinner, catchErrorsFromSuccess: catchErrorsFromSuccess, showSpinner: showSpinner, showGlobalSpinner: showGlobalSpinner, catchErrors: catchErrors, catchGlobalErrors: catchGlobalErrors, showGlobalSuccess: showGlobalSuccess, broadcast: broadcast, removeErrors: removeErrors, closeModal: closeModal } return promiseHelper; function getPromise() { return promise; } function onSuccess(cb) { promise.then(cb); return this; } function reloadState(state) { promise.then(function () { spinnerCtrl(true); mnHelper.reloadState(state); }); return this; } function closeFinally() { promise['finally'](closeModal); return this; } function closeOnSuccess() { promise.then(closeModal); return this; } function showErrorsSensitiveSpinner(name, timer, scope) { name && setSpinnerName(name); maybeHandleSpinnerWithTimer(timer, scope); promise.then(clearSpinnerTimeout, hideSpinner); return this; } function catchErrorsFromSuccess(nameOrCallback) { nameOrCallback && setErrorsNameOrCallback(nameOrCallback); promise.then(function (resp) { errorsCtrl(extractErrors(resp)); }); return this; } function showSpinner(name, timer, scope) { name && setSpinnerName(name); maybeHandleSpinnerWithTimer(timer, scope); promise.then(hideSpinner, hideSpinner); return this; } function showGlobalSpinner(timer) { var id = doShowGlobalSpinner(); promise.then(hideGlobalSpinner(id), hideGlobalSpinner(id)); return this; } function catchErrors(nameOrCallback) { nameOrCallback && setErrorsNameOrCallback(nameOrCallback); promise.then(removeErrors, function (resp) { if (resp.status !== -1) { errorsCtrl(extractErrors(resp)); } }); return this; } function catchGlobalErrors(errorMessage, timeout) { promise.then(null, function (resp) { if (resp.status !== -1) { mnAlertsService.formatAndSetAlerts(errorMessage || extractErrors(resp.data), 'error', timeout); } }); return this; } function showGlobalSuccess(successMessage, timeout) { if (timeout === undefined) { timeout = 2500; } promise.then(function (resp) { mnAlertsService.formatAndSetAlerts(successMessage || resp.data, 'success', timeout); }); return this; } function applyToScope(keyOrFunction) { promise.then(angular.isFunction(keyOrFunction) ? keyOrFunction : function (value) { scope[keyOrFunction] = value; }, function () { if (angular.isFunction(keyOrFunction)) { keyOrFunction(null); } else { delete scope[keyOrFunction]; } }); return this; } function broadcast(event, data) { promise.then(function () { $rootScope.$broadcast(event, data); }); return this; } function spinnerCtrl(isLoaded) { if (angular.isFunction(spinnerNameOrFunction)) { spinnerNameOrFunction(isLoaded); } else { scope[spinnerNameOrFunction] = isLoaded; } } function errorsCtrl(errors) { if (angular.isFunction(errorsNameOrCallback)) { errorsNameOrCallback(errors); } else { scope[errorsNameOrCallback] = errors; } } function doShowGlobalSpinner() { var timer = $timeout(function () { $rootScope.mnGlobalSpinnerFlag = true; }, 100); var id = "id" + Math.random().toString(36).substr(2, 9); pendingGlobalSpinnerQueries[id] = timer; return id; } function hideGlobalSpinner(id) { return function () { $timeout.cancel(pendingGlobalSpinnerQueries[id]); delete pendingGlobalSpinnerQueries[id]; if (_.isEmpty(pendingGlobalSpinnerQueries)) { $rootScope.mnGlobalSpinnerFlag = false; } } } function hideSpinner() { spinnerCtrl(false); clearSpinnerTimeout(); } function removeErrors() { errorsCtrl(false); return this; } function setSpinnerName(name) { spinnerNameOrFunction = name; } function setErrorsNameOrCallback(nameOrCallback) { errorsNameOrCallback = nameOrCallback; } function closeModal() { modalInstance.close(scope); } function extractErrors(resp) { if (resp.status === 0) { return false; } var errors = resp.data && resp.data.errors !== undefined && _.keys(resp.data).length === 1 ? resp.data.errors : resp.data || resp ; return _.isEmpty(errors) ? false : errors; } function clearSpinnerTimeout() { if (spinnerTimeout) { $timeout.cancel(spinnerTimeout); } } function enableSpinnerTimeout(timer) { spinnerTimeout = $timeout(function () { spinnerCtrl(true); }, timer); } function maybeHandleSpinnerWithTimer(timer, scope) { if (timer) { enableSpinnerTimeout(timer); scope.$on("$destroy", clearSpinnerTimeout); } else { spinnerCtrl(true); } } } }
/** * Created by julian on 15/09/14. */ ; (function () { "use strict"; angular.module(G.APP) .directive('sisesWidgetArchivos', [function() { return { templateUrl: G.template('directive/widget_archivos'), scope: { elements: '=sisesWidgetArchivos' }, link: function(scope) { scope.id = G.guid(); scope.active = false; scope.percent = 0; scope.files = []; scope.current_edit = null; scope.filters = [ { title : "Image files", extensions : "jpg,gif,png,jpeg,gif" }, { title : "Zip files", extensions : "zip,rar,tar" }, { title : "Documents", extensions : "pdf,doc,xls,docx,xlsx,ppt" }, ]; var find = function(archivo) { var founded = -1; // Se busca por archivos, tiene nombres unicos angular.forEach(scope.elements, function(value, index) { if (value.file === archivo.file) { founded = index; } }); return founded; }; var append = function(archivo) { var founded = find(archivo); if (founded < 0) { if (!scope.elements) { scope.elements = []; } scope.elements.push(archivo); } }; scope.edit = function(archivo) { scope.current_edit = archivo; }; scope.editOff = function($event) { scope.current_edit = null; $event.stopPropagation() }; scope.remove = function(archivo, $event) { $event.stopPropagation(); var founded = find(archivo); if (founded >= 0) { scope.elements.splice(founded, 1); } }; scope.editable = function(archivo) { if (!scope.current_edit) { return false; } return scope.current_edit.file === archivo.file; }; scope.fileUploaded = function(res) { scope.active = false; append({ file: JSON.parse(res.response).file, nombre: scope.files[0].name }); scope.files = []; }; scope.fileAdded = function() { scope.percent = 0; scope.active = true; }; } } }]) ; })();
const { App } = require('database').models; const getOne = async ({ name, bots }) => { try { const app = await App.findOne({ name }).select(bots ? {} : { service_bots: 0 }).lean(); if (!app) { return { error: { status: 404, message: 'App not found!' } }; } return { app }; } catch (error) { return { error }; } }; const getAll = async () => { try { const apps = await App.find().lean(); if (!apps || !apps.length) { return { error: { status: 404, message: 'App not found!' } }; } return { apps }; } catch (error) { return { error }; } }; const aggregate = async (pipeline) => { try { const result = await App.aggregate(pipeline); if (!result) { return { error: { status: 404, message: 'Not found!' } }; } return { result }; } catch (error) { return { error }; } }; const updateOne = async ({ name, updData }) => { try { const result = await App.updateOne({ name }, updData); return { result: !!result.nModified }; } catch (error) { return { error }; } }; module.exports = { getOne, aggregate, updateOne, getAll, };
jQuery(function () { /*using animate.css list*/ var animationend = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationEnd AnimationEnd'; function intro_animation() { $(".main_illust .backgrid_img").addClass("animated fadeIn"); $(".main_illust .face_img").delay(400).animate({ top: '0px' }); setTimeout(function () { $(".main_illust .camera_img").addClass("animated jackInTheBox"); $(".main_illust .siss_img").addClass("animated jackInTheBox"); $(".main_illust .laptop_img").addClass("animated jackInTheBox"); }, 600); setTimeout(function () { $(".intro .down_btn").addClass("animated flash").one(animationend, function () { $(this).removeClass('animated flash'); }); }, 1500); }; function about_animation() { $('.about_text .left_illust').addClass('animated fadeInLeft'); $('.about_text .right_illust').addClass('animated fadeInRight'); }; function workshop_animation() { $('.workshop_video .bottom_text .illust').addClass('animated tada').one(animationend, function () { $(this).removeClass('animated tada'); }); }; function artist_animation() { $('.artist_video .top_text .illust.ear_illust').addClass('animated tada').one(animationend, function () { $(this).removeClass('animated tada'); }); }; /*intro animation*/ window.onload = intro_animation(); /*fancybox add*/ $(".fancybox").fancybox(); $('.ytube').fancybox(); $(".ov-box a").fancybox(); /*bxslider add*/ $('.gallery_img_li').bxSlider({ pagerCustom: '#gallnav', nextSelector: '.gallery_btn.right_btn', prevSelector: '.gallery_btn.left_btn', easing: 'ease-out', maxSlides: 2 }); /*button click animation*/ $('.gallery_btn').on('click', function () { $(this).addClass("animated rubberBand").one(animationend, function () { $(this).removeClass('animated rubberBand'); }); }); $('.gallnav a span').on('click', function () { $(this).addClass("animated jello").one(animationend, function () { $(this).removeClass('animated jello'); }); }); /*resizing*/ $(window).on('resize', function () { if ($(window).height() > 960) { $('section.intro .main_illust').css({ 'max-width': '900px', height: '540px' }); $('.main_illust span').css({ height: '540px' }); } }) $(window).trigger('resize'); /*scroll works*/ $nav_button = $('nav .page_nav li'); $section = $("section"); $section_position = new Array(); for (var i = 0; i < $section.length; i++) { $section_position[i] = $section.eq(i).offset().top; }; $('.down_btn').on('click', function () { $('html,body').stop().animate({ scrollTop: $section_position[1] }); }); $nav_button.on('click', function () { $idx = $(this).index(); $position = $('section').eq($idx).offset().top; $('html,body').stop().animate({ scrollTop: $position }); $(this).addClass('on').siblings().removeClass('on'); }); $(window).on('scroll resize', function () { $('.videoli_hover').hide(); $('.artist_hover').hide(); $html_top = $('html').scrollTop(); $html_bottom = $(window).scrollTop() + $(window).height(); $section_position = new Array(); for (var i = 0; i < $section.length; i++) { $section_position[i] = $section.eq(i).offset().top; }; /*scroll animation*/ if ($html_bottom > $('.about_text .left_illust').offset().top) { about_animation(); }; $cat_top = $('.workshop_video .bottom_text .illust').offset().top; if ($html_bottom > $cat_top && $html_bottom < $cat_top + 40) { workshop_animation(); }; $ear_top = $('.artist_video .top_text .illust.ear_illust').offset().top; if ($html_bottom > $ear_top && $html_bottom < $ear_top + 40) { artist_animation(); }; /*navigation work*/ for (var i = 0; i < $section.length; i++) { if ($html_top > $section_position[i] - 100) { $nav_button.eq(i).addClass('on').siblings().removeClass('on'); }; }; }); /*video li hover*/ $('.video_li li').on('mouseenter mousemove', function () { if ($(window).width() > 768) { $('.videoli_hover').show(); $video_title = $(this).find('.text .title').text(); $running_time = $(this).find('.text .running_time').text(); $('.videoli_hover span.video_title').text($video_title); $('.videoli_hover span.running_time').text($running_time); $('.videoli_hover').css({ left: event.clientX + 10, top: event.clientY - 20 }); } }); $('.video_li li').on('mouseleave', function () { $('.videoli_hover').hide(); }); /*artist image hover*/ $artist_images = new Array(); for (var i = 0; i < $('.artist_lineup .artist_li li').length; i++) { $artist_images[i] = 'url(img/videoartist_' + i + '.png)'; }; $('.artist_lineup .artist_li li').on('mouseenter mousemove', function () { if ($(window).width() > 768) { $idx = $(this).index(); $('.artist_hover span.hover_image').css({ 'background-image': $artist_images[$idx] }); $('.artist_hover').show(); $('.artist_hover').css({ left: event.clientX - 50, top: event.clientY - 150 }); } }); $('.artist_lineup .artist_li li').on('mouseleave', function () { $('.artist_hover').hide(); }); });
import React, { Component } from 'react' const arr1 = [ { type: 'renderTitle', content: '七种内置类型' }, { type: 'renderUl', content: [ '基本类型 - undefined null string number boolean', '引用类型 - object 传递的是引用地址', 'es6 新增类型 - symbol 属于基本类型' ] }, { type: 'renderPop', html: 'symbol', content: ` <title>symbol</title> <codeBlock> <code>let s = Symbol()</code> <code> let s2 = Symbol()</code> <code>s === s2 // false</code> </codeBlock> <codeBlock> <code>let s3 = Symbol('foo')</code> <code>s3.toString() // 'Symbol(foo)'</code> <code>s3.description // 'foo' es2019</code> </codeBlock> <codeBlock> <code>let s1 = Symbol.for("bar") // 全局登记</code> <code>let s2 = Symbol.for("bar")</code> <code>s1 === s2 // true</code> <code>Symbol.keyFor(s1) // "bar"</code> </codeBlock> <div> <p>1. 对象的属性名为字符串时, 容易造成属性名的冲突。es6引入Symbol的概念,使用Symbol生成的属性名是独一无二的</p> <p>2. Symbol 不是对象,是一个原始类型的值,不能使用new 命令</p> <p>3. 为了便于查看区分,可以传递参数 Symbol('foo') ; 也可以传递一个对象作为参数,此时会调用该对象的toString方法,转化为字符串再生成</p> <p>4. Symbol 不能和其他类型的值进行运算, 但是可以转化为布尔值, Boolean(s) !s</p> <p>5. 使用Symbol 作为对象属性名时,不能使用点运算符</p> <p>6. Symbol 不会出现在for...in for...of 循环中, 也不会被Object.keys()、Object.getOwnPropertyNames()、JSON.stringify()返回, 可通过 Object.getOwnPropertySymbols 获取,【非私有】 Reflect.ownKeys 可以返回包含Symbol在内的所有健名</p> </div> ` } ] const arr2 = [ { type: 'renderTitle', content: 'undefiend 和 null 的区别' }, { type: 'renderSubTitle', content: 'null ---- 人为设置的空对象' }, { type: 'renderHtml', content: ` <codeBlock> <code>1、 Null 类型, 代表一个空对象指针【栈中的变量没有指向堆中的内存对象】</code> <code> 2、 判断类型方法 <p>a. typeof null == “object”</p> <p>b. Object.prototype.toString.call(null) == [Object Null]</p> </code> <code> 3、 常见的几种null情况 <p>-- 对象原型链的终点</p> <p>-- 当一个对象被赋值null之后,原来的对象在内存中就失去了指向,GC会择机回收该对象释放内存。</p> <p>-- null有属于自己的类型Null,但是typeof之所以会被判定为Object.</p> <p> 这是因为js数据类型在底层是以二进制形式存在的。二进制的前三位为0 会被typeof 判断为对象类型。而null的二进制恰好都是0,因为被误判为Object </p> <p>【000 - 对象】【100 - 字符串】 【110 - 布尔】</p> </code> </codeBlock> ` }, { type: 'renderSubTitle', content: 'undefined ---- 原始状态' }, { type: 'renderHtml', content: ` <codeBlock> <code>1、 undefined 类型,一个变量已被声明,但未初始化</code> <code>2、 typeof undefined == "undefined"</code> <code> 3、 常见的几种undefined情况 <p>-- 访问对象上不存在的属性</p> <p>-- 定义形参,但是没有传递实参</p> <p>-- void 操作符对任何表达式求值都返回undefined</p> </code> </codeBlock> ` }, { type: 'renderPop', html: 'Q', content: ` <title>Q</title> <codeBlock> <code>null == undefined </code> <code>// true null 和undefiend 行为相似,都表示一个无效的值</code> <code>null === undefined // false 不属于同一种类型</code> <code>null >= 0 // true</code> <code>null == 0 // false</code> </codeBlock> ` }, { type: 'renderPop', html: '== 和 === 的区别', content: ` <title>== 和 === 的区别</title> <div>这两个操作符都会先转换操作数【强制转型】,然后再进行相等性的判断</div> <div>字符串 & 数值 -- 将字符串转换为数值</div> <div>布尔值 &。 -- 将之转换为数值 0 和 1</div> <div>对象 & 非对象 -- 调用valueOf() 方法, 再按照之前的基本类型规则</div> <div>null 和 undefined 不能转换为其它任何值</div> <div>NaN 不等于NaN</div> <div>对象的比较 : 如果两个操作数都指向同一个对象,则相等</div> <div>对象通过它们的引用(reference)进行比较。JavaScript 检查对象是否具有对内存中相同位置的引用</div> <div>{ age: 18 } == { age: 18 } // false</div> ` }, { type: 'renderPop', html: '关系运算符 和 相等运算符', content: ` <title>关系运算符 和 相等运算符</title> <div>两者并不是同一类别的</div> <div>关系运算符需要尝试将运算元转为一个number</div> <codeBlock> <code>null > 0 // true null 尝试转型为number 则为0</code> <code>null == 0 // false 在此处不允许被转型</code> </codeBlock> ` } ] const arr3 = [ { type: 'renderTitle', content: '判断类型的方式' }, ] const dataType = [ ...arr1, ...arr2, ...arr3, ] export default dataType
const React = require('react'); const Gridfunc = require('./Gridfunc.js'); const TileEditor = React.createClass({ render: function () { if (this.props.editingContentType) { //initial select return <div className='select-div'> <form onSubmit={this.onTextSubmit}> <select onChange={this.onInitialSelect}> <option>Add/edit text</option> <option>Change tile colour</option> <option>Add image</option> <option>Change tile size</option> </select> <textarea value={this.props.content.text} onChange={this.changeTileText} /><br/> <input type='Submit'/> </form> </div>; } else if (this.props.editingColour) { //colour edit return <div className='select-div'> <form onSubmit={this.onColourSubmit}> <select onChange={this.onColourSelect}> <option>Yellow</option> <option>Red</option> <option>Green</option> <option>Purple</option> <option>White</option> <option>Black</option> <option>Transparent</option> <option>Blue</option> <option>Chartreuse</option> <option>DarkCyan</option> <option>DarkGoldenRod</option> <option>DarkOrange</option> <option>DarkRed</option> <option>DeepPink</option> <option>LightCyan</option> <option>LightGreen</option> <option>OrangeRed</option> </select> <input type='submit'/> </form> </div>; } else if (this.props.editingImage) { //editing image return <div className='select-div'> <form onSubmit={this.onImageSubmit}> <input type='text' placeholder='IMAGE URL' onChange={this.changeImageURL} > </input> <input type='text' placeholder='(OPTIONAL) LINK URL'></input> <input type='text' placeholder='CAPTION'></input> <select onChange={this.userRequestsFill}> <option>Centre image in container</option> <option>Fill container</option> </select> <input type='submit'></input> </form> </div>; } else if (this.props.editingTileSize) { //editing tile size let pairsAndStrings = Gridfunc.makeArrayOfPairsAndStrings(this.props.position, this.props.columns, this.props.gridSize); let options = pairsAndStrings.map(function (triplet) { return <option key={triplet[1]} value={triplet[0]}>{triplet[1]}</option>; }); return <div className='select-div'> <form onSubmit={this.onSizeSubmit}> <select onChange={this.onSizeSelect}> {options} </select> <input type='submit'/> </form> </div> } }, userRequestsFill: function (e) { e.preventDefault(); this.props.userRequestsFill(e.target.value, this.props.position); }, changeTileText: function (e) { e.preventDefault(); this.props.changeTileText(this.props.position, e.target.value); }, onTextSubmit: function (e) { e.preventDefault(); this.props.onTextSubmit(this.props.position); }, changeImageURL: function (e) { e.preventDefault(); this.props.changeImageURL(this.props.position, e.target.value); }, onImageSubmit: function (e) { e.preventDefault(); this.props.onTextSubmit(); }, onInitialSelect: function (e) { if (e.target.value === 'Change tile colour') { this.props.userRequestsEditColour(this.props.position); } else if (e.target.value === 'Add image') { this.props.userRequestsAddImage(this.props.position); } else if (e.target.value === 'Change tile size') { this.props.userRequestsChangeTileSize(this.props.position); } }, onColourSelect: function (e) { e.preventDefault(); this.props.changeTileColour(this.props.position, e.target.value); }, onColourSubmit: function (e) { e.preventDefault(); this.props.onTextSubmit(); }, onSizeSelect: function (e) { e.preventDefault(); let colRow = e.target.value; colRow = colRow.split(','); let columns = parseInt(colRow[0]); let rows = parseInt(colRow[1]); this.props.changeTileSize(this.props.position, columns, rows); }, onSizeSubmit: function (e) { e.preventDefault(); this.props.onTextSubmit(); } }); module.exports = TileEditor;
/* eslint-disable react/prefer-stateless-function */ /* eslint-disable jsx-a11y/label-has-for */ /* eslint-disable jsx-a11y/no-autofocus */ /* eslint-disable jsx-a11y/label-has-associated-control */ import React, { Component } from 'react'; import Loader from 'react-loaders'; import PropTypes from 'prop-types'; // eslint-disable-next-line react/prefer-stateless-function export default class LandingPage extends Component { render() { const { onSubmit, onChange } = this.props; const loader = <Loader type="ball-spin-fade-loader" />; return ( <div className="container"> <div className="row"> <div className="col-sm-9 col-md-7 col-lg-5 mx-auto"> <div className="card card-signin my-5" id="signin"> <div className="card-body"> <h5 className="card-title text-center"><strong>STORE MANAGER</strong></h5> <h5 className="card-title text-center">Sign In</h5> <form className="form-signin" onSubmit={onSubmit}> <div className="form-label-group"> <input type="text" id="inputText" className="form-control" placeholder="Username" required autoFocus name="username" onChange={onChange} /> <label htmlFor="inputText">Username</label> </div> <div className="form-label-group"> <input type="password" id="inputPassword" className="form-control" placeholder="Password" required name="password" onChange={onChange} /> <label htmlFor="inputPassword">Password</label> </div> <div className="custom-control custom-checkbox mb-3"> <input type="checkbox" className="custom-control-input" id="customCheck1" /> <label className="custom-control-label" htmlFor="customCheck1">Remember password</label> </div> <button className="btn btn-lg btn-success btn-block text-uppercase" type="submit">Sign in</button> </form> </div> </div> </div> </div> </div> ); } } LandingPage.propTypes = { onSubmit: PropTypes.func.isRequired, onChange: PropTypes.func.isRequired, };
import axios from "axios"; import React, { useState } from "react"; import { useHistory } from "react-router"; import { link } from "../../Proxy/proxy"; function SignUp() { const history = useHistory(); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [confpassword, setconfPassword] = useState(""); const [firstName, setfirstName] = useState(""); const [mobileNumber, setMobileNumber] = useState(""); const [lastName, setlastName] = useState(""); const [message, setMessage] = useState(""); const [showMessage, setShowMessage] = useState(false); const reqSignUp = (e) => { e.preventDefault(); const signup = async () => { const url = `${link}/signup`; await axios .post(url, { email: email, password: password, firstName: firstName, lastName: lastName, mobileNumber: mobileNumber, active: "true", role: "employee", }) .then((res) => { localStorage.setItem("token", res.data[1].token); history.push("/"); }) .catch((err) => { // console.log(err.response.data[0].error); setMessage(err.response.data[0].error); setShowMessage(true); }); }; if (password === confpassword) { signup(); } else { setShowMessage(true); setMessage("Passwords Do Not Match!"); } }; return ( <div className="cover"> <div className="container"> <h1 className="h3 mb-3 fw-normal">Water Management Portal</h1> <h1 className="h1 mb-3 fw-normal">Sign Up</h1> {showMessage && ( <div className="alert alert-danger" role="alert"> {message} </div> )} <form onSubmit={reqSignUp}> <label className="form-label">First Name</label> <input type="text" maxLength="15" onChange={(e) => setfirstName(e.target.value)} required className="form-control" ></input> <label className="form-label">Last Name</label> <input type="text" maxLength="15" onChange={(e) => setlastName(e.target.value)} required className="form-control" ></input> <label className="form-label">Email</label> <input type="email" onChange={(e) => setEmail(e.target.value)} required className="form-control" ></input> <label className="form-label">Mobile Number</label> <input type="text" maxLength="10" onChange={(e) => setMobileNumber(e.target.value)} required className="form-control" ></input> <label className="form-label">Password</label> <input type="password" maxLength="30" onChange={(e) => setPassword(e.target.value)} required className="form-control" ></input> <label className="form-label">Confirm Password</label> <input type="password" maxLength="30" onChange={(e) => setconfPassword(e.target.value)} required className="form-control" ></input> <button type="submit" className="btn btn-primary my-3"> Sign Up </button> </form> <a href="/login">Already Have An Account?</a> </div> </div> ); } export default SignUp;
//@ts-check import { useRef, useMemo, useState, useEffect, useCallback } from "react"; import { mixClass, build, getDisplayName, SemanticUI, } from "react-atomic-molecule"; import { useDebounce, useMounted } from "reshow-hooks"; import scrollStore from "../../stores/scrollStore"; import fastScrollStore from "../../stores/fastScrollStore"; /** * @typedef {object} ScrollSpyProps */ /** * @param {ScrollSpyProps} props */ const useScrollSpy = (props) => { /** * monitorScroll use in store, in component just for reset props. */ const { noDelay = false, monitorScroll = true, attachDestRetry = 20, id, scrollMargin, children, container, className, attachDest, ...restProps } = props; const [targetId, setTargetId] = useState(id); const _mount = useMounted(); const lastEl = useRef(); /** @type {React.MutableRefObject<object>} */ const lastConfig = useRef({}); lastConfig.current = { ...lastConfig.current, id: targetId, attachDest: lastConfig.current.attachDest || attachDest, monitorScroll, scrollMargin, }; const nextContainer = useRef(); useEffect(() => { const store = noDelay ? fastScrollStore : scrollStore; const id = store.scroller.attach(expose); lastConfig.current.store = store; setTargetId(id); return () => { store.scroller.detach(expose); }; }, []); const warnDebounce = useDebounce( /** * @param {object} args */ (args) => { // for lazy render component, that warn delay 1.5 secs. if (!lastEl.current && _mount()) { // maybe could get lastEl late. console.warn( 'Please use SemanticUI. props.container -> import {SemanticUI} from "react-atomic-molecule"', args ); } }, 1500 ); const getOffsetEl = useCallback(() => { if (lastEl.current) { return lastEl.current; } else { warnDebounce({ targetId, container: nextContainer.current }); } }, [targetId]); const expose = { lastConfig, getOffsetEl, detach: () => lastConfig.current.store.scroller.detach(expose), getId: () => lastConfig.current.id, setId: setTargetId, getAttachDest: () => lastConfig.current.attachDest, /** * @param {object} attachDest the scroll-node */ setAttachDest: (attachDest) => (lastConfig.current.attachDest = attachDest), getMonitorScroll: () => lastConfig.current.monitorScroll, getScrollMargin: () => lastConfig.current.scrollMargin, getAttachDestRetry: () => attachDestRetry, }; restProps.id = targetId; restProps.refCb = lastEl; restProps.className = mixClass(className, "spy-tar-" + targetId); return { targetId, className, children, container, noDelay, nextContainer, restProps, }; }; /** * @param {ScrollSpyProps} props */ const ScrollSpy = (props) => { const { targetId, children, container, noDelay, nextContainer, restProps } = useScrollSpy(props); return useMemo(() => { const hasScrollReceiver = "ScrollReceiver" === getDisplayName(children) ? true : false; let nextProps; if (hasScrollReceiver) { nextContainer.current = children; nextProps = { ...children.props, ...restProps, targetId, container, noDelay, }; } else { nextContainer.current = container || SemanticUI; nextProps = { ...restProps, children, }; } return build(nextContainer.current)(nextProps); }, [children, targetId]); }; export default ScrollSpy;
// 引入Vue import Vue from 'vue' // 引入vue-router import router from './router' // 引入axios import axios from 'axios' // 引入json-bigint import JSONBig from 'json-bigint' // 给axios做配置 axios.defaults.baseURL = 'http://ttapi.research.itcast.cn/mp/v1_0/' // axios请求拦截器 axios.interceptors.request.use(function (config) { // config是对象,可以理解为 axios.defaults,可以给config做配置 // 给所有axios请求统一配置token,token需要通过http头协议信息形式传递 // console.log(config) var token = window.sessionStorage.getItem('token') if (token) { config.headers.Authorization = 'Bearer ' + token } return config }, function (error) { return Promise.reject(error) }) axios.defaults.transformResponse = [function (data) { // 对服务器返回的第一手数据data做处理,该数据本质是 字符串对象 // 服务器端会返回两种类型: // 1) 字符串对象 '{xxx:xxx}' // 2) 空字符串 '' if (data) { return JSONBig.parse(data) } else { return data } }] // axios响应拦截器 axios.interceptors.response.use(function (response) { // 正常的响应逻辑处 // response代表服务器端返回的信息 // console.log(2222, response) return response }, function (error) { // 如果出现token过期401错误,那么要执行此处代码 // console.dir(error.response.status=======401) if (error.response.status === 401) { // 强制登录系统 // this.$router.push({ name: 'login' }) router.push({ name: 'login' }) } return Promise.reject(error) }) Vue.prototype.$http = axios
/** * The MIT License (MIT) * Copyright (c) 2016, Jeff Jenkins @jeffj. */ const React = require('react'); const ArticleActions = require('../actions/ArticleActions'); const ArticleStore = require('../stores/ArticleStore'); const NotFound = require('./NotFound.react'); const Messages = require('./Messages.react'); const PageSelection = require('./PageSelection.react'); const PageSearch = require('./PageSearch.react'); const PageArticle = require('./PageArticle.react'); const ToolTip = require('./ToolTip.react'); const ReactCSSTransitionGroup = require('react-addons-css-transition-group'); const parse = require('url-parse'); const Loader = require('react-loader'); const MAIN_KEY ='MAIN_KEY'; const CONNECTED_KEY ='CONNECTED_KEY'; import { Link } from 'react-router'; /** * Retrieve the current ARTICLES data from the ArticleStore */ function getState(id, Cid) { return { page: ArticleStore.getById(id), connectedPage: ArticleStore.getById(Cid) }; } const PageMain = React.createClass({ contextTypes:{ router: React.PropTypes.object.isRequired }, getInitialState: function() { return getState(this.props.params.id); //Using the antipattern to pass the id from the URL }, componentDidMount: function() { if (!this.state.page){ ArticleActions.getById(this.props.params.id); } ArticleStore.addChangeListener(this._onChange); //Manual data entry for dev const data = { "MAIN_KEY":{"selectedParagraphIndex":0,"selectedIndex":[105,119]}, "CONNECTED_KEY":{"selectedParagraphIndex":0,"selectedIndex":[0,100]} } this.connectedID = '572c11aed64ba8b71f05e831'; this.setState({ selection:data }); const that= this; setTimeout(function(){ ArticleActions.getById(that.connectedID); },500) //End Manual data entry for dev }, componentWillUnmount: function() { ArticleStore.removeChangeListener(this._onChange); }, componentWillReceiveProps: function(nextProps) { if (nextProps.params.id !== this.props.params.id){ ArticleActions.getById(nextProps.params.id); } }, /** * @return {object} */ render :function() { const that = this; const pageData = this.state.page; const connectedPageData = this.state.connectedPage; const selection = this.state.selection; const id = this.props.params.id; if (pageData===null){return <NotFound />}//null means the api gave us a 404. else if (!pageData){return <Loader />}//undefined means that no request for the article has been made. const errorMessage = this.state._messages? ( <Messages messages={this.state._messages} type="danger" /> ) : null; //Rendering a warning message. const mainSelection = selection && selection[MAIN_KEY]? selection[MAIN_KEY]: null; const mainPage = mainSelection? <ReactCSSTransitionGroup transitionEnterTimeout={500} transitionLeaveTimeout={500} transitionAppear={true} transitionName="link" transitionAppearTimeout={500} > <a onClick={this._onCancelSelectionMain} href="javascript:void(0);"> <span className="glyphicon glyphicon-arrow-left" /> back </a> <PageSelection page={pageData} paragraph={mainSelection.selectedParagraphIndex} index={mainSelection.selectedIndex}/> <hr className="divider"/> </ReactCSSTransitionGroup>: <PageArticle linkId={this.state.lid} id={id} page={pageData} refresh={this._refreshPage} onToolTipClick={this._onToolTipClick.bind(this, MAIN_KEY)} />; const pageSearch = mainSelection && connectedPageData===undefined? <ReactCSSTransitionGroup transitionEnterTimeout={500} transitionLeaveTimeout={500} transitionAppear={true} transitionName="link" transitionAppearTimeout={500} > <PageSearch className="page-search" onSelect={this._onSelectLinkedPage} /> </ReactCSSTransitionGroup>: null; const connectedSelection = selection && selection[CONNECTED_KEY]? selection[CONNECTED_KEY]: null; const button = this.state.saving? <div className='link-loader'><Loader /></div>: <button onClick={this._save} className="btn btn-primary connect-action" >Create Link</button>; //&nbsp;<Loader options={{radius: 4, length:5, color: '#FFF', lines: 10, width: 3}}/> var connectedPage; if (connectedPageData && connectedSelection){ connectedPage = <div> {button} <ReactCSSTransitionGroup transitionEnterTimeout={500} transitionLeaveTimeout={500} transitionAppear={true} transitionName="link" transitionAppearTimeout={500} > <a onClick={this._onCancelSearch} href="javascript:void(0);" className="pull-right cancel-search"> <span className="glyphicon glyphicon-remove-circle" /> </a> <PageSelection page={connectedPageData} paragraph={connectedSelection.selectedParagraphIndex} index={connectedSelection.selectedIndex}/> </ReactCSSTransitionGroup> </div>; } else if (connectedPageData){ connectedPage = <div> {button} <a onClick={this._onCancelSearch} href="javascript:void(0);" className="pull-right cancel-search"> <span className="glyphicon glyphicon-remove-circle" /> </a> <PageArticle id={id} page={connectedPageData} onToolTipClick={this._onToolTipClick.bind(this, CONNECTED_KEY) } /> </div> } return <div> <section className="container"> {errorMessage} <div className="content main"> {mainPage} {pageSearch} {connectedPage} </div> </section> </div> }, /** * Event handler for 'change' events coming from the PageStore */ _onCancelSelectionMain: function() { this.connectedID = null; this.setState({ selection: null, connectedPage: undefined }); }, /** * Event handler for 'change' events coming from the PageStore */ _onCancelSearch: function() { const selection = this.state.selection; selection[CONNECTED_KEY]=null; this.setState({ selection: selection, connectedPage: undefined }); }, /** * Event handler for 'change' events coming from the PageStore */ _onToolTipClick: function(key ,selectedParagraphIndex, selectedIndex) { var data = this.state.selection || {}; data[key]={}; data[key].selectedParagraphIndex = selectedParagraphIndex; data[key].selectedIndex = selectedIndex; if (key==CONNECTED_KEY){ window.scroll(0,0); } this.setState({ selection: data }); }, /** * Event handler for 'change' events coming from the PageStore */ _onSelectLinkedPage: function(id) { this.connectedID = id; ArticleActions.getById(id); }, /** * Event handler for 'change' events coming from the PageStore */ _refreshPage: function() { let id = this.props.params.id; ArticleActions.getById(id); }, /** * Event handler for 'change' events coming from the PageStore */ _onChange: function() { const id = this.props.params.id; const connectedID = this.connectedID; const state = getState(id, connectedID)//getState(null, this.props.params.id)// state.lid=this.props.params.lid; const errors = ArticleStore.getErrors() if (errors.length>0) { //Errors from page action need to be displayed. this.setState({ _messages: errors }); } else { this.setState(state); } }, /** * Event handler for 'change' events coming from the PageStore */ _save: function() { const id = this.props.params.id; const cId = this.connectedID; const data = this.state.selection; const selectedParagraphIndexMain = data[MAIN_KEY].selectedParagraphIndex; const selectedIndexMain = data[MAIN_KEY].selectedIndex; const selectedParagraphIndexConnected = data[CONNECTED_KEY]?data[CONNECTED_KEY].selectedParagraphIndex:null; const selectedIndexConnected = data[CONNECTED_KEY]?data[CONNECTED_KEY].selectedParagraphIndex:null; this.setState({ _saving: true }); //Placeholder till we figure out hwo to reset the page and ge tthe link showing this._onCancelSelectionMain(); ArticleActions.createLink( id, cId, selectedParagraphIndexMain, selectedIndexMain, selectedParagraphIndexConnected, selectedIndexConnected ); }, /** * Event handler for 'imgError' events coming from the Page DOM */ _imgError:function(e){ e.target.remove(); } }); module.exports = PageMain;
import React from 'react' import { StyleSheet, Platform, Image, Text, View, Button, FlatList } from 'react-native' import firebase from 'firebase' export default class Doigtes extends React.Component { constructor(){ super() //firebase.auth() this.state={doigtes:[], chargement:true} } componentDidMount(){ const ref = firebase.database().ref('doigtes') ref.on('value', (snapshot) => { this.setState({doigtes: snapshot.val(), chargement:false}) }); } render(){ if(this.state.chargement){ return( <Text>Chargement en cours</Text> ) } else{ const array = Object.values(this.state.doigtes); return( <View style={styles.container}> <FlatList data={array.sort((a,b) => a.rang.localeCompare(b.rang))} keyExtractor={(item) => item.nom.toString()} renderItem={({item}) => <View><Text style={styles.titre}>{item.nom}</Text> <Image source={{uri:item.pic}} style={styles.pic} resizeMode="contain"/> </View>} /> </View> ) } } } const styles = StyleSheet.create({ container: { flex: 1 }, titre:{ fontSize:25, fontWeight:'bold', textAlign:'center', }, pic:{ width: '100%', height: 75 } })
/** eslint-disable react/require-render-return,react/jsx-no-undef **/ /** * Created by liu 2018/5/14 **/ import React, {Component} from 'react'; import {storeAware} from 'react-hymn'; import {Spin, Layout, DatePicker, message, Button} from 'antd'; import TableView from '../../components/TableView' import Breadcrumb from '../../components/Breadcrumb.js' import CustomFormView from "../../components/CustomFormView"; import TradeEntrustSearch from '../../components/SearchView/TradeEntrustSearch.js' import {tradeEntrustList, tradeOrderListExcel} from '../../requests/http-req.js' import {EntrusState} from '../../networking/ConfigNet.js' import Number from '../../utils/Number.js' import math from 'mathjs' import moment from 'moment' var {MonthPicker, RangePicker} = DatePicker; var {Sider, Footer, Content} = Layout; var sortedInfo = null const columns = [ { width: 70, title: '序号', fixed: 'left', dataIndex: 'index', }, { title: '用户ID', key: 'left', dataIndex: 'userId', } , { title: '币对', dataIndex: 'coinCode', key: 'coinCode', render: (text, r) => { return <div>{text.toUpperCase()}</div> } }, { title: '订单号', dataIndex: 'orderNo', key: 'orderNo', }, { title: '类型', dataIndex: 'tradeType', render: (text, r) => { return <div>{text == 1 ? '限价' : '市价'}</div> } } , { title: '方向', dataIndex: 'position', key: 'position', render: (text, r) => { return <div>{text == 1 ? '卖出' : '买入'}</div> } } , { title: '状态', dataIndex: 'status', render: (text, r) => { return <div>{getEntrusStateText(text)}</div> } } , { title: '交易手续费', dataIndex: 'poundageAmount', key: 'poundageAmount', render: (text, r) => { return <div>{Number.scientificToNumber(text)}</div> } }, { title: '委托价格', dataIndex: 'tradePrice', key: 'tradePrice', }, { title: '委托量', // dataIndex: 'tradeAmount', key: 'tradeAmount', }, { title: '委托总额', //价格*数量 key: 'bwithdrawCash', render: (text, r) => { return <div>{Number.mul(r.tradeAmount, r.tradePrice)}</div> // return <div>{Number.scientificToNumber(math.multiply(parseFloat(r.tradeAmount), parseFloat(r.tradePrice)))}</div> } }, { title: '已成交', dataIndex: 'dealAmount', key: 'dealAmount', }, { //未成交数量 title: '未成交',//交易总量-成交量 dataIndex: 'unDealAmount', key: 'unDealAmount', render: (text, r) => { // return <div>{r.tradeAmount - r.dealAmount}</div> return <div>{Number.sub(r.tradeAmount, r.dealAmount)}</div> } } , { title: '成交均价', dataIndex: 'dealPrice', key: 'dealPrice', }, { title: '成交总额', //dealAmount * 成交均价 dataIndex: 'AllDealAmount', key: 'AllDealAmount', render: (text, r) => { return <div>{Number.mul(r.dealPrice, r.dealAmount)}</div> // return <div>{math.multiply(parseFloat(r.dealPrice), parseFloat(r.dealAmount))}</div> } } , { title: '更新时间', dataIndex: 'updateTime', key: 'updateTime', }, { title: '创建时间', dataIndex: 'createTime', key: 'createTime', } ]; const getEntrusStateText = (text) => { let tem = '00' EntrusState.forEach(item => { if (item.dicKey == text) { tem = item.dicName } }) return tem } const data = null export default class TradeEntrust extends Component { constructor(props) { super(props); this.state = { showLoading: false, pageNo: 0, pageSize: 10, total: 0, data: [] } } componentWillMount() { this.state.showLoading = true; } componentDidMount() { this.getData() } //tradeEntrust renderSearchView = () => { return ( <CustomFormView/> ) } onChangePagintion = (e) => { this.setState({pageNo: e}, () => { this.getData() }) } renderUserList = () => { return ( <Spin spinning={this.state.showLoading}> <div style={{display: 'flex', flexDirection: 'column', marginTop: '20px', marginBottom: '20px'}}> <Button style={{width: 65, marginBottom: 5, marginLeft: 5}} onClick={() => this.tradeOrderListExcel()}>导出</Button> <TableView minWidth={2100} columns={columns} data={this.state.data} total={this.state.total} pageNo={this.state.pageNo} pageSize={this.state.pageSize} onChangePagintion={this.onChangePagintion}/> </div> </Spin> ) } renderBreadcrumb = () => { const pathname = window.location.pathname return ( <Breadcrumb data={pathname}/> ) } handleSearch = (values, id) => { //console.log(values) this.state.pageNo = 0 // let beginTime = values.date && values.date[0] ? JSON.stringify(values.date[0]).slice(1, 11).replace(/-/g, '/') : null // let endTime = values.date && values.date[1] ? JSON.stringify(values.date[1]).slice(1, 11).replace(/-/g, '/') : null // values.beginTime = beginTime // values.endTime = endTime values.userId = id this.searchData = values //console.log(values) this.getData() } getData() { tradeEntrustList({ pageNo: this.state.pageNo, pageSize: this.state.pageSize, orderNo: this.searchData && this.searchData.orderNo && this.searchData.orderNo.trim() || null, userId: this.searchData && this.searchData.userId || null, coinCode: this.searchData && this.searchData.coinCode || null, position: this.searchData && this.searchData.position || null, status: this.searchData && this.searchData.tradeStatus || null, beginTime: this.searchData && this.searchData.beginTime || null, endTime: this.searchData && this.searchData.endTime || null, }).then((req) => { //console.log(req) if (req.status == 200) { req.data.data.forEach((item, index) => { item.index = this.state.pageNo == 0 ? (index + 1) : (this.state.pageNo - 1) * 10 + index + 1 }) this.setState({ showLoading: false, total: req.data.total, data: req.data.data }, () => { //console.log(this.state.data) }) } }) } tradeOrderListExcel() { if (!this.state.data || this.state.data.length == 0) { message.warning('没有数据') return } tradeOrderListExcel({ pageNo: 0, pageSize: 0, orderNo: this.searchData && this.searchData.orderNo && this.searchData.orderNo.trim() || null, userId: this.searchData && this.searchData.userId || null, coinCode: this.searchData && this.searchData.coinCode || null, position: this.searchData && this.searchData.position || null, status: this.searchData && this.searchData.tradeStatus || null, beginTime: this.searchData && this.searchData.beginTime || null, endTime: this.searchData && this.searchData.endTime || null, }).then(result => { if (result.status === 200) { var url = window.URL.createObjectURL(result.data); var a = document.createElement('a'); a.href = url; a.download = moment().format('YYYYMMDD_HHMMSS') + ".xlsx"; a.click(); } this.setState({showLoading: false}) }).catch(e => { if (e) { message.error('导出失败') this.setState({showLoading: false}) } }) } render() { return ( <div className='center-user-list'> {this.renderBreadcrumb()} <TradeEntrustSearch handleSearch={this.handleSearch}/> {this.renderUserList()} </div> ) } }
import { graphql } from 'react-apollo' import gql from 'graphql-tag' import objFragment from '../fragments/obj' export const ObjQuery = gql` query ObjQuery($objId: ID!) { obj(id: $objId) { ...ObjFragment } } ${objFragment} ` const queryConfig = { options: ({ objId }) => ({ variables: { objId } }), props: ({ ownProps, data }) => ({ ...ownProps, ...data }) } export default graphql(ObjQuery, queryConfig)
const express = require("express"); const app = express(); const { checkErr, correctPath, borrarImagen, borrarArchivo, deleteDir, findData, } = require("../funts"); const { verificaToken } = require("../middelwares/authentication"); const Dir = require("../models/dir"); const File = require("../models/file"); const fs = require("fs"); const path = require("path"); const fileUpload = require("express-fileupload"); const { findByIdAndDelete } = require("../models/dir"); const file = require("../models/file"); app.use(fileUpload()); app.post("/upload/:path", verificaToken, async(req, res) => { if (!req.files) { return res.json({ ok: false, err: { message: "sube un archivo" }, }); } let file = req.files.avatar; let pathFileFolder = correctPath(req.params.path); var fileName = file.name; const pathFile = path.resolve( __dirname, "../../uploads/", req.user._id.toString(), pathFileFolder ); if (fs.existsSync(pathFile + "\\" + fileName)) { let num = 0; do { num += 1; let ext = fileName.split("."); let a = ext.length - 1; let extension = ext[a]; ext.pop(); ext.push(num.toString()); var nameWExt = ""; ext.forEach((element) => { console.log(element); nameWExt = nameWExt.concat(element.toString()); }); nameWExt = nameWExt.concat(".", extension); fileName = nameWExt; } while (fs.existsSync(pathFile + "\\" + fileName)); console.log(fileName); } console.log(pathFile + fileName); file.mv(pathFile + "\\" + fileName, (err) => { if (err) { return res.status(500).json({ ok: false, err, }); } else { var file = new File({ nombre: fileName, path: pathFile, creator: req.user._id, }); file.save((err, filedb) => { //checkErrAndDelete(res, err, `${req.user._id.toString()}/${pathFileFolder}/${fileName}`) if (err) { borrarImagen( `${req.user._id.toString()}/${pathFileFolder}/${fileName}` ); return res.status(500).json({ ok: false, err, }); } return res.json({ ok: true, archivo: filedb, }); }); } }); }); app.post("/dir/:path/:nameDir", verificaToken, (req, res) => { let pathDirFolder = correctPath(req.params.path); let pathName = req.params.nameDir.replace("-", "/"); let name = pathName.split("/"); name = name[name.length - 1]; const pathDir = path.resolve( __dirname, "../../uploads/", req.user._id.toString(), pathDirFolder, pathName ); let pathDb = path.resolve( __dirname, "../../uploads/", req.user._id.toString(), pathDirFolder ); fs.mkdir(pathDir, (err) => { if (err) { return res.status(400).json({ ok: false, err, }); } else { console.log(pathName); var dir = new Dir({ nombre: name, path: pathDb, creator: req.user._id, }); dir.save((err, dirdb) => { checkErr(res, err); return res.json({ ok: true, archivo: dirdb, }); }); } }); }); app.get("/getData/:path", verificaToken, async(req, res) => { let pathToGet = correctPath(req.params.path); let pathDir = path.resolve( __dirname, "../../uploads", req.user._id.toString(), pathToGet ); findData(res, pathDir); }); app.delete("/file/:id", verificaToken, (req, res) => { let id = req.params.id; borrarArchivo(id, res); }); app.delete("/dir/:id", verificaToken, (req, res) => { let id = req.params.id; deleteDir(res, id); }); module.exports = app;
angular.module('app') .controller('UserListController', function($location, $state, UserService) { const vm = this; vm.users = UserService.getAll(); vm.search = lastName => { vm.users = UserService.getAll({lastName}); }; const errorCallback = err => { vm.msg=`${err.data.message}`; }; const deleteCallback = () => { $state.reload(); }; vm.deleteUser = (user) => { UserService.deleteUser(user) .then(deleteCallback) .catch(errorCallback); }; vm.redirectToUserEdit = userId => { $location.path(`/admin/user-edit/${userId}`); }; vm.redirectToUserReservations = userId => { $location.path(`/admin/user/reservations/${userId}`); }; });
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Provides the ClientIdentifier class definition. */ angular.module('client').factory('ClientIdentifier', ['$injector', function defineClientIdentifier($injector) { // Required services var authenticationService = $injector.get('authenticationService'); var $window = $injector.get('$window'); /** * Object which uniquely identifies a particular connection or connection * group within Guacamole. This object can be converted to/from a string to * generate a guaranteed-unique, deterministic identifier for client URLs. * * @constructor * @param {ClientIdentifier|Object} [template={}] * The object whose properties should be copied within the new * ClientIdentifier. */ var ClientIdentifier = function ClientIdentifier(template) { // Use empty object by default template = template || {}; /** * The identifier of the data source associated with the object to * which the client will connect. This identifier will be the * identifier of an AuthenticationProvider within the Guacamole web * application. * * @type String */ this.dataSource = template.dataSource; /** * The type of object to which the client will connect. Possible values * are defined within ClientIdentifier.Types. * * @type String */ this.type = template.type; /** * The unique identifier of the object to which the client will * connect. * * @type String */ this.id = template.id; }; /** * All possible ClientIdentifier types. * * @type Object.<String, String> */ ClientIdentifier.Types = { /** * The type string for a Guacamole connection. * * @type String */ CONNECTION : 'c', /** * The type string for a Guacamole connection group. * * @type String */ CONNECTION_GROUP : 'g', /** * The type string for an active Guacamole connection. * * @type String */ ACTIVE_CONNECTION : 'a' }; /** * Converts the given ClientIdentifier or ClientIdentifier-like object to * a String representation. Any object having the same properties as * ClientIdentifier may be used, but only those properties will be taken * into account when producing the resulting String. * * @param {ClientIdentifier|Object} id * The ClientIdentifier or ClientIdentifier-like object to convert to * a String representation. * * @returns {String} * A deterministic String representation of the given ClientIdentifier * or ClientIdentifier-like object. */ ClientIdentifier.toString = function toString(id) { return $window.btoa([ id.id, id.type, id.dataSource ].join('\0')); }; /** * Converts the given String into the corresponding ClientIdentifier. If * the provided String is not a valid identifier, it will be interpreted * as the identifier of a connection within the data source that * authenticated the current user. * * @param {String} str * The String to convert to a ClientIdentifier. * * @returns {ClientIdentifier} * The ClientIdentifier represented by the given String. */ ClientIdentifier.fromString = function fromString(str) { try { var values = $window.atob(str).split('\0'); return new ClientIdentifier({ id : values[0], type : values[1], dataSource : values[2] }); } // If the provided string is invalid, transform into a reasonable guess catch (e) { return new ClientIdentifier({ id : str, type : ClientIdentifier.Types.CONNECTION, dataSource : authenticationService.getDataSource() || 'default' }); } }; return ClientIdentifier; }]);
import React from 'react' import PropTypes from 'prop-types' import styled from 'styled-components' const Bar = styled.div` width: 100vw; height: 10vh; position: fixed; z-index: 1; display: flex; justify-content: center; align-items: center; transition-duration: 0.2s; &.white { background-color: white; box-shadow: 0 0px 12px 0px black; } ` const Categories = styled.div` width: 45%; position: absolute; right: 15%; display: flex; justify-content: space-evenly; align-items: center; color: white; font-size: 1.6rem; transition-duration: 0.5s; &.closed { transform: translateX(50%); opacity: 0; } &.scrolledDown { color: black; } @media screen and (max-width: 580px) { padding: 1rem; right: unset; font-size: 2rem; display: flex; flex-direction: column; top: 0; width: 100%; background-color: white; box-shadow: 0 0px 12px 0px black; color: black; &.closed { background-color: unset; box-shadow: none; transform: translateY(-5rem); opacity: 0; color: white; } } ` const Category = styled.p` :hover { cursor: pointer; } @media screen and (max-width: 580px) { font-weight: 300; margin: 0.6rem 0; } ` const BurgerHolder = styled.div` position: absolute; right: 0; width: 10%; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; :hover { cursor: pointer; } @media screen and (max-width: 900px) { width: 18%; } @media screen and (max-width: 580px) { width: 28%; } ` const Burger = styled.div` background-color: #000000ba; justify-content: center; align-items: center; display: flex; height: 70%; width: 60%; transition-duration: 0.2s; &:before { content: ""; border-top: 4px solid white; border-bottom: 4px solid white; width: 40%; max-width: 90px; position: absolute; height: 11px; transition-duration: 0.2s; transform: translateY(-7px) } &.X:before { height: 0; border-top: unset; transform: rotateZ(-45deg) translateX(-1px) translateY(-1px); border-width: 3px; } &:after { content: ""; border-bottom: 4px solid white; position: absolute; width: 40%; max-width: 90px; height: 31px; transition-duration: 0.2s; } &.X:after { transform: rotateZ(45deg) translateY(-14px); border-width: 3px; } &.scrolledDown { background-color: white; &:after,:before { border-color: black; } } @media screen and (max-width: 580px) { &.X { background-color: unset; } &.X:before { border-color: black; } &.X:after { border-color: black; } &:before { width: 35%; } &:after { width: 35%; } } ` class Menu extends React.Component { constructor(props) { super(props) this.state = { menuOpen: false, scrolledDown: false } } toggleMenu = () => { this.setState(prev => ({ menuOpen: !prev.menuOpen })) } componentDidMount() { window.addEventListener('scroll', this.handleScroll) } componentWillUnmount() { window.removeEventListener('scroll', this.handleScroll) } handleScroll = () => { const height = window.scrollY const { scrolledDown } = this.state if (!scrolledDown && height > 10) { this.setState({ scrolledDown: true }) } else if (scrolledDown && height === 0) { this.setState({ scrolledDown: false }) } } onCategoryClick = anchor => { this.props.scrollTo(anchor) this.setState(prev => ({ ...prev, menuOpen: false })) } render() { const { menuOpen, scrolledDown } = this.state return ( <Bar className={scrolledDown && menuOpen ? 'white' : ''}> <Categories className={menuOpen ? scrolledDown ? 'scrolledDown' : '' : 'closed'}> <Category onClick={() => this.onCategoryClick('summary')} >Vad vi gör</Category> <Category onClick={() => this.onCategoryClick('people')} >Om oss</Category> <Category onClick={() => this.onCategoryClick('cases')} >Case</Category> </Categories> <BurgerHolder onClick={this.toggleMenu}> <Burger className={menuOpen ? scrolledDown ? 'X scrolledDown' : 'X' : ''} /> </BurgerHolder> </Bar> ) } } Menu.propTypes = { scrollTo: PropTypes.func.isRequired } export default Menu
import React, { Component } from 'react' import { StyleSheet, View, Image, Text, FlatList,TouchableOpacity} from 'react-native' import { connect } from 'react-redux' import {forEach, map} from 'lodash' import * as ScreenUtil from '../utils/ScreenUtil' import { NavigationActions, createAction } from '../utils' import { Tabs, List, WhiteSpace } from 'antd-mobile' var Platform = require('Platform'); const Item = List.Item; const Brief = Item.Brief; @connect(({ money }) => ({ ...money })) class OrderNaigator extends Component { state = { } static navigationOptions = { headerTitle: ( <Text style={{ fontSize: ScreenUtil.setSpText(20), alignSelf: 'center', textAlign: 'center', flex: 1,color: '#FF6600', }} >交易记录</Text> ), headerRight: <View />, } gotoDetail = () => { this.props.dispatch(NavigationActions.navigate({ routeName: 'Detail' })) } onTabChange = (tab, index) => { const date = new Date() switch(index){ case 0: date.setDate(date.getDate()-3); this.props.dispatch(createAction('money/myMoneyFlow')({ startDate:this.getStartOfDate(date), endDate:this.getEndOfDate(new Date()), })) break; case 1: date.setDate(date.getDate()-7); this.props.dispatch(createAction('money/myMoneyFlow')({ startDate:this.getStartOfDate(date), endDate:this.getEndOfDate(new Date()), })) break; case 2: date.setDate(date.getMonth() - 1); this.props.dispatch(createAction('money/myMoneyFlow')({ startDate:this.getStartOfDate(date), endDate:this.getEndOfDate(new Date()), })) break; default: break; } } onItemClick = (value) => { //this.props.dispatch(NavigationActions.navigate({ routeName: 'MoneyFlowDetail', params:{orderRecord:value.orderRecordCode} })) } tabs2 = [ { title: '近三天' }, { title: '一周内'}, { title: '一月内' }, ]; getStartOfDate = (date) => { return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' 00:00:00'; } getEndOfDate = (date) => { return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' 23:59:59'; } convertType = (busiType) => { switch (busiType) { case "WORK": return "业务收入" break; case "IVT": return "邀请收入" break; case "BZJ": return "保证金余额支出" break; case "TX": return "提现支出" break; case "TK": return "退款收入" break; case "BZJ-WC": return "保证金微信支付" break; case "BZJ-ALI": return "保证金支付宝支付" break; default: return "其他" break; } } componentDidMount = () => { const date = new Date() date.setDate(date.getDate()-3); this.props.dispatch(createAction('money/myMoneyFlow')({ startDate:this.getStartOfDate(date), endDate:this.getEndOfDate(new Date()), })) } render() { const {moneyFlow} = this.props console.log(moneyFlow) return ( <View style={{flex:1}}> <Tabs tabs={this.tabs2} initialPage={0} onChange={this.onTabChange} renderTab={tab => <Text>{tab.title}</Text>} style={{flex:1,minHeight:16}} /> <View style={{flex:20}}> <FlatList data={moneyFlow} extraData={this.state} keyExtractor={(item, index) => ''+item.id} renderItem={({item})=><Item key={'item'+item.id} style={{marginBottom:1}} onClick={() => this.onItemClick(item)} arrow="horizontal" thumb={<View style={{alignItems:'center',marginRight:ScreenUtil.setSpText(10)}}> <TouchableOpacity disabled={true} style={{width:ScreenUtil.setSpText(32),height:ScreenUtil.setSpText(32), backgroundColor:'#336699',color:'#ffffff',alignContent:'center', alignItems:'center',borderRadius:5,borderWidth:0,paddingTop:Platform.OS === 'android'?0:ScreenUtil.setSpText(5)}}> <Text style={{fontSize:ScreenUtil.setSpText(20),color:'#ffffff'}}> {item.amount>0 ? '入':'出'} </Text> </TouchableOpacity> </View>} multipleLine> {`${item.amount} 类型:${this.convertType(item.busiType)}`} <Brief>时间:{item.recordTime}</Brief> </Item>}> </FlatList> </View> </View> ) } } const styles = StyleSheet.create({ container: { flex: 1, alignItems: 'center', justifyContent: 'center', }, icon: { width: ScreenUtil.setSpText(28), height: ScreenUtil.setSpText(28), }, tabView: { flex:1, display: 'flex', alignItems: 'center', justifyContent: 'flex-start', }, list: { width: '100%' } }) export default OrderNaigator
var searchData= [ ['ia',['ia',['../classplayer.html#ab5c7590da844e3e2128868820ab9ec45',1,'player']]], ['id',['id',['../classplayer.html#a5862f005a5367e1b0dc19bdf2846fd34',1,'player']]], ['info',['info',['../classnoeud.html#ad6e70a2d7350a11040d53468eaa40510',1,'noeud']]] ];
define(["jquery", "knockout", "durandal/app", "durandal/system", "plugins/router", "services/data", "moment", "utils/utils"], function ($, ko, app, system, router, data, moment, utils) { var // Properties taskName = ko.observable(''), TIME_FORMAT = "DD.MM.YYYY HH:mm:ss", tId, projectId, error = ko.observable(''), isRunning = ko.observable(false), timer, started = ko.observable('N/A'), ended = ko.observable('N/A'), elapsedTime, elapsed = ko.observable('00:00:00'), formatTime = function (timeDiff) { }, startTimer = function() { isRunning(true); timer = setInterval(function () { elapsedTime += 1; elapsed(utils.formatTime(elapsedTime)); }, 1000, true); }, // Handlers start = function () { if (isRunning()) return; data.startTask(tId).done(startTimer).fail(function (err) { error(err.responseText); }); }, pause = function () { if (!isRunning()) return; data.stopTask(tId).done(function (task) { elapsedTime = task.ElapsedSeconds; formatTime(elapsedTime); ended(moment(task.EndTime).format(TIME_FORMAT)); isRunning(false); clearInterval(timer); }).fail(function () {}); }, stop = function () { pause(); router.navigate("#tasks/" + projectId); }, // Lifecycle activate = function (taskId) { error(''); return data.getLastTaskRun(taskId).done(function (task) { tId = task.ID; projectId = task.ProjectID; taskName(task.Name); elapsedTime = task.ElapsedSeconds; elapsed(utils.formatTime(elapsedTime)); started(task.StartTime ? moment(task.StartTime).format(TIME_FORMAT) : 'N/A') ended(task.EndTime ? moment(task.EndTime).format(TIME_FORMAT): 'N/A') if (task.IsRunning) { startTimer(); } }).fail(function () {}); }, deactivate = function () { clearInterval(timer); }; ko.computed return { // Place your public properties here activate: activate, deactivate: deactivate, taskName: taskName, start: start, pause: pause, stop: stop, elapsed: elapsed, isRunning: isRunning, error: error, started: started, ended: ended }; });
import React, { Component } from "react"; import { connect } from "react-redux"; import RouletteBoard from "components/RouletteBoard"; import { Typography } from "components"; import redColors from "../../../../RouletteGameCard/redColors"; import classNames from "classnames"; import _ from 'lodash'; import "./index.css"; class RouletteDetails extends Component { constructor(props){ super(props); this.state = { betHistory: [], number: null }; } componentDidMount(){ this.projectData(this.props); } componentWillReceiveProps(props){ this.projectData(props); } projectData = async (props) => { const { bet } = this.props; const number = bet.outcomeResultSpace.index; const result = bet.result; const betHistory = result.map( el => { return { cell : el._id.place, chip : el._id.value.toFixed(3) } }); this.setState({ betHistory, number }); } render() { const { betHistory, number } = this.state; const resultStyles = classNames("result", { green: number == 0, red: redColors.includes(number) }); return ( <div styleName="container"> <div styleName={resultStyles}> <Typography variant="body" color="white"> {number} </Typography> </div> <RouletteBoard betHistory={betHistory} rotating={false} isAddChipDisabled={true} /> </div> ); } } function mapStateToProps(state){ return { profile: state.profile, ln : state.language }; } export default connect(mapStateToProps)(RouletteDetails);
'use strict'; var gulp = require('gulp'); var gulpLoadPlugins = require('gulp-load-plugins'); var browserSync = require('browser-sync'); var plugins = gulpLoadPlugins(), reload = browserSync.reload, BROWSER_SYNC_RELOAD_DELAY = 500, paths = { js: ['*.js', 'app.js', 'test/**/*.js', '!test/coverage/**', 'routes/**/*.js', 'public/javascripts/**/*.js', 'modules/**/*.js'], html: ['views/**/*.*'], css: ['public/stylesheets/style.scss'], cssDest: ['public/stylesheets'], sass: ['public/stylesheets/*.scss'], publicPath: ['public/**/*.*']}; // TODO: Define env variables and ports globally gulp.task('lint', function () { return gulp.src(paths.js) // .pipe(reload({stream: true, once: true})) // eslint() attaches the lint output to the eslint property // of the file object so it can be used by other modules. .pipe(plugins.eslint()) // eslint.format() outputs the lint results to the console. // Alternatively use eslint.formatEach() (see Docs). .pipe(plugins.eslint.format()) // To have the process exit with an error code (1) on // lint error, return the stream and pipe to failOnError last. .pipe(plugins.eslint.failOnError()); }); // Lint JavaScript gulp.task('jshint', function () { return gulp.src(paths.js) // .pipe(reload({stream: true, once: true})) .pipe(plugins.jshint()) .pipe(plugins.jshint.reporter('jshint-stylish')) // .pipe(plugins.jshint.reporter('default')) .pipe(plugins.jshint.reporter('fail')); }); gulp.task('sass', function () { return gulp.src(paths.css) .pipe(plugins.sass()) .pipe(gulp.dest(paths.cssDest[0])) .pipe(reload({stream: true})); }); gulp.task('mochaTest', ['jshint', 'lint'], function () { return gulp.src(paths.js[2], {read: false}) .pipe(plugins.mocha({ reporter: 'spec' })); }); gulp.task('coverage', ['mochaTest'], function (cb) { gulp.src([paths.js[1], paths.js[4], paths.js[5], paths.js[6]]) .pipe(plugins.istanbul()) // Covering files .pipe(plugins.istanbul.hookRequire()) // Force `require` to return covered files .on('finish', function () { gulp.src(paths.js[2], {read: false}) .pipe(plugins.mocha({ reporter: 'spec' })) .pipe(plugins.istanbul.writeReports()) // Creating the reports after tests runned .pipe(plugins.istanbul.enforceThresholds({ thresholds: { global: 80 } })) // Enforce a coverage of at least 90% .on('end', cb); }); }); gulp.task('browser-sync', ['mochaTest', 'sass', 'nodemon'], function() { browserSync.init({ proxy: 'http://localhost:5000', files: [paths.publicPath], browser: 'google chrome', port: 7000 }); gulp.watch(paths.sass, ['sass', reload]); gulp.watch(paths.js, ['mochaTest']); }); gulp.task('nodemon', ['mochaTest'], function (cb) { var called = false; return plugins.nodemon({ script: paths.js[1], watch: [paths.js, paths.html] }) .on('start', function () { if (!called) { cb(); } called = true; }) .on('restart', function onRestart() { // reload connected browsers after a slight delay setTimeout(function reload() { browserSync.reload({ stream: false }); }, BROWSER_SYNC_RELOAD_DELAY); }); }); gulp.task('default', ['browser-sync'], function() { // place code for your default task here });
/* eslint-disable no-underscore-dangle */ const { getUser, updateUser, deleteUser, createUser } = require('./userController'); const User = require('../models/userModel'); jest.mock('../models/userModel.js'); describe('Given a function createUser', () => { let req; let res; beforeEach(() => { req = { body: {} }; res = { status: jest.fn(), send: jest.fn(), json: jest.fn() }; }); test('Then should call res.json', () => { const newUser = new User(req.body); newUser.save.mockImplementationOnce((callback) => { callback(false); }); createUser(req, res); expect(res.json).toHaveBeenCalled(); }); test('Then should call res.send', () => { const newUser = new User(req.body); newUser.save.mockImplementationOnce((callback) => { callback(true); }); createUser(req, res); expect(res.send).toHaveBeenCalled(); }); }); describe('Given a function getUser', () => { let req; let res; beforeEach(() => { res = { status: jest.fn(), send: jest.fn(), json: jest.fn() }; }); test('Then should call res.json', async () => { req = { body: { _id: 2 } }; User.findById.mockReturnValueOnce({ exec: jest.fn() }); await getUser(req, res); expect(res.json).toHaveBeenCalled(); }); test('Then should call res.send', async () => { req = { body: { _id: null } }; User.findById.mockReturnValueOnce(() => { throw new Error('Not found'); }); await getUser(req, res); expect(res.send).toHaveBeenCalled(); }); }); describe('Given a function deleteUser', () => { let req; let res; beforeEach(() => { res = { status: jest.fn(), send: jest.fn(), json: jest.fn() }; }); test('Then should call res.json', async () => { req = { body: { _id: 2 } }; User.findByIdAndDelete.mockReturnValueOnce({ exec: jest.fn() }); await deleteUser(req, res); expect(res.json).toHaveBeenCalled(); }); test('Then should call res.send', async () => { req = { body: { _id: null } }; User.findByIdAndDelete.mockReturnValueOnce(() => { throw new Error('Could not delete the user'); }); await deleteUser(req, res); expect(res.send).toHaveBeenCalled(); }); }); describe('Given a function updateUser', () => { let req; let res; beforeEach(() => { res = { status: jest.fn(), send: jest.fn(), json: jest.fn() }; }); test('Then should call res.json', async () => { req = { body: { _id: 2, name: 'John' } }; User.findByIdAndUpdate.mockReturnValueOnce({ exec: jest.fn() }); await updateUser(req, res); expect(res.json).toHaveBeenCalled(); }); test('Then should call res.send', async () => { req = { body: { _id: 2, name: 'John' } }; User.findByIdAndUpdate.mockReturnValueOnce(() => { throw new Error('Could not update'); }); await updateUser(req, res); expect(res.send).toHaveBeenCalled(); }); });
import React from 'react'; import './RecipeLinks.css'; import { Link } from 'react-router-dom'; //<a href={'/recipe/' + this.state[3].title}> this.state[3].title </a> // <a href={'/recipe/' + this.state[2].title}> this.state[2].title </a> class RecipeLinks extends React.Component { constructor(props){ super(props); this.state = {RecipeList : []}; } componentDidMount() { fetch('http://localhost:3001/api/recipe') .then(res => res.json()) .then(data => this.setState({ RecipeList : data })); } render () { console.log(this.state); console.log(this.state[3] && this.state[3].title); return ( <div className='RecipeLinks'> <h2>Recipes</h2> <body className='recipe-body'> <h3 className='recipe-h3'> Food </h3> <div className='links'> { this.state.RecipeList && this.state.RecipeList.slice(2,4).map(item => { return ( <Link to={'/recipe/' + item.title}> {item.title} </Link> );} )} </div> <h3 className='recipe-h3'> Dessert </h3> <div className='links'> { this.state.RecipeList && this.state.RecipeList.slice(0,1).map(item => { return ( <Link to={'/recipe/' + item.title}> {item.title} </Link> );} )} </div> <h3 className='recipe-h3'> Drinks </h3> <div className='links'> { this.state.RecipeList && this.state.RecipeList.slice(1,2).map(item => { return ( <Link to={'/recipe/' + item.title}> {item.title} </Link> );} )} </div> </body> </div> ); } } export default RecipeLinks;
import * as d3 from 'd3'; export const chartStock = function (tickerSym, ajaxResponse, investment){ debugger; let data, startDate, endDate, minPrice, maxPrice, priceVariable; if (Object.keys(ajaxResponse)[0] === "history"){ data = ajaxResponse["history"] .reverse() .map(quote => ({ date: quote["timestamp"], value: quote["value"]})); startDate = data[0].date; endDate = data[data.length - 1].date; data.forEach(point => { if (!minPrice || minPrice > point.value) { minPrice = point.value; } if (!maxPrice || maxPrice < point.value) { maxPrice = point.value; } }); priceVariable = "value"; } else { const quotes = ajaxResponse["Time Series (Daily)"]; const dates = Object.keys(quotes).sort(); startDate = dates[0]; endDate = dates.slice(-1); data = dates.map(date => { return { date: date, open: parseFloat(quotes[date]["1. open"]), close: parseFloat(quotes[date]["4. close"]), low: parseFloat(quotes[date]["3. low"]), high: parseFloat(quotes[date]["2. high"]), volume: parseInt(quotes[date]["5. volume"]) }; }); let minClose, minOpen, minLow, minHigh, maxClose, maxOpen, maxLow, maxHigh; data.forEach(dayStat => { if (!minClose || minClose > dayStat.close) { minClose = dayStat.close; } if (!maxClose || maxClose < dayStat.close) { maxClose = dayStat.close; } if (!minOpen || minOpen > dayStat.open) { minOpen = dayStat.open; } if (!maxOpen || maxOpen < dayStat.open) { maxOpen = dayStat.open; } if (!minLow || minLow > dayStat.low) { minLow = dayStat.low; } if (!maxLow || maxLow < dayStat.low) { maxLow = dayStat.low; } if (!minHigh || minHigh> dayStat.high) { minHigh = dayStat.high; } if (!maxHigh || maxHigh < dayStat.high) { maxHigh = dayStat.high; } }); minPrice = minClose; maxPrice = maxClose; priceVariable = 'close'; } const metaData = ajaxResponse["Meta Data"]; //Chart dimensions const margin = { top: 70, bot: 50, left: 50, right: 50 }; const width = 900 - margin.left - margin.right; const height = 600 - margin.top - margin.bot; //Formats const legendFormat = d3.timeFormat('%b %d, %Y'); //Calculate with investment const units = investment ? (investment / data[0][priceVariable]) : 1; // Scale const xScale = d3.scaleTime() .domain([new Date(startDate), new Date(endDate)]) .range([0,width]); // const x = d3.time.scale().range([0, width]); const yScale = d3.scaleLinear() .domain([units * minPrice - maxPrice * 0.05, units * maxPrice + maxPrice * 0.05]) .range([height, 0]); //Axes const xAxis = d3.axisBottom(xScale); const yAxis = d3.axisLeft(yScale); //Line function const priceLine = d3.line() .x(function(d) { return xScale(new Date(d.date)); }) .y(function(d) { return yScale(units * d[priceVariable]); }); //svg const svg = d3.select('chart').append('svg') .attr('class', 'svg-chart') .attr('width', width + margin.left + margin.right) .attr('height', height + margin.top + margin.bot); const g = svg.append('g') .attr('transform', `translate(${margin.left}, ${margin.top})`); //Append axes const xAxisGroup = g.append('g') .attr('transform', `translate(0, ${height})`) .call(xAxis); const yAxisGroup = g.append('g') .call(yAxis); //Append price line svg.append('path') .attr('d', priceLine(data)) .attr('stroke', 'blue') .attr('stroke-width', 1) .attr('transform', `translate(${margin.left}, ${margin.top})`) .attr('fill', 'none'); //Statistics and legend bars above chart const legend = svg.append('g') .attr('class', 'legend') .attr('width', width) .attr('height', 30) .attr('transform', `translate(${margin.left}, 30)`); legend.append('text') .attr('class', 'ticker') .text(`${tickerSym.toUpperCase()}`); const dateRange = legend.append('g') .attr('class', 'date-selection') .style('text-anchor', 'end') .attr('transform', `translate(${width}, 0)`); dateRange.append('text') .text(`${legendFormat(new Date(startDate))} - ${legendFormat(new Date(endDate))}`); const tooltip = legend.append('g') .attr('class', 'tooltip') .style('text-anchor', 'end') .attr('transform', `translate(${width}, 30)`); const tooltipText = tooltip.append('text'); //For hover effects const focus = g.append('g') .attr('class', 'focus') .style('display', 'none'); svg.append('rect') .attr('transform', `translate(${margin.left}, ${margin.top})`) .attr('class', 'overlay') .attr('width', width) .attr('height', height) .on("mouseover", function() { focus.style("display", null); }) .on("mouseout", function() { focus.style("display", "none"); }) .on('mousemove', mousemove); focus.append('line') .attr('class', 'x-hover-line hover-line') .attr('y1', 0) .attr('y2', height); focus.append('line') .attr('class', 'y-hover-line hover-line') .attr('x1', 0) .attr('x2', 0); focus.append('circle').attr('r', 4.5); focus.append('text') .attr('x', 15) .attr('dy', '.31em'); // Mouse move handler function mousemove(){ const x0 = xScale.invert(d3.mouse(this)[0]); const bisectDate = d3.bisector( function(d) { return new Date(d.date); }).left; const i = bisectDate(data, x0, 1); const d0 = data[i - 1]; const d1 = data[i]; const d = x0 - d0.date > d1.date - x0 ? d1 : d0; focus.attr('transform', `translate(${xScale(new Date(d.date))}, ${yScale(units * d[priceVariable])})`); focus.select('text').text(() => d[priceVariable]); focus.select('.x-hover-line').attr('y2', height - yScale(units * d[priceVariable])); focus.select('.y-hover-line').attr('x1', - xScale(new Date(d.date))); tooltipText.text(`${tooltipTextFormat(d)}`); } function tooltipTextFormat(d){ if (priceVariable === 'value'){ return `${legendFormat(new Date(d.date))} - Price: ${d.value}`; } else { return `${legendFormat(new Date(d.date))} - Open: ${d.open}, Close: ${d.close}, High: ${d.high}, Low: ${d.low}`; } } };
/** * Created by duoyi on 2016/8/30. */ var db=require('../models'); exports.getCommentsByMessageId=function (option){ var msgId=option.msgId; return db.comment.findAll({where:{msgId:msgId},order:[['creatAt','DESC']],raw:true}); } exports.getMessageFrowardComment=function (option) { var msgId=option.msgId; var isForward=option.isForward; return db.comment.findAll({where:{msgId:msgId,isForward:isForward},order:[['creatAt','DESC']],raw:true}); } exports.createComment=function (comment) { return db.comment.create(comment); }
const arrow = document.querySelector('.arrow'); const authorPanel = document.querySelector('.author-panel'); const avatar = document.querySelector('.avatar'); const postInfo = document.querySelector('.post-info'); const shareButton = document.querySelector('.share-button'); const shareLabel = document.querySelector('.share'); const socialButtons = document.querySelector('.social'); const body = document.querySelector('body'); const post = document.querySelector('.post'); const image = document.querySelector('.image'); function toggleSharePanel() { if (!shareButton.classList.contains('medium')) { //darken background of authorPanel authorPanel.classList.add('dark'); //switch to dark button; //background of button shareButton.classList.add('medium'); //arrow on button arrow.classList.add('brighten'); //hide avatar avatar.classList.add('hidden'); //hide postInfo postInfo.classList.add('hidden'); //unhide shareLabel shareLabel.classList.remove('hidden'); //unhide socialButtons socialButtons.classList.remove('hidden'); } else { authorPanel.classList.remove('dark'); shareButton.classList.remove('medium'); arrow.classList.remove('brighten'); avatar.classList.remove('hidden'); postInfo.classList.remove('hidden'); shareLabel.classList.add('hidden'); socialButtons.classList.add('hidden'); } } function hideSharePanel() { if (shareButton.classList.contains('medium')) { authorPanel.classList.remove('dark'); shareButton.classList.remove('medium'); arrow.classList.remove('brighten'); avatar.classList.remove('hidden'); postInfo.classList.remove('hidden'); shareLabel.classList.add('hidden'); socialButtons.classList.add('hidden'); } } shareButton.addEventListener('click', toggleSharePanel); post.addEventListener('click', hideSharePanel); image.addEventListener('click', hideSharePanel);
import React from 'react' import CreateScene from './Create' import ViewScene from './View' const Scene = ({ id }) => ( <> {id ? ( <ViewScene id={id} /> ) : ( <CreateScene /> )} </> ) export default Scene
import React from 'react' import { Jumbotron, Button } from 'react-bootstrap' const DefaultAskQuestion = (props) => ( <Jumbotron> <h2>Hello you!</h2> <p>You want to ask a question too? Don't be shy, register!</p> <p> <button className="reg-btn-color" onClick={props.register}>Register</button> </p> </Jumbotron> ) export default DefaultAskQuestion;
// var sum = 0; // function addToSum(num) { // sum += num; // } // var arr = [1,2,3]; // myForEach = (array, func) => { // for(let i = 0; i < array.length; i++){ // let currentElem = array[i]; // action() // } // } // myForEach(arr, addToSum); // console.log(sum); // 6 // var arr = [1, 2, 3, 4, 5, 6]; // function isEven(num) { // return num % 2 === 0; // } // var filtered = myFilter(arr, isEven); // console.log(filtered); // [2, 4, 6] // console.log(arr); // [1, 2, 3, 4, 5, 6] // var arr = [1,2,3,4]; // myReduce = (array, func){ // array.forEach // } // var sum = myReduce(arr, function(a, b) { // return a + b; // }, 0); // console.log(sum) // 10 // console.log(arr) // [1,2,3,4]
export default [ { prop: 'mixin', label: '分享内容', //rule: { required: false, message: '分享内容为必填项', trigger: 'blur' }, render(h) { h = this.$root.$createElement //, { icon: 'ios-videocam', label: '视频', name: 'video' } const uploadType = [{ icon: 'image', label: '图片', name: 'image' }, { icon: 'android-image', label: '文字', name: 'Text' }] return <share-content ref="sharecontentwidget" v-model={ this.model } uploadType={ uploadType }></share-content> } }, { prop: 'content', label: '朋友圈内容', default:"", rule: { required: true, message: '朋友圈内容为必填项', trigger: 'blur' }, render(h) { return <limit-word-num-textarea v-model={this.model}></limit-word-num-textarea> } }, // { // prop: 'replyText', // label: '评论', // default:"", // rule: { required: true, message: '分享文案为必填项', trigger: 'blur' }, // render(h) { // return <limit-word-num-textarea v-model={ this.model }></limit-word-num-textarea> // } // }, { prop: 'mode', label: '可见情况', default: '0', render(h) { return <radio-group v-model={this.model}> <radio label='0'>全部用户可见</radio> <radio label='1'>仅标签用户可见</radio> </radio-group> } }, { prop: 'customIDs', label: '执行账号', default: '已选择5个运营号', rule: { required: true, message: '设备为必填项', trigger: 'blur' }, render(h) { h = this.$root.$createElement //return <div>选择</div> return <choose v-model={ this.model } ref="choosewidget"></choose> } }, { prop: 'actionTime', label: '发送时间', render(h) { return <date-picker v-model={ this.model } format='yyyy-MM-dd HH:mm:ss' type='datetime' placeholder='请选择发送时间' style='width: 80%'></date-picker> } } ]
import React, { useState, useEffect } from 'react'; import { Link } from 'react-router-dom'; import './Home.css'; import './Pokedex.css'; function App() { const[type, setType] = useState("all"); const [pokemonType, setPokemonType] = useState([]); const [pokemons, setPokemons] = useState([]); const [pokemonsId, setPokemonsId] = useState([]); const [pokemonsSprite, setPokemonsSprite] = useState([""]); const [pokemonsFirstType, setPokemonsFirstType] = useState([]); const [pokemonsSecondType, setPokemonsSecondType] = useState([]); const [scrollTop, setScrollTop] = useState(false); const [originalpokemons, setoriginalPokemons] = useState([]); const [namesearch, setNameSearch] = useState([""]); const [offset, setOffset] = useState(0); const [limit, setLimit] = useState(50); useEffect( () => { if (type === "all") { fetch(`https://pokeapi.co/api/v2/pokemon?offset=${offset}&limit=${limit}`, { method: 'GET', }).then((response) => response.json()) .then((responseJson) => { setPokemons(responseJson.results); setoriginalPokemons(responseJson.results); setScrollTop(true); }) .catch((error) => alert(JSON.stringify(error))); } }, [offset,limit,type]); useEffect( () => { if (pokemons.length > 0) { Promise.all(pokemons.map((item) => fetch(item.url, { method: 'GET', }).then((item) => item.json()))) .then((allResponse) => { setPokemonsId(allResponse.map((item) => item.id)); setPokemonsFirstType(allResponse.map((item) => item.types).map((item) => item[0].type.name)); setPokemonsSecondType(allResponse.map((item) => item.types).map((item) => item.length === 2 && item[1].type.name)); setPokemonsSprite(allResponse.map((item) => item.sprites).map((item) => item.front_default)); }) .catch((error) => { console.log(error) }) } }, [pokemons]); useEffect( () => { if(type !== "all") { fetch(`https://pokeapi.co/api/v2/type/${type}`, { method: 'GET', }).then((response) => response.json()) .then((responseJson) => { let offlimit = limit + offset; setPokemonType(responseJson.pokemon.slice(offset,offlimit)); setScrollTop(true); console.log(responseJson.pokemon.slice(offset,offlimit)) console.log(offlimit) }) .catch((error) => alert(JSON.stringify(error))); } }, [type,offset,limit]) useEffect( () => { Promise.all(pokemonType.map((item) => fetch(item.pokemon.url, { method: 'GET', }).then((item) => item.json()))) .then((allResponse) => { setPokemonsId(allResponse.map((item) => item.id)); setPokemonsFirstType(allResponse.map((item) => item.types).map((item) => item[0].type.name)); setPokemonsSecondType(allResponse.map((item) => item.types).map((item) => item.length === 2 && item[1].type.name)); setPokemonsSprite(allResponse.map((item) => item.sprites).map((item) => item.front_default)); setPokemons(allResponse.map((item) => item)) setoriginalPokemons(allResponse.map((item) => item)) }) .catch((error) => alert(JSON.stringify(error))); }, [pokemonType]) useEffect(() => { window.scrollTo(0,0); setScrollTop(false); },[scrollTop]) const changeType = e => { setType(e.target.value); setOffset(0); } const changeLimit = e => { setLimit(parseInt(e.target.value)); } const handleSearchByName = async (input) => { setNameSearch(input); const newData = originalpokemons.filter(function(item) { const itemData = item.name ? item.name.toLowerCase() : ''.toLowerCase(); const textData = input.toLowerCase(); return itemData.indexOf(textData) > -1; }); setPokemons(newData); } function Buttons() { return ( <nav className="navigation"> <button className="arrow arrow_prev" onClick={ () => {setOffset(offset => offset > 0 && offset - limit); setScrollTop(true) }}>Previous</button> <div className="filters"> <span>Type : </span> <select className="type-select" value={type} onChange={changeType}> <option defaultValue value="all" > All Types</option> <option value="normal">Normal</option> <option value="fighting">Fighting</option> <option value="flying">Flying</option> <option value="poison">Poison</option> <option value="ground">Ground</option> <option value="rock">Rock</option> <option value="bug">Bug</option> <option value="ghost">Ghost</option> <option value="steel">Steel</option> <option value="fire">Fire</option> <option value="water">Water</option> <option value="grass">Grass</option> <option value="electric">Electric</option> <option value="psychic">Psychic</option> <option value="ice">Ice</option> <option value="dragon">Dragon</option> <option value="dark">Dark</option> <option value="fairy">Fairy</option> </select> <span> Limit : </span> <select className="limit-select" value={limit} onChange={changeLimit}> <option value="10">10</option> <option value="20">20</option> <option value="30">30</option> <option value="40">40</option> <option defaultValue="50">50</option> </select> </div> <button className="arrow arrow_next" onClick={ () => { setOffset(offset => offset + limit) ; setScrollTop(true) }}>Next</button> <input placeholder="Pokemon name..." onChange={(e) => handleSearchByName(e.target.value)} value={namesearch} /> </nav> ) } function Pokedex() { return ( <div className="pokedex"> { pokemons.map((item, index) => <div key={index} className="pokemon" > <div className="pokemon-sprite"> <img alt={item.name} src={pokemonsSprite[index]}></img> </div> <div className="pokemon-infos"> <span>n° { pokemonsId[index] } - </span> <Link className="pokemon-name" to={`/pokemon/${item.name}`}>{ item.name }</Link> </div> <div className="pokemon-types"> <div className="types"> <span className={pokemonsFirstType[index]}> { pokemonsFirstType[index] }</span> { pokemonsSecondType[index] && <span className={pokemonsSecondType[index]}>{pokemonsSecondType[index] }</span> } </div> </div> </div>) } </div> ) } return( <div className="mainPokedex"> <Buttons /> <Pokedex /> </div> ); } export default App;
const request = require('request'); const parseDomain = require('parse-domain'); const NlpProcess = require('./nlpProcess'); function converse(storage, bot, message){ storage.users.get(message.user,function(err, user) { // console.log("--------------------converse------------------"); if (err) { // console.log("----------------error found-------------------------"); return; } if (!user) { // console.log("----------------user not found-------------------------"); user = { id: message.user, team: message.team }; storage.users.save(user); } let prevCompany = user.previous_company || null; // Process Chat NlpProcess.chat(prevCompany, message.text, (err, company, response) => { // console.log("-------------------------get callback----------------------") // console.log(company); // console.log(response); if( !company ){ return bot.reply(message, response); } user.previous_company = company.domain || prevCompany || null; storage.users.save(user,function(err, id) { return bot.reply(message, response); }); }); }); } module.exports = { converse };
var express = require('express'), db = require('../../common/database'), router = express.Router(), data = null, newList = {}; function formatUser(key, data) { return { 'userId': key, 'username': data.username || 'Anonymous', 'status': data.status || 'Offline', 'avatar': data.avatar || null, 'game': data.game || null, 'streamurl': data.streamurl || null } } router.get('/', function(req, res) { // list users var data = db.getSnapshot(); for (member in data) { newList[member] = formatUser(member, data[member]); } var viewObject = { 'rows': [{ 'template': 'rows/userRow', 'data': newList }] } console.log(viewObject.rows[0].data); res.render('home', viewObject); }); router.get('/user/:userid', function(req, res) { var userid = req.params.userid; var data = db.getRowInfo(userid); var Viewdata = { 'userId': key, 'username': data.username || 'Anonymous', 'status': data.status || 'Offline', 'avatar': data.avatar || null, 'game': data.game || null, 'streamurl': data.streamurl || null, 'games': data.games || null, 'streams': data.streams || null } var viewObject = { 'data': Viewdata } console.log(data); res.render('user', viewObject); }); module.exports = router
function t_slidesInit(recid) { var el = $('#rec' + recid), windowWidth = $(window).width(), sliderItem = el.find('.t-slides__item'), sliderWrapper = el.find('.t-slides__items-wrapper'), sliderArrows = el.find('.t-slides__arrow_wrapper'), sliderWidth = el.find('.t-slides__container').width(), firstSlide = sliderItem.filter(':first'), lastSlide = sliderItem.filter(':last'), totalSlides = sliderItem.length, sliderDoResize, pos = 1; $(window).resize(function() { if (sliderDoResize) clearTimeout(sliderDoResize); sliderDoResize = setTimeout(function() { windowWidth = $(window).width(); sliderWidth = el.find('.t-slides__container').width(); t_slides_setSliderWidth(recid, sliderWidth, totalSlides); slideMove() }, 200) }); firstSlide.before(lastSlide.clone(true).attr('data-slide-index', '0')); lastSlide.after(firstSlide.clone(true).attr('data-slide-index', totalSlides + 1).removeClass('t-slides__item_active')); t_slides_setSliderHeight(recid); t_slides_setSliderWidth(recid, sliderWidth, totalSlides); if (980 > windowWidth) { sliderWrapper.css({ transform: 'translate3d(-' + (sliderWidth * pos) + 'px, 0, 0)' }) } else { sliderWrapper.css('transform', '') } el.find('.t-slides__arrow_wrapper-right').click(function() { if (!$(this).is('.t-slides__arrow-clicked')) { $(this).addClass('t-slides__arrow-clicked'); slideRight() } }); el.find('.t-slides__arrow_wrapper-left').click(function() { if (!$(this).is('.t-slides__arrow-clicked')) { $(this).addClass('t-slides__arrow-clicked'); slideLeft() } }); el.find('.t-slides__bullet').click(function() { pos = $(this).attr('data-slide-bullet-for'); slideMove() }); function slideLeft() { pos--; slideMove() } function slideRight() { pos++; slideMove() } function slideMove() { sliderWrapper.addClass('t-slides_animated'); if (980 > windowWidth) { sliderWrapper.css({ transform: 'translate3d(-' + (sliderWidth * pos) + 'px, 0, 0)' }) } else { sliderWrapper.css('transform', '') } if (pos == (totalSlides + 1)) { pos = 1 } if (pos == 0) { pos = totalSlides } setTimeout(function() { sliderWrapper.removeClass('t-slides_animated'); if (980 > windowWidth) { sliderWrapper.css({ transform: 'translate3d(-' + (sliderWidth * pos) + 'px, 0, 0)' }) } else { sliderWrapper.css('transform', '') } $('.t-slides__arrow_wrapper').removeClass('t-slides__arrow-clicked') }, 300); t_slides_setActiveBullet(recid, pos); t_slides_setActiveSlide(recid, pos); t_slides_setSliderHeight(recid) } delete Hammer.defaults.cssProps.userSelect; hammer = new Hammer(el.find('.t-slides__items-wrapper')[0], { domEvents: true, threshold: 0, direction: Hammer.DIRECTION_VERTICAL }); hammer.on('pan', function(event) { if (980 > windowWidth) { var distance = event.deltaX, percentage = 100 / totalSlides * event.deltaX / $(window).innerWidth(), sensitivity = 20; t_slides_scrollImages(recid, (sliderWidth * pos) - distance); if (event.isFinal) { if (event.velocityX > 1) { slideLeft() } else if (event.velocityX < -1) { slideRight() } else { if (percentage <= -(sensitivity / totalSlides)) { slideRight() } else if (percentage >= (sensitivity / totalSlides)) { slideLeft() } else { slideMove() } } } } }) } function t_slides_scrollImages(recid, distance) { var el = $('#rec' + recid), value = (distance < 0 ? "" : "-") + Math.abs(distance).toString(); el.find(".t-slides__items-wrapper").css("transform", "translate3d(" + value + "px, 0, 0)") } function t_slides_setActiveBullet(recid, pos) { var el = $('#rec' + recid), bullet = el.find('.t-slides__bullet'), bulletActive = el.find('.t-slides__bullet[data-slide-bullet-for="' + pos + '"]'); bullet.removeClass('t-slides__bullet_active'); bulletActive.addClass('t-slides__bullet_active') } function t_slides_setActiveSlide(recid, pos) { var el = $('#rec' + recid), slide = el.find('.t-slides__item'), slideActive = el.find('.t-slides__item[data-slide-index="' + pos + '"]'); slide.removeClass('t-slides__item_active'); slideActive.addClass('t-slides__item_active') } function t_slides_setSliderWidth(recid, sliderWidth, totalSlides) { var el = $('#rec' + recid); el.find('.t-slides__items-wrapper').width(sliderWidth * (totalSlides + 2)); el.find('.t-slides__item').width(sliderWidth) } function t_slides_setSliderHeight(recid) { var el = $('#rec' + recid); el.find('.t-slides__items-wrapper').height(el.find('.t-slides__item_active').height()); el.find('.t-slides__arrow_wrapper').height(el.find('.t-slides__item_active').height()) }
function reverseArray(arr) { arr.reverse(); console.log(arr) } reverseArray(["A", "B", "C"]);
import React from 'react' import { number, boolean } from '@storybook/addon-knobs' import Chart from './chart' export default { title: 'Chart/Line', parameters: { component: Chart, }, } export const Basic = () => ( <Chart id="line" subtitle={boolean('Subtitle', true, 'General option')} customs={{ sortByValues: boolean('Sort by value', false, 'General option') }} size={{ height: 200 }} data={[ { name: 'Column1', main: { value: number('Column1', 6406, {}, 'Value') }, }, { name: 'Column2', main: { value: number('Column2', 3999, {}, 'Value') }, }, { name: 'Column3', main: { value: number('Column3', 6155, {}, 'Value') }, }, { name: 'Column4', main: { value: number('Column4', 862, {}, 'Value') }, }, { name: 'Column5', main: { value: number('Column5', 3866, {}, 'Value') }, }, ]} /> )
import React from "react"; import Nittedal from "../../../images/Nittedal.png"; const Art3 = props => { return ( <div className="balsfjord co" style={{ left: `${props.scrollLeft}` }} > <div className="art"> <img src={Nittedal} alt="" /> <div className="text"> <p> Nittedal kommune leverer «meglerpakke» til både Norkart og Infoland (Ambita) sine løsninger. Vi tok i bruk automatisk produksjon fra Norkart for begge løsningene 2.januar 2017. </p> <p> Automatikken fungerer veldig bra og er svært tidsbesparende. Vi er da også færre som bruker tid på å produsere opplysninger. Den gjør også at feilkildene er minimale og at en sikrer at det er opplysningene som er registrert som blir hentet. Dette gjør oss mer effektive og at de opplysningene som går automatisk kan sluttføres og ekspederes raskere. </p> </div> <div className="author-infobox"> <p className="author-name"> <em>Dag Wågen</em> </p> <p className="role"> <em>Avdelingsingeniør</em> </p> </div> </div> </div> ); }; export default Art3;
import React from 'react'; import { Button, Grid, Typography, TextField, FormControl, FormControlLabel, FormHelperText, Radio, RadioGroup, Collapse, } from '@material-ui/core'; import Autocomplete from '@material-ui/lab/Autocomplete'; //TODO: add real list of schools, organized by state/cities const schools = [ { label: 'Columbia University'}, { label: 'University of Illinois' }, {label: 'Glendale Community College'}, { label: 'Brooklyn College' }] export const SchoolInput = ({setSchool, schools}) => { return ( <Autocomplete id="country-select-demo" style={{ width: 300 }} options={schools} autoHighlight autoComplete disabled={schools.length<1} getOptionLabel={(option) => option} renderOption={(option) => ( <React.Fragment> {option} </React.Fragment> )} onChange={(event, newValue) => { setSchool(newValue); }} renderInput={(params) => ( <TextField {...params} label="Choose a school..." variant="outlined" // inputProps={{ // ...params.inputProps, // autoComplete: 'new-password', // disable autocomplete and autofill // }} /> )} />); }
const API_URL = "http://localhost:8080/api"; import axios from "axios"; import router from "../router"; class AuthService { user = { authenticated: false }; login(context, account, redirect) { const url = `${API_URL}/login/`; axios .post(url, account) .then(response => { localStorage.setItem("token", response.data.token); this.user.authenticated = true; // Redirect to route if (redirect) { router.replace(redirect); } }) .catch(error => { context.alert.toggleOnOff(); context.alert.content = `Failed to login. Error: ${error}`; }); } register(context, account, redirect) { const url = `${API_URL}/account/`; axios .post(url, account) .then(response => { if (response.data) { context.toggleForm(); context.alert.toggleOnOff(); context.alert.content = "Successfully created an account."; } }) .catch(error => { context.alert.toggleOnOff(); context.alert.content = `Failed to login. Error: ${error}`; }); } logout() { localStorage.removeItem("token"); this.user.authenticated = false; router.replace("/login"); } checkAuth() { var hadToken = localStorage.getItem("token"); if (hadToken) { this.user.authenticated = true; } else { this.user.authenticated = false; } } getAuthHeader() { return { accessToken: localStorage.getItem("token") }; } } export default AuthService;
export default { splash: { teaching_kid: '育兒', }, };
mainModule.controller('activityController', function($rootScope, $scope, $routeParams, defaultFactory) { $scope.result = []; $scope.activity = []; $scope.$on('pushActivities', function(event, data) { console.log("received", data); $scope.result = data; }); $scope.submitActivity = function() { $("#activityController").addClass('hidden'); $rootScope.$broadcast('findPath', $scope.activity); } $scope.addActivity = function(data) { if($scope.activity.length < 8) { if($scope.activity.indexOf(data) == -1) { $(".act-" + data.id).removeClass('hidden'); $scope.activity.push(data); } else { $(".act-" + data.id).addClass('hidden'); $scope.activity.splice($scope.activity.indexOf(data), 1); } } else { alert("You'll never get there at that rate! Please choose 8 locations or less."); } } });
'use strict'; module.exports = function (gulp, plugins, config, gutil) { return function () { return gulp.src([ config.viewsPath + '/**/*.html' ]) .pipe(gulp.dest(config.buildFolder + '/views')) .on('error', gutil.log); }; };
import {Component} from "react"; import { styled } from '@material-ui/core/styles'; import { Grid,Card,Typography} from "@material-ui/core"; import {Form,Button} from "react-bootstrap"; import axios from "axios"; import Modal from 'react-bootstrap/Modal' import Payment from "../../Passenger/Payment/Payment"; import { withRouter } from "react-router"; const MyGrid1 = styled(Grid)({ backgroundColor:"white", marginBottom:"2%", padding:"2%" }); const MyGrid2 = styled(Grid)({ width:"80vw", marginTop:"2%", backgroundColor:"White", paddingTop:"5%", paddingLeft:"5%", paddingRight:"5%", paddingBottom:"2%", marginLeft:"10%", }); export class Register extends Component { state = { id:'', firstname: "", lastname: "", email: "", phone: "", type: "Local", password:'', show:false } handleChange = (event) => { const {name,value} = event.target; this.setState({[name]:value}); } onHide = () => { this.setState({show:false}) } handleSubmit = (event) =>{ event.preventDefault(); this.setState({show:true}) }; handleSubmitOfModal = () => { let details = { id:this.state.id, password:this.state.password, firstname: this.state.firstname, lastname: this.state.lastname, email: this.state.email, phone: this.state.phone, type: this.state.type, credit:1000 } axios.post('https://backendtransportsystem.herokuapp.com/passenger/register',details).then(response => { if (response.data.success) { this.setState({show:false}) alert("Registered Successfully") window.location = '/login' } else { alert('Failed to Register') } }) .catch(err => console.log(err)); } render() { return ( <div> <MyGrid2 container spacing={1}> <Card> <Grid item xs={12} style={{marginBottom:"3%",marginTop:"2%"}} > <Typography style={{marginLeft:"40%"}} component="h1" variant="h5"> Create an Account </Typography> </Grid> <MyGrid1 container spacing={3}> <Grid item xs={12} > <Form.Control required id="id" name="id" type="text" placeholder="NIC/Passport Number" fullWidth onChange={this.handleChange} /> </Grid> <Grid item xs={12} > <Form.Control required id="id" name="password" type="password" placeholder="Password" fullWidth onChange={this.handleChange} /> </Grid> <Grid item xs={12} sm={6}> <Form.Control required id="firstname" name="firstname" placeholder="First Name" fullWidth onChange={this.handleChange} /> </Grid> <Grid item xs={12} sm={6}> <Form.Control required id="lastname" name="lastname" placeholder="Last Name" fullWidth onChange={this.handleChange} /> </Grid> <Grid item xs={12} sm={6}> <Form.Control required id="email" name="email" placeholder="Email" fullWidth onChange={this.handleChange} /> </Grid> <Grid item xs={12} sm={6}> <Form.Control required id="phone" name="phone" placeholder="Contact Number" fullWidth onChange={this.handleChange} /> </Grid> <Grid item xs={12} > <Form.Select name="type" placeholder="Passenger Type" onChange={this.handleChange}> <option value="Local" selected>Local</option> <option value="Foreign">Foreign</option> </Form.Select> </Grid> <Grid item xs={12}> <Button size="large" color="primary" variant="primary" style={{marginLeft:"25%",width:"50%"}} onClick={this.handleSubmit} >Register</Button> </Grid> </MyGrid1> </Card> </MyGrid2> <Modal show={this.state.show} onHide={this.onHide} size="lg" aria-labelledby="contained-modal-title-vcenter" centered > <Modal.Header closeButton> <Modal.Title id="contained-modal-title-vcenter"> Payment </Modal.Title> </Modal.Header> <Modal.Body> <Payment/> </Modal.Body> <Modal.Footer> <Button onClick={this.onHide}>Close</Button> <Button onClick={this.handleSubmitOfModal}>Submit</Button> </Modal.Footer> </Modal> </div> ); } } export default withRouter(Register);
//The webpage will prompt you for your slack token! $(document).ready(function() { var url = "https://slack.com/api/"; $("#token").val(getSlackToken()); $("#user-div").hide(); $("#navbar").hide(); $(".home-div").hide(); var ajaxCall = function(apiMethod, options) { return $.ajax(url + apiMethod, options); } $("#verify-token").click(function() { var token = $("#token").val(); var data = {"token":token}; var options = {"data":data,method:"POST"}; ajaxCall("auth.test",options).done(function(result) { if(result.ok) { onVerify(); $("#token-div").hide(); $("#navbar").show(); $(".home-div").show(); } else { alert("Token not valid"); } }); }); var buildMsgData = function(channel,text) { var data = {"token":$("#token").val(), "channel":channel, "text":text}; data.as_user = getAsUser(); if (getBotName()!=="") {data.username = getBotName();} if (getIconUrl()!=="") {data.icon_url = getIconUrl();} return data; } function getAsUser() { return !($("#as-bot").is( ":checked" )); } function getBotName() { return $("#bot-name").val(); } function getIconUrl() { return $("#bot-pic").val(); } function onVerify() { token = $("#token").val().toString(); var data = {"token":token}; var options = {"data":data, method:"POST"}; ajaxCall("channels.list",options).done(function(result) { result.channels.sort(); for (var i=0;i<result.channels.length;i++) { var channelName = result.channels[i].name; var item = $("<li><input type=\"radio\" name=\"channel\" value=\"" + channelName + "\"> " + channelName + "</li>") $("#pub-chan-list").append(item); } ajaxCall("groups.list",options).done(function(result) { for (var i=0;i<result.groups.length;i++) { var channelName = result.groups[i].name; console.log(result.groups[i].id); var item = $("<li><input type=\"radio\" name=\"channel\" value=\"" + result.groups[i].id + "\"> " + channelName + "</li>") $("#pri-chan-list").append(item); } }).done(function(result) { var radioButtons = $("input[name=channel]"); $("#send-msg").click( function() { var chan = radioButtons.filter(":checked").val(); var txt = $("#msg-box").val(); var data = buildMsgData(chan, txt); console.log(chan); var options = {"data":data, method:"POST"}; ajaxCall("chat.postMessage",options).done(function(results) { console.log(results); $("#msg-box").val(""); }); }); }); }); } $("#clear-msg").click( function() { $("#msg-box").val(""); }); $("#nav-home").click(function(){ $("#user-div").hide(); $(".home-div").show(); }); $("#nav-info").click(function(){ $("#user-div").show(); $(".home-div").hide(); }); $("#nav-toggle").click(function(){ $("#pri-chan-list").toggle(); }); });
require('should'); const zapier = require('zapier-platform-core'); const App = require('../index'); const appTester = zapier.createAppTester(App); ` {key: 'url', required: true, type: 'string'}, {key: 'sourceId', required: true, type: 'string'}, {key: 'orgId', required: true, type: 'string'}, {key: 'apiKey', required: true, type: 'string'}, {key: 'platform', required: true, choices: {dev: 'pushdev.cloud.coveo.com', qa: 'pushqa.cloud.coveo.com', prod: 'push.cloud.coveo.com'}} ` describe('pushes', () => { describe('push content', () => { it('should push some text', (done) => { const bundle = { inputData: { docId: 'https://www.youtube.com/watch?v=Y3gC7NizMd4', text: 'some text', sourceId: 'syxjf4ckgric4ndrcd6dpaslum-myorgsarecursed', orgId: 'myorgsarecursed', apiKey: 'xx341750b0-f929-4390-b4ed-f99060810e7f', platform: 'pushdev.cloud.coveo.com' } }; appTester(App.creates.push.operation.perform, bundle) .then((result) => { console.log(result); done(); }) .catch(done); }); }); });
const express = require('express'); const restaurantModel = require('../models/Restaurants'); const app = express(); // find all restaurants // http://localhost:3000/restaurants app.get('/restaurants', async (req, res) =>{ const restaurants = await restaurantModel.find({}); try { res.send(restaurants); } catch (err){ res.status(500).send(err); } }); //http://localhost:3000/restaurants/cuisine/Japanese app.get('/restaurants/cuisine/Japanese', async(req, res)=>{ try{ const restaurants = await restaurantModel. find({}) .where('cuisine').equals('japanese') .select('city cuisine name restaurant_id address ') .exec((err, data)=>{ if(err){ res.send(JSON.stringify({status:false, message:"No resaurants found"})) } else{ res.send(data); } }); } catch (err){ res.status(500).send(err) } }); //http://localhost:3000/restaurants/cuisine/Bakery app.get('/restaurants/cuisine/Bakery', async(req, res)=>{ try{ const restaurants = await restaurantModel. find({}) .where('cuisine').equals('Bakery') .select('city cuisine name restaurant_id address ') .exec((err, data)=>{ if(err){ res.send(JSON.stringify({status:false, message:"No resaurants found"})) } else{ res.send(data); } }); } catch (err){ res.status(500).send(err) } }); //http://localhost:3000/restaurants/cuisine/Italian app.get('/restaurants/cuisine/Italian', async(req, res)=>{ try{ const restaurants = await restaurantModel. find({}) .where('cuisine').equals('Italian') .select('city cuisine name restaurant_id address ') .exec((err, data)=>{ if(err){ res.send(JSON.stringify({status:false, message:"No resaurants found"})) } else{ res.send(data); } }); } catch (err){ res.status(500).send(err) } }); module.exports=app;
function showText() { $('#more').css('display', 'none'); $('#text').css('display', 'inline') }
function icl_get_form_id() { form_id = ""; $("input[name=form_id]").each(function() { if ($(this).attr('id').indexOf('icl') >= 0) { form_id = $(this).val(); } }); return form_id; } function icl_get_form_token() { form_token = ""; $("input[name=form_token]").each(function() { if ($(this).attr('id').indexOf('icl') >= 0) { form_token = $(this).val(); } }); return form_token; } $(document).ready(function(){ // Render reminders form_token = icl_get_form_token(); form_id = icl_get_form_id(); jQuery.ajax({ type: "POST", url: Drupal.settings.icl_reminders_message.ajax_url, data: {icl_translator_ajx_action:'reminders_get', form_id:form_id, form_token:form_token}, cache: false, dataType: 'json', success: function(msg){ if(!msg.error){ $('#icl_reminders_wrapper').html(msg.message).fadeIn(); } } }); }) function iclRemindersInit() { $('.icl_reminders_link_dismiss').click(function() { form_token = icl_get_form_token(); form_id = icl_get_form_id(); var data = {icl_translator_ajx_action:'reminder_dismiss', form_id:form_id, form_token:form_token}; var hide = $(this).parent(); jQuery.ajax({ type: "POST", url: $(this).attr('href'), data: data, cache: false, dataType: 'json', success: function(msg){ if(!msg.error){ if (hide.parent().children('div').length < 2) { hide.parent().fadeOut(); } else { hide.fadeOut().remove(); } } } }); return false; }); $('#icl_reminders_show').click(function() { form_token = icl_get_form_token(); form_id = icl_get_form_id(); var data = {icl_translator_ajx_action:'reminders_show', form_id:form_id, form_token:form_token}; var thisV = $(this); jQuery.ajax({ type: "POST", url: $(this).attr('href'), data: data, cache: false, dataType: 'json', success: function(msg){ if(!msg.error){ thisV.parent().children('div').toggle(); if (thisV.parent().children('div').is(':visible')) { var txtV = Drupal.settings.icl_reminders_message.hide_txt; var hrefV = Drupal.settings.icl_reminders_message.hide_link; } else { var txtV = Drupal.settings.icl_reminders_message.show_txt; var hrefV = Drupal.settings.icl_reminders_message.show_link; } thisV.html(txtV).attr('href', hrefV); } } }); return false; }); }
// @ts-nocheck /* eslint-disable */ /* tslint:disable */ /* prettier-ignore-start */ import React from "react"; import { classNames } from "@plasmicapp/react-web"; export function UploadIcon(props) { const { className, style, title, ...restProps } = props; return ( <svg xmlns={"http://www.w3.org/2000/svg"} className={classNames( "plasmic-default__svg", className, "r-4qtqp9 r-yyyyoo r-1xvli5t r-dnmrzs r-bnwqim r-1plcrui r-lrvibr r-1hdv0qi" )} viewBox={"0 0 24 24"} fill={"currentcolor"} height={"1em"} width={"1em"} style={style} {...restProps} > {title && <title>{title}</title>} <path d={ "M17.53 7.47l-5-5a.749.749 0 00-1.06 0l-5 5a.749.749 0 101.06 1.06l3.72-3.72V15a.75.75 0 001.5 0V4.81l3.72 3.72c.146.147.338.22.53.22s.384-.072.53-.22a.749.749 0 000-1.06z" } ></path> <path d={ "M19.708 21.944H4.292A2.294 2.294 0 012 19.652V14a.75.75 0 011.5 0v5.652c0 .437.355.792.792.792h15.416a.793.793 0 00.792-.792V14a.75.75 0 011.5 0v5.652a2.294 2.294 0 01-2.292 2.292z" } ></path> </svg> ); } export default UploadIcon; /* prettier-ignore-end */
function nextStep(){ // 註冊三個步驟 var step1=document.getElementById("step1"); var step2=document.getElementById("step2"); var step3=document.getElementById("step3"); var upBtn=document.getElementById("upBtn"); var share=document.getElementById("sharePhoto"); var chooseBtn=document.getElementById("chooseBtn"); var controlBar=document.getElementsByClassName("controlBar")[0]; // 判斷式 // 1到2 if (next.innerText=="選擇朋友"){ console.log(2); step1.style.filter="grayscale(100%)"; step2.style.filter="grayscale(0%)"; step3.style.filter="grayscale(100%)"; upBtn.style.display="none"; chooseBtn.style.display="block"; back.style.display="block"; canvas.style.display="none"; controlBar.style.display="none"; power02=true; console.log(power02); next.innerText="編輯塗鴉"; back.innerText="選擇背景"; } // 2到3 else if(next.innerText=="編輯塗鴉"){ console.log(3); step1.style.filter="grayscale(100%)"; step2.style.filter="grayscale(100%)"; step3.style.filter="grayscale(0%)"; back.style.display="block"; upBtn.style.display="none"; chooseBtn.style.display="none"; share.style.display="block"; canvas.style.display="block"; controlBar.style.display="flex"; next.style.display="none"; power02=false; power03=true; back.innerText="選擇朋友"; } } function backStep(){ var step1=document.getElementById("step1"); var step2=document.getElementById("step2"); var step3=document.getElementById("step3"); var upBtn=document.getElementById("upBtn"); var chooseBtn=document.getElementById("chooseBtn"); var share=document.getElementById("sharePhoto"); var controlBar=document.getElementsByClassName("controlBar")[0]; // 2變1 if(back.innerText=="選擇背景"){ console.log("back1"); step1.style.filter="grayscale(0%)"; step2.style.filter="grayscale(100%)"; step3.style.filter="grayscale(100%)"; upBtn.style.display="block"; chooseBtn.style.display="none"; back.style.display="none"; next.innerText="選擇朋友"; } // 3變2 else if(back.innerText=="選擇朋友"){ console.log("back2"); // step3.style.filter="grayscale(0%)"; step1.style.filter="grayscale( 100%)"; step2.style.filter="grayscale(0%)"; step3.style.filter="grayscale(100%)"; back.style.display="block"; next.style.display="block"; upBtn.style.display="none"; chooseBtn.style.display="block"; share.style.display="none"; canvas.style.display="none"; controlBar.style.display="none"; next.innerText="編輯塗鴉"; back.innerText="選擇背景"; } } //將顏色寫到ctx.strokeStyle function changeColor(e){ var color = e.target.id; var color_Pack = document.getElementsByClassName('colorPack')[0]; var colorCode = window.getComputedStyle(e.target).getPropertyValue("background-color"); ctx.strokeStyle = colorCode ; }; //getBoundingClientRect 取得物件完整座標資訊,包含寬高等 function getMousePos(canvas, evt) { var rect = canvas.getBoundingClientRect(); //這個function將會傳回滑鼠在 canvas上的座標 return { x: evt.clientX - rect.left, y: evt.clientY - rect.top }; }; //透過getMousePos function 去取得滑鼠座標 //mousePos 是一個物件,包含x和y的值 function mouseMove(evt) { var mousePos = getMousePos(canvas, evt); //利用取回的值畫線 ctx.lineTo(mousePos.x, mousePos.y); ctx.lineWidth = 10; ctx.stroke(); }; //利用toDataURL() 把canvas轉成data:image $('#save').on('click', function(){ var _url = canvas.toDataURL(); //再把href載入上面的Data:image this.href = _url; }); function $id(id){ return document.getElementById(id); } function init(){ $id("upFile").onchange = function(e){ var file = e.target.files[0]; var reader = new FileReader(); reader.onload = function(){ $id("imgPreview").src = reader.result; } reader.readAsDataURL(file); } var next=document.getElementById("next"); var back=document.getElementById("back"); next.addEventListener("click",nextStep,false); back.addEventListener("click",backStep,false); power01=true; power02=false; power03=false; var canvas = document.getElementById('canvas'); ctx = canvas.getContext('2d'); // 宣告 改變顏色 colors = document.getElementsByClassName('color'); for(var i = 0; i < colors.length; i++){ colors[i].addEventListener('click', changeColor,false)}; var x = 0; var y = 0; //從按下去就會執行第一次的座標取得 canvas.addEventListener('mousedown', function(evt) { var mousePos = getMousePos(canvas, evt); //建立path物件 evt.preventDefault(); ctx.beginPath(); //每次的點用moveTo去區別開,如果用lineTo會連在一起 ctx.moveTo(mousePos.x, mousePos.y); //mousemove的偵聽也在按下去的同時開啟 canvas.addEventListener('mousemove', mouseMove, false); }); //如果滑鼠放開,將會停止mouseup的偵聽 canvas.addEventListener('mouseup', function() { canvas.removeEventListener('mousemove', mouseMove, false); }, false); // 一鍵清除 var clear = document.getElementById("reset"); clear.addEventListener('click', function(){ ctx.clearRect(0,0,canvas.width,canvas.height); },false); console.log("reset"); canvas.addEventListener('touchstart',function(a){ var x = a.touches[0].clientX; var y =a.touches[0].clientY; using = true; lastPoint = {x: x, y: y}; },false); canvas.ontouchmove = function(a){ var x = a.touches[0].clientX; var y = a.touches[0].clientY; using = true; if (!using) {return} var newPoint = {"x": x, "y": y}; drawLine(lastPoint.x, lastPoint.y, newPoint.x, newPoint.y) lastPoint = newPoint; } canvas.addEventListener('touchend',function(a){ using = false; },false); // canvas.addEventListener('mousemove',usePen); // console.log(0); } window.addEventListener("load", init, false);
// Exercise 13 // // Write a function that takes accepts a string as its only argument // and returns a number that indicates how many uppercase "B"s are in the string. // // Edit only the code between the lines (below) // ----------------------------------------------------------------- function countBs(str) { // str is a string let c = 0; for(let n = 0; n<str.length; n++){ if(str[n]==='B'){ c++; } } return c; } // ----------------------------------------------------------------- // Edit only the code between the lines (above) // Create more test cases. console.log(countBs("BBB")); console.log(countBs("")); console.log(countBs("BbBB")); console.log(countBs("BBB ")); console.log(countBs("BBBAabB66")); console.log(countBs("66")); // This is needed for automated testing (more on that later) module.exports = countBs;
// Variables used by Scriptable. // These must be at the very top of the file. Do not edit. // icon-color: orange; icon-glyph: grin-hearts; // Created by Enjoyee @ https://github.com/Enjoyee/Scriptable // Modified by Samuel Shi on 2020-10-24 ////////////////////////////////////////// // 预览大小【小:Small,中:Medium,大:Large】 const previewSize = "Small"; // 是否需要更换背景 const changePicBg = true; // 是否是纯色背景 const colorMode = false; // 小组件背景色 const bgColor = new Color("000000"); // 默认字体 const defaultFont = Font.systemFont(18); // 默认字体颜色 const defaultTextColor = new Color("#ffffff"); // 内容区左右边距 const padding = { top: 0, left: 0, bottom: 0, right: 0, }; // 标题样式定义 let textStyle = { stack: undefined, // 加入到哪个内容栈显示 marginStart: 0, // 开始距离,水平方向的就是左边距离,垂直方向的就是顶部距离 marginEnd: 0, // 结束距离,水平方向的就是右边距离,垂直方向的就是底部距离 text: "", // 显示的文字 width: 0, // 宽 height: 0, // 长 lineLimit: 0, // 行数控制,0是全部展示 font: undefined, // 字体 textColor: defaultTextColor, // 文字颜色 }; // 图片样式定义 let imgStyle = { stack: undefined, // 加入到哪个内容栈显示 marginStart: 0, // 开始距离,水平方向的就是左边距离,垂直方向的就是顶部距离 marginEnd: 0, // 结束距离,水平方向的就是右边距离,垂直方向的就是底部距离 img: undefined, // 图片资源 width: 0, // 宽 height: 0, // 长 tintColor: undefined, // 图片渲染颜色 }; //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////// // 组件Start const filename = `${Script.name()}.jpg`; const files = FileManager.local(); const path = files.joinPath(files.documentsDirectory(), filename); const widget = new ListWidget(); const contentStack = widget.addStack(); ////////////////////////////////////// /* **************************************************************************** ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 下面添加你自己的组件内容/逻辑 **************************************************************************** */ // 获取外部输入的参数 var widgetInputRAW = args.widgetParameter; try { widgetInputRAW.toString(); } catch (e) { widgetInputRAW = ""; } // 指定日期 var assignMonthDay = widgetInputRAW.toString(); const imgObjs = { "3月9日": "https://patchwiki.biligame.com/images/dongsen/a/a2/3f1qchqu7q74dsis7uyz7jfqt6xgo0d.png", "10月20日": "https://patchwiki.biligame.com/images/dongsen/0/01/mnuuv9nmyb8q7qv8fuqflzn8ds465zp.png", "10月24日": "https://patchwiki.biligame.com/images/dongsen/7/7e/awj7kx6aqiuoventjw1w3qu7imv1f9n.png", "4月18日": "https://patchwiki.biligame.com/images/dongsen/8/8f/lyy1idgf70u6nyowt5lifixlwo4fxeh.png", "4月17日": "https://patchwiki.biligame.com/images/dongsen/4/4b/3rb923sgqde5is4t91kh2mm4s28fuct.png", "7月1日": "https://patchwiki.biligame.com/images/dongsen/7/7d/icyc1bivjo9jk1txakfj4pw9wpkpeuo.png", "12月4日": "https://patchwiki.biligame.com/images/dongsen/a/a6/47kpe9s2rqwsns95mle0nl7sw8q6ra4.png", "1月16日": "https://patchwiki.biligame.com/images/dongsen/9/9d/j3pzy8brhh5duoc69254qiuawgu6efs.png", "2月6日": "https://patchwiki.biligame.com/images/dongsen/1/19/jzi70ru0jxnp9a0v1m937v3y1m2wt7v.png", "1月27日": "https://patchwiki.biligame.com/images/dongsen/9/97/gk1iz5nkg7554dcjbygai8hx9or1f27.png", "9月27日": "https://patchwiki.biligame.com/images/dongsen/8/89/m0okhdls60la08yeqwtkjqfbif8wcc8.png", "7月22日": "https://patchwiki.biligame.com/images/dongsen/0/0d/0mgqwfkrc3x297y55pxjqalv6lu11b1.png", "3月4日": "https://patchwiki.biligame.com/images/dongsen/d/d7/4icwqsjceeke1ft4pcxz9625rwmxuja.png", "7月31日": "https://patchwiki.biligame.com/images/dongsen/8/89/pbj278ho6r4vuyczcied2z5711etlzq.png", "5月19日": "https://patchwiki.biligame.com/images/dongsen/0/0d/h9o092vymv3i9wh7hw3h6zf7f1v3f5o.png", "3月12日": "https://patchwiki.biligame.com/images/dongsen/8/81/duu89um5g4g80lv7ajxp2a817csqvyp.png", "3月31日": "https://patchwiki.biligame.com/images/dongsen/9/93/fgjyv3jqk743p9b1jsfyldco50rnqpg.png", "8月16日": "https://patchwiki.biligame.com/images/dongsen/0/03/fvd09yel4l88x5pk1rmyiwmf9mhhp1w.png", "11月9日": "https://patchwiki.biligame.com/images/dongsen/2/29/2rfhy4aut3y01csbq66kubh0kwk1mwk.png", "7月13日": "https://patchwiki.biligame.com/images/dongsen/a/a2/peygnbpmeg60vwfc7j1vk4sghk1o2ku.png", "3月22日": "https://patchwiki.biligame.com/images/dongsen/e/e7/7148nh94i4q82syg04fg0bp8iw5stpn.png", "9月26日": "https://patchwiki.biligame.com/images/dongsen/b/b1/rqludwtc1t21mysovsikt1ndjqs2kvf.png", "8月24日": "https://patchwiki.biligame.com/images/dongsen/e/e0/bboh9xv51ysue2g1r0v4fqs1vri9i5l.png", "3月13日": "https://patchwiki.biligame.com/images/dongsen/0/0c/lp09t1ac40s27x1e0q3alhdxbugfmin.png", "10月23日": "https://patchwiki.biligame.com/images/dongsen/a/ab/5n8lmrx77x4zaq0c58c751fphgs3g2j.png", "2月16日": "https://patchwiki.biligame.com/images/dongsen/f/fd/6dckpnus6jnvqyxgvxzvulo3xzesxpo.png", "2月2日": "https://patchwiki.biligame.com/images/dongsen/6/68/o1xzpnl4pbpnjiluvt7eiqsmej9cpkv.png", "5月16日": "https://patchwiki.biligame.com/images/dongsen/b/b6/5vkxwei43ar4fs0nvtkflvxt2bolhpa.png", "9月9日": "https://patchwiki.biligame.com/images/dongsen/8/8c/mqyphld9pr5k88zcymr4mjugln9oh4r.png", "7月17日": "https://patchwiki.biligame.com/images/dongsen/9/93/8gjxl0xwtewfx1frot3soj823141un0.png", "9月15日": "https://patchwiki.biligame.com/images/dongsen/e/e5/3z8cu1d44hcxfzx4ho0lrz5pp4jxe3l.png", "10月29日": "https://patchwiki.biligame.com/images/dongsen/0/07/85nu475h8slfwtaxm47fxd4ujfhapy2.png", "3月27日": "https://patchwiki.biligame.com/images/dongsen/c/c3/7d99fi1m321r7uqh4ynjemfvmcdhn5f.png", "11月29日": "https://patchwiki.biligame.com/images/dongsen/3/37/tn2whour3unzy1cs0qwkcqpo9bajahq.png", "1月1日": "https://patchwiki.biligame.com/images/dongsen/f/fd/mrpv91b59t0faao3ajelo22ybzju2h1.png", "6月22日": "https://patchwiki.biligame.com/images/dongsen/c/cf/565gkqkt79ynxqh784djljoare1sh42.png", "2月15日": "https://patchwiki.biligame.com/images/dongsen/4/40/69qnhd2ykyiu4ffwsvgwxbtghgv7ew1.png", "6月17日": "https://patchwiki.biligame.com/images/dongsen/2/2b/kep0zyjducbpa20y4qxvdtrnw373iky.png", "4月20日": "https://patchwiki.biligame.com/images/dongsen/f/f5/ezhh3zv7rwqn9a7iplt1cjf8sj1sn0e.png", "9月22日": "https://patchwiki.biligame.com/images/dongsen/3/39/0qk07h279fy7r5gxi7gz9bnzwck22tc.png", "8月1日": "https://patchwiki.biligame.com/images/dongsen/d/dc/hjv0riyqct10xo1fieojpnscxkerhhh.png", "9月25日": "https://patchwiki.biligame.com/images/dongsen/d/d5/if6m85xq870gov60x2cd466yhwm5vs1.png", "7月25日": "https://patchwiki.biligame.com/images/dongsen/8/85/kifvkn4d05id5j3w47sqj05kyeeldyk.png", "12月10日": "https://patchwiki.biligame.com/images/dongsen/b/b0/fzck20tr0fq4vghr32fdftjwjaj7ztv.png", "4月11日": "https://patchwiki.biligame.com/images/dongsen/8/88/ixudoc3lyluzyinsezw8ncbncfg7dtb.png", "5月20日": "https://patchwiki.biligame.com/images/dongsen/6/63/pr7jen0xri93cwywxohddv30jxq1q2t.png", "9月30日": "https://patchwiki.biligame.com/images/dongsen/7/72/m5qy2ekcw0tbr71z7bch7jgnszrocvq.png", "2月27日": "https://patchwiki.biligame.com/images/dongsen/c/cf/rqhd7zebnj9azof94c3mintkr8iywls.png", "11月20日": "https://patchwiki.biligame.com/images/dongsen/2/2b/obdvd9ffgwg7w10yubgqpoats16kzuz.png", "6月29日": "https://patchwiki.biligame.com/images/dongsen/6/67/pktjtjer77ubhb6dcflz3uf7vg0zdkn.png", "5月29日": "https://patchwiki.biligame.com/images/dongsen/8/86/cvvp33t5np0hnq82tn8336eunitoxa1.png", "4月29日": "https://patchwiki.biligame.com/images/dongsen/9/9a/6chtxm0j01j8cn31hw3kkvw3v1vfa8h.png", "8月13日": "https://patchwiki.biligame.com/images/dongsen/7/73/6vlkez4zljimukn5ckqketa3ofon6sz.png", "2月3日": "https://patchwiki.biligame.com/images/dongsen/c/c3/8bmpe8jgxlocd9rvuyv95htgo3a5a8j.png", "4月30日": "https://patchwiki.biligame.com/images/dongsen/2/22/lxjv0lo1arpefnac9ysddx2fhvyznwr.png", "3月30日": "https://patchwiki.biligame.com/images/dongsen/c/cd/i4tnpwqpj1r8c587peirpu6sly93swj.png", "1月12日": "https://patchwiki.biligame.com/images/dongsen/3/31/i47tys2ox8ca7nan78f49cnc8g9wzoz.png", "12月29日": "https://patchwiki.biligame.com/images/dongsen/1/11/oorndymygs7qo94x27bnsmqt7qdnzcq.png", "12月12日": "https://patchwiki.biligame.com/images/dongsen/7/71/sl1zg3z8rb6jzi17ppilwjpn5fu566b.png", "8月17日": "https://patchwiki.biligame.com/images/dongsen/5/53/6pogjdqiua1x1tnzvvdiwbjfp52qkv5.png", "10月8日": "https://patchwiki.biligame.com/images/dongsen/f/fe/0hawmivoi75im2daxz09hdyyqonwrxc.png", "9月28日": "https://patchwiki.biligame.com/images/dongsen/7/7b/7s4cbpguae80z6xktuce9k32g1kgkpv.png", "10月10日": "https://patchwiki.biligame.com/images/dongsen/2/22/ewmm6ba71xi8prb32lkgsnzzscahfd3.png", "3月17日": "https://patchwiki.biligame.com/images/dongsen/7/76/fmvygkzkoahgrx1hfnmmf4tk1fkx6vo.png", "6月24日": "https://patchwiki.biligame.com/images/dongsen/4/4a/42y0oixbjcr3033iov58pfjop8p2i5k.png", "11月23日": "https://patchwiki.biligame.com/images/dongsen/6/63/s5i5oriz69pozztqx31wupynoihh6pj.png", "6月23日": "https://patchwiki.biligame.com/images/dongsen/7/79/1erfp6xljbqj2r349ytevmgz7kcw0ax.png", "2月10日": "https://patchwiki.biligame.com/images/dongsen/5/57/krd6ijg6345xqm9a1ilsygbbuoj563b.png", "10月14日": "https://patchwiki.biligame.com/images/dongsen/e/e1/o1rvyqdbfqev4t4e9mi6y17b59b1pw8.png", "5月21日": "https://patchwiki.biligame.com/images/dongsen/a/aa/1z17qp0484s064hmfx6mz7o0zg5syfg.png", "6月15日": "https://patchwiki.biligame.com/images/dongsen/4/45/qgwupkiydqtssk9lcb20u4vqnhvwcuw.png", "4月16日": "https://patchwiki.biligame.com/images/dongsen/7/7d/87zyggqsehorpb0evby37v22lsb4k8n.png", "8月2日": "https://patchwiki.biligame.com/images/dongsen/f/f7/pguy9t7oidqq3a8ck4ztwbnr9vanjqz.png", "12月20日": "https://patchwiki.biligame.com/images/dongsen/4/40/rb53l2onglw3tdaljd6tb5mcy0xaw3x.png", "4月28日": "https://patchwiki.biligame.com/images/dongsen/7/79/njojjwcfp6y5npyyfn8n34ulun4d75j.png", "5月18日": "https://patchwiki.biligame.com/images/dongsen/9/93/pxhkzjrtmbjm7hv8fwhdbrf03zk1gid.png", "1月2日": "https://patchwiki.biligame.com/images/dongsen/2/2b/kbs48eg2l0l8j05xkdqsfw7bh4n9qof.png", "12月23日": "https://patchwiki.biligame.com/images/dongsen/7/78/rqqnwch9yd2ty1fzsz3axw9b7eqpfr1.png", "3月10日": "https://patchwiki.biligame.com/images/dongsen/4/49/59o34z38jeoh43oocsdifo0kgm7mvne.png", "4月27日": "https://patchwiki.biligame.com/images/dongsen/f/f5/41t4355ooxnkjs5hj1h11txy8e9q7jn.png", "12月9日": "https://patchwiki.biligame.com/images/dongsen/a/a6/rj09p189d8jada21ghlhoj2thg6qhwg.png", "8月6日": "https://patchwiki.biligame.com/images/dongsen/2/2c/g584sd7pval1beky8nkwrlvbto9x8ay.png", "6月11日": "https://patchwiki.biligame.com/images/dongsen/e/e5/dbh14ywrx6dakxx0xh7lrv99r30idu4.png", "5月10日": "https://patchwiki.biligame.com/images/dongsen/a/a2/ohr2rpaqcd4rezm6x25q3arjjcys7n2.png", "10月4日": "https://patchwiki.biligame.com/images/dongsen/c/c1/2o2pfw91po4usgi8im68sah5ejxq9dm.png", "7月12日": "https://patchwiki.biligame.com/images/dongsen/c/cc/629ff1uvi60pnrntbmlo2nimzyz0ew7.png", "10月1日": "https://patchwiki.biligame.com/images/dongsen/4/44/hm4dq0lmgyt8ym4esz7il2d9o06qouu.png", "10月12日": "https://patchwiki.biligame.com/images/dongsen/a/a9/4txtpw7gqq1yu34iukiv8s5hsodpe0b.png", "3月2日": "https://patchwiki.biligame.com/images/dongsen/8/8e/ru4b74i2ibkthnc3nevpa2plcaulepl.png", "2月12日": "https://patchwiki.biligame.com/images/dongsen/6/62/m20ph316j0abpi5pohpzkjj8hsunec8.png", "8月25日": "https://patchwiki.biligame.com/images/dongsen/c/c5/los096pej03ac0g5uet1gx3ygxjvjth.png", "11月4日": "https://patchwiki.biligame.com/images/dongsen/e/e5/h5cyjbl7jhiu8h20dfe2usem23sccje.png", "5月4日": "https://patchwiki.biligame.com/images/dongsen/3/3a/j3t4objv0xf9sgth4nzssuwgkttr3ai.png", "8月7日": "https://patchwiki.biligame.com/images/dongsen/2/23/pfwfkhhz6cv0i49y8ispf63daij5eyj.png", "11月16日": "https://patchwiki.biligame.com/images/dongsen/c/c7/nlarmnzsa5h1805mic8gfbeqt9avr7h.png", "7月27日": "https://patchwiki.biligame.com/images/dongsen/f/f4/oqjj7wie25t3bael1ksqs5fsqqnw60i.png", "3月26日": "https://patchwiki.biligame.com/images/dongsen/1/14/dxpmoaaw8hbp5vpzwbqg920xba2ua0q.png", "9月20日": "https://patchwiki.biligame.com/images/dongsen/c/c3/bogw0xegt316vrfhbzz2binuyaxb96g.png", "5月13日": "https://patchwiki.biligame.com/images/dongsen/6/62/7ed8zmjxsg5hg956giatowj87wcdwl3.png", "8月20日": "https://patchwiki.biligame.com/images/dongsen/c/c6/ij7ucye1q5gqm2eb2n0qdz2aqmjdjpe.png", "5月27日": "https://patchwiki.biligame.com/images/dongsen/a/a9/4plpg3r25lok9wp90jefc7zirzd9m1w.png", "1月18日": "https://patchwiki.biligame.com/images/dongsen/9/91/0mw0w2nz56zvpifrapf8ogf2aqnc6jm.png", "11月7日": "https://patchwiki.biligame.com/images/dongsen/d/d0/en26uvg5lcgznlcdpssf8athod4njzk.png", "2月28日": "https://patchwiki.biligame.com/images/dongsen/2/2c/ebkklcmpn60qx771gc2ron2pte0udvd.png", "8月4日": "https://patchwiki.biligame.com/images/dongsen/2/2f/3rn7954x4mvss7pat62sg2unwuoorhm.png", "9月19日": "https://patchwiki.biligame.com/images/dongsen/e/e8/0ix0qskel080j2d0gsq5bbx4cndv62q.png", "11月15日": "https://patchwiki.biligame.com/images/dongsen/c/c1/0o9yg767srogxentjkgaw1fy9at2944.png", "12月27日": "https://patchwiki.biligame.com/images/dongsen/c/ce/ncohbzaiiu4qyfcdfpmd15v44jfl2et.png", "6月7日": "https://patchwiki.biligame.com/images/dongsen/9/93/natub9hc3xt4duqxedgq5l8ieogc0ej.png", "6月9日": "https://patchwiki.biligame.com/images/dongsen/4/47/colkszeqlgjl44wcolpq4hzft032p8g.png", "10月25日": "https://patchwiki.biligame.com/images/dongsen/6/64/pkk961x0ti463ie3pqs2cejb7z6mnp1.png", "4月5日": "https://patchwiki.biligame.com/images/dongsen/5/5a/h8kt1ys4tvp003qwdg2vecwqnhu3ryp.png", "5月17日": "https://patchwiki.biligame.com/images/dongsen/c/c5/p02xrv5yfa83gy7fcjbfe31052tf9zv.png", "11月1日": "https://patchwiki.biligame.com/images/dongsen/8/8c/o2ufo80qh0jkhzl5ebxsojya0w08njb.png", "5月26日": "https://patchwiki.biligame.com/images/dongsen/3/36/asfugf4649czmqigm5axpivuuwwcxn8.png", "11月8日": "https://patchwiki.biligame.com/images/dongsen/a/a6/k9vn3t655a4ki632nxmhdo27ufb61wm.png", "6月10日": "https://patchwiki.biligame.com/images/dongsen/f/f0/gey80ieaqvjn87z5ggw25pqb4iji2xm.png", "1月4日": "https://patchwiki.biligame.com/images/dongsen/3/3a/t6cqbgbl3mkasxw9thy0n11pifltfvm.png", "6月27日": "https://patchwiki.biligame.com/images/dongsen/6/61/sde917jaliz3hf9ucags25ak6sgmbuc.png", "11月11日": "https://patchwiki.biligame.com/images/dongsen/a/a5/hyeh649whoqz0ignmkq0ess9voifovo.png", "7月14日": "https://patchwiki.biligame.com/images/dongsen/8/88/55hk86r706wgjzal0f1zu1u196yvxl2.png", "6月25日": "https://patchwiki.biligame.com/images/dongsen/7/71/psmk0thlcucjs7bue6t5zi38uda24tp.png", "2月1日": "https://patchwiki.biligame.com/images/dongsen/7/71/aa9fu7fnkxl3giytnfshy4zdjem1adw.png", "8月12日": "https://patchwiki.biligame.com/images/dongsen/4/4c/g2qz3vp03s1stckr8bw01wljz5wtldw.png", "2月11日": "https://patchwiki.biligame.com/images/dongsen/e/e4/6skh9jx5x5dvc2l9ohcb5q3pbqdxsea.png", "12月31日": "https://patchwiki.biligame.com/images/dongsen/9/92/kmze66ykg1f6c4bkggi9jqif41vuaet.png", "10月3日": "https://patchwiki.biligame.com/images/dongsen/a/a4/ai1cm3xmxuld41frz7vwaqz41vyjdij.png", "6月13日": "https://patchwiki.biligame.com/images/dongsen/7/7f/bzpikocio5973d6q1mcj9ouumcvvr5w.png", "1月3日": "https://patchwiki.biligame.com/images/dongsen/d/dd/bu8r96la1xkf0ex4o6l0b8kzisbt0o2.png", "6月18日": "https://patchwiki.biligame.com/images/dongsen/5/54/cxciz6ch2qhmbadda82z5dl54psowud.png", "3月7日": "https://patchwiki.biligame.com/images/dongsen/6/62/3dnh0d2eiuwv528wbn5dn4punieqrpl.png", "11月17日": "https://patchwiki.biligame.com/images/dongsen/3/36/ken3f6k8t384dakj94me6336iqhiyf1.png", "8月3日": "https://patchwiki.biligame.com/images/dongsen/4/40/pdeg0mcbkbb1ormxzkan6pgtkmb1up8.png", "12月8日": "https://patchwiki.biligame.com/images/dongsen/d/d0/rckuejj2qk0qebtyn6ve4pt2j70e3vm.png", "6月30日": "https://patchwiki.biligame.com/images/dongsen/3/3f/l6masev2ynwhgqiik8nc3muqoxi7uqa.png", "2月23日": "https://patchwiki.biligame.com/images/dongsen/b/ba/qv8k4badavn0tnhdvfp9wwiodvl99f8.png", "1月11日": "https://patchwiki.biligame.com/images/dongsen/b/bb/crmicitqddd7bku2auo4bbirqpmpwje.png", "12月22日": "https://patchwiki.biligame.com/images/dongsen/9/98/m7zhhg7uma7i0c1r2d8lerhf74gxemj.png", "2月19日": "https://patchwiki.biligame.com/images/dongsen/e/e7/mnv0xywskylaa8f5qbh6chbflse5xx4.png", "5月11日": "https://patchwiki.biligame.com/images/dongsen/0/0b/7s6wdk5ku9g1rzivn6k866c06ifa0xa.png", "1月28日": "https://patchwiki.biligame.com/images/dongsen/e/e8/kcf5gxv1cer96mcd7x5i7yjx3fbuy0s.png", "4月23日": "https://patchwiki.biligame.com/images/dongsen/9/9e/4mtumgv3tk4s0jc0v5sqpqvb7pdh08z.png", "4月8日": "https://patchwiki.biligame.com/images/dongsen/e/e3/rudqvvjnugkofh1pyzz39xcwumaxubm.png", "10月15日": "https://patchwiki.biligame.com/images/dongsen/5/5d/4rqmnnc0fjrmbmaj75ihcvrectr97d2.png", "1月20日": "https://patchwiki.biligame.com/images/dongsen/6/6f/ejx84zeqk8j32v9isbm48uvqso4mytq.png", "5月25日": "https://patchwiki.biligame.com/images/dongsen/9/9d/1sgr0325r11bj3kzvxlctwk6ffnnkwu.png", "11月24日": "https://patchwiki.biligame.com/images/dongsen/4/4e/2qmjbec3fyus66lhtq8e8rkuyksmkuv.png", "7月8日": "https://patchwiki.biligame.com/images/dongsen/5/58/dbu7scdrjao5a0vgxh8af5d7a5yy00f.png", "3月6日": "https://patchwiki.biligame.com/images/dongsen/9/92/tfdojprp04ra4a50g0r5jujozkxdlpp.png", "8月29日": "https://patchwiki.biligame.com/images/dongsen/3/32/qo497aek52jbl95vxsgu2yu1dh9gkqs.png", "10月27日": "https://patchwiki.biligame.com/images/dongsen/e/ec/jql712lgnzfa8lpqd3e6scad9hv2mz2.png", "6月5日": "https://patchwiki.biligame.com/images/dongsen/f/f6/q8txnu7am41kz94rbk3txar0liq8rjc.png", "3月23日": "https://patchwiki.biligame.com/images/dongsen/2/20/tl6m5wzyhbvt0h4rcv75irezu0aj26n.png", "9月21日": "https://patchwiki.biligame.com/images/dongsen/5/59/0b40egp2b7ow9w60jti8m1zzzn9o2wb.png", "6月6日": "https://patchwiki.biligame.com/images/dongsen/7/7d/7g5io3kqwvnmvh1pdiqit4h8h9ujd5r.png", "10月9日": "https://patchwiki.biligame.com/images/dongsen/9/92/t75vh1e5gcz48715cpg8kcrfezqovhe.png", "5月12日": "https://patchwiki.biligame.com/images/dongsen/3/38/k1yfyahl3gs9ljs7x2s3mi996wbpug4.png", "12月17日": "https://patchwiki.biligame.com/images/dongsen/f/f6/qp9or356mx4eprxbhi05ol56x61k8o4.png", "2月4日": "https://patchwiki.biligame.com/images/dongsen/e/e4/27l9vlp4npt7splyi4q05pgkfquztv3.png", "8月11日": "https://patchwiki.biligame.com/images/dongsen/4/4e/g4ie0cl055f54ncfwm3a7euiuf0m2fv.png", "8月21日": "https://patchwiki.biligame.com/images/dongsen/d/db/emquelpgwthlebr52sv40ol9wpsofll.png", "9月7日": "https://patchwiki.biligame.com/images/dongsen/3/33/3qjoaz07j4okjmky0nb2usicwylf947.png", "7月9日": "https://patchwiki.biligame.com/images/dongsen/5/51/5qe9feuth9m0juhd3y7xb179dwfvsqn.png", "2月13日": "https://patchwiki.biligame.com/images/dongsen/7/79/q2kqasr6hesugklqmoxenym3ohk5nvh.png", "7月18日": "https://patchwiki.biligame.com/images/dongsen/7/70/03hahqavmi2h4jj7mll2xicmeep7mln.png", "1月13日": "https://patchwiki.biligame.com/images/dongsen/8/8a/ffp0aar02eksqqds9atw9aoltbuep1y.png", "11月18日": "https://patchwiki.biligame.com/images/dongsen/2/2c/kn4oyqbmdvp1naxr0kyj1wqp7na86wk.png", "3月25日": "https://patchwiki.biligame.com/images/dongsen/b/b6/4olkj8xwx3dnpiivsj8o5h77knfuuxx.png", "7月21日": "https://patchwiki.biligame.com/images/dongsen/b/b1/ibim1vghz8f909jjyxjqp4ion0zv33y.png", "2月8日": "https://patchwiki.biligame.com/images/dongsen/d/d7/j893zf7u1cayty1uowpj48jyervqldg.png", "5月5日": "https://patchwiki.biligame.com/images/dongsen/c/c5/70olxzbcxny9ayriswuesp2ibfy2op3.png", "10月2日": "https://patchwiki.biligame.com/images/dongsen/8/8d/96ovso0lbb4pno1gx6ezwz8j64noofo.png", "11月10日": "https://patchwiki.biligame.com/images/dongsen/d/d8/klbh6w1itf1aiqe1ohgl838hkubysuf.png", "8月18日": "https://patchwiki.biligame.com/images/dongsen/5/52/74g6ceyzk3b96i6i956xbibfj1jblf1.png", "9月6日": "https://patchwiki.biligame.com/images/dongsen/e/ea/48rkiq6xtnvc3b0d7e23bm6gdp25dd9.png", "1月7日": "https://patchwiki.biligame.com/images/dongsen/1/19/ikqwt3dq1h9o480ke1q0mkw4l4zhlqn.png", "8月9日": "https://patchwiki.biligame.com/images/dongsen/c/c9/q4mw4rwxrhpbtu13fm5sw3hlurmtdfg.png", "9月1日": "https://patchwiki.biligame.com/images/dongsen/6/66/nahdv9i1uzp8xn87vhrhqdjscbh1y7z.png", "1月14日": "https://patchwiki.biligame.com/images/dongsen/c/c7/81kle150pdfctdrg1r9sb7pblijogse.png", "9月18日": "https://patchwiki.biligame.com/images/dongsen/5/52/h4uwkdwmnbwn26niy09dtdxbf1xknwk.png", "5月30日": "https://patchwiki.biligame.com/images/dongsen/8/81/5egq9llgwtm3r8thngyfct8fjf2hyb3.png", "9月11日": "https://patchwiki.biligame.com/images/dongsen/c/cd/a55zqrdef7kkktyxc163gi50lt73iu5.png", "10月19日": "https://patchwiki.biligame.com/images/dongsen/2/25/b0e7ejx4h0tfbrqjyvhbd26fkouervl.png", "10月18日": "https://patchwiki.biligame.com/images/dongsen/1/11/3iiszn72bh3y02z42hvzdyhvsuv40oi.png", "6月28日": "https://patchwiki.biligame.com/images/dongsen/8/8e/fs9mtvm7rv0aczz2klc709oeooloohr.png", "4月25日": "https://patchwiki.biligame.com/images/dongsen/7/7f/87kftednofchygtfo3x8n2egl1k3d4k.png", "9月24日": "https://patchwiki.biligame.com/images/dongsen/d/dd/1oyxt3seg2gggyhjquhwdncuh0h3h52.png", "9月12日": "https://patchwiki.biligame.com/images/dongsen/0/0a/pcv310lwe8nfurz45hwodddkgz79tst.png", "4月4日": "https://patchwiki.biligame.com/images/dongsen/0/03/62l7bsz16xvrbw8jjylprohoaj09n8n.png", "1月30日": "https://patchwiki.biligame.com/images/dongsen/3/3c/517wl1nxxlzdww8hvfpwbhk02nn7im4.png", "4月14日": "https://patchwiki.biligame.com/images/dongsen/e/e4/muz86rthi22e9uxjp0aj2xb49cac3om.png", "12月26日": "https://patchwiki.biligame.com/images/dongsen/b/bd/fk693rcqcidrjrs8ts2pdcp56lmp7q8.png", "3月29日": "https://patchwiki.biligame.com/images/dongsen/7/7f/rplap7kqzrycu7gevgou7b89j92j7ak.png", "6月20日": "https://patchwiki.biligame.com/images/dongsen/a/a1/2ldoe8a0yr537pgr85uaar5aw4pkmve.png", "2月25日": "https://patchwiki.biligame.com/images/dongsen/d/d7/mmr82yu5xor08h0de43j4hkl2ajh3e8.png", "12月5日": "https://patchwiki.biligame.com/images/dongsen/a/a8/d01fez3707oi8jma6ad7hi37ldka38g.png", "10月6日": "https://patchwiki.biligame.com/images/dongsen/4/49/ok9r5l58k8dh4jhwu8dbhghca8gtpmq.png", "5月7日": "https://patchwiki.biligame.com/images/dongsen/0/0d/g0tczkumwnmhf5hikf2rgwigs2j452t.png", "5月22日": "https://patchwiki.biligame.com/images/dongsen/b/b7/q3k33hekqi95zaqqj9gysq5dpwj259r.png", "1月25日": "https://patchwiki.biligame.com/images/dongsen/8/8a/n74e7mp7zrm7syl51wdk1qeb1sl8slo.png", "11月12日": "https://patchwiki.biligame.com/images/dongsen/9/99/d6sssg6olsv35l9dxl6jt93gqd6f1ju.png", "8月19日": "https://patchwiki.biligame.com/images/dongsen/7/7f/jwsyvjwcpppqz3tiql686zchylfww3m.png", "2月9日": "https://patchwiki.biligame.com/images/dongsen/7/77/2z5t9yhygcb6aga4408f182b843t4lp.png", "5月14日": "https://patchwiki.biligame.com/images/dongsen/e/e6/hbf44jwb4zsnlztzaefot1xcps2h6hk.png", "1月10日": "https://patchwiki.biligame.com/images/dongsen/5/57/et66rqm6lea9c2i584fzmadswb3ankp.png", "10月5日": "https://patchwiki.biligame.com/images/dongsen/6/6d/q9tuf5zigsqwi17uqvcg7tj80bmlg2i.png", "4月12日": "https://patchwiki.biligame.com/images/dongsen/c/cb/n717nzm6jws9zgi9drk3ayo7z7ujsgi.png", "11月28日": "https://patchwiki.biligame.com/images/dongsen/1/1a/jzyppv0z5ozo5reb7io9ewpoel35ysw.png", "3月15日": "https://patchwiki.biligame.com/images/dongsen/c/c7/pq9pp4ikfbba4qe54rbappa6xy29hvs.png", "6月16日": "https://patchwiki.biligame.com/images/dongsen/6/6e/rgw9ntk063coc7normdou3hd37c2lmj.png", "9月8日": "https://patchwiki.biligame.com/images/dongsen/b/b9/79s9vuad9fpqop5dlgknr1yrhywg8lw.png", "6月21日": "https://patchwiki.biligame.com/images/dongsen/d/dd/82vd9kyqcxpy2rqolwdgcu9ygrhu9tq.png", "12月2日": "https://patchwiki.biligame.com/images/dongsen/3/32/qt4oxo4nyn621ybj8waa04s14qmf7r2.png", "10月26日": "https://patchwiki.biligame.com/images/dongsen/b/b0/b4bzcaso8ws8xro1qcj0fcjuihdk85e.png", "6月4日": "https://patchwiki.biligame.com/images/dongsen/9/97/09tkbzszfnlabu5sxkzb915vomo6xof.png", "1月31日": "https://patchwiki.biligame.com/images/dongsen/0/06/67uix871ru4edcivfeqijp3emrfi7dg.png", "5月3日": "https://patchwiki.biligame.com/images/dongsen/1/13/s5h7ra9f9cl9c7w2gtqdc8pu0d9np7h.png", "10月13日": "https://patchwiki.biligame.com/images/dongsen/1/11/p4yo43embceklejg39wjcao2dflhupm.png", "5月1日": "https://patchwiki.biligame.com/images/dongsen/c/c8/0bdbv5dmy148jwzj6wz7i0dopz7bl23.png", "7月11日": "https://patchwiki.biligame.com/images/dongsen/3/35/4q9luopcjzive7y700cp1y7wxkqhhq6.png", "10月11日": "https://patchwiki.biligame.com/images/dongsen/f/f3/ti9k5d68jx41lo7tcwydrssvlc8jx0z.png", "7月20日": "https://patchwiki.biligame.com/images/dongsen/8/87/np28gskvh3c80ecv40jtczapu3dxb3u.png", "9月16日": "https://patchwiki.biligame.com/images/dongsen/e/e6/eppjc6f67k8cs5qubpyj0kw7v049967.png", "4月24日": "https://patchwiki.biligame.com/images/dongsen/1/1b/6jp0e69511ua382635cd4iil8p1huhz.png", "7月5日": "https://patchwiki.biligame.com/images/dongsen/7/73/1y7di93gt1xyon16g2udxbacb76bfg7.png", "12月7日": "https://patchwiki.biligame.com/images/dongsen/9/91/k1qhth8sh8a7zdj6f1z8nlcnt6p0cq2.png", "7月23日": "https://patchwiki.biligame.com/images/dongsen/d/d7/flu90iffdm6h7j6jh16m3oggkn3pfz3.png", "2月18日": "https://patchwiki.biligame.com/images/dongsen/e/ee/ee9iz1pjbgd4vy0o1a7s5tmyo7pmsp5.png", "7月29日": "https://patchwiki.biligame.com/images/dongsen/0/06/mpn3et437nwodgr4fqiyoogsjvitgru.png", "12月1日": "https://patchwiki.biligame.com/images/dongsen/d/df/bmh96e2zmeax3s1ffnvhd3gg4inte6c.png", "8月14日": "https://patchwiki.biligame.com/images/dongsen/a/a8/oan43wxd9nxjtobdcttjbd8br708uat.png", "3月21日": "https://patchwiki.biligame.com/images/dongsen/7/7b/evl4zb8pyitmok5i7lr2h35l0xwop54.png", "7月24日": "https://patchwiki.biligame.com/images/dongsen/4/4d/5kwnkz7b65lt4r0rm2oc31cvscgff71.png", "9月13日": "https://patchwiki.biligame.com/images/dongsen/b/b5/ig3bpkwz9ym7krs4bdlkjqs4aal7v4u.png", "10月17日": "https://patchwiki.biligame.com/images/dongsen/2/24/7gaw5pv3f0niodgyc694vznx82sljk6.png", "8月23日": "https://patchwiki.biligame.com/images/dongsen/f/fc/870tidowcze3vja3fpzqo4t4d2ujnuf.png", "5月31日": "https://patchwiki.biligame.com/images/dongsen/7/72/8igbn063brd1hmna4rjhmtwszyr6xpm.png", "4月13日": "https://patchwiki.biligame.com/images/dongsen/5/5a/jl0p136ll16vbpm9hjisv3pooxhogvu.png", "11月21日": "https://patchwiki.biligame.com/images/dongsen/7/75/65o6boxxh9smu76rb9p3hsqgh8azpw8.png", "6月12日": "https://patchwiki.biligame.com/images/dongsen/0/09/l7wsaw634rfes0dk28p0y3ajx1d6orp.png", "12月28日": "https://patchwiki.biligame.com/images/dongsen/a/ac/ahlsx669hvzhxnios1b21k3orylv1fv.png", "1月19日": "https://patchwiki.biligame.com/images/dongsen/d/de/7iinzc4mh7nflcc6axle8fe41mk32mv.png", "1月17日": "https://patchwiki.biligame.com/images/dongsen/c/c6/ko72zjqc754tgnu8jeicwe3v9koloj6.png", "4月10日": "https://patchwiki.biligame.com/images/dongsen/5/58/6ioaexbx5n483jm375o79304nxqvmsm.png", "7月10日": "https://patchwiki.biligame.com/images/dongsen/c/c6/1255403cd6ij684wpn5v8jonw0b1ei0.png", "7月7日": "https://patchwiki.biligame.com/images/dongsen/2/2f/swnl86r4t7m4shwi7j9oczpdu2oenvc.png", "4月2日": "https://patchwiki.biligame.com/images/dongsen/3/35/tbbis12vrf1qg8q1poys0030u4b7nc0.png", "8月8日": "https://patchwiki.biligame.com/images/dongsen/1/1f/jw0jnpedfzxo7o65yeqxjjd4wz6k7kw.png", "2月24日": "https://patchwiki.biligame.com/images/dongsen/a/a7/dnuas10v2wcwbelzublkh01tem83ti3.png", "5月24日": "https://patchwiki.biligame.com/images/dongsen/e/e7/lkt0k618jaiud0uunc01hkw0rcs381a.png", "4月22日": "https://patchwiki.biligame.com/images/dongsen/c/cd/2m741s6wpa5gu9p5euxtqntogsjuh8i.png", "11月13日": "https://patchwiki.biligame.com/images/dongsen/1/14/o1bi5ehmjqzb2em69ie8yl5lt8bbbcc.png", "2月22日": "https://patchwiki.biligame.com/images/dongsen/e/ee/fc41cdvdzsw7ezzqcaz17uv6g01vz5u.png", "9月23日": "https://patchwiki.biligame.com/images/dongsen/0/08/grwklqd4a2pgijsruj7zda1eqxvlr0d.png", "12月15日": "https://patchwiki.biligame.com/images/dongsen/8/86/ivc4gm2b9c0rnybutp9ddq1gb15qsdw.png", "7月4日": "https://patchwiki.biligame.com/images/dongsen/e/e3/31lebg5sp9fscdk3z34mzr86oebtsrk.png", "1月15日": "https://patchwiki.biligame.com/images/dongsen/d/db/4lmlxor5la0tdwdvecu9vl9vsfcu2xz.png", "7月30日": "https://patchwiki.biligame.com/images/dongsen/e/e0/j32zlpzdcq1tuigs88egfxi9ct0agcy.png", "11月27日": "https://patchwiki.biligame.com/images/dongsen/1/19/1coa4egj6wvqtkiit1ghikooq5nmw7i.png", "1月5日": "https://patchwiki.biligame.com/images/dongsen/5/55/scif1ak1fwdhtlfb7nl2lsni4gaftv4.png", "11月19日": "https://patchwiki.biligame.com/images/dongsen/9/9d/2m3gyfjhrpjd3zrshvzwx1jt781z142.png", "10月21日": "https://patchwiki.biligame.com/images/dongsen/0/00/l0cf2ywp1xge6fp871oqfclqzy0nz4x.png", "12月11日": "https://patchwiki.biligame.com/images/dongsen/e/e4/3bd68if2sc8wshowwug2o89npcc64vu.png", "12月21日": "https://patchwiki.biligame.com/images/dongsen/7/73/emotk22s8d2tydzai0ui9pmosrhj3nm.png", "6月26日": "https://patchwiki.biligame.com/images/dongsen/f/f1/9b7seaokt931ntc4kpwjsmhq4a0r8ve.png", "1月29日": "https://patchwiki.biligame.com/images/dongsen/d/da/9601l4myh7juqm2vnu3f6kb4z7pk0dt.png", "1月8日": "https://patchwiki.biligame.com/images/dongsen/c/c4/eu5id2zk5nnpi1cponvyqx8gzih8czg.png", "9月5日": "https://patchwiki.biligame.com/images/dongsen/d/df/ft4olv4jfqadzltoi59xx51jl3udxjk.png", "6月1日": "https://patchwiki.biligame.com/images/dongsen/5/5f/k8a53y9nja257aam60ppaqpkif3cuh4.png", "3月8日": "https://patchwiki.biligame.com/images/dongsen/0/09/lphwha59o6x5smdcpjelmmfavc4shn9.png", "4月6日": "https://patchwiki.biligame.com/images/dongsen/9/9b/hx2val1g0rbvrgh3cnnrlppkzyg3fyc.png", "2月5日": "https://patchwiki.biligame.com/images/dongsen/e/e5/988m0nzr14euy4a67yp5jm2awqr9yfv.png", "4月26日": "https://patchwiki.biligame.com/images/dongsen/c/c0/cy68m8ev44ou0pwnxol97z185efm32j.png", "7月26日": "https://patchwiki.biligame.com/images/dongsen/2/20/qf20oa4l2yt39uj470p3l9hkjkmkr9q.png", "10月16日": "https://patchwiki.biligame.com/images/dongsen/f/fe/mf1s7q6g9u0dhtttzwdqzyoagvl4khq.png", "3月1日": "https://patchwiki.biligame.com/images/dongsen/7/75/krizmcsw0syyfl0da665yy2h64xj5fk.png", "9月3日": "https://patchwiki.biligame.com/images/dongsen/4/4b/iosxmq8oodugccuwdh2ju4na4ks5prp.png", "11月2日": "https://patchwiki.biligame.com/images/dongsen/7/71/qnzzn83qvgw44oo37kbgktjwg4yllks.png", "11月14日": "https://patchwiki.biligame.com/images/dongsen/d/d9/qjk27gnc7tl5hl4yu6sbqldxsmkepoc.png", "7月28日": "https://patchwiki.biligame.com/images/dongsen/a/af/o27p868q3hdhxua7whfyrp8e2zwqdd0.png", "1月23日": "https://patchwiki.biligame.com/images/dongsen/e/ec/pp2znp072zvlv2ogiek1m552fgura61.png", "11月3日": "https://patchwiki.biligame.com/images/dongsen/7/78/5p7eo93hwyp55xx9mp5cxaorv1n4afa.png", "5月23日": "https://patchwiki.biligame.com/images/dongsen/b/bd/tp8hsu6ghbpawlaca0dr6kx209hkvky.png", "10月7日": "https://patchwiki.biligame.com/images/dongsen/0/09/363c99jl9nsyn8tkdza1808mfohjh8k.png", "4月21日": "https://patchwiki.biligame.com/images/dongsen/8/8c/pi1ml6l5423opdr36l5fa0rqund5mz8.png", "4月7日": "https://patchwiki.biligame.com/images/dongsen/8/8a/dmothrerlmfjpsbcgg1sj8y8bdavq02.png", "2月21日": "https://patchwiki.biligame.com/images/dongsen/3/3b/8zvcvfw73ru2tm7j2ojiur9madthv0n.png", "3月5日": "https://patchwiki.biligame.com/images/dongsen/e/ea/q1eil21411kw9jlb6ir6w1r17e7fd5g.png", "11月6日": "https://patchwiki.biligame.com/images/dongsen/6/61/ql02vbtci7ab4hr517r4m0dk6e8jgex.png", "9月2日": "https://patchwiki.biligame.com/images/dongsen/1/1f/du9y3miwoqbqgcaj2cmpt8vrjbairto.png", "5月9日": "https://patchwiki.biligame.com/images/dongsen/3/3e/4uw8h5r7efsfroiz1fwdfubb3gqxlvd.png", "12月30日": "https://patchwiki.biligame.com/images/dongsen/e/e1/bvlhebjvu4srieqmn8rilympp2z9val.png", "10月30日": "https://patchwiki.biligame.com/images/dongsen/1/1e/8301xbo3urk9tch9g6msx6hig6wrrhq.png", "2月20日": "https://patchwiki.biligame.com/images/dongsen/5/51/r4egt0jnu8lxllsxvi70o24uxme25x4.png", "3月14日": "https://patchwiki.biligame.com/images/dongsen/d/d1/ih2tu2bya6cp3b4whqhq2wycrsxnu6e.png", "6月2日": "https://patchwiki.biligame.com/images/dongsen/d/d6/r51r1nlkfe734as91v19xf25gg0enk4.png", "2月7日": "https://patchwiki.biligame.com/images/dongsen/5/59/i0jmfzci713s9ofwqrg4piif2aw2i0w.png", "4月3日": "https://patchwiki.biligame.com/images/dongsen/8/8b/9nmc5pj2daqmr6m6kvxd2hr5zphdbns.png", "12月3日": "https://patchwiki.biligame.com/images/dongsen/7/7c/4lkhhtbk1dm6dh7mx0zr06jjtist5p8.png", "3月19日": "https://patchwiki.biligame.com/images/dongsen/e/ef/77kati0bgxauqxuyu67pwpyjtsm0e2v.png", "1月6日": "https://patchwiki.biligame.com/images/dongsen/2/25/7jzjauc9zfcy88lorf1yuz7mvtftdw0.png", "1月9日": "https://patchwiki.biligame.com/images/dongsen/1/13/5azpbdwxoxpz1ljb68lpr08wy4a3gt4.png", "4月9日": "https://patchwiki.biligame.com/images/dongsen/7/7b/4fzu1zxj9k2bqx8itjd7hwtl37wvuyv.png", "5月6日": "https://patchwiki.biligame.com/images/dongsen/6/65/2tazxmv3v4sea1z6vh7dbghw2bnoocd.png", "1月22日": "https://patchwiki.biligame.com/images/dongsen/d/d9/n00g59xqa96cfu7kjb085cpj2xocj3o.png", "5月28日": "https://patchwiki.biligame.com/images/dongsen/e/e3/c3lbbdzgocb8qssvhixo79zwfmr9xq8.png", "3月3日": "https://patchwiki.biligame.com/images/dongsen/b/bc/9vyim332hu5nsf827ptj8opwnrjokr7.png", "1月21日": "https://patchwiki.biligame.com/images/dongsen/e/e5/bys6x2eq8pkukt2s3jaaj9eqhxufapk.png", "1月24日": "https://patchwiki.biligame.com/images/dongsen/e/e1/2y3wxf6fir5k8zxu1ik7hej40ru3el5.png", "8月28日": "https://patchwiki.biligame.com/images/dongsen/a/a7/jhciny9gwfym04n74ph0soihjhkb5uw.png", "10月28日": "https://patchwiki.biligame.com/images/dongsen/1/17/5aeptqefmdhnn7txpx4hdob27ozbx83.png", "8月10日": "https://patchwiki.biligame.com/images/dongsen/4/48/bgxtgs2w76gheg0269u9fp4pr3tx8rn.png", "12月25日": "https://patchwiki.biligame.com/images/dongsen/6/68/klaxl8prjk4p3dkly9621q3vzqkjaim.png", "3月11日": "https://patchwiki.biligame.com/images/dongsen/4/48/m5tfdviryiozol7qsv8ji7ddhpon3kd.png", "12月16日": "https://patchwiki.biligame.com/images/dongsen/a/a8/1mj4m56aedht79cldybbsbnt0ztrimm.png", "3月28日": "https://patchwiki.biligame.com/images/dongsen/2/2d/hy4wi3i6uscn2wcz5v5uq6goczlqz0k.png", "7月6日": "https://patchwiki.biligame.com/images/dongsen/f/f5/46xpeboflx1meoo7q9gy8dbnodr8ff6.png", "3月16日": "https://patchwiki.biligame.com/images/dongsen/b/b8/5poq2lslegj7bwt4lpoyeqfao49lold.png", "3月20日": "https://patchwiki.biligame.com/images/dongsen/4/44/hg3hckbwer9j339rb11moywaj6smy5z.png", "6月14日": "https://patchwiki.biligame.com/images/dongsen/5/5c/am40yyinov5mmkclttkyubirkadmquy.png", "9月4日": "https://patchwiki.biligame.com/images/dongsen/3/30/dxppkhuxf3hb0k98ojq5tv7qdypoisz.png", "6月3日": "https://patchwiki.biligame.com/images/dongsen/c/c6/5mgfgi38q1z353mkz2rvc40yioowh6g.png", "8月15日": "https://patchwiki.biligame.com/images/dongsen/8/81/6giwy3r977txgkka02n3rlk3x4gzu1a.png", "9月29日": "https://patchwiki.biligame.com/images/dongsen/6/6e/g6cocxxla3629wil6gucwpl6ojtzmt7.png", "6月19日": "https://patchwiki.biligame.com/images/dongsen/2/21/3gugjnk28cr8qg8x1uki514uclxz3uw.png", "11月30日": "https://patchwiki.biligame.com/images/dongsen/4/40/a2ajfmigfx0750e4tboeb956k1i9ies.png", "9月10日": "https://patchwiki.biligame.com/images/dongsen/4/42/tfcendmm114460krzuncw38g35toxmc.png", "3月18日": "https://patchwiki.biligame.com/images/dongsen/d/d7/orr001b5scgm12acutroxom53ypwy4t.png", "10月22日": "https://patchwiki.biligame.com/images/dongsen/1/14/3oxpxd38p755jomjc4jit9im19tuka0.png", "7月19日": "https://patchwiki.biligame.com/images/dongsen/9/9a/nhzwz0iex2z2u7zsy46o0xs7xvf5wj9.png", "7月16日": "https://patchwiki.biligame.com/images/dongsen/a/a2/7mq0v32x7priwqdbtjod1jokas7pcdy.png", "5月2日": "https://patchwiki.biligame.com/images/dongsen/c/ca/tsp10ljuqsd4kvz943x0dbltz0zip3h.png", "6月8日": "https://patchwiki.biligame.com/images/dongsen/8/89/gpzswatfsel82x786vxqz41jyvuhv14.png", "11月26日": "https://patchwiki.biligame.com/images/dongsen/9/9b/75lfwzz80r5zwdbu8wxotxaidsnkfa6.png", "8月5日": "https://patchwiki.biligame.com/images/dongsen/c/ca/tin80dfsjanwhjgpg3d19a56rd83dr8.png", "7月2日": "https://patchwiki.biligame.com/images/dongsen/9/9e/q2zi9f8l8cxhz6ecfo64rlzsqmm5y3b.png", "2月14日": "https://patchwiki.biligame.com/images/dongsen/d/da/9fzg1ls7g5c3txuxphubiwooxbr4pnc.png", "9月14日": "https://patchwiki.biligame.com/images/dongsen/8/88/faw8dqzaoiwdy5aydcd53reqz91901w.png", "7月3日": "https://patchwiki.biligame.com/images/dongsen/6/6a/22xnhu86ba85vz1sc8a7ejfm7vsyob6.png", "5月8日": "https://patchwiki.biligame.com/images/dongsen/6/6b/da7keq4702or8uryye6gtuvaz8013aa.png", "2月26日": "https://patchwiki.biligame.com/images/dongsen/b/bc/ekm2yudn1s5612zih4m7wwlu2ius8dq.png", "7月15日": "https://patchwiki.biligame.com/images/dongsen/d/da/0ofd7l03sge6meme22rny0g5t4ji3hm.png", "4月19日": "https://patchwiki.biligame.com/images/dongsen/9/97/hu80fyzr8qbhkb20k13iau0rsc6yihf.png", "12月6日": "https://patchwiki.biligame.com/images/dongsen/e/eb/jcjwvzzmjk45jb9k5birc565es5m8yv.png", "12月19日": "https://patchwiki.biligame.com/images/dongsen/9/91/g1egdrwvc36wsoyb04qc200964s4vo9.png", "12月14日": "https://patchwiki.biligame.com/images/dongsen/5/54/hb8mz0w85y37bhihntt2lg2sgoh6uhd.png", "8月27日": "https://patchwiki.biligame.com/images/dongsen/c/c2/b5laxy8ycy0mskwkunh92mb0mie9f9i.png", "8月31日": "https://patchwiki.biligame.com/images/dongsen/6/6b/knbp2rll0jrxv0dg852v7vfd526dxxn.png", "11月5日": "https://patchwiki.biligame.com/images/dongsen/7/7b/gzvtv3f7vwubiyhszmufw8xuyso33jw.png", "8月30日": "https://patchwiki.biligame.com/images/dongsen/2/2b/56zv4rn61ilgrau9ew8248ofkd6s5o2.png", "12月18日": "https://patchwiki.biligame.com/images/dongsen/1/1a/auyz5rbgrl3lq22lk6032qaw9nsf81x.png", "5月15日": "https://patchwiki.biligame.com/images/dongsen/c/cf/2tycl7qyndgzoz90sxad3rztqaj284p.png", "11月25日": "https://patchwiki.biligame.com/images/dongsen/b/b0/6sc4r820h43gljz7rlp92a37qbzbufp.png", "8月22日": "https://patchwiki.biligame.com/images/dongsen/e/ed/ezffzxnypqy04hnnmnj8xaezpgsor29.png", "1月26日": "https://patchwiki.biligame.com/images/dongsen/f/f6/al2ebe3fm8b9mvrurrxbh3ux2xitl33.png", "11月22日": "https://patchwiki.biligame.com/images/dongsen/b/b4/hompta8by1y633ydqmp8uldja6mh7bd.png", "9月17日": "https://patchwiki.biligame.com/images/dongsen/1/1f/0dktb2cyzk4my0h0wrn6k4qzei5fu47.png", "8月26日": "https://patchwiki.biligame.com/images/dongsen/b/bc/h937s6xnou6mc9h6ytnx55jsoodda9v.png", "3月24日": "https://patchwiki.biligame.com/images/dongsen/3/38/0yr4p5kk01pxlda7crx34dnmt9siklv.png", "12月13日": "https://patchwiki.biligame.com/images/dongsen/7/71/62iqqf2n75p9lu9kofx9rjwyku7bknj.png", "2月17日": "https://patchwiki.biligame.com/images/dongsen/7/78/jb1yvqgwlfkvbxq7bnh9p2knmd1zd18.png", }; const date = new Date(); const month = date.getMonth() + 1; const day = date.getDate(); let monthDayStr = `${month}月${day}日`; if (assignMonthDay.length > 0) { monthDayStr = assignMonthDay; } log(`日期:${monthDayStr}`); let imgUrl = imgObjs[monthDayStr]; if (imgUrl == undefined) { imgUrl = imgObjs["12月4日"]; } let img = await getImage(imgUrl); imgStyle.stack = contentStack; imgStyle.width = 138; imgStyle.height = 138; imgStyle.img = img; addStyleImg(); /* **************************************************************************** 上面添加你自己的组件内容/逻辑 ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ **************************************************************************** */ /* **************************************************************************** * 这里是图片逻辑,不用修改 **************************************************************************** */ if (!colorMode && !config.runsInWidget && changePicBg) { const okTips = "您的小部件背景已准备就绪"; let message = "图片模式支持相册照片&背景透明"; let options = ["图片选择", "透明背景"]; let isTransparentMode = await generateAlert(message, options); if (!isTransparentMode) { let img = await Photos.fromLibrary(); message = okTips; const resultOptions = ["好的"]; await generateAlert(message, resultOptions); files.writeImage(path, img); } else { message = "以下是【透明背景】生成步骤,如果你没有屏幕截图请退出,并返回主屏幕长按进入编辑模式。滑动到最右边的空白页截图。然后重新运行!"; let exitOptions = ["继续(已有截图)", "退出(没有截图)"]; let shouldExit = await generateAlert(message, exitOptions); if (shouldExit) return; // Get screenshot and determine phone size. let img = await Photos.fromLibrary(); let height = img.size.height; let phone = phoneSizes()[height]; if (!phone) { message = "您似乎选择了非iPhone屏幕截图的图像,或者不支持您的iPhone。请使用其他图像再试一次!"; await generateAlert(message, ["好的!我现在去截图"]); return; } // Prompt for widget size and position. message = "您想要创建什么尺寸的小部件?"; let sizes = ["小号", "中号", "大号"]; let size = await generateAlert(message, sizes); let widgetSize = sizes[size]; message = "您想它在什么位置?"; message += height == 1136 ? " (请注意,您的设备仅支持两行小部件,因此中间和底部选项相同。)" : ""; // Determine image crop based on phone size. let crop = { w: "", h: "", x: "", y: "" }; if (widgetSize == "小号") { crop.w = phone.小号; crop.h = phone.小号; let positions = [ "顶部 左边", "顶部 右边", "中间 左边", "中间 右边", "底部 左边", "底部 右边", ]; let position = await generateAlert(message, positions); // Convert the two words into two keys for the phone size dictionary. let keys = positions[position].split(" "); crop.y = phone[keys[0]]; crop.x = phone[keys[1]]; } else if (widgetSize == "中号") { crop.w = phone.中号; crop.h = phone.小号; // 中号 and 大号 widgets have a fixed x-value. crop.x = phone.左边; let positions = ["顶部", "中间", "底部"]; let position = await generateAlert(message, positions); let key = positions[position].toLowerCase(); crop.y = phone[key]; } else if (widgetSize == "大号") { crop.w = phone.中号; crop.h = phone.大号; crop.x = phone.左边; let positions = ["顶部", "底部"]; let position = await generateAlert(message, positions); // 大号 widgets at the 底部 have the "中间" y-value. crop.y = position ? phone.中间 : phone.顶部; } // Crop image and finalize the widget. let imgCrop = cropImage(img, new Rect(crop.x, crop.y, crop.w, crop.h)); message = "您的小部件背景已准备就绪,退出到桌面预览。"; const resultOptions = ["好的"]; await generateAlert(message, resultOptions); files.writeImage(path, imgCrop); } } ////////////////////////////////////// // 组件End // 设置小组件的背景 if (colorMode) { widget.backgroundColor = bgColor; } else { widget.backgroundImage = files.readImage(path); } // 设置边距(上,左,下,右) widget.setPadding(padding.top, padding.left, padding.bottom, padding.right); // 设置组件 Script.setWidget(widget); // 完成脚本 Script.complete(); // 预览 if (previewSize == "Large") { widget.presentLarge(); } else if (previewSize == "Medium") { widget.presentMedium(); } else { widget.presentSmall(); } ////////////////////////////////////// /* **************************************************************************** * 重置文本样式 **************************************************************************** */ function resetTextStyle() { textStyle.stack = undefined; // 加入到哪个内容栈显示 textStyle.marginStart = 0; textStyle.marginEnd = 0; textStyle.text = ""; // 显示的文字 textStyle.width = 0; // 宽 textStyle.height = 0; // 长 textStyle.lineLimit = 0; // 行数控制,0是全部展示 textStyle.font = undefined; // 字体 textStyle.textColor = defaultTextColor; // 文字颜色 } /* **************************************************************************** * 重置图片样式 **************************************************************************** */ function resetImgStyle() { imgStyle.stack = undefined; // 加入到哪个内容栈显示 textStyle.marginStart = 0; textStyle.marginEnd = 0; imgStyle.img = undefined; // 图片资源 imgStyle.width = 0; // 宽 imgStyle.height = 0; // 长 imgStyle.tintColor = undefined; // 图片渲染颜色 } /* **************************************************************************** * 添加一行文本数据进行显示 **************************************************************************** */ function addStyleText() { const contentStack = textStyle.stack; if (contentStack == undefined) { return; } const marginStart = textStyle.marginStart; if (marginStart != undefined && marginStart != 0) { contentStack.addSpacer(marginStart); } const textSpan = contentStack.addText(`${textStyle.text}`); contentStack.size = new Size(textStyle.width, textStyle.height); textSpan.lineLimit = textStyle.lineLimit; textSpan.font = textStyle.font; textSpan.textColor = textStyle.textColor; const marginEnd = textStyle.marginEnd; if (marginStart != undefined && marginStart != 0) { contentStack.addSpacer(marginEnd); } // 重置样式 resetTextStyle(); } /* **************************************************************************** * 添加图片进行显示 **************************************************************************** */ function addStyleImg() { const contentStack = imgStyle.stack; if (contentStack == undefined) { return; } const marginStart = textStyle.marginStart; if (marginStart != undefined && marginStart != 0) { contentStack.addSpacer(marginStart); } const imgSpan = contentStack.addImage(imgStyle.img); imgSpan.imageSize = new Size(imgStyle.width, imgStyle.height); const tintColor = imgStyle.tintColor; if (tintColor != undefined) { imgSpan.tintColor = tintColor; } const marginEnd = textStyle.marginEnd; if (marginStart != undefined && marginStart != 0) { contentStack.addSpacer(marginEnd); } // 重置样式 resetImgStyle(); } /* **************************************************************************** * 右对齐,水平方向排列 **************************************************************************** */ function alignRightStack(alignmentStack, marginRight) { let contentStack = alignmentStack.addStack(); contentStack.layoutHorizontally(); contentStack.addSpacer(); let returnStack = contentStack.addStack(); // 添加右边距 if (marginRight != undefined && marginRight != 0) { contentStack.addSpacer(marginRight); } return returnStack; } /* **************************************************************************** * 左对齐,水平方向排列 **************************************************************************** */ function alignLeftStack(alignmentStack, marginLeft) { let contentStack = alignmentStack.addStack(); contentStack.layoutHorizontally(); let returnStack = contentStack.addStack(); returnStack.layoutHorizontally(); // 添加左边距 if (marginLeft != undefined && marginLeft != 0) { returnStack.addSpacer(marginLeft); } contentStack.addSpacer(); return returnStack; } /* **************************************************************************** * 上对齐,垂直方向排列 **************************************************************************** */ function alignTopStack(alignmentStack, marginTop) { let contentStack = alignmentStack.addStack(); contentStack.layoutVertically(); // 添加左边距 if (marginTop != undefined && marginTop != 0) { contentStack.addSpacer(marginTop); } let returnStack = contentStack.addStack(); returnStack.layoutVertically(); contentStack.addSpacer(); return returnStack; } /* **************************************************************************** * 下对齐,垂直方向排列 **************************************************************************** */ function alignBottomStack(alignmentStack, marginBottom) { let contentStack = alignmentStack.addStack(); contentStack.layoutVertically(); contentStack.addSpacer(); let returnStack = contentStack.addStack(); // 添加下边距 if (marginBottom != undefined && marginBottom != 0) { contentStack.addSpacer(marginBottom); } return returnStack; } /* **************************************************************************** * 水平居中 **************************************************************************** */ function alignHorizontallyCenterStack(alignmentStack) { let returnStack = alignmentStack.addStack(); returnStack.layoutHorizontally(); returnStack.centerAlignContent(); return returnStack; } /* **************************************************************************** * 垂直居中 **************************************************************************** */ function alignVerticallyCenterStack(alignmentStack) { let returnStack = alignmentStack.addStack(); returnStack.layoutVertically(); returnStack.centerAlignContent(); return returnStack; } /* **************************************************************************** * 网络请求get封装 **************************************************************************** */ async function getJson(url) { const request = new Request(url); const defaultHeaders = { Accept: "*/*", "Content-Type": "application/json", }; request.url = url; request.method = "GET"; request.headers = defaultHeaders; const data = await request.loadJSON(); return data; } /* **************************************************************************** * 网络请求获取图片,如获取失败则从缓存读取图片 **************************************************************************** */ async function getImage(url) { // 设置图片缓存 const imageCache = files.joinPath( files.documentsDirectory(), "ac-image-cache" ); const cacheExists = files.fileExists(imageCache); var data; try { const request = new Request(url); data = await request.loadImage(); console.log("图片数据获取成功"); // 将获得的图片写入缓存 files.writeImage(imageCache, data); } catch (e) { if (cacheExists) { // 读取图片数据缓存 const cache = files.readImage(imageCache); console.log("图片缓存数据获取成功"); data = cache; } } return data; } /* **************************************************************************** * 图片裁剪相关 **************************************************************************** */ // Generate an alert with the provided array of options. async function generateAlert(message, options) { let alert = new Alert(); alert.message = message; for (const option of options) { alert.addAction(option); } let response = await alert.presentAlert(); return response; } // Crop an image into the specified rect. function cropImage(img, rect) { let draw = new DrawContext(); draw.size = new Size(rect.width, rect.height); draw.drawImageAtPoint(img, new Point(-rect.x, -rect.y)); return draw.getImage(); } // Pixel sizes and positions for widgets on all supported phones. function phoneSizes() { let phones = { 2688: { 小号: 507, 中号: 1080, 大号: 1137, 左边: 81, 右边: 654, 顶部: 228, 中间: 858, 底部: 1488, }, 1792: { 小号: 338, 中号: 720, 大号: 758, 左边: 54, 右边: 436, 顶部: 160, 中间: 580, 底部: 1000, }, 2436: { 小号: 465, 中号: 987, 大号: 1035, 左边: 69, 右边: 591, 顶部: 213, 中间: 783, 底部: 1353, }, 2208: { 小号: 471, 中号: 1044, 大号: 1071, 左边: 99, 右边: 672, 顶部: 114, 中间: 696, 底部: 1278, }, 1334: { 小号: 296, 中号: 642, 大号: 648, 左边: 54, 右边: 400, 顶部: 60, 中间: 412, 底部: 764, }, 1136: { 小号: 282, 中号: 584, 大号: 622, 左边: 30, 右边: 332, 顶部: 59, 中间: 399, 底部: 399, }, }; return phones; } /* **************************************************************************** **************************************************************************** **************************************************************************** */
! function() { var e = function(e, i, a) { var r = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia; return r ? new Promise(function(i, a) { r.call(navigator, e, i, a) }) : Promise.reject(new Error("getUserMedia is not implemented in this browser")) }; void 0 === navigator.mediaDevices && (navigator.mediaDevices = {}), void 0 === navigator.mediaDevices.getUserMedia && (navigator.mediaDevices.getUserMedia = e) }(); var RetryHandler = function() { this.interval = 1e3, this.maxInterval = 6e4 }; RetryHandler.prototype.retry = function(t) { setTimeout(t, this.interval), this.interval = this.nextInterval_() }, RetryHandler.prototype.reset = function() { this.interval = 1e3 }, RetryHandler.prototype.nextInterval_ = function() { var t = 2 * this.interval + this.getRandomInt_(0, 1e3); return Math.min(t, this.maxInterval) }, RetryHandler.prototype.getRandomInt_ = function(t, e) { return Math.floor(Math.random() * (e - t + 1) + t) }; var MediaUploader = function(t) { var e = function() {}; if (this.file = t.file, this.contentType = t.contentType || this.file.type || "application/octet-stream", this.metadata = t.metadata || { title: this.file.name, mimeType: this.contentType }, this.token = t.token, this.onComplete = t.onComplete || e, this.onProgress = t.onProgress || e, this.onError = t.onError || e, this.offset = t.offset || 0, this.chunkSize = t.chunkSize || 0, this.retryHandler = new RetryHandler, this.url = t.url, !this.url) { var n = t.params || {}; n.uploadType = "resumable", this.url = this.buildUrl_(t.fileId, n, t.baseUrl) } this.httpMethod = t.fileId ? "PUT" : "POST" }; MediaUploader.prototype.upload = function() { var t = new XMLHttpRequest; t.open(this.httpMethod, this.url, !0), t.setRequestHeader("Authorization", "Bearer " + this.token), t.setRequestHeader("Content-Type", "application/json"), t.setRequestHeader("X-Upload-Content-Length", this.file.size), t.setRequestHeader("X-Upload-Content-Type", this.contentType), t.onload = function(t) { if (t.target.status < 400) { var e = t.target.getResponseHeader("Location"); this.url = e, this.sendFile_() } else this.onUploadError_(t) }.bind(this), t.onerror = this.onUploadError_.bind(this), t.send(JSON.stringify(this.metadata)) }, MediaUploader.prototype.sendFile_ = function() { var t = this.file, e = this.file.size; (this.offset || this.chunkSize) && (this.chunkSize && (e = Math.min(this.offset + this.chunkSize, this.file.size)), t = t.slice(this.offset, e)); var n = new XMLHttpRequest; n.open("PUT", this.url, !0), n.setRequestHeader("Content-Type", this.contentType), n.setRequestHeader("Content-Range", "bytes " + this.offset + "-" + (e - 1) + "/" + this.file.size), n.setRequestHeader("X-Upload-Content-Type", this.file.type), n.upload && n.upload.addEventListener("progress", this.onProgress), n.onload = this.onContentUploadSuccess_.bind(this), n.onerror = this.onContentUploadError_.bind(this), n.send(t) }, MediaUploader.prototype.resume_ = function() { var t = new XMLHttpRequest; t.open("PUT", this.url, !0), t.setRequestHeader("Content-Range", "bytes */" + this.file.size), t.setRequestHeader("X-Upload-Content-Type", this.file.type), t.upload && t.upload.addEventListener("progress", this.onProgress), t.onload = this.onContentUploadSuccess_.bind(this), t.onerror = this.onContentUploadError_.bind(this), t.send() }, MediaUploader.prototype.extractRange_ = function(t) { var e = t.getResponseHeader("Range"); e && (this.offset = parseInt(e.match(/\d+/g).pop(), 10) + 1) }, MediaUploader.prototype.onContentUploadSuccess_ = function(t) { 200 == t.target.status || 201 == t.target.status ? this.onComplete(t.target.response) : 308 == t.target.status ? (this.extractRange_(t.target), this.retryHandler.reset(), this.sendFile_()) : this.onContentUploadError_(t) }, MediaUploader.prototype.onContentUploadError_ = function(t) { t.target.status && t.target.status < 500 ? this.onError(t.target.response) : this.retryHandler.retry(this.resume_.bind(this)) }, MediaUploader.prototype.onUploadError_ = function(t) { this.onError(t.target.response) }, MediaUploader.prototype.buildQuery_ = function(t) { return t = t || {}, Object.keys(t).map(function(e) { return encodeURIComponent(e) + "=" + encodeURIComponent(t[e]) }).join("&") }, MediaUploader.prototype.buildUrl_ = function(t, e, n) { var o = n || "https://www.googleapis.com/upload/drive/v2/files/"; t && (o += t); var r = this.buildQuery_(e); return r && (o += "?" + r), o };
import React, {useRef} from 'react'; import { Dropdown } from 'semantic-ui-react'; import DocumentsActsTable from './DocumentsActsTable/DocumentsActsTable'; import DateTimePicker from '../../DateTimePicker/DateTimePicker'; import UploadScantModal from "../../modals/UploadScan/UploadScanModal"; import RoleBasedRender from '../../RoleBasedRender/RoleBasedRender'; const mockInfo = [ { date: new Date().toISOString(), user: 'Житкова Любава Евстигнеевна', document: 'Скан прибора учета', status: 'Не отправлен' }, { date: new Date().toISOString(), user: 'Житкова Любава Евстигнеевна', document: 'Скан прибора учета', status: 'Отправлен' }, { date: new Date().toISOString(), user: 'Житкова Любава Евстигнеевна', document: 'Скан прибора учета', status: 'Не отправлен' }, { date: new Date().toISOString(), user: 'Житкова Любава Евстигнеевна', document: 'Скан прибора учета', status: 'Отправлен' }, { date: new Date().toISOString(), user: 'Житкова Любава Евстигнеевна', document: 'Скан прибора учета', status: 'Не отправлен' }, { date: new Date().toISOString(), user: 'Житкова Любава Евстигнеевна', document: 'Скан прибора учета', status: 'Отправлен' }, { date: new Date().toISOString(), user: 'Житкова Любава Евстигнеевна', document: 'Скан прибора учета', status: 'Не отправлен' }, { date: new Date().toISOString(), user: 'Житкова Любава Евстигнеевна', document: 'Скан прибора учета', status: 'Не отправлен' }, ]; const mockInfo2 = [ { date: new Date().toISOString(), document: 'Скан прибора учета', status: 'Не отправлен' }, { date: new Date().toISOString(), document: 'Скан прибора учета', status: 'Отправлен' }, { date: new Date().toISOString(), document: 'Скан прибора учета', status: 'Не отправлен' }, { date: new Date().toISOString(), document: 'Скан прибора учета', status: 'Отправлен' }, { date: new Date().toISOString(), document: 'Скан прибора учета', status: 'Не отправлен' }, { date: new Date().toISOString(), document: 'Скан прибора учета', status: 'Отправлен' }, { date: new Date().toISOString(), document: 'Скан прибора учета', status: 'Не отправлен' }, { date: new Date().toISOString(), document: 'Скан прибора учета', status: 'Не отправлен' }, ]; const dateFilterOptions = [ { key: '1 января 2019 - 1 сентября 2019', text: '1 января 2019 - 1 сентября 2019', value: '1 января 2019 - 1 сентября 2019', }, { key: '1 сентября 2019 - 1 октября 2019', text: '1 сентября 2019 - 1 октября 2019', value: '1 сентября 2019 - 1 октября 2019', }, ]; const usersOptions = [ { key: 'С потребителями и СО', text: 'С потребителями и СО', value: 'С потребителями и СО', } ]; const statusOptions = [ { key: 'С любым статусом', text: 'С любым статусом', value: 'С любым статусом', }, { key: 'Отправлен', text: 'Отправлен', value: 'Отправлен', }, { key: 'Не отправлен', text: 'Не отправлен', value: 'Не отправлен', }, ]; function DocumentsActs() { const childRef = useRef(); const handleDelete = event => console.log('Clicked delete'); const handleRowClick = event => console.log('Clicked'); return ( <div> <div className='flex-row space'> <div className='flex-row'> <RoleBasedRender requiredRoles={ ['Администратор'] } > <Dropdown defaultValue='С потребителями и СО' fluid className="app-dropdown-button date-range-selector medium-input-dropdown dropdown-margin" selection icon='angle down' options={ usersOptions } /> </RoleBasedRender> <DateTimePicker /> <Dropdown defaultValue='С любым статусом' fluid className="app-dropdown-button date-range-selector small-input-dropdown dropdown-margin" selection icon='angle down' options={ statusOptions } /> </div> <RoleBasedRender requiredRoles={ ['Администратор'] } > <button className='primary-button flex-row' onClick={() => childRef.current.showModal()}>Загрузить скан акта</button> </RoleBasedRender> </div> <RoleBasedRender requiredRoles={ ['Администратор'] } > <DocumentsActsTable documents={ mockInfo } onDelete={ handleDelete } onRowClick={ handleRowClick } /> </RoleBasedRender> <RoleBasedRender requiredRoles={ ['Потребитель'] } > <DocumentsActsTable documents={ mockInfo2 } onDelete={ handleDelete } onRowClick={ handleRowClick } /> </RoleBasedRender> <UploadScantModal ref={childRef}/> </div> ); } export default DocumentsActs;
import React, { useContext, useState } from 'react' import style from "../styles/pages/Products.module.scss" import Link from "next/link" import AllProducts from '../pages/all-products' import AppContext from './AppContext' const Product = ({...restProps}) => { const myContext = useContext(AppContext); if(restProps.data){ const {data:product} = restProps; const openForm = (value) => { const orderSampleForm = document.getElementById("contact-form"); orderSampleForm.classList.toggle("show"); myContext.setCoffee(value); } const {features} = product; return ( <div className={style.products__card} style={restProps.styles}> <img src={`/assets/images/products/${product.image}`} height="423px" width="450px" alt="castillo coffee" /> <div className={style.products__card__content} style={restProps.cardContentStyle}> {restProps.slug? <div style={{display:"flex", alignItems:"center", gap:"1rem"}} > <h3 style={{marginRight: "1rem", lineHeight:"18px"}}> {product.varietal}</h3></div> : <Link style={{display:"flex", alignItems:"center", gap:"1rem"}} href={`/products/${encodeURIComponent(product.id)}`}> <h3 className={style.products__title} style={{marginRight: "1rem"}}> {product.varietal}<span className={style.arrow} > &rarr;</span></h3></Link> } <ul className={style.products__features}> {Object.entries(features).map((value, key)=>{ return( <li key = {key} className={style.product__feature}><b>{value[0]}: </b> {value[1]}</li> ) })} </ul> {restProps.slug? <p>{product.description}</p>: ""} <div onClick = {()=>openForm(product.varietal)} className={style.orderBtn}>Order Sample</div> </div> </div> ) } else{ return( <AllProducts /> ) } } export default Product
'use strict'; import React, {Component} from 'react'; import { View, ScrollView, TouchableOpacity, SafeAreaView, StatusBar, Image, StyleSheet, KeyboardAvoidingView, FlatList, TouchableWithoutFeedback, Text, Modal, } from 'react-native'; import { Icon} from 'native-base' import styles from './styles'; import colors from '../../assets/colors' import data from '../Register/Countries'; import { ProgressDialog } from 'react-native-simple-dialogs'; import {DisplayText, InputField, SingleButtonAlert, SubmitButton} from '../../components'; import { UpdateUserEndpoint, updateUserDetails, getUserDetails } from '../Utils/Utils'; import {connect} from 'react-redux'; import { setProfile } from '../../redux/actions/ProfileActions'; import DropdownAlert from 'react-native-dropdownalert'; const defaultFlag = data.filter( obj => obj.name === 'Nigeria' )[0].flag class ContactDetails extends Component { constructor(props) { super(props); this.state ={ isAddressValid : false, isStateProRegValid : false, isCityValid : false, flag : defaultFlag, nationalityModalVisible : false, showAlert : false, showLoading : false, title : '', message : '', id : '', token : '', address : '', city : '', stateProReg :'', country : '', } } async componentDidMount(){ let userDetails = await getUserDetails(); const {profile} = this.props; await this.setState({ id : userDetails.data.id, token: userDetails.token, //profile. }); } showLoadingDialogue =()=> { this.setState({ showLoading: true, }); } hideLoadingDialogue =()=> { this.setState({ showLoading: false, }); } // showNotification = (message, title) => { // this.setState({ // showLoading : false, // title : title, // message : message, // showAlert : true, // }); // } showNotification = (type, title, message) => { this.hideLoadingDialogue(); return this.dropDownAlertRef.alertWithType(type, title, message); } handleCloseNotification = () => { return this.setState({ showAlert : false, }) } handleUpdate = async() => { this.showLoadingDialogue(); const { id, token, address, city, country, stateProReg } = this.state; let endpoint = `${UpdateUserEndpoint}/${id}`; let body = {id, token, address, city, country, stateProReg}; const settings = { method : "PUT", body : JSON.stringify(body), headers : { "Accept" : "application/json", 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}`, } } try { let response = await fetch(endpoint, settings); let res = await response.json(); if(typeof res.errors !== 'undefined') { const value = Object.values(res.errors); return this.showNotification('error','Error', value[0].toString()); } else { this.props.setProfile(res.data); updateUserDetails(res.data, token); return this.showNotification('success', 'Success', 'Contact Updated Successfully'); } } catch(error) { return this.showNotification('error', 'Error', error.toString()); } } handleChangeAddress = (address) => { if (address.length > 0) { this.setState({ isAddressValid : true, address: address }); } else { if ( address.length < 1 ) { this.setState({ isAddressValid : false }) } } } handleChangeSpr = (stateProReg) => { if (stateProReg.length > 0) { this.setState({ isStateProRegValid : true, stateProReg: stateProReg }); } else { if ( stateProReg.length < 1 ) { this.setState({ isStateProRegValid : false }) } } } handleChangeCity = (city) => { if (city.length > 0) { this.setState({ isCityValid : true, city: city }); } else { if ( city.length < 1 ) { this.setState({ isCityValid : false }) } } } handdleBackPress = () => { return this.props.navigation.goBack(); }; selectNationality = async(country) => { // Get data from Countries.js const countryData = await data try { //get country name const countryName = await countryData.filter( obj => obj.name === country )[0].name // Update the state then hide the Modal this.setState({ country : countryName, }) await this.hideNationalityModal() } catch (err) { (err) } } showNationalityModal = ()=> { this.setState({ nationalityModalVisible: true }) } hideNationalityModal =()=> { this.setState({ nationalityModalVisible: false }) } render () { const { title, message, showAlert, showLoading } = this.state const countryData = data return( <SafeAreaView style={styles.container}> <StatusBar barStyle="default" /> <View style = {styles.navBar}> <TouchableOpacity onPress = {this.handdleBackPress} style = {styles.headerImage}> <Image onPress = {this.handdleBackPress} source = {require('../../assets/images/back.png')} style = {StyleSheet.flatten(styles.headerIcon)} /> </TouchableOpacity> <View style = {styles.nameView}> <DisplayText text={'Manage Account'} styles = {StyleSheet.flatten(styles.txtHeader)}/> </View> </View> <DropdownAlert ref={ref => this.dropDownAlertRef = ref} /> {/* Card Contact Details */} <View style = {styles.cards}> <View style = {styles.cardImageView}> <Image source = {require('../../assets/images/email.png')} style = {StyleSheet.flatten(styles.cardIcon)} /> </View> <View style = { styles.viewText}> <DisplayText text={'Contact Details'} styles = {StyleSheet.flatten(styles.amtText)} /> </View> <TouchableOpacity onPress = {this.handdleBackPress} style = {styles.angleView}> <Image onPress = {this.handdleBackPress} source = {require('../../assets/images/angle_back.png')} style = {StyleSheet.flatten(styles.angleBack)} /> </TouchableOpacity> </View> <KeyboardAvoidingView style={styles.wrapper} behavior = 'padding'> <ScrollView style={{flex:1,}} showsVerticalScrollIndicator={false}> <View style = {styles.formView}> <DisplayText text={'Address *'} styles = {styles.formHeaderTxt} /> <InputField textColor={colors.text_color} inputType={'name'} keyboardType={'default'} onChangeText = {this.handleChangeAddress} autoCapitalize = "words" height = {40} // borderWidth = {1} borderColor={colors.field_color} borderRadius={4} paddingLeft = {8} formStyle = {styles.formstyle} /> </View> {/* Nationality */} <View style = {styles.CountryView}> <DisplayText text={'Coutry *'} styles = {styles.formHeaderTxt} /> <TouchableOpacity underlayColor={colors.white} onPress={() => this.showNationalityModal()} style = {styles.textBoder}> <View style = {styles.viewTxtgender}> <Text style = {styles.genderText}> {this.state.country} </Text> <Icon active name='md-arrow-dropdown' style={styles.iconStyle} onPress={() => this.showNationalityModal()} /> </View> </TouchableOpacity> <Modal animationType="slide" transparent={true} onRequestClose={this.hideNationalityModal} visible={this.state.nationalityModalVisible}> <View style={{ flex : 1, paddingLeft : 20, paddingRight : 20}}> <View style={{ flex: 7, marginTop: 10 }}> {/* Render the list of countries */} <FlatList data={countryData} keyExtractor={(item, index) => index.toString()} renderItem={ ({ item }) => <TouchableWithoutFeedback onPress={() => this.selectNationality(item.name)}> <View style={styles.countryStyle}> <Text style={styles.textStyle}> {item.flag} {item.name} </Text> </View> </TouchableWithoutFeedback> } /> </View> <View style={styles.closeButtonStyle}> <TouchableOpacity style={styles.closeButton} onPress={() => this.hideNationalityModal()}> <Text style={styles.textBtn}> Close </Text> </TouchableOpacity> </View> </View> </Modal> </View> <View style = {styles.formView}> <DisplayText text={'State/Provice/Region *'} styles = {styles.formHeaderTxt} /> <InputField textColor={colors.text_color} inputType={'name'} keyboardType={'default'} onChangeText = {this.handleChangeSpr} autoCapitalize = "words" height = {40} // borderWidth = {1} borderColor={colors.field_color} borderRadius={4} paddingLeft = {8} formStyle = {styles.formstyle} /> </View> <View style = {styles.formView}> <DisplayText text={'City *'} styles = {styles.formHeaderTxt} /> <InputField textColor={colors.text_color} inputType={'name'} keyboardType={'default'} onChangeText = {this.handleChangeCity} autoCapitalize = "words" height = {40} // borderWidth = {1} borderColor={colors.field_color} borderRadius={4} paddingLeft = {8} formStyle = {styles.formstyle} /> </View> <View style = {styles.btnView}> <ProgressDialog visible={showLoading} title="Processing" message="Please wait..." /> <SubmitButton title={'Update'} onPress={this.handleUpdate} titleStyle={styles.btnText} btnStyle = {styles.btnStyle} /> <SingleButtonAlert title = {title} message = {message} handleCloseNotification = {this.handleCloseNotification} visible = {showAlert} /> </View> </ScrollView> </KeyboardAvoidingView> </SafeAreaView> ) } } const mapStateToProps = (state, ownProps) =>{ return{ profile: state.ProfileReducer.profile } } const mapDispatchToProps = (dispatch) =>{ return{ setProfile: (data) =>{dispatch(setProfile(data))}, } } export default connect(mapStateToProps, mapDispatchToProps)(ContactDetails);
import React from "react"; import { Menubar } from "primereact/menubar"; import { InputText } from "primereact/inputtext"; import { Button } from "primereact/button"; export const MenubarDemo = ({handleChange , handleClick}) => { const loadState = () => { try { const serializedState = localStorage.getItem(`user`); if (serializedState === null) { return undefined; } const state = JSON.parse(serializedState); return state; } catch (err) { return undefined; } }; const RemoveItem = ()=>{ try { localStorage.removeItem('user') } catch (err) { return undefined; } } const items = [ { label: "Search", icon: "pi pi-filter", command: (event)=>{ return handleClick(event) } }, { label: "favourites", icon: "pi pi-star", }, { label: "Log In", icon: "pi pi-fw pi-user", command: (event) => { window.location.pathname = "/login"; }, }, { label: "register", icon: "pi pi-fw pi-user", command: (event) => { window.location.pathname = "/register"; }, }, ]; return ( <div className="card"> <Menubar model={items} start={<InputText placeholder="Search" type="text" onChange={(e)=>{handleChange(e)}}/>} end={ <Button label="Logout" icon="pi pi-power-off" className="p-button-raised p-button-rounded" onClick={RemoveItem} /> } /> </div> ) }; //<Button label="Proceed" className="p-button-raised p-button-rounded" />
const express = require('express') const scheduleController = require('../controllers/scheduleController') const auth = require('../middlewares/auth') const router = new express.Router() /** * Router for all endpoints regarding to managing the schedules. */ /** * Route for creating a new schedule. */ router.post('/schedules', auth, scheduleController.createSchedule) /** * Route for getting a list of all schedules by EmployeeId */ router.get('/schedules/:id', auth, scheduleController.readAllSchedules) /** * Route for getting a schedule. */ router.get('/schedules/:id', auth, scheduleController.readSchedule) /** * Route for updating a schedule. Allowed options are 'planned', 'actual' and 'isHoliday'. */ router.patch('/schedules/:id', auth, scheduleController.updateSchedule) /** * Route for deleting a schedule. */ router.delete('/schedules/:id', auth, scheduleController.deleteSchedule) /** * Route for start and stop the time tracker by EmployeeId */ router.post('/schedules/tracking/:id', auth, scheduleController.trackTime) router.post('/schedules/holidays/:id', auth, scheduleController.setHolidays) module.exports = router
const require_ = require('esm')(module) module.exports = require_('./index.js').default module.exports.init = module.exports
'use strict'; const express = require('express'); const router = new express.Router(); router.get('/', serveFront); router.post('/', serveFront); /** * Serves frontpage (/) of the website * * @param {Object} req HTTP Request object * @param {Object} req HTTP Response object */ function serveFront(req, res) { res.render('index', { pageTitle: 'pangalinkide testkeskkond', page: '/' }); } module.exports = router;
import { StyleSheet, Platform, StatusBar } from "react-native"; export const styles = StyleSheet.create({ container: { marginTop: 30 }, subtitleView: { flexDirection: 'row', paddingLeft: 10, paddingTop: 5 }, subtitleText: { opacity: 0.5 } });
import classes from '../styles/Header.module.css'; import Query from './Query/index.js'; import HEADER_QUERY from '../queries/header.js'; import { connect } from "react-redux"; import store from '../store/index'; import { slide as Menu } from 'react-burger-menu'; import { NavHashLink } from 'react-router-hash-link'; const mapStateToProps = state => { return { lang: state.lang }; }; const changeLang = () => { var state = store.getState() var lang = state.lang === 'en' ? 'hun' : 'en'; store.dispatch({ type: 'SET_LANG', payload: lang }); } const closeMenu = () => { function eventFire(el, etype){ if (el.fireEvent) { el.fireEvent('on' + etype); } else { var evObj = document.createEvent('Events'); evObj.initEvent(etype, true, false); el.dispatchEvent(evObj); } } eventFire(document.getElementById('react-burger-cross-btn'), 'click'); } const connectedHeader = ({ lang }) => { return ( <div> <nav className={`${classes.header} navbar fixed-top navbar-expand-xl navbar-light bg-lightest`} id="header"> <NavHashLink smooth to="/#home" className="navbar-brand" > <img src="/logo.svg" alt="Yolk.digital"/> </NavHashLink> <Query query={HEADER_QUERY} id={null} > {({ data: { header } }) => { return ( <> <div className="d-xl-none"> <img src="/menu.svg" alt="Menu"/> <Menu right width={ 280 } disableAutoFocus > {header.links.map((link, i) => { return ( <div className="nav-item mr-4"> <NavHashLink smooth onClick={closeMenu} to={link.url} className={classes.link} >{ link[lang]} </NavHashLink> </div> ) })} <div className="nav-item"> <div className={classes.link} onClick={changeLang}> {lang === 'hun' && <span>EN/<span className="text-orange">HU</span></span> } {lang === 'en' && <span><span className="text-orange">EN</span>/HU</span> } </div> </div> </Menu> </div> <div className="collapse navbar-collapse" id="navbarSupportedContent"> <ul className="navbar-nav ml-auto"> {header.links.map((link, i) => { return ( <li className="nav-item mr-4"> <NavHashLink smooth to={link.url} className={classes.link} > {link[lang]} </NavHashLink> </li> ) })} <li className="nav-item"> <div className={classes.link} onClick={changeLang}> {lang === 'hun' && <span>EN/<span className="text-orange">HU</span></span> } {lang === 'en' && <span><span className="text-orange">EN</span>/HU</span> } </div> </li> </ul> </div> </> ) }} </Query> </nav> </div> ) } const Header = connect(mapStateToProps)(connectedHeader); export default Header
import React from 'react'; import { observer } from 'mobx-react'; // import {action, observable} from 'mobx'; @observer class SimpleCheckbox extends React.Component { // @observable field = null constructor(props) { super(props) // this.field = props.field } render() { const { field, label, style } = this.props return ( <div className={ field.error ? 'form-check has-danger' : 'form-check'} style={style}> <label htmlFor={field.id} className='form-check-label'> <input {...field.bind({type: 'checkbox'})} className='form-check-input' checked={field.value }/> {label ? label : field.label} </label> <small className="form-control-feedback d-flex">{field.error}</small> </div> ) } } export default SimpleCheckbox
import React, { useState } from "react"; import "./ProjectEdit.css"; import moment from "moment"; import ReactDatePicker from "react-datepicker"; import "react-datepicker/dist/react-datepicker.css"; import { useHistory } from "react-router"; import { Button, Dropdown, Form } from "semantic-ui-react"; import Wrapper from "../../components/layouts/Wrapper"; const teamLeadMembersOptions = [ { key: 1, text: "Sammy", value: "Sammy" }, { key: 2, text: "Dorcis", value: "Dorcis" }, { key: 3, text: "Kirigha", value: "Kirigha" }, { key: 4, text: "John", value: "John" }, { key: 5, text: "Mwasho", value: "Mwasho" }, ]; const initialActivityOptions = [ { key: 1, text: "Planning & Scheduling", value: "Planning & Scheduling" }, { key: 2, text: "Project Timeline View", value: "Project Timeline View" }, { key: 3, text: "Collaboration", value: "Collaboration" }, ]; const ProjectEdit = () => { const [project, setProject] = useState({ project_name: "", duration: "", start_date: moment().toDate(), duration: "", description: "", team_lead: "", initial_activity: "", }); const onChange = (e) => { const { name, value } = e.target; setProject((prev) => ({ ...prev, [name]: value })); }; const selectHandle = (e, data) => { const { name, value } = data; setProject((prev) => ({ ...prev, [name]: value })); }; const minDate = moment(); return ( <Wrapper> <div className="projectUpdate"> <h1 className="addProjectTitle">Edit Project</h1> <form className="addProjectForm"> <div className="addProjectItem"> <lable>Project name </lable> <input type="text" name="project_name" id="name" placeholder="enter project name" autoComplete="off" value={project.project_name} onChange={onChange} /> </div> <div className="addProjectItem"> <lable> Start Date </lable> <ReactDatePicker name="date" id="date" value={project.start_date} autoComplete="off" dateFormat="dd/MM/yyyy" selected={project.start_date} minDate={minDate} onChange={(date) => setProject({ ...project, start_date: date })} filterDate={(date) => date.getDay() !== 6 && date.getDay() !== 0} isClearable showYearDropdown scrollableYearDropdown /> </div> <div className="addProjectItem"> <lable> Duration </lable> <input type="text" name="duration" id="duration" placeholder="enter duration" autoComplete="off" value={project.duration} onChange={onChange} /> </div> <div className="addProjectItem"> <lable> Description </lable> <input type="text" name="description" id="description" placeholder="enter description" autoComplete="off" value={project.description} onChange={onChange} /> </div> <div className="addProjectItem"> <lable> Team Lead </lable> <Dropdown placeholder="select Team Lead" name="team_lead" fluid search // value={handleSelect} onChange={selectHandle} selection options={teamLeadMembersOptions} /> </div> <div className="addProjectItem"> <lable> Initial Activity </lable> <Dropdown placeholder="Select Initial Activity" name="initial_activity" fluid search // value={handleSelect} onChange={selectHandle} selection options={initialActivityOptions} /> </div> <button className="addProjectButton" type="submit"> Update </button> </form> </div> </Wrapper> ); }; export default ProjectEdit;
import { ApolloClient } from 'apollo-client' import {HttpLink} from "apollo-link-http" import {InMemoryCache} from "apollo-cache-inmemory" const GITHUB_BASE_GQL_URL = 'https://api.github.com/graphql' const httpLink = new HttpLink({ uri: GITHUB_BASE_GQL_URL, headers: { authorization: `Bearer ${process.env.REACT_APP_GITHUB_KEY}` } }) const cache = new InMemoryCache() const client = new ApolloClient({ link: httpLink, cache }) export default client
// pass the modules you would like to see transpiled const withTM = require('next-transpile-modules')(['lodash-es', '@bootcamp/graphql', '@bootcamp/stores']); module.exports = withTM();
import React, {Component} from "react"; import {Button, Card, Modal} from "react-bootstrap"; import {FontAwesomeIcon} from "@fortawesome/react-fontawesome" class BookMarkCard extends Component { state = { show: false } setShow = (event) => { this.setState({show: true}); } onModalClose = () => { this.setState({show: false}); } render() { return (<><><Modal show={this.state.show}> <Modal.Header closeButton onClick={this.onModalClose}> <Modal.Title>{this.props.title}</Modal.Title> </Modal.Header> <Modal.Body> <div className="h4">{this.props.description}</div> <p>><a href={this.props.tinyUrl}>{this.props.tinyUrl}</a></p> </Modal.Body> </Modal></> <div className="col-md-3 m-1 p-1 d-flex align-items-stretch" onClick={this.props.clicked}> <Card style={{width: '18rem'}} className="bg-dark text-white"> <FontAwesomeIcon icon="coffee"/> <Card.Body> <Card.Title>{this.props.title}</Card.Title> <Button variant="outline-primary m-1" onClick={() => this.setShow()}>View</Button> <Button variant="outline-warning m-1" onClick={this.props.whenEdit}>Edit</Button> </Card.Body> </Card> </div> </> ); } } BookMarkCard.propTypes = {}; export default BookMarkCard;
import React, { Component } from 'react'; import { Link } from 'react-router-dom'; import { connect } from 'react-redux'; import { loginAction } from '../modules/Login' import * as RoutePath from '../utilities/RoutePath'; import { Formik, Form, Field } from 'formik'; class Login extends Component { constructor(props) { super(props); this.state = { username: this.props.loginReducer.username, password: this.props.loginReducer.password } this.onLoginSubmit = this.onLoginSubmit.bind(this); } loginForm = ({ error, status, touched, isSubmitting }) => ( <Form> <Field type="email" name="username" placeholder="username" /> <Field type="password" name="password" placeholder="password" /> <button type="submit">Login</button> </Form> ); componentDidMount() { console.log(this.props); } onLoginSubmit = (values, action) => { debugger; this.props.dispatch(loginAction(values)) // console.log(values); action.resetForm(); } render() { return ( <div> <Formik initialValues={this.state} onSubmit={this.onLoginSubmit} render={this.loginForm} /> <Link to={{ pathname: RoutePath.SIGNUP, hash: '#/test', search: '' }}>Signup</Link> </div > ) } } const mapStateToProps = (state) => { console.log(state) return { loginReducer: state.loginReducer } } export default connect(mapStateToProps)(Login);
import { ManagementClient, AuthenticationClient } from "auth0"; const { AUTH0_DOMAIN: domain, AUTH0_CLIENT_ID: clientId, AUTH0_CLIENT_SECRET: clientSecret } = process.env; const auth0Management = new ManagementClient({ domain, clientId, clientSecret }); const auth0Authentication = new AuthenticationClient({ domain, clientId }); export { auth0Management, auth0Authentication };
/************** BLOCK SCOPE IN JS ********************/ /* { var x = 10; let y = 100; const z = 1000; console.log(x); console.log(y); console.log(z); } console.log(x); console.log(y); console.log(z); */ /********* SHADOWING IN JS ****************/ /* let y = 11; { var x = 10; // t has shadowed the global value of x. let y = 100; const z = 1000; console.log(x); console.log(y); console.log(z); } //console.log(x); console.log(y); //console.log(z); */ /****** shadowing follows lexical environment ******/ const a = 10; { const a = 20; { const a = 30; console.log(a); } }
OC.L10N.register( "lib", { "Cannot write into \"config\" directory!" : "Nu se poate scrie în folderul \"config\"!", "This can usually be fixed by giving the webserver write access to the config directory" : "Aceasta se poate repara de obicei prin permiterea accesului de scriere la dosarul de configurare al serverului Web", "See %s" : "Vezi %s", "This can usually be fixed by %sgiving the webserver write access to the config directory%s." : "Aceasta se poate repara de obicei de %s prin acordarea accesului de scriere către serverul Web pentru directorul de configurare %s. ", "Sample configuration detected" : "A fost detectată o configurație exemplu", "It has been detected that the sample configuration has been copied. This can break your installation and is unsupported. Please read the documentation before performing changes on config.php" : "S-a detectat copierea configurației exemplu. Acest lucru poate duce la oprirea instanței tale și nu este suportat. Te rugăm să citești documentația înainte de a face modificări în fișierul config.php", "PHP %s or higher is required." : "Versiunea PHP %s sau mai mare este necesară.", "PHP with a version lower than %s is required." : "Este necesară o versiune PHP mai mică decât %s", "%sbit or higher PHP required." : "Este necesar PHP %sbit sau mai mare.", "Following databases are supported: %s" : "Următoarele baze de date sunt suportate: %s", "The command line tool %s could not be found" : "Unealta în linie de comandă %s nu a fost găsită", "The library %s is not available." : "Biblioteca %s nu este disponibilă.", "Following platforms are supported: %s" : "Sunt suportate următoarele platforme: %s", "ownCloud %s or higher is required." : "ownCloud %s sau mai mare este necesar.", "ownCloud %s or lower is required." : "Versiunea ownCloud %s sau mai joasă este necesară.", "Unknown filetype" : "Tip fișier necunoscut", "Invalid image" : "Imagine invalidă", "today" : "astăzi", "yesterday" : "ieri", "_%n day ago_::_%n days ago_" : ["Acum o zi","Acum %n zile","Acum %n zile"], "last month" : "ultima lună", "_%n month ago_::_%n months ago_" : ["%n lună în urmă","%n luni în urmă","%n luni în urmă"], "last year" : "ultimul an", "_%n year ago_::_%n years ago_" : ["%n an în urmă","%n ani în urmâ","%n ani în urmâ"], "seconds ago" : "secunde în urmă", "Module with id: %s does not exist. Please enable it in your apps settings or contact your administrator." : "Modulul cu id-ul %s nu există. Activează-l în setările tale de aplicație sau contactează-ți administratorul.", "Builtin" : "Inclus", "None" : "Niciuna", "Username and password" : "Nume de utilizator și parolă", "Username" : "Utilizator", "Password" : "Parolă", "Empty filename is not allowed" : "Nu este permis fișier fără nume", "Dot files are not allowed" : "Fișierele care încep cu caracterul punct nu sunt permise", "4-byte characters are not supported in file names" : "Caracterele stocate în 4 octeți nu sunt suportate în denumirile fișierelor", "File name is a reserved word" : "Numele fișierului este un cuvânt rezervat", "File name contains at least one invalid character" : "Numele fișierului conține măcar un caracter invalid", "File name is too long" : "Numele fișierului este prea lung", "__language_name__" : "_language_name_", "App directory already exists" : "Directorul de aplicație există deja", "Can't create app folder. Please fix permissions. %s" : "Nu se poate crea directorul de aplicație. Repară permisiunile. %s", "Archive does not contain a directory named %s" : "Arhiva nu conține vreun director cu numele %s", "No source specified when installing app" : "Nu a fost specificată vreo sursă la instalarea aplicației", "No href specified when installing app from http" : "Nu s-a specificat adresa la instalarea aplicației dintr-o sursă de pe Internet", "No path specified when installing app from local file" : "Nu s-a specificat vreo cale la instalarea aplicației de pe un fișier local", "Archives of type %s are not supported" : "Arhivele de tip %s nu sunt suportate", "Failed to open archive when installing app" : "Deschiderea arhivei a eșuat în timpul instalării aplicației", "App does not provide an info.xml file" : "Aplicația nu furnizează un fișier info.xml", "App cannot be installed because appinfo file cannot be read." : "Aplicația nu poate fi instalată deoarece fișierul appinfo nu poate fi citit", "Signature could not get checked. Please contact the app developer and check your admin screen." : "Semnătura nu a putut fi verificată. Contactează dezvoltatorul aplicației și verifică-ți consola administrativă.", "App can't be installed because it is not compatible with this version of ownCloud" : "Aplicația nu poate fi instalată deoarece nu este compatibilă cu această versiune ownCloud", "Apps" : "Aplicații", "General" : "General", "Storage" : "Stocare", "Security" : "Securitate", "Encryption" : "Încriptare", "Sharing" : "Partajare", "Search" : "Căutare", "%s enter the database username and name." : "%s introdu numele de utilizator și parola pentru baza de date.", "%s enter the database username." : "%s introdu utilizatorul bazei de date.", "%s enter the database name." : "%s introduceți numele bazei de date", "Oracle connection could not be established" : "Conexiunea Oracle nu a putut fi stabilită", "Oracle username and/or password not valid" : "Numele de utilizator sau / și parola Oracle nu sunt valide", "DB Error: \"%s\"" : "Eroare Bază de Date: \"%s\"", "Offending command was: \"%s\"" : "Comanda cauză a fost: \"%s\"", "PostgreSQL username and/or password not valid" : "Nume utilizator și/sau parolă PostgreSQL greșită", "For the best results, please consider using a GNU/Linux server instead." : "Pentru cele mai bune rezultate, ia în calcul folosirea unui server care rulează un sistem de operare GNU/Linux.", "Set an admin username." : "Setează un nume de administrator.", "Set an admin password." : "Setează o parolă de administrator.", "Invalid Federated Cloud ID" : "ID invalid cloud federalizat", "%s shared »%s« with you" : "%s Partajat »%s« cu tine de", "%s via %s" : "%s via %s", "You are not allowed to share %s" : "Nu există permisiunea de partajare %s", "Sharing %s failed, because this item is already shared with %s" : "Partajarea %s a eșuat deoarece acest element este deja partajat cu %s", "Not allowed to create a federated share with the same user" : "Nu este permisă crearea unei partajări federalizate cu acelaşi utilizator", "Share type %s is not valid for %s" : "Tipul partajării %s nu este valid pentru %s", "Could not find category \"%s\"" : "Cloud nu a gasit categoria \"%s\"", "A valid username must be provided" : "Trebuie să furnizaţi un nume de utilizator valid", "A valid password must be provided" : "Trebuie să furnizaţi o parolă validă", "The username is already being used" : "Numele de utilizator este deja folosit", "Settings" : "Setări", "Users" : "Utilizatori", "A safe home for all your data" : "Un spațiu de stocare sigur pentru toate datele tale", "Imprint" : "Imprint", "Application is not enabled" : "Aplicația nu este activată", "Authentication error" : "Eroare la autentificare", "Token expired. Please reload page." : "Token expirat. Te rugăm să reîncarci pagina.", "Unknown user" : "Utilizator necunoscut", "Cannot write into \"config\" directory" : "Nu se poate scrie în folderul \"config\"", "PHP module %s not installed." : "Modulul PHP %s nu este instalat.", "PHP modules have been installed, but they are still listed as missing?" : "Modulele PHP au fost instalate, dar apar ca lipsind?", "PostgreSQL >= 9 required" : "Este necesară versiunea 9 sau mai mare a PostgreSQL", "Please upgrade your database version" : "Actualizați baza de date la o versiune mai nouă" }, "nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));");
import fetch from '@system.fetch'; import settle from './settle'; import createError from './createError'; /** * Execute a fetch request * * @param {object} config The config that is to be used for the request * @returns {Promise} The Promise to be fulfilled */ function http(config) { return new Promise((resolve, reject) => { fetch.fetch(config) .then(res => { const responseData = res.data; const response = { code: responseData.code, data: responseData.data, headers: responseData.headers, config, }; settle(resolve, reject, response); }) .catch(error => { reject(createError( error.data, config, error.code, )); }) }); } export default http;
import React, {Component} from 'react'; import './App.css'; import Shop from './components/Shop'; import About from './components/About'; import Navbar from './components/Navbar'; import Home from './components/Home'; import Contact from './components/Contact'; import Footer from './components/Footer'; import Employ from './components/Employ' import { BrowserRouter , Route , Switch } from 'react-router-dom' // havent used link in here, have to run npm i react-router-dom to use these functions class App extends Component { state = {basket: 0}; addToBasket = () => { console.log("adding to basket"); this.setState({ basket: this.state.basket + 1 }) }; render(){ return ( <div> <BrowserRouter> <Navbar basketNumbers={this.state.basket}/> <Switch> <Route exact path="/shop" render= { () => <Shop myFunc={this.addToBasket}/>}/> <Route exact path="/about" component={About}/> <Route exact path="/home" component={Home}/> <Route exact path="/contact" component={Contact}/> <Route exact path="/employment" component={Employ}/> </Switch> <Footer/> </BrowserRouter> </div> ) } }; export default App;
function DistanceMatrix() { let distanceMatrix = {}; let graph = {}; let identifier = d => d; let sz = 0; /** * Method for Creating a node in the graph * For each node, the following attributes will be created: * { * name: the identifier of the node * neighbors: list of all neighbors of this node * data: the data attached with the node, which is initially the object sent as a parameter * } * @param node: the data of the node to be created * identifier(node) should give the id of the node * @returns {*}: the node object in the graph */ distanceMatrix.createNode = function (node) { let nodeId = identifier(node); if (graph.hasOwnProperty(nodeId)) { throw 'There is an existing node with the same Id!' } graph[nodeId] = { 'name': nodeId, 'neighbors': {}, 'data': node }; ++sz; return graph[nodeId]; }; /** * Returns a list of all the ids of the nodes in the graph * @returns {string[]} list of ids of the nodes in the graph */ distanceMatrix.getNodesIds = function () { return Object.keys(graph); }; /** * Get the graph node with the given id * @param nodeId: the id of the node to be retrieved * @returns $ObjMap|undefined: the node with the given id, or undefined if none exists */ distanceMatrix.getNode = function (nodeId) { return graph[nodeId]; }; /** * Clear the graph from all of its nodes */ distanceMatrix.clear = function () { graph = {}; sz = 0; }; /** * Get the number of nodes currently in the graph * @returns {number} total number of nodes in a graph */ distanceMatrix.size = function () { return Object.keys(graph).length; }; distanceMatrix.addEdge = function (first, second) { let firstNode = distanceMatrix.getNode(first); if (!firstNode) { firstNode = distanceMatrix.createNode(first); } let secondNode = distanceMatrix.getNode(second); if (!secondNode) { secondNode = distanceMatrix.createNode(second); } if (!firstNode.neighbors[second]){ firstNode.neighbors[second]=0; } if (!secondNode.neighbors[first]){ secondNode.neighbors[first]=0; } firstNode.neighbors[second] += 1; secondNode.neighbors[first] += 1; }; distanceMatrix.compile = function () { let self=this; let distanceMatrix = []; const INF = 100000009; let ids = self.getNodesIds(); for (let i = 0; i < ids.length; ++i) { distanceMatrix.push([]); for (let j = 0; j < ids.length; ++j) { distanceMatrix[i].push(INF); } } ids.forEach((cur, idx) => { let node = self.getNode(cur); Object.keys(node.neighbors).forEach(otherId => { let otherIdx = ids.indexOf(otherId); if (otherIdx === -1) { throw "id is not found"; } let value = node.neighbors[otherId]; distanceMatrix[idx][otherIdx] = value; }) }); for (let i = 0; i < ids.length; ++i) { for (let j = 0; j < ids.length; ++j) { for (let u = 0; u < ids.length; ++u) { distanceMatrix[i][j] = Math.min(distanceMatrix[i][j], distanceMatrix[i][u] + distanceMatrix[u][j]); } } } distanceMatrix.forEach(cur=>{ cur.forEach((field,idx)=>{ if (field===INF){ cur[idx]=-1; } }) }); console.log("Calculated distance matrix"); return { nodes: ids, distanceMatrix: distanceMatrix }; }; distanceMatrix.identifier = function (value) { return arguments.length ? (identifier = value, distanceMatrix) : identifier; }; return distanceMatrix; } module.exports = DistanceMatrix;
import React from 'react'; import ClassNames from 'classnames'; import ActivableRenderer from '../hoc/ActivableRenderer'; import Overlay from '../overlay'; import style from './style'; const Drawer = (props) => { const className = ClassNames([style.root, style[props.type]], { [style.active]: props.active }, props.className); return ( <Overlay active={props.active} onClick={props.onOverlayClick}> <div data-react-toolbox='drawer' className={className}> <aside className={style.content}> {props.children} </aside> </div> </Overlay> ); }; Drawer.propTypes = { active: React.PropTypes.bool, children: React.PropTypes.node, className: React.PropTypes.string, onOverlayClick: React.PropTypes.func, type: React.PropTypes.oneOf(['left', 'right']) }; Drawer.defaultProps = { active: false, className: '', type: 'left' }; export default ActivableRenderer()(Drawer);
angular .module('planTrip') .component('planTripCenter', { templateUrl: 'app/page/plantrip/plantrip-center.html', controller: PlanTripCenterController }); /** @ngInject */ function PlanTripCenterController() { // var vm = this; }
import successfulPermApi from '@/api/successfulPerm' import selectCase from '@/components/main/dialog/selectCase/selectCase.vue' import selectCandidate from '@/components/main/dialog/selectCandidate/selectCandidate.vue' import selectUser from '@/components/main/dialog/selectUser/selectUser.vue' import selectHr from '@/components/main/dialog/selectHr/selectHr.vue' import clientApi from '@/api/client' import configApi from '@/api/config' import commonJS from '@/common/common' import userApi from '@/api/user' import salaryApi from '@/api/salary' export default { components: { 'selectCandidate': selectCandidate, 'selectCase': selectCase, 'selectUser': selectUser, 'selectHr': selectHr }, data () { return { mode: 'add', // 默认操作模式为新建 consultantIndex: 1, // 顾问索引 consultantColumnShow1: true, // 顾问列显示控制 consultantColumnShow2: false, // 顾问列显示控制 consultantColumnShow3: false, // 顾问列显示控制 consultantColumnShow4: false, // 顾问列显示控制 consultantColumnShow5: false, // 顾问列显示控制 consultantColumnShow6: false, // 顾问列显示控制 consultantColumnShow7: false, // 顾问列显示控制 consultantColumnShow8: false, // 顾问列显示控制 consultantColumnShow9: false, // 顾问列显示控制 consultantColumnShow10: false, // 顾问列显示控制 consultantColumnShow11: false, // 顾问列显示控制 consultantColumnShow12: false, // 顾问列显示控制 consultantColumnShow13: false, // 顾问列显示控制 consultantColumnShow14: false, // 顾问列显示控制 consultantColumnShow15: false, // 顾问列显示控制 consultantColumnShow16: false, // 顾问列显示控制 consultantColumnShow17: false, // 顾问列显示控制 consultantColumnShow18: false, // 顾问列显示控制 consultantColumnShow19: false, // 顾问列显示控制 consultantColumnShow20: false, // 顾问列显示控制 form: { id: null, clientId: '', // 公司id approveStatus: 'applied', // 审批状态,apply表示申请状态,approved表示审批通过,denied表示审批否决 department: '', // 部门名称 caseId: '', // 职位id title: '', // 职位名称 candidateId: '', // 候选人id candidateEnglishName: '', // 候选人英文名字 candidateChineseName: '', // 候选人中文名字 hrId: '', hrChineseName: '', hrEnglishName: '', cwId: '', // CWid cwUserName: '', // CW登录名 cwRealName: '', // CW真实姓名 cwCommissionPercent: '', // CW提成比例 bdId: '', // BDid bdUserName: '', // BD登录名 bdRealName: '', // BD真实姓名 bdCommissionPercent: '', // BD提成比例 leaderId: '', // Leaderid leaderUserName: '', // Leader登录名 leaderRealName: '', // Leader真实姓名 leaderCommissionPercent: '', // Leader提成比例 consultantId: '', // 顾问id consultantUserName: '', // 顾问登录名 consultantRealName: '', // 顾问真实姓名 consultantCommissionPercent: '', // 顾问提成比例 consultantId2: '', // 顾问id2 consultantUserName2: '', // 顾问登录名2 consultantRealName2: '', // 顾问真实姓名2 consultantCommissionPercent2: '', // 顾问提成比例2 consultantId3: '', // 顾问id3 consultantUserName3: '', // 顾问登录名3 consultantRealName3: '', // 顾问真实姓名3 consultantCommissionPercent3: '', // 顾问提成比例3 consultantId4: '', // 顾问id4 consultantUserName4: '', // 顾问登录名4 consultantRealName4: '', // 顾问真实姓名4 consultantCommissionPercent4: '', // 顾问提成比例4 consultantId5: '', // 顾问id5 consultantUserName5: '', // 顾问登录名5 consultantRealName5: '', // 顾问真实姓名5 consultantCommissionPercent5: '', // 顾问提成比例5 consultantId6: '', // 顾问id6 consultantUserName6: '', // 顾问登录名6 consultantRealName6: '', // 顾问真实姓名6 consultantCommissionPercent6: '', // 顾问提成比例6 consultantId7: '', // 顾问id7 consultantUserName7: '', // 顾问登录名7 consultantRealName7: '', // 顾问真实姓名7 consultantCommissionPercent7: '', // 顾问提成比例7 consultantId8: '', // 顾问id8 consultantUserName8: '', // 顾问登录名8 consultantRealName8: '', // 顾问真实姓名8 consultantCommissionPercent8: '', // 顾问提成比例8 consultantId9: '', // 顾问id9 consultantUserName9: '', // 顾问登录名9 consultantRealName9: '', // 顾问真实姓名9 consultantCommissionPercent9: '', // 顾问提成比例9 consultantId10: '', // 顾问id10 consultantUserName10: '', // 顾问登录名10 consultantRealName10: '', // 顾问真实姓名10 consultantCommissionPercent10: '', // 顾问提成比例10 consultantId11: '', // 顾问id11 consultantUserName11: '', // 顾问登录名11 consultantRealName11: '', // 顾问真实姓名11 consultantCommissionPercent11: '', // 顾问提成比例11 consultantId12: '', // 顾问id12 consultantUserName12: '', // 顾问登录名12 consultantRealName12: '', // 顾问真实姓名12 consultantCommissionPercent12: '', // 顾问提成比例12 consultantId13: '', // 顾问id13 consultantUserName13: '', // 顾问登录名13 consultantRealName13: '', // 顾问真实姓名13 consultantCommissionPercent13: '', // 顾问提成比例13 consultantId14: '', // 顾问id4 consultantUserName14: '', // 顾问登录名14 consultantRealName14: '', // 顾问真实姓名14 consultantCommissionPercent14: '', // 顾问提成比例14 consultantId15: '', // 顾问id15 consultantUserName15: '', // 顾问登录名15 consultantRealName15: '', // 顾问真实姓名15 consultantCommissionPercent15: '', // 顾问提成比例15 consultantId16: '', // 顾问id16 consultantUserName16: '', // 顾问登录名16 consultantRealName16: '', // 顾问真实姓名16 consultantCommissionPercent16: '', // 顾问提成比例16 consultantId17: '', // 顾问id17 consultantUserName17: '', // 顾问登录名17 consultantRealName17: '', // 顾问真实姓名17 consultantCommissionPercent17: '', // 顾问提成比例17 consultantId18: '', // 顾问id18 consultantUserName18: '', // 顾问登录名18 consultantRealName18: '', // 顾问真实姓名18 consultantCommissionPercent18: '', // 顾问提成比例18 consultantId19: '', // 顾问id19 consultantUserName19: '', // 顾问登录名19 consultantRealName19: '', // 顾问真实姓名19 consultantCommissionPercent19: '', // 顾问提成比例19 consultantId20: '', // 顾问id20 consultantUserName20: '', // 顾问登录名20 consultantRealName20: '', // 顾问真实姓名20 consultantCommissionPercent20: '', // 顾问提成比例20 location: '', // 地点 base: 0, gp: 0, billing: 0, interviewDate: '', // 到面日期 onBoardDate: '', guaranteeDate: '', offerDate: '', paymentDate: '', invoiceDate: '', po: '', invoiceNo: '', channel: '', actualPaymentDate: '', // 实际收款日期 commissionDate: '', // 奖金发放日期 comment: '', // 说明 type: 'perm' }, clients: [], // 职位候选人集合 candidateForCase: [], // 当前选中职位对应候选人 curCandidateForCase: null, // 选择候选人对话框是否显示 selectCandidateDialogShow: false, // 选择职位对话框是否显示 selectCaseDialogShow: false, selectHRDialogShow: false, selectConsultantDialogShow: false, selectCWDialogShow: false, selectBDDialogShow: false, selectLeaderDialogShow: false, approveStatusList: [{ 'id': 'applied', 'name': '申请状态' }, { 'id': 'approved', 'name': '审批通过' }, { 'id': 'denied', 'name': '审批否决' }], typeList: [], // [{'id': 'perm', 'name': 'perm'}, {'id': 'contracting', 'name': 'contracting'}] roles: [], jobType: '' } }, methods: { // 跳转到编辑职位 jumpToTitle () { if (this.form.caseId !== '') { this.$router.push({ path: '/case/case', query: { mode: 'modify', caseId: this.form.caseId } }) } }, // 跳转到编辑候选人 jumpToCandidate () { if (this.form.candidateId !== '') { this.$router.push({ path: '/candidate/candidate', query: { mode: 'modify', candidateId: this.form.candidateId } }) } }, // 增加顾问 addConsultant () { if (!this.consultantColumnShow1) { this.consultantColumnShow1 = true } else if (!this.consultantColumnShow2) { this.consultantColumnShow2 = true } else if (!this.consultantColumnShow3) { this.consultantColumnShow3 = true } else if (!this.consultantColumnShow4) { this.consultantColumnShow4 = true } else if (!this.consultantColumnShow5) { this.consultantColumnShow5 = true } else if (!this.consultantColumnShow6) { this.consultantColumnShow6 = true } else if (!this.consultantColumnShow7) { this.consultantColumnShow7 = true } else if (!this.consultantColumnShow8) { this.consultantColumnShow8 = true } else if (!this.consultantColumnShow9) { this.consultantColumnShow9 = true } else if (!this.consultantColumnShow10) { this.consultantColumnShow10 = true } else if (!this.consultantColumnShow11) { this.consultantColumnShow11 = true } else if (!this.consultantColumnShow12) { this.consultantColumnShow12 = true } else if (!this.consultantColumnShow13) { this.consultantColumnShow13 = true } else if (!this.consultantColumnShow14) { this.consultantColumnShow14 = true } else if (!this.consultantColumnShow15) { this.consultantColumnShow15 = true } else if (!this.consultantColumnShow16) { this.consultantColumnShow16 = true } else if (!this.consultantColumnShow17) { this.consultantColumnShow17 = true } else if (!this.consultantColumnShow18) { this.consultantColumnShow18 = true } else if (!this.consultantColumnShow19) { this.consultantColumnShow19 = true } else if (!this.consultantColumnShow20) { this.consultantColumnShow20 = true } }, // 获取日期部分 getDateStr (dateStr) { if (typeof (dateStr) !== 'undefined' && dateStr !== null && dateStr.length > 10) { return dateStr.substr(0, 10) } return dateStr }, // 显示控制 showControl (key) { if (key === 'approveStatus' || key === 'commissionDate' || key === 'actualPaymentDate' || key === 'calcGP' || key === 'invoiceDate') { return commonJS.isAdminInArray(this.roles) } else if (key === 'save') { // 保持按钮。如果已经是审批状态,只有管理员显示保存按钮 if (this.form.approveStatus === 'approved') { return commonJS.isAdminInArray(this.roles) } return true } }, // 编辑候选人 editCandidate (index, row) { this.$router.push({ path: '/candidate/candidate', query: { mode: 'modify', candidateId: row.candidateId } }) }, // 取消 cancel () { if (typeof (this.$route.query.mode) !== 'undefined') { this.mode = this.$route.query.mode this.form = this.$route.query.successfulPerm } else { this.form.id = null this.form.clientId = '' // 公司id this.form.approveStatus = '' this.form.department = '' // 部门名称 this.form.caseId = '' // 职位id this.form.title = '' // 职位名称 this.form.candidateId = '' // 候选人id this.form.candidateEnglishName = '' // 候选人英文名字 this.form.candidateChineseName = '' // 候选人中文名字 this.form.hrId = '' this.form.hrChineseName = '' this.form.hrEnglishName = '' this.form.cwId = '' // CWid this.form.cwUserName = '' // CW登录名 this.form.cwRealName = '' // CW真实姓名 this.form.cwCommissionPercent = '' // CW提成比例 this.form.bdId = '' // BDid this.form.bdUserName = '' // BD登录名 this.form.bdRealName = '' // BD真实姓名 this.form.bdCommissionPercent = '' // BD提成比例 this.form.consultantId = '' // 顾问id this.form.consultantUserName = '' // 顾问登录名 this.form.consultantRealName = '' // 顾问真实姓名 this.form.consultantCommissionPercent = '' // 顾问提成比例 this.form.consultantId2 = '' // 顾问id2 this.form.consultantUserName2 = '' // 顾问登录名2 this.form.consultantRealName2 = '' // 顾问真实姓名2 this.form.consultantCommissionPercent2 = '' // 顾问提成比例2 this.form.consultantId3 = '' // 顾问id3 this.form.consultantUserName3 = '' // 顾问登录名3 this.form.consultantRealName3 = '' // 顾问真实姓名3 this.form.consultantCommissionPercent3 = '' // 顾问提成比例3 this.form.consultantId4 = '' // 顾问id4 this.form.consultantUserName4 = '' // 顾问登录名4 this.form.consultantRealName4 = '' // 顾问真实姓名4 this.form.consultantCommissionPercent4 = '' // 顾问提成比例4 this.form.consultantId5 = '' // 顾问id5 this.form.consultantUserName5 = '' // 顾问登录名5 this.form.consultantRealName5 = '' // 顾问真实姓名5 this.form.consultantCommissionPercent5 = '' // 顾问提成比例5 this.form.location = '' // 地点 this.form.base = 0 this.form.gp = 0 this.form.billing = 0 this.form.interviewDate = '' this.form.onBoardDate = '' this.form.guaranteeDate = '' this.form.offerDate = '' this.form.paymentDate = '' this.form.invoiceDate = '' this.form.po = '' this.form.invoiceNo = '' this.form.channel = '' this.form.actualPaymentDate = '' // 实际收款日期 this.form.commissionDate = '' // 奖金发放日期 this.form.comment = '' } }, // 保存 save () { if (this.form.clientId === '') { this.$message({ message: '客户必选!', type: 'warning', showClose: true }) return } if (this.form.caseId === '') { this.$message({ message: '职位必选!', type: 'warning', showClose: true }) return } if (this.form.candidateId === '') { this.$message({ message: '候选人必选!', type: 'warning', showClose: true }) return } if (this.form.base === '') { this.$message({ message: 'Base不能为空!', type: 'warning', showClose: true }) return } if (this.form.billing === '') { this.$message({ message: 'Billing不能为空!', type: 'warning', showClose: true }) return } if (this.form.gp === '') { this.$message({ message: 'GP不能为空!', type: 'warning', showClose: true }) return } if (this.form.approveStatus === 'approved' && !commonJS.isAdmin()) { this.$message({ message: '审批通过后,只有管理员可以修改!', type: 'warning', showClose: true }) return } this.$refs['form'].validate((valid) => { if (valid) { // 如果校验通过就调用后端接口 successfulPermApi.save(this.form).then( res => { if (res.status === 200) { // 将从服务端获取的id赋值给前端显示 this.form.id = res.data.id this.$message({ message: '保存成功!', type: 'success', showClose: true }) } else { this.$message.error('保存失败!') } }) } else { // 如果检查不通过就给出提示 this.$message({ message: '有错误,请检查!', type: 'warning', showClose: true }) } }) }, // 职位候选人变化 rowChange (val) { this.curCandidateForCase = val }, // 打开“选择候选人”对话框 openSelectCandidateDialog () { this.selectCandidateDialogShow = true }, // “选择候选人”对话框返回 sureSelectCandidateDialog (val) { // 首先关闭对话框 this.selectCandidateDialogShow = false this.form.candidateId = val.id this.form.candidateChineseName = val.chineseName this.form.candidateEnglishName = val.englishName }, // 打开“选择职位”对话框 openSelectCaseDialog () { this.selectCaseDialogShow = true }, // “选择职位”对话框返回 sureSelectCaseDialog (val) { // 首先关闭对话框 this.selectCaseDialogShow = false this.form.caseId = val.id this.form.title = val.title }, // 打开“选择顾问”对话框 openSelectConsultantDialog (val) { this.consultantIndex = val this.selectConsultantDialogShow = true }, // 删除“选择顾问” deleteConsultant (val) { if (val === 'cw') { this.form.cwId = '' this.form.cwUserName = '' this.form.cwRealName = '' this.form.cwCommissionPercent = null } else if (val === 'bd') { this.form.bdId = '' this.form.bdUserName = '' this.form.bdRealName = '' this.form.bdCommissionPercent = null } else if (val === 'leader') { this.form.leaderId = '' this.form.leaderUserName = '' this.form.leaderRealName = '' this.form.leaderCommissionPercent = null } else if (val === '1') { this.form.consultantId = '' this.form.consultantUserName = '' this.form.consultantRealName = '' this.form.consultantCommissionPercent = null this.consultantColumnShow1 = false } else if (val === '2') { this.form.consultantId2 = '' this.form.consultantUserName2 = '' this.form.consultantRealName2 = '' this.form.consultantCommissionPercent2 = null this.consultantColumnShow2 = false } else if (val === '3') { this.form.consultantId3 = '' this.form.consultantUserName3 = '' this.form.consultantRealName3 = '' this.form.consultantCommissionPercent3 = null this.consultantColumnShow3 = false } else if (val === '4') { this.form.consultantId4 = '' this.form.consultantUserName4 = '' this.form.consultantRealName4 = '' this.form.consultantCommissionPercent4 = null this.consultantColumnShow4 = false } else if (val === '5') { this.form.consultantId5 = '' this.form.consultantUserName5 = '' this.form.consultantRealName5 = '' this.form.consultantCommissionPercent5 = null } else if (val === '6') { this.form.consultantId6 = '' this.form.consultantUserName6 = '' this.form.consultantRealName6 = '' this.form.consultantCommissionPercent6 = null } else if (val === '7') { this.form.consultantId7 = '' this.form.consultantUserName7 = '' this.form.consultantRealName7 = '' this.form.consultantCommissionPercent7 = null } else if (val === '8') { this.form.consultantId8 = '' this.form.consultantUserName8 = '' this.form.consultantRealName8 = '' this.form.consultantCommissionPercent8 = null } else if (val === '9') { this.form.consultantId9 = '' this.form.consultantUserName9 = '' this.form.consultantRealName9 = '' this.form.consultantCommissionPercent9 = null } else if (val === '10') { this.form.consultantId10 = '' this.form.consultantUserName10 = '' this.form.consultantRealName10 = '' this.form.consultantCommissionPercent10 = null } else if (val === '11') { this.form.consultantId11 = '' this.form.consultantUserName11 = '' this.form.consultantRealName11 = '' this.form.consultantCommissionPercent11 = null } else if (val === '12') { this.form.consultantId12 = '' this.form.consultantUserName12 = '' this.form.consultantRealName12 = '' this.form.consultantCommissionPercent12 = null } else if (val === '13') { this.form.consultantId13 = '' this.form.consultantUserName13 = '' this.form.consultantRealName13 = '' this.form.consultantCommissionPercent13 = null } else if (val === '14') { this.form.consultantId14 = '' this.form.consultantUserName14 = '' this.form.consultantRealName14 = '' this.form.consultantCommissionPercent14 = null } else if (val === '15') { this.form.consultantId15 = '' this.form.consultantUserName15 = '' this.form.consultantRealName15 = '' this.form.consultantCommissionPercent15 = null } else if (val === '16') { this.form.consultantId16 = '' this.form.consultantUserName16 = '' this.form.consultantRealName16 = '' this.form.consultantCommissionPercent16 = null } else if (val === '17') { this.form.consultantId17 = '' this.form.consultantUserName17 = '' this.form.consultantRealName17 = '' this.form.consultantCommissionPercent17 = null } else if (val === '18') { this.form.consultantId18 = '' this.form.consultantUserName18 = '' this.form.consultantRealName18 = '' this.form.consultantCommissionPercent18 = null } else if (val === '19') { this.form.consultantId19 = '' this.form.consultantUserName19 = '' this.form.consultantRealName19 = '' this.form.consultantCommissionPercent19 = null } else if (val === '20') { this.form.consultantId20 = '' this.form.consultantUserName20 = '' this.form.consultantRealName20 = '' this.form.consultantCommissionPercent20 = null } }, // “选择顾问”对话框返回 sureSelectConsultantDialog (val) { // 首先关闭对话框 this.selectConsultantDialogShow = false if (this.consultantIndex === '1') { this.form.consultantId = val.id this.form.consultantUserName = val.username this.form.consultantRealName = val.realname } else if (this.consultantIndex === '2') { this.form.consultantId2 = val.id this.form.consultantUserName2 = val.username this.form.consultantRealName2 = val.realname } else if (this.consultantIndex === '3') { this.form.consultantId3 = val.id this.form.consultantUserName3 = val.username this.form.consultantRealName3 = val.realname } else if (this.consultantIndex === '4') { this.form.consultantId4 = val.id this.form.consultantUserName4 = val.username this.form.consultantRealName4 = val.realname } else if (this.consultantIndex === '5') { this.form.consultantId5 = val.id this.form.consultantUserName5 = val.username this.form.consultantRealName5 = val.realname } else if (this.consultantIndex === '6') { this.form.consultantId6 = val.id this.form.consultantUserName6 = val.username this.form.consultantRealName6 = val.realname } else if (this.consultantIndex === '7') { this.form.consultantId7 = val.id this.form.consultantUserName7 = val.username this.form.consultantRealName7 = val.realname } else if (this.consultantIndex === '8') { this.form.consultantId8 = val.id this.form.consultantUserName8 = val.username this.form.consultantRealName8 = val.realname } else if (this.consultantIndex === '9') { this.form.consultantId9 = val.id this.form.consultantUserName9 = val.username this.form.consultantRealName9 = val.realname } else if (this.consultantIndex === '10') { this.form.consultantId10 = val.id this.form.consultantUserName10 = val.username this.form.consultantRealName10 = val.realname } else if (this.consultantIndex === '11') { this.form.consultantId11 = val.id this.form.consultantUserName11 = val.username this.form.consultantRealName11 = val.realname } else if (this.consultantIndex === '12') { this.form.consultantId12 = val.id this.form.consultantUserName12 = val.username this.form.consultantRealName12 = val.realname } else if (this.consultantIndex === '13') { this.form.consultantId13 = val.id this.form.consultantUserName13 = val.username this.form.consultantRealName13 = val.realname } else if (this.consultantIndex === '14') { this.form.consultantId14 = val.id this.form.consultantUserName14 = val.username this.form.consultantRealName14 = val.realname } else if (this.consultantIndex === '15') { this.form.consultantId15 = val.id this.form.consultantUserName15 = val.username this.form.consultantRealName15 = val.realname } else if (this.consultantIndex === '16') { this.form.consultantId16 = val.id this.form.consultantUserName16 = val.username this.form.consultantRealName16 = val.realname } else if (this.consultantIndex === '17') { this.form.consultantId17 = val.id this.form.consultantUserName17 = val.username this.form.consultantRealName17 = val.realname } else if (this.consultantIndex === '18') { this.form.consultantId18 = val.id this.form.consultantUserName18 = val.username this.form.consultantRealName18 = val.realname } else if (this.consultantIndex === '19') { this.form.consultantId19 = val.id this.form.consultantUserName19 = val.username this.form.consultantRealName19 = val.realname } else if (this.consultantIndex === '20') { this.form.consultantId20 = val.id this.form.consultantUserName20 = val.username this.form.consultantRealName20 = val.realname } }, // 打开“选择CW”对话框 openSelectCWDialog () { this.selectCWDialogShow = true }, // “选择CW”对话框返回 sureSelectCWDialog (val) { // 首先关闭对话框 this.selectCWDialogShow = false this.form.cwId = val.id this.form.cwUserName = val.username this.form.cwRealName = val.realname }, // 打开“选择BD”对话框 openSelectBDDialog () { this.selectBDDialogShow = true }, // 打开“选择Leader”对话框 openSelectLeaderDialog () { this.selectLeaderDialogShow = true }, // “选择BD”对话框返回 sureSelectBDDialog (val) { // 首先关闭对话框 this.selectBDDialogShow = false this.form.bdId = val.id this.form.bdUserName = val.username this.form.bdRealName = val.realname }, // “选择Leader”对话框返回 sureSelectLeaderDialog (val) { // 首先关闭对话框 this.selectLeaderDialogShow = false this.form.leaderId = val.id this.form.leaderUserName = val.username this.form.leaderRealName = val.realname }, // “选择hr”对话框返回 sureSelectHRDialog (val) { // 首先关闭对话框 this.selectHRDialogShow = false this.form.hrId = val.id this.form.hrChineseName = val.chineseName this.form.hrEnglishName = val.englishName }, // billing只读控制方法 billingReadonly: function () { // 管理员可以修改Billing if (commonJS.isAdmin()) { return false } else { if (this.form.clientId === 83128 || this.form.clientId === 116400) { // 一汽奔腾 一汽红旗可以修改billing return false } return true } }, // gp只读控制方法 gpReadonly: function () { // 管理员可以修改GP return !commonJS.isAdmin() }, // 通过billing计算GP getGP: function () { if (this.form.type === 'perm' && this.form.billing !== null) { // 猎头业务才计算 let params = { 'billing': this.form.billing } salaryApi.billingToGp(params).then(res => { if (res.status === 200) { this.form.gp = res.data } }) } }, // base变化计算billing和gp calcBillingAndGp: function () { if (this.form.type === 'perm' && this.form.base !== null && this.form.clientId !== null) { // 猎头业务才计算 let params = { 'base': this.form.base, 'clientId': this.form.clientId } salaryApi.calcBillingByBaseAndClient(params).then(res => { if (res.status === 200) { this.form.billing = res.data[0] this.form.gp = res.data[1] } }) } } }, computed: { formatBase: function () { if (this.form.base !== '') { return parseInt(this.form.base / 10000) + 'w' } }, formatGp: function () { if (this.form.gp !== '') { return parseInt(this.form.gp / 10000) + 'w' } }, formatBilling: function () { if (this.form.billing !== '') { return parseInt(this.form.billing / 10000) + 'w' } } }, created () { // 获取当前用户的角色列表 userApi.findSelf().then(res => { if (res.status === 200) { this.roles = res.data.roles this.jobType = res.data.jobType } }) // 通过入参获取当前操作模式 if (typeof (this.$route.query.mode) !== 'undefined') { // 接收list传入的参数 this.mode = this.$route.query.mode if (typeof (this.$route.query.successfulPerm) !== 'undefined') { this.form = this.$route.query.successfulPerm // 通过顾问id不为空,控制顾问按钮显示 if (commonJS.judgeStrIsNotNull(this.form.consultantId)) { this.consultantColumnShow1 = true } if (commonJS.judgeStrIsNotNull(this.form.consultantId2)) { this.consultantColumnShow2 = true } if (commonJS.judgeStrIsNotNull(this.form.consultantId3)) { this.consultantColumnShow3 = true } if (commonJS.judgeStrIsNotNull(this.form.consultantId4)) { this.consultantColumnShow4 = true } if (commonJS.judgeStrIsNotNull(this.form.consultantId5)) { this.consultantColumnShow5 = true } if (commonJS.judgeStrIsNotNull(this.form.consultantId6)) { this.consultantColumnShow6 = true } if (commonJS.judgeStrIsNotNull(this.form.consultantId7)) { this.consultantColumnShow7 = true } if (commonJS.judgeStrIsNotNull(this.form.consultantId8)) { this.consultantColumnShow8 = true } if (commonJS.judgeStrIsNotNull(this.form.consultantId9)) { this.consultantColumnShow9 = true } if (commonJS.judgeStrIsNotNull(this.form.consultantId10)) { this.consultantColumnShow10 = true } if (commonJS.judgeStrIsNotNull(this.form.consultantId11)) { this.consultantColumnShow11 = true } if (commonJS.judgeStrIsNotNull(this.form.consultantId12)) { this.consultantColumnShow12 = true } if (commonJS.judgeStrIsNotNull(this.form.consultantId13)) { this.consultantColumnShow13 = true } if (commonJS.judgeStrIsNotNull(this.form.consultantId14)) { this.consultantColumnShow14 = true } if (commonJS.judgeStrIsNotNull(this.form.consultantId15)) { this.consultantColumnShow15 = true } if (commonJS.judgeStrIsNotNull(this.form.consultantId16)) { this.consultantColumnShow16 = true } if (commonJS.judgeStrIsNotNull(this.form.consultantId17)) { this.consultantColumnShow17 = true } if (commonJS.judgeStrIsNotNull(this.form.consultantId18)) { this.consultantColumnShow18 = true } if (commonJS.judgeStrIsNotNull(this.form.consultantId19)) { this.consultantColumnShow19 = true } if (commonJS.judgeStrIsNotNull(this.form.consultantId20)) { this.consultantColumnShow20 = true } } } clientApi.findAllOrderByChineseName().then( res => { if (res.status === 200) { // 将从服务端获取的id赋值给前端显示 this.clients = res.data } }) // 查询成功case类型列表 configApi.findAllByCategory({ category: 'SuccessfulCaseType' }).then(res => { if (res.status === 200) { this.typeList = res.data } }) } }
const getLocalDate = (offset) => { const date = new Date(); return new Date(date.getTime() + date.getTimezoneOffset() * 60 * 1000 + offset); }; export default getLocalDate;
console.log("jashith java script loaded"); function isDefined(a) { return (typeof(a)=="undefined" ? false : true); } try{ var JCL_timer = (function(){ this.serachVelocity = 300; this.searchTrigger = ''; this.searchQuery = ''; this.callBack = function(obj){} this.setDelayTime = function(velocity){ this.serachVelocity = velocity; } this.setCallBack = function(callback){ this.callback = callback; } this.fireCallBack = function(){ this.callback(this.searchQuery); } this.update = function(obj){ this.searchQuery = obj; var th = this; if(this.searchTrigger!=''){ clearTimeout(this.searchTrigger); this.searchTrigger = ''; } var velocity = obj.attr('data-delay'); //set custom velocity if avail if(isDefined(velocity) && !isNaN(velocity)) this.setDelayTime(velocity); th.searchTrigger = setTimeout(function(){ th.searchTrigger = ''; th.fireCallBack(); }, th.serachVelocity); } }); }catch(e) {console.log(e);} var JCL_lib = (function(){ this.validateEmail = function(emailField){ var reg = /^([A-Za-z0-9_\-\.\+])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; if (reg.test(emailField) == false) return false; return true; } });
import React from 'react' import localforage from 'localforage' import Graph from '../engine/Graph.js' import GraphEditor from './GraphEditor.js' class ReflowEditor extends React.Component { static defaultProps = { reflowStore: localforage.createInstance({name: 'reflow'}), } constructor (opts) { super(opts) this.state = { selectedGraphRecordKey: null, selectedGraph: null, currentGraph: null, currentGraphViewStore: null, } this.actions = { setCurrentGraphViewProps: ({graphViewProps}) => { this.setState({ currentGraph: graphViewProps.graph, currentGraphViewStore: graphViewProps.store, }) }, } } componentDidMount () { if (! this.state.selectedGraphRecordKey) { const graphKey = ['graph', (new Date()).getTime(), Math.random()].join(':') const graph = new Graph({ id: graphKey, label: 'graph-' + (new Date()).toISOString(), }) this.setState({currentGraph: graph}) } } render () { return ( <div style={this.props.style}> <div style={{ width: '100%', height: '100%', position: 'relative', }} > <style> {` .panel { position: absolute; top: 0; bottom: 0; border: thin solid gray; overflow: auto; } `} </style> <div className="graph-editor-panel panel" style={{ left: 0, right: 0, }} > {this.renderGraphEditorPanelContent()} </div> </div> </div> ) } renderGraphEditorPanelContent () { const { currentGraph, currentGraphViewStore } = this.state if (! currentGraph) { return (<i>no currentGraph</i>) } return ( <div style={{ height: '100%', width: '100%', position: 'relative', }} > { this.renderGraphEditor({ graph: currentGraph, graphViewStore: currentGraphViewStore, }) } </div> ) } renderGraphEditor ({graph, graphViewStore}) { return ( <GraphEditor actions={{ setCurrentGraphViewProps: this.actions.setCurrentGraphViewProps, }} reflowStore={this.props.reflowStore} graph={graph} graphViewStore={graphViewStore} style={{ height: '100%', widht: '100%', }} /> ) } } export default ReflowEditor
const express = require('express') const userRouter = require('./routers/userinfo') const app = express() // 处理req body app.use(express.json()) app.use(express.urlencoded({extended: true})) app.get('/', (req, res) => { res.send('hello express') }) app.use('api/user', userRouter) app.listen(3000) console.log('服务已启动')
/** * Copyright 2016 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ goog.provide('audioCat.ui.TrackListingManager'); goog.require('audioCat.audio.play.events'); goog.require('audioCat.state.events'); goog.require('audioCat.ui.templates'); goog.require('audioCat.ui.tracks.TrackEntry'); goog.require('audioCat.ui.tracks.effect.EffectChipDragManager'); goog.require('audioCat.ui.visualization.events'); goog.require('goog.array'); goog.require('goog.dom.classes'); goog.require('goog.events'); /** * Manages the display of tracks. * @param {!audioCat.utility.IdGenerator} idGenerator Generates IDs unique * throughout the application. * @param {!audioCat.utility.DomHelper} domHelper Faciliates interactions with * the DOM. * @param {!audioCat.ui.keyboard.KeyboardManager} keyboardManager Manages * keyboard shortcuts. * @param {!audioCat.state.TrackManager} trackManager Manages tracks. * @param {!Element} entriesContainer The container in which to append track * entries. * @param {!audioCat.state.command.CommandManager} commandManager Manages * commands, so users can redo and undo. * @param {!audioCat.ui.visualization.Context2dPool} context2dPool Pools 2D * contexts, so we don't create too many. * @param {!audioCat.ui.visualization.TimeDomainScaleManager} * timeDomainScaleManager Manages the scale at which we render audio in the * time domain. * @param {!audioCat.state.editMode.EditModeManager} editModeManager Maintains * and updates the current edit mode. * @param {!audioCat.ui.window.ScrollResizeManager} scrollResizeManager Manages * scrolling and resizing of the viewport. * @param {!audioCat.audio.play.TimeManager} timeManager Manages the time * indicated to the user by the UI. * @param {!audioCat.audio.play.PlayManager} playManager Manages the playing of * audio. * @param {!audioCat.utility.dialog.DialogManager} dialogManager Manages * dialogs. * @param {!audioCat.ui.text.TimeFormatter} timeFormatter Formats time. * @param {!audioCat.audio.AudioUnitConverter} audioUnitConverter Converts * between different units of audio and various standards. * @param {!audioCat.ui.helperPanel.EffectContentProvider} effectContentProvider * Provides content to the helper panel when an effect is put in focus. * @param {!audioCat.ui.tracks.effect.EffectChipDragManager} * effectChipDragManager Manages the dragging of chips around. * @param {!audioCat.action.DisplayEffectSelectorAction} * displayEffectSelectorAction An action for displaying the dialog for * creating new effects. * @constructor */ audioCat.ui.TrackListingManager = function( idGenerator, domHelper, keyboardManager, trackManager, entriesContainer, commandManager, context2dPool, timeDomainScaleManager, editModeManager, scrollResizeManager, timeManager, playManager, dialogManager, timeFormatter, audioUnitConverter, effectContentProvider, effectChipDragManager, displayEffectSelectorAction) { /** * @private {!audioCat.utility.IdGenerator} */ this.idGenerator_ = idGenerator; /** * @private {!audioCat.audio.AudioUnitConverter} */ this.audioUnitConverter_ = audioUnitConverter; /** * @private {!audioCat.ui.helperPanel.EffectContentProvider} Provides content * to the helper panel when an effect is put in focus. */ this.effectContentProvider_ = effectContentProvider; /** * Facilitates interactions with the DOM. * @private {!audioCat.utility.DomHelper} */ this.domHelper_ = domHelper; /** * Manages keyboard interactions. * @private {!audioCat.ui.keyboard.KeyboardManager} */ this.keyboardManager_ = keyboardManager; /** * Manages tracks. * @private {!audioCat.state.TrackManager} */ this.trackManager_ = trackManager; /** * Track entries displayed. * @private {!Array.<!audioCat.ui.tracks.TrackEntry>} */ this.trackEntries_ = []; /** * A drag list group that allows users to drag effect chips around. * @private */ this.effectChipDragManager_ = effectChipDragManager; /** * Manages dialogs. * @private {!audioCat.utility.dialog.DialogManager} */ this.dialogManager_ = dialogManager; /** * Formats time. * @private {!audioCat.ui.text.TimeFormatter} */ this.timeFormatter_ = timeFormatter; // Display tracks as they are added. goog.events.listen(trackManager, audioCat.state.events.TRACK_ADDED, this.handleTrackAddedEvent_, false, this); // Remove track entries as tracks are removed. goog.events.listen(trackManager, audioCat.state.events.TRACK_REMOVED, this.handleTrackRemovedEvent_, false, this); /** * The container for both elements of the track entry. * @private {!Element} */ this.entriesContainer_ = entriesContainer; // Listen for soloing or un-soloing so we can apply UI effects. goog.events.listen(trackManager, audioCat.state.events.SOLOED_TRACK_CHANGED, this.handleChangeInSoloState_, false, this); // Listen for changes in edit mode manager. goog.events.listen(editModeManager, audioCat.state.editMode.Events.EDIT_MODE_CHANGED, this.handleEditModeChanged_, false, this); /** * Manages commands, so that users can undo and redo. * @private {!audioCat.state.command.CommandManager} */ this.commandManager_ = commandManager; /** * Pools 2D contexts. * @private {!audioCat.ui.visualization.Context2dPool} */ this.context2dPool_ = context2dPool; /** * Manages the scale at which we render audio in the time domain scale. * @private {!audioCat.ui.visualization.TimeDomainScaleManager} */ this.timeDomainScaleManager_ = timeDomainScaleManager; /** * Maintains and updates the current edit mode. * @private {!audioCat.state.editMode.EditModeManager} */ this.editModeManager_ = editModeManager; this.setEditModeDataKey_(); /** * Manages resizing and scrolling of the viewport. * @private {!audioCat.ui.window.ScrollResizeManager} */ this.scrollResizeManager_ = scrollResizeManager; goog.events.listen(timeDomainScaleManager, audioCat.ui.visualization.events.ZOOM_CHANGED, this.handleZoomChange_, false, this); /** * Mapping from track ID to track entry DOM. * @private {!Object<audioCat.utility.Id, !Element>} */ this.trackIdDomMapping_ = {}; /** * Manages the time indicated to the user. * @private {!audioCat.audio.play.TimeManager} */ this.timeManager_ = timeManager; /** * Manages the playing of audio. * @private {!audioCat.audio.play.PlayManager} */ this.playManager_ = playManager; // Listen for changes in play state so we can handle add effects to the UI // for solo-ed and muted tracks while the audio is playing. goog.events.listen(playManager, audioCat.audio.play.events.PAUSED, this.handlePlayStateChange_, false, this); goog.events.listen(playManager, audioCat.audio.play.events.PLAY_BEGAN, this.handlePlayStateChange_, false, this); /** * An action for displaying the dialog box for adding new effects. * @private {!audioCat.action.DisplayEffectSelectorAction} */ this.displayEffectSelectorAction_ = displayEffectSelectorAction; }; /** * Handles a zoom change. * @private */ audioCat.ui.TrackListingManager.prototype.handleZoomChange_ = function() { // Redraw tracks. var trackEntries = this.trackEntries_; var numberOfTrackEntries = trackEntries.length; for (var i = 0; i < numberOfTrackEntries; ++i) { trackEntries[i].triggerRedraw(); } // Have the view include the current play time after the zoom change. var scale = this.timeDomainScaleManager_.getCurrentScale(); var playTimePixelEquivalent = scale.convertToPixels( this.timeManager_.getIndicatedTime()); var scrollResizeManager = this.scrollResizeManager_; var targetScroll = Math.floor(playTimePixelEquivalent - scrollResizeManager.getWindowWidth() / 3); targetScroll = (targetScroll < 0) ? 0 : targetScroll; scrollResizeManager.scrollTo( targetScroll, scrollResizeManager.getTopBottomScroll()); }; /** * Adds a track entry to some entity. * @param {!audioCat.state.Track} track The track to add an entry for. * @param {number=} opt_index The index at which to add the track. If not * provided, the track is added at the end. */ audioCat.ui.TrackListingManager.prototype.addTrackEntry = function(track, opt_index) { var trackEntries = this.trackEntries_; var newTrackEntry = new audioCat.ui.tracks.TrackEntry(this.idGenerator_, this.domHelper_, track, this.commandManager_, this.context2dPool_, this.timeDomainScaleManager_, this.editModeManager_, this.scrollResizeManager_, this.timeManager_, this.playManager_, this.dialogManager_, this.timeFormatter_, this.audioUnitConverter_, this.effectContentProvider_, this.effectChipDragManager_, this.displayEffectSelectorAction_, this.keyboardManager_); var trackIndex = goog.isDef(opt_index) ? opt_index : trackEntries.length; goog.array.insertAt(trackEntries, newTrackEntry, trackIndex); var domHelper = this.domHelper_; var trackEntryContainer = domHelper.createElement('div'); goog.dom.classes.add( trackEntryContainer, goog.getCssName('singleTrackEntryContainer')); var descriptorDom = newTrackEntry.getDescriptorDom(); domHelper.appendChild(trackEntryContainer, descriptorDom); this.scrollResizeManager_.fixLeft(descriptorDom); domHelper.appendChild(trackEntryContainer, newTrackEntry.getAudioRowDom()); // Add the whole tracke entry. goog.dom.classes.add(trackEntryContainer, goog.getCssName('hiddenTrack')); goog.dom.classes.add( trackEntryContainer, goog.getCssName('transitioningTrack')); domHelper.insertChildAt( this.entriesContainer_, trackEntryContainer, trackIndex); // Asynchronously remove the class to trigger a fade-in. goog.global.setTimeout(function() { goog.dom.classes.remove( trackEntryContainer, goog.getCssName('hiddenTrack')); }, 1); // Don't keep the transition lest the track be slow. goog.global.setTimeout(function() { goog.dom.classes.remove( trackEntryContainer, goog.getCssName('transitioningTrack')); }, 500); this.trackIdDomMapping_[track.getId()] = trackEntryContainer; }; /** * Removes a track entry. * @param {number} trackIndex A whole number. The index of the track entry we * seek to remove. */ audioCat.ui.TrackListingManager.prototype.removeTrackEntry = function(trackIndex) { var trackEntries = this.trackEntries_; var trackEntry = trackEntries[trackIndex]; var domHelper = this.domHelper_; // TODO(chizeng): Get the track based on the index instead. var track = trackEntry.getTrack(); var trackEntryDom = this.trackIdDomMapping_[track.getId()]; domHelper.removeNode(trackEntryDom); goog.array.removeAt(trackEntries, trackIndex); this.scrollResizeManager_.removeFromFixLeft(trackEntry.getDescriptorDom()); trackEntry.cleanUp(); }; /** * Handles a new track being added. * @param {!audioCat.state.TrackAddedEvent} event The event associated with the * new track being added. * @private */ audioCat.ui.TrackListingManager.prototype.handleTrackAddedEvent_ = function(event) { this.addTrackEntry(event.getTrack(), event.getTrackIndex()); }; /** * Handles a new track being removed. * @param {!audioCat.state.TrackRemovedEvent} event The event associated with a * track being removed. * @private */ audioCat.ui.TrackListingManager.prototype.handleTrackRemovedEvent_ = function(event) { this.removeTrackEntry(event.getTrackIndex()); }; /** * Handles what happens when playing stops or begins. This lets us add special * UI effects to solo-ed or muted tracks. * @private */ audioCat.ui.TrackListingManager.prototype.handlePlayStateChange_ = function() { (this.playManager_.getPlayState() ? goog.dom.classes.add : goog.dom.classes.remove)( this.entriesContainer_, goog.getCssName('currentlyPlaying')); }; /** * Handles what happens when the solo state of the track manager changes. This * means either a track was solo-ed or un-soloed. * @private */ audioCat.ui.TrackListingManager.prototype.handleChangeInSoloState_ = function() { (this.trackManager_.getSoloedTrack() ? goog.dom.classes.add : goog.dom.classes.remove)( this.entriesContainer_, goog.getCssName('soloedState')); }; /** * Handles changes in edit mode. * @private */ audioCat.ui.TrackListingManager.prototype.handleEditModeChanged_ = function() { this.setEditModeDataKey_(); }; /** * Sets the data key for the edit mode so that child elements can make use of * it. For example, the speed alterer differs based on whether the current mode * is edit mode. * @private */ audioCat.ui.TrackListingManager.prototype.setEditModeDataKey_ = function() { this.entriesContainer_.setAttribute('data-m', '' + this.editModeManager_.getCurrentEditMode().getName()); };
/* eslint-disable jsx-a11y/no-static-element-interactions */ /* eslint-disable react/sort-comp */ /* eslint-disable global-require */ /* eslint-disable no-nested-ternary */ /* eslint-disable react/destructuring-assignment */ /* eslint-disable react/prop-types */ import React from 'react'; import './AnalystProfile.scss'; import { Row, Col, Image, ListGroup } from 'react-bootstrap'; import { withRouter } from 'react-router-dom'; import CircularProgress from '@material-ui/core/CircularProgress'; import { connect } from 'react-redux'; import { Button, ButtonGroup, FormControl } from '@material-ui/core'; import Dialog from '@material-ui/core/Dialog'; import DialogTitle from '@material-ui/core/DialogTitle'; import DialogContent from '@material-ui/core/DialogContent'; import DialogActions from '@material-ui/core/DialogActions'; import Typography from '@material-ui/core/Typography'; import Input from '@material-ui/core/Input'; import DesktopWindowsOutlinedIcon from '@material-ui/icons/DesktopWindowsOutlined'; import ClickAwayListener from '@material-ui/core/ClickAwayListener'; import ResizeImage from 'image-resize'; import Slider from '@material-ui/core/Slider'; import Cropper from 'react-easy-crop'; import getCroppedImg from './cropImage'; import * as actions from '../../redux/actions/index'; import RotateRightIcon from '@material-ui/icons/RotateRight'; import RotateLeftIcon from '@material-ui/icons/RotateLeft'; import DoneIcon from '@material-ui/icons/Done'; import CloseIcon from '@material-ui/icons/Close'; import CheckCircleOutlinedIcon from '@material-ui/icons/CheckCircleOutlined'; import ContactSupportOutlinedIcon from '@material-ui/icons/ContactSupportOutlined'; import Slide from '@material-ui/core/Slide'; import Loading from '../Loading/Loading'; import { Mixpanel } from '../../shared/mixPanel'; class AnalystProfile extends React.Component { constructor(props) { super(props); this.state = { name: this.props.signinData && this.props.signinData.user && this.props.signinData.user.UserAttributes.filter(item => item.Name === 'name').length > 0 ? this.props.signinData.user.UserAttributes.filter(item => item.Name === 'name')[0].Value === ' ' ? null : this.props.signinData.user.UserAttributes.filter(item => item.Name === 'name')[0].Value : null, isEdit: false, analyst_followers: this.props.analystDetails ? this.props.analystDetails.followers_count : 0, analyst_subscribers: this.props.analystDetails ? this.props.analystDetails.subscriber_count : 0, image: this.props.profileImage ? this.props.profileImage : require('../../assets/images/jpeg/placeholder.jpg'), slectedImage: null, crop: { x: 0, y: 0 }, zoom: 1, aspect: 5 / 5, croppedAreaPixels: null, fileName: null, fileType: null, croppedImage: null, rotation: 0, fetchingReferralCode: false // loading: true }; } componentDidMount() { // this.timerHandle = setTimeout(() => { // *** // this.setState({ loading: false }); // *** // }, 2000); // this.props.getProfileImage(this.props.signinData.token.AuthenticationResult.AccessToken); if (this.props.signinData && this.props.userGroup === 'ANALYST' && !this.props.subscriptionPlan) { this.props.getSubscriptionPlanList(); } if (this.props.signinData && this.props.userGroup === 'ANALYST' && !this.props.subscriptionPlan) { this.props.getAnalystPortfolio(); } // if (this.props.analystDetails) { // this.props.fetchPerformanceAndTransactionsData({ // analyst_id: this.props.analystDetails.user.user_id, // token: this.props.signinData.token.AuthenticationResult.AccessToken // }); // } } handleLogoutSubmit = event => { event.preventDefault(); this.props.logout('/signin'); // this.props.history.push('/signin'); }; componentDidUpdate(preState, preProps) { if (this.props.profileImage && this.state.image !== this.props.profileImage) { this.setState({ image: this.props.profileImage }); } if (this.state.fetchingReferralCode && this.props.referralCode) { this.setState({ fetchingReferralCode: false }); if (navigator.share) { navigator.share({ url: `https://m.pvot.in/referral-code?referralCode=${this.props.referralCode}`, text: "Hi! I'm inviting you to join Pvot. Pvot is the best stock market app for people looking for expertise on trading and investing." }); } } } onNameChange = event => { this.setState({ name: event.target.value }); }; handleName = () => { this.setState({ isEdit: true }); }; selectFile = event => { if (event.target.files && event.target.files.length > 0) { this.setState({ slectedImage: window.URL.createObjectURL(event.target.files[0]), crop: { x: 0, y: 0 }, zoom: 1, fileName: event.target.files[0].name, fileType: event.target.files[0].type }); } }; onCropChange = crop => { this.setState({ crop }); }; // onRotationChange = rotation => { // this.setState({ rotation }); // }; onRotationChange = r => { let rotation = this.state.rotation + r; this.setState({ rotation }); }; onCropComplete = (croppedArea, croppedAreaPixels) => { console.log(croppedArea, croppedAreaPixels); this.setState({ croppedAreaPixels }); }; onZoomChange = zoom => { this.setState({ zoom }); }; getImage = async () => { const croppedImage = await getCroppedImg( this.state.slectedImage, this.state.croppedAreaPixels, this.state.fileName, this.state.fileType, this.state.rotation ); console.log('donee', { croppedImage }); this.setState({ slectedImage: null, croppedImage: croppedImage }, () => { var resizeImage = new ResizeImage({ format: this.state.fileType, outputType: 'blob', width: 750, height: 750 }); resizeImage .play(window.URL.createObjectURL(this.state.croppedImage)) .then(response => { console.log('!!!!!!!!!!!!!!!!!', response); var formData = new FormData(); console.log(response); formData.append('field_name', 'profile_pic'); formData.append('profile_pic', response); this.props.updateProfileImage({ payload: formData }); this.setState({ croppedImage: null }); }) .catch(error => { console.error(error); }); }); }; handleNameEdit = () => { const preName = this.props.signinData && this.props.signinData.user && this.props.signinData.user.UserAttributes.filter(item => item.Name === 'name').length > 0 ? this.props.signinData.user.UserAttributes.filter(item => item.Name === 'name')[0].Value : null; if (this.state.isEdit) { this.setState({ isEdit: false }); if (this.state.name !== preName) { if (this.state.name && this.state.name !== '') this.props.updateName({ UserAttributes: [ { Name: 'name', Value: this.state.name } ] }); else this.setState({ name: preName }); } } }; fetchReferralCode() { this.props.getReferralCode(); this.setState({ fetchingReferralCode: true }); } render() { // console.log('@@@@@@@@@@@@@@@@@@@@@@@@@@@@', this.props); const { signinData, analystDetails, analystPortfolio, subscriptionPlan, logoutLoading } = this.props; const signinDataName = signinData && signinData.user && signinData.user.UserAttributes.filter(item => item.Name === 'name').length > 0 ? signinData.user.UserAttributes.filter(item => item.Name === 'name')[0].Value === ' ' ? null : signinData.user.UserAttributes.filter(item => item.Name === 'name')[0].Value : null; const signinDataEmail = signinData && signinData.user && signinData.user.UserAttributes.filter(item => item.Name === 'email').length > 0 ? signinData.user.UserAttributes.filter(item => item.Name === 'email')[0].Value === ' ' ? null : signinData.user.UserAttributes.filter(item => item.Name === 'email')[0].Value : null; const tradingExp = analystDetails && analystDetails.trading_experience >= 0; const education = analystDetails && analystDetails.education; const allocationComplete = analystDetails ? analystDetails.segment_list ? Object.keys(analystDetails.segment_list).length > 0 ? true : false : false : false; // const allocationComplete = analystPortfolio ? (analystPortfolio.length > 0 ? true : false) : false; const subscriptionComplete = subscriptionPlan ? (subscriptionPlan.length > 0 ? true : false) : false; return ( <Slide direction='left' in={true} mountOnEnter unmountOnExit> <div> {/* <Slide direction='up' in={this.state.checked} mountOnEnter unmountOnExit> */} {!this.state.loading && ( <Row className='container-fluid mainArea mb-5 py-2'> <Col className='center-col-special'> <Row className='topSection align-content-center'> <Col className='center-col'> <div className='analyst-profile-header'>Settings</div> </Col> {logoutLoading ? ( <CircularProgress name='circle' /> ) : ( <div onClick={this.handleLogoutSubmit} className='logoutText'> <u>Logout</u> </div> )} </Row> {/* Section 1: Image, Name, Follower and Subscriber */} <Row className='ImageSection'> <Col className='center-col'> <Row className="profileImageSection align-content-center justify-content-center'"> <label className='profile_image'> <Image src={this.state.image} roundedCircle className='analyst-image' /> <input className='profiel_image_input' type='file' accept='image/*' onChange={event => this.selectFile(event)} /> </label> </Row> <Row className='fullNameSection align-content-center justify-content-center'> <ClickAwayListener onClickAway={this.handleNameEdit}> <FormControl> <input id='Name' className='fullName' placeholder='Firstname Lastname' disableUnderline={!this.state.isEdit} value={this.state.name} onChange={event => this.onNameChange(event)} fullWidth autoComplete='off' onClick={this.handleName} focus={this.state.isEdit} /> </FormControl> </ClickAwayListener> {this.props.signinData && this.props.signinData.user && ((this.props.signinData.user.UserAttributes.filter(item => item.Name === 'name').length > 0 && !this.props.signinData.user.UserAttributes.filter(item => item.Name === 'name')[0].Value) || this.props.signinData.user.UserAttributes.filter(item => item.Name === 'name').length === 0) && ( <p style={{ fontSize: '12px', color: '#212121', opacity: '0.5' }} > Click name field to edit </p> )} </Row> <Row className='followerSection align-content-center justify-content-center'> <div onClick={() => this.props.history.push('/followers', { list: 'Followers' })} className='col-5' > <Row className='mt-3 justify-content-center'> <div className='followerCount'> {this.props.analystDetails ? this.props.analystDetails.followers_count : 0} </div> </Row> <Row> <div className='followereTitle'>Followers</div> </Row> </div> <div className='col-2 mt-3'> <div className='followerSubscriberPartition'></div> </div> <div onClick={() => this.props.history.push('/subscribers', { list: 'Subscribers' })} className='col-5' > <Row className='mt-3 justify-content-center'> <div className='followerCount'> {this.props.analystDetails ? this.props.analystDetails.subscriber_count : 0} </div> </Row> <Row> <div className='followereTitle'>Subscribers</div> </Row> </div> </Row> </Col> </Row> {/* Section 2: Personal Details, Portfolio Allocation, Subscription Plan */} <div className='profileButtonArea mx-auto px-4'> <Typography align='center' className='profileButtonInfoText mx-auto'> {signinDataName && tradingExp && education && allocationComplete && subscriptionComplete ? 'Edit your details by clicking bellow' : 'Complete your details to start trading'} </Typography> <div className='row my-2 fullProfileButton'> {signinDataName && tradingExp && education ? ( <Button variant='outlined' className='btn-block rounded-lg py-2 px-1 profileButton' onClick={() => this.props.history.push({ pathname: '/basic-detail' }) } > <div className='row buttonTextSection'> <div className='mx-auto my-auto buttonText'>Profile</div> <CheckCircleOutlinedIcon className='tikIcon mr-2 my-auto' /> </div> </Button> ) : ( <Button variant='outlined' className='btn-block rounded-lg py-2 px-1 profileButton' onClick={() => this.props.history.push({ pathname: '/basic-detail' }) } > <div className='row buttonTextSection'> <div className='col mx-auto buttonText'>Profile</div> </div> </Button> )} </div> <div className='row my-2 fullProfileButton'> {allocationComplete ? ( <Button variant='outlined' className='btn-block rounded-lg py-2 px-1 profileButton' onClick={() => this.props.history.push({ pathname: '/allocate-my-trade' }) } > <div className='row buttonTextSection'> <div className='mx-auto my-auto buttonText'>Portfolio Allocation</div> <CheckCircleOutlinedIcon className='tikIcon mr-2 my-auto' /> </div> </Button> ) : ( <Button variant='outlined' className='btn-block rounded-lg py-2 px-1 profileButton' onClick={() => this.props.history.push({ pathname: '/allocate-my-trade' }) } > <div className='row buttonTextSection'> <div className='col mx-auto buttonText'>Portfolio Allocation</div> </div> </Button> )} </div> <div className='row my-2 fullProfileButton'> {subscriptionComplete ? ( <Button variant='outlined' className='btn-block rounded-lg py-2 px-1 profileButton' onClick={() => { this.props.history.push({ pathname: '/create-subscription-plan' }); }} > <div className='row buttonTextSection'> <div className='mx-auto my-auto buttonText'>Subscription Plans</div> <CheckCircleOutlinedIcon className='tikIcon mr-2 my-auto' /> </div> </Button> ) : ( <Button variant='outlined' className='btn-block rounded-lg py-2 px-1 profileButton' onClick={() => { this.props.history.push({ pathname: '/create-subscription-plan' }); }} > <div className='row buttonTextSection'> <div className='col mx-auto buttonText'>Subscription Plans</div> </div> </Button> )} </div> </div> {/* Section 3: User Manual */} <div className='userManualSection'> <Row className='mb-5'> <Col align='center' className=''> <button className='btn btn-link manualButton' onClick={() => this.props.history.push('/user-manual')} > <ContactSupportOutlinedIcon /> User Manual </button> </Col> </Row> </div> {/* Section 4: FAQ, About and Privacy Policy */} <div className='bottomSection mx-auto'> <Row className='mt-2 text-center'> {this.state.fetchingReferralCode ? ( <Col className='col-4 offset-4'> <CircularProgress size='1rem' color='primary' /> </Col> ) : ( <Col onClick={this.fetchReferralCode.bind(this)} className='col-6 offset-3 text-center color-blue' > Refer a friend </Col> )} </Row> <Row className='mx-auto'> <ButtonGroup variant='text' aria-label='text primary button group' align='center'> <span className='bottomButton' onClick={() => this.props.history.push('/expert-faqs')}> FAQs </span> {/* <div className='bottomVerticalLine'></div> */} <span className='bottomButton' onClick={() => this.props.history.push('/privacy-policy')}> Privacy Policy </span> {/* <div className='bottomVerticalLine'></div> */} <span className='bottomButton' onClick={() => this.props.history.push('/terms-of-use')}> Terms of Use </span> </ButtonGroup> </Row> </div> </Col> <Dialog open={this.state.slectedImage} onClose={() => { this.setState({ slectedImage: null }); }} aria-labelledby='alert-dialog-title' aria-describedby='alert-dialog-description' fullWidth className='cropImageDialog' > <DialogContent> <div className='row justify-content-center align-items-center'> <div className='col-3'> <DialogActions> <Button onClick={() => { this.setState({ slectedImage: null }); }} autoFocus > <CloseIcon /> </Button> </DialogActions> </div> <div className='col-6'> <button onClick={() => this.onRotationChange(-90)} className='bg-transparent border-0'> <RotateLeftIcon className='rotationIcon bg-transparent text-primary' /> </button> <button onClick={() => this.onRotationChange(90)} className='bg-transparent border-0'> <RotateRightIcon className='rotationIcon bg-transparent text-primary' /> </button> </div> <div className='col-3'> <DialogActions> <Button onClick={() => { this.getImage(); }} autoFocus > <DoneIcon /> </Button> </DialogActions> </div> </div> <div className='crop-container p-2'> <Cropper image={this.state.slectedImage} crop={this.state.crop} zoom={this.state.zoom} rotation={this.state.rotation} cropShape='round' showGrid={false} aspect={this.state.aspect} onCropChange={this.onCropChange} onRotationChange={this.onRotationChange} onCropComplete={this.onCropComplete} onZoomChange={this.onZoomChange} /> </div> <div className='text-center controls m-2 p-2'> <Slider value={this.state.zoom} min={1} max={3} step={0.1} aria-labelledby='Zoom' onChange={(e, zoom) => this.onZoomChange(zoom)} /> </div> </DialogContent> </Dialog> <Loading open={this.props.loading} popover /> </Row> )} {/* </Slide> */} </div> </Slide> ); } } const mapStateToProps = state => ({ logoutLoading: state.auth.logoutLoading, logoutError: state.auth.logoutError, logoutData: state.auth.logoutData, logoutMessage: state.auth.logoutMessage, logoutShow: state.auth.logoutShow, signinData: state.auth.signinData, profileImage: state.auth.profileImage, analystDetails: state.analyst.analystDetails, subscriptionPlan: state.analyst.subscriptionPlan, userGroup: state.auth.userGroup, analystsForSubscriptionDetails: state.user.analystsForSubscriptionDetails, analystPortfolio: state.analyst.analystPortfolio, loading: state.analyst.loading }); const mapDispatchToProps = dispatch => ({ logout: path => dispatch(actions.logout(path)), // logoutalertshowhidedanger: () => dispatch(actions.logoutalertshowhidedanger()), // logoutalertshowhidedangerdismiss: () => dispatch(actions.logoutalertshowhidedangerdismiss()), updateName: namePayload => dispatch(actions.updateName(namePayload)), updateProfileImage: profileImage => dispatch(actions.updateProfileImage(profileImage)), getSubscriptionPlanList: token => dispatch(actions.getSubscriptionPlanList(token)), getAnalystPortfolio: token => dispatch(actions.getAnalystPortfolio(token)), getReferralCode: () => dispatch(actions.getReferralCode()) // getProfileImage: token => dispatch(actions.getProfileImage(token)) // fetchPerformanceAndTransactionsData: params => dispatch(actions.fetchPerformanceAndTransactionsData(params)) }); export default connect(mapStateToProps, mapDispatchToProps)(withRouter(AnalystProfile));
/** * date:20191213 * author:WL * description:后台界面框架 */ layui.define(["element", "jquery"], function (exports) { var $ = layui.$ ,element = layui.element ,layer = layui.layer; let adminui = new function () { this.init = function () { }; /** * * 判断窗口是否已打开 * @param tabId * @param isIframe 是否从子界面的iframe判断 * @returns {boolean} */ this.checkTab = function (tabId, isIframe) { // 判断选项卡上是否有 var checkTab = false; if (isIframe === undefined || isIframe === false) { $(".layui-tab-title li").each(function () { checkTabId = $(this).attr('lay-id'); if (checkTabId != null && checkTabId === tabId) { checkTab = true; } }); } else { parent.layui.$(".layui-tab-title li").each(function () { checkTabId = $(this).attr('lay-id'); if (checkTabId != null && checkTabId === tabId) { checkTab = true; } }); } if (checkTab === false) { return false; } // 判断sessionStorage是否有 var tabInfo = JSON.parse(sessionStorage.getItem("tabInfo")); if (tabInfo == null) { tabInfo = {}; } var check = tabInfo[tabId]; return check !== undefined; }; /** * 打开选项卡 * @param tabId * @param href * @param title * @param addSession */ this.addTab = function (tabId, href, title, addSession) { if (addSession === undefined || addSession === true) { var tabInfo = JSON.parse(sessionStorage.getItem("tabInfo")); if (tabInfo == null) { tabInfo = {}; } tabInfo[tabId] = {href: href, title: title}; sessionStorage.setItem("tabInfo", JSON.stringify(tabInfo)); } element.tabAdd('adminTab', { title: title , content: '<iframe width="100%" height="100%" frameborder="0" src="' + href + '"></iframe>' , id: tabId }); }; /** * 刷新当新选项卡 */ this.refreshTab = function () { var othis = parent.layui.$(".layui-tab-title li.layui-this").eq(0) , layId = othis.attr('lay-id') , index = othis.parents().children('li').index(othis) , parents = othis.parents('.layui-tab').eq(0) , item = parents.children('.layui-tab-content').children('.layui-tab-item') , oiframe = item.eq(index).find('iframe') , src = item.eq(index).find('iframe').attr('src'); oiframe.attr('src', src); }; /** * 关闭选项卡 * @param isAll 是否关闭全部 */ this.closeTab = function (isAll = false) { $(".layui-tab-title li").each(function () { tabId = $(this).attr('lay-id'); var id = $(this).attr('id'); if (id !== 'homeTabLi') { var tabClass = $(this).attr('class'); if (isAll || tabClass !== 'layui-this') { var tabInfo = JSON.parse(sessionStorage.getItem("tabInfo")); if (tabInfo != null) { delete tabInfo[tabId]; sessionStorage.setItem("tabInfo", JSON.stringify(tabInfo)) } element.tabDelete('adminTab', tabId); } } }); } }; /** * 打开新选项卡 */ $('body').on('click', '[data-tab]', function () { var loading = layer.load(0, {shade: false, time: 2 * 1000}); // 加载 var tabId = $(this).attr('data-tab'), href = $(this).attr('data-tab'), title = $(this).html(), target = $(this).attr('target'); if (target === '_blank') { // 表示打开新窗口 layer.close(loading); window.open(href, "_blank"); return false; } // 拼接链接参数(暂无) // 判断链接有效(暂无) // 判断tabId if (tabId === undefined) { tabId = new Date().getTime(); } // 判断选项卡是否已打开 var checkTab = adminui.checkTab(tabId); if (!checkTab) { adminui.addTab(tabId, href, title, true); } element.tabChange('adminTab', tabId); layer.close(loading); }); /** * 选项卡操作,刷新当前选项卡/关闭其他选项卡 */ $('body').on('click', '[data-tab-operation]', function () { var loading = layer.load(0, {shade: false, time: 2 * 1000}); // 加载 opId = $(this).attr('data-tab-operation'); if (opId === 'refresh') { adminui.refreshTab(); } else if (opId === 'closeOther') { adminui.closeTab(); } else if (opId === 'closeAll') { adminui.closeTab(true); } $(this).parent().removeClass('layui-this'); // 去除焦点 layer.close(loading); }); exports("adminui", adminui); });
import React from 'react'; export default class TrainerCounter extends React.Component { constructor(props) { super(props); } render() { return ( <div className="row mt-3"> <div id="poke-master-counter-text" className="col-md-12 text-center"> <span className="oi oi-person" title="person" aria-hidden="true"></span> x {this.props.number} </div> </div> ); } }
import React from 'react'; import { shallow } from 'enzyme'; import SectionCard from './SectionCard'; import renderer from 'react-test-renderer'; test('It calls the function that gets passed in as a prop to remove section on click.', () => { const mockOnClick = jest.fn(); const props = { title: 'This is a Section Title', id: '98748345934', lessons: [{}], } const sectionCard = shallow(<SectionCard {...props} removeSection={mockOnClick} />); sectionCard.find('.deleteSection').simulate('click', { target: { value: 'Removes section' } }); expect(mockOnClick).toHaveBeenCalled(); });
import { ParamsError } from './Err'; import ValidatorBase from './ValidatorBase'; import { isBool } from './dataType'; export default class BooleanValidator extends ValidatorBase { constructor(data, options) { super(); this.type = 'boolean'; this.value = data; this.options = options || {}; } singleField(name, options) { this.currentFieldInfo = this.fetchFieldInfo(name, this.value, this.type, options); this.validate(); } checkOptionsParamsSupport() { this.checkOptionsRequired(); } startValidateProcedure() { this.tryCastType(); this.verifyType(); } tryCastType() { const { value } = this.currentFieldInfo; if (typeof value === 'string' && ['true', 'false'].indexOf(value) > -1) { this.currentFieldInfo.value = value === 'true'; } } verifyType() { const { value, name } = this.currentFieldInfo; if (!isBool(value)) { throw new ParamsError(`the type of ${name} is not boolean.`); } } }
import { selectedSub } from '../reducers' import { SELECT_SUB, } from '../actions' describe("selectedSub Reducer", () => { it("returns current state", () => { const action = {} const state = "reactjs" expect(selectedSub(state, action)).toEqual(state) }) it("updates state", () => { const action = { type: SELECT_SUB, sub: "reactjs" } const expectedState = "reactjs" expect(selectedSub("", action)).toEqual(expectedState) }) })
var app = require('express')(); var server = require('http').createServer(app); var io = require('socket.io')(server); var router = require('express').Router(); var Brainiac = require('./brainiac.js'); router.get('/', function(req, res) { res.status(200).json( { message: 'Welcom to Brainiac, an interactive interface for controlling a Raspberry PI through websocket.', port: 1958 } ); }); io.on('connection', function(client) { console.log('New connexion of: ', client.id); client.on('setup', function(datas) { console.log('setup datas:', datas); if (typeof(datas) === 'object') { if (!Array.isArray(datas)) datas = [datas]; datas.forEach(function(data) { var mode = Brainiac.verification.getMode(data.mode); if (mode) Brainiac.setup(data.pinNumber, mode); }); } }); client.on('write', function(datas) { console.log('write datas:', datas); if (typeof(datas) === 'object') { if (!Array.isArray(datas)) datas = [datas]; datas.forEach(function(data) { var pinValue = Brainiac.verification.getPinValue(data.value); if (pinValue === 0 || pinValue === 1) Brainiac.write(data.pinNumber, pinValue); }); } }); }); app.use('/', router); server.listen(1958);
import styled from "styled-components"; import Paper from "@material-ui/core/Paper"; export const Div = styled(Paper)` width: 100%; position: relative; margin: 0 auto auto; .ant-upload { width: 100% !important; min-height: 200px !important; padding: 15px; span:first-child { width: 100% !important; } img { width: 100%; height: auto; } } .submitButton { margin-bottom: 20px !important; } .ant-upload-list-item .anticon.anticon-close { display: ${props => props.readOnly ? 'none' : 'inherit'}; } .bid-title { font-size: 18px; padding: 10px 10px; span:nth-of-type(2) { float: right; } } `;