Spaces:
Running
Running
create a project management that features centralize work with flexible views (List, Board, Calendar, Timeline), robust task management (dependencies, custom fields, subtasks), powerful automation (rules, workflows), team collaboration tools (Inbox, comments, status updates), and advanced reporting (dashboards, portfolios) to provide visibility, accountability, and streamline projects from start to finish.
ea012db verified Download script.js from jcondes0829/workflowwizard-pro: direct link, hf CLI and curl.
- Browser
- Download file 10.5 kB
-
https://huggingface.co/spaces/jcondes0829/workflowwizard-pro/resolve/main/script.js
- Command line
-
hf download hf://spaces/jcondes0829/workflowwizard-pro/script.js
-
curl -L -o script.js https://huggingface.co/spaces/jcondes0829/workflowwizard-pro/resolve/main/script.js
10.5 kB
| // Main application script for TaskTamer Pro | |
| class TaskTamerApp { | |
| constructor() { | |
| this.currentView = 'list'; | |
| this.init(); | |
| } | |
| init() { | |
| this.loadProjects(); | |
| this.loadTasks(); | |
| this.setupEventListeners(); | |
| this.setupDragAndDrop(); | |
| } | |
| loadProjects() { | |
| // In a real app, this would be an API call | |
| console.log('Loading projects...'); | |
| } | |
| loadTasks() { | |
| // In a real app, this would be an API call | |
| console.log('Loading tasks...'); | |
| } | |
| setupEventListeners() { | |
| // View switcher | |
| document.addEventListener('click', (e) => { | |
| if (e.target.closest('[data-view]')) { | |
| const view = e.target.closest('[data-view]').dataset.view; | |
| this.switchView(view); | |
| } | |
| }); | |
| // Task completion toggle | |
| document.addEventListener('click', (e) => { | |
| if (e.target.closest('[data-task-toggle]')) { | |
| const taskId = e.target.closest('[data-task-toggle]').dataset.taskToggle; | |
| this.toggleTaskCompletion(taskId); | |
| } | |
| }); | |
| // Modal handling | |
| document.addEventListener('click', (e) => { | |
| if (e.target.closest('[data-modal-open]')) { | |
| const modalId = e.target.closest('[data-modal-open]').dataset.modalOpen; | |
| this.openModal(modalId); | |
| } | |
| if (e.target.closest('[data-modal-close]') || e.target.classList.contains('modal-overlay')) { | |
| this.closeModal(); | |
| } | |
| }); | |
| } | |
| switchView(view) { | |
| this.currentView = view; | |
| // Update active view button | |
| document.querySelectorAll('[data-view]').forEach(btn => { | |
| btn.classList.toggle('active', btn.dataset.view === view); | |
| }); | |
| // Show/hide view containers | |
| document.querySelectorAll('.view-container').forEach(container => { | |
| container.classList.toggle('hidden', container.id !== `${view}-view`); | |
| }); | |
| // Save preference | |
| localStorage.setItem('preferredView', view); | |
| console.log(`Switched to ${view} view`); | |
| } | |
| toggleTaskCompletion(taskId) { | |
| const taskElement = document.querySelector(`[data-task-id="${taskId}"]`); | |
| if (taskElement) { | |
| const isCompleted = taskElement.classList.toggle('completed'); | |
| // Update task in database (API call in real app) | |
| console.log(`Task ${taskId} ${isCompleted ? 'completed' : 'uncompleted'}`); | |
| // Update progress bars | |
| this.updateProjectProgress(taskElement.dataset.projectId); | |
| } | |
| } | |
| updateProjectProgress(projectId) { | |
| // Update progress for the specific project | |
| const progressElements = document.querySelectorAll(`[data-project-progress="${projectId}"]`); | |
| progressElements.forEach(el => { | |
| // Calculate new progress | |
| // This would be an API call in real app | |
| const newProgress = Math.min(100, parseInt(el.style.width) + 10); | |
| el.style.width = `${newProgress}%`; | |
| el.textContent = `${newProgress}%`; | |
| }); | |
| } | |
| // Advanced task management methods | |
| addDependency(parentTaskId, childTaskId) { | |
| console.log(`Adding dependency: ${parentTaskId} -> ${childTaskId}`); | |
| return Promise.resolve({ success: true }); | |
| } | |
| addCustomField(taskId, fieldName, value) { | |
| console.log(`Adding custom field ${fieldName} to task ${taskId}`); | |
| return Promise.resolve({ success: true }); | |
| } | |
| createSubtask(parentTaskId, subtaskData) { | |
| console.log(`Creating subtask for ${parentTaskId}:`, subtaskData); | |
| return Promise.resolve({ id: Date.now(), ...subtaskData }); | |
| } | |
| // Automation methods | |
| createAutomationRule(ruleData) { | |
| console.log('Creating automation rule:', ruleData); | |
| return Promise.resolve({ id: Date.now(), ...ruleData }); | |
| } | |
| executeWorkflow(workflowId, inputData) { | |
| console.log(`Executing workflow ${workflowId}:`, inputData); | |
| return Promise.resolve({ success: true }); | |
| } | |
| // Collaboration methods | |
| addComment(taskId, commentData) { | |
| console.log(`Adding comment to task ${taskId}:`, commentData); | |
| return Promise.resolve({ id: Date.now(), ...commentData }); | |
| } | |
| sendStatusUpdate(updateData) { | |
| console.log('Sending status update:', updateData); | |
| return Promise.resolve({ success: true }); | |
| } | |
| // Reporting methods | |
| generateReport(reportConfig) { | |
| console.log('Generating report:', reportConfig); | |
| return Promise.resolve({ id: Date.now(), data: {} }); | |
| } | |
| createPortfolioView(portfolioData) { | |
| console.log('Creating portfolio view:', portfolioData); | |
| return Promise.resolve({ success: true }); | |
| } | |
| setupDragAndDrop() { | |
| // Setup drag and drop for board view | |
| const draggables = document.querySelectorAll('.draggable-task'); | |
| const columns = document.querySelectorAll('.board-column'); | |
| draggables.forEach(draggable => { | |
| draggable.addEventListener('dragstart', () => { | |
| draggable.classList.add('dragging'); | |
| }); | |
| draggable.addEventListener('dragend', () => { | |
| draggable.classList.remove('dragging'); | |
| }); | |
| }); | |
| columns.forEach(column => { | |
| column.addEventListener('dragover', e => { | |
| e.preventDefault(); | |
| const afterElement = this.getDragAfterElement(column, e.clientY); | |
| const draggable = document.querySelector('.dragging'); | |
| if (afterElement == null) { | |
| column.appendChild(draggable); | |
| } else { | |
| column.insertBefore(draggable, afterElement); | |
| } | |
| }); | |
| }); | |
| } | |
| getDragAfterElement(container, y) { | |
| const draggableElements = [...container.querySelectorAll('.draggable-task:not(.dragging)')]; | |
| return draggableElements.reduce((closest, child) => { | |
| const box = child.getBoundingClientRect(); | |
| const offset = y - box.top - box.height / 2; | |
| if (offset < 0 && offset > closest.offset) { | |
| return { offset: offset, element: child }; | |
| } else { | |
| return closest; | |
| } | |
| }, { offset: Number.NEGATIVE_INFINITY }).element; | |
| } | |
| openModal(modalId) { | |
| const modal = document.getElementById(modalId); | |
| if (modal) { | |
| modal.classList.remove('hidden'); | |
| document.body.style.overflow = 'hidden'; | |
| } | |
| } | |
| closeModal() { | |
| document.querySelectorAll('.modal').forEach(modal => { | |
| modal.classList.add('hidden'); | |
| }); | |
| document.body.style.overflow = 'auto'; | |
| } | |
| // Task management methods | |
| createTask(taskData) { | |
| // API call to create task | |
| console.log('Creating task:', taskData); | |
| return Promise.resolve({ id: Date.now(), ...taskData }); | |
| } | |
| updateTask(taskId, updates) { | |
| // API call to update task | |
| console.log(`Updating task ${taskId}:`, updates); | |
| return Promise.resolve({ success: true }); | |
| } | |
| deleteTask(taskId) { | |
| // API call to delete task | |
| console.log(`Deleting task ${taskId}`); | |
| return Promise.resolve({ success: true }); | |
| } | |
| // Project management methods | |
| createProject(projectData) { | |
| // API call to create project | |
| console.log('Creating project:', projectData); | |
| return Promise.resolve({ id: Date.now(), ...projectData }); | |
| } | |
| updateProject(projectId, updates) { | |
| // API call to update project | |
| console.log(`Updating project ${projectId}:`, updates); | |
| return Promise.resolve({ success: true }); | |
| } | |
| } | |
| // Initialize app when DOM is loaded | |
| document.addEventListener('DOMContentLoaded', () => { | |
| window.taskTamer = new TaskTamerApp(); | |
| // Load preferred view | |
| const preferredView = localStorage.getItem('preferredView') || 'list'; | |
| window.taskTamer.switchView(preferredView); | |
| // Initialize tooltips | |
| const tooltipTriggers = document.querySelectorAll('[data-tooltip]'); | |
| tooltipTriggers.forEach(trigger => { | |
| trigger.addEventListener('mouseenter', (e) => { | |
| const tooltip = document.createElement('div'); | |
| tooltip.className = 'absolute z-50 px-3 py-2 text-sm font-medium text-white bg-gray-900 rounded-lg shadow-sm tooltip'; | |
| tooltip.textContent = e.target.dataset.tooltip; | |
| const rect = e.target.getBoundingClientRect(); | |
| tooltip.style.top = `${rect.top - 40}px`; | |
| tooltip.style.left = `${rect.left + rect.width / 2 - tooltip.offsetWidth / 2}px`; | |
| document.body.appendChild(tooltip); | |
| e.target._tooltip = tooltip; | |
| }); | |
| trigger.addEventListener('mouseleave', (e) => { | |
| if (e.target._tooltip) { | |
| e.target._tooltip.remove(); | |
| delete e.target._tooltip; | |
| } | |
| }); | |
| }); | |
| }); | |
| // Utility functions | |
| const Utils = { | |
| formatDate(dateString) { | |
| const date = new Date(dateString); | |
| return date.toLocaleDateString('en-US', { | |
| weekday: 'short', | |
| month: 'short', | |
| day: 'numeric' | |
| }); | |
| }, | |
| formatRelativeDate(dateString) { | |
| const date = new Date(dateString); | |
| const now = new Date(); | |
| const diffTime = Math.abs(date - now); | |
| const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)); | |
| if (diffDays === 0) return 'Today'; | |
| if (diffDays === 1) return 'Tomorrow'; | |
| if (diffDays < 7) return `In ${diffDays} days`; | |
| if (diffDays < 30) return `In ${Math.floor(diffDays / 7)} weeks`; | |
| return `In ${Math.floor(diffDays / 30)} months`; | |
| }, | |
| debounce(func, wait) { | |
| let timeout; | |
| return function executedFunction(...args) { | |
| const later = () => { | |
| clearTimeout(timeout); | |
| func(...args); | |
| }; | |
| clearTimeout(timeout); | |
| timeout = setTimeout(later, wait); | |
| }; | |
| } | |
| }; | |
| // Make utilities globally available | |
| window.Utils = Utils; |