Good info on plugins and scripting - not wanting it lost

To help you uderstand more. What you were doing with:

document.getElementById("demo").innerHTML = Date();

is exactly the same as

$(pr.sid).html(Date());

Because pr.sid is the dynamic ID of a <div> element that is automatically placed in the page for you exactly where the


reference was. (sid stands for script id) So without the need for the <em id=demo> you could write the same thing as

myScript(20409, function($, pr) {
    $(pr.sid).html(Date());
});

And if you wanted an inline tag instead of the block tag you could have simply switched it with

myScript(20409, function($, pr) {
    $(pr.sid).html(Date()).css('display', 'inline');
});

and then wherever the


reference was could have replaced your <em> tag and be exactly where your date appeared even to the same exact character in the sentence. And then all the intricasies of buiding and iding html tags, making the id's unique in the scope of the whole document, finding the exact spot in the page, and getting the timing right for perfect visual display, are complely taken care of for you by SeriTD.

The only sometimes slightly tricky part is that sometimes you have to use the Tx (remove format) on our references, of any kind, when they are itermixed with other HTML structures or they just don't work because they can end up with html inside them from the RTE. But that's not such a big deal if you know to do it.

proudly scribed using markdown?

Tags

  1. scripts
  2. script reference
  3. plugin
  4. plugins

Comments


Si says
seth 2016-03-11 12:23:44 [item 20421#48933]
what i don’t know how to do is to have the script affect another <div> not containg the script … like for eample one somewhere else on the page.

The easy answer is that it is just simple jQuery navigation. But lets say you want all the thoughts on the page. You can just right-click in your browser on a thought and take a look how thoughts are layed out. You will quickly see that they have a .thought-container class on them.

So all you need is

$('.thought-container')

to have a list of all the thoughts on the page.

Then you can do an each on them if you like. Look for things in them, and do as you will. For instance, if your will is to delete all the thoughts on the page from the database you could write

myThought(function() {
    $('.thought-container').each(function() {
        $(this).find('.delete-item-btn').click():
    });
});

Now of course, that is why right-edit-scripts is such a privildge!

You don't have to remember all these classes and things. I sure don't! You can just right click on anything in any page or thought, choose “inspect”, and see what they are right there live in the html. It's self documenting.

proudly scribed using markdown?


Si says
Anybody loving  the syntax colored code blocks other than me? I sure think it makes the code a lot easier to read and understand!  

Si says
Before I can make a new Author’s profile group be “Betty Boop’s Profile” we need to come to a hard and exact understanding of if the author’s real name is displayed and if it is optional, then when do they decide and if they decide no, then what do we do.

Right now, the author’s first and last name is being used to build their group name so giving them an option to hide it from their profile view is virtually useless. It will still be shown all over the place as their profile group name.

I would personally prefer NOT to do this. Like you say, not everyone should be forced to show their real name if they don’t want to … but making their group name their first and last name sneaks right around that. A group number is SO MUCH NICER AND SAFER AND EASIER FOR EVERYONE ….. until someday the author chooses on their own to obtain permanence, and then she can do it intelligently … instead of SeriTD guessing for her.

The system is in a fickle pickle right now because of this issue. I can’t finish coding new membership until author right to display, or not display, real name is known.

If it is ever a choice, then we must not put it in group names and in group titles.

Seth was all tizzy about author name being displayed without permission on the profile one day, and about “Author Group” for a newbee group name on other days. Those issues totally cross each other. --- He gotta un fickleify.  

Mark de LA says
nathan 2016-03-11 13:12:03 [item 20421#48944]
p.s. It is possible to apply coloring to ANY grammar and most grammar’s already have a colorizer … and it is fairly easy to make one for any that don’t. Even Seth’s quad grammars could be colorized.
M. 2016-03-11 13:26:56 [item 20421#48945]
does he have a grammar or just a data structure? 
nathan 2016-03-11 13:33:22 [item 20421#48947]
It looked to me like he had BNF grammar defined in some of his documents. I think there is a direct BNF definition to colorizer utility.
?

Holmes says
M. 2016-03-11 14:29:09 [item 20421#48953]
For my 2¢-wor$th, I prefer the right not to display my name. OTOH, the right to change one’s authorship at random seems to prevail anyway lessening the sting a bit  – if there was any. An email does not guarantee a real name at all: only a connection between a subscriber and an email address: a communications channel. Later when/as/if money changes hands a credit card, bitcoin or blockchain may be more valuble.  I have 3 gmails. So might as well make it optional. Hillary Clinton apparently had a few. Just saying ……
& said!
smug
nathan 2016-03-11 14:33:37 [item 20421#48954]
You and Hillary … email groupies of a feather!  

Yep, we are arriving at the idea of allowing not to show real name.  
M. 2016-03-11 15:04:53 [item 20421#48955]
Except I have no legal restrictions on mine, no classified info on mine & don’t work for the government.laughing
Yea. But with all the things you say online (keywords), and the fact that you use the term FBI often enough, I am sure you are on more NSA monitoring lists than Hillary will ever be!

To them, Hillary is a well known safe bet … no one really cares what she thinks or does.

You ...

See Also

  1. Thought Comment hiding plugin with 2 viewings related by tag "plugin".
  2. Thought Quick Script Writing Tutorial with 2 viewings related by tag "scripts".
  3. Thought The Dogs Of War with 2 viewings related by tag "scripts".
  4. Thought One man's propaganda is another man's truth is a third man's JOKE with 1 viewings related by tag "scripts".
  5. Thought A terrible question ... with 0 viewings related by tag "scripts".
  6. Thought What we do to each other matters, for that is the very being of our humanity. with 0 viewings related by tag "scripts".
  7. Thought about: Is Iran planning a cataclysmic strike for August 22? with 0 viewings related by tag "scripts".
  8. Thought Murder & Merde with 0 viewings related by tag "scripts".
  9. Thought about: The New Way Forward with 0 viewings related by tag "scripts".
  10. Thought about: Olmert gives IDF green light to expand ground offensive with 0 viewings related by tag "scripts".
  11. Thought Would that it was Otherwise with 0 viewings related by tag "scripts".
  12. Thought UN Resolution 1701 with 0 viewings related by tag "scripts".
  13. Thought The Quintessential Jewish Script with 0 viewings related by tag "scripts".
  14. Thought Other Side of the Story Anyone ? with 0 viewings related by tag "scripts".
  15. Thought about: Al-Qaeda planning militant Islamic state within Iraq with 0 viewings related by tag "scripts".
  16. Thought Where are we in the script ? with 0 viewings related by tag "scripts".
  17. Thought I wonder if there is a FastBlogIt plugin for the Google Homepage in our Future with 0 viewings related by tag "plugins".
  18. Thought Tracking internal Israeli politics with 0 viewings related by tag "scripts".
  19. Thought One road to peace ... saying things that need to be said. with 0 viewings related by tag "scripts".
  20. Thought Mr President, to surge or not to surge ? with 0 viewings related by tag "scripts".
  21. Thought A fatwa against a potential invasion of Iran with 0 viewings related by tag "scripts".
  22. Thought A Winning Script for Iraq with 0 viewings related by tag "scripts".
  23. Thought Changing Dynamics in Iraq with 0 viewings related by tag "scripts".
  24. Thought A Faint Sound of Peace ... with 0 viewings related by tag "scripts".
  25. Thought Wise Advice From A Former President with 0 viewings related by tag "scripts".
  26. Thought Draft for UNIVERSAL DATA ACCESS syntax with 0 viewings related by tag "scripts".