Recent Posts

@srhyse said:

{{on noautolink}}

How did I miss this gem 3yrs ago? Probably it wasn't relevant to me back then but it has become a pain recently
Definitely going to try adding this to my default header to see if I can avoid adding random slashes everywhere

Thanks!
Mark

posted in Trunk Notes Help read more

Hi @cprichard

It's a while since you asked this so I imagine you already either found the answer or stopped using the app?

Head on over to https://appsonthemove.freshdesk.com/support/home for support from the developer

Also there are a couple of interesting trunknotes articles buried in his blog http://appsonthemove.com/blog/

I don't think a replacement forum was ever created which is a shame
Think it boiled down to not enough revenue generated from the app

Mark

posted in Trunk Notes Help read more

This one was already posted in the old forum, however those pages are currently lost to us (hopefully not for too much longer) but I'm quite proud of this one so here it is again.

Background:

I wanted something more visually appealing than just a list of links to represent the different sections of my notes. On my iPad I have lots of apps and there I group them into folders, that works well for me so I started to wonder if I could do something similar for groups of notes.

Code:

LogoView.lua

pageList=args[1]
headerCategory=args[2]
returnValue=""

function split(stringarray, sep)
  array={}; i=1
  if stringarray then
  for str in string.gmatch(stringarray, "[^"..sep.."]+") do
    array[i]=str; i=i+1
  end
  end
  return array
end

pages=split(pageList,";")
if headerCategory == null then
  headerCategory = ""
end

returnValue='{{stylesheet LogoView.css}}'

for p = 1, #pages do

  title = pages[p]:gsub("?",":")
  link = headerCategory..title:gsub("%s","") 
  image = "no_link.png"
  title = title:gsub("File:",""):gsub(".png","")
  icon = title:gsub("%s","")..".png" 

  if wiki.exists(link) then 
    image = "no_image.png"
    title = "<I>"..title.."</i>"
  end

  if wiki.exists("File:"..icon) then 
    image = icon
  end
    
  returnValue = returnValue .. '<div class="cell"><div class="cell-image">'
  returnValue = returnValue .. '[[' .. link .. '|<img src = "files/' .. image .. '" class = "icon" />]]'
  returnValue = returnValue .. '</div><div class="cell-text">' .. title .. '</div></div>'

end

returnValue = returnValue .. '<div class = "abort-grid"></div>'

return returnValue

LogoView.css

/* default settings = smallest screen */
/* iPod 4, iPhone 4 & earlier : 480x320 */

.cell {
  width: 25%;
  float: left;
  margin: 5px 0 0 0;
}

.icon {width: 65;}
.cell-image {text-align: center;}
.cell-checkbox {
text-align: center;
height:40px;
}
.cell-text {
text-align: center;
height: 40px;
}

/* default setting + landscape */
@media (orientation: landscape) {
.cell {width: 16.6%;}
.icon {width: 50;}
}

/* iPhone 5, iPod 5 : 568x320 */
@media (orientation: portrait) and (min-device-height: 568) {
.icon {width: 65;}
.cell {width: 33%;}
}
@media (orientation: landscape) and (min-device-height: 568) {
.icon {width: 65;}
.cell {width: 16.6%;}
}

/* iPad 2 : 1024x768 */
@media (min-device-height: 1024px) and (orientation: portrait) {
.icon {width: 175;}
.cell {width: 33%;}
}
@media (orientation: landscape) and (min-device-height: 1024px) {
.icon {width: 165;}
.cell {width: 25%;}
}

.abort-grid {clear: both;}

Icons:

You need some software which can generate suitable .pgn icons based on a photo always cropping to the same size & shape. I've been using an app called Icon Designer & saving my icons as 144x144 which it says is suitable for an iPad with retina display.

Find or make your own default icons that are to be shown when no page specific icon exists. Call these no_link.png and no_image.png (or something else & modify the code) - for my no_image.png I decided to use a Trunk Notes logo, this works well for me.

For each page you are going to view via LogoView.lua where you don't want to see the default logo simply create and upload your desired logo and name it after the page. i.e. if the page is called ToDoList then name the image ToDoList.png

Usage:

{{lua LogoView.lua, Page 1;Page 2;Page 3;Page 4}}

Notes:

The layout I've used is best suited to sets of 12 pages per set. More or less than 12 pages works ok but there will either be scrolling or blank space & with 12 it all just fits perfectly.

Image sizes and images per row are optimised based on the device used and the orientation in which it's being held. So for the ideal set of 12 image links on a page ...

  • iPad2 Landscape > large images & 3 rows by 4 columns
  • iPad2 Portrait > large images & 4 rows by 3 columns
  • 5th Gen iPod Touch Landscape > medium images & 2 rows by 6 columns
  • 5th Gen iPod Touch Portrait > medium images & 4 rows by 3 columns
  • 4th Gen iPod Touch Landscape > small images & 2 rows by 6 columns
  • 4th Gen iPod Touch Portrait > small images & 4 rows by 3 columns

Other device screen sizes and resolutions can easily be catered for within the CSS code

Example Images:

Still unsure how to include images here, so for now see my Picasa Folder

posted in Trunk Notes Discussion read more

@pacamilo - do you just mean it's also showing actions that are already over due?
I don't really use TN for date / action processing but that's what I see when trying it.

Seems to me the following will show all @todo actions dated anytime upto a week from now but not just those starting between now and then.

{{dueinnext, 7, @todo}} 

I guess the concept is todo task oriented and older tasks are expected to be purged if they are complete.

posted in Trunk Notes Discussion read more

In my CheckList Example I recommended using a static include or customised lua loader when the same checklist table is to be added into multiple pages. Here's an example:

Lua Code:

ProjectXCheckList.lua

function CheckList(title, row_labels, col_labels)
   O=title
   for col = 1, #col_labels do
      O=O .. " | " .. col_labels[col]
      col_labels[col] = string.gsub(col_labels[col], "%d", function(d) return string.format("%c", d+64) end)
   end
   O=O .. "\n:--:"
   for col = 1, #col_labels do
      O=O .. "|:--:"
   end
   O=O .. "\n"
   for row = 1, #row_labels do
      O=O .. row_labels[row]
      row_labels[row] = string.gsub(row_labels[row], "%d", function(d) return string.format("%c", d+64) end)
      for col = 1, #col_labels do
         O=O .. " | {{check " .. row_labels[row] .. col_labels[col] .. "}}"
      end
      O=O .. "\n"
   end 
return O
end

function split(stringarray, sep)
  array={}; i=1
  for str in string.gmatch(stringarray, "[^"..sep.."]+") do
    array[i]=str; i=i+1
  end
  return array
end

Rows=split("row 1:row 2:row 3",":")
Cols=split("col 1:col 2:col 3",":")

Y=CheckList("Title", Rows, Cols)

S = "{{stylesheet CheckList.css}}\n"

Y = S .. Y

return (Y)

Usage:

{{lua ProjectXCheckList.lua}}

Benefits:

  • This can easily be built into every page you want to see a particular checklist
  • E.g. it could be added via a snippet, or included in a common header or footer
  • If the details of what you want to see changes you only need to edit one page

posted in Trunk Notes Discussion read more

A while ago (in the old forum) I promised to tidy up & share some of my examples relating to checkboxes.
Can't recall if this code was ever posted so thought I'd share it here anyway in case it's of help to anyone.

Background:

I was adding many pages (similar to each other) of manually entered tables filled with checkboxes
Problem 1: This was tedious, time consuming & difficult to maintain especially over multiple pages
Problem 2: Adding or removing checkboxes affects which (later) checkboxes are ticked / unticked
Problem 3: Problem 2 can be solved by using named checkboxes but these look awful in a table

Usage:

{{lua CheckList.lua, heading, row 1:row 2:row 3, col 1:col 2:col 3}} 

Notes:

heading = the title you want to see in the top left of the resulting table
row 1... = colon separated list of row labels
col 1... = colon separated list of column labels

Output:

(not sure how to do a table or add a screenshot in this forum so you may need to use your imagination)

 _________________________________________
|  heading  |  col 1  |  col 2  |  col 3  |
 _________________________________________
|  row 1    |    X    |    X    |    X    |
|  row 2    |    X    |    X    |    X    |
|  row 3    |    X    |    X    |    X    |
 _________________________________________

Lua Code:

CheckList.lua

Title=args[1]
RowLabels=args[2]
ColLabels=args[3]

function CheckList(title, row_labels, col_labels)
   O=title
   for col = 1, #col_labels do
      O=O .. " | " .. col_labels[col]
      col_labels[col] = string.gsub(col_labels[col], "%d", function(d) return string.format("%c", d+64) end)
   end
   O=O .. "\n:--:"
   for col = 1, #col_labels do
      O=O .. "|:--:"
   end
   O=O .. "\n"
   for row = 1, #row_labels do
      O=O .. row_labels[row]
      row_labels[row] = string.gsub(row_labels[row], "%d", function(d) return string.format("%c", d+64) end)
      for col = 1, #col_labels do
         O=O .. " | {{check " .. row_labels[row] .. col_labels[col] .. "}}"
      end
      O=O .. "\n"
   end 
return O
end

function split(stringarray, sep)
  array={}; i=1
  for str in string.gmatch(stringarray, "[^"..sep.."]+") do
    array[i]=str; i=i+1
  end
  return array
end

Rows=split(RowLabels,":")
Cols=split(ColLabels,":")

Y=CheckList(Title, Rows, Cols)

S = "{{stylesheet CheckList.css}}\n"

Y = S .. Y

return (Y)

CSS Code:

CheckList.css

.checked_checkbox {
   display: none;
}

.unchecked_checkbox {
    display: none;
}

Recommendation:

If adding the same checklist to lots of pages then do so via a static include or purpose built lua loader with the title/row/column parameters baked in. This way when you decide to redesign the layout and / or content you'll only have to edit one version

Warnings:

  • Avoid titles on any two rows or columns which are the same (ignoring case, spaces, and non-alphanumeric values). The reason for this is that I label each checkbox with a concatenation of the row title and the column title & this needs to be unique
  • Changing any row or column names will lose the checkbox statuses for everything in those rows / columns

posted in Trunk Notes Discussion read more

@pacamilo : anything in particular you were looking for?

posted in Trunk Notes Help read more