Implemented draggable extension buttons

This commit is contained in:
benweet 2014-04-23 00:39:00 +01:00
commit f165adbe4e
18 changed files with 303 additions and 124 deletions

View File

@ -74,19 +74,6 @@ module.exports = function(grunt) {
},
},
'string-replace': {
'font-parameters': {
files: {
'./': 'public/res-min/themes/*.css',
},
options: {
replacements: [
{
pattern: /(font\/fontello\.\w+)\?\w+/g,
replacement: '$1'
}
]
}
},
'constants': {
files: {
'public/res/constants.js': 'public/res/constants.js'
@ -202,10 +189,8 @@ module.exports = function(grunt) {
*/
grunt.registerTask('build-css', function() {
// First compile less files
// Compile less files
grunt.task.run('less:compile');
// Remove fontello checksum arguments
grunt.task.run('string-replace:font-parameters');
});

File diff suppressed because one or more lines are too long

View File

@ -894,7 +894,7 @@ li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
.asciidoc .hljs-emphasis,.markdown .hljs-emphasis{font-style:italic}
.nginx .hljs-built_in{font-weight:normal}
.coffeescript .javascript,.javascript .xml,.lasso .markup,.tex .hljs-formula,.xml .javascript,.xml .vbscript,.xml .css,.xml .hljs-cdata{opacity:0.5}
@font-face{font-family:'fontello';src:url('../font/fontello.eot');src:url('../font/fontello.eot#iefix') format('embedded-opentype'),url('../font/fontello.woff') format('woff'),url('../font/fontello.ttf') format('truetype'),url('../font/fontello.svg#fontello') format('svg');font-weight:normal;font-style:normal}[class^="icon-"]:before,[class*=" icon-"]:before{font-family:"fontello";font-style:normal;font-weight:normal;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em;}
@font-face{font-family:'fontello';src:url('../font/fontello.eot?24620533');src:url('../font/fontello.eot?24620533#iefix') format('embedded-opentype'),url('../font/fontello.woff?24620533') format('woff'),url('../font/fontello.ttf?24620533') format('truetype'),url('../font/fontello.svg?24620533#fontello') format('svg');font-weight:normal;font-style:normal}[class^="icon-"]:before,[class*=" icon-"]:before{font-family:"fontello";font-style:normal;font-weight:normal;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em;}
.icon-glass:before{content:'\e801'}
.icon-archive:before{content:'\e859'}
.icon-search:before{content:'\e803'}
@ -1213,7 +1213,11 @@ li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
.icon-chat:before{content:'\e83e'}
.icon-folder-open:before{content:'\e81e'}
.icon-up-circled:before{content:'\e893'}
<<<<<<< HEAD
@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:300;src:local('Source Sans Pro Light'),local('SourceSansPro-Light'),url("../font/SourceSansPro-Light-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:400;src:local('Source Sans Pro'),local('SourceSansPro'),url("../font/SourceSansPro-Regular-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:700;src:local('Source Sans Pro Bold'),local('SourceSansPro-Bold'),url("../font/SourceSansPro-Bold-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:300;src:local('Source Sans Pro Light Italic'),local('SourceSansProLight-Italic'),url("../font/SourceSansPro-LightItalic-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:400;src:local('Source Sans Pro Italic'),local('SourceSansPro-Italic'),url("../font/SourceSansPro-Italic-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:700;src:local('Source Sans Pro Bold Italic'),local('SourceSansPro-BoldItalic'),url("../font/SourceSansPro-BoldItalic-webfont.woff") format('woff')}@font-face{font-family:'Source Code Pro';font-style:normal;font-weight:400;src:local('Source Code Pro'),local('SourceCodePro-Regular'),url("../font/SourceCodePro-Regular-webfont.woff") format('woff')}@font-face{font-family:'Source Code Pro';font-style:normal;font-weight:700;src:local('Source Code Pro Bold'),local('SourceCodePro-Bold'),url("../font/SourceCodePro-Bold-webfont.woff") format('woff')}.container{margin-bottom:180px}
=======
@font-face{font-family:'fontello';src:url('../font/fontello.svg#fontello') format('svg'),url('../font/fontello.woff') format('woff');font-weight:normal;font-style:normal}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:300;src:local('Source Sans Pro Light'),local('SourceSansPro-Light'),url("../font/SourceSansPro-Light-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:400;src:local('Source Sans Pro'),local('SourceSansPro'),url("../font/SourceSansPro-Regular-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:700;src:local('Source Sans Pro Bold'),local('SourceSansPro-Bold'),url("../font/SourceSansPro-Bold-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:300;src:local('Source Sans Pro Light Italic'),local('SourceSansProLight-Italic'),url("../font/SourceSansPro-LightItalic-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:400;src:local('Source Sans Pro Italic'),local('SourceSansPro-Italic'),url("../font/SourceSansPro-Italic-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:700;src:local('Source Sans Pro Bold Italic'),local('SourceSansPro-BoldItalic'),url("../font/SourceSansPro-BoldItalic-webfont.woff") format('woff')}@font-face{font-family:'Source Code Pro';font-style:normal;font-weight:400;src:local('Source Code Pro'),local('SourceCodePro-Regular'),url("../font/SourceCodePro-Regular-webfont.woff") format('woff')}@font-face{font-family:'Source Code Pro';font-style:normal;font-weight:700;src:local('Source Code Pro Bold'),local('SourceCodePro-Bold'),url("../font/SourceCodePro-Bold-webfont.woff") format('woff')}@font-face{font-family:'Inconsolata';font-style:normal;font-weight:400;src:local('Inconsolata'),url("../font/Inconsolata-Regular-webfont.woff") format('woff')}@font-face{font-family:'Inconsolata';font-style:normal;font-weight:700;src:local('Inconsolata Bold'),local('Inconsolata-Bold'),url("../font/Inconsolata-Bold-webfont.woff") format('woff')}@font-face{font-family:'Anonymous Pro';font-style:normal;font-weight:400;src:local('Anonymous Pro'),local('AnonymousPro'),url("../font/AnonymousPro-Regular-webfont.woff") format('woff')}@font-face{font-family:'Anonymous Pro';font-style:normal;font-weight:700;src:local('Anonymous Pro Bold'),local('AnonymousPro-Bold'),url("../font/AnonymousPro-Bold-webfont.woff") format('woff')}@font-face{font-family:'Anonymous Pro';font-style:italic;font-weight:400;src:local('Anonymous Pro Italic'),local('AnonymousPro-Italic'),url("../font/AnonymousPro-Italic-webfont.woff") format('woff')}@font-face{font-family:'Anonymous Pro';font-style:italic;font-weight:700;src:local('Anonymous Pro Bold Italic'),local('AnonymousPro-BoldItalic'),url("../font/AnonymousPro-BoldItalic-webfont.woff") format('woff')}.container{margin-bottom:180px}
>>>>>>> 754d9153095ec89be57ca8bd2144ddbac1b0eebb
a code{color:inherit}
h1{font-size:2.6em}
h2{font-size:2.15em}

View File

@ -909,7 +909,7 @@ li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
.asciidoc .hljs-emphasis,.markdown .hljs-emphasis{font-style:italic}
.nginx .hljs-built_in{font-weight:normal}
.coffeescript .javascript,.javascript .xml,.lasso .markup,.tex .hljs-formula,.xml .javascript,.xml .vbscript,.xml .css,.xml .hljs-cdata{opacity:0.5}
@font-face{font-family:'fontello';src:url('../font/fontello.eot');src:url('../font/fontello.eot#iefix') format('embedded-opentype'),url('../font/fontello.woff') format('woff'),url('../font/fontello.ttf') format('truetype'),url('../font/fontello.svg#fontello') format('svg');font-weight:normal;font-style:normal}[class^="icon-"]:before,[class*=" icon-"]:before{font-family:"fontello";font-style:normal;font-weight:normal;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em;}
@font-face{font-family:'fontello';src:url('../font/fontello.eot?24620533');src:url('../font/fontello.eot?24620533#iefix') format('embedded-opentype'),url('../font/fontello.woff?24620533') format('woff'),url('../font/fontello.ttf?24620533') format('truetype'),url('../font/fontello.svg?24620533#fontello') format('svg');font-weight:normal;font-style:normal}[class^="icon-"]:before,[class*=" icon-"]:before{font-family:"fontello";font-style:normal;font-weight:normal;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em;}
.icon-glass:before{content:'\e801'}
.icon-archive:before{content:'\e859'}
.icon-search:before{content:'\e803'}
@ -1228,7 +1228,11 @@ li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
.icon-chat:before{content:'\e83e'}
.icon-folder-open:before{content:'\e81e'}
.icon-up-circled:before{content:'\e893'}
<<<<<<< HEAD
@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:300;src:local('Source Sans Pro Light'),local('SourceSansPro-Light'),url("../font/SourceSansPro-Light-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:400;src:local('Source Sans Pro'),local('SourceSansPro'),url("../font/SourceSansPro-Regular-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:700;src:local('Source Sans Pro Bold'),local('SourceSansPro-Bold'),url("../font/SourceSansPro-Bold-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:300;src:local('Source Sans Pro Light Italic'),local('SourceSansProLight-Italic'),url("../font/SourceSansPro-LightItalic-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:400;src:local('Source Sans Pro Italic'),local('SourceSansPro-Italic'),url("../font/SourceSansPro-Italic-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:700;src:local('Source Sans Pro Bold Italic'),local('SourceSansPro-BoldItalic'),url("../font/SourceSansPro-BoldItalic-webfont.woff") format('woff')}@font-face{font-family:'Source Code Pro';font-style:normal;font-weight:400;src:local('Source Code Pro'),local('SourceCodePro-Regular'),url("../font/SourceCodePro-Regular-webfont.woff") format('woff')}@font-face{font-family:'Source Code Pro';font-style:normal;font-weight:700;src:local('Source Code Pro Bold'),local('SourceCodePro-Bold'),url("../font/SourceCodePro-Bold-webfont.woff") format('woff')}.container{margin-bottom:180px}
=======
@font-face{font-family:'fontello';src:url('../font/fontello.svg#fontello') format('svg'),url('../font/fontello.woff') format('woff');font-weight:normal;font-style:normal}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:300;src:local('Source Sans Pro Light'),local('SourceSansPro-Light'),url("../font/SourceSansPro-Light-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:400;src:local('Source Sans Pro'),local('SourceSansPro'),url("../font/SourceSansPro-Regular-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:700;src:local('Source Sans Pro Bold'),local('SourceSansPro-Bold'),url("../font/SourceSansPro-Bold-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:300;src:local('Source Sans Pro Light Italic'),local('SourceSansProLight-Italic'),url("../font/SourceSansPro-LightItalic-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:400;src:local('Source Sans Pro Italic'),local('SourceSansPro-Italic'),url("../font/SourceSansPro-Italic-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:700;src:local('Source Sans Pro Bold Italic'),local('SourceSansPro-BoldItalic'),url("../font/SourceSansPro-BoldItalic-webfont.woff") format('woff')}@font-face{font-family:'Source Code Pro';font-style:normal;font-weight:400;src:local('Source Code Pro'),local('SourceCodePro-Regular'),url("../font/SourceCodePro-Regular-webfont.woff") format('woff')}@font-face{font-family:'Source Code Pro';font-style:normal;font-weight:700;src:local('Source Code Pro Bold'),local('SourceCodePro-Bold'),url("../font/SourceCodePro-Bold-webfont.woff") format('woff')}@font-face{font-family:'Inconsolata';font-style:normal;font-weight:400;src:local('Inconsolata'),url("../font/Inconsolata-Regular-webfont.woff") format('woff')}@font-face{font-family:'Inconsolata';font-style:normal;font-weight:700;src:local('Inconsolata Bold'),local('Inconsolata-Bold'),url("../font/Inconsolata-Bold-webfont.woff") format('woff')}@font-face{font-family:'Anonymous Pro';font-style:normal;font-weight:400;src:local('Anonymous Pro'),local('AnonymousPro'),url("../font/AnonymousPro-Regular-webfont.woff") format('woff')}@font-face{font-family:'Anonymous Pro';font-style:normal;font-weight:700;src:local('Anonymous Pro Bold'),local('AnonymousPro-Bold'),url("../font/AnonymousPro-Bold-webfont.woff") format('woff')}@font-face{font-family:'Anonymous Pro';font-style:italic;font-weight:400;src:local('Anonymous Pro Italic'),local('AnonymousPro-Italic'),url("../font/AnonymousPro-Italic-webfont.woff") format('woff')}@font-face{font-family:'Anonymous Pro';font-style:italic;font-weight:700;src:local('Anonymous Pro Bold Italic'),local('AnonymousPro-BoldItalic'),url("../font/AnonymousPro-BoldItalic-webfont.woff") format('woff')}.container{margin-bottom:180px}
>>>>>>> 754d9153095ec89be57ca8bd2144ddbac1b0eebb
a code{color:inherit}
h1{font-size:2.6em}
h2{font-size:2.15em}

View File

@ -909,7 +909,7 @@ li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
.asciidoc .hljs-emphasis,.markdown .hljs-emphasis{font-style:italic}
.nginx .hljs-built_in{font-weight:normal}
.coffeescript .javascript,.javascript .xml,.lasso .markup,.tex .hljs-formula,.xml .javascript,.xml .vbscript,.xml .css,.xml .hljs-cdata{opacity:0.5}
@font-face{font-family:'fontello';src:url('../font/fontello.eot');src:url('../font/fontello.eot#iefix') format('embedded-opentype'),url('../font/fontello.woff') format('woff'),url('../font/fontello.ttf') format('truetype'),url('../font/fontello.svg#fontello') format('svg');font-weight:normal;font-style:normal}[class^="icon-"]:before,[class*=" icon-"]:before{font-family:"fontello";font-style:normal;font-weight:normal;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em;}
@font-face{font-family:'fontello';src:url('../font/fontello.eot?24620533');src:url('../font/fontello.eot?24620533#iefix') format('embedded-opentype'),url('../font/fontello.woff?24620533') format('woff'),url('../font/fontello.ttf?24620533') format('truetype'),url('../font/fontello.svg?24620533#fontello') format('svg');font-weight:normal;font-style:normal}[class^="icon-"]:before,[class*=" icon-"]:before{font-family:"fontello";font-style:normal;font-weight:normal;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em;}
.icon-glass:before{content:'\e801'}
.icon-archive:before{content:'\e859'}
.icon-search:before{content:'\e803'}
@ -1228,7 +1228,11 @@ li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
.icon-chat:before{content:'\e83e'}
.icon-folder-open:before{content:'\e81e'}
.icon-up-circled:before{content:'\e893'}
<<<<<<< HEAD
@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:300;src:local('Source Sans Pro Light'),local('SourceSansPro-Light'),url("../font/SourceSansPro-Light-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:400;src:local('Source Sans Pro'),local('SourceSansPro'),url("../font/SourceSansPro-Regular-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:700;src:local('Source Sans Pro Bold'),local('SourceSansPro-Bold'),url("../font/SourceSansPro-Bold-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:300;src:local('Source Sans Pro Light Italic'),local('SourceSansProLight-Italic'),url("../font/SourceSansPro-LightItalic-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:400;src:local('Source Sans Pro Italic'),local('SourceSansPro-Italic'),url("../font/SourceSansPro-Italic-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:700;src:local('Source Sans Pro Bold Italic'),local('SourceSansPro-BoldItalic'),url("../font/SourceSansPro-BoldItalic-webfont.woff") format('woff')}@font-face{font-family:'Source Code Pro';font-style:normal;font-weight:400;src:local('Source Code Pro'),local('SourceCodePro-Regular'),url("../font/SourceCodePro-Regular-webfont.woff") format('woff')}@font-face{font-family:'Source Code Pro';font-style:normal;font-weight:700;src:local('Source Code Pro Bold'),local('SourceCodePro-Bold'),url("../font/SourceCodePro-Bold-webfont.woff") format('woff')}.container{margin-bottom:180px}
=======
@font-face{font-family:'fontello';src:url('../font/fontello.svg#fontello') format('svg'),url('../font/fontello.woff') format('woff');font-weight:normal;font-style:normal}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:300;src:local('Source Sans Pro Light'),local('SourceSansPro-Light'),url("../font/SourceSansPro-Light-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:400;src:local('Source Sans Pro'),local('SourceSansPro'),url("../font/SourceSansPro-Regular-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:700;src:local('Source Sans Pro Bold'),local('SourceSansPro-Bold'),url("../font/SourceSansPro-Bold-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:300;src:local('Source Sans Pro Light Italic'),local('SourceSansProLight-Italic'),url("../font/SourceSansPro-LightItalic-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:400;src:local('Source Sans Pro Italic'),local('SourceSansPro-Italic'),url("../font/SourceSansPro-Italic-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:700;src:local('Source Sans Pro Bold Italic'),local('SourceSansPro-BoldItalic'),url("../font/SourceSansPro-BoldItalic-webfont.woff") format('woff')}@font-face{font-family:'Source Code Pro';font-style:normal;font-weight:400;src:local('Source Code Pro'),local('SourceCodePro-Regular'),url("../font/SourceCodePro-Regular-webfont.woff") format('woff')}@font-face{font-family:'Source Code Pro';font-style:normal;font-weight:700;src:local('Source Code Pro Bold'),local('SourceCodePro-Bold'),url("../font/SourceCodePro-Bold-webfont.woff") format('woff')}@font-face{font-family:'Inconsolata';font-style:normal;font-weight:400;src:local('Inconsolata'),url("../font/Inconsolata-Regular-webfont.woff") format('woff')}@font-face{font-family:'Inconsolata';font-style:normal;font-weight:700;src:local('Inconsolata Bold'),local('Inconsolata-Bold'),url("../font/Inconsolata-Bold-webfont.woff") format('woff')}@font-face{font-family:'Anonymous Pro';font-style:normal;font-weight:400;src:local('Anonymous Pro'),local('AnonymousPro'),url("../font/AnonymousPro-Regular-webfont.woff") format('woff')}@font-face{font-family:'Anonymous Pro';font-style:normal;font-weight:700;src:local('Anonymous Pro Bold'),local('AnonymousPro-Bold'),url("../font/AnonymousPro-Bold-webfont.woff") format('woff')}@font-face{font-family:'Anonymous Pro';font-style:italic;font-weight:400;src:local('Anonymous Pro Italic'),local('AnonymousPro-Italic'),url("../font/AnonymousPro-Italic-webfont.woff") format('woff')}@font-face{font-family:'Anonymous Pro';font-style:italic;font-weight:700;src:local('Anonymous Pro Bold Italic'),local('AnonymousPro-BoldItalic'),url("../font/AnonymousPro-BoldItalic-webfont.woff") format('woff')}.container{margin-bottom:180px}
>>>>>>> 754d9153095ec89be57ca8bd2144ddbac1b0eebb
a code{color:inherit}
h1{font-size:2.6em}
h2{font-size:2.15em}

View File

@ -909,7 +909,7 @@ li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
.asciidoc .hljs-emphasis,.markdown .hljs-emphasis{font-style:italic}
.nginx .hljs-built_in{font-weight:normal}
.coffeescript .javascript,.javascript .xml,.lasso .markup,.tex .hljs-formula,.xml .javascript,.xml .vbscript,.xml .css,.xml .hljs-cdata{opacity:0.5}
@font-face{font-family:'fontello';src:url('../font/fontello.eot');src:url('../font/fontello.eot#iefix') format('embedded-opentype'),url('../font/fontello.woff') format('woff'),url('../font/fontello.ttf') format('truetype'),url('../font/fontello.svg#fontello') format('svg');font-weight:normal;font-style:normal}[class^="icon-"]:before,[class*=" icon-"]:before{font-family:"fontello";font-style:normal;font-weight:normal;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em;}
@font-face{font-family:'fontello';src:url('../font/fontello.eot?24620533');src:url('../font/fontello.eot?24620533#iefix') format('embedded-opentype'),url('../font/fontello.woff?24620533') format('woff'),url('../font/fontello.ttf?24620533') format('truetype'),url('../font/fontello.svg?24620533#fontello') format('svg');font-weight:normal;font-style:normal}[class^="icon-"]:before,[class*=" icon-"]:before{font-family:"fontello";font-style:normal;font-weight:normal;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em;}
.icon-glass:before{content:'\e801'}
.icon-archive:before{content:'\e859'}
.icon-search:before{content:'\e803'}
@ -1228,7 +1228,11 @@ li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
.icon-chat:before{content:'\e83e'}
.icon-folder-open:before{content:'\e81e'}
.icon-up-circled:before{content:'\e893'}
<<<<<<< HEAD
@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:300;src:local('Source Sans Pro Light'),local('SourceSansPro-Light'),url("../font/SourceSansPro-Light-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:400;src:local('Source Sans Pro'),local('SourceSansPro'),url("../font/SourceSansPro-Regular-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:700;src:local('Source Sans Pro Bold'),local('SourceSansPro-Bold'),url("../font/SourceSansPro-Bold-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:300;src:local('Source Sans Pro Light Italic'),local('SourceSansProLight-Italic'),url("../font/SourceSansPro-LightItalic-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:400;src:local('Source Sans Pro Italic'),local('SourceSansPro-Italic'),url("../font/SourceSansPro-Italic-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:700;src:local('Source Sans Pro Bold Italic'),local('SourceSansPro-BoldItalic'),url("../font/SourceSansPro-BoldItalic-webfont.woff") format('woff')}@font-face{font-family:'Source Code Pro';font-style:normal;font-weight:400;src:local('Source Code Pro'),local('SourceCodePro-Regular'),url("../font/SourceCodePro-Regular-webfont.woff") format('woff')}@font-face{font-family:'Source Code Pro';font-style:normal;font-weight:700;src:local('Source Code Pro Bold'),local('SourceCodePro-Bold'),url("../font/SourceCodePro-Bold-webfont.woff") format('woff')}.container{margin-bottom:180px}
=======
@font-face{font-family:'fontello';src:url('../font/fontello.svg#fontello') format('svg'),url('../font/fontello.woff') format('woff');font-weight:normal;font-style:normal}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:300;src:local('Source Sans Pro Light'),local('SourceSansPro-Light'),url("../font/SourceSansPro-Light-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:400;src:local('Source Sans Pro'),local('SourceSansPro'),url("../font/SourceSansPro-Regular-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:700;src:local('Source Sans Pro Bold'),local('SourceSansPro-Bold'),url("../font/SourceSansPro-Bold-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:300;src:local('Source Sans Pro Light Italic'),local('SourceSansProLight-Italic'),url("../font/SourceSansPro-LightItalic-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:400;src:local('Source Sans Pro Italic'),local('SourceSansPro-Italic'),url("../font/SourceSansPro-Italic-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:700;src:local('Source Sans Pro Bold Italic'),local('SourceSansPro-BoldItalic'),url("../font/SourceSansPro-BoldItalic-webfont.woff") format('woff')}@font-face{font-family:'Source Code Pro';font-style:normal;font-weight:400;src:local('Source Code Pro'),local('SourceCodePro-Regular'),url("../font/SourceCodePro-Regular-webfont.woff") format('woff')}@font-face{font-family:'Source Code Pro';font-style:normal;font-weight:700;src:local('Source Code Pro Bold'),local('SourceCodePro-Bold'),url("../font/SourceCodePro-Bold-webfont.woff") format('woff')}@font-face{font-family:'Inconsolata';font-style:normal;font-weight:400;src:local('Inconsolata'),url("../font/Inconsolata-Regular-webfont.woff") format('woff')}@font-face{font-family:'Inconsolata';font-style:normal;font-weight:700;src:local('Inconsolata Bold'),local('Inconsolata-Bold'),url("../font/Inconsolata-Bold-webfont.woff") format('woff')}@font-face{font-family:'Anonymous Pro';font-style:normal;font-weight:400;src:local('Anonymous Pro'),local('AnonymousPro'),url("../font/AnonymousPro-Regular-webfont.woff") format('woff')}@font-face{font-family:'Anonymous Pro';font-style:normal;font-weight:700;src:local('Anonymous Pro Bold'),local('AnonymousPro-Bold'),url("../font/AnonymousPro-Bold-webfont.woff") format('woff')}@font-face{font-family:'Anonymous Pro';font-style:italic;font-weight:400;src:local('Anonymous Pro Italic'),local('AnonymousPro-Italic'),url("../font/AnonymousPro-Italic-webfont.woff") format('woff')}@font-face{font-family:'Anonymous Pro';font-style:italic;font-weight:700;src:local('Anonymous Pro Bold Italic'),local('AnonymousPro-BoldItalic'),url("../font/AnonymousPro-BoldItalic-webfont.woff") format('woff')}.container{margin-bottom:180px}
>>>>>>> 754d9153095ec89be57ca8bd2144ddbac1b0eebb
a code{color:inherit}
h1{font-size:2.6em}
h2{font-size:2.15em}

View File

@ -909,7 +909,7 @@ li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
.asciidoc .hljs-emphasis,.markdown .hljs-emphasis{font-style:italic}
.nginx .hljs-built_in{font-weight:normal}
.coffeescript .javascript,.javascript .xml,.lasso .markup,.tex .hljs-formula,.xml .javascript,.xml .vbscript,.xml .css,.xml .hljs-cdata{opacity:0.5}
@font-face{font-family:'fontello';src:url('../font/fontello.eot');src:url('../font/fontello.eot#iefix') format('embedded-opentype'),url('../font/fontello.woff') format('woff'),url('../font/fontello.ttf') format('truetype'),url('../font/fontello.svg#fontello') format('svg');font-weight:normal;font-style:normal}[class^="icon-"]:before,[class*=" icon-"]:before{font-family:"fontello";font-style:normal;font-weight:normal;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em;}
@font-face{font-family:'fontello';src:url('../font/fontello.eot?24620533');src:url('../font/fontello.eot?24620533#iefix') format('embedded-opentype'),url('../font/fontello.woff?24620533') format('woff'),url('../font/fontello.ttf?24620533') format('truetype'),url('../font/fontello.svg?24620533#fontello') format('svg');font-weight:normal;font-style:normal}[class^="icon-"]:before,[class*=" icon-"]:before{font-family:"fontello";font-style:normal;font-weight:normal;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em;}
.icon-glass:before{content:'\e801'}
.icon-archive:before{content:'\e859'}
.icon-search:before{content:'\e803'}
@ -1228,7 +1228,11 @@ li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
.icon-chat:before{content:'\e83e'}
.icon-folder-open:before{content:'\e81e'}
.icon-up-circled:before{content:'\e893'}
<<<<<<< HEAD
@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:300;src:local('Source Sans Pro Light'),local('SourceSansPro-Light'),url("../font/SourceSansPro-Light-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:400;src:local('Source Sans Pro'),local('SourceSansPro'),url("../font/SourceSansPro-Regular-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:700;src:local('Source Sans Pro Bold'),local('SourceSansPro-Bold'),url("../font/SourceSansPro-Bold-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:300;src:local('Source Sans Pro Light Italic'),local('SourceSansProLight-Italic'),url("../font/SourceSansPro-LightItalic-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:400;src:local('Source Sans Pro Italic'),local('SourceSansPro-Italic'),url("../font/SourceSansPro-Italic-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:700;src:local('Source Sans Pro Bold Italic'),local('SourceSansPro-BoldItalic'),url("../font/SourceSansPro-BoldItalic-webfont.woff") format('woff')}@font-face{font-family:'Source Code Pro';font-style:normal;font-weight:400;src:local('Source Code Pro'),local('SourceCodePro-Regular'),url("../font/SourceCodePro-Regular-webfont.woff") format('woff')}@font-face{font-family:'Source Code Pro';font-style:normal;font-weight:700;src:local('Source Code Pro Bold'),local('SourceCodePro-Bold'),url("../font/SourceCodePro-Bold-webfont.woff") format('woff')}.container{margin-bottom:180px}
=======
@font-face{font-family:'fontello';src:url('../font/fontello.svg#fontello') format('svg'),url('../font/fontello.woff') format('woff');font-weight:normal;font-style:normal}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:300;src:local('Source Sans Pro Light'),local('SourceSansPro-Light'),url("../font/SourceSansPro-Light-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:400;src:local('Source Sans Pro'),local('SourceSansPro'),url("../font/SourceSansPro-Regular-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:700;src:local('Source Sans Pro Bold'),local('SourceSansPro-Bold'),url("../font/SourceSansPro-Bold-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:300;src:local('Source Sans Pro Light Italic'),local('SourceSansProLight-Italic'),url("../font/SourceSansPro-LightItalic-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:400;src:local('Source Sans Pro Italic'),local('SourceSansPro-Italic'),url("../font/SourceSansPro-Italic-webfont.woff") format('woff')}@font-face{font-family:'Source Sans Pro';font-style:italic;font-weight:700;src:local('Source Sans Pro Bold Italic'),local('SourceSansPro-BoldItalic'),url("../font/SourceSansPro-BoldItalic-webfont.woff") format('woff')}@font-face{font-family:'Source Code Pro';font-style:normal;font-weight:400;src:local('Source Code Pro'),local('SourceCodePro-Regular'),url("../font/SourceCodePro-Regular-webfont.woff") format('woff')}@font-face{font-family:'Source Code Pro';font-style:normal;font-weight:700;src:local('Source Code Pro Bold'),local('SourceCodePro-Bold'),url("../font/SourceCodePro-Bold-webfont.woff") format('woff')}@font-face{font-family:'Inconsolata';font-style:normal;font-weight:400;src:local('Inconsolata'),url("../font/Inconsolata-Regular-webfont.woff") format('woff')}@font-face{font-family:'Inconsolata';font-style:normal;font-weight:700;src:local('Inconsolata Bold'),local('Inconsolata-Bold'),url("../font/Inconsolata-Bold-webfont.woff") format('woff')}@font-face{font-family:'Anonymous Pro';font-style:normal;font-weight:400;src:local('Anonymous Pro'),local('AnonymousPro'),url("../font/AnonymousPro-Regular-webfont.woff") format('woff')}@font-face{font-family:'Anonymous Pro';font-style:normal;font-weight:700;src:local('Anonymous Pro Bold'),local('AnonymousPro-Bold'),url("../font/AnonymousPro-Bold-webfont.woff") format('woff')}@font-face{font-family:'Anonymous Pro';font-style:italic;font-weight:400;src:local('Anonymous Pro Italic'),local('AnonymousPro-Italic'),url("../font/AnonymousPro-Italic-webfont.woff") format('woff')}@font-face{font-family:'Anonymous Pro';font-style:italic;font-weight:700;src:local('Anonymous Pro Bold Italic'),local('AnonymousPro-BoldItalic'),url("../font/AnonymousPro-BoldItalic-webfont.woff") format('woff')}.container{margin-bottom:180px}
>>>>>>> 754d9153095ec89be57ca8bd2144ddbac1b0eebb
a code{color:inherit}
h1{font-size:2.6em}
h2{font-size:2.15em}

View File

@ -112,7 +112,7 @@ define([
this.selectionEnd = 0;
this.cursorY = 0;
this.findOffset = function(offset) {
var walker = document.createTreeWalker(contentElt, 4);
var walker = document.createTreeWalker(contentElt, 4, null, false);
var text = '';
while(walker.nextNode()) {
text = walker.currentNode.nodeValue || '';
@ -141,13 +141,42 @@ define([
range.setEnd(offset.container, offset.offset);
return range;
};
var updateCursorCoordinates = utils.debounce(_.bind(function() {
$inputElt.toggleClass('has-selection', this.selectionStart !== this.selectionEnd);
var coordinates = this.getCoordinates(this.selectionEnd, this.selectionEndContainer, this.selectionEndOffset);
if(this.cursorY !== coordinates.y) {
this.cursorY = coordinates.y;
eventMgr.onCursorCoordinates(coordinates.x, coordinates.y);
}
if(this.adjustScroll) {
var adjust = inputElt.offsetHeight / 2;
if(adjust > 130) {
adjust = 130;
}
var cursorMinY = inputElt.scrollTop + adjust;
var cursorMaxY = inputElt.scrollTop + inputElt.offsetHeight - adjust;
if(selectionMgr.cursorY < cursorMinY) {
inputElt.scrollTop += selectionMgr.cursorY - cursorMinY;
}
else if(selectionMgr.cursorY > cursorMaxY) {
inputElt.scrollTop += selectionMgr.cursorY - cursorMaxY;
}
this.adjustScroll = false;
}
}, this));
this.setSelectionStartEnd = function(start, end, range, skipSelectionUpdate) {
if(start === undefined) {
start = this.selectionStart;
}
if(start < 0) {
start = 0;
}
if(end === undefined) {
end = this.selectionEnd;
}
if(end < 0) {
end = 0;
}
this.selectionStart = start;
this.selectionEnd = end;
var min = Math.min(start, end);
@ -160,17 +189,15 @@ define([
}
fileDesc.editorStart = this.selectionStart;
fileDesc.editorEnd = this.selectionEnd;
// Update cursor coordinates
$inputElt.toggleClass('has-selection', this.selectionStart !== this.selectionEnd);
var coordinates = this.getCoordinates(this.selectionEnd, this.selectionEndContainer, this.selectionEndOffset);
if(this.cursorY !== coordinates.y) {
this.cursorY = coordinates.y;
eventMgr.onCursorCoordinates(coordinates.x, coordinates.y);
}
updateCursorCoordinates();
return range;
};
this.saveSelectionState = (function() {
function save() {
var timeoutId;
function save(adjustScroll) {
clearTimeout(timeoutId);
timeoutId = undefined;
self.adjustScroll = adjustScroll;
if(fileChanged === false) {
var selectionStart = self.selectionStart;
var selectionEnd = self.selectionEnd;
@ -206,9 +233,15 @@ define([
}
undoMgr.saveSelectionState();
}
var debouncedSave = utils.debounce(save);
return function(debounced) {
debounced ? debouncedSave() : save();
return function(debounced, adjustScroll) {
adjustScroll = _.isBoolean(adjustScroll) ? adjustScroll : false;
if(debounced) {
clearTimeout(timeoutId);
timeoutId = _.delay(save, 5, adjustScroll);
}
else {
save(adjustScroll);
}
};
})();
this.getCoordinates = function(inputOffset, container, offset) {
@ -282,29 +315,12 @@ define([
editor.selectionMgr = selectionMgr;
$(document).on('selectionchange', '.editor-content', _.bind(selectionMgr.saveSelectionState, selectionMgr, true));
var adjustCursorPosition = (function() {
var adjust = utils.debounce(function() {
var adjust = inputElt.offsetHeight / 2;
if(adjust > 130) {
adjust = 130;
}
var cursorMinY = inputElt.scrollTop + adjust;
var cursorMaxY = inputElt.scrollTop + inputElt.offsetHeight - adjust;
if(selectionMgr.cursorY < cursorMinY) {
inputElt.scrollTop += selectionMgr.cursorY - cursorMinY;
}
else if(selectionMgr.cursorY > cursorMaxY) {
inputElt.scrollTop += selectionMgr.cursorY - cursorMaxY;
}
});
return function() {
if(inputElt === undefined) {
return;
}
selectionMgr.saveSelectionState(true);
adjust();
};
})();
function adjustCursorPosition() {
if(inputElt === undefined) {
return;
}
selectionMgr.saveSelectionState(true, true);
}
editor.adjustCursorPosition = adjustCursorPosition;
var textContent;

View File

@ -43,16 +43,22 @@ define([
buttonStat.onCreatePreviewButton = function() {
return _.template(buttonStatHTML, buttonStat.config);
};
var previewContentsElt;
var value1Elt;
var value2Elt;
var value3Elt;
var valueElt, value1Elt, value2Elt, value3Elt;
buttonStat.onReady = function() {
previewContentsElt = document.getElementById('preview-contents');
value1Elt = document.getElementById('span-stat-value1');
value2Elt = document.getElementById('span-stat-value2');
value3Elt = document.getElementById('span-stat-value3');
valueElt = document.querySelector('.stat-button .value');
value1Elt = document.querySelector('.stat-button-dropdown .value1');
value2Elt = document.querySelector('.stat-button-dropdown .value2');
value3Elt = document.querySelector('.stat-button-dropdown .value3');
};
var regex1, regex2, regex3;
buttonStat.onInit = function() {
regex1 = new RegExp(buttonStat.config.value1, "g");
regex2 = new RegExp(buttonStat.config.value2, "g");
regex3 = new RegExp(buttonStat.config.value3, "g");
};
buttonStat.onPreviewFinished = function() {
@ -63,11 +69,11 @@ define([
scriptElt.parentNode.removeChild(scriptElt);
}
var text = previewContentsEltClone.textContent;
value1Elt.textContent = (text.match(new RegExp(buttonStat.config.value1, "g")) || []).length;
value2Elt.textContent = (text.match(new RegExp(buttonStat.config.value2, "g")) || []).length;
value3Elt.textContent = (text.match(new RegExp(buttonStat.config.value3, "g")) || []).length;
valueElt.textContent = value1Elt.textContent = (text.match(regex1) || []).length;
value2Elt.textContent = (text.match(regex2) || []).length;
value3Elt.textContent = (text.match(regex3) || []).length;
};
return buttonStat;
});
});

View File

@ -17,8 +17,6 @@ define([
sectionList = sectionListParam;
};
var isPreviewVisible = true;
var $editorElt;
var $previewElt;
var mdSectionList = [];
@ -26,9 +24,6 @@ define([
var lastEditorScrollTop;
var lastPreviewScrollTop;
var buildSections = _.debounce(function() {
if(!isPreviewVisible) {
return;
}
mdSectionList = [];
var mdSectionOffset;
var scrollHeight;
@ -91,11 +86,28 @@ define([
doScrollSync();
}, 500);
var isPreviewVisible = true;
var isScrollEditor = false;
var isScrollPreview = false;
var isEditorMoving = false;
var isPreviewMoving = false;
var scrollingHelper = $('<div>');
function getDestScrollTop(srcScrollTop, srcSectionList, destSectionList) {
// Find the section corresponding to the offset
var sectionIndex;
var srcSection = _.find(srcSectionList, function(section, index) {
sectionIndex = index;
return srcScrollTop < section.endOffset;
});
if(srcSection === undefined) {
// Something very bad happened
return;
}
var posInSection = (srcScrollTop - srcSection.startOffset) / (srcSection.height || 1);
var destSection = destSectionList[sectionIndex];
return destSection.startOffset + destSection.height * posInSection;
}
var doScrollSync = _.throttle(function() {
if(!isPreviewVisible || mdSectionList.length === 0 || mdSectionList.length !== htmlSectionList.length) {
return;
@ -103,21 +115,6 @@ define([
var editorScrollTop = $editorElt.scrollTop();
editorScrollTop < 0 && (editorScrollTop = 0);
var previewScrollTop = $previewElt.scrollTop();
function getDestScrollTop(srcScrollTop, srcSectionList, destSectionList) {
// Find the section corresponding to the offset
var sectionIndex;
var srcSection = _.find(srcSectionList, function(section, index) {
sectionIndex = index;
return srcScrollTop < section.endOffset;
});
if(srcSection === undefined) {
// Something very bad happened
return;
}
var posInSection = (srcScrollTop - srcSection.startOffset) / (srcSection.height || 1);
var destSection = destSectionList[sectionIndex];
return destSection.startOffset + destSection.height * posInSection;
}
var destScrollTop;
// Perform the animation if diff > 9px
if(isScrollEditor === true) {
@ -223,12 +220,25 @@ define([
}
});
$previewElt.on('hide.layout.toggle', function() {
$(".preview-panel").on('hide.layout.toggle', function() {
isPreviewVisible = false;
});
$previewElt.on('shown.layout.toggle', function() {
}).on('shown.layout.toggle', function() {
isPreviewVisible = true;
});
// Reimplement anchor scrolling to work without preview
$('.extension-preview-buttons .table-of-contents').on('click', 'a', function(evt) {
evt.preventDefault();
var id = this.hash;
var $anchorElt = $previewElt.find(id);
if(!$anchorElt.length) {
return;
}
var previewScrollTop = $anchorElt.offset().top - $previewElt.offset().top + $previewElt.scrollTop();
$previewElt.scrollTop(previewScrollTop);
var editorScrollTop = getDestScrollTop(previewScrollTop, htmlSectionList, mdSectionList);
$editorElt.scrollTop(editorScrollTop);
});
};
var $previewContentsElt;

View File

@ -132,12 +132,24 @@ define([
elt.innerHTML = htmlToc;
}
});
// Add toc in the TOC button
// Add toc in the TOC button
_.each(tocEltList, function(elt) {
elt.innerHTML = htmlToc;
});
});
};
toc.onReady = function() {
var isPreviewVisible = true;
$(".preview-panel").on('hide.layout.toggle', function() {
isPreviewVisible = false;
}).on('shown.layout.toggle', function() {
isPreviewVisible = true;
});
$('.extension-preview-buttons .table-of-contents').on('click', 'a', function(evt) {
!isPreviewVisible && evt.preventDefault();
});
};
return toc;
});

View File

@ -41,9 +41,9 @@ define([
},
onEnd: function() {
storage.welcomeTour = 'done';
infoTooltip('.menu-panel .toggle-button *', 'Synchronize, publish and more...', 'right');
infoTooltip('.document-panel .toggle-button *', 'Create and manage documents', 'left');
infoTooltip('.extension-preview-buttons .btn-group:first', 'Need help with Markdown syntax?', 'left');
infoTooltip('.menu-panel .toggle-button *', 'Synchronize, publish...', 'right');
infoTooltip('.document-panel .toggle-button *', 'Create, manage documents', 'left');
infoTooltip('.drag-me', 'Drag me!', 'left');
infoTooltip('.layout-toggler-preview', 'Toggle preview', 'right');
},
template: [

View File

@ -62,7 +62,11 @@
</div>
</div>
</div>
<div class="extension-preview-buttons"></div>
<div class="extension-preview-buttons">
<div class="btn-group drag-me" title="Drag me!">
<i class="icon-menu"></i>
</div>
</div>
</div>
<div id="wmd-button-bar" class="hide"></div>

View File

@ -1,18 +1,19 @@
<button class="btn btn-info dropdown-toggle" title="Document statistics" data-toggle="dropdown">
<button class="btn btn-info dropdown-toggle stat-button" title="Document statistics" data-toggle="dropdown">
<i class="icon-chart-bar"></i>
<span class="value"></span>
</button>
<div class="dropdown-menu pull-right">
<div class="dropdown-menu pull-right stat-button-dropdown">
<h3>Statistics</h3>
<hr>
<div class="stat">
<div>
<%= name1 %>: <span id="span-stat-value1"></span>
<%= name1 %>: <span class="value1"></span>
</div>
<div>
<%= name2 %>: <span id="span-stat-value2"></span>
<%= name2 %>: <span class="value2"></span>
</div>
<div>
<%= name3 %>: <span id="span-stat-value3"></span>
<%= name3 %>: <span class="value3"></span>
</div>
</div>
</div>

View File

@ -25,6 +25,11 @@ define([
var menuPanelWidth = 280;
var documentPanelWidth = 320;
var titleMinWidth = 200;
var previewButtonsDropdownMargin = 130;
var previewButtonsOffset = {
x: -45,
y: -6
};
var windowSize;
var wrapperL1, wrapperL2, wrapperL3;
@ -353,6 +358,8 @@ define([
previewResizer.applyCss();
navbarToggler.applyCss();
previewButtons.adjustPosition();
onResize();
}
layout.resizeAll = resizeAll;
@ -406,6 +413,7 @@ define([
previewPanel.halfSize = true;
previewToggler.$elt.click(_.bind(previewPanel.toggle, previewPanel));
/*
// Hide extension buttons when preview is closed
previewPanel.$elt.on('hide.layout.toggle', function() {
previewButtons.bottom = 99999;
@ -417,7 +425,7 @@ define([
previewButtons.bottom = 6;
previewButtons.applyCss();
});
*/
// Open StackEdit Viewer if failing to open the preview
previewPanel.$elt.on('show.layout.toggle', function() {
_.defer(function() {
@ -458,7 +466,7 @@ define([
});
// Gesture
previewResizer.initHammer(true);
/*
navbar.initHammer();
menuPanel.initHammer();
@ -476,21 +484,58 @@ define([
documentPanel.hammer.on('swiperight', _.bind(documentPanel.toggle, documentPanel, false));
*/
var initialWidth, initialHeight;
previewResizer.initHammer(true);
var resizerInitialSize;
previewResizer.hammer.on('dragstart', function() {
initialWidth = previewPanel.width;
initialHeight = previewPanel.height;
resizerInitialSize = {
width: previewPanel.width,
height: previewPanel.height
};
}).on('drag', function(evt) {
if(isVertical) {
previewPanel.height = initialHeight - evt.gesture.deltaY;
previewPanel.height = resizerInitialSize.height - evt.gesture.deltaY;
}
else {
previewPanel.width = initialWidth - evt.gesture.deltaX;
previewPanel.width = resizerInitialSize.width - evt.gesture.deltaX;
}
evt.gesture.preventDefault();
previewPanel.halfSize = false;
resizeAll();
});
previewButtons.initHammer(true);
previewButtons.adjustPosition = function() {
if(!previewButtons.isDragged) {
return;
}
var minX = -windowSize.width + previewButtons.elt.offsetWidth;
var minY = -windowSize.height + previewButtons.elt.offsetHeight;
this.x < minX && (this.x = minX);
this.y < minY && (this.y = minY);
this.x > 0 && (this.x = 0);
this.y > 0 && (this.y = 0);
this.applyCss();
};
var buttonsInitialCoord;
previewButtons.hammer.on('dragstart', function() {
previewButtons.isDragged = true;
previewButtons.$elt.removeClass('animate');
wrapperL2.$elt.addClass('dragging');
buttonsInitialCoord = {
x: previewButtons.x,
y: previewButtons.y
};
}).on('drag', function(evt) {
previewButtons.x = buttonsInitialCoord.x + evt.gesture.deltaX;
previewButtons.y = buttonsInitialCoord.y + evt.gesture.deltaY;
previewButtons.adjustPosition();
evt.gesture.preventDefault();
}).on('dragend', function() {
wrapperL2.$elt.removeClass('dragging');
previewButtons.$elt.find('.btn-group').toggleClass('dropup', windowSize.height/2 > -previewButtons.y);
});
}
var isModalShown = false;
@ -541,19 +586,25 @@ define([
};
eventMgr.addListener('onReady', function() {
var previewButtonsWidth = previewButtons.elt.offsetWidth;
previewButtons.x = previewButtonsOffset.x;
previewButtons.y = previewButtonsOffset.y;
previewButtons.applyCss();
function openPreviewButtons() {
clearTimeout(closeTimeoutId);
previewButtons.x = 0;
previewButtons.applyCss();
if(!previewButtons.isDragged) {
previewButtons.x = previewButtonsOffset.x;
previewButtons.applyCss();
}
}
var closeTimeoutId;
var dropdownOpen = false;
function closePreviewButtons() {
clearTimeout(closeTimeoutId);
closeTimeoutId = setTimeout(function() {
if(!dropdownOpen) {
previewButtons.x = previewButtonsWidth;
if(!previewButtons.isDragged && !dropdownOpen) {
previewButtons.$elt.addClass('animate');
previewButtons.x = previewButtonsOffset.x + previewButtons.elt.offsetWidth;
previewButtons.applyCss();
}
}, 3000);
@ -571,13 +622,18 @@ define([
_.each(previewButtons.elt.querySelectorAll('.btn-group'), function(btnGroupElt) {
var $btnGroupElt = $(btnGroupElt);
$btnGroupElt.click(function() {
$btnGroupElt.on('shown.bs.dropdown', function() {
// Align dropdown to the left of the screen
$btnGroupElt.find('.dropdown-menu').css({
right: -previewButtonsWidth + $btnGroupElt.width() + $btnGroupElt.position().left
right: -previewButtons.elt.offsetWidth + $btnGroupElt.width() + $btnGroupElt.position().left
});
var maxHeight = -previewButtons.y - previewButtonsDropdownMargin;
// If it's a dropup
if(windowSize.height/2 > -previewButtons.y) {
maxHeight = windowSize.height + previewButtons.y - previewButtons.elt.offsetHeight - previewButtonsDropdownMargin;
}
$btnGroupElt.find('.markdown-syntax, .table-of-contents').css({
'maxHeight': wrapperL3.height - 180
'maxHeight': maxHeight
});
}).addClass('dropup');
});

View File

@ -737,12 +737,13 @@
return;
}
if (inputArea.selectionStart !== undefined && !uaSniffed.isOpera) {
//if (inputArea.selectionStart !== undefined && !uaSniffed.isOpera) {
inputArea.focus();
inputArea.selectionStart = stateObj.start;
inputArea.selectionEnd = stateObj.end;
inputArea.scrollTop = stateObj.scrollTop;
/*
}
else if (doc.selection) {
@ -754,14 +755,16 @@
range.moveStart("character", stateObj.start);
range.select();
}
*/
};
this.setInputAreaSelectionStartEnd = function () {
if (!panels.ieCachedRange && (inputArea.selectionStart || inputArea.selectionStart === 0)) {
//if (!panels.ieCachedRange && (inputArea.selectionStart || inputArea.selectionStart === 0)) {
stateObj.start = inputArea.selectionStart;
stateObj.end = inputArea.selectionEnd;
/*
}
else if (doc.selection) {
@ -802,6 +805,7 @@
this.setInputAreaSelection();
}
*/
};
// Restore this state into the input area.
@ -1401,9 +1405,11 @@
if (!noCleanup) {
fixupInputArea();
/*
if(!linkOrImage) {
inputBox.dispatchEvent(new Event('keydown'));
}
*/
}
}

View File

@ -19,6 +19,14 @@
@p-margin: 1.1em;
@headings-font-family: inherit;
@font-face {
font-family: 'fontello';
src: url('../font/fontello.svg#fontello') format('svg'),
url('../font/fontello.woff') format('woff');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;

View File

@ -112,6 +112,7 @@
@btn-info-color: fade(@secondary-desaturated, 35%);
@btn-info-bg: @transparent;
@btn-info-border: @transparent;
@btn-info-hover-color: darken(@secondary, 30%);
@btn-info-hover-border: fade(@secondary, 8%);
@btn-info-hover-bg: @secondary-bg-dark;
@gray-lighter: @body-bg;
@ -158,6 +159,10 @@ body {
cursor: progress;
}
.dragging {
cursor: move !important;
}
.btn,
.dropdown-menu {
.user-select(none);
@ -327,7 +332,7 @@ a {
&.info-tooltip,
.info-tooltip &,
.open &.dropdown-toggle {
color: darken(@secondary, 30%);
color: @btn-info-hover-color;
border-color: @btn-info-hover-border;
background-color: @btn-info-hover-bg !important; // important to override .nav > li > a:hover
}
@ -808,14 +813,16 @@ a {
}
.extension-preview-buttons {
position: absolute;
z-index: 10;
right: 45px;
bottom: 6px;
position: absolute;
right: 0;
bottom: 0;
z-index: 30;
background-color: @btn-info-hover-bg;
border: 1px solid @btn-info-hover-border;
border-radius: @border-radius-base;
.transition-transform(350ms ease-in-out);
&.animate {
.transition-transform(350ms ease-in-out);
}
.btn-group {
.btn {
position: initial;
@ -823,6 +830,7 @@ a {
}
}
.dropdown-menu {
margin-top: 6px;
margin-bottom: 6px;
padding-bottom: 20px;
}
@ -851,6 +859,24 @@ a {
padding-left: 10px;
}
}
.stat-button .value {
vertical-align: text-top;
}
.drag-me {
color: @btn-info-color;
cursor: move;
&.info-tooltip {
color: @btn-info-hover-color;
}
i {
overflow: hidden;
&:before {
width: 5px;
}
}
}
}