├── .gitattributes ├── .gitignore ├── .vscode └── launch.json ├── README.md ├── favicon.png ├── index.html ├── scripts ├── app_functions.js ├── document_title.js ├── file_export.js ├── file_import.js ├── main.js ├── modal.js ├── navbar.js ├── old │ ├── diff.js │ ├── difflib.js │ ├── jquery.cookie.min.js │ ├── jquery.minicolors.min.js │ ├── jquery.mousewheel.min.js │ ├── kineticjs.js │ └── mindmap.min.js ├── pane_resizer.js ├── settings.js ├── shortcuts.js └── unsaved_changes.js └── styles ├── app.css ├── document_title.css ├── editor.css ├── modal.css ├── navbar.css ├── old ├── customstyles.css ├── jquery-ui-1.10.3.custom.min.css └── jquery.minicolors.css ├── pane_resizer.css ├── preferences_modal.css └── viewer.css /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear in the root of a volume 35 | .DocumentRevisions-V100 36 | .fseventsd 37 | .Spotlight-V100 38 | .TemporaryItems 39 | .Trashes 40 | .VolumeIcon.icns 41 | 42 | # Directories potentially created on remote AFP share 43 | .AppleDB 44 | .AppleDesktop 45 | Network Trash Folder 46 | Temporary Items 47 | .apdisk 48 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "chrome", 9 | "request": "launch", 10 | "name": "Launch Chrome against localhost", 11 | "url": "http://localhost:8080", 12 | "webRoot": "${workspaceFolder}" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Please note 2 | The current version of the tool utilizes some minified JavaScript and CSS code from the original [Text2MindMap.com](http://www.text2mindmap.com), which I didn't personally write. This was originally just meant to be a quick hack for personal use, and while I'm glad so many people have found a use for it, I unfortunately cannot dedicate the time I had originally intended to make this fully functioning web app. So let me reiterate, **this project is not in active development** at the current time, and might never be. 3 | 4 | # Text2MindMap 5 | An online tool for making mindmaps by writing indented lists. 6 | 7 | A few months ago one of my favorite tools [Text2MindMap](http://www.text2mindmap.com) went down and since there doesn't seem to be any plans to bring it back up I created my own version of the site. It's basically just a quick mashup between some of the code from the original site and some code from my [Markdown Editor](https://tobloef.com/markant/), but I hope someone will find it as useful. 8 | 9 | ![](https://i.imgur.com/1dov0WF.png) 10 | -------------------------------------------------------------------------------- /favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tobloef/text2mindmap/b85695dcc1611fdcfe1c28fac93574c16e25462e/favicon.png -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 14 | 15 | 16 | 17 | Text2MindMap 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 |
68 | 102 | 103 |
104 |
105 |
106 |
107 |
108 | 109 |
110 |
111 | 112 |
113 |
114 |
115 | 120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 | 173 | 174 | 175 | 176 | 177 | -------------------------------------------------------------------------------- /scripts/app_functions.js: -------------------------------------------------------------------------------- 1 | // A library of various functions that can be called by the app. 2 | // This is kept in a seperate module, so the navbar and the shortcuts can call the same functions. 3 | appFunctions = (function() { 4 | return { 5 | // Discard the current document and create an empty one. 6 | fileNew() { 7 | if (!unsavedChanges.confirmContinue()) { 8 | return; 9 | } 10 | $("#textArea").val(settings.getDefaultValue("documentContent")); 11 | mindmap.render(); 12 | documentTitle.setTitle(settings.getDefaultValue("documentTitle")); 13 | unsavedChanges.setHasChanges(false); 14 | settings.setSetting("documentContent", settings.getDefaultValue("documentContent")); 15 | settings.setSetting("documentTitle", settings.getDefaultValue("documentTitle")); 16 | }, 17 | 18 | // Open a markdown file from the user's computer 19 | fileOpen() { 20 | if (!unsavedChanges.confirmContinue()) { 21 | return; 22 | } 23 | fileImport.chooseFile(); 24 | }, 25 | 26 | // Save the current markdown document to the user's computer 27 | fileSave() { 28 | const content = $("#textArea").val(); 29 | const title = documentTitle.getTitle(); 30 | const type = ".txt"; 31 | fileExport.saveFile(content, title, type); 32 | unsavedChanges.setHasChanges(false); 33 | settings.setSetting("documentTitle", settings.getDefaultValue("documentTitle")); 34 | settings.setSetting("documentContent", settings.getDefaultValue("documentContent")); 35 | }, 36 | 37 | // Set the focus on the input box for renaming the document 38 | fileRename() { 39 | documentTitle.focus(); 40 | }, 41 | 42 | // Open the settings modal 43 | filePreferences() { 44 | $("#settings-modal").addClass("active"); 45 | } 46 | }; 47 | }()); -------------------------------------------------------------------------------- /scripts/document_title.js: -------------------------------------------------------------------------------- 1 | // Logic for the document title input field. To properly resize the input field, 2 | // a hidden input field is mirroring the visible's field's text. 3 | documentTitle = (function() { 4 | // Max width for the input element. 5 | const maxWidth = 300; 6 | // The amount of extra width to add to the input element. 7 | const extraWidth = 3; 8 | 9 | // Set up the jQuery elements. 10 | let $input; 11 | let $mirror; 12 | 13 | let oldTitle; 14 | 15 | $(document).ready(function() { 16 | $input = $(`.document-title-input`); 17 | $mirror = $(`.document-title-mirror`); 18 | 19 | // When the input loses focus, finalize the title 20 | $input.on("focusout", function(event) { 21 | setTitle($input.val()); 22 | }); 23 | 24 | // When the input is changed, mirror the text to the hidden input. 25 | $input.on("input change load focusout", function() { 26 | mirrorWidth($input, $mirror); 27 | }); 28 | 29 | // When the input is clicked, highlight the text if it's the default title. 30 | $input.on("focus", function(event) { 31 | if ($input.val() === settings.getDefaultValue("documentTitle")) { 32 | $input.select(); 33 | } 34 | }); 35 | 36 | // If the enter or escape key is pressed, either finalize the title or 37 | // cancel the edit and revert to the old title. 38 | $input.on("keydown", function(key) { 39 | if (key.keyCode === 13) { 40 | $input.blur(); 41 | } else if (key.keyCode === 27) { 42 | $input.val(oldTitle); 43 | $input.blur(); 44 | } 45 | }); 46 | }); 47 | 48 | // Get the document's title. 49 | function getTitle() { 50 | $input.blur(); 51 | return $input.val(); 52 | } 53 | 54 | // Set the document's title 55 | function setTitle(title) { 56 | if (title === null || title === "") { 57 | title = settings.getDefaultValue("documentTitle"); 58 | } 59 | $input.val(title); 60 | oldTitle = title; 61 | mirrorWidth($input, $mirror); 62 | unsavedChanges.setHasChanges(true); 63 | settings.setSetting("documentTitle", title); 64 | } 65 | 66 | // Shift focus to the title input. 67 | function focus() { 68 | $input.focus(); 69 | } 70 | 71 | // Mirror the text of the visble input to the hidden input. 72 | // This is used to resize the input width dynamically. 73 | function mirrorWidth($input, $mirror) { 74 | $mirror.text($input.val()); 75 | let width = parseInt($mirror.css("width")); 76 | if (!isNaN(width)) { 77 | width += extraWidth; 78 | width = Math.min(maxWidth, width); 79 | $input.css("width", width + "px"); 80 | } 81 | } 82 | 83 | return { 84 | getTitle, 85 | setTitle, 86 | focus 87 | }; 88 | }()); 89 | -------------------------------------------------------------------------------- /scripts/file_export.js: -------------------------------------------------------------------------------- 1 | // Save a file to the user's local drive. 2 | fileExport = (function() { 3 | // Convert some data to a file and save it to the user's local drive with 4 | // the speficied filename and extension. 5 | function saveFile(data, filename, extension) { 6 | const file = new Blob([data]); 7 | if (window.navigator.msSaveOrOpenBlob) { 8 | window.navigator.msSaveOrOpenBlob(file, filename + extension); 9 | } else { 10 | const url = URL.createObjectURL(file); 11 | const a = document.createElement("a"); 12 | a.href = url; 13 | a.download = filename + extension; 14 | document.body.appendChild(a); 15 | a.click(); 16 | setTimeout(function() { 17 | document.body.removeChild(a); 18 | window.URL.revokeObjectURL(url); 19 | }, 0); 20 | } 21 | } 22 | 23 | return { 24 | saveFile 25 | }; 26 | }()); 27 | -------------------------------------------------------------------------------- /scripts/file_import.js: -------------------------------------------------------------------------------- 1 | // Logic for importing a Markdown document from the user's lcoal drive. 2 | // A hidden tag i clicked and the user is prompted to choose the file. 3 | fileImport = (function() { 4 | // Only set up the listener if file reading is supported. 5 | $(document).ready(function() { 6 | if (window.FileReader) { 7 | $("#file-input").on("change", fileInput); 8 | } 9 | }) 10 | 11 | // Handler function for whenever the user chooses a file from the dialog prompt. 12 | function fileInput(event) { 13 | event.stopPropagation(); 14 | event.preventDefault(); 15 | let files = null; 16 | if (event.target && event.target.files && event.target.files.length > 0) { 17 | const selectedFile = event.target.files[0]; 18 | const reader = new FileReader(); 19 | const fileName = selectedFile.name; 20 | reader.onloadend = function(event) { 21 | handleUpload(event, fileName); 22 | }; 23 | reader.readAsText(selectedFile); 24 | } 25 | $("#file-input").val(""); 26 | } 27 | 28 | // Handler method for when the file has been loaded from the drive. 29 | function handleUpload(event, fileName) { 30 | if (event.target.readyState !== 2) { 31 | return; 32 | } 33 | if (event.target.error) { 34 | alert("There was an error opening the file."); 35 | return; 36 | } 37 | const content = event.target.result; 38 | 39 | documentTitle.setTitle(fileName.replace("/\.txt$/", "")); 40 | $("#textArea").val(content); 41 | mindmap.render(); 42 | unsavedChanges.setHasChanges(false); 43 | settings.setSetting("documentTitle", settings.getDefaultValue("documentTitle")); 44 | settings.setSetting("documentContent", settings.getDefaultValue("documentContent")); 45 | } 46 | 47 | // Try to click the hidden tag, triggering the file upload process. 48 | function chooseFile() { 49 | if (!window.FileReader) { 50 | alert("Your browser doesn't support opening files, consider upgrading to a newer version of your browser."); 51 | return; 52 | } 53 | $("#file-input").click(); 54 | } 55 | 56 | return { 57 | chooseFile 58 | }; 59 | }()); 60 | -------------------------------------------------------------------------------- /scripts/main.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | if (/Mobi/.test(navigator.userAgent)) { 3 | alert("The website doesn't currently work very well in mobile browsers, so it's recommended that you use a computer. Sorry about that!") 4 | } 5 | 6 | $(document).ready(function() { 7 | documentTitle.setTitle(settings.getSetting("documentTitle")); 8 | 9 | // Before the user closes the window, warn them if they have unsaved changes. 10 | $(window).on("beforeunload", function(event) { 11 | if (unsavedChanges.getHasChanges() && false ) { //TODO: 12 | const message = "You have unsaved changes. Are you sure you want to leave without saving?"; 13 | if (event) { 14 | event.returnValue = message; 15 | } 16 | return message; 17 | } 18 | return; 19 | }); 20 | 21 | // Set up shortcut bindings 22 | $(document).on("keydown", shortcuts.handleKeypress); 23 | const bindings = { 24 | "Ctrl+N": appFunctions.fileNew, 25 | "Ctrl+O": appFunctions.fileOpen, 26 | "Ctrl+S": appFunctions.fileSave 27 | }; 28 | shortcuts.addBindings(bindings); 29 | 30 | $("#modal-settings-save").on("click", function() { 31 | $(".modal").removeClass("active"); 32 | }); 33 | 34 | $("#textArea").val(settings.getSetting("documentContent")); 35 | mindmap.render(); 36 | 37 | function updateMindMap() { 38 | const value = $("#textArea").val(); 39 | unsavedChanges.setHasChanges(value !== settings.getDefaultValue("documentContent")); 40 | settings.setSetting("documentContent", value); 41 | mindmap.render(); 42 | } 43 | 44 | $('#textArea').on("input propertychange", updateMindMap); 45 | $('#textArea').on("keydown", function(e) { 46 | let keyCode = e.keyCode || e.which; 47 | if (keyCode == 9 || keyCode == 13) { 48 | updateMindMap(); 49 | } 50 | unsavedChanges.setHasChanges(true); 51 | }); 52 | }) 53 | }()); -------------------------------------------------------------------------------- /scripts/modal.js: -------------------------------------------------------------------------------- 1 | // Logic for the general modal UI. 2 | modal = (function() { 3 | let $tabs; 4 | let $contents; 5 | let $close; 6 | 7 | $(document).ready(function() { 8 | // Setup jQuery element. 9 | $tabs = $(".modal-tabs > li"); 10 | $contents = $(".tab-content"); 11 | $close = $(".close-modal"); 12 | 13 | // Close the modal 14 | $close.on("click touchstart", function() { 15 | $(this).closest(".modal").removeClass("active"); 16 | }); 17 | 18 | // Switch to the clicked tab 19 | $tabs.on("click touchstart", function() { 20 | $contents.removeClass("active"); 21 | $(`#${$(this).data("tab")}`).addClass("active"); 22 | $tabs.removeClass("active"); 23 | $(this).addClass("active"); 24 | }); 25 | }) 26 | }()); 27 | -------------------------------------------------------------------------------- /scripts/navbar.js: -------------------------------------------------------------------------------- 1 | // Logic for the top navigation bar (navbar) in the app. 2 | navbar = (function() { 3 | // Close all open dropdowns from the navbar. 4 | function closeDropdowns() { 5 | $(".navbar-dropdown .dropdown-content").hide(); 6 | } 7 | 8 | // Set the state of the visibility icon of a dropdown item, 9 | // signaling whether something is displayed or not. 10 | function setVisibilityIcon(buttonId, visibility) { 11 | $(`#${buttonId} > i`).removeClass("fa-eye fa-eye-slash"); 12 | if (visibility) { 13 | $(`#${buttonId} > i`).addClass("fa-eye"); 14 | } else { 15 | $(`#${buttonId} > i`).addClass("fa-eye-slash"); 16 | } 17 | } 18 | 19 | $(document).ready(function() { 20 | // A map of dropdown item ids and functions to call when the item is clicked. 21 | const idFunctionMap = { 22 | "file-new": appFunctions.fileNew, 23 | "file-open": appFunctions.fileOpen, 24 | "file-save": appFunctions.fileSave, 25 | "file-rename": appFunctions.fileRename, 26 | "file-preferences": appFunctions.filePreferences, 27 | }; 28 | 29 | let $links = $(".navbar a"); 30 | 31 | // When the dropdown item is clicked, call the appropriate function. 32 | $links.on("click touchstart", function(event) { 33 | if ($(this).attr("href") === "#") { 34 | event.preventDefault(); 35 | } 36 | const id = $(this).attr("id"); 37 | console.log(id); 38 | if (id in idFunctionMap) { 39 | idFunctionMap[id]($(this)); 40 | closeDropdowns(); 41 | } 42 | }); 43 | 44 | // Close all open dropdowns if the user clicks anywhere but the dropdown. 45 | $(document).on("click click", function(event) { 46 | closeDropdowns(); 47 | let $navbarDropdown = $(event.target).parent(".navbar-dropdown"); 48 | if ($navbarDropdown.length !== 0) { 49 | $navbarDropdown.find(".dropdown-content").show(); 50 | } 51 | }); 52 | }); 53 | 54 | return { 55 | setVisibilityIcon 56 | } 57 | }()); -------------------------------------------------------------------------------- /scripts/old/diff.js: -------------------------------------------------------------------------------- 1 | /* 2 | Simple Diff for version 1.0 (ported to JavaScript) 3 | 4 | Annotate two versions of a list with the values that have been 5 | changed between the versions, similar to unix's `diff` but with 6 | a dead-simple JavaScript interface. 7 | 8 | JavaScript port by DJ Mountney (twk3) based on code by Paul Butler. 9 | 10 | (C) 2008-2012 11 | May be used and distributed under the zlib/libpng license 12 | 13 | */ 14 | var diff=function(d,c){var b={},a;for(a=0;ah&&(h=l[k],e=k-h+1,g=j-h+1)}f=l}return 0===h?(b=[],d.length&&b.push(["-",d]),c.length&&b.push(["+",c]),b):[].concat(diff(d.slice(0,e),c.slice(0,g)),[["=",c.slice(g,g+h)]],diff(d.slice(e+h),c.slice(g+h)))},stringDiff=function(d,c){return diff(d.split(/[ ]+/), 15 | c.split(/[ ]+/))},htmlDiff=function(d,c){var b,a,f,e=[];b={"=":function(a){return a},"+":function(a){return""+a+""},"-":function(a){return""+a+""}};a=stringDiff(d,c);for(f=0;f 3 | Copyright (c) 2007, Snowtide Informatics Systems, Inc. All rights reserved. 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 7 | * Neither the name of the Snowtide Informatics Systems nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 8 | */ 9 | __whitespace={" ":true,"\t":true,"\n":true,"\f":true,"\r":true}; 10 | difflib={defaultJunkFunction:function(c){return __whitespace.hasOwnProperty(c)},stripLinebreaks:function(str){return str.replace(/^[\n\r]*|[\n\r]*$/g,"")},stringAsLines:function(str){var lfpos=str.indexOf("\n");var crpos=str.indexOf("\r");var linebreak=lfpos>-1&&crpos>-1||crpos<0?"\n":"\r";var lines=str.split(linebreak);for(var i=0;ib[i])return 1}return a.length==b.length?0:a.length=200&&indices.length*100>n){populardict[elt]=1;delete b2j[elt]}else indices.push(i)}else b2j[elt]=[i]}for(var elt in populardict)if(populardict.hasOwnProperty(elt))delete b2j[elt];var isjunk=this.isjunk;var junkdict={};if(isjunk){for(var elt in populardict)if(populardict.hasOwnProperty(elt)&&isjunk(elt)){junkdict[elt]=1;delete populardict[elt]}for(var elt in b2j)if(b2j.hasOwnProperty(elt)&&isjunk(elt)){junkdict[elt]=1;delete b2j[elt]}}this.isbjunk=difflib.__isindict(junkdict);this.isbpopular= 14 | difflib.__isindict(populardict)};this.find_longest_match=function(alo,ahi,blo,bhi){var a=this.a;var b=this.b;var b2j=this.b2j;var isbjunk=this.isbjunk;var besti=alo;var bestj=blo;var bestsize=0;var j=null;var j2len={};var nothing=[];for(var i=alo;i=bhi)break;newj2len[j]=k=difflib.__dictget(j2len,j-1,0)+1;if(k>bestsize){besti=i-k+1;bestj= 15 | j-k+1;bestsize=k}}j2len=newj2len}while(besti>alo&&bestj>blo&&!isbjunk(b[bestj-1])&&a[besti-1]==b[bestj-1]){besti--;bestj--;bestsize++}while(besti+bestsizealo&&bestj>blo&&isbjunk(b[bestj-1])&&a[besti-1]==b[bestj-1]){besti--;bestj--;bestsize++}while(besti+bestsizenn){groups.push([tag,i1,Math.min(i2,i1+n),j1,Math.min(j2,j1+n)]);i1=Math.max(i1,i2-n);j1=Math.max(j1,j2-n)}groups.push([tag,i1,i2,j1,j2])}if(groups&&groups[groups.length-1][0]=="equal")groups.pop();return groups};this.ratio=function(){matches=difflib.__reduce(function(sum,triple){return sum+triple[triple.length-1]},this.get_matching_blocks(),0);return difflib.__calculate_ratio(matches,this.a.length+this.b.length)};this.quick_ratio=function(){var fullbcount,elt;if(this.fullbcount== 21 | null){this.fullbcount=fullbcount={};for(var i=0;i0)matches++}return difflib.__calculate_ratio(matches,this.a.length+this.b.length)};this.real_quick_ratio=function(){var la= 22 | this.a.length;var lb=this.b.length;return _calculate_ratio(Math.min(la,lb),la+lb)};this.isjunk=isjunk?isjunk:difflib.defaultJunkFunction;this.a=this.b=null;this.set_seqs(a,b)}}; 23 | -------------------------------------------------------------------------------- /scripts/old/jquery.cookie.min.js: -------------------------------------------------------------------------------- 1 | (function(e){if(typeof define==="function"&&define.amd&&define.amd.jQuery){define(["jquery"],e)}else{e(jQuery)}})(function(e){function n(e){return e}function r(e){return decodeURIComponent(e.replace(t," "))}function i(e){if(e.indexOf('"')===0){e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\")}try{return s.json?JSON.parse(e):e}catch(t){}}var t=/\+/g;var s=e.cookie=function(t,o,u){if(o!==undefined){u=e.extend({},s.defaults,u);if(typeof u.expires==="number"){var a=u.expires,f=u.expires=new Date;f.setDate(f.getDate()+a)}o=s.json?JSON.stringify(o):String(o);return document.cookie=[encodeURIComponent(t),"=",s.raw?o:encodeURIComponent(o),u.expires?"; expires="+u.expires.toUTCString():"",u.path?"; path="+u.path:"",u.domain?"; domain="+u.domain:"",u.secure?"; secure":""].join("")}var l=s.raw?n:r;var c=document.cookie.split("; ");var h=t?undefined:{};for(var p=0,d=c.length;p'),i=e.minicolors.defaultSettings;if(t.data("minicolors-initialized"))return;n=e.extend(true,{},i,n);r.addClass("minicolors-theme-"+n.theme).addClass("minicolors-swatch-position-"+n.swatchPosition).toggleClass("minicolors-swatch-left",n.swatchPosition==="left").toggleClass("minicolors-with-opacity",n.opacity);if(n.position!==undefined){e.each(n.position.split(" "),function(){r.addClass("minicolors-position-"+this)})}t.addClass("minicolors-input").data("minicolors-initialized",true).data("minicolors-settings",n).prop("size",7).prop("maxlength",7).wrap(r).after(''+''+''+""+''+''+""+''+''+''+""+"");t.parent().find(".minicolors-panel").on("selectstart",function(){return false}).end();if(n.swatchPosition==="left"){t.before('')}else{t.after('')}if(!n.textfield)t.addClass("minicolors-hidden");if(n.inline)t.parent().addClass("minicolors-inline");a(t)}function n(e){var t=e.parent();e.removeData("minicolors-initialized").removeData("minicolors-settings").removeProp("size").removeProp("maxlength").removeClass("minicolors-input");t.before(e).remove()}function r(e){a(e)}function i(e){var t=e.parent(),n=t.find(".minicolors-panel"),r=e.data("minicolors-settings");if(!e.data("minicolors-initialized")||e.prop("disabled")||t.hasClass("minicolors-focus"))return;s();t.addClass("minicolors-focus");n.stop(true,true).fadeIn(r.showSpeed,function(){if(r.show)r.show.call(e)})}function s(){e(".minicolors-input").each(function(){var t=e(this),n=t.data("minicolors-settings"),r=t.parent();if(n.inline)return;r.find(".minicolors-panel").fadeOut(n.hideSpeed,function(){if(r.hasClass("minicolors-focus")){if(n.hide)n.hide.call(t)}r.removeClass("minicolors-focus")})})}function o(e,t,n){var r=e.parents(".minicolors").find(".minicolors-input"),i=r.data("minicolors-settings"),s=e.find("[class$=-picker]"),o=e.offset().left,a=e.offset().top,f=Math.round(t.pageX-o),l=Math.round(t.pageY-a),c=n?i.animationSpeed:0,h,p,d,v;if(t.originalEvent.changedTouches){f=t.originalEvent.changedTouches[0].pageX-o;l=t.originalEvent.changedTouches[0].pageY-a}if(f<0)f=0;if(l<0)l=0;if(f>e.width())f=e.width();if(l>e.height())l=e.height();if(e.parent().is(".minicolors-slider-wheel")&&s.parent().is(".minicolors-grid")){h=75-f;p=75-l;d=Math.sqrt(h*h+p*p);v=Math.atan2(p,h);if(v<0)v+=Math.PI*2;if(d>75){d=75;f=75-75*Math.cos(v);l=75-75*Math.sin(v)}f=Math.round(f);l=Math.round(l)}if(e.is(".minicolors-grid")){s.stop(true).animate({top:l+"px",left:f+"px"},c,i.animationEasing,function(){u(r)})}else{s.stop(true).animate({top:l+"px"},c,i.animationEasing,function(){u(r)})}}function u(e){function t(e,t){var n,r;if(!e.length||!t)return null;n=e.offset().left;r=e.offset().top;return{x:n-t.offset().left+e.outerWidth()/2,y:r-t.offset().top+e.outerHeight()/2}}var n,r,i,s,o,u,a,f,l,h,d=e.parent(),v=e.data("minicolors-settings"),g=d.find(".minicolors-panel"),y=d.find(".minicolors-swatch"),b=d.find(".minicolors-grid"),w=d.find(".minicolors-slider"),E=d.find(".minicolors-opacity-slider"),S=b.find("[class$=-picker]"),x=w.find("[class$=-picker]"),T=E.find("[class$=-picker]"),N=t(S,b),C=t(x,w),k=t(T,E);switch(v.control){case"wheel":a=b.width()/2-N.x;f=b.height()/2-N.y;l=Math.sqrt(a*a+f*f);h=Math.atan2(f,a);if(h<0)h+=Math.PI*2;if(l>75){l=75;N.x=69-75*Math.cos(h);N.y=69-75*Math.sin(h)}r=p(l/.75,0,100);n=p(h*180/Math.PI,0,360);i=p(100-Math.floor(C.y*(100/w.height())),0,100);u=m({h:n,s:r,b:i});w.css("backgroundColor",m({h:n,s:r,b:100}));break;case"saturation":n=p(parseInt(N.x*(360/b.width())),0,360);r=p(100-Math.floor(C.y*(100/w.height())),0,100);i=p(100-Math.floor(N.y*(100/b.height())),0,100);u=m({h:n,s:r,b:i});w.css("backgroundColor",m({h:n,s:100,b:i}));d.find(".minicolors-grid-inner").css("opacity",r/100);break;case"brightness":n=p(parseInt(N.x*(360/b.width())),0,360);r=p(100-Math.floor(N.y*(100/b.height())),0,100);i=p(100-Math.floor(C.y*(100/w.height())),0,100);u=m({h:n,s:r,b:i});w.css("backgroundColor",m({h:n,s:r,b:100}));d.find(".minicolors-grid-inner").css("opacity",1-i/100);break;default:n=p(360-parseInt(C.y*(360/w.height())),0,360);r=p(Math.floor(N.x*(100/b.width())),0,100);i=p(100-Math.floor(N.y*(100/b.height())),0,100);u=m({h:n,s:r,b:i});b.css("backgroundColor",m({h:n,s:100,b:100}));break}if(v.opacity){s=parseFloat(1-k.y/E.height()).toFixed(2)}else{s=1}e.val(c(u,v.letterCase));if(v.opacity)e.attr("data-opacity",s);y.find("SPAN").css({backgroundColor:u,opacity:s});if(u+s!==e.data("minicolors-lastChange")){e.data("minicolors-lastChange",u+s);if(v.change)v.change.call(e,u,s)}}function a(e,t){var n,r,i,s,o,u,a,f=e.parent(),l=e.data("minicolors-settings"),d=f.find(".minicolors-swatch"),v=f.find(".minicolors-grid"),y=f.find(".minicolors-slider"),b=f.find(".minicolors-opacity-slider"),w=v.find("[class$=-picker]"),E=y.find("[class$=-picker]"),S=b.find("[class$=-picker]");n=c(h(e.val(),true),l.letterCase);if(!n)n=c(h(l.defaultValue,true));r=g(n);if(!t)e.val(n);if(l.opacity){i=e.attr("data-opacity")===""?1:p(parseFloat(e.attr("data-opacity")).toFixed(2),0,1);e.attr("data-opacity",i);d.find("SPAN").css("opacity",i);o=p(b.height()-b.height()*i,0,b.height());S.css("top",o+"px")}d.find("SPAN").css("backgroundColor",n);switch(l.control){case"wheel":u=p(Math.ceil(r.s*.75),0,v.height()/2);a=r.h*Math.PI/180;s=p(75-Math.cos(a)*u,0,v.width());o=p(75-Math.sin(a)*u,0,v.height());w.css({top:o+"px",left:s+"px"});o=150-r.b/(100/v.height());if(n==="")o=0;E.css("top",o+"px");y.css("backgroundColor",m({h:r.h,s:r.s,b:100}));break;case"saturation":s=p(5*r.h/12,0,150);o=p(v.height()-Math.ceil(r.b/(100/v.height())),0,v.height());w.css({top:o+"px",left:s+"px"});o=p(y.height()-r.s*(y.height()/100),0,y.height());E.css("top",o+"px");y.css("backgroundColor",m({h:r.h,s:100,b:r.b}));f.find(".minicolors-grid-inner").css("opacity",r.s/100);break;case"brightness":s=p(5*r.h/12,0,150);o=p(v.height()-Math.ceil(r.s/(100/v.height())),0,v.height());w.css({top:o+"px",left:s+"px"});o=p(y.height()-r.b*(y.height()/100),0,y.height());E.css("top",o+"px");y.css("backgroundColor",m({h:r.h,s:r.s,b:100}));f.find(".minicolors-grid-inner").css("opacity",1-r.b/100);break;default:s=p(Math.ceil(r.s/(100/v.width())),0,v.width());o=p(v.height()-Math.ceil(r.b/(100/v.height())),0,v.height());w.css({top:o+"px",left:s+"px"});o=p(y.height()-r.h/(360/y.height()),0,y.height());E.css("top",o+"px");v.css("backgroundColor",m({h:r.h,s:100,b:100}));break}}function f(t){var n=h(e(t).val(),true),r=b(n),i=e(t).attr("data-opacity");if(!r)return null;if(i!==undefined)e.extend(r,{a:parseFloat(i)});return r}function l(t,n){var r=h(e(t).val(),true),i=b(r),s=e(t).attr("data-opacity");if(!i)return null;if(s===undefined)s=1;if(n){return"rgba("+i.r+", "+i.g+", "+i.b+", "+parseFloat(s)+")"}else{return"rgb("+i.r+", "+i.g+", "+i.b+")"}}function c(e,t){return t==="uppercase"?e.toUpperCase():e.toLowerCase()}function h(e,t){e=e.replace(/[^A-F0-9]/ig,"");if(e.length!==3&&e.length!==6)return"";if(e.length===3&&t){e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]}return"#"+e}function p(e,t,n){if(en)e=n;return e}function d(e){var t={};var n=Math.round(e.h);var r=Math.round(e.s*255/100);var i=Math.round(e.b*255/100);if(r===0){t.r=t.g=t.b=i}else{var s=i;var o=(255-r)*i/255;var u=(s-o)*(n%60)/60;if(n===360)n=0;if(n<60){t.r=s;t.b=o;t.g=o+u}else if(n<120){t.g=s;t.b=o;t.r=s-u}else if(n<180){t.g=s;t.r=o;t.b=o+u}else if(n<240){t.b=s;t.r=o;t.g=s-u}else if(n<300){t.b=s;t.g=o;t.r=o+u}else if(n<360){t.r=s;t.g=o;t.b=s-u}else{t.r=0;t.g=0;t.b=0}}return{r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)}}function v(t){var n=[t.r.toString(16),t.g.toString(16),t.b.toString(16)];e.each(n,function(e,t){if(t.length===1)n[e]="0"+t});return"#"+n.join("")}function m(e){return v(d(e))}function g(e){var t=y(b(e));if(t.s===0)t.h=360;return t}function y(e){var t={h:0,s:0,b:0};var n=Math.min(e.r,e.g,e.b);var r=Math.max(e.r,e.g,e.b);var i=r-n;t.b=r;t.s=r!==0?255*i/r:0;if(t.s!==0){if(e.r===r){t.h=(e.g-e.b)/i}else if(e.g===r){t.h=2+(e.b-e.r)/i}else{t.h=4+(e.r-e.g)/i}}else{t.h=-1}t.h*=60;if(t.h<0){t.h+=360}t.s*=100/255;t.b*=100/255;return t}function b(e){e=parseInt(e.indexOf("#")>-1?e.substring(1):e,16);return{r:e>>16,g:(e&65280)>>8,b:e&255}}e.minicolors={defaultSettings:{animationSpeed:100,animationEasing:"swing",change:null,control:"hue",defaultValue:"",hide:null,hideSpeed:100,inline:false,letterCase:"lowercase",opacity:false,position:"default",show:null,showSpeed:100,swatchPosition:"left",textfield:true,theme:"default"}};e.extend(e.fn,{minicolors:function(i,s){switch(i){case"destroy":e(this).each(function(){n(e(this))});return e(this);case"opacity":if(s===undefined){return e(this).attr("data-opacity")}else{e(this).each(function(){r(e(this).attr("data-opacity",s))});return e(this)};case"rgbObject":return f(e(this),i==="rgbaObject");case"rgbString":case"rgbaString":return l(e(this),i==="rgbaString");case"settings":if(s===undefined){return e(this).data("minicolors-settings")}else{e(this).each(function(){var t=e(this).data("minicolors-settings")||{};n(e(this));e(this).minicolors(e.extend(true,t,s))});return e(this)};case"value":if(s===undefined){return e(this).val()}else{e(this).each(function(){r(e(this).val(s))});return e(this)};case"create":default:if(i!=="create")s=i;e(this).each(function(){t(e(this),s)});return e(this)}}});e(document).on("mousedown.minicolors touchstart.minicolors",function(t){if(!e(t.target).parents().add(t.target).hasClass("minicolors")){s()}}).on("mousedown.minicolors touchstart.minicolors",".minicolors-grid, .minicolors-slider, .minicolors-opacity-slider",function(t){var n=e(this);t.preventDefault();e(document).data("minicolors-target",n);o(n,t,true)}).on("mousemove.minicolors touchmove.minicolors",function(t){var n=e(document).data("minicolors-target");if(n)o(n,t)}).on("mouseup.minicolors touchend.minicolors",function(){e(this).removeData("minicolors-target")}).on("mousedown.minicolors touchstart.minicolors",".minicolors-swatch",function(t){var n=e(this).parent().find(".minicolors-input"),r=n.parent();if(r.hasClass("minicolors-focus")){s(n)}else{i(n)}}).on("focus.minicolors",".minicolors-input",function(t){var n=e(this);if(!n.data("minicolors-initialized"))return;i(n)}).on("blur.minicolors",".minicolors-input",function(t){var n=e(this),r=n.data("minicolors-settings");if(!n.data("minicolors-initialized"))return;n.val(h(n.val(),true));if(n.val()==="")n.val(h(r.defaultValue,true));n.val(c(n.val(),r.letterCase));s(n)}).on("keydown.minicolors",".minicolors-input",function(t){var n=e(this);if(!n.data("minicolors-initialized"))return;switch(t.keyCode){case 9:s();break;case 27:s();n.blur();break}}).on("keyup.minicolors",".minicolors-input",function(t){var n=e(this);if(!n.data("minicolors-initialized"))return;a(n,true)}).on("paste.minicolors",".minicolors-input",function(t){var n=e(this);if(!n.data("minicolors-initialized"))return;setTimeout(function(){a(n,true)},1)})})(jQuery) -------------------------------------------------------------------------------- /scripts/old/jquery.mousewheel.min.js: -------------------------------------------------------------------------------- 1 | /*! Copyright (c) 2013 Brandon Aaron (http://brandonaaron.net) 2 | * Licensed under the MIT License (LICENSE.txt). 3 | * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. 4 | * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. 5 | * Thanks to: Seamus Leahy for adding deltaX and deltaY 6 | * Version: 3.1.3 7 | * Requires: 1.2.2+ 8 | */ 9 | (function(c){"function"===typeof define&&define.amd?define(["jquery"],c):"object"===typeof exports?module.exports=c:c(jQuery)})(function(c){function l(b){var a=b||window.event,g=[].slice.call(arguments,1),d=0,e=0,h=0,f=0,f=0;b=c.event.fix(a);b.type="mousewheel";a.wheelDelta&&(d=a.wheelDelta);a.detail&&(d=-1*a.detail);a.deltaY&&(d=h=-1*a.deltaY);a.deltaX&&(e=a.deltaX,d=-1*e);void 0!==a.wheelDeltaY&&(h=a.wheelDeltaY);void 0!==a.wheelDeltaX&&(e=-1*a.wheelDeltaX);f=Math.abs(d);if(!k||f0},_isInDocument:function(a){while(a=a.parentNode)if(a==document)return!0;return!1},_getXY:function(a){if(this._isNumber(a))return{x:a,y:a};if(this._isArray(a)){if(a.length===1){var b=a[0];if(this._isNumber(b))return{x:b,y:b};if(this._isArray(b))return{x:b[0],y:b[1]};if(this._isObject(b))return b}else if(a.length>=2)return{x:a[0],y:a[1]}}else if(this._isObject(a))return a;return null},_getSize:function(a){if(this._isNumber(a))return{width:a,height:a};if(this._isArray(a))if(a.length===1){var b=a[0];if(this._isNumber(b))return{width:b,height:b};if(this._isArray(b)){if(b.length>=4)return{width:b[2],height:b[3]};if(b.length>=2)return{width:b[0],height:b[1]}}else if(this._isObject(b))return b}else{if(a.length>=4)return{width:a[2],height:a[3]};if(a.length>=2)return{width:a[0],height:a[1]}}else if(this._isObject(a))return a;return null},_getPoints:function(a){if(a===undefined)return[];if(this._isArray(a[0])){var b=[];for(var c=0;c>16&255,g:b>>8&255,b:b&255}},_getRandomColorKey:function(){var a=Math.round(Math.random()*255),b=Math.round(Math.random()*255),c=Math.round(Math.random()*255);return this._rgbToHex(a,b,c)},_merge:function(a,b){var c=this._clone(b);for(var d in a)this._isObject(a[d])?c[d]=this._merge(a[d],c[d]):c[d]=a[d];return c},_clone:function(a){var b={};for(var c in a)this._isObject(a[c])?b[c]=this._clone(a[c]):b[c]=a[c];return b},_degToRad:function(a){return a*Math.PI/180},_radToDeg:function(a){return a*180/Math.PI}}})(); 33 | (function(){var a=document.createElement("canvas"),b=a.getContext("2d"),c=window.devicePixelRatio||1,d=b.webkitBackingStorePixelRatio||b.mozBackingStorePixelRatio||b.msBackingStorePixelRatio||b.oBackingStorePixelRatio||b.backingStorePixelRatio||1,e=c/d;Kinetic.Canvas=function(a,b,c){this.pixelRatio=c||e,this.width=a,this.height=b,this.element=document.createElement("canvas"),this.context=this.element.getContext("2d"),this.setSize(a||0,b||0)},Kinetic.Canvas.prototype={clear:function(){var a=this.getContext(),b=this.getElement();a.clearRect(0,0,b.width,b.height)},getElement:function(){return this.element},getContext:function(){return this.context},setWidth:function(a){this.width=a,this.element.width=a*this.pixelRatio,this.element.style.width=a+"px"},setHeight:function(a){this.height=a,this.element.height=a*this.pixelRatio,this.element.style.height=a+"px"},getWidth:function(){return this.width},getHeight:function(){return this.height},setSize:function(a,b){this.setWidth(a),this.setHeight(b)},toDataURL:function(a,b){try{return this.element.toDataURL(a,b)}catch(c){try{return this.element.toDataURL()}catch(c){return Kinetic.Global.warn("Unable to get data URL. "+c.message),""}}},fill:function(a){a.getFillEnabled()&&this._fill(a)},stroke:function(a){a.getStrokeEnabled()&&this._stroke(a)},fillStroke:function(a){var b=a.getFillEnabled();b&&this._fill(a),a.getStrokeEnabled()&&this._stroke(a,a.hasShadow()&&a.hasFill()&&b)},applyShadow:function(a,b){var c=this.context;c.save(),this._applyShadow(a),b(),c.restore(),b()},_applyLineCap:function(a){var b=a.getLineCap();b&&(this.context.lineCap=b)},_applyOpacity:function(a){var b=a.getAbsoluteOpacity();b!==1&&(this.context.globalAlpha=b)},_applyLineJoin:function(a){var b=a.getLineJoin();b&&(this.context.lineJoin=b)},_applyAncestorTransforms:function(a){var b=this.context;a._eachAncestorReverse(function(a){var c=a.getTransform(),d=c.getMatrix();b.transform(d[0],d[1],d[2],d[3],d[4],d[5])},!0)}},Kinetic.SceneCanvas=function(a,b,c){Kinetic.Canvas.call(this,a,b,c)},Kinetic.SceneCanvas.prototype={setWidth:function(a){var b=this.pixelRatio;Kinetic.Canvas.prototype.setWidth.call(this,a),this.context.scale(b,b)},setHeight:function(a){var b=this.pixelRatio;Kinetic.Canvas.prototype.setHeight.call(this,a),this.context.scale(b,b)},_fillColor:function(a){var b=this.context,c=a.getFill();b.fillStyle=c,a._fillFunc(b)},_fillPattern:function(a){var b=this.context,c=a.getFillPatternImage(),d=a.getFillPatternX(),e=a.getFillPatternY(),f=a.getFillPatternScale(),g=a.getFillPatternRotation(),h=a.getFillPatternOffset(),i=a.getFillPatternRepeat();(d||e)&&b.translate(d||0,e||0),g&&b.rotate(g),f&&b.scale(f.x,f.y),h&&b.translate(-1*h.x,-1*h.y),b.fillStyle=b.createPattern(c,i||"repeat"),b.fill()},_fillLinearGradient:function(a){var b=this.context,c=a.getFillLinearGradientStartPoint(),d=a.getFillLinearGradientEndPoint(),e=a.getFillLinearGradientColorStops(),f=b.createLinearGradient(c.x,c.y,d.x,d.y);for(var g=0;g1?h[1]:"";this.eventListeners[i]||(this.eventListeners[i]=[]),this.eventListeners[i].push({name:j,handler:b})}},off:function(a){var b=a.split(" "),c=b.length;for(var d=0;d1)if(h)this.eventListeners[h]&&this._off(h,g[1]);else for(var e in this.eventListeners)this._off(e,g[1]);else delete this.eventListeners[h]}},remove:function(){var a=this.getParent();a&&a.children&&(a.children.splice(this.index,1),a._setChildrenIndices()),delete this.parent},destroy:function(){var a=this.getParent(),b=this.getStage(),c=Kinetic.DD,d=Kinetic.Global;while(this.children&&this.children.length>0)this.children[0].destroy();d._removeId(this.getId()),d._removeName(this.getName(),this._id),c&&c.node&&c.node._id===this._id&&node._endDrag(),this.trans&&this.trans.stop(),this.remove()},getAttrs:function(){return this.attrs},setDefaultAttrs:function(a){this.attrs===undefined&&(this.attrs={});if(a)for(var b in a)this.attrs[b]===undefined&&(this.attrs[b]=a[b])},setAttrs:function(a){if(a)for(var b in a){var c="set"+b.charAt(0).toUpperCase()+b.slice(1);Kinetic.Type._isFunction(this[c])?this[c](a[b]):this.setAttr(b,a[b])}},getVisible:function(){var a=this.attrs.visible,b=this.getParent();return a&&b&&!b.getVisible()?!1:a},getListening:function(){var a=this.attrs.listening,b=this.getParent();return a&&b&&!b.getListening()?!1:a},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},getZIndex:function(){return this.index},getAbsoluteZIndex:function(){function e(b){var f=[],g=b.length;for(var h=0;h0&&f[0].getLevel()<=a&&e(f)}var a=this.getLevel(),b=this.getStage(),c=this,d=0;return c.nodeType!=="Stage"&&e(c.getStage().getChildren()),d},getLevel:function(){var a=0,b=this.parent;while(b)a++,b=b.parent;return a},setPosition:function(){var a=Kinetic.Type._getXY([].slice.call(arguments));this.setAttr("x",a.x),this.setAttr("y",a.y)},getPosition:function(){var a=this.attrs;return{x:a.x,y:a.y}},getAbsolutePosition:function(){var a=this.getAbsoluteTransform(),b=this.getOffset();return a.translate(b.x,b.y),a.getTranslation()},setAbsolutePosition:function(){var a=Kinetic.Type._getXY([].slice.call(arguments)),b=this._clearTransform();this.attrs.x=b.x,this.attrs.y=b.y,delete b.x,delete b.y;var c=this.getAbsoluteTransform();c.invert(),c.translate(a.x,a.y),a={x:this.attrs.x+c.getTranslation().x,y:this.attrs.y+c.getTranslation().y},this.setPosition(a.x,a.y),this._setTransform(b)},move:function(){var a=Kinetic.Type._getXY([].slice.call(arguments)),b=this.getX(),c=this.getY();a.x!==undefined&&(b+=a.x),a.y!==undefined&&(c+=a.y),this.setPosition(b,c)},_eachAncestorReverse:function(a,b){var c=[],d=this.getParent();b&&c.unshift(this);while(d)c.unshift(d),d=d.parent;var e=c.length;for(var f=0;f0)return this.parent.children.splice(a,1),this.parent.children.splice(a-1,0,this),this.parent._setChildrenIndices(),!0},moveToBottom:function(){var a=this.index;if(a>0)return this.parent.children.splice(a,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0},setZIndex:function(a){var b=this.index;this.parent.children.splice(b,1),this.parent.children.splice(a,0,this),this.parent._setChildrenIndices()},getAbsoluteOpacity:function(){var a=this.getOpacity();return this.getParent()&&(a*=this.getParent().getAbsoluteOpacity()),a},moveTo:function(a){Kinetic.Node.prototype.remove.call(this),a.add(this)},toObject:function(){var a=Kinetic.Type,b={},c=this.attrs;b.attrs={};for(var d in c){var e=c[d];!a._isFunction(e)&&!a._isElement(e)&&(!a._isObject(e)||!a._hasMethods(e))&&(b.attrs[d]=e)}return b.nodeType=this.nodeType,b.shapeType=this.shapeType,b},toJSON:function(){return JSON.stringify(this.toObject())},getParent:function(){return this.parent},getLayer:function(){return this.getParent().getLayer()},getStage:function(){return this.getParent()?this.getParent().getStage():undefined},simulate:function(a,b){this._handleEvent(a,b||{})},fire:function(a,b){this._executeHandlers(a,b||{})},getAbsoluteTransform:function(){var a=new Kinetic.Transform;return this._eachAncestorReverse(function(b){var c=b.getTransform();a.multiply(c)},!0),a},getTransform:function(){var a=new Kinetic.Transform,b=this.attrs,c=b.x,d=b.y,e=b.rotation,f=b.scale,g=f.x,h=f.y,i=b.offset,j=i.x,k=i.y;return(c!==0||d!==0)&&a.translate(c,d),e!==0&&a.rotate(e),(g!==1||h!==1)&&a.scale(g,h),(j!==0||k!==0)&&a.translate(-1*j,-1*k),a},clone:function(a){var b=this.shapeType||this.nodeType,c=new Kinetic[b](this.attrs);for(var d in this.eventListeners){var e=this.eventListeners[d],f=e.length;for(var g=0;g0)this.children[0].remove()},add:function(a){var b=Kinetic.Global,c=this.children;return a.index=c.length,a.parent=this,c.push(a),this},get:function(a){var b=new Kinetic.Collection;if(a.charAt(0)==="#"){var c=this._getNodeById(a.slice(1));c&&b.push(c)}else if(a.charAt(0)==="."){var d=this._getNodesByName(a.slice(1));Kinetic.Collection.apply(b,d)}else{var e=[],f=this.getChildren(),g=f.length;for(var h=0;h0},enableFill:function(){this.setAttr("fillEnabled",!0)},disableFill:function(){this.setAttr("fillEnabled",!1)},enableStroke:function(){this.setAttr("strokeEnabled",!0)},disableStroke:function(){this.setAttr("strokeEnabled",!1)},enableShadow:function(){this.setAttr("shadowEnabled",!0)},disableShadow:function(){this.setAttr("shadowEnabled",!1)},enableDashArray:function(){this.setAttr("dashArrayEnabled",!0)},disableDashArray:function(){this.setAttr("dashArrayEnabled",!1)},remove:function(){Kinetic.Node.prototype.remove.call(this),delete Kinetic.Global.shapes[this.colorKey]},drawScene:function(a){var b=this.attrs,c=b.drawFunc,a=a||this.getLayer().getCanvas(),d=a.getContext();c&&this.isVisible()&&(d.save(),a._applyOpacity(this),a._applyLineJoin(this),a._applyAncestorTransforms(this),c.call(this,a),d.restore())},drawHit:function(){var a=this.attrs,b=a.drawHitFunc||a.drawFunc,c=this.getLayer().hitCanvas,d=c.getContext();b&&this.isVisible()&&this.isListening()&&(d.save(),c._applyLineJoin(this),c._applyAncestorTransforms(this),b.call(this,c),d.restore())},_setDrawFuncs:function(){!this.attrs.drawFunc&&this.drawFunc&&this.setDrawFunc(this.drawFunc),!this.attrs.drawHitFunc&&this.drawHitFunc&&this.setDrawHitFunc(this.drawHitFunc)}},Kinetic.Global.extend(Kinetic.Shape,Kinetic.Node),Kinetic.Node.addGettersSetters(Kinetic.Shape,["stroke","lineJoin","lineCap","strokeWidth","drawFunc","drawHitFunc","dashArray","shadowColor","shadowBlur","shadowOpacity","fillPatternImage","fill","fillPatternX","fillPatternY","fillLinearGradientColorStops","fillRadialGradientStartRadius","fillRadialGradientEndRadius","fillRadialGradientColorStops","fillPatternRepeat","fillEnabled","strokeEnabled","shadowEnabled","dashArrayEnabled","fillPriority"]),Kinetic.Node.addPointGettersSetters(Kinetic.Shape,["fillPatternOffset","fillPatternScale","fillLinearGradientStartPoint","fillLinearGradientEndPoint","fillRadialGradientStartPoint","fillRadialGradientEndPoint","shadowOffset"]),Kinetic.Node.addRotationGettersSetters(Kinetic.Shape,["fillPatternRotation"])})(); 39 | (function(){Kinetic.Stage=function(a){this._initStage(a)},Kinetic.Stage.prototype={_initStage:function(a){var b=Kinetic.DD;this.setDefaultAttrs({width:400,height:200}),Kinetic.Container.call(this,a),this._setStageDefaultProperties(),this._id=Kinetic.Global.idCounter++,this._buildDOM(),this._bindContentEvents(),Kinetic.Global.stages.push(this),b&&b._initDragLayer(this)},setContainer:function(a){typeof a=="string"&&(a=document.getElementById(a)),this.setAttr("container",a)},setHeight:function(a){Kinetic.Node.prototype.setHeight.call(this,a),this._resizeDOM()},setWidth:function(a){Kinetic.Node.prototype.setWidth.call(this,a),this._resizeDOM()},clear:function(){var a=this.children;for(var b=0;b=0;d--){var e=c[d];if(e.isVisible()&&e.isListening()){var f=e.hitCanvas.context.getImageData(Math.round(a.x),Math.round(a.y),1,1).data;if(f[3]===255){var g=Kinetic.Type._rgbToHex(f[0],f[1],f[2]);return b=Kinetic.Global.shapes[g],{shape:b,pixel:f}}if(f[0]>0||f[1]>0||f[2]>0||f[3]>0)return{pixel:f}}}return null},_resizeDOM:function(){if(this.content){var a=this.attrs.width,b=this.attrs.height;this.content.style.width=a+"px",this.content.style.height=b+"px",this.bufferCanvas.setSize(a,b,1),this.hitCanvas.setSize(a,b);var c=this.children;for(var d=0;d0&&addLine&&(this.attrs.height===a||lineHeightPx*(d+1)this.attrs.width-padding*2){if(e==0)break;var k=i.lastIndexOf(r),l=i.lastIndexOf(g),m=Math.max(k,l);if(m>=0){f=b.splice(0,1+m).join(h);break}f=b.splice(0,e).join(h);break}e++,e===b.length&&(f=b.splice(0,e).join(h))}this.textWidth=Math.max(this.textWidth,this._getTextSize(f).width),f!==undefined&&(c.push(f),addLine=!0),d++}this.textArr=this._expandTextData(c)}},Kinetic.Global.extend(Kinetic.Text,Kinetic.Shape),Kinetic.Node.addGettersSetters(Kinetic.Text,["fontFamily","fontSize","fontStyle","padding","align","lineHeight"]),Kinetic.Node.addGetters(Kinetic.Text,[k])})(); 44 | (function(){Kinetic.Line=function(a){this._initLine(a)},Kinetic.Line.prototype={_initLine:function(a){this.setDefaultAttrs({points:[],lineCap:"butt"}),Kinetic.Shape.call(this,a),this.shapeType="Line",this._setDrawFuncs()},drawFunc:function(a){var b=this.getPoints(),c=b.length,d=a.getContext();d.beginPath(),d.moveTo(b[0].x,b[0].y);for(var e=1;e").append("" + e + "
") 74 | } 75 | $(".bgcolors").minicolors({ 76 | textfield: !1, 77 | change: function(a, b) { 78 | var g = d.settings("bgcolors"); 79 | g[parseInt(picker)] = a; 80 | d.settings({ 81 | bgcolors: g 82 | }) 83 | }, 84 | show: function() { 85 | picker = $(this).attr("pickerNbr") 86 | }, 87 | position: "top left", 88 | hideSpeed: 0, 89 | showSpeed: 0 90 | }) 91 | } 92 | 93 | function p() { 94 | setCookie(); 95 | $(".errorMsg").hide(); 96 | $(".loginUser").hide(); 97 | $("#sendMsg").html(""); 98 | logged_in && userid ? ($("#mapEmail").val(user), $("#user").text(user), $(".guest").hide(), $(".user").show()) : ($(".user").hide(), $(".guest").show()); 99 | if ("unsaved" == savingState) { 100 | var a = $("#textArea").val(); 101 | (a = a.substring(0, a.indexOf("\n"))) && $("#mapTitle").val(a.replace("\t", "")); 102 | $("#savingStateSaved").hide(); 103 | $("#savingStateViewOnly").hide(); 104 | $("#savingStateUnsaved").show() 105 | } else if ("viewonly" == savingState) $("#savingStateSaved").hide(), $("#savingStateViewOnly").show(), $("#savingStateUnsaved").show(); 106 | else if ("saved" == savingState) $("#savingStateViewOnly").hide(), $("#savingStateUnsaved").hide(), $("#savingStateSaved").show(), w(); 107 | else { 108 | console.log("Unknown saving state."); 109 | return 110 | } 111 | } 112 | 113 | function w() { 114 | if ("unsaved" == savingState || "viewonly" == savingState) { 115 | var a = $("#mapTitle").val(), 116 | g = a && 0 < a.length && " " != a && " " != a; 117 | $("#reminderForT")[0].style.display = 118 | g ? "none" : "inline"; 119 | var c = $("#mapEmail").val(), 120 | h = c && 2 == c.split("@").length && c.lastIndexOf(".") > c.indexOf("@"); 121 | $("#reminderForE")[0].style.display = h ? "none" : "inline"; 122 | if (!g || !h) return !1 123 | } 124 | $(".savingInProgress").show(); 125 | $("#savingFinished").hide(); 126 | g = C(); 127 | a && (g.maptitle = a); 128 | c && (g.email = c); 129 | g.savingState = savingState; 130 | g.viewcode = viewcode; 131 | g.admincode = admincode; 132 | logged_in && (g.userid = userid); 133 | $.ajax({ 134 | url: "saveMap.php", 135 | type: "POST", 136 | data: g, 137 | success: function(a) { 138 | $(".errorMsg").hide(); 139 | $("#savingFinished").show(); 140 | $(".savingInProgress").hide(); 141 | $("#saveMindMapBtn").hide(); 142 | a.status && "OK" == a.status ? (savingState = "saved", admincode = a.admincode, viewcode = a.viewcode, $("#savingStateUnsaved").css("display", "none"), $("#savingStateViewOnly").css("display", "none"), $("#savingStateSaved").css("display", "inline"), $(".savedMapInfo").show(), url = "text2mindmap.com/" + a.admincode, $(".adminLink").html('' + url + ""), url = "text2mindmap.com/" + a.viewcode, $(".viewLink").html('' + url + ""), $("#lastSavedInfo").html(a.lastsaved), hasChanged = !1, $(".saveMsg").hide()) : (console.log("handleSaveResponse(): data.status did not return OK"), y()) 144 | }, 145 | timeout: 3E4, 146 | error: function(a) { 147 | y(a) 148 | } 149 | }) 150 | } 151 | 152 | function y(a) { 153 | $(".errorMsg").show(); 154 | console.log("handleSavingError(): There was an error while saving the file.", a.responseText) 155 | } 156 | 157 | function A() { 158 | d.getImage(function(a) { 159 | s = a; 160 | $("#thumbnailImage")[0].src = s 161 | }, 1); 162 | $("#downloadPNG").html(' Download image'); 163 | $("#downloadPDF").html(' Download PDF'); 164 | return !1 165 | } 166 | 167 | function D(a, g) { 168 | if (1 == g) { 169 | var c = s; 170 | $('
").appendTo("body").submit(); 171 | $("#downloadPNG").html(' Download image') 172 | } else d.getImage(function(g) { 173 | c = g; 174 | $('
').appendTo("body").submit() 176 | }, 2), $("#downloadPDF").html(' Download PDF') 177 | } 178 | 179 | function C() { 180 | var a = {}; 181 | a.text = $("#textArea").val(); 182 | a.font = d.settings("font"); 183 | a.fontColor = d.settings("fontColor"); 184 | a.fontSize = d.settings("fontSize"); 185 | a.lineColor = d.settings("lineColor"); 186 | a.lineWidth = d.settings("lineWidth"); 187 | a.coloringMode = d.settings("coloringMode"); 188 | a.bgcolors = JSON.stringify(d.settings("bgcolors")); 189 | a.positions = 190 | JSON.stringify(d.exportPositions()); 191 | a.showLockIcons = null; 192 | a.lockAfterMoving = d.settings("lockAfterMoving") ? 1 : 0; 193 | a.transform = JSON.stringify(d.settings("transform")); 194 | a.version = 0.4; 195 | return a 196 | } 197 | 198 | function m(a) { 199 | try { 200 | $("#textArea").val(a.text); 201 | var g = { 202 | font: a.font, 203 | fontColor: a.fontColor, 204 | fontSize: parseInt(a.fontSize), 205 | lineColor: a.lineColor, 206 | lineWidth: parseFloat(a.lineWidth), 207 | coloringMode: parseInt(a.coloringMode), 208 | lockAfterMoving: parseInt(a.lockAfterMoving), 209 | bgcolors: JSON.parse(a.bgcolors), 210 | transform: JSON.parse(a.transform) 211 | }; 212 | $(".fontcolor").minicolors("value", g.fontColor); 213 | $(".linecolor").minicolors("value", g.lineColor); 214 | var c = 1 == g.lockAfterMoving ? !0 : !1; 215 | $("#lockAfterMoving").prop("checked", c); 216 | if (1 == g.coloringMode) { 217 | $("#mode1").addClass("active") 218 | $("#mode2").removeClass("active") 219 | } else { 220 | $("#mode1").removeClass("active") 221 | $("#mode2").addClass("active") 222 | } 223 | d.settings(g); 224 | render(!0); 225 | var h = JSON.parse(a.positions); 226 | d.importPositions(h, a.version); 227 | hasChanged = !1; 228 | t = a.text; 229 | $(".saveMsg").hide() 230 | } catch (e) { 231 | alert("Sorry, there was an error while opening the mind map:\n" + 232 | e), render() 233 | } 234 | } 235 | 236 | $(document).ready(function() { 237 | //TODO: 238 | d = new I("stageHolder", { 239 | width: $("#viewer-container").innerWidth(), 240 | height: $("#viewer-container").innerHeight() 241 | }); 242 | hasChanged = !1; 243 | var s = null, 244 | t = "", 245 | l = 0; 246 | $("#textArea").keydown(function(a) { 247 | if (9 == a.which || 13 == a.which) { 248 | a.preventDefault(); 249 | var g = this.selectionStart, 250 | c = this.selectionEnd, 251 | h = $(this).val(), 252 | e = h.lastIndexOf("\n", g - 1) 253 | } 254 | if (9 == a.which) { 255 | if (g <= c) { 256 | lastBreak = h.indexOf("\n", c - 1); 257 | lastBreak < c && (lastBreak = c); 258 | var d = h.substring(e + 1, lastBreak).split("\n"); 259 | nbr = 0; 260 | if (a.shiftKey) { 261 | d.forEach(function(a, b) { 262 | "\t" == a.charAt(0) && (d[b] = a.substring(1, a.length), nbr++) 263 | }); 264 | var f = d.join("\n") 265 | } else f = "\t" + d.join("\n\t"), nbr = d.length; 266 | $(this).val(h.substring(0, e + 1) + f + h.substring(lastBreak, h.length)); 267 | this.selectionStart = a.shiftKey ? g - Math.min(1, nbr) : g + Math.min(1, nbr); 268 | this.selectionEnd = a.shiftKey ? c - nbr : c + nbr 269 | } 270 | } else if (13 == a.which) { 271 | if (a.ctrlKey) return render(); 272 | a = "\n"; 273 | for (c = e; c <= g; c++) 274 | if (f = h.charAt(c), "\t" == f) a += "\t"; 275 | else if (" " != f && "\n" != f) break; 276 | "\n" == a && -1 == e && (a = "\n\t"); 277 | $(this).val(h.substring(0, 278 | g) + a + h.substring(g, h.length)); 279 | this.selectionStart = g + a.length; 280 | this.selectionEnd = g + a.length 281 | } 282 | }); 283 | $.support.style || $("#textArea").resizable({ 284 | handles: "se", 285 | minWidth: 288 286 | }); 287 | $("#indent").on("touchstart click", function(a) { 288 | a.stopPropagation(); 289 | a.preventDefault(); 290 | $("#textArea").trigger(jQuery.Event("keydown", { 291 | which: 9, 292 | shiftKey: !1 293 | })) 294 | }); 295 | $("#outdent").on("touchstart click", function(a) { 296 | a.stopPropagation(); 297 | a.preventDefault(); 298 | $("#textArea").trigger(jQuery.Event("keydown", { 299 | which: 9, 300 | shiftKey: !0 301 | })) 302 | }); 303 | $("#logo").on("touchstart click", function(a) { 304 | a.stopPropagation(); 305 | a.preventDefault(); 306 | n() 307 | }); 308 | $("#showFaq").on("touchstart click", function(a) { 309 | a.stopPropagation(); 310 | a.preventDefault(); 311 | $("#faqMore").show(); 312 | $(this).hide(); 313 | return !1 314 | }); 315 | $("#stageHolder").on("mousewheel", function(e) { 316 | d.zoom(e.originalEvent.wheelDelta); 317 | }); 318 | $("#zoomInBtn").on("touchstart click", function(a) { 319 | a.stopPropagation(); 320 | a.preventDefault(); 321 | d.zoom(120); 322 | return !1 323 | }); 324 | $("#zoomOutBtn").on("touchstart click", function(a) { 325 | a.stopPropagation(); 326 | a.preventDefault(); 327 | d.zoom(-120); 328 | return !1 329 | }); 330 | $("#lockAfterMoving").change(function() { 331 | d.settings({ 332 | lockAfterMoving: $(this).prop("checked") 333 | }) 334 | }); 335 | 336 | $("#coloringMode").change(function(a) { 337 | d.settings({ 338 | coloringMode: $(this).val() 339 | }); 340 | }); 341 | 342 | $("a.fonts").on("touchstart click", function(a) { 343 | d.settings({ 344 | font: $(this).text() 345 | }) 346 | }); 347 | $("a.fontSize").on("mouseover touchstart", function() { 348 | d.settings({ 349 | fontSize: $(this).text() 350 | }) 351 | }); 352 | $(".lineWidth").on("mouseover touchstart", function() { 353 | d.settings({ 354 | lineWidth: $(this).attr("val") 355 | }) 356 | }); 357 | $("input.fontcolor").minicolors({ 358 | textfield: !1, 359 | animationSpeed: 0, 360 | change: function(a, b) { 361 | d.settings({ 362 | fontColor: a 363 | }) 364 | }, 365 | position: "top left", 366 | hideSpeed: 0, 367 | showSpeed: 0 368 | }); 369 | $("input.linecolor").minicolors({ 370 | textfield: !1, 371 | animationSpeed: 0, 372 | change: function(a, b) { 373 | d.settings({ 374 | lineColor: a 375 | }) 376 | }, 377 | position: "top left", 378 | hideSpeed: 0, 379 | showSpeed: 0 380 | }); 381 | $("body").keydown(function(a) { 382 | if (a.ctrlKey || a.metaKey) { 383 | switch (String.fromCharCode(a.which).toLowerCase()) { 384 | case "s": 385 | a.preventDefault(); 386 | p(); 387 | break; 388 | case "d": 389 | a.preventDefault(); 390 | A(); 391 | break; 392 | case "t": 393 | a.preventDefault(), n() 394 | } 395 | 187 == a.which || 107 == a.which ? d.zoom(120) : 189 != a.which && 109 != a.which || d.zoom(-120) 396 | } 397 | }); 398 | $("#mapEmail").keydown(function(a) { 399 | 13 == a.which && w() 400 | }); 401 | $("#signInFromModal").on("touchstart click", function(a) { 402 | a.stopPropagation(); 403 | a.preventDefault(); 404 | $(".user, .guest").hide(); 405 | $(".loginUser").show(); 406 | return !1 407 | }); 408 | $("#signInBtn").on("touchstart click", function(a) { 409 | setCookie() 410 | }); 411 | $("#signOutFromModal").on("touchstart click", function(a) { 412 | a.stopPropagation(); 413 | a.preventDefault(); 414 | $.get("index.php/user/signout/0", function() { 415 | userid = user = logged_in = !1; 416 | p() 417 | }); 418 | return !1 419 | }); 420 | $("#signInFromModalForm").submit(function(a) { 421 | $("#signInMsg").hide(); 422 | a.preventDefault(); 423 | a = $("#signInFromModalForm .user_username").val(); 424 | var g = $("#signInFromModalForm .user_password").val(); 425 | a && g ? $.ajax({ 426 | type: "POST", 427 | url: "index.php/user/signin", 428 | data: $("#signInFromModalForm").serialize(), 429 | success: function(a) { 430 | "0" != a && 0 != a && a ? (a = JSON.parse(a), userid = a.userid, user = a.user, 431 | logged_in = 1, p()) : $("#signInMsg").text("Sorry, wrong email/password combination").show() 432 | }, 433 | error: function() { 434 | $("#signInMsg").text("Sorry, there seems to be a technical problem.").show() 435 | } 436 | }) : $("#signInMsg").text("Please provide your email and password to sign in").show(); 437 | return !1 438 | }); 439 | $("#saveAsGuestLink").on("touchstart click", function(a) { 440 | a.stopPropagation(); 441 | a.preventDefault(); 442 | $(".loginUser, .user").hide(); 443 | $(".guest").show() 444 | }); 445 | $("#saveBtn, .saveBtn").on("touchstart click", function(a) { 446 | a.stopPropagation(); 447 | a.preventDefault(); 448 | p(); 449 | return !1 450 | }); 451 | $("#saveMindMapBtn").on("touchstart click", function(a) { 452 | a.stopPropagation(); 453 | a.preventDefault(); 454 | w(); 455 | return !1 456 | }); 457 | $("#mindmap-lock-all").on("touchstart click", function(a) { 458 | a.stopPropagation(); 459 | a.preventDefault(); 460 | d.setNodeLocks(!0); 461 | return !1 462 | }); 463 | $("#mindmap-unlock-all").on("touchstart click", function(a) { 464 | a.stopPropagation(); 465 | a.preventDefault(); 466 | d.setNodeLocks(!1); 467 | return !1 468 | }); 469 | $("#helpBtn").on("touchstart click", function(a) { 470 | a.stopPropagation(); 471 | a.preventDefault(); 472 | return !1 473 | }); 474 | $("#newBtn, .newBtn").on("touchstart click", function(a) { 475 | a.stopPropagation(); 476 | a.preventDefault(); 477 | hasChanged && !1 == confirm("Create a new mind map without saving this one first?") ? a = void 0 : ($("#textArea").val(""), d.clear(), savingState = "unsaved", viewcode = admincode = "", hasChanged = !1, $(".saveMsg").hide(), $.cookie("current-mindmap", !1, { 478 | expires: -1 479 | }), a = !1); 480 | return a 481 | }); 482 | $("#downloadBtn").on("touchstart click", function(a) { 483 | a.stopPropagation(); 484 | a.preventDefault(); 485 | return A() 486 | }); 487 | $("#downloadPNG").on("touchstart click", 488 | function(a) { 489 | a.stopPropagation(); 490 | a.preventDefault(); 491 | $("#downloadPNG").append(" "); 492 | D("downloadPNG.php", 1) 493 | }); 494 | $("#downloadPDF").on("touchstart click", function(a) { 495 | a.stopPropagation(); 496 | a.preventDefault(); 497 | $("#downloadPDF").append(" "); 498 | D("downloadPDF.php", 2) 499 | }); 500 | $("#feedbackBtn").on("touchstart click", function(a) { 501 | a.stopPropagation(); 502 | a.preventDefault(); 503 | $("#sendFeedbackMsg").html("Sending... "); 504 | $.ajax({ 505 | url: "sendFeedback.php", 506 | data: { 507 | msg: $("#fm").val(), 508 | val: $("#fe").val(), 509 | admincode: admincode, 510 | viewcode: viewcode 511 | }, 512 | timeout: 3E4, 513 | success: function() { 514 | $("#sendFeedbackMsg").html("Sent. Thank you for your feedback.") 515 | } 516 | }); 517 | return !1 518 | }); 519 | $("#sendMailBtn").on("touchstart click", function(a) { 520 | $("#sendMsg").html("Sending... "); 521 | a.stopPropagation(); 522 | a.preventDefault(); 523 | $.ajax({ 524 | url: "sendMail.php", 525 | data: { 526 | address: $("#sendEmailMail").val(), 527 | admincode: admincode, 528 | viewcode: viewcode 529 | }, 530 | timeout: 3E4, 531 | success: function() { 532 | $("#sendMsg").html(" Sent") 533 | }, 534 | error: function() { 535 | $("#sendMsg").html(" Sorry, there seem to be a technical problem. Please try again later.") 536 | } 537 | }); 538 | return !1 539 | }); 540 | $("#sendReminderBtn").on("touchstart click", function(a) { 541 | $("#sendReminderMsg").html("Sending... "); 542 | a.stopPropagation(); 543 | a.preventDefault(); 544 | $.ajax({ 545 | url: "sendReminder.php", 546 | data: { 547 | email: $("#forgot_e").val() 548 | }, 549 | timeout: 3E4, 550 | success: function() { 551 | $("#sendReminderMsg").html("Email sent.") 552 | }, 553 | error: function() { 554 | $("#sendReminderMsg").html(" Error: Please try again later.") 555 | } 556 | }); 557 | return !1 558 | }); 559 | $("#toggle1").on("touchstart click", function(a) { 560 | $("#toggle1").removeClass("toggleInactive").addClass("toggleActive"); 561 | $("#toggle2").removeClass("toggleActive").addClass("toggleInactive"); 562 | $("#tab2").removeClass("active"); 563 | $("#tab1").addClass("active"); 564 | a.preventDefault() 565 | }); 566 | $("#toggle2").on("touchstart click", function(a) { 567 | $("#toggle2").removeClass("toggleInactive").addClass("toggleActive"); 568 | $("#toggle1").removeClass("toggleActive").addClass("toggleInactive"); 569 | $("#tab1").removeClass("active"); 570 | $("#tab2").addClass("active"); 571 | a.preventDefault() 572 | }); 573 | $("#drawBtn").on("touchstart click", function(a) { 574 | a.stopPropagation(); 575 | a.preventDefault(); 576 | render(); 577 | var g; 578 | $("#textArea").val() == t ? ($("#holder").popover({ 579 | content: "No changes have been made
Indent text using the TAB key on your keyboard, then draw again.", 580 | html: !0, 581 | trigger: "manual", 582 | delay: { 583 | show: 200, 584 | hide: 500 585 | } 586 | }).popover("show"), clearTimeout(g), g = setTimeout(function() { 587 | $("#holder").popover("destroy") 588 | }, 589 | 2200)) : t = $("#textArea").val() 590 | }); 591 | x = $("#textArea").val().indexOf("\n", $("#textArea").val().indexOf("\n") + 1); 592 | this.setSelectionRange && $("#textArea")[0].setSelectionRange(x, x); 593 | setCookie = function() { 594 | if ("error404" != viewcode) { 595 | var a = C(); 596 | a && ($.cookie("current-mindmap", JSON.stringify(a), { 597 | expires: 1 598 | }), $(".saveMsg").show()); 599 | a = new Date; 600 | a.setTime(a.getTime() + 6E5); 601 | $.cookie("timestamp", "1", { 602 | expires: a 603 | }) 604 | } 605 | }; 606 | }); 607 | 608 | var I = function(q, r) { 609 | function n(a, g, c) { 610 | c = "undefined" == typeof c ? !1 : c; 611 | var h = l.getTransform().m; 612 | if (c) return { 613 | x: (a - h[4]) / h[0], 614 | y: (g - h[5]) / h[3] 615 | }; 616 | c = $("#" + q).offset(); 617 | return { 618 | x: (a - c.left - h[4]) / h[0], 619 | y: (g - c.top - h[5]) / h[3] 620 | } 621 | } 622 | var e = { 623 | bgcolors: "#3f3a3a #2365ba #16c75e #ff481c #ffa81c #365C8E #31975A #C2583F #C2903F #9d9d9d".split(" "), 624 | coloringMode: 2, 625 | fontSize: 20, 626 | fontMinSize: 11, 627 | font: "Helvetica, Verdana, sans-serif", 628 | fontColor: "#ffffff", 629 | lineColor: "#cccccc", 630 | lineWidth: 1.5, 631 | scale: 1, 632 | lockAfterMoving: !0, 633 | linkLength: 80, 634 | friction: 0.9, 635 | charge: 1600, 636 | width: 400, 637 | height: 400, 638 | gravity: 0.1 639 | }, 640 | e = $.extend({}, e, r), 641 | p = [], 642 | w = 0, 643 | y = "", 644 | A = 0, 645 | D = 0, 646 | C, m = !1, 647 | x = !1, 648 | f, d = { 649 | nodes: [], 650 | links: [] 651 | }, 652 | s = 0, 653 | t = 0, 654 | l = new Kinetic.Layer, 655 | v = new Kinetic.Stage({ 656 | container: q, 657 | width: e.width, 658 | height: e.height 659 | }); 660 | v.add(l); 661 | var B = document.getElementById(q), 662 | z = $("#" + q); 663 | z.on("touchstart mousedown", function(a) { 664 | m || (x = !0, $(window).on("touchmove mousemove", function(a) { 665 | a.stopPropagation(); 666 | a.preventDefault(); 667 | s && t || (s = a.pageX || a.originalEvent.touches[0].pageX || a.originalEvent.changedTouches[0].pageX, t = a.pageY || a.originalEvent.touches[0].pageY || a.originalEvent.changedTouches[0].pageY); 668 | var b = a.pageX || a.originalEvent.touches[0].pageX || a.originalEvent.changedTouches[0].pageX; 669 | a = a.pageY || a.originalEvent.touches[0].pageY || a.originalEvent.changedTouches[0].pageY; 670 | l.move(b - s, a - t); 671 | s = b; 672 | t = a; 673 | l.draw() 674 | })); 675 | a.stopPropagation(); 676 | a.preventDefault() 677 | }); 678 | z.on("touchmove mousemove", function(a) { 679 | m && (a = n(a.pageX || 680 | a.originalEvent.targetTouches[0].pageX, a.pageY || a.originalEvent.targetTouches[0].pageY), m.x = a.x + C.x, m.y = a.y + C.y, m.px = m.x, m.py = m.y, 0.02 > f.alpha() && f.alpha(0.025)) 681 | }); 682 | $(window).on("mouseup touchend", function(a) { 683 | x && ($(window).unbind("touchmove mousemove"), x = !1); 684 | m && !1 !== m.data.parent && (m.fixed = e.lockAfterMoving); 685 | t = s = m = !1; 686 | a.stopPropagation(); 687 | a.preventDefault() 688 | }); 689 | return that = { 690 | settings: function(a, g, c) { 691 | g = "undefined" == typeof g ? !0 : g; 692 | if ("object" == typeof a) { 693 | e = $.extend({}, e, a); 694 | if ("undefined" != typeof a.scale) { 695 | if (f) { 696 | var h = 697 | f.alpha(); 698 | f.stop() 699 | } 700 | c = l.getScale().x; 701 | var d = a.scale; 702 | l.setScale(d); 703 | l.move(0.5 * e.width * (c - d), 0.5 * e.height * (c - d)); 704 | f && f.alpha(h) 705 | } 706 | if ("undefined" != typeof a.height || "undefined" != typeof a.width) f && f.stop(), v.setHeight(e.height), v.setWidth(e.width), f && f.alpha(0.02); 707 | "undefined" != typeof a.transform && (h = a.transform, l.move(h[4], h[5]), l.setScale(h[0], h[3])); 708 | if ("undefined" != typeof a.linkLength || "undefined" != typeof a.charge || "undefined" != typeof a.friction || "undefined" != typeof a.gravity) { 709 | if (!f) return; 710 | f.linkDistance(e.linkLength); 711 | f.charge(-e.charge); 712 | f.friction(e.friction); 713 | f.gravity(e.gravity) 714 | } 715 | } else if ("string" == typeof a) return "transform" == a ? l.getTransform().m : e[a]; 716 | g && that.redrawAll() 717 | }, 718 | stopForce: function() { 719 | f && f.stop() 720 | }, 721 | execute: function(a, g) { 722 | f && f.stop(); 723 | that.text2mindmap(a); 724 | !0 !== g && (hasChanged = !0, $(".saveMsg").show()); 725 | f ? f.start() : f = d3.layout.force().linkDistance(e.linkLength).charge(-e.charge).friction(e.friction).theta(0.99).gravity(e.gravity).size([e.width, e.height]).nodes(d.nodes).links(d.links).start().on("tick", function() { 726 | var a = 727 | f.alpha(); 728 | 0.011 > a && f.alpha(0.8 * a); 729 | that.redraw() 730 | }).on("end", function() { 731 | setCookie() 732 | }) 733 | }, 734 | getImage: function(a, b) { 735 | f.stop(); 736 | var c = that.getBoundingBox(20), 737 | h = 1 == b ? 1 : 2736 / c.width > 1889 / c.height ? 1889 / c.height : 2736 / c.width, 738 | d = l.clone(), 739 | e = l.getScale().x, 740 | u = n(0, 0, !0); 741 | d.move(u.x * e, u.y * e); 742 | d.move(-c.left, -c.top); 743 | d.setScale(1); 744 | var k = new Kinetic.Stage({ 745 | container: "hiddenStage", 746 | width: c.width * h, 747 | height: c.height * h 748 | }); 749 | k.add(d); 750 | k.setScale(h); 751 | d.draw(); 752 | that.fillLayerBackground(d, "#FFFFFF"); 753 | k.toDataURL({ 754 | mimeType: "image/jpeg", 755 | quality: 1, 756 | callback: function(b) { 757 | a(b); 758 | d.remove(); 759 | k.remove() 760 | } 761 | }) 762 | }, 763 | computeLayoutOffline: function(a) { 764 | f.start(); 765 | for (var b = 0; b < a; b++) f.tick(); 766 | f.stop() 767 | }, 768 | fillLayerBackground: function(a, b) { 769 | var c = a.getCanvas(), 770 | h = a.getContext(); 771 | h.save(); 772 | h.globalCompositeOperation = "destination-over"; 773 | h.setTransform(1, 0, 0, 1, 0, 0); 774 | h.fillStyle = "#FFFFFF"; 775 | h.fillRect(0, 0, c.width, c.height); 776 | h.restore() 777 | }, 778 | clear: function() { 779 | l.removeChildren(); 780 | d.nodes = d = { 781 | nodes: [], 782 | links: [] 783 | }; 784 | f = !1; 785 | y = ""; 786 | that.execute("") 787 | }, 788 | getBranches: function() { 789 | return A 790 | }, 791 | getLevels: function() { 792 | return D 793 | }, 794 | zoom: function(a) { 795 | if (0 < a && 1 > l.getScale().x) a = Math.min(1, 1.1 * l.getScale().x), that.settings({ 796 | scale: a 797 | }); 798 | else { 799 | var b = 23 / Math.pow(0.8, 3); 800 | if (!(0 > a && e.fontSize <= e.fontMinSize || 0 < a && e.fontSize >= b || !1 == f)) { 801 | f.stop(); 802 | var c = 0 < a ? 1 : -1; 803 | d.nodes.forEach(function(a) { 804 | a.x += 0.2 * (a.x - 0.5 * v.getWidth()) * c; 805 | a.y += 0.2 * (a.y - 0.5 * v.getHeight()) * c; 806 | a.px = a.x; 807 | a.py = a.y 808 | }); 809 | a = 0 > a ? { 810 | fontSize: Math.max(e.fontMinSize, 0.8 * e.fontSize), 811 | linkLength: Math.max(20, 0.7 * e.linkLength), 812 | charge: Math.max(230, 0.6 * e.charge), 813 | friction: Math.max(0.87, e.friction - 0.01), 814 | gravity: Math.max(0.025, e.gravity - 0.015) 815 | } : { 816 | fontSize: Math.min(23 / Math.pow(0.8, 3), e.fontSize / 0.8), 817 | linkLength: Math.min(80 / Math.pow(0.7, 3), e.linkLength / 0.7), 818 | charge: Math.min(1700 / Math.pow(0.6, 3), e.charge / 0.6), 819 | friction: Math.min(0.9, e.friction + 0.01), 820 | gravity: Math.min(0.1, e.gravity + 0.015) 821 | }; 822 | that.settings(a); 823 | f.start() 824 | } 825 | } 826 | }, 827 | getBoundingBox: function(a) { 828 | a || (a = 0); 829 | for (var b = 9999, c = 9999, d = -9999, e = -9999, f = l.getChildren(), u = 0; u < f.length; u++) { 830 | var k = f[u]; 831 | if ("Group" == k.nodeType) { 832 | var E = 0.5 * k.children[0].attrs.width, 833 | F = 0.5 * k.children[0].attrs.height; 834 | k.attrs.x - E < c && (c = k.attrs.x - E); 835 | k.attrs.y - F < b && (b = k.attrs.y - F); 836 | k.attrs.x + E > d && (d = k.attrs.x + E); 837 | k.attrs.y + F > e && (e = k.attrs.y + F) 838 | } 839 | } 840 | return { 841 | left: c - a, 842 | right: d + a, 843 | top: b - a, 844 | bottom: e + a, 845 | width: d - c + 2 * a, 846 | height: e - b + 2 * a 847 | } 848 | }, 849 | addNode: function(a, b) { 850 | f && f.stop(); 851 | var c = { 852 | id: w++, 853 | fixed: b.fixed, 854 | x: b.x, 855 | y: b.y, 856 | data: b 857 | }; 858 | d.nodes.splice(a, 0, c); 859 | return c 860 | }, 861 | addLink: function(a, b) { 862 | d.links.push({ 863 | source: a, 864 | target: b, 865 | data: { 866 | color: e.lineColor, 867 | weight: e.lineWidth, 868 | label: a.data.linkLabel 869 | } 870 | }) 871 | }, 872 | findNode: function(a) { 873 | for (var b = 0; b < d.nodes.length; b++) 874 | if (parseInt(d.nodes[b].id) == 875 | parseInt(a)) return d.nodes[b]; 876 | return !1 877 | }, 878 | getLinksFrom: function(a) { 879 | var b = []; 880 | d.links.forEach(function(c) { 881 | c.source.id == a.id && b.push(c) 882 | }); 883 | return b 884 | }, 885 | getLinksTo: function(a) { 886 | var b = []; 887 | d.links.forEach(function(c) { 888 | c.target.id == a.id && b.push(c) 889 | }); 890 | return b 891 | }, 892 | isLinkedTo: function(a, b) { 893 | for (var c = 0; c < d.links.length; c++) 894 | if (d.links[c].source.id == a.id && d.links[c].target.id == b.id) return !0; 895 | return !1 896 | }, 897 | removeLink: function(a) { 898 | d.links.forEach(function(b, c) { 899 | b == a && (b.ui && b.ui.remove(), d.links.splice(c, 1)) 900 | }) 901 | }, 902 | setNodeLocks: function(a) { 903 | d.nodes.forEach(function(b) { 904 | b.data.parent && 905 | (b.fixed = a) 906 | }); 907 | f && !1 == a && f.resume() 908 | }, 909 | removeNode: function(a) { 910 | f && f.stop(); 911 | var b = d.nodes[a]; 912 | b ? (that.getLinksFrom(b).forEach(function(a) { 913 | that.removeLink(a) 914 | }), that.getLinksTo(b).forEach(function(a) { 915 | that.removeLink(a) 916 | }), "undefined" != typeof b && b.ui.remove(), d.nodes.splice(a, 1)) : console.log("Could node find node with pos:" + a + "\n\n" + JSON.stringify(d.nodes)) 917 | }, 918 | setStartPosition: function(a) { 919 | if (!1 == a.data.parent) return a.x = 0.5 * e.width, a.y = 0.5 * e.height, a.px = a.x, a.py = a.y, a; 920 | a.x = a.data.parent.x; 921 | a.y = a.data.parent.y; 922 | var b = a.data.parent.data.children; 923 | b || (b = 4); 924 | p[a.data.parent.id] || (p[a.data.parent.id] = 1); 925 | var c = p[a.data.parent.id]++, 926 | b = 135 + 360 / b * c, 927 | c = Math.max(60, 150 - 30 * a.data.level); 928 | a.x += Math.round(c * Math.cos(b / 360 * 2 * Math.PI) + 10 * Math.random()); 929 | a.y += Math.round(c * Math.sin(b / 360 * 2 * Math.PI) + 10 * Math.random()); 930 | a.px = a.x; 931 | a.py = a.y; 932 | return a 933 | }, 934 | redrawAll: function() { 935 | d.nodes.forEach(function(a) { 936 | a.data = that.setTheme(a.data); 937 | a.data.redraw = !0 938 | }); 939 | d.links.forEach(function(a) { 940 | a.data.color = e.lineColor; 941 | a.data.weight = e.lineWidth; 942 | a.data.redraw = !0 943 | }); 944 | that.redraw() 945 | }, 946 | redraw: function() { 947 | d.links.forEach(function(a) { 948 | a.ui && !a.data.redraw ? a.ui.setPoints([a.source, a.target]) : (a.ui && a.ui.remove(), a.ui = that.newLine(a, a.source, a.target), l.add(a.ui), a.ui.moveToBottom(), a.data.redraw = !1) 949 | }); 950 | d.nodes.forEach(function(a) { 951 | a.ui && !a.data.redraw ? a.ui.setPosition(a.x, a.y) : (a.ui && a.ui.remove(), a.ui = that.newGroup(a), l.add(a.ui), a.data.redraw = !1) 952 | }); 953 | l.draw() 954 | }, 955 | newLine: function(a, b, c) { 956 | if (a.data.label) { 957 | var d = c.x - b.x; 958 | c = c.y - b.y; 959 | var e = new Kinetic.Line({ 960 | points: [{ 961 | x: 0, 962 | y: 0 963 | }, { 964 | x: d, 965 | y: c 966 | }], 967 | stroke: a.data.color, 968 | strokeWidth: a.data.weight 969 | }), 970 | f = new Kinetic.Text({ 971 | text: a.data.label, 972 | fontSize: 11, 973 | fontFamily: "Arial", 974 | fill: "#666", 975 | x: 0.5 * d - 50, 976 | y: 0.5 * c - 6, 977 | width: 100, 978 | align: "center" 979 | }), 980 | u = new Kinetic.Group({ 981 | x: b.x, 982 | y: b.y 983 | }); 984 | u.add(e); 985 | u.add(f); 986 | u.setPoints = function(a) { 987 | var b = a[1].x - a[0].x, 988 | c = a[1].y - a[0].y; 989 | e.setPoints([{ 990 | x: 0, 991 | y: 0 992 | }, { 993 | x: b, 994 | y: c 995 | }]); 996 | f.setPosition(0.5 * b - 50, 0.5 * c - 6); 997 | u.setPosition(a[0].x, a[0].y) 998 | }; 999 | return u 1000 | } 1001 | return new Kinetic.Line({ 1002 | points: [b, c], 1003 | stroke: a.data.color, 1004 | strokeWidth: a.data.weight 1005 | }) 1006 | }, 1007 | newGroup: function(a) { 1008 | var b = 1009 | new Kinetic.Group({ 1010 | x: a.x, 1011 | y: a.y 1012 | }), 1013 | c = that.newText(a), 1014 | d = c.getWidth(), 1015 | e = c.getHeight(); 1016 | c.setPosition(-0.5 * d, -0.5 * e); 1017 | d = that.newRect(a, d, e); 1018 | b.add(d); 1019 | b.add(c); 1020 | b.on("touchstart mousedown", function(b) { 1021 | b.stopPropagation(); 1022 | b.preventDefault(); 1023 | m = a; 1024 | m.fixed = !0; 1025 | var c = n(b.pageX || b.originalEvent.targetTouches[0].pageX, b.pageY || b.originalEvent.targetTouches[0].pageY); 1026 | C = { 1027 | x: m.x - c.x, 1028 | y: m.y - c.y 1029 | }; 1030 | b.preventDefault() 1031 | }); 1032 | return b 1033 | }, 1034 | newRect: function(a, b, c) { 1035 | return new Kinetic.Rect({ 1036 | x: -0.5 * b - 1, 1037 | y: -0.5 * c, 1038 | width: b + 2, 1039 | height: c, 1040 | cornerRadius: 2, 1041 | fill: a.data.color, 1042 | opacity: 1, 1043 | shadowColor: "#999", 1044 | shadowBlur: 2, 1045 | shadowOffset: 2, 1046 | shadowOpacity: 0.5 1047 | }) 1048 | }, 1049 | newText: function(a) { 1050 | var g = new Kinetic.Text({ 1051 | x: 0, 1052 | y: 0, 1053 | text: a.data.label, 1054 | fontSize: a.data.fontSize, 1055 | fontFamily: a.data.font, 1056 | fill: a.data.fontColor, 1057 | padding: 10 - Math.min(a.data.level*3, 5), 1058 | align: "center" 1059 | }), 1060 | c = that.maxTextWidth(a); 1061 | g.getWidth() > c && g.setAttrs({ 1062 | width: c 1063 | }); 1064 | g.on("mouseover", function() { 1065 | B.style.cursor = "pointer"; 1066 | for (var c = d.nodes.indexOf(a), g = $("#textArea").val().split(/\n/), e = -1, f = 0; f <= c; f++) e += g[f].length + 1; - 1 != e && "undefined" != typeof e && (f = $("#textArea")[0], g = e, f.setSelectionRange ? (f.focus(), f.setSelectionRange(g, e)) : f.createTextRange && (f = f.createTextRange(), f.collapse(!0), f.moveEnd("character", e), f.moveStart("character", g), f.select()), e = $("#textArea"), g = parseInt(e.css("line-height")), e.scrollTop(c * g)) 1067 | }); 1068 | g.on("mouseout", function() { 1069 | m || (B.style.cursor = "move") 1070 | }); 1071 | return g 1072 | }, 1073 | maxTextWidth: function(a) { 1074 | return (new Kinetic.Text({ 1075 | text: "MMMMMMMMMMMMMMMMMMMM", 1076 | fontSize: a.data.fontSize, 1077 | fontFamily: a.data.font 1078 | })).getWidth() 1079 | }, 1080 | findParent: function(a, b, c) { 1081 | if (0 == b) return !1; 1082 | for (a = c[b]; 0 <= b; b--) 1083 | if (0 < b && (c[b] < a || 0 == b)) return b; 1084 | return 0 1085 | }, 1086 | hashCode: function(a) { 1087 | var b = 0; 1088 | if (0 == a.length) return b; 1089 | for (i = 0; i < a.length; i++) var c = a.charCodeAt(i), 1090 | b = (b << 5) - b + c; 1091 | return b 1092 | }, 1093 | exportPositions: function() { 1094 | var a = []; 1095 | d.nodes.forEach(function(b, c) { 1096 | var e = parseFloat(b.x).toFixed(2), 1097 | d = parseFloat(b.y).toFixed(2); 1098 | a.push({ 1099 | i: c, 1100 | x: e, 1101 | y: d, 1102 | f: b.fixed 1103 | }) 1104 | }); 1105 | return a 1106 | }, 1107 | importPositions: function(a, b) { 1108 | f && f.stop(); 1109 | if (0.2 >= parseFloat(b)) { 1110 | var c = [], 1111 | e = []; 1112 | d.nodes.forEach(function(b) { 1113 | c[b.data.level] ? 1114 | c[b.data.level]++ : c[b.data.level] = 1; 1115 | var d = b.data.parent ? b.data.parent.data.oldId : !1, 1116 | g = e[d] + "-" + c[b.data.level], 1117 | d = that.hashCode(b.data.label + "_" + (d ? e[d] : void 0) + "_" + b.data.branch + "_" + b.data.level + "_" + d); 1118 | b.data.oldId = d; 1119 | e[d] = g; 1120 | for (var g = v.getWidth(), d = v.getHeight(), f = 0; f < a.length; f++) { 1121 | var k = a[f]; 1122 | if (b.data.oldId == k.id) { 1123 | b.x = 0.5 * g + k.x / 22 * g; 1124 | b.y = 0.5 * d + k.y / 22 * d; 1125 | b.px = b.x; 1126 | b.py = b.y; 1127 | b.fixed = k.locked; 1128 | break 1129 | } 1130 | } 1131 | }) 1132 | } else 1133 | for (var l = 0; l < a.length; l++) { 1134 | var m = a[l], 1135 | u = 0.4 <= b ? m.f : m.fixed, 1136 | k = d.nodes[0.4 <= b ? m.i : m.lineNbr]; 1137 | k && (k.x = 1138 | parseFloat(m.x), k.y = parseFloat(m.y), k.px = k.x, k.py = k.y, k.fixed = u) 1139 | } 1140 | f && f.alpha(0.025) 1141 | }, 1142 | text2mindmap: function(a) { 1143 | var b = a.split(/\n/).filter(function(a) { 1144 | return a.match(/\S/) 1145 | }), 1146 | b = b.join("\n"); 1147 | a = difflib.stringAsLines(b); 1148 | for (var c = difflib.stringAsLines(y), e = (new difflib.SequenceMatcher(c, a)).get_opcodes(), f = 0, m = 0, l = 0; l < e.length; l++) 1149 | for (var k = e[l], n = k[0], q = k[1], r = k[2], p = k[3], k = k[4], x = Math.max(r - q, k - p), v = 0; v < x; v++) { 1150 | if ("delete" == n || "replace" == n && p == k) { 1151 | var s = q - f + m; 1152 | that.removeNode(s); 1153 | f++ 1154 | } else if ("insert" == n || 1155 | "replace" == n && q == r || "replace" == n && !c[q]) { 1156 | var s = p, 1157 | t = H(a[s]); 1158 | that.addNode(s, { 1159 | label: t.label, 1160 | linkLabel: t.linkLabel, 1161 | fixed: 0 == s, 1162 | children: 0 1163 | }); 1164 | m++ 1165 | } else "replace" == n && (s = q, t = H(a[p]), d.nodes[s].data.label = t.label, d.nodes[s].data.linkLabel = t.linkLabel); 1166 | q = q < r ? q + 1 : q; 1167 | p = p < k ? p + 1 : p 1168 | } 1169 | var w = [], 1170 | z = []; 1171 | A = 0; 1172 | a.forEach(function(a, c) { 1173 | w[c] = G(a); 1174 | z[c] = that.findParent(b, c, w); 1175 | w[c] > D && D++ 1176 | }); 1177 | d.nodes.forEach(function(a, b) { 1178 | a.data.branch = 1 == w[b] ? ++A : A; 1179 | a.data.level = w[b]; 1180 | a.data.parent = 0 == b ? !1 : d.nodes[z[b]]; 1181 | a.data = that.setTheme(a.data); 1182 | a.data.redraw = !0; 1183 | a.data.parent && !that.isLinkedTo(a, a.data.parent) && (a.data.parent.data.children++, that.getLinksFrom(a).forEach(function(a) { 1184 | that.removeLink(a) 1185 | }), that.addLink(a, a.data.parent)); 1186 | var c = that.getLinksFrom(a); 1187 | (c = c[0]) && c.data.label != a.data.linkLabel && (c.data.label = a.data.linkLabel, c.data.redraw = !0) 1188 | }); 1189 | d.nodes.forEach(function(a, b) { 1190 | "undefined" == typeof a.x && that.setStartPosition(a) 1191 | }); 1192 | y = b 1193 | }, 1194 | setTheme: function(a) { 1195 | a.font = e.font; 1196 | a.fontColor = e.fontColor ? e.fontColor : "#fff"; 1197 | a.fontSize = Math.max(e.fontMinSize, Math.round(e.fontSize * 1198 | (1 - 0.17 * a.level))); 1199 | a.color = 1 == e.coloringMode ? a.level >= e.bgcolors.length ? e.bgcolors[e.bgcolors.length - 1] : e.bgcolors[a.level] : a.branch >= e.bgcolors.length ? e.bgcolors[e.bgcolors.length - 1] : e.bgcolors[a.branch]; 1200 | if ("undefined" == typeof a.color || null == a.color) a.color = "#eeeeee"; 1201 | var b; 1202 | var c = a.color; 1203 | if (c) { 1204 | c = c.replace(/^\s*#|\s*$/g, ""); 1205 | 3 == c.length && (c = c.replace(/(.)/g, "$1$1")); 1206 | b = parseInt(c.substr(0, 2), 16); 1207 | var d = parseInt(c.substr(2, 2), 16), 1208 | c = parseInt(c.substr(4, 2), 16); 1209 | b = "#" + (0 | 256 + b + 10 * (256 - b) / 100).toString(16).substr(1) + 1210 | (0 | 256 + d + 10 * (256 - d) / 100).toString(16).substr(1) + (0 | 256 + c + 10 * (256 - c) / 100).toString(16).substr(1) 1211 | } else b = void 0; 1212 | a.shadow = b; 1213 | return a 1214 | }, 1215 | text2tree: function(a) { 1216 | y = text = a.split(/\n/).filter(function(a) { 1217 | return a.match(/\S/) 1218 | }); 1219 | var d, c = [], 1220 | e = []; 1221 | b.each(text, function(a, b) { 1222 | e[a] = G(b); 1223 | var f = that.findParent(text, a, e), 1224 | k = { 1225 | name: b, 1226 | children: [], 1227 | lineNbr: a 1228 | }; 1229 | 0 == a ? (d = k, c[a] = k) : (c[a] = k, c[f].children.push(k)) 1230 | }); 1231 | console.log(JSON.stringify(d)); 1232 | return d 1233 | } 1234 | } 1235 | }; 1236 | 1237 | Array.prototype.forEach || (Array.prototype.forEach = function(b, r) { 1238 | var n, e; 1239 | if (null == 1240 | this) throw new TypeError(" this is null or not defined"); 1241 | var p = Object(this), 1242 | w = p.length >>> 0; 1243 | if ("[object Function]" != {}.toString.call(b)) throw new TypeError(b + " is not a function"); 1244 | r && (n = r); 1245 | for (e = 0; e < w;) { 1246 | var y; 1247 | e in p && (y = p[e], b.call(n, y, e, p)); 1248 | e++ 1249 | } 1250 | }) 1251 | 1252 | return { 1253 | render, 1254 | updateCanvasSize 1255 | } 1256 | })(); -------------------------------------------------------------------------------- /scripts/pane_resizer.js: -------------------------------------------------------------------------------- 1 | // Handler for resizing the two panes. It handles the logic of the dragable bar in 2 | // the middle and the buttons to open collapsed panes. 3 | paneResizer = (function() { 4 | // Set up the jQuery elements 5 | let $paneContainer; 6 | let $dragbar; 7 | let $editorPane; 8 | let $viewerPane; 9 | let $editorCollapseButton; 10 | let $viewerCollapseButton; 11 | let $viewer; 12 | let $body; 13 | let $textArea; 14 | 15 | // Minimum width for the panes 16 | const minPaneWidth = 200; 17 | // When the user attempts to resize the pane below this width, 18 | // completely hide the pane. This is used for the dragbar. 19 | const minCollapseWidth = 100; 20 | 21 | // Whether the user is dragging the drag bar. 22 | let dragging = false; 23 | // Whether the panes should be split the next time the space is available. 24 | let shouldSplitPanes = false; 25 | 26 | // Saved size of the two panes, used for restoring their size after opening a collapsed pane. 27 | let oldEditorPanePercentage; 28 | let oldViewerPanePercentage; 29 | // The current sizes of the panes in percentages. 30 | let editorPanePercentage = 35; 31 | let viewerPanePercentage = 65; 32 | 33 | $.fn.hasScrollBar = function() { 34 | return this.get(0).scrollHeight > this.innerHeight(); 35 | } 36 | 37 | // Set the initial state of the various elements. 38 | $(document).ready(function() { 39 | $paneContainer = $("#pane-container"); 40 | $dragbar = $("#dragbar"); 41 | $editorPane = $("#editor-pane"); 42 | $viewerPane = $("#viewer-pane"); 43 | $editorCollapseButton = $("#editor-collapse-button"); 44 | $viewerCollapseButton = $("#viewer-collapse-button"); 45 | $viewer = $viewerPane.find("#viewer"); 46 | $body = $("body"); 47 | $textArea = $("#textArea"); 48 | // Show the collapse buttons and set the panes to their initial size. 49 | $editorCollapseButton.css("visibility", "visible"); 50 | $viewerCollapseButton.css("visibility", "visible"); 51 | 52 | oldEditorPanePercentage = editorPanePercentage; 53 | oldViewerPanePercentage = viewerPanePercentage; 54 | resizePanesToPercentage(editorPanePercentage, viewerPanePercentage); 55 | 56 | // On window resize, scale the sizes of the panes so they keep the same relative size. 57 | $(window).on("resize", function() { 58 | resizePanesToPercentage(editorPanePercentage, viewerPanePercentage); 59 | }); 60 | 61 | // When the buttons to open a collapsed pane is pressed, 62 | // open the appropriate pane. 63 | $editorCollapseButton.on("click touchstart", toggleViewer); 64 | $viewerCollapseButton.on("click touchstart", toggleEditor); 65 | 66 | $dragbar.on("mousedown", function(mousedownEvent) { 67 | dragging = true; 68 | $body.addClass("no-selection"); 69 | const mouseDownPos = mousedownEvent.pageX; 70 | const initialLeftPaneWidth = $editorPane.width(); 71 | const initialRightPaneWidth = $viewerPane.width(); 72 | 73 | // Resize the panes based on the current mouse position relative to 74 | // the position of the dragbar when it was clicked. 75 | $(document).on("mousemove", function(mousemoveEvent) { 76 | if (dragging) { 77 | const deltaPageX = mousemoveEvent.pageX - mouseDownPos; 78 | const unit = $paneContainer.width() / 100; 79 | const newEditorPanePercentage = (initialLeftPaneWidth + deltaPageX) / unit; 80 | const newViewerPanePercentage = (initialRightPaneWidth - deltaPageX) / unit; 81 | editorPanePercentage = newEditorPanePercentage; 82 | viewerPanePercentage = newViewerPanePercentage; 83 | if (editorPanePercentage < minPaneWidth / unit) { 84 | editorPanePercentage = minPaneWidth / unit; 85 | viewerPanePercentage = 100 - editorPanePercentage; 86 | } 87 | if (viewerPanePercentage < minPaneWidth / unit) { 88 | viewerPanePercentage = minPaneWidth / unit; 89 | editorPanePercentage = 100 - viewerPanePercentage; 90 | } 91 | oldEditorPanePercentage = editorPanePercentage; 92 | oldViewerPanePercentage = viewerPanePercentage; 93 | resizePanesToPercentage(newEditorPanePercentage, newViewerPanePercentage); 94 | } 95 | }); 96 | 97 | $(document).on("mouseup", function() { 98 | if (dragging) { 99 | dragging = false; 100 | $body.removeClass("no-selection"); 101 | $(document).unbind("mousemove"); 102 | } 103 | }); 104 | }); 105 | }); 106 | 107 | // Resize the two panes to percentage sizes. 108 | function resizePanesToPercentage(newEditorPanePercentage, newViewerPanePercentage) { 109 | // Make sure the percentages add up to 100% total. 110 | if (Math.abs(newEditorPanePercentage + newViewerPanePercentage - 100) > 0.1) { 111 | console.warn("Error resizing panes, percentages don't add up. Resetting to 50% split."); 112 | editorPanePercentage = 50; 113 | viewerPanePercentage = 50; 114 | return resizePanesToPercentage(editorPanePercentage, viewerPanePercentage); 115 | } 116 | let newLeftWidth = ($paneContainer.width() / 100) * newEditorPanePercentage; 117 | let newRightWidth = ($paneContainer.width() / 100) * newViewerPanePercentage; 118 | $dragbar.show(); 119 | if (newEditorPanePercentage === 0 || newViewerPanePercentage === 0) { 120 | if (shouldSplitPanes && $paneContainer.width() >= minPaneWidth * 2) { 121 | shouldSplitPanes = false; 122 | editorPanePercentage = oldEditorPanePercentage; 123 | viewerPanePercentage = oldViewerPanePercentage; 124 | return resizePanesToPercentage(editorPanePercentage, viewerPanePercentage); 125 | } 126 | if (newEditorPanePercentage === 0) { 127 | $dragbar.hide(); 128 | } 129 | } else { 130 | if ($paneContainer.width() < minPaneWidth * 2) { 131 | shouldSplitPanes = true; 132 | editorPanePercentage = 100; 133 | viewerPanePercentage = 0; 134 | return resizePanesToPercentage(editorPanePercentage, viewerPanePercentage); 135 | } 136 | if (newLeftWidth < minCollapseWidth) { 137 | editorPanePercentage = 0; 138 | viewerPanePercentage = 100; 139 | return resizePanesToPercentage(editorPanePercentage, viewerPanePercentage); 140 | } 141 | if (newRightWidth < minCollapseWidth) { 142 | editorPanePercentage = 100; 143 | viewerPanePercentage = 0; 144 | return resizePanesToPercentage(editorPanePercentage, viewerPanePercentage); 145 | } 146 | if (newLeftWidth < minPaneWidth) { 147 | newLeftWidth = minPaneWidth; 148 | newRightWidth = $paneContainer.width() - newLeftWidth; 149 | } 150 | if (newRightWidth < minPaneWidth) { 151 | newRightWidth = minPaneWidth; 152 | newLeftWidth = $paneContainer.width() - newRightWidth; 153 | } 154 | } 155 | $editorPane.width(newLeftWidth); 156 | $viewerPane.width(newRightWidth); 157 | setCollapseButtonPositions(); 158 | mindmap.updateCanvasSize(); 159 | } 160 | 161 | // Set the positions, specifically the horizontal positions, of the two collapse buttons. 162 | // This is done so they won't overlap with the scrollbars. 163 | function setCollapseButtonPositions() { 164 | if ($editorPane.width() === 0) { 165 | $viewerCollapseButton.show(); 166 | } else { 167 | $viewerCollapseButton.hide(); 168 | } 169 | if ($viewerPane.width() === 0) { 170 | $editorCollapseButton.show(); 171 | } else { 172 | $editorCollapseButton.hide(); 173 | } 174 | const leftPaneHasScrollbar = $textArea.hasScrollBar(); 175 | let rightOffset = 29; 176 | $editorCollapseButton.css("left", `calc(100% - ${rightOffset}px)`); 177 | if (editorPanePercentage === 0) { 178 | $viewerCollapseButton.css("margin-left", "5px"); 179 | } else { 180 | $viewerCollapseButton.css("margin-left", "10px"); 181 | } 182 | } 183 | 184 | // Toggle the visibility of the editor pane 185 | function toggleEditor() { 186 | if (editorPanePercentage === 0) { 187 | if ($paneContainer.width() >= minPaneWidth * 2) { 188 | editorPanePercentage = oldEditorPanePercentage; 189 | viewerPanePercentage = oldViewerPanePercentage; 190 | } else { 191 | editorPanePercentage = 100; 192 | viewerPanePercentage = 0 193 | } 194 | } else { 195 | editorPanePercentage = 0; 196 | viewerPanePercentage = 100 197 | } 198 | resizePanesToPercentage(editorPanePercentage, viewerPanePercentage); 199 | } 200 | 201 | // Toggle the visibility of the viewer pane 202 | function toggleViewer() { 203 | if (viewerPanePercentage === 0) { 204 | if ($paneContainer.width() >= minPaneWidth * 2) { 205 | editorPanePercentage = oldEditorPanePercentage; 206 | viewerPanePercentage = oldViewerPanePercentage; 207 | } else { 208 | editorPanePercentage = 0; 209 | viewerPanePercentage = 100 210 | } 211 | } else { 212 | editorPanePercentage = 100; 213 | viewerPanePercentage = 0 214 | } 215 | resizePanesToPercentage(editorPanePercentage, viewerPanePercentage); 216 | } 217 | 218 | return { 219 | toggleViewer, 220 | toggleEditor 221 | } 222 | }()); 223 | -------------------------------------------------------------------------------- /scripts/settings.js: -------------------------------------------------------------------------------- 1 | // Helper functions for saving and loading user settings with localstorage. 2 | settings = (function() { 3 | // Used for seperating settings on the same domain 4 | const prefix = "text2mindmap"; 5 | 6 | // Default values for various user settings. 7 | const defaultValues = { 8 | "documentContent": "Text2MindMap\n\tTurn tab-indented lists into mind maps\n\t\tPress Tab to indent lines\n\t\tPress Shift + Tab to unindent lines\n\tDrag nodes to re-organize them\n\tRight-click the mindmap to save it as an image\n\tThis project is based on the now dead site Text2MindMap.com", 9 | "documentTitle": "Untitled Document" 10 | }; 11 | 12 | // Used for converting settings values to actual font-familys. 13 | const fontFamilyMap = { 14 | "monospace": "monospace", 15 | "sans-serif": "sans-serif", 16 | "serif": "serif", 17 | }; 18 | 19 | // Get the setting with the specified key. If the setting is null, use the default value. 20 | function getSetting(key) { 21 | let setting; 22 | try { 23 | setting = JSON.parse(localStorage.getItem(prefix+key)); 24 | } catch (exception) { 25 | // Ignored 26 | } 27 | if (!setting || setting == "") { 28 | setting = getDefaultValue(key); 29 | setSetting(key, setting); 30 | } 31 | return setting; 32 | } 33 | 34 | // Set the setting with the specified key to the specified value. 35 | function setSetting(key, value) { 36 | if (!value) { 37 | value = getDefaultValue(key); 38 | } 39 | try { 40 | localStorage.setItem(prefix+key, JSON.stringify(value)); 41 | } catch (exception) { 42 | console.error(`Error saving setting.\nKey: ${key}\nValue: ${value}\n`); 43 | } 44 | } 45 | 46 | // Get the default value of the setting with the specified key. 47 | function getDefaultValue(key) { 48 | if (key in defaultValues) { 49 | return defaultValues[key]; 50 | } 51 | } 52 | 53 | // Reset all the settings to their default values. 54 | function reset() { 55 | for (let key in defaultValues) { 56 | setSetting(key, getDefaultValue(key)); 57 | } 58 | } 59 | 60 | return { 61 | getSetting, 62 | setSetting, 63 | fontFamilyMap, 64 | getDefaultValue, 65 | reset 66 | }; 67 | }()); 68 | -------------------------------------------------------------------------------- /scripts/shortcuts.js: -------------------------------------------------------------------------------- 1 | // Logic for handling bindings for keyboard shortcuts. 2 | shortcuts = (function() { 3 | const bindings = {}; 4 | 5 | // Handler function for all keypress events the user makes. 6 | // Will convert the key-combination to a string and compare it to existing 7 | // shortcut bindings. If the binding is found, call the appropriate function. 8 | function handleKeypress(event) { 9 | const keys = [event.key.toLowerCase()]; 10 | if (event.shiftKey) { 11 | keys.push("shift"); 12 | } 13 | if ((event.ctrlKey || event.metaKey)) { 14 | keys.push("ctrl"); 15 | } 16 | if (event.altKey) { 17 | keys.push("alt"); 18 | } 19 | for (let key in bindings) { 20 | if (keysEqual(key.split("+"), keys)) { 21 | event.preventDefault(); 22 | bindings[key](); 23 | } 24 | } 25 | } 26 | 27 | // Add a keyboard binding to the list. 28 | // Shortcut is a string formatted like this: "ctrl+shift+v" 29 | // Callback is the function to call when the shortcut is pressed. 30 | function addBinding(shortcut, callback) { 31 | bindings[shortcut.toLowerCase()] = callback; 32 | } 33 | 34 | // Add an array of bindings to the list. 35 | function addBindings(newBindings) { 36 | for (let binding in newBindings) { 37 | bindings[binding.toLowerCase()] = newBindings[binding]; 38 | } 39 | } 40 | 41 | // Check if two arrays of keys are equal. 42 | function keysEqual(keys1, keys2) { 43 | if (!keys1 || !keys2) { 44 | return false; 45 | } 46 | if (keys1.length !== keys2.length) { 47 | return false; 48 | } 49 | keys1.sort(); 50 | keys2.sort(); 51 | for (let i = 0; i < keys1.length; i++) { 52 | if (keys1[i] instanceof Array && keys2[i] instanceof Array) { 53 | if (!keys1[i].equals(keys2[i])) { 54 | return false; 55 | } 56 | } else if (keys1[i] !== keys2[i]) { 57 | return false; 58 | } 59 | } 60 | return true; 61 | } 62 | 63 | return { 64 | addBinding, 65 | addBindings, 66 | handleKeypress 67 | }; 68 | }()); -------------------------------------------------------------------------------- /scripts/unsaved_changes.js: -------------------------------------------------------------------------------- 1 | // Small module for setting whether the user has unsaved changes. 2 | unsavedChanges = (function() { 3 | const defaultMessage = "You have unsaved changes. Are you sure you want to continue?"; 4 | 5 | let hasChanges = false; 6 | 7 | // Warn the user that they're about to lose unsaved changes. 8 | // Return whether they want to continue. 9 | function confirmContinue(message) { 10 | const res = !getHasChanges() || confirm(message || defaultMessage); 11 | return res; 12 | } 13 | 14 | // Setter method for hasChanges. 15 | function setHasChanges(value) { 16 | hasChanges = value; 17 | } 18 | 19 | // Getter method for hasChanged 20 | function getHasChanges() { 21 | return hasChanges; 22 | } 23 | 24 | return { 25 | setHasChanges, 26 | getHasChanges, 27 | confirmContinue, 28 | }; 29 | }()); 30 | -------------------------------------------------------------------------------- /styles/app.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | margin: 0; 3 | height: 100%; 4 | overflow: hidden; 5 | } 6 | 7 | .wrapper { 8 | height: 100%; 9 | overflow: hidden; 10 | } 11 | 12 | #pane-container { 13 | /* 100% minus the height of the navbar */ 14 | height: calc(100% - 50px); 15 | width: 100%; 16 | overflow: hidden; 17 | } 18 | 19 | .modal-container { 20 | width: 100%; 21 | height: 100%; 22 | margin: 0; 23 | padding: 0; 24 | } 25 | 26 | #uploader { 27 | width: 100%; 28 | height: 100%; 29 | margin: 0; 30 | padding: 0; 31 | background: red; 32 | } 33 | 34 | /* Buttons */ 35 | .button { 36 | border: 1px solid #ccc; 37 | background-color: white; 38 | color: black; 39 | height: 3em; 40 | border-radius: 3px; 41 | outline: 0; 42 | cursor: pointer; 43 | font-size: 0.9em; 44 | padding: 0 13px; 45 | } 46 | 47 | .button:hover { 48 | background-color: #e6e6e6; 49 | } 50 | 51 | .button:active { 52 | background-color: #d4d4d4; 53 | } 54 | 55 | .button.dark { 56 | background-color: #424242; 57 | color: white; 58 | border: 1px solid #323232; 59 | } 60 | 61 | .button.dark:hover { 62 | background-color: #323232; 63 | } 64 | 65 | .button.dark:active { 66 | background-color: #222222; 67 | } 68 | 69 | .button svg { 70 | margin-right: 7px; 71 | } 72 | 73 | /* Forms */ 74 | form { 75 | margin-top: 20px; 76 | } 77 | 78 | form .form-group + .form-group { 79 | margin-top: 1em; 80 | } 81 | 82 | .form-group { 83 | width: 100%; 84 | display: -webkit-box; 85 | display: -ms-flexbox; 86 | display: flex; 87 | -webkit-box-orient: horizontal; 88 | -webkit-box-direction: normal; 89 | -ms-flex-direction: row; 90 | flex-direction: row; 91 | } 92 | 93 | form .control-label { 94 | padding: 0.5em 0; 95 | font-weight: bold; 96 | display: inline-block; 97 | text-align: right; 98 | margin-right: 1em; 99 | width: 10em; 100 | min-width: 5em; 101 | color: #333; 102 | -webkit-box-flex: 0.5; 103 | -ms-flex: 0.5; 104 | flex: 0.5; 105 | } 106 | 107 | form label { 108 | -webkit-user-select: none; 109 | -moz-user-select: none; 110 | -ms-user-select: none; 111 | user-select: none; 112 | min-width: 0; 113 | } 114 | 115 | form input[type="text"], 116 | form input[type="number"] 117 | { 118 | display: flex; 119 | -webkit-box-flex: 1; 120 | -ms-flex: 1; 121 | flex: 1; 122 | margin-right: 3em; 123 | border-radius: 3px; 124 | border: 1px solid #ccc; 125 | padding: 0.5em; 126 | font-size: 1em; 127 | height: 1em; 128 | min-width: 0; 129 | } 130 | 131 | form .form-div { 132 | flex: 1; 133 | margin-right: 3em; 134 | padding: 0.5em; 135 | } 136 | 137 | form .minicolors-swatch { 138 | margin-bottom: 10px; 139 | margin-right: 10px; 140 | } 141 | 142 | .checkbox-control { 143 | display: flex; 144 | -webkit-box-flex: 1; 145 | -ms-flex: 1; 146 | flex: 1; 147 | margin-right: 3em; 148 | min-width: 0; 149 | } 150 | 151 | form input[type="checkbox"] { 152 | height: 2em; 153 | width: 1.2em; 154 | margin: 0; 155 | margin-top: 0.4em; 156 | margin-right: 0.7em; 157 | } 158 | 159 | form .form-group.smaller-top-margin { 160 | margin-top: 5px; 161 | } 162 | 163 | form input[type="checkbox"] + label { 164 | padding-top: 0.45em; 165 | } 166 | 167 | form select { 168 | min-width: 0; 169 | display: inline-block; 170 | -webkit-box-flex: 1; 171 | -ms-flex: 1; 172 | flex: 1; 173 | margin-right: 3em; 174 | border-radius: 3px; 175 | border: 1px solid #ccc; 176 | padding: 0 0.5em; 177 | font-size: 1em; 178 | height: 2em; 179 | background-color: white; 180 | } 181 | 182 | .no-selection { 183 | -webkit-user-select: none; 184 | -moz-user-select: none; 185 | -ms-user-select: none; 186 | user-select: none; 187 | } 188 | 189 | #file-input { 190 | display: none; 191 | } 192 | -------------------------------------------------------------------------------- /styles/document_title.css: -------------------------------------------------------------------------------- 1 | .document-title-container { 2 | display: -webkit-box; 3 | display: -ms-flexbox; 4 | display: flex; 5 | -webkit-box-align: center; 6 | -ms-flex-align: center; 7 | align-items: center; 8 | height: 100%; 9 | padding-left: 10px; 10 | padding-right: 3px; 11 | } 12 | 13 | .document-title-input { 14 | text-overflow: ellipsis; 15 | width: 140px; 16 | } 17 | 18 | .document-title-mirror { 19 | display: none; 20 | white-space: pre; 21 | } 22 | 23 | .document-title-input, 24 | .document-title-mirror { 25 | background-color: inherit; 26 | border: none; 27 | font-size: 1.15em; 28 | color: white; 29 | padding: 2px 5px 2px 7px; 30 | } 31 | 32 | .document-title-input:hover { 33 | border-bottom: 2px solid rgba(255, 255, 255, 0.2); 34 | margin-bottom: -1px; 35 | } 36 | 37 | .document-title-input:focus { 38 | border-bottom: 2px solid rgba(255, 255, 255, 0.8); 39 | margin-bottom: -1px; 40 | outline: none; 41 | } -------------------------------------------------------------------------------- /styles/editor.css: -------------------------------------------------------------------------------- 1 | #editor-pane { 2 | height: 100%; 3 | width: 50%; 4 | display: inline-block; 5 | background-color: #f0f0f0; 6 | } 7 | 8 | #editor-pane { 9 | float: left; 10 | } 11 | 12 | #editor { 13 | height: 100%; 14 | padding: 20px 15px; 15 | } 16 | 17 | #editor > .CodeMirror { 18 | height: 100%; 19 | } 20 | 21 | #editor .cm-link { 22 | text-decoration: none; 23 | } 24 | 25 | #editor .CodeMirror-lines { 26 | margin: 20px 15px; 27 | } 28 | 29 | #textArea { 30 | resize: none; 31 | width: 100%; 32 | height: calc(100% - 25px); 33 | box-sizing: border-box; 34 | background-color: transparent; 35 | border: none; 36 | font-size: 14px; 37 | tab-size : 4; 38 | outline: none; 39 | overflow: auto; 40 | white-space: pre-wrap 41 | } 42 | -------------------------------------------------------------------------------- /styles/modal.css: -------------------------------------------------------------------------------- 1 | .modal { 2 | display: none; 3 | position: fixed; 4 | top: 0; 5 | right: 0; 6 | bottom: 0; 7 | left: 0; 8 | font-family: sans-serif; 9 | z-index: 2000; 10 | overflow: auto; 11 | } 12 | 13 | .modal.active { 14 | display: block; 15 | } 16 | 17 | .modal-dialog { 18 | position: relative; 19 | max-width: 600px; 20 | margin: 30px auto; 21 | z-index: 2010; 22 | } 23 | 24 | .modal-content { 25 | border: 1px solid #999999; 26 | border: 1px solid rgba(0, 0, 0, 0.2); 27 | background-color: white; 28 | border-radius: 8px; 29 | box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); 30 | } 31 | 32 | .modal-header { 33 | padding: 15px 15px 10px 15px; 34 | border-bottom: 1px solid #e5e5e5; 35 | background-color: #f7f7f7; 36 | border-radius: 8px 8px 0 0; 37 | } 38 | 39 | .modal-title { 40 | font-weight: bold; 41 | font-size: 1.5em; 42 | } 43 | 44 | .modal-body { 45 | position: relative; 46 | padding: 10px 15px; 47 | overflow: hidden; 48 | } 49 | 50 | .modal-footer { 51 | padding: 15px; 52 | text-align: right; 53 | border-top: 1px solid #e5e5e5; 54 | } 55 | 56 | .modal-footer .button { 57 | margin: 0 5px; 58 | } 59 | 60 | .modal-backdrop { 61 | background: #000; 62 | opacity: 0.5; 63 | -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; 64 | position: fixed; 65 | top: 0; 66 | right: 0; 67 | bottom: 0; 68 | left: 0; 69 | z-index: 2000; 70 | } 71 | 72 | .close-button { 73 | float: right; 74 | color: lightgray; 75 | background: transparent; 76 | border: 0; 77 | cursor: pointer; 78 | font-size: 1.5em; 79 | font-weight: bold; 80 | margin-top: -10px; 81 | padding: 0; 82 | outline: 0; 83 | } 84 | 85 | .close-button:hover { 86 | color: gray; 87 | } 88 | 89 | .modal-tabs { 90 | list-style: none; 91 | padding: 0; 92 | margin: 0; 93 | margin-bottom: -11px; 94 | margin-top: 10px; 95 | overflow: hidden 96 | } 97 | 98 | .modal-tabs > li { 99 | -webkit-user-select: none; 100 | border: 1px solid transparent; 101 | float: left; 102 | padding: 15px; 103 | margin-bottom: 0; 104 | margin-right: 3px; 105 | border-radius: 5px 5px 0 0; 106 | cursor: pointer; 107 | } 108 | 109 | .modal-tabs > li:hover { 110 | border: 1px solid #e5e5e5; 111 | background-color: #f0f0f0; 112 | } 113 | 114 | .modal-tabs > li.active { 115 | border: 1px solid #e5e5e5; 116 | border-bottom: 1px solid transparent; 117 | background-color: white; 118 | cursor: default; 119 | color: black; 120 | } 121 | 122 | .tab-content { 123 | display: none; 124 | } 125 | 126 | .tab-content.active { 127 | display: block; 128 | } -------------------------------------------------------------------------------- /styles/navbar.css: -------------------------------------------------------------------------------- 1 | .navbar { 2 | font-family: sans-serif; 3 | height: 50px; 4 | background-color: #424242; 5 | font-size: 15px; 6 | width: 100%; 7 | position: relative; 8 | overflow: hidden; 9 | } 10 | 11 | .navbar > ul { 12 | padding: 0; 13 | margin: 0; 14 | list-style: none; 15 | height: 100%; 16 | } 17 | 18 | .navbar-item { 19 | float: left; 20 | height: 100%; 21 | } 22 | 23 | .navbar-icon { 24 | font-size: 35px; 25 | float: right; 26 | color: white; 27 | padding-right: 10px; 28 | padding-left: 5px; 29 | padding-top: 6px; 30 | box-sizing: border-box; 31 | display: inline-block; 32 | } 33 | 34 | .navbar-text { 35 | font-size: 16px; 36 | float: right; 37 | color: white; 38 | padding-right: 15px; 39 | line-height: 50px; 40 | text-decoration: none; 41 | } 42 | 43 | 44 | .navbar-text:hover { 45 | text-decoration: underline; 46 | } 47 | 48 | .navbar-button { 49 | min-width: 60px; 50 | } 51 | 52 | .navbar-button > a { 53 | padding: 0 12px; 54 | } 55 | 56 | .navbar-button:hover { 57 | background-color: rgba(0, 0, 0, 0.25); 58 | } 59 | 60 | .navbar-item a { 61 | display: -webkit-box; 62 | display: -ms-flexbox; 63 | display: flex; 64 | -webkit-box-pack: center; 65 | -ms-flex-pack: center; 66 | justify-content: center; 67 | -webkit-box-align: center; 68 | -ms-flex-align: center; 69 | align-items: center; 70 | text-decoration: none; 71 | height: 100%; 72 | color: white; 73 | } 74 | 75 | .dropdown-content { 76 | z-index: 1000; 77 | display: none; 78 | position: fixed; 79 | padding: 5px 0; 80 | list-style: none; 81 | background-color: white; 82 | min-width: 200px; 83 | box-shadow: 0 5px 10px 0 rgba(0, 0, 0, 0.2); 84 | border: 1px solid rgba(0, 0, 0, 0.15); 85 | } 86 | 87 | .dropdown-content li:not(.dropdown-divider) { 88 | height: 28px; 89 | font-size: 14px; 90 | } 91 | 92 | .dropdown-content li:not(.dropdown-divider):hover { 93 | background-color: #2780e3; 94 | } 95 | 96 | .dropdown-content svg { 97 | padding-right: 7px; 98 | width: 1.28571429em; 99 | } 100 | 101 | .dropdown-content a { 102 | color: #333333; 103 | -webkit-box-pack: start; 104 | -ms-flex-pack: start; 105 | justify-content: flex-start; 106 | padding-left: 9px; 107 | } 108 | 109 | .dropdown-content a:hover { 110 | color: white; 111 | } 112 | 113 | .dropdown-content a:hover .dropdown-shortcut { 114 | color: white; 115 | } 116 | 117 | .dropdown-divider { 118 | background-color: #ebebeb; 119 | height: 1px; 120 | margin: 5px 0; 121 | overflow: hidden; 122 | } 123 | 124 | .dropdown-shortcut { 125 | color: #aaa; 126 | position: absolute; 127 | right: 20px; 128 | } 129 | 130 | .navbar-logo { 131 | float: right; 132 | margin-right: 25px; 133 | font-size: 20px; 134 | font-weight: bold; 135 | } 136 | 137 | .navbar-dropdown > a:after { 138 | content: ""; 139 | width: 0; 140 | height: 0; 141 | border-left: 4px solid transparent; 142 | border-right: 4px solid transparent; 143 | border-top: 4px solid white; 144 | margin-left: 5px; 145 | } 146 | -------------------------------------------------------------------------------- /styles/old/customstyles.css: -------------------------------------------------------------------------------- 1 | #stageHolder:hover{ 2 | cursor:move; 3 | } 4 | -------------------------------------------------------------------------------- /styles/old/jquery-ui-1.10.3.custom.min.css: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.10.3 - 2013-05-30 2 | * http://jqueryui.com 3 | * Includes: jquery.ui.core.css, jquery.ui.resizable.css 4 | * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS%2CTahoma%2CVerdana%2CArial%2Csans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=gloss_wave&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=highlight_soft&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=glass&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=glass&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=highlight_soft&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=diagonals_thick&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=diagonals_thick&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=flat&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px 5 | * Copyright 2013 jQuery Foundation and other contributors Licensed MIT */.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-widget{font-family:Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #ddd;background:#eee url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x;color:#333}.ui-widget-content a{color:#333}.ui-widget-header{border:1px solid #e78f08;background:#f6a828 url(images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x;color:#fff;font-weight:bold}.ui-widget-header a{color:#fff}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #ccc;background:#f6f6f6 url(images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x;font-weight:bold;color:#1c94c4}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#1c94c4;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #fbcb09;background:#fdf5ce url(images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x;font-weight:bold;color:#c77405}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited{color:#c77405;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #fbd850;background:#fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:bold;color:#eb8f00}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#eb8f00;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fed22f;background:#ffe45c url(images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#b81900 url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat;color:#fff}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#fff}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#fff}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_ffffff_256x240.png)}.ui-state-default .ui-icon{background-image:url(images/ui-icons_ef8c08_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_ef8c08_256x240.png)}.ui-state-active .ui-icon{background-image:url(images/ui-icons_ef8c08_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_228ef1_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_ffd27a_256x240.png)}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#666 url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat;opacity:.5;filter:Alpha(Opacity=50)}.ui-widget-shadow{margin:-5px 0 0 -5px;padding:5px;background:#000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x;opacity:.2;filter:Alpha(Opacity=20);border-radius:5px} -------------------------------------------------------------------------------- /styles/old/jquery.minicolors.css: -------------------------------------------------------------------------------- 1 | .minicolors { 2 | position: relative; 3 | display: inline-block; 4 | z-index: 1; 5 | } 6 | 7 | .minicolors-focus { 8 | z-index: 2; 9 | } 10 | 11 | .minicolors.minicolors-theme-default .minicolors-input { 12 | margin: 0px; 13 | margin-right: 3px; 14 | border: solid 1px #CCC; 15 | font: 14px sans-serif; 16 | width: 65px; 17 | height: 16px; 18 | border-radius: 0; 19 | box-shadow: inset 0 2px 4px rgba(0, 0, 0, .04); 20 | padding: 2px; 21 | margin-right: -1px; 22 | } 23 | 24 | .minicolors-theme-default.minicolors .minicolors-input { 25 | vertical-align: middle; 26 | outline: none; 27 | } 28 | 29 | .minicolors-theme-default.minicolors-swatch-left .minicolors-input { 30 | margin-left: -1px; 31 | margin-right: auto; 32 | } 33 | 34 | .minicolors-theme-default.minicolors-focus .minicolors-input, 35 | .minicolors-theme-default.minicolors-focus .minicolors-swatch { 36 | border-color: #999; 37 | } 38 | 39 | .minicolors-hidden { 40 | position: absolute; 41 | left: -9999em; 42 | } 43 | 44 | .minicolors-swatch { 45 | position: relative; 46 | width: 20px; 47 | height: 20px; 48 | background: url(jquery.minicolors.png) -80px 0; 49 | border: solid 1px #CCC; 50 | display: inline-block; 51 | vertical-align: middle; 52 | } 53 | 54 | .minicolors-swatch SPAN { 55 | position: absolute; 56 | width: 100%; 57 | height: 100%; 58 | background: none; 59 | box-shadow: inset 0 9px 0 rgba(255, 255, 255, .1); 60 | display: inline-block; 61 | } 62 | 63 | /* Panel */ 64 | .minicolors-panel { 65 | position: absolute; 66 | top: 26px; 67 | left: 0; 68 | width: 173px; 69 | height: 152px; 70 | background: white; 71 | border: solid 1px #CCC; 72 | box-shadow: 0 0 20px rgba(0, 0, 0, .2); 73 | display: none; 74 | } 75 | 76 | .minicolors-position-top .minicolors-panel { 77 | top: -156px; 78 | } 79 | 80 | .minicolors-position-left .minicolors-panel { 81 | left: -83px; 82 | } 83 | 84 | .minicolors-position-left.minicolors-with-opacity .minicolors-panel { 85 | left: -104px; 86 | } 87 | 88 | .minicolors-with-opacity .minicolors-panel { 89 | width: 194px; 90 | } 91 | 92 | .minicolors .minicolors-grid { 93 | position: absolute; 94 | top: 1px; 95 | left: 1px; 96 | width: 150px; 97 | height: 150px; 98 | background: url(jquery.minicolors.png) -120px 0; 99 | cursor: crosshair; 100 | } 101 | 102 | .minicolors .minicolors-grid-inner { 103 | position: absolute; 104 | top: 0; 105 | left: 0; 106 | width: 150px; 107 | height: 150px; 108 | background: none; 109 | } 110 | 111 | .minicolors-slider-saturation .minicolors-grid { 112 | background-position: -420px 0; 113 | } 114 | 115 | .minicolors-slider-saturation .minicolors-grid-inner { 116 | background: url(jquery.minicolors.png) -270px 0; 117 | } 118 | 119 | .minicolors-slider-brightness .minicolors-grid { 120 | background-position: -570px 0; 121 | } 122 | 123 | .minicolors-slider-brightness .minicolors-grid-inner { 124 | background: black; 125 | } 126 | 127 | .minicolors-slider-wheel .minicolors-grid { 128 | background-position: -720px 0; 129 | } 130 | 131 | .minicolors-slider, 132 | .minicolors-opacity-slider { 133 | position: absolute; 134 | top: 1px; 135 | left: 152px; 136 | width: 20px; 137 | height: 150px; 138 | background: white url(jquery.minicolors.png) 0 0; 139 | cursor: crosshair; 140 | } 141 | 142 | .minicolors-slider-saturation .minicolors-slider { 143 | background-position: -60px 0; 144 | } 145 | 146 | .minicolors-slider-brightness .minicolors-slider { 147 | background-position: -20px 0; 148 | } 149 | 150 | .minicolors-slider-wheel .minicolors-slider { 151 | background-position: -20px 0; 152 | } 153 | 154 | .minicolors-opacity-slider { 155 | left: 173px; 156 | background-position: -40px 0; 157 | display: none; 158 | } 159 | 160 | .minicolors-with-opacity .minicolors-opacity-slider { 161 | display: block; 162 | } 163 | 164 | /* Pickers */ 165 | .minicolors-grid .minicolors-picker { 166 | position: absolute; 167 | top: 70px; 168 | left: 70px; 169 | width: 10px; 170 | height: 10px; 171 | border: solid 1px black; 172 | border-radius: 10px; 173 | margin-top: -6px; 174 | margin-left: -6px; 175 | background: none; 176 | } 177 | 178 | .minicolors-grid .minicolors-picker SPAN { 179 | position: absolute; 180 | top: 0; 181 | left: 0; 182 | width: 6px; 183 | height: 6px; 184 | border-radius: 6px; 185 | border: solid 2px white; 186 | } 187 | 188 | .minicolors-picker { 189 | position: absolute; 190 | top: 0; 191 | left: 0; 192 | width: 18px; 193 | height: 2px; 194 | background: white; 195 | border: solid 1px black; 196 | margin-top: -2px; 197 | } 198 | 199 | /* Inline controls */ 200 | .minicolors-inline .minicolors-input, 201 | .minicolors-inline .minicolors-swatch { 202 | display: none; 203 | } 204 | 205 | .minicolors-inline .minicolors-panel { 206 | position: relative; 207 | top: auto; 208 | left: auto; 209 | display: inline-block; 210 | } 211 | 212 | 213 | /* 214 | * Bootstrap Theme (theme: 'bootstrap') 215 | * 216 | */ 217 | 218 | /* Input styles */ 219 | .minicolors-theme-bootstrap .minicolors-input { 220 | padding: 4px 6px; 221 | padding-left: 30px; 222 | background-color: white; 223 | border: 1px solid #CCC; 224 | border-radius: 3px; 225 | color: #555; 226 | font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; 227 | font-size: 14px; 228 | height: 19px; 229 | margin: 0px; 230 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); 231 | } 232 | 233 | /* When the input has focus */ 234 | .minicolors-theme-bootstrap.minicolors-focus .minicolors-input { 235 | border-color: #6fb8f1; 236 | box-shadow: 0 0 10px #6fb8f1; 237 | outline: none; 238 | } 239 | 240 | /* Swatch styles */ 241 | .minicolors-theme-bootstrap .minicolors-swatch { 242 | position: absolute; 243 | left: 4px; 244 | top: 4px; 245 | z-index: 2; 246 | } 247 | 248 | /* Handle swatch position (left = default / right) */ 249 | .minicolors-theme-bootstrap.minicolors-swatch-position-right .minicolors-input { 250 | padding-left: 6px; 251 | padding-right: 30px; 252 | } 253 | 254 | .minicolors-theme-bootstrap.minicolors-swatch-position-right .minicolors-swatch { 255 | left: auto; 256 | right: 4px; 257 | } 258 | 259 | /* Panel styles */ 260 | .minicolors-theme-bootstrap .minicolors-panel { 261 | top: 28px; 262 | z-index: 3; 263 | } 264 | 265 | /* Handle panel positions (top / left) */ 266 | .minicolors-theme-bootstrap.minicolors-position-top .minicolors-panel { 267 | top: -154px; 268 | } 269 | 270 | .minicolors-theme-bootstrap.minicolors-position-left .minicolors-panel { 271 | left: -63px; 272 | } 273 | 274 | /* Don't forget to adjust the left position in case the opacity slider is visible! */ 275 | .minicolors-theme-bootstrap.minicolors-position-left.minicolors-with-opacity .minicolors-panel { 276 | left: -84px; 277 | } -------------------------------------------------------------------------------- /styles/pane_resizer.css: -------------------------------------------------------------------------------- 1 | #dragbar { 2 | cursor: col-resize; 3 | width: 6px; 4 | float: left; 5 | height: 100%; 6 | background: #d3d3d3; 7 | background: rgba(0, 0, 0, 0.1); 8 | background: -webkit-linear-gradient(right, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.0)); 9 | background: -o-linear-gradient(right, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.0)); 10 | background: -moz-linear-gradient(right, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.0)); 11 | background: linear-gradient(to right, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.0)); 12 | } 13 | 14 | #dragbar:hover, 15 | #dragbar:active { 16 | background: #c0c0c0; 17 | background: rgba(0, 0, 0, 0.2); 18 | } 19 | 20 | .collapse-button { 21 | position: relative; 22 | width: 0; 23 | height: 0; 24 | top: 45%; 25 | } 26 | 27 | .collapse-button > div { 28 | position: absolute; 29 | z-index: 10; 30 | color: black; 31 | width: 25px; 32 | cursor: pointer; 33 | padding: 20px 0; 34 | border-radius: 3px; 35 | opacity: 0.3; 36 | -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"; 37 | } 38 | 39 | .collapse-button > div svg { 40 | vertical-align: middle; 41 | text-align: center; 42 | width: 100%; 43 | } 44 | 45 | .collapse-button > div:hover { 46 | background-color: #bbb; 47 | opacity: 0.8; 48 | -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; 49 | } 50 | 51 | .collapse-button > div:active { 52 | opacity: 1; 53 | -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; 54 | } -------------------------------------------------------------------------------- /styles/preferences_modal.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tobloef/text2mindmap/b85695dcc1611fdcfe1c28fac93574c16e25462e/styles/preferences_modal.css -------------------------------------------------------------------------------- /styles/viewer.css: -------------------------------------------------------------------------------- 1 | #viewer-pane { 2 | height: 100%; 3 | width: 50%; 4 | display: inline; 5 | top: 0; 6 | overflow: hidden; 7 | } 8 | 9 | #viewer-container { 10 | height: 100%; 11 | display: flex; 12 | } 13 | --------------------------------------------------------------------------------