Merge branch 'dev-life'
Conflicts: app/init.go public/js/common-min.js public/js/common.js
This commit is contained in:
app
controllers
AttachController.goAuthController.goBaseController.goBlogController.goFileController.goNoteController.goPreviewController.go
admin
member
db
info
init.golea
release
service
AttachService.goAuthService.goFileService.goGroupService.goNoteContentHistoryService.goShareService.goThemeService.goUserService.go
views
messages
public
admin
js
blog
js
themes
backup
default
archive.htmlcate.htmlcomment.htmlfooter.htmlheader.htmlhighlight.html
images
index.htmlnoise.pngpage.htmlpaging.htmlsearch.htmlsingle.htmlstyle.csstag_posts.htmltags.htmltheme.jsonview.htmlview.jselegant
archive.htmlcate.htmlcomment.htmlfooter.htmlheader.htmlhighlight.html
images
index.htmlpage.htmlpaging.htmlsearch.htmlsingle.htmlstyle.csstag_posts.htmltags.htmltheme.jsonview.htmlview.jsnav_fixed
elegant
css
blog
bootstrap.csscss
index.cssindex.lesstheme
basic.lessdefault.cssdefault.lessmobile.lesssimple.csssimple.lesswritting-overwrite.csswritting-overwrite.lesswritting.css
zTreeStyle
dist
images
slider
js
ZeroClipboard
all.jsapp
attachment_upload-min.jsattachment_upload.jseditor_drop_paste-min.jseditor_drop_paste.jsnote-min.jsnote.jsnotebook-min.jsnotebook.jspage-min.jspage.jsshare-min.jsshare.js
common-min.jscommon.jsfastclick.jsjquery.mobile-1.4.4.min.jsjquery.ztree.all-3.5-min.jsjquery.ztree.all-3.5.jsmain-min.jsmain.jsother.jslibs
MathJax
MathJax.jsfontdata-extra.jsfontdata.jsfontdata-extra.jsfontdata.jsfontdata-extra.jsfontdata.jsfontdata-extra.jsfontdata.jsfontdata-extra.jsfontdata.jsimageFonts.jsjax.js
config
AM_HTMLorMML-full.jsAM_HTMLorMML.jsAccessible-full.jsAccessible.jsMML_HTMLorMML-full.jsMML_HTMLorMML.jsMMLorHTML.jsSafe.jsTeX-AMS_HTML-full.jsTeX-AMS_HTML.jsdefault.js
local
extensions
FontWarnings.js
HTML-CSS
HelpDialog.jsMatchWebFonts.jsMathEvents.jsMathMenu.jsMathZoom.jsSafe.jsTeX
AMScd.jsAMSmath.jsAMSsymbols.jsHTML.jsaction.jsautobold.jsautoload-all.jsbbox.jsbegingroup.jsboldsymbol.jscancel.jscolor.jsenclose.jsextpfeil.jsmathchoice.jsmhchem.jsnewcommand.jsnoErrors.jsnoUndefined.jsunicode.jsverb.js
asciimath2jax.jsjsMath2jax.jstex2jax.jsfonts
HTML-CSS
Asana-Math
woff
AsanaMathJax_Alphabets-Regular.woffAsanaMathJax_Arrows-Regular.woffAsanaMathJax_DoubleStruck-Regular.woffAsanaMathJax_Fraktur-Regular.woffAsanaMathJax_Latin-Regular.woffAsanaMathJax_Main-Regular.woffAsanaMathJax_Marks-Regular.woffAsanaMathJax_Misc-Regular.woffAsanaMathJax_Monospace-Regular.woffAsanaMathJax_NonUnicode-Regular.woffAsanaMathJax_Normal-Regular.woffAsanaMathJax_Operators-Regular.woffAsanaMathJax_SansSerif-Regular.woffAsanaMathJax_Script-Regular.woffAsanaMathJax_Shapes-Regular.woffAsanaMathJax_Size1-Regular.woffAsanaMathJax_Size2-Regular.woffAsanaMathJax_Size3-Regular.woffAsanaMathJax_Size4-Regular.woffAsanaMathJax_Size5-Regular.woffAsanaMathJax_Size6-Regular.woffAsanaMathJax_Symbols-Regular.woffAsanaMathJax_Variants-Regular.woff
Gyre-Pagella
woff
GyrePagellaMathJax_Alphabets-Regular.woffGyrePagellaMathJax_Arrows-Regular.woffGyrePagellaMathJax_DoubleStruck-Regular.woffGyrePagellaMathJax_Fraktur-Regular.woffGyrePagellaMathJax_Latin-Regular.woffGyrePagellaMathJax_Main-Regular.woffGyrePagellaMathJax_Marks-Regular.woffGyrePagellaMathJax_Misc-Regular.woffGyrePagellaMathJax_Monospace-Regular.woffGyrePagellaMathJax_NonUnicode-Regular.woffGyrePagellaMathJax_Normal-Regular.woffGyrePagellaMathJax_Operators-Regular.woffGyrePagellaMathJax_SansSerif-Regular.woffGyrePagellaMathJax_Script-Regular.woffGyrePagellaMathJax_Shapes-Regular.woffGyrePagellaMathJax_Size1-Regular.woffGyrePagellaMathJax_Size2-Regular.woffGyrePagellaMathJax_Size3-Regular.woffGyrePagellaMathJax_Size4-Regular.woffGyrePagellaMathJax_Size5-Regular.woffGyrePagellaMathJax_Size6-Regular.woffGyrePagellaMathJax_Symbols-Regular.woffGyrePagellaMathJax_Variants-Regular.woff
Gyre-Termes
woff
GyreTermesMathJax_Alphabets-Regular.woffGyreTermesMathJax_Arrows-Regular.woffGyreTermesMathJax_DoubleStruck-Regular.woffGyreTermesMathJax_Fraktur-Regular.woffGyreTermesMathJax_Latin-Regular.woffGyreTermesMathJax_Main-Regular.woffGyreTermesMathJax_Marks-Regular.woffGyreTermesMathJax_Misc-Regular.woffGyreTermesMathJax_Monospace-Regular.woffGyreTermesMathJax_NonUnicode-Regular.woffGyreTermesMathJax_Normal-Regular.woffGyreTermesMathJax_Operators-Regular.woffGyreTermesMathJax_SansSerif-Regular.woffGyreTermesMathJax_Script-Regular.woffGyreTermesMathJax_Shapes-Regular.woffGyreTermesMathJax_Size1-Regular.woffGyreTermesMathJax_Size2-Regular.woffGyreTermesMathJax_Size3-Regular.woffGyreTermesMathJax_Size4-Regular.woffGyreTermesMathJax_Size5-Regular.woffGyreTermesMathJax_Size6-Regular.woffGyreTermesMathJax_Symbols-Regular.woffGyreTermesMathJax_Variants-Regular.woff
Latin-Modern
woff
LatinModernMathJax_Alphabets-Regular.woffLatinModernMathJax_Arrows-Regular.woffLatinModernMathJax_DoubleStruck-Regular.woffLatinModernMathJax_Fraktur-Regular.woffLatinModernMathJax_Latin-Regular.woffLatinModernMathJax_Main-Regular.woffLatinModernMathJax_Marks-Regular.woffLatinModernMathJax_Misc-Regular.woffLatinModernMathJax_Monospace-Regular.woffLatinModernMathJax_NonUnicode-Regular.woffLatinModernMathJax_Normal-Regular.woffLatinModernMathJax_Operators-Regular.woffLatinModernMathJax_SansSerif-Regular.woffLatinModernMathJax_Script-Regular.woffLatinModernMathJax_Shapes-Regular.woffLatinModernMathJax_Size1-Regular.woffLatinModernMathJax_Size2-Regular.woffLatinModernMathJax_Size3-Regular.woffLatinModernMathJax_Size4-Regular.woffLatinModernMathJax_Size5-Regular.woffLatinModernMathJax_Size6-Regular.woffLatinModernMathJax_Size7-Regular.woffLatinModernMathJax_Symbols-Regular.woffLatinModernMathJax_Variants-Regular.woff
Neo-Euler
woff
NeoEulerMathJax_Alphabets-Regular.woffNeoEulerMathJax_Arrows-Regular.woffNeoEulerMathJax_Fraktur-Regular.woffNeoEulerMathJax_Main-Regular.woffNeoEulerMathJax_Marks-Regular.woffNeoEulerMathJax_NonUnicode-Regular.woffNeoEulerMathJax_Normal-Regular.woffNeoEulerMathJax_Operators-Regular.woffNeoEulerMathJax_Script-Regular.woffNeoEulerMathJax_Shapes-Regular.woffNeoEulerMathJax_Size1-Regular.woffNeoEulerMathJax_Size2-Regular.woffNeoEulerMathJax_Size3-Regular.woffNeoEulerMathJax_Size4-Regular.woffNeoEulerMathJax_Size5-Regular.woffNeoEulerMathJax_Symbols-Regular.woffNeoEulerMathJax_Variants-Regular.woff
STIX-Web
woff
STIXMathJax_Alphabets-Bold.woffSTIXMathJax_Alphabets-BoldItalic.woffSTIXMathJax_Alphabets-Italic.woffSTIXMathJax_Alphabets-Regular.woffSTIXMathJax_Arrows-Bold.woffSTIXMathJax_Arrows-Regular.woffSTIXMathJax_DoubleStruck-Bold.woffSTIXMathJax_DoubleStruck-BoldItalic.woffSTIXMathJax_DoubleStruck-Italic.woffSTIXMathJax_DoubleStruck-Regular.woffSTIXMathJax_Fraktur-Bold.woffSTIXMathJax_Fraktur-Regular.woffSTIXMathJax_Latin-Bold.woffSTIXMathJax_Latin-BoldItalic.woffSTIXMathJax_Latin-Italic.woffSTIXMathJax_Latin-Regular.woffSTIXMathJax_Main-Bold.woffSTIXMathJax_Main-BoldItalic.woffSTIXMathJax_Main-Italic.woffSTIXMathJax_Main-Regular.woffSTIXMathJax_Marks-Bold.woffSTIXMathJax_Marks-BoldItalic.woffSTIXMathJax_Marks-Italic.woffSTIXMathJax_Marks-Regular.woffSTIXMathJax_Misc-Bold.woffSTIXMathJax_Misc-BoldItalic.woffSTIXMathJax_Misc-Italic.woffSTIXMathJax_Misc-Regular.woffSTIXMathJax_Monospace-Regular.woffSTIXMathJax_Normal-Bold.woffSTIXMathJax_Normal-BoldItalic.woffSTIXMathJax_Normal-Italic.woffSTIXMathJax_Operators-Bold.woffSTIXMathJax_Operators-Regular.woffSTIXMathJax_SansSerif-Bold.woffSTIXMathJax_SansSerif-BoldItalic.woffSTIXMathJax_SansSerif-Italic.woffSTIXMathJax_SansSerif-Regular.woffSTIXMathJax_Script-BoldItalic.woffSTIXMathJax_Script-Italic.woffSTIXMathJax_Script-Regular.woffSTIXMathJax_Shapes-Bold.woffSTIXMathJax_Shapes-BoldItalic.woffSTIXMathJax_Shapes-Regular.woffSTIXMathJax_Size1-Regular.woffSTIXMathJax_Size2-Regular.woffSTIXMathJax_Size3-Regular.woffSTIXMathJax_Size4-Regular.woffSTIXMathJax_Size5-Regular.woffSTIXMathJax_Symbols-Bold.woffSTIXMathJax_Symbols-Regular.woffSTIXMathJax_Variants-Bold.woffSTIXMathJax_Variants-BoldItalic.woffSTIXMathJax_Variants-Italic.woffSTIXMathJax_Variants-Regular.woff
TeX
woff
MathJax_AMS-Regular.woffMathJax_Caligraphic-Bold.woffMathJax_Caligraphic-Regular.woffMathJax_Fraktur-Bold.woffMathJax_Fraktur-Regular.woffMathJax_Main-Bold.woffMathJax_Main-Italic.woffMathJax_Main-Regular.woffMathJax_Math-BoldItalic.woffMathJax_Math-Italic.woffMathJax_Math-Regular.woffMathJax_SansSerif-Bold.woffMathJax_SansSerif-Italic.woffMathJax_SansSerif-Regular.woffMathJax_Script-Regular.woffMathJax_Size1-Regular.woffMathJax_Size2-Regular.woffMathJax_Size3-Regular.woffMathJax_Size4-Regular.woffMathJax_Typewriter-Regular.woff
jax
element
mml
jax.js
optable
Arrows.jsBasicLatin.jsCombDiacritMarks.jsCombDiactForSymbols.jsDingbats.jsGeneralPunctuation.jsGeometricShapes.jsGreekAndCoptic.jsLatin1Supplement.jsLetterlikeSymbols.jsMathOperators.jsMiscMathSymbolsA.jsMiscMathSymbolsB.jsMiscSymbolsAndArrows.jsMiscTechnical.jsSpacingModLetters.jsSuppMathOperators.jsSupplementalArrowsA.jsSupplementalArrowsB.js
input
output
HTML-CSS
autoload
config.jsfonts
Asana-Math
Alphabets
Regular
Arrows
Regular
DoubleStruck
Regular
Fraktur
Regular
Latin
Regular
Main
Regular
Marks
Regular
Misc
Regular
Monospace
Regular
NonUnicode
Regular
Normal
Regular
Operators
Regular
SansSerif
Regular
Script
Regular
Shapes
Regular
Size1
Regular
Size2
Regular
Size3
Regular
Size4
Regular
Size5
Regular
Size6
Regular
Symbols
Regular
Variants
Regular
Gyre-Pagella
Alphabets
Regular
Arrows
Regular
DoubleStruck
Regular
Fraktur
Regular
Latin
Regular
Main
Regular
Marks
Regular
Misc
Regular
Monospace
Regular
NonUnicode
Regular
Normal
Regular
Operators
Regular
SansSerif
Regular
Script
Regular
Shapes
Regular
Size1
Regular
Size2
Regular
Size3
Regular
Size4
Regular
Size5
Regular
Size6
Regular
Symbols
Regular
Variants
Regular
Gyre-Termes
Alphabets
Regular
Arrows
Regular
DoubleStruck
Regular
Fraktur
Regular
Latin
Regular
Main
Regular
Marks
Regular
Misc
Regular
Monospace
Regular
NonUnicode
Regular
Normal
Regular
Operators
Regular
SansSerif
Regular
Script
Regular
Shapes
Regular
Size1
Regular
Size2
Regular
Size3
Regular
Size4
Regular
Size5
Regular
Size6
Regular
Symbols
Regular
Variants
Regular
Latin-Modern
Alphabets
Regular
Arrows
Regular
DoubleStruck
Regular
Fraktur
Regular
Latin
Regular
Main
Regular
Marks
Regular
Misc
Regular
Monospace
Regular
NonUnicode
Regular
Normal
Regular
Operators
Regular
SansSerif
Regular
Script
Regular
Shapes
Regular
Size1
Regular
Size2
Regular
Size3
Regular
Size4
Regular
Size5
Regular
Size6
Regular
Size7
Regular
Symbols
Regular
Variants
Regular
Neo-Euler
Alphabets
Regular
Arrows
Regular
Fraktur
Regular
Main
Regular
Marks
Regular
NonUnicode
Regular
Normal
Regular
Operators
Regular
Script
Regular
Shapes
Regular
Size1
Regular
Size2
Regular
Size3
Regular
Size4
Regular
Size5
Regular
Symbols
Regular
Variants
Regular
STIX-Web
Alphabets
Arrows
DoubleStruck
Fraktur
Latin
Main
Marks
Misc
Monospace
Regular
Normal
Operators
SansSerif
Script
Shapes
Size1
Regular
Size2
Regular
Size3
Regular
Size4
Regular
Size5
Regular
Symbols
Variants
fontdata-extra.jsfontdata.jsSTIX
General
Bold
AlphaPresentForms.jsArrows.jsBBBold.jsBoldFraktur.jsBoxDrawing.jsCombDiacritMarks.jsCombDiactForSymbols.jsControlPictures.jsCurrencySymbols.jsCyrillic.jsEnclosedAlphanum.jsGeneralPunctuation.jsGeometricShapes.jsGreekAndCoptic.jsGreekBold.jsGreekSSBold.jsIPAExtensions.jsLatin1Supplement.jsLatinExtendedA.jsLatinExtendedAdditional.jsLatinExtendedB.jsLatinExtendedD.jsLetterlikeSymbols.jsMain.jsMathBold.jsMathOperators.jsMathSSBold.jsMiscMathSymbolsA.jsMiscMathSymbolsB.jsMiscSymbols.jsMiscTechnical.jsNumberForms.jsPhoneticExtensions.jsSpacingModLetters.jsSuperAndSubscripts.jsSuppMathOperators.js
BoldItalic
AlphaPresentForms.jsBasicLatin.jsBoxDrawing.jsCombDiactForSymbols.jsControlPictures.jsCurrencySymbols.jsCyrillic.jsEnclosedAlphanum.jsGeneralPunctuation.jsGreekAndCoptic.jsGreekBoldItalic.jsGreekSSBoldItalic.jsIPAExtensions.jsLatin1Supplement.jsLatinExtendedA.jsLatinExtendedAdditional.jsLatinExtendedB.jsLetterlikeSymbols.jsMain.jsMathBoldItalic.jsMathBoldScript.jsMathOperators.jsMathSSItalicBold.jsSpacingModLetters.js
Italic
AlphaPresentForms.jsBoxDrawing.jsCombDiactForSymbols.jsControlPictures.jsCurrencySymbols.jsCyrillic.jsEnclosedAlphanum.jsGeneralPunctuation.jsGreekAndCoptic.jsGreekItalic.jsIPAExtensions.jsLatin1Supplement.jsLatinExtendedA.jsLatinExtendedAdditional.jsLatinExtendedB.jsLetterlikeSymbols.jsMain.jsMathItalic.jsMathOperators.jsMathSSItalic.jsMathScript.jsSpacingModLetters.jsij.js
Regular
AlphaPresentForms.jsArrows.jsBBBold.jsBlockElements.jsBoldFraktur.jsBoxDrawing.jsCJK.jsCombDiacritMarks.jsCombDiactForSymbols.jsControlPictures.jsCurrencySymbols.jsCyrillic.jsDingbats.jsEnclosedAlphanum.jsFraktur.jsGeneralPunctuation.jsGeometricShapes.jsGreekAndCoptic.jsGreekBold.jsGreekBoldItalic.jsGreekItalic.jsGreekSSBold.jsGreekSSBoldItalic.jsHiragana.jsIPAExtensions.jsLatin1Supplement.jsLatinExtendedA.jsLatinExtendedAdditional.jsLatinExtendedB.jsLatinExtendedD.jsLetterlikeSymbols.jsMain.jsMathBold.jsMathBoldItalic.jsMathBoldScript.jsMathItalic.jsMathOperators.jsMathSS.jsMathSSBold.jsMathSSItalic.jsMathSSItalicBold.jsMathScript.jsMathTT.jsMiscMathSymbolsA.jsMiscMathSymbolsB.jsMiscSymbols.jsMiscSymbolsAndArrows.jsMiscTechnical.jsNumberForms.jsPhoneticExtensions.jsSpacingModLetters.jsSpecials.jsSuperAndSubscripts.jsSuppMathOperators.jsSupplementalArrowsA.jsSupplementalArrowsB.jsij.js
IntegralsD
IntegralsSm
IntegralsUp
IntegralsUpD
IntegralsUpSm
NonUnicode
Bold
BoldItalic
Italic
Regular
SizeFiveSym
SizeFourSym
SizeOneSym
SizeThreeSym
SizeTwoSym
Variants
fontdata-1.0.jsfontdata-beta.jsfontdata-extra.jsfontdata.jsTeX
AMS
Regular
Arrows.jsBBBold.jsBoxDrawing.jsCombDiacritMarks.jsDingbats.jsEnclosedAlphanum.jsGeneralPunctuation.jsGeometricShapes.jsGreekAndCoptic.jsLatin1Supplement.jsLatinExtendedA.jsLetterlikeSymbols.jsMain.jsMathOperators.jsMiscMathSymbolsB.jsMiscSymbols.jsMiscTechnical.jsPUA.jsSpacingModLetters.jsSuppMathOperators.js
Caligraphic
Fraktur
Greek
Main
Bold
Arrows.jsCombDiacritMarks.jsCombDiactForSymbols.jsGeneralPunctuation.jsGeometricShapes.jsLatin1Supplement.jsLatinExtendedA.jsLatinExtendedB.jsLetterlikeSymbols.jsMain.jsMathOperators.jsMiscMathSymbolsA.jsMiscSymbols.jsMiscTechnical.jsSpacingModLetters.jsSuppMathOperators.jsSupplementalArrowsA.js
Italic
Regular
Math
SansSerif
Bold
Italic
Regular
Script
Regular
Size1
Regular
Size2
Regular
Size3
Regular
Size4
Regular
Typewriter
WinChrome
Regular
WinIE6
fontdata-extra.jsfontdata.jsace
ace.jsext-beautify.jsext-chromevox.jsext-elastic_tabstops_lite.jsext-emmet.jsext-error_marker.jsext-keybinding_menu.jsext-language_tools.jsext-linking.jsext-modelist.jsext-old_ie.jsext-searchbox.jsext-settings_menu.jsext-spellcheck.jsext-split.jsext-static_highlight.jsext-statusbar.jsext-textarea.jsext-themelist.jsext-whitespace.jskeybinding-emacs.jskeybinding-vim.jsmode-abap.jsmode-actionscript.jsmode-ada.jsmode-apache_conf.jsmode-applescript.jsmode-asciidoc.jsmode-assembly_x86.jsmode-autohotkey.jsmode-batchfile.jsmode-c9search.jsmode-c_cpp.jsmode-cirru.jsmode-clojure.jsmode-cobol.jsmode-coffee.jsmode-coldfusion.jsmode-csharp.jsmode-css.jsmode-curly.jsmode-d.jsmode-dart.jsmode-diff.jsmode-django.jsmode-dockerfile.jsmode-dot.jsmode-eiffel.jsmode-ejs.jsmode-erlang.jsmode-forth.jsmode-ftl.jsmode-gcode.jsmode-gherkin.jsmode-gitignore.jsmode-glsl.jsmode-golang.jsmode-groovy.jsmode-haml.jsmode-handlebars.jsmode-haskell.jsmode-haxe.jsmode-html.jsmode-html_ruby.jsmode-ini.jsmode-io.jsmode-jack.jsmode-jade.jsmode-java.jsmode-javascript.jsmode-json.jsmode-jsoniq.jsmode-jsp.jsmode-jsx.jsmode-julia.jsmode-latex.jsmode-less.jsmode-liquid.jsmode-lisp.jsmode-livescript.jsmode-logiql.jsmode-lsl.jsmode-lua.jsmode-luapage.jsmode-lucene.jsmode-makefile.jsmode-markdown.jsmode-matlab.jsmode-mel.jsmode-mushcode.jsmode-mysql.jsmode-nix.jsmode-objectivec.jsmode-ocaml.jsmode-pascal.jsmode-perl.jsmode-pgsql.jsmode-php.jsmode-plain_text.jsmode-powershell.jsmode-praat.jsmode-prolog.jsmode-properties.jsmode-protobuf.jsmode-python.jsmode-r.jsmode-rdoc.jsmode-rhtml.jsmode-ruby.jsmode-rust.jsmode-sass.jsmode-scad.jsmode-scala.jsmode-scheme.jsmode-scss.jsmode-sh.jsmode-sjs.jsmode-smarty.jsmode-snippets.jsmode-soy_template.jsmode-space.jsmode-sql.jsmode-stylus.jsmode-svg.jsmode-tcl.jsmode-tex.jsmode-text.jsmode-textile.jsmode-toml.jsmode-twig.jsmode-typescript.jsmode-vala.jsmode-vbscript.jsmode-velocity.jsmode-verilog.jsmode-vhdl.jsmode-xml.jsmode-xquery.jsmode-yaml.js
snippets
abap.jsactionscript.jsada.jsapache_conf.jsapplescript.jsasciidoc.jsassembly_x86.jsautohotkey.jsbatchfile.jsc9search.jsc_cpp.jscirru.jsclojure.jscobol.jscoffee.jscoldfusion.jscsharp.jscss.jscurly.jsd.jsdart.jsdiff.jsdjango.jsdockerfile.jsdot.jseiffel.jsejs.jserlang.jsforth.jsftl.jsgcode.jsgherkin.jsgitignore.jsglsl.jsgolang.jsgroovy.jshaml.jshandlebars.jshaskell.jshaxe.jshtml.jshtml_ruby.jsini.jsio.jsjack.jsjade.jsjava.jsjavascript.jsjson.jsjsoniq.jsjsp.jsjsx.jsjulia.jslatex.jsless.jsliquid.jslisp.jslivescript.jslogiql.jslsl.jslua.jsluapage.jslucene.jsmakefile.jsmarkdown.jsmatlab.jsmel.jsmushcode.jsmysql.jsnix.jsobjectivec.jsocaml.jspascal.jsperl.jspgsql.jsphp.jsplain_text.jspowershell.jspraat.jsprolog.jsproperties.jsprotobuf.jspython.jsr.jsrdoc.jsrhtml.jsruby.jsrust.jssass.jsscad.jsscala.jsscheme.jsscss.jssh.jssjs.jssmarty.jssnippets.jssoy_template.jsspace.jssql.jsstylus.jssvg.jstcl.jstex.jstext.jstextile.jstoml.jstwig.jstypescript.jsvala.jsvbscript.jsvelocity.jsverilog.jsvhdl.jsxml.jsxquery.jsyaml.js
theme-ambiance.jstheme-chaos.jstheme-chrome.jstheme-clouds.jstheme-clouds_midnight.jstheme-cobalt.jstheme-crimson_editor.jstheme-dawn.jstheme-dreamweaver.jstheme-eclipse.jstheme-github.jstheme-idle_fingers.jstheme-katzenmilch.jstheme-kr.jstheme-kr_theme.jstheme-kuroir.jstheme-merbivore.jstheme-merbivore_soft.jstheme-mono_industrial.jstheme-monokai.jstheme-pastel_on_dark.jstheme-solarized_dark.jstheme-solarized_light.jstheme-terminal.jstheme-textmate.jstheme-tomorrow.jstheme-tomorrow_night.jstheme-tomorrow_night_blue.jstheme-tomorrow_night_bright.jstheme-tomorrow_night_eighties.jstheme-twilight.jstheme-vibrant_ink.jstheme-xcode.jsworker-coffee.jsworker-css.jsworker-html.jsworker-javascript.jsworker-json.jsworker-lua.jsworker-php.jsworker-xquery.jsmdeditor
css
bootstrap-responsive.cssbootstrap.cssindex2.html
smoothness
images
animated-overlay.gifui-bg_flat_0_aaaaaa_40x100.pngui-bg_flat_75_ffffff_40x100.pngui-bg_glass_55_fbf9ee_1x400.pngui-bg_glass_65_ffffff_1x400.pngui-bg_glass_75_dadada_1x400.pngui-bg_glass_75_e6e6e6_1x400.pngui-bg_glass_95_fef1ec_1x400.pngui-bg_highlight-soft_75_cccccc_1x100.pngui-icons_222222_256x240.pngui-icons_2e83ff_256x240.pngui-icons_454545_256x240.pngui-icons_888888_256x240.pngui-icons_cd0a0a_256x240.png
jquery-ui-1.10.2.custom.cssjquery-ui-1.10.2.custom.min.csseditor
editor-min.jseditor.js
google-code-prettify
lang-apollo.jslang-basic.jslang-clj.jslang-css.jslang-dart.jslang-erlang.jslang-go.jslang-hs.jslang-lisp.jslang-llvm.jslang-lua.jslang-matlab.jslang-ml.jslang-mumps.jslang-n.jslang-pascal.jslang-proto.jslang-r.jslang-rd.jslang-scala.jslang-sql.jslang-tcl.jslang-tex.jslang-vb.jslang-vhdl.jslang-wiki.jslang-xq.jslang-yaml.jsmine.cssprettify.cssprettify.jsrun_prettify.js
mdeditor.jsimg
member
css
js
ace
ck
ace-min.jsext-beautify-min.jsext-chromevox-min.jsext-elastic_tabstops_lite-min.jsext-emmet-min.jsext-error_marker-min.jsext-keybinding_menu-min.jsext-language_tools-min.jsext-linking-min.jsext-modelist-min.jsext-old_ie-min.jsext-prompt-min.jsext-searchbox-min.jsext-settings_menu-min.jsext-spellcheck-min.jsext-split-min.jsext-static_highlight-min.jsext-statusbar-min.jsext-textarea-min.jsext-themelist-min.jsext-whitespace-min.jskeybinding-emacs-min.jskeybinding-vim-min.jsmode-abap-min.jsmode-actionscript-min.jsmode-ada-min.jsmode-apache_conf-min.jsmode-applescript-min.jsmode-asciidoc-min.jsmode-assembly_x86-min.jsmode-autohotkey-min.jsmode-batchfile-min.jsmode-c9search-min.jsmode-c_cpp-min.jsmode-cirru-min.jsmode-clojure-min.jsmode-cobol-min.jsmode-coffee-min.jsmode-coldfusion-min.jsmode-csharp-min.jsmode-css-min.jsmode-curly-min.jsmode-d-min.jsmode-dart-min.jsmode-diff-min.jsmode-django-min.jsmode-dockerfile-min.jsmode-dot-min.jsmode-ejs-min.jsmode-erlang-min.jsmode-forth-min.jsmode-ftl-min.jsmode-gherkin-min.jsmode-glsl-min.jsmode-golang-min.jsmode-groovy-min.jsmode-haml-min.jsmode-handlebars-min.jsmode-haskell-min.jsmode-haxe-min.jsmode-html-min.jsmode-html_completions-min.jsmode-html_ruby-min.jsmode-ini-min.jsmode-jack-min.jsmode-jade-min.jsmode-java-min.jsmode-javascript-min.jsmode-json-min.jsmode-jsoniq-min.jsmode-jsp-min.jsmode-jsx-min.jsmode-julia-min.jsmode-latex-min.jsmode-less-min.jsmode-liquid-min.jsmode-lisp-min.jsmode-livescript-min.jsmode-logiql-min.jsmode-lsl-min.jsmode-lua-min.jsmode-luapage-min.jsmode-lucene-min.jsmode-makefile-min.jsmode-markdown-min.jsmode-matlab-min.jsmode-mel-min.jsmode-mushcode-min.jsmode-mushcode_high_rules-min.jsmode-mysql-min.jsmode-nix-min.jsmode-objectivec-min.jsmode-ocaml-min.jsmode-pascal-min.jsmode-perl-min.jsmode-pgsql-min.jsmode-php-min.jsmode-plain_text-min.jsmode-powershell-min.jsmode-prolog-min.jsmode-properties-min.jsmode-protobuf-min.jsmode-python-min.jsmode-r-min.jsmode-rdoc-min.jsmode-rhtml-min.jsmode-ruby-min.jsmode-rust-min.jsmode-sass-min.jsmode-scad-min.jsmode-scala-min.jsmode-scheme-min.jsmode-scss-min.jsmode-sh-min.jsmode-sjs-min.jsmode-smarty-min.jsmode-snippets-min.jsmode-soy_template-min.jsmode-space-min.jsmode-sql-min.jsmode-stylus-min.jsmode-svg-min.jsmode-tcl-min.jsmode-tex-min.jsmode-textile-min.jsmode-toml-min.jsmode-twig-min.jsmode-typescript-min.jsmode-vala-min.jsmode-vbscript-min.jsmode-verilog-min.jsmode-vhdl-min.jsmode-xml-min.jsmode-yaml-min.js
mode-abap.jsmode-actionscript.jsmode-ada.jsmode-apache_conf.jsmode-applescript.jsmode-asciidoc.jsmode-assembly_x86.jsmode-autohotkey.jsmode-batchfile.jsmode-c9search.jsmode-c_cpp.jsmode-cirru.jsmode-clojure.jsmode-cobol.jsmode-coffee.jsmode-coldfusion.jsmode-csharp.jsmode-curly.jsmode-d.jsmode-dart.jsmode-diff.jsmode-django.jsmode-dockerfile.jsmode-dot.jsmode-ejs.jsmode-erlang.jsmode-forth.jsmode-ftl.jsmode-gherkin.jsmode-glsl.jsmode-golang.jsmode-groovy.jsmode-haml.jsmode-handlebars.jsmode-haskell.jsmode-haxe.jsmode-html_completions.jsmode-html_ruby.jsmode-ini.jsmode-jack.jsmode-jade.jsmode-java.jsmode-json.jsmode-jsoniq.jsmode-jsp.jsmode-jsx.jsmode-julia.jsmode-latex.jsmode-liquid.jsmode-lisp.jsmode-livescript.jsmode-logiql.jsmode-lsl.jsmode-lua.jsmode-luapage.jsmode-lucene.jsmode-makefile.jsmode-markdown.jsmode-matlab.jsmode-mel.jsmode-mushcode.jsmode-mushcode_high_rules.jsmode-mysql.jsmode-nix.jsmode-objectivec.jsmode-ocaml.jsmode-pascal.jsmode-perl.jsmode-pgsql.jsmode-php.jsmode-plain_text.jsmode-powershell.jsmode-prolog.jsmode-properties.jsmode-protobuf.jsmode-python.jsmode-r.jsmode-rdoc.jsmode-rhtml.jsmode-ruby.jsmode-rust.jsmode-sass.jsmode-scad.jsmode-scala.jsmode-scheme.jsmode-scss.jsmode-sh.jsmode-sjs.jsmode-smarty.jsmode-snippets.jsmode-soy_template.jsmode-space.jsmode-sql.jsmode-stylus.jsmode-svg.jsmode-tcl.jsmode-tex.jsmode-textile.jsmode-toml.jsmode-twig.jsmode-typescript.jsmode-vala.jsmode-vbscript.jsmode-velocity.jsmode-verilog.jsmode-vhdl.jsmode-xml.jsmode-xquery.jsmode-yaml.jssnippets
abap.jsactionscript.jsada.jsapache_conf.jsapplescript.jsasciidoc.jsassembly_x86.jsautohotkey.jsbatchfile.jsc9search.jsc_cpp.jscirru.js
theme-ambiance.jstheme-chaos.jstheme-chrome.jstheme-cloud9_day.jstheme-cloud9_night.jstheme-cloud9_night_low_color.jstheme-clouds.jstheme-clouds_midnight.jstheme-cobalt.jstheme-crimson_editor.jstheme-dawn.jstheme-dreamweaver.jstheme-eclipse.jstheme-github.jstheme-idle_fingers.jstheme-katzenmilch.jstheme-kr.jstheme-kuroir.jstheme-merbivore.jstheme-merbivore_soft.jstheme-mono_industrial.jstheme-monokai.jstheme-pastel_on_dark.jstheme-solarized_dark.jstheme-solarized_light.jstheme-terminal.jstheme-textmate.jstheme-tomorrow_night.jstheme-tomorrow_night_blue.jstheme-tomorrow_night_bright.jstheme-tomorrow_night_eighties.jstheme-twilight.jstheme-vibrant_ink.jstheme-xcode.jsck
abap-min.jsactionscript-min.jsada-min.jsapache_conf-min.jsapplescript-min.jsasciidoc-min.jsassembly_x86-min.jsautohotkey-min.jsbatchfile-min.jsc9search-min.jsc_cpp-min.jscirru-min.jsclojure-min.jscobol-min.jscoffee-min.jscoldfusion-min.jscsharp-min.jscss-min.jscurly-min.jsd-min.jsdart-min.jsdiff-min.jsdjango-min.jsdockerfile-min.jsdot-min.jsejs-min.jserlang-min.jsforth-min.jsftl-min.jsgherkin-min.jsglsl-min.jsgolang-min.jsgroovy-min.jshaml-min.jshandlebars-min.jshaskell-min.jshaxe-min.jshtml-min.jshtml_completions-min.jshtml_ruby-min.jsini-min.jsjack-min.jsjade-min.jsjava-min.jsjavascript-min.jsjson-min.jsjsoniq-min.jsjsp-min.jsjsx-min.jsjulia-min.jslatex-min.jsless-min.jsliquid-min.jslisp-min.jslivescript-min.jslogiql-min.jslsl-min.jslua-min.jsluapage-min.jslucene-min.jsmakefile-min.jsmarkdown-min.jsmatlab-min.jsmel-min.jsmushcode-min.jsmushcode_high_rules-min.jsmysql-min.jsnix-min.jsocaml-min.jspascal-min.jsperl-min.jspgsql-min.jsplain_text-min.jspowershell-min.jsprolog-min.jsproperties-min.jspython-min.jsr-min.jsrdoc-min.jsrhtml-min.jsruby-min.jsrust-min.jsscad-min.jsscheme-min.jsscss-min.jssh-min.jssmarty-min.jssnippets-min.jssoy_template-min.jsspace-min.jsstylus-min.jssvg-min.js
clojure.jscobol.jscoffee.jscoldfusion.jscsharp.jscurly.jsd.jsdart.jsdiff.jsdjango.jsdockerfile.jsdot.jsejs.jserlang.jsforth.jsftl.jsgherkin.jsglsl.jsgolang.jsgroovy.jshaml.jshandlebars.jshaskell.jshaxe.jshtml_completions.jshtml_ruby.jsini.jsjack.jsjade.jsjava.jsjson.jsjsoniq.jsjsp.jsjsx.jsjulia.jslatex.jsliquid.jslisp.jslivescript.jslogiql.jslsl.jslua.jsluapage.jslucene.jsmakefile.jsmarkdown.jsmatlab.jsmel.jsmushcode.jsmushcode_high_rules.jsmysql.jsnix.jsobjectivec.jsocaml.jspascal.jsperl.jspgsql.jsphp.jsplain_text.jspowershell.jsprolog.jsproperties.jsprotobuf.jspython.jsr.jsrdoc.jsrhtml.jsruby.jsrust.jssass.jsscad.jsscala.jsscheme.jsscss.jssh.jssjs.jssmarty.jssnippets.jssoy_template.jsspace.jssql.jsstylus.jssvg.jstcl.jstex.jstextile.jstoml.jstwig.jstypescript.jsvala.jsvbscript.jsvelocity.jsverilog.jsvhdl.jsxml.jsxquery.jsyaml.jstinymce
classes
langs
plugins
codemirror
leanote_code
leanote_code2
leanote_nav
leanote_nav2
leaui_image
paste
spellchecker
table
themes
modern
@ -62,7 +62,7 @@ func (c Attach) uploadAttach(noteId string) (re info.Re) {
|
||||
maxFileSize = 1000
|
||||
}
|
||||
if(float64(len(data)) > maxFileSize * float64(1024*1024)) {
|
||||
resultMsg = fmt.Sprintf("附件大于%vM", maxFileSize)
|
||||
resultMsg = fmt.Sprintf("The file's size is bigger than %vM", maxFileSize)
|
||||
return re
|
||||
}
|
||||
|
||||
@ -100,11 +100,15 @@ func (c Attach) uploadAttach(noteId string) (re info.Re) {
|
||||
id := bson.NewObjectId();
|
||||
fileInfo.AttachId = id
|
||||
fileId = id.Hex()
|
||||
Ok = attachService.AddAttach(fileInfo)
|
||||
Ok, resultMsg = attachService.AddAttach(fileInfo)
|
||||
if resultMsg != "" {
|
||||
resultMsg = c.Message(resultMsg)
|
||||
}
|
||||
|
||||
fileInfo.Path = ""; // 不要返回
|
||||
resultMsg = "success"
|
||||
|
||||
if Ok {
|
||||
resultMsg = "success"
|
||||
}
|
||||
return re
|
||||
}
|
||||
|
||||
@ -212,4 +216,4 @@ func (c Attach) DownloadAll(noteId string) revel.Result {
|
||||
// file, _ := os.Open(dir + "/" + filename)
|
||||
// fw.Seek(0, 0)
|
||||
return c.RenderBinary(fw, filename, revel.Attachment, time.Now()) // revel.Attachment
|
||||
}
|
||||
}
|
||||
|
@ -91,18 +91,19 @@ func (c Auth) Demo() revel.Result {
|
||||
|
||||
//--------
|
||||
// 注册
|
||||
func (c Auth) Register(from string) revel.Result {
|
||||
func (c Auth) Register(from, iu string) revel.Result {
|
||||
if !configService.IsOpenRegister() {
|
||||
return c.Redirect("/index")
|
||||
}
|
||||
c.SetLocale()
|
||||
c.RenderArgs["from"] = from
|
||||
c.RenderArgs["iu"] = iu
|
||||
|
||||
c.RenderArgs["title"] = c.Message("register")
|
||||
c.RenderArgs["subTitle"] = c.Message("register")
|
||||
return c.RenderTemplate("home/register.html")
|
||||
}
|
||||
func (c Auth) DoRegister(email, pwd string) revel.Result {
|
||||
func (c Auth) DoRegister(email, pwd, iu string) revel.Result {
|
||||
if !configService.IsOpenRegister() {
|
||||
return c.Redirect("/index")
|
||||
}
|
||||
@ -117,7 +118,7 @@ func (c Auth) DoRegister(email, pwd string) revel.Result {
|
||||
}
|
||||
|
||||
// 注册
|
||||
re.Ok, re.Msg = authService.Register(email, pwd)
|
||||
re.Ok, re.Msg = authService.Register(email, pwd, iu)
|
||||
|
||||
// 注册成功, 则立即登录之
|
||||
if re.Ok {
|
||||
|
@ -193,12 +193,13 @@ func (c BaseController) SetLocale() string {
|
||||
}
|
||||
|
||||
// 设置userInfo
|
||||
func (c BaseController) SetUserInfo() {
|
||||
func (c BaseController) SetUserInfo() info.User {
|
||||
userInfo := c.GetUserInfo()
|
||||
c.RenderArgs["userInfo"] = userInfo
|
||||
if(userInfo.Username == configService.GetAdminUsername()) {
|
||||
c.RenderArgs["isAdmin"] = true
|
||||
}
|
||||
return userInfo
|
||||
}
|
||||
|
||||
// life
|
||||
@ -224,6 +225,7 @@ func (c BaseController) RenderTemplateStr(templatePath string) string {
|
||||
// 为了msg
|
||||
// msg-v1-v2-v3
|
||||
func (c BaseController) RenderRe(re info.Re) revel.Result {
|
||||
oldMsg := re.Msg
|
||||
if re.Msg != "" {
|
||||
if(strings.Contains(re.Msg, "-")) {
|
||||
msgAndValues := strings.Split(re.Msg, "-")
|
||||
@ -241,5 +243,8 @@ func (c BaseController) RenderRe(re info.Re) revel.Result {
|
||||
re.Msg = c.Message(re.Msg)
|
||||
}
|
||||
}
|
||||
if strings.HasPrefix(re.Msg, "???") {
|
||||
re.Msg = oldMsg
|
||||
}
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
@ -57,6 +57,9 @@ func (c Blog) render(templateName string, themePath string) revel.Result {
|
||||
isPreview = true
|
||||
themePath = themePath2.(string)
|
||||
c.setPreviewUrl()
|
||||
|
||||
// 因为common的themeInfo是从UserBlog.ThemeId来取的, 所以这里要fugai下
|
||||
c.RenderArgs["themeInfo"] = c.RenderArgs["themeInfoPreview"];
|
||||
}
|
||||
return blog.RenderTemplate(templateName, c.RenderArgs, revel.BasePath+"/"+themePath, isPreview)
|
||||
}
|
||||
@ -846,4 +849,4 @@ func (c Blog) ListCateLatest(notebookId, callback string) revel.Result {
|
||||
re.Ok = true
|
||||
re.List = blogs
|
||||
return c.RenderJsonP(callback, re)
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"fmt"
|
||||
"strconv"
|
||||
// "strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@ -85,7 +85,7 @@ func (c File) uploadImage(from, albumId string) (re info.Re) {
|
||||
var fileUrlPath = ""
|
||||
var fileId = ""
|
||||
var resultCode = 0 // 1表示正常
|
||||
var resultMsg = "内部错误" // 错误信息
|
||||
var resultMsg = "error" // 错误信息
|
||||
var Ok = false
|
||||
|
||||
defer func() {
|
||||
@ -120,7 +120,7 @@ func (c File) uploadImage(from, albumId string) (re info.Re) {
|
||||
} else {
|
||||
_, ext = SplitFilename(filename)
|
||||
if(ext != ".gif" && ext != ".jpg" && ext != ".png" && ext != ".bmp" && ext != ".jpeg") {
|
||||
resultMsg = "不是图片"
|
||||
resultMsg = "Please upload image"
|
||||
return re
|
||||
}
|
||||
}
|
||||
@ -147,7 +147,7 @@ func (c File) uploadImage(from, albumId string) (re info.Re) {
|
||||
// > 2M?
|
||||
if(float64(len(data)) > maxFileSize * float64(1024*1024)) {
|
||||
resultCode = 0
|
||||
resultMsg = fmt.Sprintf("图片大于%vM", maxFileSize)
|
||||
resultMsg = fmt.Sprintf("The file Size is bigger than %vM", maxFileSize)
|
||||
return re
|
||||
}
|
||||
|
||||
@ -163,7 +163,7 @@ func (c File) uploadImage(from, albumId string) (re info.Re) {
|
||||
filesize := GetFilesize(toPathGif)
|
||||
fileUrlPath += "/" + filename
|
||||
resultCode = 1
|
||||
resultMsg = "上传成功!"
|
||||
resultMsg = "Upload Success!"
|
||||
|
||||
// File
|
||||
fileInfo := info.File{Name: filename,
|
||||
@ -178,7 +178,8 @@ func (c File) uploadImage(from, albumId string) (re info.Re) {
|
||||
fileId = "public/upload/" + c.GetUserId() + "/images/logo/" + filename
|
||||
}
|
||||
|
||||
Ok = fileService.AddImage(fileInfo, albumId, c.GetUserId())
|
||||
Ok, resultMsg = fileService.AddImage(fileInfo, albumId, c.GetUserId(), from == "" || from == "pasteImage")
|
||||
resultMsg = c.Message(resultMsg)
|
||||
|
||||
fileInfo.Path = ""; // 不要返回
|
||||
re.Item = fileInfo
|
||||
@ -203,55 +204,6 @@ func (c File) DeleteImage(fileId string) revel.Result {
|
||||
re.Ok, re.Msg = fileService.DeleteImage(c.GetUserId(), fileId)
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
// update image uploader to leaui image,
|
||||
// scan all user's images and insert into db
|
||||
func (c File) UpgradeLeauiImage() revel.Result {
|
||||
re := info.NewRe()
|
||||
|
||||
if ok, _ := revel.Config.Bool("upgradeLeauiImage"); !ok {
|
||||
re.Msg = "Not allowed"
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
uploadPath := revel.BasePath + "/public/upload";
|
||||
userIds := ListDir(uploadPath)
|
||||
if userIds == nil {
|
||||
re.Msg = "no user"
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
msg := "";
|
||||
|
||||
for _, userId := range userIds {
|
||||
dirPath := uploadPath + "/" + userId + "/images"
|
||||
images := ListDir(dirPath)
|
||||
if images == nil {
|
||||
msg += userId + " no images "
|
||||
continue;
|
||||
}
|
||||
|
||||
hadImages := fileService.GetAllImageNamesMap(userId)
|
||||
|
||||
i := 0
|
||||
for _, filename := range images {
|
||||
if _, ok := hadImages[filename]; !ok {
|
||||
fileUrlPath := "/upload/" + userId + "/images/" + filename
|
||||
fileInfo := info.File{Name: filename,
|
||||
Title: filename,
|
||||
Path: fileUrlPath,
|
||||
Size: GetFilesize(dirPath + "/" + filename)}
|
||||
fileService.AddImage(fileInfo, "", userId)
|
||||
i++
|
||||
}
|
||||
}
|
||||
msg += userId + ": " + strconv.Itoa(len(images)) + " -- " + strconv.Itoa(i) + " images "
|
||||
}
|
||||
|
||||
re.Msg = msg
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
//-----------
|
||||
|
||||
// 输出image
|
||||
@ -267,15 +219,15 @@ func (c File) OutputImage(noteId, fileId string) revel.Result {
|
||||
}
|
||||
|
||||
// 协作时复制图片到owner
|
||||
// 需要计算对方大小
|
||||
func (c File) CopyImage(userId, fileId, toUserId string) revel.Result {
|
||||
re := info.NewRe()
|
||||
|
||||
re.Ok, re.Id = fileService.CopyImage(userId, fileId, toUserId)
|
||||
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
// 复制外网的图片, 成公共图片 放在/upload下
|
||||
// 都要好好的计算大小
|
||||
func (c File) CopyHttpImage(src string) revel.Result {
|
||||
re := info.NewRe()
|
||||
fileUrlPath := "upload/" + c.GetUserId() + "/images"
|
||||
@ -302,29 +254,7 @@ func (c File) CopyHttpImage(src string) revel.Result {
|
||||
|
||||
re.Id = id.Hex()
|
||||
re.Item = fileInfo.Path
|
||||
re.Ok = fileService.AddImage(fileInfo, "", c.GetUserId())
|
||||
re.Ok, re.Msg = fileService.AddImage(fileInfo, "", c.GetUserId(), true)
|
||||
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
//------------
|
||||
// 过时 已弃用!
|
||||
func (c File) UploadImage(renderHtml string) revel.Result {
|
||||
if renderHtml == "" {
|
||||
renderHtml = "file/image.html"
|
||||
}
|
||||
|
||||
re := c.uploadImage("", "");
|
||||
|
||||
c.RenderArgs["fileUrlPath"] = configService.GetSiteUrl() + re.Id
|
||||
c.RenderArgs["resultCode"] = re.Code
|
||||
c.RenderArgs["resultMsg"] = re.Msg
|
||||
|
||||
return c.RenderTemplate(renderHtml)
|
||||
}
|
||||
|
||||
// 已弃用
|
||||
func (c File) UploadImageJson(from, noteId string) revel.Result {
|
||||
re := c.uploadImage(from, "");
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
}
|
@ -22,9 +22,8 @@ type Note struct {
|
||||
// 笔记首页, 判断是否已登录
|
||||
// 已登录, 得到用户基本信息(notebook, shareNotebook), 跳转到index.html中
|
||||
// 否则, 转向登录页面
|
||||
func (c Note) Index() revel.Result {
|
||||
func (c Note) Index(noteId string) revel.Result {
|
||||
c.SetLocale()
|
||||
|
||||
userInfo := c.GetUserInfo()
|
||||
|
||||
userId := userInfo.UserId.Hex()
|
||||
@ -35,7 +34,7 @@ func (c Note) Index() revel.Result {
|
||||
}
|
||||
|
||||
c.RenderArgs["openRegister"] = configService.IsOpenRegister()
|
||||
|
||||
|
||||
// 已登录了, 那么得到所有信息
|
||||
notebooks := notebookService.GetNotebooks(userId)
|
||||
shareNotebooks, sharedUserInfos := shareService.GetShareNotebooks(userId)
|
||||
@ -43,22 +42,78 @@ func (c Note) Index() revel.Result {
|
||||
// 还需要按时间排序(DESC)得到notes
|
||||
notes := []info.Note{}
|
||||
noteContent := info.NoteContent{}
|
||||
|
||||
if len(notebooks) > 0 {
|
||||
// _, notes = noteService.ListNotes(c.GetUserId(), "", false, c.GetPage(), pageSize, defaultSortField, false, false);
|
||||
// 变成最新
|
||||
_, notes = noteService.ListNotes(c.GetUserId(), "", false, c.GetPage(), 50, defaultSortField, false, false);
|
||||
if len(notes) > 0 {
|
||||
noteContent = noteService.GetNoteContent(notes[0].NoteId.Hex(), userId)
|
||||
// noteId是否存在
|
||||
// 是否传入了正确的noteId
|
||||
hasRightNoteId := false
|
||||
if IsObjectId(noteId) {
|
||||
note := noteService.GetNoteById(noteId)
|
||||
var noteOwner = note.UserId.Hex()
|
||||
noteContent = noteService.GetNoteContent(noteId, noteOwner)
|
||||
|
||||
if note.NoteId != "" {
|
||||
hasRightNoteId = true
|
||||
c.RenderArgs["curNoteId"] = noteId
|
||||
c.RenderArgs["curNotebookId"] = note.NotebookId.Hex()
|
||||
|
||||
// 打开的是共享的笔记, 那么判断是否是共享给我的默认笔记
|
||||
if noteOwner != c.GetUserId() {
|
||||
if shareService.HasReadPerm(noteOwner, c.GetUserId(), noteId) {
|
||||
// 不要获取notebook下的笔记
|
||||
// 在前端下发请求
|
||||
c.RenderArgs["curSharedNoteNotebookId"] = note.NotebookId.Hex()
|
||||
c.RenderArgs["curSharedUserId"] = noteOwner;
|
||||
// 没有读写权限
|
||||
} else {
|
||||
hasRightNoteId = false
|
||||
}
|
||||
} else {
|
||||
_, notes = noteService.ListNotes(c.GetUserId(), note.NotebookId.Hex(), false, c.GetPage(), 50, defaultSortField, false, false);
|
||||
|
||||
// 如果指定了某笔记, 则该笔记放在首位
|
||||
lenNotes := len(notes)
|
||||
if lenNotes > 1 {
|
||||
notes2 := make([]info.Note, len(notes))
|
||||
notes2[0] = note
|
||||
i := 1
|
||||
for _, note := range notes {
|
||||
if note.NoteId.Hex() != noteId {
|
||||
if i == lenNotes { // 防止越界
|
||||
break;
|
||||
}
|
||||
notes2[i] = note
|
||||
i++
|
||||
}
|
||||
}
|
||||
notes = notes2
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 得到最近的笔记
|
||||
_, latestNotes := noteService.ListNotes(c.GetUserId(), "", false, c.GetPage(), 50, defaultSortField, false, false);
|
||||
c.RenderArgs["latestNotes"] = latestNotes
|
||||
}
|
||||
|
||||
// 没有传入笔记
|
||||
// 那么得到最新笔记
|
||||
if !hasRightNoteId {
|
||||
_, notes = noteService.ListNotes(c.GetUserId(), "", false, c.GetPage(), 50, defaultSortField, false, false);
|
||||
if len(notes) > 0 {
|
||||
noteContent = noteService.GetNoteContent(notes[0].NoteId.Hex(), userId)
|
||||
c.RenderArgs["curNoteId"] = notes[0].NoteId.Hex()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 当然, 还需要得到第一个notes的content
|
||||
//...
|
||||
Log(configService.GetAdminUsername())
|
||||
c.RenderArgs["isAdmin"] = configService.GetAdminUsername() == userInfo.Username
|
||||
|
||||
c.RenderArgs["userInfo"] = userInfo
|
||||
c.RenderArgs["notebooks"] = notebooks
|
||||
c.RenderArgs["shareNotebooks"] = shareNotebooks
|
||||
c.RenderArgs["shareNotebooks"] = shareNotebooks // note信息在notes列表中
|
||||
c.RenderArgs["sharedUserInfos"] = sharedUserInfos
|
||||
|
||||
c.RenderArgs["notes"] = notes
|
||||
@ -69,6 +124,9 @@ func (c Note) Index() revel.Result {
|
||||
|
||||
c.RenderArgs["globalConfigs"] = configService.GetGlobalConfigForUser()
|
||||
|
||||
|
||||
// return c.RenderTemplate("note/note.html")
|
||||
|
||||
if isDev, _ := revel.Config.Bool("mode.dev"); isDev {
|
||||
return c.RenderTemplate("note/note-dev.html")
|
||||
} else {
|
||||
|
@ -33,6 +33,8 @@ func (c Preview) getPreviewThemeAbsolutePath(themeId string) bool {
|
||||
theme := themeService.GetTheme(c.GetUserId(), themeId)
|
||||
|
||||
c.RenderArgs["isPreview"] = true
|
||||
c.RenderArgs["themeId"] = themeId
|
||||
c.RenderArgs["themeInfoPreview"] = theme.Info
|
||||
c.RenderArgs["themePath"] = theme.Path
|
||||
if theme.Path == "" {
|
||||
return false
|
||||
|
@ -44,7 +44,7 @@ func (c AdminUser) Register(email, pwd string) revel.Result {
|
||||
}
|
||||
|
||||
// 注册
|
||||
re.Ok, re.Msg = authService.Register(email, pwd)
|
||||
re.Ok, re.Msg = authService.Register(email, pwd, "")
|
||||
|
||||
return c.RenderRe(re)
|
||||
}
|
||||
|
@ -1,15 +1,15 @@
|
||||
package member
|
||||
|
||||
import (
|
||||
"github.com/revel/revel"
|
||||
. "github.com/leanote/leanote/app/lea"
|
||||
"github.com/leanote/leanote/app/info"
|
||||
"os"
|
||||
"io/ioutil"
|
||||
"time"
|
||||
"fmt"
|
||||
"github.com/leanote/leanote/app/info"
|
||||
. "github.com/leanote/leanote/app/lea"
|
||||
"github.com/revel/revel"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
// "github.com/leanote/leanote/app/lea/blog"
|
||||
"time"
|
||||
// "github.com/leanote/leanote/app/lea/blog"
|
||||
)
|
||||
|
||||
// 博客管理
|
||||
@ -28,35 +28,34 @@ func (c MemberBlog) common() info.UserBlog {
|
||||
|
||||
userBlog := blogService.GetUserBlog(userId)
|
||||
c.RenderArgs["userBlog"] = userBlog
|
||||
|
||||
|
||||
c.SetUserInfo()
|
||||
c.SetLocale()
|
||||
return userBlog
|
||||
}
|
||||
|
||||
|
||||
// 得到sorterField 和 isAsc
|
||||
// okSorter = ['email', 'username']
|
||||
func (c MemberBlog) getSorter(sorterField string, isAsc bool, okSorter []string) (string, bool){
|
||||
func (c MemberBlog) getSorter(sorterField string, isAsc bool, okSorter []string) (string, bool) {
|
||||
sorter := ""
|
||||
c.Params.Bind(&sorter, "sorter")
|
||||
if sorter == "" {
|
||||
return sorterField, isAsc;
|
||||
return sorterField, isAsc
|
||||
}
|
||||
|
||||
|
||||
// sorter形式 email-up, email-down
|
||||
s2 := strings.Split(sorter, "-")
|
||||
if len(s2) != 2 {
|
||||
return sorterField, isAsc;
|
||||
return sorterField, isAsc
|
||||
}
|
||||
|
||||
|
||||
// 必须是可用的sorter
|
||||
if okSorter != nil && len(okSorter) > 0 {
|
||||
if !InArray(okSorter, s2[0]) {
|
||||
return sorterField, isAsc;
|
||||
return sorterField, isAsc
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sorterField = strings.Title(s2[0])
|
||||
if s2[1] == "up" {
|
||||
isAsc = true
|
||||
@ -64,28 +63,29 @@ func (c MemberBlog) getSorter(sorterField string, isAsc bool, okSorter []string)
|
||||
isAsc = false
|
||||
}
|
||||
c.RenderArgs["sorter"] = sorter
|
||||
return sorterField, isAsc;
|
||||
return sorterField, isAsc
|
||||
}
|
||||
|
||||
// 博客列表
|
||||
var userPageSize = 15
|
||||
|
||||
func (c MemberBlog) Index(sorter, keywords string) revel.Result {
|
||||
userId := c.GetUserId()
|
||||
userInfo := userService.GetUserInfo(userId)
|
||||
c.RenderArgs["userInfo"] = userInfo
|
||||
|
||||
|
||||
c.RenderArgs["title"] = "Posts"
|
||||
pageNumber := c.GetPage()
|
||||
sorterField, isAsc := c.getSorter("CreatedTime", false, []string{"title", "urlTitle", "updatedTime", "publicTime", "createdTime"});
|
||||
pageInfo, blogs := blogService.ListAllBlogs(c.GetUserId(), "", keywords, false, pageNumber, userPageSize, sorterField, isAsc);
|
||||
sorterField, isAsc := c.getSorter("CreatedTime", false, []string{"title", "urlTitle", "updatedTime", "publicTime", "createdTime"})
|
||||
pageInfo, blogs := blogService.ListAllBlogs(c.GetUserId(), "", keywords, false, pageNumber, userPageSize, sorterField, isAsc)
|
||||
c.RenderArgs["pageInfo"] = pageInfo
|
||||
c.RenderArgs["blogs"] = blogs
|
||||
c.RenderArgs["keywords"] = keywords
|
||||
|
||||
|
||||
userAndBlog := userService.GetUserAndBlog(c.GetUserId())
|
||||
c.RenderArgs["userAndBlog"] = userAndBlog
|
||||
|
||||
return c.RenderTemplate("member/blog/list.html");
|
||||
|
||||
return c.RenderTemplate("member/blog/list.html")
|
||||
}
|
||||
|
||||
// 修改笔记的urlTitle
|
||||
@ -95,17 +95,16 @@ func (c MemberBlog) UpdateBlogUrlTitle(noteId, urlTitle string) revel.Result {
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
|
||||
// 修改笔记的urlTitle
|
||||
func (c MemberBlog) UpdateBlogAbstract(noteId string) revel.Result {
|
||||
c.RenderArgs["title"] = "Update Post Abstract"
|
||||
note := noteService.GetNoteAndContent(noteId, c.GetUserId());
|
||||
note := noteService.GetNoteAndContent(noteId, c.GetUserId())
|
||||
if !note.Note.IsBlog {
|
||||
return c.E404();
|
||||
return c.E404()
|
||||
}
|
||||
c.RenderArgs["note"] = note
|
||||
c.RenderArgs["noteId"] = noteId
|
||||
return c.RenderTemplate("member/blog/update_abstract.html");
|
||||
return c.RenderTemplate("member/blog/update_abstract.html")
|
||||
}
|
||||
func (c MemberBlog) DoUpdateBlogAbstract(noteId, imgSrc, desc, abstract string) revel.Result {
|
||||
|
||||
@ -118,38 +117,33 @@ func (c MemberBlog) DoUpdateBlogAbstract(noteId, imgSrc, desc, abstract string)
|
||||
func (c MemberBlog) Base() revel.Result {
|
||||
c.common()
|
||||
c.RenderArgs["title"] = "Blog Base Info"
|
||||
return c.RenderTemplate("member/blog/base.html");
|
||||
return c.RenderTemplate("member/blog/base.html")
|
||||
}
|
||||
func (c MemberBlog) Comment() revel.Result {
|
||||
c.common()
|
||||
c.RenderArgs["title"] = "Comment"
|
||||
return c.RenderTemplate("member/blog/comment.html");
|
||||
}
|
||||
func (c MemberBlog) Domain() revel.Result {
|
||||
c.common()
|
||||
c.RenderArgs["title"] = "Domain"
|
||||
return c.RenderTemplate("member/blog/domain.html");
|
||||
return c.RenderTemplate("member/blog/comment.html")
|
||||
}
|
||||
|
||||
func (c MemberBlog) Paging() revel.Result {
|
||||
c.common()
|
||||
c.RenderArgs["title"] = "Paging"
|
||||
return c.RenderTemplate("member/blog/paging.html");
|
||||
return c.RenderTemplate("member/blog/paging.html")
|
||||
}
|
||||
|
||||
func (c MemberBlog) Cate() revel.Result {
|
||||
userBlog := c.common()
|
||||
c.RenderArgs["title"] = "Cate"
|
||||
|
||||
|
||||
notebooks := blogService.ListBlogNotebooks(c.GetUserId())
|
||||
notebooksMap := map[string]info.Notebook{}
|
||||
for _, each := range notebooks {
|
||||
notebooksMap[each.NotebookId.Hex()] = each
|
||||
}
|
||||
|
||||
var i = 0;
|
||||
|
||||
var i = 0
|
||||
notebooks2 := make([]info.Notebook, len(notebooks))
|
||||
|
||||
|
||||
// 先要保证已有的是正确的排序
|
||||
cateIds := userBlog.CateIds
|
||||
has := map[string]bool{} // cateIds中有的
|
||||
@ -171,8 +165,8 @@ func (c MemberBlog) Cate() revel.Result {
|
||||
}
|
||||
}
|
||||
c.RenderArgs["notebooks"] = notebooks2
|
||||
|
||||
return c.RenderTemplate("member/blog/cate.html");
|
||||
|
||||
return c.RenderTemplate("member/blog/cate.html")
|
||||
}
|
||||
|
||||
// 修改分类排序
|
||||
@ -199,9 +193,10 @@ func (c MemberBlog) AddOrUpdateSingle(singleId string) revel.Result {
|
||||
c.RenderArgs["title"] = "Add Single"
|
||||
c.RenderArgs["singleId"] = singleId
|
||||
if singleId != "" {
|
||||
c.RenderArgs["title"] = "Update Single"
|
||||
c.RenderArgs["single"] = blogService.GetSingle(singleId)
|
||||
}
|
||||
return c.RenderTemplate("member/blog/add_single.html");
|
||||
return c.RenderTemplate("member/blog/add_single.html")
|
||||
}
|
||||
func (c MemberBlog) SortSingles(singleIds []string) revel.Result {
|
||||
re := info.NewRe()
|
||||
@ -226,8 +221,8 @@ func (c MemberBlog) Single() revel.Result {
|
||||
c.common()
|
||||
c.RenderArgs["title"] = "Cate"
|
||||
c.RenderArgs["singles"] = blogService.GetSingles(c.GetUserId())
|
||||
|
||||
return c.RenderTemplate("member/blog/single.html");
|
||||
|
||||
return c.RenderTemplate("member/blog/single.html")
|
||||
}
|
||||
|
||||
// 主题
|
||||
@ -236,15 +231,16 @@ func (c MemberBlog) Theme() revel.Result {
|
||||
activeTheme, otherThemes := themeService.GetUserThemes(c.GetUserId())
|
||||
c.RenderArgs["activeTheme"] = activeTheme
|
||||
c.RenderArgs["otherThemes"] = otherThemes
|
||||
|
||||
|
||||
c.RenderArgs["optionThemes"] = themeService.GetDefaultThemes()
|
||||
|
||||
|
||||
c.RenderArgs["title"] = "Theme"
|
||||
return c.RenderTemplate("member/blog/theme.html");
|
||||
return c.RenderTemplate("member/blog/theme.html")
|
||||
}
|
||||
|
||||
// 编辑主题
|
||||
var baseTpls = []string{"header.html", "footer.html", "index.html", "cate.html", "search.html", "post.html", "single.html", "tags.html", "tag_posts.html", "archive.html", "share_comment.html", "404.html", "theme.json", "style.css", "blog.js"}
|
||||
|
||||
func (c MemberBlog) UpdateTheme(themeId string, isNew int) revel.Result {
|
||||
// 查看用户是否有该theme, 若没有则复制default之
|
||||
// 得到主题的文件列表
|
||||
@ -253,22 +249,25 @@ func (c MemberBlog) UpdateTheme(themeId string, isNew int) revel.Result {
|
||||
_, themeId = themeService.NewThemeForFirst(userBlog)
|
||||
return c.Redirect("/member/blog/updateTheme?themeId=" + themeId)
|
||||
}
|
||||
|
||||
|
||||
c.common()
|
||||
c.RenderArgs["title"] = "Upate Theme"
|
||||
c.RenderArgs["isNew"] = isNew
|
||||
|
||||
|
||||
// 先复制之
|
||||
c.RenderArgs["themeId"] = themeId
|
||||
|
||||
|
||||
// 得到脚本目录
|
||||
userId := c.GetUserId()
|
||||
|
||||
theme := themeService.GetTheme(userId, themeId)
|
||||
|
||||
theme := themeService.GetTheme(userId, themeId)
|
||||
if theme.ThemeId == "" {
|
||||
return c.E404()
|
||||
}
|
||||
c.RenderArgs["theme"] = theme
|
||||
|
||||
|
||||
path := revel.BasePath + "/" + theme.Path
|
||||
|
||||
|
||||
tpls := ListDir(path)
|
||||
myTpls := make([]string, len(baseTpls))
|
||||
tplMap := map[string]bool{}
|
||||
@ -279,16 +278,16 @@ func (c MemberBlog) UpdateTheme(themeId string, isNew int) revel.Result {
|
||||
// 得到没有的tpls
|
||||
for _, t := range tpls {
|
||||
if t == "images" {
|
||||
continue;
|
||||
continue
|
||||
}
|
||||
if !tplMap[t] {
|
||||
myTpls = append(myTpls, t)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
c.RenderArgs["myTpls"] = myTpls
|
||||
|
||||
return c.RenderTemplate("member/blog/update_theme.html");
|
||||
|
||||
return c.RenderTemplate("member/blog/update_theme.html")
|
||||
}
|
||||
|
||||
// 得到文件内容
|
||||
@ -296,13 +295,13 @@ func (c MemberBlog) GetTplContent(themeId string, filename string) revel.Result
|
||||
re := info.NewRe()
|
||||
re.Ok = true
|
||||
re.Item = themeService.GetTplContent(c.GetUserId(), themeId, filename)
|
||||
|
||||
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
func (c MemberBlog) UpdateTplContent(themeId, filename, content string) revel.Result {
|
||||
re := info.NewRe()
|
||||
re.Ok, re.Msg = themeService.UpdateTplContent(c.GetUserId(), themeId, filename, content)
|
||||
return c.RenderJson(re)
|
||||
return c.RenderRe(re)
|
||||
}
|
||||
|
||||
func (c MemberBlog) DeleteTpl(themeId, filename string) revel.Result {
|
||||
@ -331,7 +330,7 @@ func (c MemberBlog) DeleteThemeImage(themeId, filename string) revel.Result {
|
||||
|
||||
// 上传主题图片
|
||||
func (c MemberBlog) UploadThemeImage(themeId string) revel.Result {
|
||||
re := c.uploadImage(themeId);
|
||||
re := c.uploadImage(themeId)
|
||||
c.RenderArgs["fileUrlPath"] = re.Id
|
||||
c.RenderArgs["resultCode"] = re.Code
|
||||
c.RenderArgs["resultMsg"] = re.Msg
|
||||
@ -339,17 +338,17 @@ func (c MemberBlog) UploadThemeImage(themeId string) revel.Result {
|
||||
}
|
||||
func (c MemberBlog) uploadImage(themeId string) (re info.Re) {
|
||||
var fileId = ""
|
||||
var resultCode = 0 // 1表示正常
|
||||
var resultCode = 0 // 1表示正常
|
||||
var resultMsg = "内部错误" // 错误信息
|
||||
var Ok = false
|
||||
|
||||
|
||||
defer func() {
|
||||
re.Id = fileId // 只是id, 没有其它信息
|
||||
re.Code = resultCode
|
||||
re.Msg = resultMsg
|
||||
re.Ok = Ok
|
||||
}()
|
||||
|
||||
|
||||
file, handel, err := c.Request.FormFile("file")
|
||||
if err != nil {
|
||||
return re
|
||||
@ -363,11 +362,11 @@ func (c MemberBlog) uploadImage(themeId string) (re info.Re) {
|
||||
}
|
||||
// 生成新的文件名
|
||||
filename := handel.Filename
|
||||
|
||||
var ext string;
|
||||
|
||||
|
||||
var ext string
|
||||
|
||||
_, ext = SplitFilename(filename)
|
||||
if(ext != ".gif" && ext != ".jpg" && ext != ".png" && ext != ".bmp" && ext != ".jpeg") {
|
||||
if ext != ".gif" && ext != ".jpg" && ext != ".png" && ext != ".bmp" && ext != ".jpeg" {
|
||||
resultMsg = "不是图片"
|
||||
return re
|
||||
}
|
||||
@ -378,15 +377,15 @@ func (c MemberBlog) uploadImage(themeId string) (re info.Re) {
|
||||
LogJ(err)
|
||||
return re
|
||||
}
|
||||
|
||||
|
||||
// > 2M?
|
||||
if(len(data) > 5 * 1024 * 1024) {
|
||||
if len(data) > 5*1024*1024 {
|
||||
resultCode = 0
|
||||
resultMsg = "图片大于2M"
|
||||
return re
|
||||
}
|
||||
|
||||
toPath := dir + "/" + filename;
|
||||
|
||||
toPath := dir + "/" + filename
|
||||
err = ioutil.WriteFile(toPath, data, 0777)
|
||||
if err != nil {
|
||||
LogJ(err)
|
||||
@ -395,7 +394,7 @@ func (c MemberBlog) uploadImage(themeId string) (re info.Re) {
|
||||
TransToGif(toPath, 0, true)
|
||||
resultCode = 1
|
||||
resultMsg = "上传成功!"
|
||||
|
||||
|
||||
return re
|
||||
}
|
||||
|
||||
@ -406,18 +405,21 @@ func (c MemberBlog) ActiveTheme(themeId string) revel.Result {
|
||||
re.Ok = themeService.ActiveTheme(c.GetUserId(), themeId)
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
// 删除主题
|
||||
func (c MemberBlog) DeleteTheme(themeId string) revel.Result {
|
||||
re := info.NewRe()
|
||||
re.Ok = themeService.DeleteTheme(c.GetUserId(), themeId)
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
// 管理员公开主题
|
||||
func (c MemberBlog) PublicTheme(themeId string) revel.Result {
|
||||
re := info.NewRe()
|
||||
re.Ok = themeService.PublicTheme(c.GetUserId(), themeId)
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
// 导出
|
||||
func (c MemberBlog) ExportTheme(themeId string) revel.Result {
|
||||
re := info.NewRe()
|
||||
@ -427,21 +429,21 @@ func (c MemberBlog) ExportTheme(themeId string) revel.Result {
|
||||
return c.RenderText("error...")
|
||||
}
|
||||
fw, err := os.Open(path)
|
||||
if err != nil {
|
||||
if err != nil {
|
||||
return c.RenderText("error")
|
||||
}
|
||||
return c.RenderBinary(fw, GetFilename(path), revel.Attachment, time.Now()) // revel.Attachment
|
||||
}
|
||||
return c.RenderBinary(fw, GetFilename(path), revel.Attachment, time.Now()) // revel.Attachment
|
||||
}
|
||||
|
||||
// 导入主题
|
||||
func (c MemberBlog) ImportTheme() revel.Result {
|
||||
re := info.NewRe()
|
||||
|
||||
|
||||
file, handel, err := c.Request.FormFile("file")
|
||||
if err != nil {
|
||||
re.Msg = fmt.Sprintf("%v", err)
|
||||
return c.RenderJson(re)
|
||||
|
||||
|
||||
}
|
||||
defer file.Close()
|
||||
// 生成上传路径
|
||||
@ -454,10 +456,10 @@ func (c MemberBlog) ImportTheme() revel.Result {
|
||||
}
|
||||
// 生成新的文件名
|
||||
filename := handel.Filename
|
||||
|
||||
var ext string;
|
||||
|
||||
var ext string
|
||||
_, ext = SplitFilename(filename)
|
||||
if(ext != ".zip") {
|
||||
if ext != ".zip" {
|
||||
re.Msg = "请上传zip文件"
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
@ -467,40 +469,40 @@ func (c MemberBlog) ImportTheme() revel.Result {
|
||||
if err != nil {
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
|
||||
// > 10M?
|
||||
if(len(data) > 10 * 1024 * 1024) {
|
||||
if len(data) > 10*1024*1024 {
|
||||
re.Msg = "文件大于10M"
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
toPath := dir + "/" + filename;
|
||||
|
||||
toPath := dir + "/" + filename
|
||||
err = ioutil.WriteFile(toPath, data, 0777)
|
||||
if err != nil {
|
||||
re.Msg = fmt.Sprintf("%v", err)
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
|
||||
// 上传好后, 增加之
|
||||
themeService.ImportTheme(c.GetUserId(), toPath)
|
||||
|
||||
re.Ok = true
|
||||
return c.RenderJson(re)
|
||||
re.Ok, re.Msg = themeService.ImportTheme(c.GetUserId(), toPath)
|
||||
return c.RenderRe(re)
|
||||
}
|
||||
|
||||
|
||||
// 安装
|
||||
func (c MemberBlog) InstallTheme(themeId string) revel.Result {
|
||||
re := info.NewRe()
|
||||
re.Ok = themeService.InstallTheme(c.GetUserId(), themeId)
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
// 新建主题
|
||||
func (c MemberBlog) NewTheme() revel.Result {
|
||||
_, themeId := themeService.NewTheme(c.GetUserId())
|
||||
return c.Redirect("/member/blog/updateTheme?isNew=1&themeId=" + themeId)
|
||||
}
|
||||
|
||||
//-----------
|
||||
//
|
||||
//
|
||||
func (c MemberBlog) SetUserBlogBase(userBlog info.UserBlogBase) revel.Result {
|
||||
re := info.NewRe()
|
||||
re.Ok = blogService.UpdateUserBlogBase(c.GetUserId(), userBlog)
|
||||
@ -516,6 +518,7 @@ func (c MemberBlog) SetUserBlogStyle(userBlog info.UserBlogStyle) revel.Result {
|
||||
re.Ok = blogService.UpdateUserBlogStyle(c.GetUserId(), userBlog)
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
func (c MemberBlog) SetUserBlogPaging(perPageSize int, sortField string, isAsc bool) revel.Result {
|
||||
re := info.NewRe()
|
||||
re.Ok, re.Msg = blogService.UpdateUserBlogPaging(c.GetUserId(), perPageSize, sortField, isAsc)
|
||||
|
@ -35,7 +35,7 @@ func (c MemberGroup) UpdateGroupTitle(groupId, title string) revel.Result {
|
||||
func (c MemberGroup) DeleteGroup(groupId string) revel.Result {
|
||||
re := info.NewRe()
|
||||
re.Ok, re.Msg = groupService.DeleteGroup(c.GetUserId(), groupId)
|
||||
return c.RenderJson(re)
|
||||
return c.RenderRe(re)
|
||||
}
|
||||
|
||||
// 添加用户
|
||||
|
@ -128,6 +128,7 @@ func init() {
|
||||
revel.InterceptFunc(AuthInterceptor, revel.BEFORE, &MemberIndex{})
|
||||
revel.InterceptFunc(AuthInterceptor, revel.BEFORE, &MemberUser{})
|
||||
revel.InterceptFunc(AuthInterceptor, revel.BEFORE, &MemberBlog{})
|
||||
revel.InterceptFunc(AuthInterceptor, revel.BEFORE, &MemberGroup{})
|
||||
revel.OnAppStart(func() {
|
||||
})
|
||||
}
|
||||
}
|
@ -3,6 +3,7 @@ package db
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/revel/revel"
|
||||
. "github.com/leanote/leanote/app/lea"
|
||||
"gopkg.in/mgo.v2"
|
||||
"gopkg.in/mgo.v2/bson"
|
||||
)
|
||||
@ -56,12 +57,15 @@ var Themes *mgo.Collection
|
||||
var Sessions *mgo.Collection
|
||||
|
||||
// 初始化时连接数据库
|
||||
func Init() {
|
||||
var url string
|
||||
var ok bool
|
||||
func Init(url, dbname string) {
|
||||
ok := true
|
||||
config := revel.Config
|
||||
url, ok = config.String("db.url")
|
||||
dbname, _ := config.String("db.dbname")
|
||||
if url == "" {
|
||||
url, ok = config.String("db.url")
|
||||
}
|
||||
if dbname == "" {
|
||||
dbname, _ = config.String("db.dbname")
|
||||
}
|
||||
if !ok {
|
||||
host, _ := revel.Config.String("db.host")
|
||||
port, _ := revel.Config.String("db.port")
|
||||
@ -73,6 +77,7 @@ func Init() {
|
||||
}
|
||||
url = "mongodb://" + usernameAndPassword + host + ":" + port + "/" + dbname
|
||||
}
|
||||
Log(url)
|
||||
|
||||
// [mongodb://][user:pass@]host1[:port1][,host2[:port2],...][/database][?options]
|
||||
// mongodb://myuser:mypass@localhost:40001,otherhost:40001/mydb
|
||||
|
@ -41,7 +41,7 @@ type User struct {
|
||||
ImageSize int `bson:"ImageSize" json:"-"` // 图片大小
|
||||
AttachNum int `bson:"AttachNum" json:"-"` // 附件数量
|
||||
AttachSize int `bson:"AttachSize" json:"-"` // 附件大小
|
||||
PerAttachSize int `bson:"PerAttachSize" json:"-"` // 单个附件大小
|
||||
FromUserId bson.ObjectId `FromUserId,omitempty` // 邀请的用户
|
||||
|
||||
AccountType string `bson:"AccountType" json:"-"` // normal(为空), premium
|
||||
AccountStartTime time.Time `bson:"AccountStartTime" json:"-"` // 开始日期
|
||||
|
60
app/init.go
60
app/init.go
@ -112,6 +112,7 @@ func init() {
|
||||
}
|
||||
|
||||
// tags
|
||||
// 2014/12/30 标签添加链接
|
||||
revel.TemplateFuncs["blogTags"] = func(renderArgs map[string]interface{}, tags []string) template.HTML {
|
||||
if tags == nil || len(tags) == 0 {
|
||||
return ""
|
||||
@ -119,18 +120,74 @@ func init() {
|
||||
locale, _ := renderArgs[revel.CurrentLocaleRenderArg].(string)
|
||||
tagStr := ""
|
||||
lenTags := len(tags)
|
||||
|
||||
tagPostUrl, _ := renderArgs["tagPostsUrl"].(string)
|
||||
|
||||
for i, tag := range tags {
|
||||
str := revel.Message(locale, tag)
|
||||
var classes = "label"
|
||||
if strings.HasPrefix(str, "???") {
|
||||
str = tag
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
tagStr += str
|
||||
if i != lenTags-1 {
|
||||
tagStr += ","
|
||||
=======
|
||||
if InArray([]string{"red", "blue", "yellow", "green"}, tag) {
|
||||
classes += " label-" + tag
|
||||
} else {
|
||||
classes += " label-default"
|
||||
}
|
||||
|
||||
classes += " label-post"
|
||||
var url = tagPostUrl + "/" + url.QueryEscape(tag)
|
||||
tagStr += "<a class=\"" + classes + "\" href=\"" + url + "\">" + str + "</a>";
|
||||
if i != lenTags - 1 {
|
||||
tagStr += " "
|
||||
>>>>>>> dev-life
|
||||
}
|
||||
}
|
||||
return template.HTML(tagStr)
|
||||
}
|
||||
|
||||
// lea++
|
||||
revel.TemplateFuncs["blogTagsLea"] = func(renderArgs map[string]interface{}, tags []string, isRecommend bool) template.HTML {
|
||||
if tags == nil || len(tags) == 0 {
|
||||
return ""
|
||||
}
|
||||
locale, _ := renderArgs[revel.CurrentLocaleRenderArg].(string)
|
||||
tagStr := ""
|
||||
lenTags := len(tags)
|
||||
|
||||
tagPostUrl := "http://lea.leanote.com/"
|
||||
if isRecommend {
|
||||
tagPostUrl += "?tag=";
|
||||
} else {
|
||||
tagPostUrl += "latest?tag=";
|
||||
}
|
||||
|
||||
for i, tag := range tags {
|
||||
str := revel.Message(locale, tag)
|
||||
var classes = "label"
|
||||
if strings.HasPrefix(str, "???") {
|
||||
str = tag
|
||||
}
|
||||
if InArray([]string{"red", "blue", "yellow", "green"}, tag) {
|
||||
classes += " label-" + tag
|
||||
} else {
|
||||
classes += " label-default"
|
||||
}
|
||||
classes += " label-post"
|
||||
var url = tagPostUrl + url.QueryEscape(tag)
|
||||
tagStr += "<a class=\"" + classes + "\" href=\"" + url + "\">" + str + "</a>";
|
||||
if i != lenTags - 1 {
|
||||
tagStr += " "
|
||||
}
|
||||
}
|
||||
return template.HTML(tagStr)
|
||||
}
|
||||
|
||||
/*
|
||||
revel.TemplateFuncs["blogTags"] = func(tags []string) template.HTML {
|
||||
if tags == nil || len(tags) == 0 {
|
||||
@ -312,7 +369,7 @@ func init() {
|
||||
// init Email
|
||||
revel.OnAppStart(func() {
|
||||
// 数据库
|
||||
db.Init()
|
||||
db.Init("", "")
|
||||
// email配置
|
||||
InitEmail()
|
||||
InitVd()
|
||||
@ -324,4 +381,5 @@ func init() {
|
||||
member.InitService()
|
||||
service.ConfigS.InitGlobalConfigs()
|
||||
})
|
||||
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package lea
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/revel/revel"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func Log(i interface{}) {
|
||||
@ -12,4 +13,14 @@ func Log(i interface{}) {
|
||||
func LogJ(i interface{}) {
|
||||
b, _ := json.MarshalIndent(i, "", " ")
|
||||
revel.INFO.Println(string(b))
|
||||
}
|
||||
}
|
||||
|
||||
// 为test用
|
||||
func L(i interface{}) {
|
||||
fmt.Println(i)
|
||||
}
|
||||
|
||||
func LJ(i interface{}) {
|
||||
b, _ := json.MarshalIndent(i, "", " ")
|
||||
fmt.Println(string(b))
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import (
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
)
|
||||
|
||||
/*
|
||||
用golang exec 总是说找不到uglifyjs命令, 需要全部路径
|
||||
而且node, npm要在/usr/bin下, 已建ln
|
||||
@ -31,7 +32,7 @@ import (
|
||||
//var jss = []string{"js/jquery-cookie", "js/bootstrap"}
|
||||
var jss = []string{"js/jquery-cookie", "js/bootstrap",
|
||||
"js/common", "js/app/note", "js/app/tag", "js/app/notebook", "js/app/share",
|
||||
"js/object_id", "js/ZeroClipboard/ZeroClipboard"}
|
||||
"js/object_id"}
|
||||
|
||||
var base1 = "/Users/life/Documents/Go/package2/src/github.com/leanote/leanote/"
|
||||
var base = "/Users/life/Documents/Go/package2/src/github.com/leanote/leanote/public/"
|
||||
@ -52,7 +53,7 @@ func compressJs(filename string) {
|
||||
to := base + filename + "-min.js"
|
||||
cmd := exec.Command(cmdPath, source, "-o", to)
|
||||
_, err := cmd.CombinedOutput()
|
||||
|
||||
fmt.Println(source);
|
||||
cmdError(err)
|
||||
}
|
||||
|
||||
@ -80,7 +81,10 @@ func combineJs() {
|
||||
// 改note-dev->note
|
||||
func dev() {
|
||||
// 即替换note.js->note-min.js
|
||||
m := map[string]string{"note.js": "note-min.js",
|
||||
m := map[string]string{"tinymce.dev.js": "tinymce.min.js",
|
||||
"tinymce.js": "tinymce.min.js",
|
||||
"jquery.ztree.all-3.5.js": "jquery.ztree.all-3.5-min.js",
|
||||
"note.js": "note-min.js",
|
||||
"app.js": "app-min.js",
|
||||
"page.js": "page-min.js",
|
||||
"common.js": "common-min.js",
|
||||
@ -88,6 +92,7 @@ func dev() {
|
||||
"share.js": "share-min.js",
|
||||
"tag.js": "tag-min.js",
|
||||
"main.js": "main-min.js",
|
||||
"jquery.slimscroll.js": "jquery.slimscroll-min.js",
|
||||
"jquery.contextmenu.js": "jquery.contextmenu-min.js",
|
||||
"editor/editor.js": "editor/editor-min.js",
|
||||
"/public/mdeditor/editor/scrollLink.js": "/public/mdeditor/editor/scrollLink-min.js",
|
||||
@ -111,12 +116,21 @@ func tinymce() {
|
||||
// cmd := exec.Command("/Users/life/Documents/eclipse-workspace/go/leanote_release/tinymce-master/node_modules/jake/bin/cli.js", "minify", "bundle[themes:modern,plugins:table,paste,advlist,autolink,link,image,lists,charmap,hr,searchreplace,visualblocks,visualchars,code,nav,tabfocus,contextmenu,directionality,codemirror,codesyntax,textcolor,fullpage]")
|
||||
cmd := exec.Command("/Users/life/Documents/eclipse-workspace/go/leanote_release/tinymce-master/node_modules/jake/bin/cli.js", "minify")
|
||||
cmd.Dir = "/Users/life/Documents/eclipse-workspace/go/leanote_release/tinymce-master"
|
||||
c, err := cmd.CombinedOutput()
|
||||
|
||||
// 必须要先删除
|
||||
cmd2 := exec.Command("/bin/sh", "-c", "rm " + cmd.Dir + "/js/tinymce/tinymce.dev.js")
|
||||
cmd2.CombinedOutput()
|
||||
cmd2 = exec.Command("/bin/sh", "-c", "rm " + cmd.Dir + "/js/tinymce/tinymce.jquery.dev.js")
|
||||
c, _ := cmd2.CombinedOutput()
|
||||
fmt.Println(string(c))
|
||||
c, _ = cmd.CombinedOutput()
|
||||
fmt.Println(string(c))
|
||||
cmdError(err)
|
||||
}
|
||||
|
||||
func main() {
|
||||
// 压缩tinymce
|
||||
tinymce()
|
||||
|
||||
dev();
|
||||
|
||||
// 其它零散的需要压缩的js
|
||||
@ -133,6 +147,10 @@ func main() {
|
||||
"mdeditor/editor/underscore",
|
||||
"mdeditor/editor/mathJax",
|
||||
"js/jQuery-slimScroll-1.3.0/jquery.slimscroll",
|
||||
"js/app/editor_drop_paste",
|
||||
"js/app/attachment_upload",
|
||||
"js/jquery.ztree.all-3.5",
|
||||
"js/jQuery-slimScroll-1.3.0/jquery.slimscroll",
|
||||
}
|
||||
|
||||
for _, js := range otherJss {
|
||||
@ -141,7 +159,5 @@ func main() {
|
||||
|
||||
// 先压缩后合并
|
||||
combineJs()
|
||||
|
||||
// 压缩tinymce
|
||||
tinymce()
|
||||
|
||||
}
|
||||
|
@ -15,16 +15,16 @@ type AttachService struct {
|
||||
}
|
||||
|
||||
// add attach
|
||||
func (this *AttachService) AddAttach(attach info.Attach) bool {
|
||||
func (this *AttachService) AddAttach(attach info.Attach) (ok bool, msg string) {
|
||||
attach.CreatedTime = time.Now()
|
||||
ok := db.Insert(db.Attachs, attach)
|
||||
ok = db.Insert(db.Attachs, attach)
|
||||
|
||||
if ok {
|
||||
// 更新笔记的attachs num
|
||||
this.updateNoteAttachNum(attach.NoteId, 1)
|
||||
}
|
||||
|
||||
return ok
|
||||
return
|
||||
}
|
||||
|
||||
// 更新笔记的附件个数
|
||||
|
@ -5,6 +5,7 @@ import (
|
||||
// "github.com/leanote/leanote/app/db"
|
||||
"github.com/leanote/leanote/app/info"
|
||||
// "github.com/revel/revel"
|
||||
"strings"
|
||||
. "github.com/leanote/leanote/app/lea"
|
||||
"fmt"
|
||||
"strconv"
|
||||
@ -17,6 +18,8 @@ type AuthService struct {
|
||||
|
||||
// pwd已md5了
|
||||
func (this *AuthService) Login(emailOrUsername, pwd string) info.User {
|
||||
emailOrUsername = strings.Trim(emailOrUsername, " ")
|
||||
// pwd = strings.Trim(pwd, " ")
|
||||
userInfo := userService.LoginGetUserInfo(emailOrUsername, Md5(pwd))
|
||||
return userInfo
|
||||
}
|
||||
@ -32,12 +35,16 @@ func (this *AuthService) Login(emailOrUsername, pwd string) info.User {
|
||||
// 1. 添加用户
|
||||
// 2. 将leanote共享给我
|
||||
// [ok]
|
||||
func (this *AuthService) Register(email, pwd string) (bool, string) {
|
||||
func (this *AuthService) Register(email, pwd, fromUserId string) (bool, string) {
|
||||
// 用户是否已存在
|
||||
if userService.IsExistsUser(email) {
|
||||
return false, "userHasBeenRegistered-" + email
|
||||
}
|
||||
user := info.User{UserId: bson.NewObjectId(), Email: email, Username: email, Pwd: Md5(pwd)}
|
||||
if fromUserId != "" && IsObjectId(fromUserId) {
|
||||
user.FromUserId = bson.ObjectIdHex(fromUserId)
|
||||
}
|
||||
LogJ(user)
|
||||
return this.register(user)
|
||||
}
|
||||
|
||||
@ -129,4 +136,4 @@ func (this *AuthService) ThirdRegister(thirdType, thirdUserId, thirdUsername str
|
||||
}
|
||||
_, _ = this.register(userInfo)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ type FileService struct {
|
||||
}
|
||||
|
||||
// add Image
|
||||
func (this *FileService) AddImage(image info.File, albumId, userId string) bool {
|
||||
func (this *FileService) AddImage(image info.File, albumId, userId string, needCheckSize bool) (ok bool, msg string) {
|
||||
image.CreatedTime = time.Now()
|
||||
if albumId != "" {
|
||||
image.AlbumId = bson.ObjectIdHex(albumId)
|
||||
@ -27,7 +27,8 @@ func (this *FileService) AddImage(image info.File, albumId, userId string) bool
|
||||
}
|
||||
image.UserId = bson.ObjectIdHex(userId)
|
||||
|
||||
return db.Insert(db.Files, image)
|
||||
ok = db.Insert(db.Files, image)
|
||||
return
|
||||
}
|
||||
|
||||
// list images
|
||||
@ -147,7 +148,16 @@ func (this *FileService) GetFile(userId, fileId string) string {
|
||||
return path
|
||||
}
|
||||
|
||||
// 2014/12/28 修复, 如果是分享给用户组, 那就不行, 这里可以实现
|
||||
for _, noteId := range noteIds {
|
||||
note := noteService.GetNoteById(noteId.Hex())
|
||||
if shareService.HasReadPerm(note.UserId.Hex(), userId, noteId.Hex()) {
|
||||
return path;
|
||||
}
|
||||
}
|
||||
/*
|
||||
// 若有共享给我的笔记?
|
||||
// 对该笔记可读?
|
||||
if db.Has(db.ShareNotes, bson.M{"ToUserId": bson.ObjectIdHex(userId), "NoteId": bson.M{"$in": noteIds}}) {
|
||||
return path
|
||||
}
|
||||
@ -166,6 +176,7 @@ func (this *FileService) GetFile(userId, fileId string) string {
|
||||
return path
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
// 可能是刚复制到owner上, 但内容又没有保存, 所以没有note->imageId的映射, 此时看是否有fromFileId
|
||||
@ -222,7 +233,7 @@ func (this *FileService) CopyImage(userId, fileId, toUserId string) (bool, strin
|
||||
id := bson.NewObjectId();
|
||||
fileInfo.FileId = id
|
||||
fileId = id.Hex()
|
||||
Ok := this.AddImage(fileInfo, "", toUserId)
|
||||
Ok, _ := this.AddImage(fileInfo, "", toUserId, false)
|
||||
|
||||
if Ok {
|
||||
return Ok, id.Hex()
|
||||
|
@ -27,9 +27,12 @@ func (this *GroupService) AddGroup(userId, title string) (bool, info.Group) {
|
||||
// 删除分组
|
||||
// 判断是否有好友
|
||||
func (this *GroupService) DeleteGroup(userId, groupId string) (ok bool, msg string) {
|
||||
/*
|
||||
if db.Has(db.GroupUsers, bson.M{"GroupId": bson.ObjectIdHex(groupId)}) {
|
||||
return false, "hasUsers"
|
||||
return false, "groupHasUsers"
|
||||
}
|
||||
*/
|
||||
db.DeleteAll(db.GroupUsers, bson.M{"GroupId": bson.ObjectIdHex(groupId)})
|
||||
return db.DeleteByIdAndUserId(db.Groups, groupId, userId), ""
|
||||
|
||||
// TODO 删除分组后, 在shareNote, shareNotebook中也要删除
|
||||
|
@ -33,7 +33,8 @@ func (this *NoteContentHistoryService) AddHistory(noteId, userId string, eachHis
|
||||
// TODO
|
||||
l := len(history.Histories)
|
||||
if l >= maxSize {
|
||||
history.Histories = history.Histories[l-maxSize:]
|
||||
// history.Histories = history.Histories[l-maxSize:] // BUG, 致使都是以前的
|
||||
history.Histories = history.Histories[:maxSize]
|
||||
}
|
||||
newHistory := []info.EachHistory{eachHistory}
|
||||
newHistory = append(newHistory, history.Histories...) // 在开头加了, 最近的在最前
|
||||
@ -61,4 +62,4 @@ func (this *NoteContentHistoryService) ListHistories(noteId, userId string) []in
|
||||
histories := info.NoteContentHistory{}
|
||||
db.GetByIdAndUserId(db.NoteContentHistories, noteId, userId, &histories)
|
||||
return histories.Histories
|
||||
}
|
||||
}
|
||||
|
@ -49,6 +49,7 @@ func (this *ShareService) getOrQ(userId string) bson.M {
|
||||
return q
|
||||
}
|
||||
|
||||
// 得到共享给我的笔记本和用户(谁共享给了我)
|
||||
func (this *ShareService) GetShareNotebooks(userId string) (info.ShareNotebooksByUser, []info.User) {
|
||||
// 得到共享给我的用户s信息
|
||||
// 得到我参与的组织
|
||||
@ -60,7 +61,7 @@ func (this *ShareService) GetShareNotebooks(userId string) (info.ShareNotebooksB
|
||||
db.Distinct(db.ShareNotes, q, "UserId", &userIds1)
|
||||
|
||||
userIds2 := []bson.ObjectId{}
|
||||
db.Distinct(db.ShareNotebooks, q, "UserId", &userIds1)
|
||||
db.Distinct(db.ShareNotebooks, q, "UserId", &userIds2) // BUG之前是userId1, 2014/12/29
|
||||
|
||||
userIds := append(userIds1, userIds2...)
|
||||
userInfos := userService.GetUserInfosOrderBySeq(userIds);
|
||||
|
@ -13,6 +13,7 @@ import (
|
||||
"fmt"
|
||||
"html/template"
|
||||
"regexp"
|
||||
"io/ioutil"
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
@ -127,7 +128,8 @@ func (this *ThemeService) CopyDefaultTheme(userBlog info.UserBlog) (ok bool, the
|
||||
// 设为active true
|
||||
func (this *ThemeService) NewThemeForFirst(userBlog info.UserBlog) (ok bool, themeId string) {
|
||||
ok, themeId = this.CopyDefaultTheme(userBlog)
|
||||
db.UpdateByQField(db.Themes, bson.M{"_id": bson.ObjectIdHex(themeId)}, "IsActive", true)
|
||||
this.ActiveTheme(userBlog.UserId.Hex(), themeId)
|
||||
// db.UpdateByQField(db.Themes, bson.M{"_id": bson.ObjectIdHex(themeId)}, "IsActive", true)
|
||||
return
|
||||
}
|
||||
|
||||
@ -285,11 +287,15 @@ func (this *ThemeService) GetThemePath(userId, themeId string) string {
|
||||
}
|
||||
// 更新模板内容
|
||||
func (this *ThemeService) UpdateTplContent(userId, themeId, filename, content string) (ok bool, msg string) {
|
||||
path := this.GetThemeAbsolutePath(userId, themeId) + "/" + filename
|
||||
basePath := this.GetThemeAbsolutePath(userId, themeId)
|
||||
path := basePath + "/" + filename
|
||||
if strings.Contains(filename, ".html") {
|
||||
// 模板
|
||||
if ok, msg = this.mustTpl(filename, content); ok {
|
||||
ok = PutFileStrContent(path, content)
|
||||
Log(">>")
|
||||
if ok, msg = this.ValidateTheme(basePath, filename, content); ok {
|
||||
// 模板
|
||||
if ok, msg = this.mustTpl(filename, content); ok {
|
||||
ok = PutFileStrContent(path, content)
|
||||
}
|
||||
}
|
||||
return
|
||||
} else if filename == "theme.json" {
|
||||
@ -410,6 +416,11 @@ func (this *ThemeService) ImportTheme(userId, path string) (ok bool, msg string)
|
||||
DeleteFile(targetPath)
|
||||
return
|
||||
}
|
||||
// 主题验证
|
||||
if ok, msg = this.ValidateTheme(targetPath, "", ""); !ok {
|
||||
DeleteFile(targetPath)
|
||||
return
|
||||
}
|
||||
// 解压成功, 那么新建之
|
||||
// 保存到数据库中
|
||||
theme, _ := this.getThemeConfig(targetPath)
|
||||
@ -505,5 +516,119 @@ func (this *ThemeService) InstallTheme(userId, themeId string) (ok bool) {
|
||||
|
||||
ok = db.Insert(db.Themes, theme)
|
||||
|
||||
// 激活之
|
||||
this.ActiveTheme(userId, themeId);
|
||||
|
||||
return ok
|
||||
}
|
||||
|
||||
// 验证主题是否全法, 存在循环引用?
|
||||
// filename, newContent 表示在修改模板时要判断模板修改时是否有错误
|
||||
func (this *ThemeService) ValidateTheme(path string, filename, newContent string) (ok bool, msg string) {
|
||||
Log("theme Path")
|
||||
Log(path)
|
||||
// 建立一个有向图
|
||||
// 将该path下的所有文件提出, 得到文件的引用情况
|
||||
files := ListDir(path)
|
||||
LogJ(files);
|
||||
size := len(files)
|
||||
if(size > 100) {
|
||||
ok = false;
|
||||
msg = "tooManyFiles"
|
||||
return
|
||||
}
|
||||
/*
|
||||
111111111
|
||||
111000000
|
||||
*/
|
||||
vector := make([][]int, size)
|
||||
for i := 0; i < size; i++ {
|
||||
vector[i] = make([]int, size)
|
||||
}
|
||||
fileIndexMap := map[string]int{} // fileName => index
|
||||
fileContent := map[string]string{} // fileName => content
|
||||
index := 0
|
||||
// 得到文件内容, 和建立索引, 每个文件都有一个index, 对应数组位置
|
||||
for _, t := range files {
|
||||
if !strings.Contains(t, ".html") {
|
||||
continue;
|
||||
}
|
||||
if t != filename {
|
||||
fileBytes, err := ioutil.ReadFile(path + "/" + t)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
||||
fileIndexMap[t] = index;
|
||||
// html内容
|
||||
fileStr := string(fileBytes)
|
||||
fileContent[t] = fileStr
|
||||
} else {
|
||||
fileIndexMap[t] = index
|
||||
fileContent[t] = newContent
|
||||
}
|
||||
index++
|
||||
}
|
||||
// 分析文件内容, 建立有向图
|
||||
reg, _ := regexp.Compile("{{ *template \"(.+?\\.html)\".*}}")
|
||||
for filename, content := range fileContent {
|
||||
thisIndex := fileIndexMap[filename]
|
||||
finds := reg.FindAllStringSubmatch(content, -1) // 子匹配
|
||||
LogJ(finds)
|
||||
// Log(content)
|
||||
if finds != nil && len(finds) > 0 {
|
||||
for _, includes := range finds {
|
||||
include := includes[1]
|
||||
includeIndex, has := fileIndexMap[include]
|
||||
Log(includeIndex)
|
||||
Log("??")
|
||||
Log(has)
|
||||
if has {
|
||||
vector[thisIndex][includeIndex] = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LogJ(vector)
|
||||
LogJ(fileIndexMap)
|
||||
// 建立图后, 判断是否有环
|
||||
if this.hasRound(vector, index) {
|
||||
ok = false
|
||||
msg = "themeValidHasRoundInclude"
|
||||
} else {
|
||||
ok = true
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 检测有向图是否有环, DFS
|
||||
func (this *ThemeService) hasRound(vector [][]int, size int) (ok bool) {
|
||||
for i := 0; i < size; i++ {
|
||||
visited := make([]int, size)
|
||||
if this.hasRoundEach(vector, i, size, visited) {
|
||||
Log(">>")
|
||||
Log(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// 从每个节点出发, 判断是否有环
|
||||
func (this *ThemeService) hasRoundEach(vector [][]int, index int, size int, visited []int) (ok bool) {
|
||||
if visited[index] > 0 {
|
||||
Log("<")
|
||||
Log(index)
|
||||
return true
|
||||
}
|
||||
visited[index] = 1;
|
||||
// 遍历它的孩子
|
||||
for i := 0; i < size; i++ {
|
||||
if vector[index][i] > 0 {
|
||||
return this.hasRoundEach(vector, i, size, visited);
|
||||
}
|
||||
}
|
||||
visited[index] = 0;
|
||||
return false;
|
||||
}
|
||||
|
@ -369,7 +369,7 @@ func (this *UserService) ThirdAddUser(userId, email, pwd string) (ok bool, msg s
|
||||
// 宽度
|
||||
func (this *UserService)UpdateColumnWidth(userId string, notebookWidth, noteListWidth, mdEditorWidth int) bool {
|
||||
return db.UpdateByQMap(db.Users, bson.M{"_id": bson.ObjectIdHex(userId)},
|
||||
bson.M{"NotebookWidth": notebookWidth, "NoteListWidth": noteListWidth, "mdEditorWidth": mdEditorWidth})
|
||||
bson.M{"NotebookWidth": notebookWidth, "NoteListWidth": noteListWidth, "MdEditorWidth": mdEditorWidth})
|
||||
}
|
||||
// 左侧是否隐藏
|
||||
func (this *UserService)UpdateLeftIsMin(userId string, leftIsMin bool) bool {
|
||||
|
63
app/views/errors/500-blog.html
Normal file
63
app/views/errors/500-blog.html
Normal file
@ -0,0 +1,63 @@
|
||||
{{template "home/header_box.html" .}}
|
||||
|
||||
<section id="box">
|
||||
<div>
|
||||
<div>
|
||||
<h1 class="h text-white animated fadeInDownBig">ERROR!</h1>
|
||||
</div>
|
||||
<div id="errorBox">
|
||||
<p class="error-info">
|
||||
Sorry, you(not we) got an error. This error is just showing in blog preview for test.
|
||||
</p>
|
||||
|
||||
<div class="list-group m-b-sm bg-white m-b-lg">
|
||||
|
||||
{{with .Error}}
|
||||
<div id="header" class="block">
|
||||
<h1>
|
||||
{{.Title}}
|
||||
</h1>
|
||||
<p>
|
||||
{{if .SourceType}}
|
||||
The {{.SourceType}} <strong>{{.Path}}</strong> does not compile: <strong>{{.Description}}</strong>
|
||||
{{else}}
|
||||
{{.Description}}
|
||||
{{end}}
|
||||
</p>
|
||||
</div>
|
||||
{{if .Path}}
|
||||
<div id="source" class="block">
|
||||
<h2>In {{.Path}}
|
||||
{{if .Line}}
|
||||
(around {{if .Line}}line {{.Line}}{{end}}{{if .Column}} column {{.Column}}{{end}})
|
||||
{{end}}
|
||||
</h2>
|
||||
{{range .ContextSource}}
|
||||
<div class="line {{if .IsError}}error{{end}}">
|
||||
<span class="lineNumber">{{.Line}}:</span>
|
||||
<pre>{{.Source}}</pre>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .MetaError}}
|
||||
<div id="source" class="block">
|
||||
<h2>Additionally, an error occurred while handling this error.</h2>
|
||||
<div class="line error">
|
||||
{{.MetaError}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div id="boxFooter">
|
||||
<p>
|
||||
<a href="/index">leanote</a> © 2014
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -100,7 +100,9 @@ $(function() {
|
||||
$("#registerBtn").html("{{msg . "ing"}}...").addClass("disabled");
|
||||
// hideMsg();
|
||||
|
||||
$.post("/doRegister", {email: email, pwd: pwd}, function(e) {
|
||||
var iu = "{{.iu}}";
|
||||
|
||||
$.post("/doRegister", {email: email, pwd: pwd, iu: iu}, function(e) {
|
||||
$("#registerBtn").html("{{msg . "register"}}").removeClass("disabled");
|
||||
if(e.Ok) {
|
||||
$("#registerBtn").html("{{msg . "registerSuccessAndRdirectToNote"}}");
|
||||
|
@ -1,13 +1,13 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">
|
||||
{{if .page}}
|
||||
修改页面
|
||||
{{if .single}}
|
||||
{{msg . "updateSingle"}}
|
||||
{{else}}
|
||||
添加页面
|
||||
{{msg . "addSingle"}}
|
||||
{{end}}
|
||||
</h3></div>
|
||||
|
||||
<link rel="stylesheet" href="/tinymce/skins/custom/skin.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="/tinymce/skins/custom/skin.min.css" type="text/css">
|
||||
<div class="row">
|
||||
<div class="col-sm-10">
|
||||
<form id="formData">
|
||||
@ -16,18 +16,18 @@
|
||||
<div class="alert alert-danger" id="baseMsg" style="display: none"></div>
|
||||
<input type="hidden" id="singleId" value="{{.single.SingleId.Hex}}" />
|
||||
<div class="form-group">
|
||||
<label>标题</label>
|
||||
<label>{{msg . "title"}}</label>
|
||||
<input type="text" class="form-control" id="title" name="title"
|
||||
value="{{.single.Title}}"
|
||||
data-rules='[
|
||||
{rule: "required", msg: "请输入页面标题"},
|
||||
{rule: "required", msg: "{{msg . "inputSingleTitle"}}"},
|
||||
]'
|
||||
data-msg_target="#baseMsg"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="content1">内容</label>
|
||||
<label for="content1">{{msg . "content"}}</label>
|
||||
<div id="popularToolbar"></div>
|
||||
<textarea id="content1" name="content">{{.single.Content}}</textarea>
|
||||
</div>
|
||||
@ -41,9 +41,9 @@
|
||||
|
||||
</div>
|
||||
{{template "member/footer.html" .}}
|
||||
<script type="text/javascript" src="/tinymce/tinymce.min.js"></script>
|
||||
<script type="text/javascript" src="/tinymce/tinymce.js"></script>
|
||||
<script>
|
||||
var urlPrefix = "{{.siteUrl}}";
|
||||
var urlPrefix = "{{.siteUrl}}";
|
||||
$(function() {
|
||||
tinymce.init({
|
||||
selector : "#content1",
|
||||
@ -55,7 +55,7 @@ $(function() {
|
||||
skin : "custom",
|
||||
plugins : [
|
||||
"advlist autolink link leanote_image lists charmap hr ",
|
||||
"searchreplace visualblocks visualchars leanote_code tabfocus",
|
||||
"searchreplace visualblocks visualchars tabfocus",
|
||||
"table contextmenu directionality textcolor paste fullpage textcolor"],
|
||||
toolbar1 : "formatselect |fontselect fontsizeselect| forecolor backcolor | bold italic underline strikethrough | bullist numlist |",
|
||||
menubar : false,
|
||||
|
@ -1,29 +1,26 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "baseInfoSet"}}</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg $ "basicInfoSet"}}</h3></div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-10">
|
||||
<div class="col-sm-8">
|
||||
<div id="formData">
|
||||
<section class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="alert alert-danger" id="baseMsg" style="display: none"></div>
|
||||
<div class="form-horizontal" role="form" id="userBlogForm">
|
||||
<div role="form" id="userBlogForm">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="title" class="col-sm-2 control-label">{{msg . "blogName"}}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="Title" name="Title"
|
||||
<label for="title" >{{msg . "blogName"}}</label>
|
||||
<input type="text" class="form-control" id="Title" name="Title"
|
||||
placeholder="eg: leanote's blog"
|
||||
value="{{if .userBlog.Title}}{{.userBlog.Title}}{{else}}{{.userInfo.Email}} 's blog{{end}}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="logo" class="col-sm-2 control-label">{{msg . "blogLogo"}}</label>
|
||||
<div class="col-sm-10">
|
||||
<label for="logo">{{msg . "blogLogo"}}</label>
|
||||
<input type="hidden" name="Logo" id="Logo"
|
||||
value="{{.userBlog.Logo}}" />
|
||||
<form id="formLogo" action="{{$.siteUrl}}/file/uploadBlogLogo" method="post"
|
||||
<form id="formLogo" action="/file/uploadBlogLogo" method="post"
|
||||
enctype="multipart/form-data" target="logoTarget">
|
||||
<input type="file" class="form-control" id="logo2" name="file"
|
||||
onChange='$("#formLogo").submit();' />
|
||||
@ -37,16 +34,13 @@
|
||||
</div>
|
||||
</form>
|
||||
<iframe id="logoTarget" name="logoTarget" src="#" style="display: none"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="subTitle" class="col-sm-2 control-label">{{msg . "blogDesc"}}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="SubTitle"
|
||||
<label for="subTitle">{{msg . "blogDesc"}}</label>
|
||||
<input type="text" class="form-control" id="SubTitle"
|
||||
name="SubTitle" value="{{.userBlog.SubTitle}}"
|
||||
placeholder="eg: leanote, Not Just A Notebook">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
@ -1,29 +1,37 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">(笔记本)分类</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "cate"}}</h3></div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
<section class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
分类是公开为博客的笔记本
|
||||
{{msg . "cateIsPublicNotebook"}}
|
||||
<br />
|
||||
拖动可排序
|
||||
{{if .notebooks}}
|
||||
{{msg . "dragAndSort"}}
|
||||
<ul class="list-group gutter list-group-lg list-group-sp sortable">
|
||||
{{range .notebooks}}
|
||||
<li class="list-group-item" draggable="true" data-id="{{.NotebookId.Hex}}">
|
||||
<span class="pull-left media-xs"><i class="fa fa-sort text-muted fa m-r-sm"></i></span>
|
||||
<div class="pull-right" style="margin-right: 10px">
|
||||
固定链接: /cate/<input data-id="{{.NotebookId.Hex}}" class="url-title" type="text" value="{{if .UrlTitle}}{{.UrlTitle|decodeUrlValue}}{{else}}{{.NotebookId.Hex}}{{end}}"/>
|
||||
{{msg $ "permanentLink"}}: /cate/<input data-id="{{.NotebookId.Hex}}" class="url-title" type="text" value="{{if .UrlTitle}}{{.UrlTitle|decodeUrlValue}}{{else}}{{.NotebookId.Hex}}{{end}}"/>
|
||||
</div>
|
||||
{{.Title}}
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
{{else}}
|
||||
{{msg . "noCates"}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{if .notebooks}}
|
||||
<footer class="panel-footer text-right bg-light lter">
|
||||
<button type="submit" id="baseBtn" class="btn btn-success">{{msg . "submit"}}</button>
|
||||
<button type="submit" id="baseBtn" class="btn btn-success">{{msg . "saveSort"}}</button>
|
||||
</footer>
|
||||
{{end}}
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
@ -22,7 +22,7 @@
|
||||
<input type="radio"
|
||||
name="commentType"
|
||||
value="default"
|
||||
{{if or (not .userBlog.CommentType) (eq .userBlog.CommentType "default")}}checked="checked"{{end}} > Default
|
||||
{{if or (not .userBlog.CommentType) (eq .userBlog.CommentType "default")}}checked="checked"{{end}} > {{msg $ "defaultComment"}}
|
||||
</label>
|
||||
|
||||
<label>
|
||||
|
@ -1,5 +1,5 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"><h3 class="m-b-none">文章列表</h3></div>
|
||||
<div class="m-b-md"><h3 class="m-b-none">{{msg . "postList"}}</h3></div>
|
||||
<style>
|
||||
.url-title {
|
||||
width: 260px;
|
||||
@ -13,7 +13,7 @@
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<div class="input-group search-group">
|
||||
<input type="text" class="input-sm form-control" placeholder="Title" id="keywords" value="{{.keywords}}" />
|
||||
<input type="text" class="input-sm form-control" placeholder="{{msg . "title"}}" id="keywords" value="{{.keywords}}" />
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-sm btn-default" type="button" data-url="/member/blog/index">Search</button>
|
||||
</span>
|
||||
@ -40,7 +40,7 @@
|
||||
style="width: 300px"
|
||||
{{sorterTh $url "urlTitle" .sorter}}
|
||||
>
|
||||
固定链接
|
||||
{{msg $ "permanentLink"}}
|
||||
<span class="th-sort">
|
||||
<i class="fa fa-sort-down"></i>
|
||||
<i class="fa fa-sort-up"></i>
|
||||
@ -50,7 +50,7 @@
|
||||
<th
|
||||
{{sorterTh $url "publicTime" .sorter}}
|
||||
>
|
||||
发布日期
|
||||
{{msg . "publicTime"}}
|
||||
<span class="th-sort">
|
||||
<i class="fa fa-sort-down"></i>
|
||||
<i class="fa fa-sort-up"></i>
|
||||
@ -61,7 +61,7 @@
|
||||
<th
|
||||
{{sorterTh $url "updatedTime" .sorter}}
|
||||
>
|
||||
更新日期
|
||||
{{msg . "updatedTime"}}
|
||||
<span class="th-sort">
|
||||
<i class="fa fa-sort-down"></i>
|
||||
<i class="fa fa-sort-up"></i>
|
||||
@ -71,7 +71,7 @@
|
||||
<th
|
||||
{{sorterTh $url "createdTime" .sorter}}
|
||||
>
|
||||
创建日期
|
||||
{{msg . "createdTime"}}
|
||||
<span class="th-sort">
|
||||
<i class="fa fa-sort-down"></i>
|
||||
<i class="fa fa-sort-up"></i>
|
||||
@ -114,13 +114,13 @@
|
||||
|
||||
<a
|
||||
{{if .HasSelfDefined}}
|
||||
title="已设置"
|
||||
title="{{msg $ "hasSelfDefined"}}"
|
||||
class="btn btn-sm btn-success"
|
||||
{{else}}
|
||||
title="未设置"
|
||||
title="{{msg $ "noSelfDefined"}}"
|
||||
class="btn btn-sm btn-default"
|
||||
{{end}}
|
||||
href="/member/blog/updateBlogAbstract?noteId={{.NoteId.Hex}}">摘要设置</a>
|
||||
href="/member/blog/updateBlogAbstract?noteId={{.NoteId.Hex}}">{{msg $ "setAbstract"}}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
|
@ -1,5 +1,5 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">分页与排序设置</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg $ "pagingAndSort"}}</h3></div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
@ -8,43 +8,35 @@
|
||||
<div class="panel-body">
|
||||
<div class="alert alert-danger" id="domainMsg" style="display: none"></div>
|
||||
|
||||
<form class="form-horizontal" role="form" id="dataFrom">
|
||||
|
||||
<form role="form" id="dataFrom">
|
||||
<div class="form-group">
|
||||
<label for="perPageSize" class="col-sm-2 control-label">每页记录数</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control"
|
||||
<label for="perPageSize">{{msg . "perPageSize"}}</label>
|
||||
<input type="text" class="form-control"
|
||||
placeholder="10"
|
||||
id="perPageSize"
|
||||
name="perPageSize"
|
||||
value="{{.userBlog.PerPageSize}}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="perPageSize" class="col-sm-2 control-label">排序字段</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control"
|
||||
id="sortField"
|
||||
name="sortField"
|
||||
value="">
|
||||
<option value="PublicTime" {{if eq $.userBlog.SortField "PublicTime"}}selected{{end}}>公开为博客时间</option>
|
||||
<option value="CreatedTime" {{if eq $.userBlog.SortField "CreatedTimeTime"}}selected{{end}}>创建时间</option>
|
||||
<option value="UpdatedTime" {{if eq $.userBlog.SortField "UpdatedTime"}}selected{{end}}>更新时间</option>
|
||||
<option value="Title" {{if eq $.userBlog.SortField "Title"}}selected{{end}}>标题</option>
|
||||
</select>
|
||||
</div>
|
||||
<label for="perPageSize" >{{msg . "sortField"}}</label>
|
||||
<select class="form-control"
|
||||
id="sortField"
|
||||
name="sortField"
|
||||
value="">
|
||||
<option value="PublicTime" {{if eq $.userBlog.SortField "PublicTime"}}selected{{end}}>{{msg $ "publicTime"}}</option>
|
||||
<option value="CreatedTime" {{if eq $.userBlog.SortField "CreatedTimeTime"}}selected{{end}}>{{msg $ "createdTime"}}</option>
|
||||
<option value="UpdatedTime" {{if eq $.userBlog.SortField "UpdatedTime"}}selected{{end}}>{{msg $ "updatedTime"}}</option>
|
||||
<option value="Title" {{if eq $.userBlog.SortField "Title"}}selected{{end}}>{{msg . "title"}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">排序类型</label>
|
||||
<div class="col-sm-10" style="margin-top: 5px;">
|
||||
<label><input type="radio" name="isAsc" value="0" {{if not .userBlog.IsAsc}}checked{{end}}> 降序</label>
|
||||
<label><input type="radio" name="isAsc" value="1" {{if .userBlog.IsAsc}}checked{{end}}> 升序</label>
|
||||
<label>{{msg $ "sortType"}}</label>
|
||||
<div>
|
||||
<label><input type="radio" name="isAsc" value="0" {{if not .userBlog.IsAsc}}checked{{end}}> {{msg . "desc"}}</label>
|
||||
<label><input type="radio" name="isAsc" value="1" {{if .userBlog.IsAsc}}checked{{end}}> {{msg . "asc"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<footer class="panel-footer text-right bg-light lter">
|
||||
<button type="submit" id="baseBtn" class="btn btn-success">{{msg . "submit"}}</button>
|
||||
|
@ -1,13 +1,13 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">单页面</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "single"}}</h3></div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
<section class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<p>
|
||||
您可以添加多个单页面
|
||||
<a href="/member/blog/addOrUpdateSingle" id="addBtn" class="btn btn-success">添加页面</a>
|
||||
{{msg $ "singleTips"}}
|
||||
<a href="/member/blog/addOrUpdateSingle" id="addBtn" class="btn btn-success">{{msg $ "addSingle"}}</a>
|
||||
</p>
|
||||
<ul class="list-group gutter list-group-lg list-group-sp sortable">
|
||||
{{range .singles}}
|
||||
@ -18,7 +18,7 @@
|
||||
<a href="#"><i class="fa fa-times icon-muted fa-fw page-delete" data-id="{{.SingleId}}"></i></a>
|
||||
</span>
|
||||
<div class="pull-right" style="margin-right: 10px">
|
||||
固定链接: /single/<input data-id="{{.SingleId}}" class="url-title" type="text" value="{{if .UrlTitle}}{{.UrlTitle|decodeUrlValue}}{{else}}{{.SingleId}}{{end}}"/>
|
||||
{{msg $ "permanentLink"}}: /single/<input data-id="{{.SingleId}}" class="url-title" type="text" value="{{if .UrlTitle}}{{.UrlTitle|decodeUrlValue}}{{else}}{{.SingleId}}{{end}}"/>
|
||||
</div>
|
||||
<div class="clear">
|
||||
{{.Title}}
|
||||
@ -29,7 +29,7 @@
|
||||
</div>
|
||||
{{if .singles}}
|
||||
<footer class="panel-footer text-right bg-light lter">
|
||||
<button type="submit" id="baseBtn" class="btn btn-success">保存排序</button>
|
||||
<button type="submit" id="baseBtn" class="btn btn-success">{{msg . "saveSort"}}</button>
|
||||
</footer>
|
||||
{{end}}
|
||||
</section>
|
||||
@ -37,7 +37,7 @@
|
||||
|
||||
</div>
|
||||
{{template "member/footer.html" .}}
|
||||
<script type="text/javascript" src="{{.siteUrl}}/public/member/js/jquery.sortable.js"></script>
|
||||
<script type="text/javascript" src="/public/member/js/jquery.sortable.js"></script>
|
||||
<script>
|
||||
$(function() {
|
||||
$("#baseBtn").click(function(){
|
||||
@ -79,7 +79,7 @@ $(function() {
|
||||
art.alert(re.Msg || "error");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -2,9 +2,13 @@
|
||||
<div class="m-b-md clearfix">
|
||||
<h3 class="m-b-none">
|
||||
{{msg . "themeSet"}}
|
||||
<small>(<a href="http://blog.leanote.com/post/545f1a5c380782565e000000" target="_blank">{{msg . "needHelp"}}</a>)</small>
|
||||
<small>
|
||||
(<a href="http://blog.leanote.com/post/545f1a5c380782565e000000" target="_blank">{{msg . "needHelp"}}</a>
|
||||
<a target="_blank" href="https://github.com/leanote/leanote/wiki/leanote-blog-theme-api">Leanote Blog Theme Api</a>)
|
||||
</small>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 theme-container">
|
||||
<section class="panel panel-default">
|
||||
@ -12,9 +16,9 @@
|
||||
<div>
|
||||
<form id="uploadAvatar" method="post" action="/member/blog/importTheme" enctype="multipart/form-data">
|
||||
<div id="dropAvatar" class="dropzone">
|
||||
<a class="btn btn-default btn-new" href="/member/blog/newTheme"><span class="fa fa-plus"></span> 新建主题</a>
|
||||
<a class="btn btn-default btn-new" href="/member/blog/newTheme"><span class="fa fa-plus"></span> {{msg . "addTheme"}}</a>
|
||||
<a class="btn btn-success btn-choose-file">
|
||||
<span class="fa fa-upload"></span> 导入主题(.zip)
|
||||
<span class="fa fa-upload"></span> {{msg . "importTheme"}}(.zip)
|
||||
</a>
|
||||
<input type="file" name="file" multiple/>
|
||||
<div id="avatarUploadMsg"></div>
|
||||
@ -22,10 +26,10 @@
|
||||
</form>
|
||||
</div>
|
||||
<p>
|
||||
当前主题:
|
||||
{{msg . "currentTheme"}}:
|
||||
</p>
|
||||
<ul class="themes">
|
||||
<li class="theme">
|
||||
<div class="themes clearfix">
|
||||
<div class="theme pull-left">
|
||||
<a class="choose-theme" data-method="put" href="#" rel="nofollow">
|
||||
<div class="theme-thumb thumb active-theme">
|
||||
<img src="/{{.activeTheme.Path}}/images/screenshot.png" alt="preview">
|
||||
@ -37,17 +41,26 @@
|
||||
</span>
|
||||
<div class="theme-btns">
|
||||
<div class="btn-group" data-id="{{.activeTheme.ThemeId.Hex}}">
|
||||
<a class="btn btn-default btn-sm btn-export"><span class="fa fa-download"></span> 导出</a>
|
||||
<a class="btn btn-default btn-sm" href="{{$.siteUrl}}/preview?themeId={{.activeTheme.ThemeId.Hex}}" target="_blank"><span class="fa fa-eye"></span> 预览</a>
|
||||
<a class="btn btn-primary btn-sm" target="_blank" href="/member/blog/updateTheme?themeId={{if .activeTheme.ThemeId}}{{.activeTheme.ThemeId.Hex}}{{end}}"><span class="fa fa-pencil"></span> 编辑</a>
|
||||
<a class="btn btn-default btn-sm btn-export"><span class="fa fa-download"></span> {{msg $ "export"}}</a>
|
||||
<!-- 必须是自己的主题 -->
|
||||
{{if .activeTheme.ThemeId}}
|
||||
<a class="btn btn-default btn-sm" href="{{$.siteUrl}}/preview?themeId={{.activeTheme.ThemeId.Hex}}" target="_blank"><span class="fa fa-eye"></span> {{msg $ "preview"}}</a>
|
||||
{{end}}
|
||||
<a class="btn btn-primary btn-sm" target="_blank" href="/member/blog/updateTheme?themeId={{if .activeTheme.ThemeId}}{{.activeTheme.ThemeId.Hex}}{{end}}"><span class="fa fa-pencil"></span> {{msg $ "edit"}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{{if .activeTheme.Info.Desc}}
|
||||
<!-- 描述 -->
|
||||
<div class="pull-left theme-desc">
|
||||
{{.activeTheme.Info.Desc|raw}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
<p>
|
||||
我的其它主题:
|
||||
{{msg . "myOtherThemes"}}:
|
||||
</p>
|
||||
<ul class="themes">
|
||||
{{range $.otherThemes}}
|
||||
@ -56,6 +69,11 @@
|
||||
<a class="choose-theme" data-method="put" href="#" rel="nofollow">
|
||||
<div class="theme-thumb thumb">
|
||||
<img src="/{{.Path}}/images/screenshot.png" alt="preview">
|
||||
{{if .Info.Desc}}
|
||||
<div class="theme-desc-mask">
|
||||
{{.Info.Desc|raw}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<span class="theme-title">{{.Name}}</span>
|
||||
</a>
|
||||
@ -64,11 +82,11 @@
|
||||
</span>
|
||||
<div class="theme-btns">
|
||||
<div class="btn-group" data-id="{{.ThemeId.Hex}}">
|
||||
<a class="btn btn-default btn-sm btn-delete" data-loading-text="..."><span class="fa fa-remove"></span> 删除</a>
|
||||
<a class="btn btn-default btn-sm btn-export"><span class="fa fa-download"></span> 导出</a>
|
||||
<a class="btn btn-default btn-sm" href="{{$.siteUrl}}/preview?themeId={{.ThemeId.Hex}}" target="_blank"><span class="fa fa-eye"></span> 预览</a>
|
||||
<a class="btn btn-default btn-sm" target="_blank" href="/member/blog/updateTheme?themeId={{.ThemeId.Hex}}"><span class="fa fa-pencil"></span> 编辑</a>
|
||||
<a class="btn btn-primary btn-sm btn-active" data-loading-text="..."><span class="fa fa-check"></span> 使用</a>
|
||||
<a class="btn btn-default btn-sm btn-delete" data-loading-text="..."><span class="fa fa-remove"></span> {{msg $ "delete"}}</a>
|
||||
<a class="btn btn-default btn-sm btn-export"><span class="fa fa-download"></span> {{msg $ "export"}}</a>
|
||||
<a class="btn btn-default btn-sm" href="{{$.siteUrl}}/preview?themeId={{.ThemeId.Hex}}" target="_blank"><span class="fa fa-eye"></span> {{msg $ "preview"}}</a>
|
||||
<a class="btn btn-default btn-sm" target="_blank" href="/member/blog/updateTheme?themeId={{.ThemeId.Hex}}"><span class="fa fa-pencil"></span> {{msg $ "edit"}}</a>
|
||||
<a class="btn btn-primary btn-sm btn-active" data-loading-text="..."><span class="fa fa-check"></span> {{msg $ "use"}}</a>
|
||||
{{if $.isAdmin}}
|
||||
<a class="btn btn-default btn-sm btn-public" data-loading-text="...">
|
||||
{{if .IsDefault}}
|
||||
@ -83,13 +101,13 @@
|
||||
</li>
|
||||
{{end}}
|
||||
{{else}}
|
||||
无
|
||||
{{msg $ "none"}}
|
||||
{{end}}
|
||||
</ul>
|
||||
|
||||
<hr />
|
||||
<p>
|
||||
leanote主题市场:
|
||||
{{msg . "leanoteThemeMarket"}}:
|
||||
</p>
|
||||
<ul class="themes">
|
||||
{{range $.optionThemes}}
|
||||
@ -97,6 +115,11 @@
|
||||
<a class="choose-theme" data-method="put" href="#" rel="nofollow">
|
||||
<div class="theme-thumb thumb">
|
||||
<img src="/{{.Path}}/images/screenshot.png" alt="preview">
|
||||
{{if .Info.Desc}}
|
||||
<div class="theme-desc-mask">
|
||||
{{.Info.Desc|raw}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<span class="theme-title">{{.Name}}</span>
|
||||
</a>
|
||||
@ -104,7 +127,7 @@
|
||||
By: <a href="{{.AuthorUrl}}" target="_blank">{{.Author}}</a>
|
||||
</span>
|
||||
<p class="theme-btns" data-id="{{.ThemeId.Hex}}">
|
||||
<a class="btn btn-primary btn-sm btn-install"><span class="fa fa-gear"></span> 安装</a>
|
||||
<a class="btn btn-primary btn-sm btn-install"><span class="fa fa-gear"></span> {{msg $ "install"}}</a>
|
||||
</p>
|
||||
</li>
|
||||
{{end}}
|
||||
|
@ -11,7 +11,7 @@
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<link rel="stylesheet" href="/tinymce/skins/custom/skin.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="/tinymce/skins/custom/skin.min.css" type="text/css">
|
||||
<div class="row">
|
||||
<div class="col-sm-10">
|
||||
<form id="formData">
|
||||
@ -61,7 +61,7 @@
|
||||
{{template "member/footer.html" .}}
|
||||
<script type="text/javascript" src="/tinymce/tinymce.js"></script>
|
||||
<script>
|
||||
var UrlPrefix = "{{.siteUrl}}";
|
||||
var UrlPrefix = "{{.siteUrl}}";
|
||||
$(function() {
|
||||
tinymce.init({
|
||||
selector : "#content1",
|
||||
@ -73,9 +73,9 @@ $(function() {
|
||||
skin : "custom",
|
||||
plugins : [
|
||||
"advlist autolink link leanote_image lists charmap hr ",
|
||||
"searchreplace visualblocks visualchars leanote_code tabfocus",
|
||||
"searchreplace visualblocks visualchars tabfocus",
|
||||
"table contextmenu directionality textcolor paste fullpage textcolor"],
|
||||
toolbar1 : "formatselect |fontselect fontsizeselect| forecolor backcolor | bold italic underline strikethrough | bullist numlist | leanote_code",
|
||||
toolbar1 : "formatselect |fontselect fontsizeselect| forecolor backcolor | bold italic underline strikethrough | bullist numlist",
|
||||
menubar : false,
|
||||
statusbar : false,
|
||||
font_formats : "Arial=arial,helvetica,sans-serif;"
|
||||
|
@ -2,13 +2,18 @@
|
||||
<div class="m-b-md">
|
||||
<h3 class="m-b-none">
|
||||
{{if .isNew}}
|
||||
新建主题
|
||||
{{msg $ "addTheme"}}
|
||||
{{else}}
|
||||
编辑主题
|
||||
{{msg $ "updateTheme"}}
|
||||
-
|
||||
{{.theme.Name}}
|
||||
{{end}}
|
||||
<a class="btn btn-default" href="{{$.siteUrl}}/preview?themeId={{.themeId}}" target="_blank"><span class="fa fa-eye"></span> 预览</a>
|
||||
<a class="btn btn-default" href="{{$.siteUrl}}/preview?themeId={{.themeId}}" target="_blank"><span class="fa fa-eye"></span> {{msg . "preview"}}</a>
|
||||
|
||||
<small>
|
||||
(<a href="http://blog.leanote.com/post/545f1a5c380782565e000000" target="_blank">{{msg . "needHelp"}}</a>
|
||||
<a target="_blank" href="https://github.com/leanote/leanote/wiki/leanote-blog-theme-api">Leanote Blog Theme Api</a>)
|
||||
</small>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
@ -42,7 +47,7 @@
|
||||
<div class="col-sm-4">
|
||||
<section class="panel panel-default">
|
||||
<header class="panel-heading">
|
||||
模板, 样式, 脚本:
|
||||
{{msg . "tplStyleScript"}}:
|
||||
</header>
|
||||
<div class="panel-body" style="height:430px;overflow: auto;">
|
||||
|
||||
@ -58,14 +63,14 @@
|
||||
</div>
|
||||
</div>
|
||||
<footer class="panel-footer text-right bg-light lter">
|
||||
<a class="btn btn-default" id="newFile">新建文件</a>
|
||||
<a class="btn btn-default" id="newFile">{{msg . "newFile"}}</a>
|
||||
</footer>
|
||||
</section>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<section class="panel panel-default">
|
||||
<header class="panel-heading">
|
||||
当前文件: <span id="curTpl">header.html</span>
|
||||
{{msg . "currentFile"}}: <span id="curTpl">header.html</span>
|
||||
<span id="msg"></span>
|
||||
</header>
|
||||
<div class="panel-body">
|
||||
@ -82,7 +87,7 @@
|
||||
<div class="col-sm-12">
|
||||
<section class="panel panel-default">
|
||||
<header class="panel-heading">
|
||||
图片: images/
|
||||
{{msg . "image"}}: images/
|
||||
</header>
|
||||
<div class="panel-body">
|
||||
<ul class="image-list" id="imageList">
|
||||
@ -102,7 +107,7 @@
|
||||
</div>
|
||||
|
||||
{{template "member/footer.html" .}}
|
||||
<script src="/public/member/js/ace/ace.js" type="text/javascript"></script>
|
||||
<script src="/public/libs/ace/ace.js" type="text/javascript"></script>
|
||||
<script>
|
||||
var editor = ace.edit("tplContent");
|
||||
editor.setTheme("ace/theme/tomorrow");
|
||||
@ -118,7 +123,7 @@ var theme = {
|
||||
saveBtnO: $("#saveBtn"),
|
||||
newFileO: $("#newFile"),
|
||||
curTpl: "",
|
||||
tplInfos: {"header.html": "头部", "footer.html": "底部", "index.html": "首页", "cate.html": "分类页", "search.html": "搜索页", "single.html": "单页", "archive.html": "归档页", "post.html": "文章页", "tags.html": "标签页", "tag_posts.html": "标签文章页", "share_comment.html": "分享评论", "404.html":"404", "theme.json": "主题配置", "paging.html": "分页", "highlight.html": "高亮"},
|
||||
tplInfos: {"header.html": "{{msg . "header"}}", "footer.html": "{{msg . "footer"}}", "index.html": "{{msg . "header"}}", "cate.html": "{{msg . "cate"}}", "search.html": "{{msg . "search"}}", "single.html": "{{msg . "single"}}", "archive.html": "{{msg . "archive"}}", "post.html": "{{msg . "post"}}", "tags.html": "{{msg . "tags"}}", "tag_posts.html": "{{msg . "tag_posts"}}", "share_comment.html": "{{msg . "share_comment"}}", "404.html":"404", "theme.json": "{{msg . "themeJson"}}", "paging.html": "{{msg . "paging"}}", "highlight.html": "{{msg . "highlight"}}"},
|
||||
init: function() {
|
||||
var self = this;
|
||||
self.showTplInfo();
|
||||
@ -183,11 +188,11 @@ var theme = {
|
||||
info = self.tplInfos[file];
|
||||
if(!info) {
|
||||
if(file.indexOf(".css") > 0) {
|
||||
info = "样式";
|
||||
info = "{{msg . "style"}}";
|
||||
} else if(file.indexOf(".js") > 0) {
|
||||
info = "脚本";
|
||||
info = "{{msg . "script"}}";
|
||||
} else if(file.indexOf(".html") > 0) {
|
||||
info = "模板";
|
||||
info = "{{msg . "tpl"}}";
|
||||
}
|
||||
} else {
|
||||
$(this).find(".remove-file").remove();
|
||||
@ -209,7 +214,7 @@ var theme = {
|
||||
if(t) {
|
||||
t.button("loading");
|
||||
}
|
||||
self.msgO.html("正在保存...");
|
||||
self.msgO.html("...");
|
||||
ajaxPost("/member/blog/updateTplContent", {themeId: themeId, filename: self.curTpl, content: content}, function(re) {
|
||||
if(t) {
|
||||
t.button("reset");
|
||||
@ -217,7 +222,7 @@ var theme = {
|
||||
if(reIsOk(re)) {
|
||||
self.cache[filename] = content;
|
||||
// art.tips("Success");
|
||||
self.msgO.html("保存成功")
|
||||
self.msgO.html("{{msg . "saveSuccess"}}")
|
||||
setTimeout(function() {
|
||||
self.msgO.html("");
|
||||
}, 3000);
|
||||
|
@ -8,17 +8,19 @@
|
||||
width: 200px;
|
||||
}
|
||||
</style>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">项目组/成员</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "group"}}</h3></div>
|
||||
|
||||
<p>
|
||||
<a class="btn btn-default btn-add-group"><span class="fa fa-plus"></span> 新建分组</a>
|
||||
<a class="btn btn-default btn-add-group"><span class="fa fa-plus"></span> {{msg . "newGroup"}}</a>
|
||||
</p>
|
||||
|
||||
|
||||
<script type="text/x-jsrender" id="tUser">
|
||||
<li class="list-group-item" data-id="[[:UserId]]">
|
||||
[[:Username]] [[if Email != Username]]([[:Email]])[[/if]]
|
||||
<span class="fa fa-remove pull-right text-xs m-t-sm"></span>
|
||||
<a title="{{msg . "deleteMember"}}" class="delete-user">
|
||||
<span class="fa fa-remove pull-right text-xs m-t-sm"></span>
|
||||
</a>
|
||||
</li>
|
||||
</script>
|
||||
|
||||
@ -30,7 +32,7 @@
|
||||
<div class="clear">
|
||||
<div class="h3 m-t-xs m-b-xs text-white">
|
||||
<input type="text" data-ever="[[:Title]]" value="[[:Title]]" class="group-title" />
|
||||
<a title="删除分组" class="delete-group">
|
||||
<a title="{{msg . "deleteGroup"}}" class="delete-group">
|
||||
<i class="fa fa-remove text-white pull-right text-xs m-t-sm"></i>
|
||||
</a>
|
||||
</div>
|
||||
@ -39,7 +41,7 @@
|
||||
</header>
|
||||
<ul class="list-group no-radius">
|
||||
<li class="list-group-item">
|
||||
<input type="text" class="add-user-input form-control" placeholder="输入用户名或邮箱添加成员" />
|
||||
<input type="text" class="add-user-input form-control" placeholder="{{msg . "addMemberTips"}}" />
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
@ -57,7 +59,7 @@
|
||||
<div class="clear">
|
||||
<div class="h3 m-t-xs m-b-xs text-white">
|
||||
<input type="text" data-ever="{{.Title}}" value="{{.Title}}" class="group-title" />
|
||||
<a title="删除分组" class="delete-group">
|
||||
<a title="{{msg $ "deleteGroup"}}" class="delete-group">
|
||||
<i class="fa fa-remove text-white pull-right text-xs m-t-sm"></i>
|
||||
</a>
|
||||
</div>
|
||||
@ -69,13 +71,13 @@
|
||||
{{range .Users}}
|
||||
<li class="list-group-item" data-id="{{.UserId.Hex}}">
|
||||
{{.Username}} {{if not (eq .Email .Username)}}({{.Email}}){{end}}
|
||||
<a title="删除成员" class="delete-user">
|
||||
<a title="{{msg $ "deleteMember"}}" class="delete-user">
|
||||
<span class="fa fa-remove pull-right text-xs m-t-sm"></span>
|
||||
</a>
|
||||
</li>
|
||||
{{end}}
|
||||
<li class="list-group-item">
|
||||
<input type="text" class="add-user-input form-control" placeholder="输入用户名或邮箱添加成员" />
|
||||
<input type="text" class="add-user-input form-control" placeholder="{{msg $ "addMemberTips"}}" />
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
@ -85,7 +87,7 @@
|
||||
</div>
|
||||
|
||||
{{template "member/footer.html" .}}
|
||||
<script src="http://leanote.com/public/blog/js/jsrender.js"></script>
|
||||
<script src="/public/blog/js/jsrender.js"></script>
|
||||
<script>
|
||||
var group = {
|
||||
tGroupO: $("#tGroup"),
|
||||
@ -111,7 +113,7 @@ var group = {
|
||||
addGroupEvent: function() {
|
||||
var self = this;
|
||||
$('.btn-add-group').click(function() {
|
||||
ajaxPost("/member/group/addGroup", {title: "分组名"}, function(re) {
|
||||
ajaxPost("/member/group/addGroup", {title: "Group Title"}, function(re) {
|
||||
if(reIsOk(re)) {
|
||||
var group = re.Item;
|
||||
self.groupsO.prepend(self.tGroupO.render(group))
|
||||
@ -217,4 +219,4 @@ $(function() {
|
||||
});
|
||||
|
||||
</script>
|
||||
{{template "member/end.html" .}}
|
||||
{{template "member/end.html" .}}
|
||||
|
@ -1,5 +1,5 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{.userInfo.Username}}, 欢迎来到leanote</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{.userInfo.Username}}, {{msg . "welcomeToLeanote"}}.</h3></div>
|
||||
|
||||
<section class="panel panel-default">
|
||||
<div class="row m-l-none m-r-none bg-light lter">
|
||||
@ -26,11 +26,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 最新动态 -->
|
||||
<section class="panel panel-default">
|
||||
<h4 class="font-thin padder">
|
||||
Leanote 动态
|
||||
{{msg . "leanoteEvents"}}
|
||||
</h4>
|
||||
<ul class="list-group" id="eventsList"></ul>
|
||||
</section>
|
||||
|
@ -26,45 +26,47 @@
|
||||
</i>
|
||||
</span>
|
||||
<span>
|
||||
帐户信息
|
||||
{{msg . "accountInfo"}}
|
||||
</span>
|
||||
</a>
|
||||
<!-- 导航列表 -->
|
||||
<ul class="nav lt">
|
||||
{{if $.userInfo.Email}}
|
||||
<li>
|
||||
<a href="/member/user/username">
|
||||
<span>
|
||||
用户名
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/member/user/avatar">
|
||||
<span>
|
||||
头像
|
||||
{{msg . "avatar"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
{{if $.userInfo.Email}}
|
||||
<li>
|
||||
<a href="/member/user/username">
|
||||
<span>
|
||||
{{msg . "username"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/member/user/email">
|
||||
<span>
|
||||
邮箱
|
||||
{{msg . "email"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/member/user/password">
|
||||
<span>
|
||||
密码
|
||||
{{msg . "password"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{{else}}
|
||||
<li>
|
||||
<a href="/member/user/add_account">
|
||||
<a href="/member/user/addAccount">
|
||||
<span>
|
||||
添加leanote帐户
|
||||
{{msg . "addLeanoteAccount"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@ -85,14 +87,14 @@
|
||||
</i>
|
||||
</span>
|
||||
<span>
|
||||
博客
|
||||
{{msg . "blog"}}
|
||||
</span>
|
||||
</a>
|
||||
<ul class="nav lt">
|
||||
<li>
|
||||
<a href="/member/blog/index">
|
||||
<span>
|
||||
文章列表
|
||||
{{msg . "postList"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@ -100,42 +102,43 @@
|
||||
<li>
|
||||
<a href="/member/blog/base">
|
||||
<span>
|
||||
基本信息
|
||||
{{msg . "basicInfoSet"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/member/blog/comment">
|
||||
<span>
|
||||
评论
|
||||
{{msg . "comment"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/member/blog/cate">
|
||||
<span>
|
||||
分类
|
||||
{{msg . "cate"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/member/blog/single">
|
||||
<span>
|
||||
单页面
|
||||
{{msg . "single"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/member/blog/paging">
|
||||
<span>
|
||||
分页与排序设置
|
||||
{{msg . "pagingAndSort"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/member/blog/theme">
|
||||
<span>
|
||||
主题
|
||||
{{msg . "theme"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@ -149,9 +152,9 @@
|
||||
</b>
|
||||
</i>
|
||||
<span>
|
||||
项目组/成员
|
||||
{{msg . "group"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</nav>
|
@ -38,7 +38,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li class="hidden-xs">
|
||||
<a href="/blog/{{$.session.Username}}" class="dk" target="_blank">
|
||||
<a href="http://blog.leanote.com/{{$.session.Username}}" class="dk" target="_blank">
|
||||
{{msg . "myBlog"}}
|
||||
</a>
|
||||
</li>
|
||||
@ -115,4 +115,4 @@ padding: 10px 15px;text-align:center;">
|
||||
</ul>
|
||||
-->
|
||||
<!-- 主要内容区 -->
|
||||
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">用户名设置</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "addLeanoteAccount"}}</h3></div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-6">
|
||||
<div class="col-sm-8">
|
||||
<form id="formData">
|
||||
<section class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
|
@ -1,10 +1,10 @@
|
||||
{{template "member/top.html" .}}
|
||||
|
||||
<div class="m-b-md"> <h3 class="m-b-none">头像设置</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "avatar"}}</h3></div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-6">
|
||||
<div class="col-sm-8">
|
||||
<form id="uploadAvatar" method="post" action="/file/uploadAvatar" enctype="multipart/form-data">
|
||||
<section class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
@ -14,7 +14,7 @@
|
||||
<img src="{{if .userInfo.Logo}}{{.userInfo.Logo}}{{else}}/images/blog/default_avatar.png{{end}}" id="avatar"/>
|
||||
</div>
|
||||
<a class="btn btn-success btn-choose-file">
|
||||
<span class="fa fa-upload"></span> Choose Image
|
||||
<span class="fa fa-upload"></span> {{msg . "chooseImage"}}
|
||||
</a>
|
||||
<input type="file" name="file" multiple/>
|
||||
</div>
|
||||
|
@ -1,9 +1,9 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">邮箱设置</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "email"}}</h3></div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-6">
|
||||
<div class="col-sm-8">
|
||||
<form id="formData">
|
||||
<section class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
|
@ -1,9 +1,7 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">用户名设置</h3></div>
|
||||
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "password"}}</h3></div>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-6">
|
||||
<div class="col-sm-8">
|
||||
<form id="formData">
|
||||
<section class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
|
@ -1,9 +1,9 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">用户名设置</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "username"}}</h3></div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-6">
|
||||
<div class="col-sm-8">
|
||||
<form id="formData">
|
||||
<section class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
|
@ -12,17 +12,19 @@
|
||||
|
||||
<link href="/css/bootstrap.css" rel="stylesheet" />
|
||||
<!-- 先加载, 没有样式, 宽度不定 -->
|
||||
<link rel="stylesheet" href="tinymce/skins/custom/skin.min.css" rel="stylesheet"/>
|
||||
|
||||
<link rel="stylesheet" href="/tinymce/skins/custom/skin.min.css" rel="stylesheet"/>
|
||||
<!-- leanote css -->
|
||||
<link href="css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet" />
|
||||
<link href="css/zTreeStyle/zTreeStyle.css" rel="stylesheet" />
|
||||
<link href="/css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet" />
|
||||
<link href="/css/zTreeStyle/zTreeStyle.css" rel="stylesheet" />
|
||||
<!-- mdeditor -->
|
||||
<link href="/public/dist/themes/default.css" rel="stylesheet" />
|
||||
|
||||
<script>
|
||||
var hash = location.hash;
|
||||
if(hash == "#writing") {
|
||||
var files = '<link rel="stylesheet" href="css/theme/writting-overwrite.css" type="text/css" id="themeLink" />';
|
||||
if(hash.indexOf("writing") >= 0) {
|
||||
var files = '<link rel="stylesheet" href="/css/theme/writting-overwrite.css" type="text/css" id="themeLink" />';
|
||||
} else {
|
||||
var files ='<link rel="stylesheet" href="css/theme/{{if .userInfo.Theme}}{{.userInfo.Theme}}{{else}}default{{end}}.css" type="text/css" id="themeLink" />';
|
||||
var files ='<link rel="stylesheet" href="/css/theme/{{if .userInfo.Theme}}{{.userInfo.Theme}}{{else}}default{{end}}.css" type="text/css" id="themeLink" />';
|
||||
}
|
||||
document.write(files);
|
||||
</script>
|
||||
@ -169,7 +171,7 @@ function log(o) {
|
||||
{{if .isAdmin}}
|
||||
<li role="presentation" class="divider"></li>
|
||||
<li role="presentation">
|
||||
<a target="_blank" title="{{msg . "amdin"}}" href="/admin/index">
|
||||
<a target="_blank" title="{{msg . "admin"}}" href="/admin/index">
|
||||
<i class="fa fa-dashboard"></i>
|
||||
<span>{{msg . "admin"}}</span>
|
||||
</a>
|
||||
@ -184,6 +186,12 @@ function log(o) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pull-right top-nav writting-hide lea-blog">
|
||||
<a target="_blank" href="http://lea.leanote.com">
|
||||
lea++
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="pull-right top-nav writting-hide" id="myBlog">
|
||||
<a target="_blank" href="{{$.blogUrl}}/{{.userInfo.Username}}">
|
||||
{{msg . "myBlog"}}
|
||||
@ -327,6 +335,11 @@ function log(o) {
|
||||
<div class="noteSplit" id="notebookSplitter"></div>
|
||||
|
||||
<div id="noteAndEditor">
|
||||
<div id="noteAndEditorMask">
|
||||
<img src="/images/loading-24.gif"/>
|
||||
<br />
|
||||
loading...
|
||||
</div>
|
||||
<div id="noteList">
|
||||
<div class="clearfix" id="notesAndSort" style="position: relative">
|
||||
<div class="pull-left">
|
||||
@ -411,11 +424,11 @@ function log(o) {
|
||||
<span id="noteReadTags"></span>
|
||||
|
||||
<!-- 修改时间 -->
|
||||
<i class="fa fa-calendar"></i>{{msg . "update"}}
|
||||
<i class="fa fa-clock-o"></i>{{msg . "update"}}
|
||||
<span id="noteReadUpdatedTime"></span>
|
||||
|
||||
<!-- 修改时间 -->
|
||||
<i class="fa fa-calendar"></i>{{msg . "create"}}
|
||||
<i class="fa fa-clock-o"></i>{{msg . "create"}}
|
||||
<span id="noteReadCreatedTime"></span>
|
||||
</div>
|
||||
</div>
|
||||
@ -544,12 +557,12 @@ function log(o) {
|
||||
</a>
|
||||
</div>
|
||||
<div class="editorBg"></div>
|
||||
<div id="leanoteNav">
|
||||
<div id="leanoteNav" class="leanoteNav">
|
||||
<h1>
|
||||
<i class="fa fa-align-justify" title="文档导航"></i>
|
||||
<i class="fa fa-align-justify" title="{{msg . "nav"}}"></i>
|
||||
<span>{{msg . "nav"}}</span>
|
||||
</h1>
|
||||
<div id="leanoteNavContent">
|
||||
<div id="leanoteNavContent" class="leanoteNavContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -570,9 +583,85 @@ function log(o) {
|
||||
</div>
|
||||
|
||||
<div id="mdEditor">
|
||||
|
||||
|
||||
<div class="layout-wrapper-l1">
|
||||
<div class="layout-wrapper-l2">
|
||||
<div class="navbar navbar-default">
|
||||
<div class="navbar-inner" id="wmd-button-bar">
|
||||
<ul class="nav left-buttons">
|
||||
<li class="wmd-button-group1 btn-group"></li>
|
||||
</ul>
|
||||
<ul class="nav left-buttons">
|
||||
<li class="wmd-button-group2 btn-group"></li>
|
||||
</ul>
|
||||
<ul class="nav left-buttons">
|
||||
<li class="wmd-button-group3 btn-group"></li>
|
||||
</ul>
|
||||
<ul class="nav left-buttons">
|
||||
<li class="wmd-button-group5 btn-group"></li>
|
||||
</ul>
|
||||
<!-- 帮助 -->
|
||||
<ul class="nav left-buttons">
|
||||
<li class="wmd-button-group6 btn-group">
|
||||
<li class="wmd-button btn btn-success" id="wmd-help-button" title="Markdown syntax" style="left: 0px; display: none;"><span style="display: none; background-position: 0px 0px;"></span><i class="fa fa-question-circle"></i></li>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!--
|
||||
<ul class="nav pull-right right-buttons">
|
||||
<li class="offline-status hide">
|
||||
<div class="text-danger">
|
||||
<i class="icon-attention-circled"></i>offline
|
||||
</div>
|
||||
</li>
|
||||
<li class="extension-buttons"></li>
|
||||
</ul>
|
||||
<ul class="nav pull-right title-container">
|
||||
<li><div class="working-indicator"></div></li>
|
||||
<li><a class="btn btn-success file-title-navbar" href="#"
|
||||
title="Rename document"> </a></li>
|
||||
<li><div class="input-file-title-container"><input type="text"
|
||||
class="col-sm-4 form-control hide input-file-title"
|
||||
placeholder="Document title" /></div></li>
|
||||
</ul>
|
||||
-->
|
||||
</div>
|
||||
<div class="editorBg"></div>
|
||||
</div>
|
||||
<div class="layout-wrapper-l3">
|
||||
<div id="left-column">
|
||||
<pre id="wmd-input" class="form-control"><div class="editor-content mousetrap" contenteditable=true></div><div class="editor-margin"></div></pre>
|
||||
</div>
|
||||
<div id="right-column">
|
||||
<div class="preview-panel panel-open" id="preview-panel">
|
||||
<div id="mdSplitter2" class="layout-resizer layout-resizer-preview open" style="-webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); touch-action: none;"></div>
|
||||
<div class="layout-toggler layout-toggler-preview btn btn-info open" title="Toggle preview" data-open="1"><i class="fa fa-angle-right"></i></div>
|
||||
<div class="preview-container">
|
||||
<div id="preview-contents">
|
||||
<div id="wmd-preview" class="preview-content"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="extension-preview-buttons">
|
||||
<div id="leanoteNavMd" class="leanoteNav">
|
||||
<h1>
|
||||
<i class="fa fa-align-justify" title="{{msg . "nav"}}"></i>
|
||||
<span>{{msg . "nav"}}</span>
|
||||
</h1>
|
||||
<div id="leanoteNavContentMd" class="leanoteNavContent table-of-contents">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="wmd-button-bar" class="hide"></div>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<div id="wmd-button-bar" id="mdBar"></div>
|
||||
<div class="editorBg"></div>
|
||||
<!-- 为了scroll -->
|
||||
|
||||
<div class="clearfix" id="mdEditorPreview">
|
||||
<div id="left-column">
|
||||
@ -588,11 +677,59 @@ function log(o) {
|
||||
</div>
|
||||
</div>
|
||||
<textarea id="md-section-helper"></textarea>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- mdEditor -->
|
||||
<!-- v2 -->
|
||||
<div class="modal fade modal-insert-link">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">Hyperlink</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Please provide the link URL and an optional title:</p>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="icon-globe"></i></span><input
|
||||
id="input-insert-link" type="text" class="col-sm-5 form-control"
|
||||
placeholder='http://example.com/ "optional title"' />
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a href="#" class="btn btn-default" data-dismiss="modal">Cancel</a>
|
||||
<a href="#" class="btn btn-primary action-insert-link"
|
||||
data-dismiss="modal">OK</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 插入图片 -->
|
||||
<div class="modal fade modal-insert-image">
|
||||
<div class="modal-dialog" style="width: 840px">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">Image</h4>
|
||||
</div>
|
||||
<div class="modal-body" style="padding-top: 0; padding-bottom: 0">
|
||||
<iframe name="mdImageManager" style="width: 100%; height: 350px" scrolling="no" id="leauiIfrForMD" src="" frameborder="0"></iframe>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a href="#" class="btn btn-default"
|
||||
data-dismiss="modal">Cancel</a> <a href="#"
|
||||
class="btn btn-primary action-insert-image" data-dismiss="modal">Insert Image</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- v1 -->
|
||||
<!-- Hidden Popup Modal -->
|
||||
<div class="modal fade bs-modal-sm" id="editorDialog" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-sm">
|
||||
@ -737,17 +874,22 @@ function log(o) {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="js/jquery-1.9.0.min.js"></script>
|
||||
<script src="js/jquery.ztree.all-3.5.js"></script>
|
||||
<script src="js/i18n/msg.{{.locale}}.js"></script>
|
||||
<script src="js/common.js"></script>
|
||||
<script src="/js/jquery-1.9.0.min.js"></script>
|
||||
<script src="/js/jquery.ztree.all-3.5.js"></script>
|
||||
<script src="/js/i18n/msg.{{.locale}}.js"></script>
|
||||
<script src="/js/common.js"></script>
|
||||
<script>
|
||||
var UrlPrefix = "{{.siteUrl}}"; // 为了发weibo
|
||||
var UrlPrefix = '{{.siteUrl}}'; // 为了发weibo
|
||||
var UserInfo = {{.userInfo|jsonJs}};
|
||||
var notebooks = {{.notebooks|jsonJs}};
|
||||
var shareNotebooks = {{.shareNotebooks|jsonJs}};
|
||||
var sharedUserInfos = {{.sharedUserInfos|jsonJs}};
|
||||
var notes = {{.notes|jsonJs}}
|
||||
var curNoteId = '{{.curNoteId}}';
|
||||
var curNotebookId = '{{.curNotebookId}}';
|
||||
var curSharedNoteNotebookId = '{{.curSharedNoteNotebookId}}';
|
||||
var curSharedUserId = '{{.curSharedUserId}}';
|
||||
var notes = {{.notes|jsonJs}};
|
||||
var latestNotes = {{if .latestNotes}}{{.latestNotes|jsonJs}}{{else}}[]{{end}};
|
||||
var noteContentJson = {{.noteContentJson|jsonJs}};
|
||||
var tagsJson = {{.tags|jsonJs}};
|
||||
LEA.locale = "{{.locale}}";
|
||||
@ -755,44 +897,33 @@ var GlobalConfigs = {{.globalConfigs|jsonJs}}; // 2014/11/9 beta2
|
||||
</script>
|
||||
|
||||
<!-- 渲染view -->
|
||||
<script src="tinymce/tinymce.js"></script>
|
||||
<script src="js/app/page.js"></script>
|
||||
<script src="/tinymce/tinymce.js"></script>
|
||||
<script src="/public/libs/ace/ace.js"></script>
|
||||
<script src="/js/app/page.js"></script>
|
||||
<script src="/js/jQuery-slimScroll-1.3.0/jquery.slimscroll.js"></script>
|
||||
<script src="/js/contextmenu/jquery.contextmenu.js"></script>
|
||||
<script src="js/jquery-cookie.js"></script>
|
||||
<script src="js/bootstrap-min.js"></script>
|
||||
<script src="js/app/note.js"></script>
|
||||
<script src="js/app/tag.js"></script>
|
||||
<script src="js/app/notebook.js"></script>
|
||||
<script src="js/app/share.js"></script>
|
||||
<script src="js/object_id-min.js"></script>
|
||||
<script src="js/ZeroClipboard/ZeroClipboard-min.js"></script>
|
||||
<script src="/js/bootstrap-min.js"></script>
|
||||
<script src="/js/app/note.js"></script>
|
||||
<script src="/js/app/tag.js"></script>
|
||||
<script src="/js/app/notebook.js"></script>
|
||||
<script src="/js/app/share.js"></script>
|
||||
<script src="/js/object_id-min.js"></script>
|
||||
<script>
|
||||
Notebook.renderNotebooks(notebooks);
|
||||
Share.renderShareNotebooks(sharedUserInfos, shareNotebooks);
|
||||
|
||||
Note.setNoteCache(noteContentJson);
|
||||
Note.renderNotes(notes);
|
||||
if(!isEmpty(notes)) {
|
||||
Note.changeNote(notes[0].NoteId);
|
||||
}
|
||||
|
||||
// Note.chanteNote设置content
|
||||
// Note.renderNoteContent(noteContentJson)
|
||||
|
||||
Tag.renderTagNav(tagsJson);
|
||||
|
||||
// init notebook后才调用
|
||||
initSlimScroll();
|
||||
initPage();
|
||||
</script>
|
||||
|
||||
|
||||
<!-- context-menu -->
|
||||
<link rel="stylesheet" href="/js/contextmenu/css/contextmenu.css" type="text/css" />
|
||||
<!-- code -->
|
||||
<link href="/public/mdeditor/editor/google-code-prettify/prettify.css" rel="stylesheet" />
|
||||
<!-- js version 2.0 use require.js -->
|
||||
|
||||
<!-- v2 use require.js, mdeditor -->
|
||||
<script>
|
||||
window.baseDir = '/public/dist';
|
||||
window.require = {
|
||||
baseUrl: window.baseDir,
|
||||
deps: ['main']
|
||||
};
|
||||
</script>
|
||||
<script src="/js/require.js"></script>
|
||||
<script src="/js/main.js"></script>
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -12,17 +12,19 @@
|
||||
|
||||
<link href="/css/bootstrap.css" rel="stylesheet" />
|
||||
<!-- 先加载, 没有样式, 宽度不定 -->
|
||||
<link rel="stylesheet" href="tinymce/skins/custom/skin.min.css" rel="stylesheet"/>
|
||||
|
||||
<link rel="stylesheet" href="/tinymce/skins/custom/skin.min.css" rel="stylesheet"/>
|
||||
<!-- leanote css -->
|
||||
<link href="css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet" />
|
||||
<link href="css/zTreeStyle/zTreeStyle.css" rel="stylesheet" />
|
||||
<link href="/css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet" />
|
||||
<link href="/css/zTreeStyle/zTreeStyle.css" rel="stylesheet" />
|
||||
<!-- mdeditor -->
|
||||
<link href="/public/dist/themes/default.css" rel="stylesheet" />
|
||||
|
||||
<script>
|
||||
var hash = location.hash;
|
||||
if(hash == "#writing") {
|
||||
var files = '<link rel="stylesheet" href="css/theme/writting-overwrite.css" type="text/css" id="themeLink" />';
|
||||
if(hash.indexOf("writing") >= 0) {
|
||||
var files = '<link rel="stylesheet" href="/css/theme/writting-overwrite.css" type="text/css" id="themeLink" />';
|
||||
} else {
|
||||
var files ='<link rel="stylesheet" href="css/theme/{{if .userInfo.Theme}}{{.userInfo.Theme}}{{else}}default{{end}}.css" type="text/css" id="themeLink" />';
|
||||
var files ='<link rel="stylesheet" href="/css/theme/{{if .userInfo.Theme}}{{.userInfo.Theme}}{{else}}default{{end}}.css" type="text/css" id="themeLink" />';
|
||||
}
|
||||
document.write(files);
|
||||
</script>
|
||||
@ -169,7 +171,7 @@ function log(o) {
|
||||
{{if .isAdmin}}
|
||||
<li role="presentation" class="divider"></li>
|
||||
<li role="presentation">
|
||||
<a target="_blank" title="{{msg . "amdin"}}" href="/admin/index">
|
||||
<a target="_blank" title="{{msg . "admin"}}" href="/admin/index">
|
||||
<i class="fa fa-dashboard"></i>
|
||||
<span>{{msg . "admin"}}</span>
|
||||
</a>
|
||||
@ -184,6 +186,12 @@ function log(o) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pull-right top-nav writting-hide lea-blog">
|
||||
<a target="_blank" href="http://lea.leanote.com">
|
||||
lea++
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="pull-right top-nav writting-hide" id="myBlog">
|
||||
<a target="_blank" href="{{$.blogUrl}}/{{.userInfo.Username}}">
|
||||
{{msg . "myBlog"}}
|
||||
@ -327,6 +335,11 @@ function log(o) {
|
||||
<div class="noteSplit" id="notebookSplitter"></div>
|
||||
|
||||
<div id="noteAndEditor">
|
||||
<div id="noteAndEditorMask">
|
||||
<img src="/images/loading-24.gif"/>
|
||||
<br />
|
||||
loading...
|
||||
</div>
|
||||
<div id="noteList">
|
||||
<div class="clearfix" id="notesAndSort" style="position: relative">
|
||||
<div class="pull-left">
|
||||
@ -411,11 +424,11 @@ function log(o) {
|
||||
<span id="noteReadTags"></span>
|
||||
|
||||
<!-- 修改时间 -->
|
||||
<i class="fa fa-calendar"></i>{{msg . "update"}}
|
||||
<i class="fa fa-clock-o"></i>{{msg . "update"}}
|
||||
<span id="noteReadUpdatedTime"></span>
|
||||
|
||||
<!-- 修改时间 -->
|
||||
<i class="fa fa-calendar"></i>{{msg . "create"}}
|
||||
<i class="fa fa-clock-o"></i>{{msg . "create"}}
|
||||
<span id="noteReadCreatedTime"></span>
|
||||
</div>
|
||||
</div>
|
||||
@ -544,12 +557,12 @@ function log(o) {
|
||||
</a>
|
||||
</div>
|
||||
<div class="editorBg"></div>
|
||||
<div id="leanoteNav">
|
||||
<div id="leanoteNav" class="leanoteNav">
|
||||
<h1>
|
||||
<i class="fa fa-align-justify" title="文档导航"></i>
|
||||
<i class="fa fa-align-justify" title="{{msg . "nav"}}"></i>
|
||||
<span>{{msg . "nav"}}</span>
|
||||
</h1>
|
||||
<div id="leanoteNavContent">
|
||||
<div id="leanoteNavContent" class="leanoteNavContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -570,9 +583,85 @@ function log(o) {
|
||||
</div>
|
||||
|
||||
<div id="mdEditor">
|
||||
|
||||
|
||||
<div class="layout-wrapper-l1">
|
||||
<div class="layout-wrapper-l2">
|
||||
<div class="navbar navbar-default">
|
||||
<div class="navbar-inner" id="wmd-button-bar">
|
||||
<ul class="nav left-buttons">
|
||||
<li class="wmd-button-group1 btn-group"></li>
|
||||
</ul>
|
||||
<ul class="nav left-buttons">
|
||||
<li class="wmd-button-group2 btn-group"></li>
|
||||
</ul>
|
||||
<ul class="nav left-buttons">
|
||||
<li class="wmd-button-group3 btn-group"></li>
|
||||
</ul>
|
||||
<ul class="nav left-buttons">
|
||||
<li class="wmd-button-group5 btn-group"></li>
|
||||
</ul>
|
||||
<!-- 帮助 -->
|
||||
<ul class="nav left-buttons">
|
||||
<li class="wmd-button-group6 btn-group">
|
||||
<li class="wmd-button btn btn-success" id="wmd-help-button" title="Markdown syntax" style="left: 0px; display: none;"><span style="display: none; background-position: 0px 0px;"></span><i class="fa fa-question-circle"></i></li>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!--
|
||||
<ul class="nav pull-right right-buttons">
|
||||
<li class="offline-status hide">
|
||||
<div class="text-danger">
|
||||
<i class="icon-attention-circled"></i>offline
|
||||
</div>
|
||||
</li>
|
||||
<li class="extension-buttons"></li>
|
||||
</ul>
|
||||
<ul class="nav pull-right title-container">
|
||||
<li><div class="working-indicator"></div></li>
|
||||
<li><a class="btn btn-success file-title-navbar" href="#"
|
||||
title="Rename document"> </a></li>
|
||||
<li><div class="input-file-title-container"><input type="text"
|
||||
class="col-sm-4 form-control hide input-file-title"
|
||||
placeholder="Document title" /></div></li>
|
||||
</ul>
|
||||
-->
|
||||
</div>
|
||||
<div class="editorBg"></div>
|
||||
</div>
|
||||
<div class="layout-wrapper-l3">
|
||||
<div id="left-column">
|
||||
<pre id="wmd-input" class="form-control"><div class="editor-content mousetrap" contenteditable=true></div><div class="editor-margin"></div></pre>
|
||||
</div>
|
||||
<div id="right-column">
|
||||
<div class="preview-panel panel-open" id="preview-panel">
|
||||
<div id="mdSplitter2" class="layout-resizer layout-resizer-preview open" style="-webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); touch-action: none;"></div>
|
||||
<div class="layout-toggler layout-toggler-preview btn btn-info open" title="Toggle preview" data-open="1"><i class="fa fa-angle-right"></i></div>
|
||||
<div class="preview-container">
|
||||
<div id="preview-contents">
|
||||
<div id="wmd-preview" class="preview-content"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="extension-preview-buttons">
|
||||
<div id="leanoteNavMd" class="leanoteNav">
|
||||
<h1>
|
||||
<i class="fa fa-align-justify" title="{{msg . "nav"}}"></i>
|
||||
<span>{{msg . "nav"}}</span>
|
||||
</h1>
|
||||
<div id="leanoteNavContentMd" class="leanoteNavContent table-of-contents">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="wmd-button-bar" class="hide"></div>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<div id="wmd-button-bar" id="mdBar"></div>
|
||||
<div class="editorBg"></div>
|
||||
<!-- 为了scroll -->
|
||||
|
||||
<div class="clearfix" id="mdEditorPreview">
|
||||
<div id="left-column">
|
||||
@ -588,11 +677,59 @@ function log(o) {
|
||||
</div>
|
||||
</div>
|
||||
<textarea id="md-section-helper"></textarea>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- mdEditor -->
|
||||
<!-- v2 -->
|
||||
<div class="modal fade modal-insert-link">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">Hyperlink</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Please provide the link URL and an optional title:</p>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="icon-globe"></i></span><input
|
||||
id="input-insert-link" type="text" class="col-sm-5 form-control"
|
||||
placeholder='http://example.com/ "optional title"' />
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a href="#" class="btn btn-default" data-dismiss="modal">Cancel</a>
|
||||
<a href="#" class="btn btn-primary action-insert-link"
|
||||
data-dismiss="modal">OK</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 插入图片 -->
|
||||
<div class="modal fade modal-insert-image">
|
||||
<div class="modal-dialog" style="width: 840px">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">Image</h4>
|
||||
</div>
|
||||
<div class="modal-body" style="padding-top: 0; padding-bottom: 0">
|
||||
<iframe name="mdImageManager" style="width: 100%; height: 350px" scrolling="no" id="leauiIfrForMD" src="" frameborder="0"></iframe>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a href="#" class="btn btn-default"
|
||||
data-dismiss="modal">Cancel</a> <a href="#"
|
||||
class="btn btn-primary action-insert-image" data-dismiss="modal">Insert Image</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- v1 -->
|
||||
<!-- Hidden Popup Modal -->
|
||||
<div class="modal fade bs-modal-sm" id="editorDialog" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-sm">
|
||||
@ -737,17 +874,22 @@ function log(o) {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="js/jquery-1.9.0.min.js"></script>
|
||||
<script src="js/jquery.ztree.all-3.5.js"></script>
|
||||
<script src="js/i18n/msg.{{.locale}}.js"></script>
|
||||
<script src="js/common-min.js"></script>
|
||||
<script src="/js/jquery-1.9.0.min.js"></script>
|
||||
<script src="/js/jquery.ztree.all-3.5-min.js"></script>
|
||||
<script src="/js/i18n/msg.{{.locale}}.js"></script>
|
||||
<script src="/js/common-min.js"></script>
|
||||
<script>
|
||||
var UrlPrefix = "{{.siteUrl}}"; // 为了发weibo
|
||||
var UrlPrefix = '{{.siteUrl}}'; // 为了发weibo
|
||||
var UserInfo = {{.userInfo|jsonJs}};
|
||||
var notebooks = {{.notebooks|jsonJs}};
|
||||
var shareNotebooks = {{.shareNotebooks|jsonJs}};
|
||||
var sharedUserInfos = {{.sharedUserInfos|jsonJs}};
|
||||
var notes = {{.notes|jsonJs}}
|
||||
var curNoteId = '{{.curNoteId}}';
|
||||
var curNotebookId = '{{.curNotebookId}}';
|
||||
var curSharedNoteNotebookId = '{{.curSharedNoteNotebookId}}';
|
||||
var curSharedUserId = '{{.curSharedUserId}}';
|
||||
var notes = {{.notes|jsonJs}};
|
||||
var latestNotes = {{if .latestNotes}}{{.latestNotes|jsonJs}}{{else}}[]{{end}};
|
||||
var noteContentJson = {{.noteContentJson|jsonJs}};
|
||||
var tagsJson = {{.tags|jsonJs}};
|
||||
LEA.locale = "{{.locale}}";
|
||||
@ -755,44 +897,33 @@ var GlobalConfigs = {{.globalConfigs|jsonJs}}; // 2014/11/9 beta2
|
||||
</script>
|
||||
|
||||
<!-- 渲染view -->
|
||||
<script src="tinymce/tinymce.js"></script>
|
||||
<script src="js/app/page-min.js"></script>
|
||||
<script src="/js/jQuery-slimScroll-1.3.0/jquery.slimscroll.js"></script>
|
||||
<script src="/tinymce/tinymce.min.js"></script>
|
||||
<script src="/public/libs/ace/ace.js"></script>
|
||||
<script src="/js/app/page-min.js"></script>
|
||||
<script src="/js/jQuery-slimScroll-1.3.0/jquery.slimscroll-min.js"></script>
|
||||
<script src="/js/contextmenu/jquery.contextmenu-min.js"></script>
|
||||
<script src="js/jquery-cookie.js"></script>
|
||||
<script src="js/bootstrap-min.js"></script>
|
||||
<script src="js/app/note-min.js"></script>
|
||||
<script src="js/app/tag-min.js"></script>
|
||||
<script src="js/app/notebook-min.js"></script>
|
||||
<script src="js/app/share-min.js"></script>
|
||||
<script src="js/object_id-min.js"></script>
|
||||
<script src="js/ZeroClipboard/ZeroClipboard-min.js"></script>
|
||||
<script src="/js/bootstrap-min.js"></script>
|
||||
<script src="/js/app/note-min.js"></script>
|
||||
<script src="/js/app/tag-min.js"></script>
|
||||
<script src="/js/app/notebook-min.js"></script>
|
||||
<script src="/js/app/share-min.js"></script>
|
||||
<script src="/js/object_id-min.js"></script>
|
||||
<script>
|
||||
Notebook.renderNotebooks(notebooks);
|
||||
Share.renderShareNotebooks(sharedUserInfos, shareNotebooks);
|
||||
|
||||
Note.setNoteCache(noteContentJson);
|
||||
Note.renderNotes(notes);
|
||||
if(!isEmpty(notes)) {
|
||||
Note.changeNote(notes[0].NoteId);
|
||||
}
|
||||
|
||||
// Note.chanteNote设置content
|
||||
// Note.renderNoteContent(noteContentJson)
|
||||
|
||||
Tag.renderTagNav(tagsJson);
|
||||
|
||||
// init notebook后才调用
|
||||
initSlimScroll();
|
||||
initPage();
|
||||
</script>
|
||||
|
||||
|
||||
<!-- context-menu -->
|
||||
<link rel="stylesheet" href="/js/contextmenu/css/contextmenu.css" type="text/css" />
|
||||
<!-- code -->
|
||||
<link href="/public/mdeditor/editor/google-code-prettify/prettify.css" rel="stylesheet" />
|
||||
<!-- js version 2.0 use require.js -->
|
||||
|
||||
<!-- v2 use require.js, mdeditor -->
|
||||
<script>
|
||||
window.baseDir = '/public/dist';
|
||||
window.require = {
|
||||
baseUrl: window.baseDir,
|
||||
deps: ['main']
|
||||
};
|
||||
</script>
|
||||
<script src="/js/require.js"></script>
|
||||
<script src="/js/main-min.js"></script>
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user