Hi there, I'm using ASP.net and C# and I'm trying to make the supernote database driven. Has anyone got any ideas where to start? I'm thinking of writing the code on the fly but I'm not sure where to start. Anyone using Supernote with a Database driven content with Visual Studio?
2) Angus TurnbullGroup: Moderators Posts: 4042Joined: 7 Dec 2003Location: New ZealandIP: 202.137.--.--
Posted:
Assign IDs to notes as you generate them, build an array of note content/ID, and write that array data out at the end of the document in your script. Tada, done :).
- Angus.
3) supernoteFanGroup: Guests IP: 68.59.--.--
Posted:
Is there a way angus to use a template with supernote, or simply use the same hidden div for several tooltips, and simply feed the content of what should display in the div with some kind of function
for example tipster script lets u do this, you don't have to create the same tooltip several times, you can simply use a template
and say NewtooltipName.newtip.show('content', 'content');
4) supernoteFanGroup: Guests IP: 68.59.--.--
Posted:
for example if you are dynamically creating tooltips, which all use the same format, this would be much more efficient towards you website because let's say you had to have 500 tooltips in one page, thats a zillion extra lines of code since you had to create 500 divs with the content for each tooltip
is there a way to not do this?? Thanks :) loving the supernote :)
5) Angus TurnbullGroup: Moderators Posts: 4042Joined: 7 Dec 2003Location: New ZealandIP: 203.173.--.--
Posted:
The idea behind SuperNote is that all the data is in the page separately, so it still works OK without JavaScript.
Templating with SuperNote is deliberately left out but you can get an awful lot done with CSS. Perhaps if you wanted, make a PHP function that writes out the note trigger link, stores the note data you give it in an array, then spits out the notes at the end of the document -- that shouldn't be more than half an hour's work. Do you templating in CGI!
Good luck - Angus.
6) supernoteFanGroup: Guests IP: 68.59.--.--
Posted:
thanks for the reply, I'm sure you've been busy lately as it took you a bit to reply
The main purpose that I want to be able to "template" with supernote is because I dont' want to write in html a seperate note for the triggering link, I am using php and am having something like an average of 500 notes on one page, this will generate A LOT OF CODE, thus slowing down the pageload of my html page, I like the idea of tipster that you don't have to create a seperate note and can use templates to dynamically generate the note data, thus making 500 notes on one page the same page load as a page with 5 notes.
However, tipster is not as functional as supernote and cannot have "pinned notes" that don't automatically close on mouseout, yet supernote doesn't allow templates for notes..
ahhhh! i can't have the cake and eat it too huh? What do you suggest I do, maybe I can edit supernote to allow using templates, and you could point me of where to edit it, or maybe I can edit tipster to allow it to have pinned notes, i'm stuck between these two features and need something that can handle both features. So which edit would be easier and where?
Thank you!
7) supernoteFanGroup: Guests IP: 68.59.--.--
Posted:
really i'd like to edit tipster, as i see this would be easier
all i want to do is change the feature where it automatically closes a note onmouseout of the note or trigger
so i have to only specify onmouseout=... manually to close the note
where on what line? what main algorithim do I have to change? how do I get this done basically? I'm not asking you to do it for me, please don't be offended, i just need to be shown where to begin, what i'm getting into.. by the expert in the field of this particular script (which is you :) )
thanks again (yes i type a lot)
8) Angus TurnbullGroup: Moderators Posts: 4042Joined: 7 Dec 2003Location: New ZealandIP: 203.173.--.--
Posted:
Ah hell, if you want to edit Tipster just modify the hideDelay so it doesn't close :). Make it a very large number.
I posted a reply in the Tipster forum I can see was started by you under a different nick? Perhaps try keeping your comments in one thread as I can't recall which one is most recent otherwise :).
- Angus.
9) supernoteFanGroup: Guests IP: 68.59.--.--
Posted:
sure i'll keep it in this thread, i will try the hide delay idea, its a good idea :) thanks
i am having problems trying to position a tipster tooltip by its trigger element you give an example of a tooltip being positioned which is on a fixed position here: 'staticTip.xPos + 95', 'staticTip.yPos + 50'
here I have a span element, which I use as the trigger to open the toolip on mouseover of this span element I want to position the tooltip as a fixed position of where the span element sits on the page, not by the mouse location What kind of forumula would I need to do that? I haven't found much help on my usual resources (google, js help sites) <p> <span id="whatever" onmouseover="firstTip.newTip('trans_2', 5, 5, 'name', 'nombre', 'es', 28)" onmouseout="firstTip.hide()">nombre</span> </p>
maybe I could say: 'getElementbyid('whatever').xPos + 95', ''getElementbyid('whatever').yPos + 50'
not quite sure how to get this done, maybe u know the correct formula???
I do realize that in order to make any kind of formula of where to place the tooltip in relation to its trigger span element, you would need knowledge of where the span element sits on the page (coordinates or something) I'm not quite sure of how to automatically determine the coordiantes of a span element, I know I can look up by ID though.....
any ideas?
(sorry for all the questions)
-cheers
10) Angus TurnbullGroup: Moderators Posts: 4042Joined: 7 Dec 2003Location: New ZealandIP: 203.173.--.--
Posted:
Grab my "Modular Layer API" script, steal the page.elmPos function from that, and use 'page.elmPos("id-of-element").x + 20' to get its position and position relative to that.
Then again SuperNote has that funciontality built right in :P
- Angus.
11) supernoteFanGroup: Guests IP: 68.59.--.--
Posted:
yes yes :) supernote is awesome I know, but not so awesome because it does not support templated tooltips, that is very important to me Thank for the suggestion on using modular layer API, I will try it
I tried your hideDelay suggestion and it works in not closing the tooltip automatically yet it poses another problem here is my code:
var formTip = new TipObj('formTip'); with (formTip) { template = '<table width="240" border="1" bordercolor="#000000" bgcolor="#FDF9D7"><tr><td width="100%"><table width="230" border="0" bgcolor="#FDF9D7"><FORM NAME="contribute_%5%" ACTION="" METHOD="GET"><tr><td width="182"><span class="style6">Original English text:</span></td><td width="38"><a href="Javascript:formTip.hide()">Close</a><td></tr><tr><td>%2%</td></tr><tr><td clas s="style6">Translated Russian text:</td></tr><tr><td>%3%</td></tr><tr><td><span cl ass="style9">Suggest a better translation</span></td></tr><tr><td><span class ="style7"><textarea rows="3" cols="25" wrap="virtual" name="text">%3%</textarea></span></td></tr><tr><td alig n="right"><span class="style7"><input type="hidden" name="lang" value="%4%" /><input type="hidden" name="id" value="%5%" /><INPUT TYPE="button" Value="Contribute" onClick="suggest(this.form)"></span></td></tr></form></table></td></tr></table>';
as you can see I am also trying to close the formTip tooltip with a "close" link which executes Javascript:formTip.hide();
since the hideDelay is now 999999, using the hide() function does not work anymore, I can only choose to hide it once the delay is done
like I wanted before I'd rather somehow edit the tipster script to REALLY implement a feature where there is no auto closing of the tooltip onmouseout of the tooltip
yes I know you're going to say supernote can do this, i've seen the feature of how you can close supernotes, yet again I can't use supernote if I am not able to pass supernotes via some kind of javascript dynamic template, I cannot afford to create 1000 seperate supernote divs, this is not efficient
so I ask for you help on how to find a solution or how to edit tipster to be able to disable the auto close of a tooltip on mouseout of the tooltip
or how I can implement some kind of similar javascript template to create notes with supernote
Thank You
13) Angus TurnbullGroup: Moderators Posts: 4042Joined: 7 Dec 2003Location: New ZealandIP: 202.137.--.--
Posted:
OK, if you don't care about accessibility and want to use SuperNote like that, create a JS function that you call that document.write()s out a note in SuperNote (I'd do it by writing out a trigger, then storing the note data and writing the notes out in a batch at the end of the document). Voila, templating.
- Angus.
14) supernoteFanGroup: Guests IP: 68.59.--.--
Posted:
hey hey, calm down angus! is it just me or every conversation with you it seems like your constantly annoyed or pissed at me? I try to be nice. :) Because I ask questions etc.., I don't want to offend you.
It's as if using supernote tipster whatever it is, and me wanting to use it how I want to use it, deeply offends you. I don't mean too, put yourself in my shoes, i just want to get this done.... how would you do it? and I appreciate the help, I was even considering donating because of the help.
I don't quite understand what you mean here is two different things that I think you mean: A: I write all the supernotes out in a batch at the end of the document, this would still be a presence of 1000 supernotes and divs at the end of my page, thus not solving anything in my goal
B: You say I should create some kind of function in js that writes a single supernote div to the page, so when you do call the supernote class the note div will be written there at the end of the page, this way there will only be 1 div at the end of each page at any moment, as each time a trigger is clicked, that div will be overwritten with something new
So which do you mean? and I assume by suggesting to me this rather difficult method, that you also are telling me that doing this difficult method is EASIER than simply editing the tipster.js to not make it auto close on mouseout, i'd rather do that, but you tell me to do this other way, so... that must be super difficult or impossible I suppose then???
Cheers the fan of your scripts
15) Angus TurnbullGroup: Moderators Posts: 4042Joined: 7 Dec 2003Location: New ZealandIP: 202.137.--.--
Posted:
Oh I'm not mad, I was just saying that if you use a solution along the lines of:
var notes = []; function makeNote(linkText, noteData) { var noteNum = notes.length; document.write('<a href="#" class="supernote-hover-note' + noteNum + '">' + linkText + '</a>'); notes[noteNum] = noteData; };
...rest of document here....
for (var i = 0; i < notes.length; i++) { document.write('<div class="xyz" id="supernote-blahblah-' + noteNum + '">' + notes[noteNum] + '</div>'; }
I just bashed that out there, you will of course have to edit it to work, and it's probably full of bugs, but hopefully you get the idea. You will still have 1000 notes in the document but they're generated individually. This will of course totally fail in non-JS-browsers which is why I made that comment about accessibility.