Bookmarklets & HTTP-Get-Bookmarks

Bookmarklets

Miscellaneous

URL-Decode

Version: 1.0

Bookmarklet to decode the currently open URL or any other string copied in a prompt pop-up (e.g. %2C becomes ,).

javascript:void(prompt('Decoded:',decodeURIComponent(prompt('String to decode:',location.href))))

Drag this to your bookmark bar: Decode

URL-Encode

Version: 1.0

Bookmarklet to encode the currently open URL or any other string copied in a prompt pop-up (e.g. , becomes %2C).

javascript:void(prompt('Encoded:',encodeURIComponent(prompt('String to encode:',location.href))))

Drag this to your bookmark bar: Encode

E-mail Site

Version: 1.0

Send a link of the currently opened site to your e-mail address to read it on another device.

Redmine

Creation of Tickets

Copy as Subticket

Version: 1.0

Bookmarklet to copy the currently displayed ticket and set the parent issue to the ticket used as a starting point plus add a user (via User-ID) as a watcher.

Reset Copied Ticket as New

Version: 1.0

Bookmarklet to reset the fields status, progress (done ratio) and start date (to today) as well as uncheck the box "Copy Subtasks"

javascript:document.getElementById('issue_done_ratio').selectedIndex=0;document.getElementById('issue_status_id').value=1;d=new Date();document.getElementById('issue_start_date').value=d.toISOString().substring(0,10);document.getElementById('copy_subtasks').checked=false;

Drag this to your bookmark bar: Reset Ticket

Copy To Other Redmine-Instance new

Version: 1.0 (promoted v0.1-alpha to v1.0, no functional changes)

Bookmarklet to copy the currently displayed ticket's subject and description into another Redmine Instance ("target instance") and add a user (via User-ID of target instance) as a watcher.

Hint: Enter Redmine-URL and Project Shortname of target instance to generate the bookmarklet

Manipulations in Form Fields

Quotation updated

Version: 1.2 (now translates also Unicode o-Bullet-Character "o" to **, plus fixes a minor bug)

Bookmarklet to quote (>) selected text and replace Lotus Notes Style attachment-deleted-by-annotations (e.g. "[Attachment "file.pdf" deleted by John Doe/DO/MA/IN]" in German or English) with list-marks (*) and attachment-link (attachment:). Furthermore, hyphen (-) and other bullet-marks are replaced by stars (*) to format as unordered lists in Textile markup-language.

javascript:acEl=document.activeElement;if((sStart=acEl.selectionStart) != (sEnd=acEl.selectionEnd)){acEl.value=acEl.value.substring(0,sStart)+'>'+acEl.value.substring(sStart, sEnd).replace(/(^|\n)(-|\u00B7|\u2022)\s*/g, '\n* ').replace(/(^|\n)(\u006F)\s*/g, '\n** ').replace(/ (gelöscht von|deleted by) [üöäÜÖÄéèàÉÈÀ\w &'\-\.]+\/[\w &'\-\.]+\/[\w &'\-\.]+\/[\w &'\-\.]+\]/g, '').replace(/\n?\[(Anhang|Attachment) /g, '\n* attachment:').replace(/\n/g, '\n>')+acEl.value.substring(sEnd,acEl.value.length)}

Drag this to your bookmark bar: Quote

Add Standard Text

Version: 1.0

Bookmarklet to add a custom sub header or standard text before the selection/cursor position

Show Image

Version: 1.0

Bookmarklet to enclose an image file name with textile script (exclamation marks and styling attributes). Using this bookmarklet, attachments display as images with a border, rounded corners and a margin to separate the image from surrounding text

javascript:acEl=document.activeElement;if((sStart=acEl.selectionStart) != (sEnd=acEl.selectionEnd)){acEl.value=acEl.value.substring(0,sStart)+'!{margin:10px;border:1px solid grey}(ui-corner-all)'+acEl.value.substring(sStart, sEnd)+'!'+acEl.value.substring(sEnd,acEl.value.length)}

Drag this to your bookmark bar: Add Image

Format Table - beautify Textile-Table

Version: 1.0

Bookmarklet to format a textile-table (syntax with |-separators) shading added to alternate rows and without borders

Sample input:

| Table header 1	| Table header 2 |
| Row 1 Column 1	| Row 1 Column 2 |
| Row 2 Column 1	| Row 2 Column 2 |

Code:

javascript:if(bgColTh='#578BB8',bgColTdEven='#EEE',bgColTdOdd='#E5E5E5',noOfCols=1,acEl=document.activeElement,(sStart=acEl.selectionStart)!=(sEnd=acEl.selectionEnd)){for(rows=acEl.value.substring(sStart+1,sEnd).split('\n|'),i=0;inoOfCols?cols.length:noOfCols,rows[i]='',j=0;j^~\\\/0-9]*)_?\.? ?((.|\n)*)/,'|_$1{border:none;background:'+bgColTh+';color:#EEE}. $2'):!i||i%2?rows[i]+=cols[j].replace(/^([_=<>^~\\\/0-9]*)\.? ?((.|\n)*)/,'|$1{border:none;background:'+bgColTdOdd+'}. $2'):rows[i]+=cols[j].replace(/^([_=<>^~\\\/0-9]*)\.? ?((.|\n)*)/,'|$1{border:none;background:'+bgColTdEven+'}. $2');rows[i]+='|'}acEl.value=acEl.value.substring(0,sStart)+'table{margin:10px;background-color:#D4E1ED;border:none}.\n'+rows.join('\n')+'\n|\\'+noOfCols+'>{border:none;background:#ddd;color:#fafafa;padding:0px 1px;margin:1px;}. _generated with a_ "{text-decoration:underline;color:#fafafa;font-weight:normal;font-style:italic;background:none;padding-left:0px;}Bookmarklet":http://www.molinarius.ch/BookmarksAndMarklets.html|'+acEl.value.substring(sEnd,acEl.value.length)}

Drag this to your bookmarks bar: Format Table

Transform to Table - Transform Tabs to Textile new

Version: 0.1-alpha

Bookmarklet to format a table with shading added to alternate rows and without borders. As input use a tab-separated (for cols) and newline-separated (for rows) Text

Sample input:

Table header 1	Table header 2
Row 1 Column 1	Row 1 Column 2
Row 2 Column 1	Row 2 Column 2

Code:

javascript:if(bgColTh='#578BB8',bgColTdEven='#EEE',bgColTdOdd='#E5E5E5',noOfCols=1,acEl=document.activeElement,(sStart=acEl.selectionStart)!=(sEnd=acEl.selectionEnd)){for(rows=acEl.value.substring(sStart,sEnd).split('\n'),i=0;i<rows.length;i++){for(rows[i]=rows[i],cols=rows[i].split('\t'),noOfCols=cols.length>noOfCols?cols.length:noOfCols,rows[i]='',j=0;j<cols.length;j++)0===i?rows[i]+=cols[j].replace(/^_?([_=<>^~\\\/0-9]*)_?\.? ?((.|\n)*)/,'|_$1{border:none;background:'+bgColTh+';color:#EEE}. $2'):!i||i%2?rows[i]+=cols[j].replace(/^([_=<>^~\\\/0-9]*)\.? ?((.|\n)*)/,'|$1{border:none;background:'+bgColTdOdd+'}. $2'):rows[i]+=cols[j].replace(/^([_=<>^~\\\/0-9]*)\.? ?((.|\n)*)/,'|$1{border:none;background:'+bgColTdEven+'}. $2');rows[i]+='|'}acEl.value=acEl.value.substring(0,sStart)+'table{margin:10px;background-color:AliceBlue;border:none}.\n'+rows.join('\n')+'\n|\\'+noOfCols+'>{border:none;background:#ddd;color:#fafafa;padding:0px 1px;margin:1px;}. _generated with a_ %22{text-decoration:underline;color:#fafafa;font-weight:normal;font-style:italic;background:none;padding-left:0px;}Bookmarklet%22:http://www.molinarius.ch/BookmarksAndMarklets.html|'+acEl.value.substring(sEnd,acEl.value.length)}

Drag this to your bookmarks bar: Transform to Table

Clear Table Format

Version: 1.0

Bookmarklet to clear all CSS style formats (in {}) a table contains.

javascript:acEl=document.activeElement,(sStart=acEl.selectionStart)!=(sEnd=acEl.selectionEnd)&&(acEl.value=acEl.value.substring(0,sStart)+acEl.value.substring(sStart,sEnd).replace(/(table{[\w :;,-\.#]+?}\.\n)?(\|[_=<>^~\\\/0-9]*?){[\w :;,-\.#]+?}(\.)/g,'$2$3').replace(/\|\./g,'|')+acEl.value.substring(sEnd,acEl.value.length));

Drag this to your bookmarks bar: Clear Table Format

Workflow-Actions

BeginWork

Version: 1.0

Bookmarklet to assign a ticket to a user and start work

EndWork

Version: 1.0

Bookmarklet to enter a comment and terminate work (Status "Done")

Select Assignee

Version: 1.0

Bookmarklet to display a dropdown-box to select a person for assigning a ticket.

javascript:selectbox=document.createElement("div");selectbox.className="contextual";formselect=document.getElementById("issue_assigned_to_id");assigndropdown=selectbox.appendChild(formselect.cloneNode(true));assigndropdown.id="assigndropdown";assigndropdown.addEventListener("change", function(){formselect.selectedIndex=this.selectedIndex;document.getElementById("issue-form").submit();});document.getElementById("content").getElementsByTagName("div")[0].appendChild(selectbox);

Drag this to your bookmark bar: Assign To

Send E-Mail with Ticket Infosupdated

Version: 1.2 - now works with ticket-read permissions too.

Bookmarklet to send an e-mail of the currently opened ticket.

javascript:description=$('.description .wiki').clone();description.find('br').replaceWith('\n');location.href='mailto:re@cei.ver?SUBJECT=%5B'+encodeURIComponent(location.href.split('/').pop()+'] '+$('.subject h3').text().trim().substring(0,100)+($('.subject h3').text().trim().length>100 ? '...' : '' ))+'&BODY='+encodeURIComponent(location.href+'\n\n\n\n'+description.text().trim().substring(0,200)+(description.text().trim().length>200 ? '...' : '' ))

Drag this to your bookmark bar: Send E-mail

Appearance

Load Ticket from Clipboard/Text Input

Version: 1.0

Bookmarklet to Load a specific Ticket directly from the Clipboard (just copy the ticket ID) or enter a value via pop-up-dialog

Hide Sidebar

Version: 1.0

Bookmarklet to hide the sidebar on the right and expand the content-area.

javascript:(function(e,a,g,h,f,c,b,d){if(!(f=e.jQuery)||g>f.fn.jquery||h(f)){c=a.createElement('script');c.type='text/javascript';c.src='http://ajax.googleapis.com/ajax/libs/jquery/'+g+'/jquery.min.js';c.onload=c.onreadystatechange=function(){if(!b&&(!(d=this.readyState)||d=='loaded'||d=='complete')){h((f=e.jQuery).noConflict(1),b=1);f(c).remove()}};a.documentElement.childNodes[0].appendChild(c)}})(window,document,'1.3.2',function($,L){$('#sidebar').hide(1000);$( '#content' ).animate({ width: '98%' }, 1000, function() {});});

Drag this to your bookmark bar: Hide Sidebar

Comments Only

Version: 1.0

Bookmarklet to hide all history entries that are not comments (e.g. status changes without comment)

javascript:(function(e,a,g,h,f,c,b,d){if(!(f=e.jQuery)||g>f.fn.jquery||h(f)){c=a.createElement('script');c.type='text/javascript';c.src='http://ajax.googleapis.com/ajax/libs/jquery/'+g+'/jquery.min.js';c.onload=c.onreadystatechange=function(){if(!b&&(!(d=this.readyState)||d=='loaded'||d=='complete')){h((f=e.jQuery).noConflict(1),b=1);f(c).remove()}};a.documentElement.childNodes[0].appendChild(c)}})(window,document,'1.3.2',function($,L){$('.journal').not('.has-notes').hide (1000);$('ul.details').toggle(1000)});

Drag this to your bookmark bar: Show Comments Only

Mobile Interface

Version: 1.0

Bookmarklet to hide some elements and make other elements more mobile compatible

javascript:$('#top-menu').hide();$('#quick-search').hide();$('#footer').hide();$('#main-menu').css({'width':'100px','z-index':'20'});$('#main-menu > ul').wrap('<ul><li></li></ul>');$('#main-menu > ul > li').prepend('<a>Menü</a>');$('#main-menu > ul').menu();$('#header').css({'width':'90%','max-width':'1075px','margin':'auto','font-size':'80%'});$('#main').css({'width':'90%','max-width':'1075px','margin':'auto','font-size':'105%'});$('#sidebar').css({'width':'325px','float':'left','padding':'5px'});$('#sidebar').accordion({heightStyle:'content',collapsible:true,active:false});$('#content').css({'width':'650px','float':'left','padding':'5px'});$('.priority-5').css({'border-color':'red'});$('.status-5').css({'background-color':'#dddddd'});$('.status-4').css({'background-color':'#eedddd'});$('.status-2').css({'background-color':'#ddeedd'});$('.status-7').css({'background-color':'#aaaaaa'});$('table.list.issues td:nth-child(2n+3),table.list.issues th:nth-child(2n+3)').hide();$('div.tracker-6 > table.attributes tr:nth-child(2n+5)').toggle();

Drag this to your bookmarks bar: Mobile Ifc

Display Permalinks

Version: 1.0

Bookmarklet to display the permanent links the currently opened ticket, its subtasks and related tickets for cross-referencing in e-mails and other documents.

javascript:ids=document.getElementsByName('ids[]');linkcode = '<p style="font: 10pt helvetica, sans-serif;margin:0px;padding:0px;">A-Ticket: <a href="'+location.href+'">#'+location.href.split('/').pop()+'</a></p>\n';for (i = 0; i < ids.length; i++) {   linkcode+='<p style="font: 10pt helvetica, sans-serif;margin:0px;padding:0px;">I-Ticket: <a href="'+location.href.substring(0,location.href.lastIndexOf('/')+1)+ids[i].value+'">#'+ids[i].value+'</a></p>\n'};document.getElementById('content').insertAdjacentHTML( 'afterbegin', linkcode )

Drag this to your bookmark bar: Link

Longer Version (Only opened Ticket)

javascript:linkcode = '<p style="font: 10pt helvetica, sans-serif;margin:0px;padding:0px;"><a href="'+location.href+'">#'+location.href.split('/').pop()+'</a>: "'+document.getElementById('issue_subject').value+'"</p>\n';document.getElementById('content').insertAdjacentHTML( 'afterbegin', linkcode )

Drag this to your bookmark bar: Extended Link

Redmine Bookmark

New Ticket with Template

Version: 1.0

Bookmark to add a new Ticket in a specific project, add a custom status description (custom field), add a user as watcher, assign to the same user, preset subject and add a description template

All form fields are required.