Skip to content

Commit

Permalink
Remove defunct marginal notes code
Browse files Browse the repository at this point in the history
  • Loading branch information
jvendetti committed Jan 24, 2023
1 parent 287788e commit 7149982
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 376 deletions.
75 changes: 0 additions & 75 deletions app/assets/javascripts/bioportal.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -143,40 +143,6 @@ function toggleHide(id,name_to_hide){

}


//helper function for demo only
function newProposal(string){
document.getElementById('subject').value="Proposal For Change";
document.getElementById('comment').value=string;

selectBox = document.getElementById('margin_note_note_type');
for(var x =0; x<selectBox.options.length;x++){
option = selectBox.options[x]
if(option.value!=5){
option.disabled=true;
}
if(option.value==5){
option.selected=true;
}
}
}

function newNote(){
toggleHide("commentForm","forms")
}




function compare(note_id){
oldValue = document.getElementById("oldValue").innerHTML;
element = document.getElementById("note_value"+note_id)
target = document.getElementById("note_text"+note_id)
var d = dmp.diff_main(oldValue, element.value);
dmp.diff_cleanupSemantic(d);
target.innerHTML=dmp.diff_prettyHtml(d)
}

function hide(id){
document.getElementById(id).style.display="none";
}
Expand Down Expand Up @@ -302,47 +268,6 @@ var tabs=null;

}

function resetNoteForm(uniq){
document.getElementById("note_subject"+uniq).value=""
document.getElementById("note_comment"+uniq).value=""
document.getElementById('noteParent'+uniq).value="";
}


var myEditor;



function buildEditor(uniq){



var Dom = YAHOO.util.Dom,
Event = YAHOO.util.Event;

myEditor = new YAHOO.widget.SimpleEditor('note_comment'+uniq, {
height: '300px',
width: '522px',
dompath: false //Turns on the bar at the bottom
});
myEditor.render();
}

function saveNote(){
myEditor.saveHTML();
myEditor.destroy();

}

function destroyEditor(){
myEditor.clearEditorDoc();
myEditor.destroy();

}




function updateOntologyList(ontology){
list = document.getElementById("ontologieslist")
if(ontology.checked){
Expand Down
76 changes: 0 additions & 76 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ def isOwner?(id)
end
end

def encode_param(string)
return URI.escape(string, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))
end

def escape(string)
CGI.escape(string)
end

def clean(string)
string = string.gsub("\"",'\'')
return string.gsub("\n",'')
Expand All @@ -45,10 +37,6 @@ def clean_id(string)
return new_string
end

def to_param(string)
"#{encode_param(string.gsub(" ","_"))}"
end

def get_username(user_id)
user = LinkedData::Client::Models::User.find(user_id)
username = user.nil? ? user_id : user.username
Expand All @@ -75,70 +63,6 @@ def remove_owl_notation(string)
end
end

def draw_note_tree(notes,key)
output = ""
draw_note_tree_leaves(notes,0,output,key)
return output
end

def draw_note_tree_leaves(notes,level,output,key)
for note in notes
name="Anonymous"
unless note.user.nil?
name=note.user.username
end
headertext=""
notetext=""
if note.note_type.eql?(5)
headertext<< "<div class=\"header\" onclick=\"toggleHide('note_body#{note.id}','');compare('#{note.id}')\">"
notetext << " <input type=\"hidden\" id=\"note_value#{note.id}\" value=\"#{note.comment}\">
<span class=\"message\" id=\"note_text#{note.id}\">#{note.comment}</span>"
else
headertext<< "<div onclick=\"toggleHide('note_body#{note.id}','')\">"

notetext<< "<span class=\"message\" id=\"note_text#{note.id}\">#{simple_format(note.comment)}</span>"
end


output << "
<div style=\"clear:both;margin-left:#{level*20}px;\">
<div style=\"float:left;width:100%\">
#{headertext}
<div>
<span class=\"sender\" style=\"float:right\">#{name} at #{note.created_at.strftime('%m/%d/%y %H:%M')}</span>
<div class=\"header\"><span class=\"notetype\">#{note.type_label.titleize}:</span> #{note.subject}</div>
<div style=\"clear:both\"></div>
</div>
</div>
<div name=\"hiddenNote\" id=\"note_body#{note.id}\" >
<div class=\"messages\">
<div>
<div>
#{notetext}"
if session[:user].nil?
output << "<div id=\"insert\"><a href=\"\/login?redirect=/visualize/#{@ontology.to_param}/?conceptid=#{@concept.id}#notes\">Reply</a></div>"
else
if @modal
output << "<div id=\"insert\"><a href=\"#\" onclick =\"document.getElementById('m_noteParent').value='#{note.id}';document.getElementById('m_note_subject#{key}').value='RE:#{note.subject}';jQuery('#modal_form').html(jQuery('#modal_comment').html());return false;\">Reply</a></div>"
else
output << "<div id=\"insert\"><a href=\"#TB_inline?height=400&width=600&inlineId=commentForm\" class=\"thickbox\" onclick =\"document.getElementById('noteParent').value='#{note.id}';document.getElementById('note_subject#{key}').value='RE:#{note.subject}';\">Reply</a></div>"
end
end
output << "</div>
</div>
</div>
</div>
</div>
</div>"
if(!note.children.nil? && note.children.size>0)
draw_note_tree_leaves(note.children,level+1,output,key)
end
end
end

def draw_tree(root, id = nil, type = "Menu")
if id.nil?
id = root.children.first.id
Expand Down
94 changes: 0 additions & 94 deletions app/views/margin_notes/_proposal.html.erb

This file was deleted.

Loading

0 comments on commit 7149982

Please sign in to comment.