我正在學習咖啡腳本......我有一些默認爲JS彈出框的代碼 - 但我也想定製一些與mailto和其他內容的鏈接,並默認JS只有在沒有主方向IF/THEN咖啡腳本鏈接
例如...如果用戶點擊請求管理員權限,我想一個mailto以不彈出,上面寫着JS「這個功能尚未公佈」
onPhotosLoaded = (sampledata) ->
if !sampledata || sampledata?.success == false
jvmw.empty().append('Gallery not found')
return
# once the photos are loaded
jvu.waitCss $("#jv_mw"), 'jv-colorbox-css-loaded', ->
$.colorbox.init()
jvmw.empty()
afterPhotosAndTags() # don't load tags before getting here.
email = "#{gal_code}@phto.us"
addMorePhotosInfoDiv = $ """<div/>"""
addMorePhotosButton = $ """<div style="float:left;font-size:32px"><br>Everyone's photos from "<span class="jvreplacewitheventname">this event</span>" <a class="jvaddmorephotosbutton" href="#">+Add yours!</a> <br/> </div>"""
addMorePhotosInfoDiv.append addMorePhotosButton
dragDropDiv = $ '<div class="jvdragzoneparent" />'
addMorePhotosInfoDiv.append(dragDropDiv).append('<div style="clear:both;" />')
extraTestButtons = $ '<div id="jvextratestbut" />'
extraTestButtons.append('<a href="mailto:[email protected]">Request Admin Privileges</a> | | <a href="#">Turn SMART BROWSE (ON)</a> | ' +
' | <a href="#">Purchase prints and other merchandise</a>|| <a href="http://www.albumpl.us/gallery/#{gal_code}/live">Live View</a>')
extraTestButtons.find('a').click ->
if $(this).text() == 'Request Admin Privileges'
# <a href="mailto:[email protected]">Request Admin Privileges</a>
return false
# default thing to do is show the dialog - and register the event.
showNotYetAvailableMessage($(this).text())
return false
extraTestButtons.find('a').click ->
if $(this).text() == 'Live View'
# <a href="http://www.albumpl.us/gallery/#{gal_code}
return false
# default thing to do is show the dialog - and register the event.
showNotYetAvailableMessage($(this).text())
return false