Added link to StackEdit 4 beta

This commit is contained in:
benweet 2014-04-21 18:21:03 +01:00
parent 2751892e12
commit a0e9f5fc00
2 changed files with 86 additions and 77 deletions

View File

@ -28,7 +28,7 @@ define([
], function($, _, crel, ace, constants, utils, storage, settings, eventMgr, shortcutMgr, mousetrap, bodyIndexHTML, bodyViewerHTML, settingsTemplateTooltipHTML, settingsUserCustomExtensionTooltipHTML) { ], function($, _, crel, ace, constants, utils, storage, settings, eventMgr, shortcutMgr, mousetrap, bodyIndexHTML, bodyViewerHTML, settingsTemplateTooltipHTML, settingsUserCustomExtensionTooltipHTML) {
var core = {}; var core = {};
// Used for periodic tasks // Used for periodic tasks
var intervalId; var intervalId;
@ -53,7 +53,7 @@ define([
} }
return userActive && windowUnique; return userActive && windowUnique;
} }
// Used to only have 1 window of the application in the same browser // Used to only have 1 window of the application in the same browser
var windowId; var windowId;
function checkWindowUnique() { function checkWindowUnique() {
@ -147,7 +147,7 @@ define([
utils.setInputValue("#input-settings-pdf-page-size", settings.pdfPageSize); utils.setInputValue("#input-settings-pdf-page-size", settings.pdfPageSize);
// SSH proxy // SSH proxy
utils.setInputValue("#input-settings-ssh-proxy", settings.sshProxy); utils.setInputValue("#input-settings-ssh-proxy", settings.sshProxy);
// Load shortcuts settings // Load shortcuts settings
shortcutMgr.loadSettings(); shortcutMgr.loadSettings();
@ -454,7 +454,7 @@ define([
} }
layout.resizeAll(); layout.resizeAll();
} }
// Create the PageDown editor // Create the PageDown editor
var editor; var editor;
var $editorElt; var $editorElt;
@ -551,7 +551,7 @@ define([
} }
documentContent = newDocumentContent; documentContent = newDocumentContent;
} }
var previewWrapper; var previewWrapper;
if(window.lightMode) { if(window.lightMode) {
editor = new Markdown.EditorLight(converter); editor = new Markdown.EditorLight(converter);
@ -578,7 +578,7 @@ define([
$(".modal-insert-image").modal(); $(".modal-insert-image").modal();
return true; return true;
}); });
if(settings.lazyRendering === true) { if(settings.lazyRendering === true) {
previewWrapper = function(makePreview) { previewWrapper = function(makePreview) {
var debouncedMakePreview = _.debounce(makePreview, 500); var debouncedMakePreview = _.debounce(makePreview, 500);
@ -658,7 +658,7 @@ define([
$("#wmd-undo-button").append($('<i class="icon-reply">')).appendTo($btnGroupElt); $("#wmd-undo-button").append($('<i class="icon-reply">')).appendTo($btnGroupElt);
$("#wmd-redo-button").append($('<i class="icon-forward">')).appendTo($btnGroupElt); $("#wmd-redo-button").append($('<i class="icon-forward">')).appendTo($btnGroupElt);
}; };
// Initialize multiple things and then fire eventMgr.onReady // Initialize multiple things and then fire eventMgr.onReady
var isDocumentPanelShown = false; var isDocumentPanelShown = false;
var isMenuPanelShown = false; var isMenuPanelShown = false;
@ -675,13 +675,13 @@ define([
$leftBtnDropdown = $navbarElt.find('.left-buttons-dropdown'); $leftBtnDropdown = $navbarElt.find('.left-buttons-dropdown');
$rightBtnDropdown = $navbarElt.find('.right-buttons-dropdown'); $rightBtnDropdown = $navbarElt.find('.right-buttons-dropdown');
$(window).bind("resize", adjustWindow); $(window).bind("resize", adjustWindow);
// Initialize utils library // Initialize utils library
utils.init(); utils.init();
// Populate shortcuts in settings // Populate shortcuts in settings
shortcutMgr.addSettingEntries(); shortcutMgr.addSettingEntries();
// Hide shortcuts settings if light mode // Hide shortcuts settings if light mode
if(window.lightMode) { if(window.lightMode) {
$('.tab-settings-shortcuts').hide(); $('.tab-settings-shortcuts').hide();
@ -773,14 +773,14 @@ define([
return $('<textarea id="wmd-input">').addClass(this.className).addClass('form-control'); return $('<textarea id="wmd-input">').addClass(this.className).addClass('form-control');
}); });
} }
$editorElt = $("#wmd-input, .textarea-helper").css({ $editorElt = $("#wmd-input, .textarea-helper").css({
// Apply editor font // Apply editor font
"font-family": settings.editorFontFamily, "font-family": settings.editorFontFamily,
"font-size": settings.editorFontSize + "px", "font-size": settings.editorFontSize + "px",
"line-height": Math.round(settings.editorFontSize * (20 / 12)) + "px" "line-height": Math.round(settings.editorFontSize * (20 / 12)) + "px"
}); });
if(!window.lightMode) { if(!window.lightMode) {
// ACE editor // ACE editor
createAceEditor(); createAceEditor();
@ -811,7 +811,7 @@ define([
// Other initialization that are not prioritary // Other initialization that are not prioritary
eventMgr.addListener("onReady", function() { eventMgr.addListener("onReady", function() {
// In vertical mode, we have to offset the editor buttons otherwise they hide the editor buttons // In vertical mode, we have to offset the editor buttons otherwise they hide the editor buttons
if(!window.viewerMode && settings.layoutOrientation == "vertical") { if(!window.viewerMode && settings.layoutOrientation == "vertical") {
$previewButtonsElt.css('right', parseInt($previewButtonsElt.css('right')) + $editorButtonsElt.width()); $previewButtonsElt.css('right', parseInt($previewButtonsElt.css('right')) + $editorButtonsElt.width());
@ -845,7 +845,7 @@ define([
$(this).find(".modal-footer a:last").click(); $(this).find(".modal-footer a:last").click();
} }
}); });
// Hide menu panel when clicking 'Save as' button // Hide menu panel when clicking 'Save as' button
$('.collapse-save-as a').click(function() { $('.collapse-save-as a').click(function() {
$menuPanelElt.collapse('hide'); $menuPanelElt.collapse('hide');
@ -1008,7 +1008,7 @@ define([
}); });
}); });
} }
createTooltip(".tooltip-lazy-rendering", 'Disable preview rendering while typing in order to offload CPU. Refresh preview after 500 ms of inactivity.'); createTooltip(".tooltip-lazy-rendering", 'Disable preview rendering while typing in order to offload CPU. Refresh preview after 500 ms of inactivity.');
createTooltip(".tooltip-default-content", [ createTooltip(".tooltip-default-content", [
'Thanks for supporting StackEdit by adding a backlink in your documents!<br/><br/>', 'Thanks for supporting StackEdit by adding a backlink in your documents!<br/><br/>',
@ -1028,7 +1028,7 @@ define([
keyboard: false, keyboard: false,
show: false show: false
}); });
// Load images // Load images
_.each(document.querySelectorAll('img'), function(imgElt) { _.each(document.querySelectorAll('img'), function(imgElt) {
var $imgElt = $(imgElt); var $imgElt = $(imgElt);
@ -1045,6 +1045,8 @@ define([
}, ''); }, '');
document.getElementById('input-settings-theme').innerHTML = themeOptions; document.getElementById('input-settings-theme').innerHTML = themeOptions;
} }
$('.modal-header').append('<a class="dialog-header-message" href="https://stackedit-beta.herokuapp.com/" target="_blank">Try StackEdit 4 beta!</a>');
}); });
return core; return core;

View File

@ -75,7 +75,7 @@
@nav-disabled-link-color: @disabled-color; @nav-disabled-link-color: @disabled-color;
@nav-disabled-link-hover-color: @disabled-color; @nav-disabled-link-hover-color: @disabled-color;
@nav-tabs-border-color: @transparent; @nav-tabs-border-color: @transparent;
@nav-tabs-link-hover-border-color: @transparent; @nav-tabs-link-hover-border-color: @transparent;
@dropdown-bg: @secondary-bg-lighter; @dropdown-bg: @secondary-bg-lighter;
@dropdown-border: @secondary-border-color; @dropdown-border: @secondary-border-color;
@dropdown-link-color: @secondary-color-darkest; @dropdown-link-color: @secondary-color-darkest;
@ -247,15 +247,22 @@ a {
z-index: 1050 !important; z-index: 1050 !important;
} }
.dialog-header-message {
position: absolute;
top: 12px;
right: 55px;
font-weight: bold;
}
/******************* /*******************
* Buttons * Buttons
*******************/ *******************/
.btn { .btn {
padding: 8px 11px; padding: 8px 11px;
.transition(~"background-color ease-in-out .15s, color ease-in-out .15s, border-color ease-in-out .15s"); .transition(~"background-color ease-in-out .15s, color ease-in-out .15s, border-color ease-in-out .15s");
} }
.btn-default { .btn-default {
&:hover, &:hover,
@ -323,7 +330,7 @@ a {
/******************** /********************
* Input * Input
********************/ ********************/
// Fix form-inline broken since Bootstrap v3 // Fix form-inline broken since Bootstrap v3
.form-inline { .form-inline {
.form-control { .form-control {
@ -347,7 +354,7 @@ a {
.form-control-focus(@color: @secondary-desaturated) { .form-control-focus(@color: @secondary-desaturated) {
@color-rgba: rgba(red(@color), green(@color), blue(@color), .6); @color-rgba: rgba(red(@color), green(@color), blue(@color), .6);
&:focus { &:focus {
border-color: @input-border; border-color: @input-border;
outline: 0; outline: 0;
.box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 12px @{color-rgba}"); .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 12px @{color-rgba}");
} }
@ -379,7 +386,7 @@ a {
&:first-child .btn { &:first-child .btn {
margin-right: 6px; margin-right: 6px;
} }
&:last-child .btn { &:last-child .btn {
margin-left: 6px; margin-left: 6px;
} }
@ -389,7 +396,7 @@ a {
/******************* /*******************
* Navbar * Navbar
*******************/ *******************/
.navbar { .navbar {
position: static; position: static;
padding: 0; padding: 0;
@ -435,7 +442,7 @@ a {
} }
} }
} }
.file-title-navbar { .file-title-navbar {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
@ -446,7 +453,7 @@ a {
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
} }
.input-file-title-container { .input-file-title-container {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
@ -474,21 +481,21 @@ a {
-webkit-animation: indicator 0.6s ease-out infinite; /* Safari and Chrome */ -webkit-animation: indicator 0.6s ease-out infinite; /* Safari and Chrome */
} }
} }
.offline-status > div { .offline-status > div {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
height: @input-height-base; height: @input-height-base;
padding: 9px 10px; padding: 9px 10px;
} }
.left-buttons-dropdown, .right-buttons-dropdown { .left-buttons-dropdown, .right-buttons-dropdown {
> .nav { > .nav {
margin-left: 0; margin-left: 0;
margin-right: 0; margin-right: 0;
} }
} }
div.dropdown-menu { div.dropdown-menu {
top: initial; top: initial;
padding: 5px; padding: 5px;
@ -509,7 +516,7 @@ a {
* Menu/Document panels * Menu/Document panels
*********************/ *********************/
// Common style // Common style
.menu-panel, .document-panel { .menu-panel, .document-panel {
display: block; display: block;
position: absolute; position: absolute;
@ -609,7 +616,7 @@ a {
border-left: 1px solid @secondary-border-color-light; border-left: 1px solid @secondary-border-color-light;
.icon-layers { .icon-layers {
font-size: 135%; font-size: 135%;
} }
} }
.search-bar { .search-bar {
position: absolute; position: absolute;
@ -638,8 +645,8 @@ a {
padding-left: 30px; padding-left: 30px;
padding-right: 30px; padding-right: 30px;
} }
} }
} }
} }
// Dropdown document selector // Dropdown document selector
@ -659,7 +666,7 @@ a {
/************************** /**************************
* Document manager * Document manager
**************************/ **************************/
.modal-document-manager { .modal-document-manager {
.nav-pills { .nav-pills {
margin-bottom: 15px; margin-bottom: 15px;
@ -716,8 +723,8 @@ a {
width: 220px; width: 220px;
} }
.name, .file-count { .name, .file-count {
padding: 9px 20px 9px 15px; padding: 9px 20px 9px 15px;
} }
} }
@ -761,7 +768,7 @@ a {
.dropdown-menu { .dropdown-menu {
padding-bottom: 20px; padding-bottom: 20px;
} }
.markdown-syntax, .table-of-contents { .markdown-syntax, .table-of-contents {
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
@ -769,12 +776,12 @@ a {
margin-right: -20px; margin-right: -20px;
width: 330px; width: 330px;
} }
.markdown-syntax { .markdown-syntax {
white-space: normal; white-space: normal;
max-height: 350px; max-height: 350px;
} }
.table-of-contents { .table-of-contents {
margin-left: -10px; margin-left: -10px;
max-height: 400px; max-height: 400px;
@ -803,7 +810,7 @@ a {
} }
} }
/************************** /**************************
* Settings dialog * Settings dialog
**************************/ **************************/
@ -812,12 +819,12 @@ a {
.modal-header { .modal-header {
padding-bottom: 0; padding-bottom: 0;
} }
textarea { textarea {
max-width: 100%; max-width: 100%;
min-height: 100px; min-height: 100px;
} }
.panel { .panel {
border: 0; border: 0;
border-radius: inherit; border-radius: inherit;
@ -825,7 +832,7 @@ a {
border-bottom: 1px solid @modal-content-separator-color; border-bottom: 1px solid @modal-content-separator-color;
.box-shadow(none); .box-shadow(none);
} }
.accordion-heading { .accordion-heading {
padding: 12px 15px; padding: 12px 15px;
.checkbox { .checkbox {
@ -833,7 +840,7 @@ a {
margin-bottom: 0; margin-bottom: 0;
} }
} }
.accordion-inner { .accordion-inner {
border: 0; border: 0;
padding: 10px 40px 20px; padding: 10px 40px 20px;
@ -843,10 +850,10 @@ a {
} }
.form-inline .label-text { .form-inline .label-text {
margin-left: 15px margin-left: 15px
} }
} }
} }
.tab-pane-button-container { .tab-pane-button-container {
width: 220px; width: 220px;
margin: 10px auto 20px; margin: 10px auto 20px;
@ -855,10 +862,10 @@ a {
padding-left: 15px; padding-left: 15px;
} }
} }
.nav-tabs { .nav-tabs {
margin: 15px 0 0; margin: 15px 0 0;
& > li > a { & > li > a {
&:hover, &:focus { &:hover, &:focus {
color: darken(@secondary, 30%); color: darken(@secondary, 30%);
@ -867,7 +874,7 @@ a {
border-bottom-color: @transparent; border-bottom-color: @transparent;
} }
} }
& > li.active > a { & > li.active > a {
&, &:hover, &:focus { &, &:hover, &:focus {
color: @btn-primary-color; color: @btn-primary-color;
@ -883,7 +890,7 @@ a {
/******************************** /********************************
* Publish/Sync/Share dialogs * Publish/Sync/Share dialogs
********************************/ ********************************/
.modal-manage-sync .sync-list, .modal-manage-sync .sync-list,
.modal-manage-publish .publish-list, .modal-manage-publish .publish-list,
.modal-manage-sharing .share-list { .modal-manage-sharing .share-list {
@ -910,7 +917,7 @@ a {
/********************************* /*********************************
* UI Layout * UI Layout
*********************************/ *********************************/
.ui-layout-resizer { .ui-layout-resizer {
overflow: visible !important; overflow: visible !important;
font-size: 14px !important; font-size: 14px !important;
@ -981,14 +988,14 @@ a {
/***************************** /*****************************
* Editor * Editor
*****************************/ *****************************/
.ace_editor { .ace_editor {
color: @tertiary-color-dark; color: @tertiary-color-dark;
} }
.ace-tm { .ace-tm {
background-color: @tertiary-bg; background-color: @tertiary-bg;
.ace_text-input { .ace_text-input {
box-sizing: initial; box-sizing: initial;
} }
@ -996,104 +1003,104 @@ a {
.ace_marker-layer .ace_active-line { .ace_marker-layer .ace_active-line {
background-color: fade(@primary-desaturated, 5%); background-color: fade(@primary-desaturated, 5%);
} }
.ace_cursor { .ace_cursor {
color: darken(@primary-desaturated, 30%); color: darken(@primary-desaturated, 30%);
} }
.ace_print-margin { .ace_print-margin {
background-color: fade(@primary-desaturated, 5%); background-color: fade(@primary-desaturated, 5%);
} }
.ace_markup.ace_heading { .ace_markup.ace_heading {
color: @tertiary-color-darker; color: @tertiary-color-darker;
font-weight: bold; font-weight: bold;
} }
.ace_markup.ace_list { .ace_markup.ace_list {
color: @tertiary-color; color: @tertiary-color;
} }
.ace_constant.ace_language { .ace_constant.ace_language {
color: @tertiary-color-light; color: @tertiary-color-light;
font-weight: normal; font-weight: normal;
} }
.ace_meta.ace_tag { .ace_meta.ace_tag {
color: @tertiary-color-dark; color: @tertiary-color-dark;
font-style: italic; font-style: italic;
font-weight: bold; font-weight: bold;
background-color: @code-bg; background-color: @code-bg;
} }
.ace_keyword.ace_operator { .ace_keyword.ace_operator {
color: @tertiary-color-dark; color: @tertiary-color-dark;
background-color: transparent; background-color: transparent;
} }
.ace_storage, .ace_keyword { .ace_storage, .ace_keyword {
color: @tertiary-color-dark; color: @tertiary-color-dark;
background-color: @code-bg; background-color: @code-bg;
font-weight: bold; font-weight: bold;
} }
.ace_entity.ace_name.ace_function { .ace_entity.ace_name.ace_function {
color: @tertiary-color-darker; color: @tertiary-color-darker;
font-weight: bold; font-weight: bold;
} }
.ace_string { .ace_string {
color: @tertiary-color-dark; color: @tertiary-color-dark;
font-style: italic; font-style: italic;
background-color: @code-bg; background-color: @code-bg;
} }
.ace_invalid { .ace_invalid {
color: inherit; color: inherit;
background: inherit; background: inherit;
} }
.ace_strong { .ace_strong {
color: @tertiary-color-dark; color: @tertiary-color-dark;
font-weight: bold; font-weight: bold;
} }
.ace_emphasis { .ace_emphasis {
color: @tertiary-color-darker; color: @tertiary-color-darker;
font-style: italic; font-style: italic;
} }
.ace_blockquote { .ace_blockquote {
color: @tertiary-color; color: @tertiary-color;
} }
.ace_code { .ace_code {
color: @tertiary-color-darker; color: @tertiary-color-darker;
background-color: @code-bg; background-color: @code-bg;
} }
.ace_code_block { .ace_code_block {
color: @tertiary-color-darker; color: @tertiary-color-darker;
} }
.ace_link { .ace_link {
color: @tertiary-color; color: @tertiary-color;
background-color: @code-bg; background-color: @code-bg;
} }
.ace_description { .ace_description {
color: @tertiary-color; color: @tertiary-color;
} }
.ace_constant { .ace_constant {
color: @tertiary-color-dark; color: @tertiary-color-dark;
} }
.ace_comment { .ace_comment {
color: @tertiary-color-light; color: @tertiary-color-light;
font-style: italic; font-style: italic;
} }
.ace_marker-layer .misspelled { .ace_marker-layer .misspelled {
position: absolute; position: absolute;
z-index: -2; z-index: -2;
@ -1231,7 +1238,7 @@ div.dropdown-menu, {
margin: 15px 0; margin: 15px 0;
} }
} }
.btn-gittip { .btn-gittip {
width: 52px; width: 52px;
height: 25px; height: 25px;
@ -1357,7 +1364,7 @@ div.jGrowl {
/******************* /*******************
* Viewer * Viewer
*******************/ *******************/
.viewer { .viewer {
.document-panel .search-bar { .document-panel .search-bar {
padding: 20px 20px 10px; padding: 20px 20px 10px;
@ -1365,11 +1372,11 @@ div.jGrowl {
display: none; display: none;
} }
} }
.ui-layout-toggler { .ui-layout-toggler {
display: none !important; display: none !important;
} }
.navbar .file-title-navbar { .navbar .file-title-navbar {
cursor: initial; cursor: initial;
.box-shadow(none); .box-shadow(none);