Change note action "share" to "publish" to avoid misleading
This commit is contained in:
		
							parent
							
								
									85c67212ad
								
							
						
					
					
						commit
						04eef71b11
					
				
							
								
								
									
										8
									
								
								app.js
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								app.js
									
									
									
									
									
								
							| @ -352,10 +352,10 @@ app.post('/uploadimage', function (req, res) { | |||||||
| app.get("/new", response.newNote); | app.get("/new", response.newNote); | ||||||
| //get features
 | //get features
 | ||||||
| app.get("/features", response.showFeatures); | app.get("/features", response.showFeatures); | ||||||
| //get share note
 | //get publish note
 | ||||||
| app.get("/s/:shortid", response.showShareNote); | app.get("/s/:shortid", response.showPublishNote); | ||||||
| //share note actions
 | //publish note actions
 | ||||||
| app.get("/s/:shortid/:action", response.shareNoteActions); | app.get("/s/:shortid/:action", response.publishNoteActions); | ||||||
| //get note by id
 | //get note by id
 | ||||||
| app.get("/:noteId", response.showNote); | app.get("/:noteId", response.showNote); | ||||||
| //note actions
 | //note actions
 | ||||||
|  | |||||||
| @ -33,9 +33,9 @@ var response = { | |||||||
|     newNote: newNote, |     newNote: newNote, | ||||||
|     showFeatures: showFeatures, |     showFeatures: showFeatures, | ||||||
|     showNote: showNote, |     showNote: showNote, | ||||||
|     showShareNote: showShareNote, |     showPublishNote: showPublishNote, | ||||||
|     noteActions: noteActions, |     noteActions: noteActions, | ||||||
|     shareNoteActions: shareNoteActions |     publishNoteActions: publishNoteActions | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| function responseError(res, code, detail, msg) { | function responseError(res, code, detail, msg) { | ||||||
| @ -139,7 +139,7 @@ function showNote(req, res, next) { | |||||||
|     responseHackMD(res, noteId); |     responseHackMD(res, noteId); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function showShareNote(req, res, next) { | function showPublishNote(req, res, next) { | ||||||
|     var shortid = req.params.shortid; |     var shortid = req.params.shortid; | ||||||
|     if (shortId.isValid(shortid)) { |     if (shortId.isValid(shortid)) { | ||||||
|         Note.findNote(shortid, function (err, note) { |         Note.findNote(shortid, function (err, note) { | ||||||
| @ -194,7 +194,7 @@ function showShareNote(req, res, next) { | |||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function actionShare(req, res, noteId) { | function actionPublish(req, res, noteId) { | ||||||
|     db.readFromDB(noteId, function (err, data) { |     db.readFromDB(noteId, function (err, data) { | ||||||
|         if (err) { |         if (err) { | ||||||
|             responseError(res, "404", "Not Found", "oops."); |             responseError(res, "404", "Not Found", "oops."); | ||||||
| @ -307,9 +307,9 @@ function noteActions(req, res, next) { | |||||||
|     } |     } | ||||||
|     var action = req.params.action; |     var action = req.params.action; | ||||||
|     switch (action) { |     switch (action) { | ||||||
|     case "share": |     case "publish": | ||||||
|     case "pretty": //pretty deprecated
 |     case "pretty": //pretty deprecated
 | ||||||
|         actionShare(req, res, noteId); |         actionPublish(req, res, noteId); | ||||||
|         break; |         break; | ||||||
|     case "download": |     case "download": | ||||||
|         actionDownload(req, res, noteId); |         actionDownload(req, res, noteId); | ||||||
| @ -326,7 +326,7 @@ function noteActions(req, res, next) { | |||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function shareNoteActions(req, res, next) { | function publishNoteActions(req, res, next) { | ||||||
|     var action = req.params.action; |     var action = req.params.action; | ||||||
|     switch (action) { |     switch (action) { | ||||||
|     case "edit": |     case "edit": | ||||||
|  | |||||||
| @ -234,7 +234,7 @@ var ui = { | |||||||
|         shortStatus: $(".ui-short-status"), |         shortStatus: $(".ui-short-status"), | ||||||
|         status: $(".ui-status"), |         status: $(".ui-status"), | ||||||
|         new: $(".ui-new"), |         new: $(".ui-new"), | ||||||
|         share: $(".ui-share"), |         publish: $(".ui-publish"), | ||||||
|         download: { |         download: { | ||||||
|             markdown: $(".ui-download-markdown") |             markdown: $(".ui-download-markdown") | ||||||
|         }, |         }, | ||||||
| @ -618,7 +618,7 @@ function changeMode(type) { | |||||||
| //button actions
 | //button actions
 | ||||||
| var url = window.location.pathname; | var url = window.location.pathname; | ||||||
| //share
 | //share
 | ||||||
| ui.toolbar.share.attr("href", url + "/share"); | ui.toolbar.publish.attr("href", url + "/publish"); | ||||||
| //download
 | //download
 | ||||||
| //markdown
 | //markdown
 | ||||||
| ui.toolbar.download.markdown.click(function () { | ui.toolbar.download.markdown.click(function () { | ||||||
|  | |||||||
| @ -24,7 +24,7 @@ | |||||||
|             <ul class="dropdown-menu" role="menu" aria-labelledby="menu"> |             <ul class="dropdown-menu" role="menu" aria-labelledby="menu"> | ||||||
|                 <li role="presentation"><a role="menuitem" class="ui-new" tabindex="-1" href="./new" target="_blank"><i class="fa fa-plus fa-fw"></i> New</a> |                 <li role="presentation"><a role="menuitem" class="ui-new" tabindex="-1" href="./new" target="_blank"><i class="fa fa-plus fa-fw"></i> New</a> | ||||||
|                 </li> |                 </li> | ||||||
|                 <li role="presentation"><a role="menuitem" class="ui-share" tabindex="-1" href="#" target="_blank"><i class="fa fa-share-alt fa-fw"></i> Share</a> |                 <li role="presentation"><a role="menuitem" class="ui-publish" tabindex="-1" href="#" target="_blank"><i class="fa fa-print fa-fw"></i> Publish</a> | ||||||
|                 </li> |                 </li> | ||||||
|                 <li class="divider"></li> |                 <li class="divider"></li> | ||||||
|                 <li class="dropdown-header">Save</li> |                 <li class="dropdown-header">Save</li> | ||||||
| @ -85,8 +85,8 @@ | |||||||
|                 </a> |                 </a> | ||||||
|             </li> |             </li> | ||||||
|             <li> |             <li> | ||||||
|                 <a href="#" target="_blank" class="ui-share"> |                 <a href="#" target="_blank" class="ui-publish"> | ||||||
|                     <i class="fa fa-share-alt"></i> Share |                     <i class="fa fa-print"></i> Publish | ||||||
|                 </a> |                 </a> | ||||||
|             </li> |             </li> | ||||||
|             <li> |             <li> | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user