Sublime snippet with params on tabTrigger - sublimetext2

For example somewhere inside .html file i type:
temp:some-id
And expect my snippet creation magic to return this with the specified "some-id" :
<script type="text/template" id="some-id"></script>
So i need a way to trigger some text and pass through some arguments to the snippet creation file so when the triggering happens I can assign that arguments to some tab-placeholder inside .sublime-snippet. Any ideas?
P.S. im using sublime text 2, if it matters.

You should use the variable $TM_CURRENT_WORD, you can look into this page for more detail
However when testing this I noticed that if I have the snippet:
Hello, $TM_CURRENT_WORD
with the trigger hello: with my desired word directly after : something like hello:user i must have user highlighted if I want a tab to trigger my snippet so it should work just as fine with the variable $SELECTION in this case.
Hope this helps.

Related

y code doesnt highlight paperscript part of code...it includes html.plist instead of html.json

my code doesn't highlight paper script part of code...
I changed my HTML.plist also
from...
<key>begin</key>
<string>(?:^\s+)?(<)((?i:script))\b(?![^>]*/>)(?![^>]*(?i:type.?=.?
text/((?!javascript).*)))
</string>enter code here
beginCaptures
to...
<key>begin</key>
<string>(?:^\s+)?(<)((?i:script))\b(?![^>]*/>)(?![^>]*(?i:type.?=.?
text/((?!javascript).*)))</string>
<string>(?:^\s+)?(<)((?i:script))\b(?![^>]*/>)(?![^>]*(?i:type.?=.?
text/((?!paperscript).*)))</string>
beginCaptures
but it still not works
as it has HTML.pl instead of html.json

Cant get tinymce to display

Im trying to install tinymce to use with my text editor to allow the user to have a text box just like the stack overflow one. I cant get it to display though
ive put this in the head of my index file
<script src='https://cloud.tinymce.com/stable/tinymce.min.js'></script>
<script src='https:https://cloud.tinymce.com/stable/tinymce.min.js'>
</script>
<script src="//tinymce.cachefly.net/4.1/tinymce.min.js"></script>
<script>
tinymce.init({selector:'infotextarea'});
</script>
then in my info page ive put
<textarea id="infotextarea">Your content here.
</textarea>
can anyone explain why its not displaying
It may be that at the time you run the tinymce.init function, it is not yet rendered and there is no textarea in the DOM.
Try debugging your code on the following line:
<script>
debugger;
tinymce.init({selector:'infotextarea'});
</script>
When the web's execution has stopped on that line, in the development console of your browser type the following:
$('#infotextarea').length
If the size is greater than 0, textarea exists at that moment and it is another problem, but if it shows 0 is that you have not yet created that view, this will help us get more information about your problem.
If you want to target a <textarea> by ID you need to use a valid CSS selector.
selector: "#infotextarea"
(note the # at the beginning of the string)
I would also note you appear to be loading TinyMCE 3 separate times - I have no idea why you would need to do that - loading it once should be sufficient
Its not a perfect answer to my question, but i used ckeditor and it worked perfectly.
I must have a mistake somewhere that i or my team could not find with tinymce

Explain the strange code html

I want to do a change in my site web (html+css+php)
I have this code html:
<h4>#_live_support#</h4>
In your opinion, what is the result of code??
No!No! result is not:
#_live_support#
a result CODE is Name Only:
Direct support
I want to explain this code please**
Photo caption
[code html]
http://goo.gl/vZQNXD
[Result]
http://goo.gl/4OaIvB
This is a template HTML file you are looking at. When the PHP script is called, #_LIVE_SUPPORT# will be dynamically replaced by whatever is appropriate at the time.

adding content from search result with jquery

I am using this cool script http://qpoit.com/marcofolio_demo/apple_search/ however when I click on a search result, I want it to be added as html content to an id which I will use like . I know this is done with $("#displayContent").html(data); however I need the content of search result that I clicked on to be and not all the results found. Please help
The rpc.php-file of the search, contains the function, which generates the output of the search.
In line 29, change the content to a JavaScript-function, which does this work for you.
// Used in line 29 in rpc.php
echo '<a href="'.$result->url.'">';
// Change it to something like
echo '<a onclick="applyContent('.$result->url.')">'
After that, head back to the index.html (or the file in which you are using the apple-search), make sure jQuery is loaded and add something like this:
<script type="text/javascript">
// Use the same function name, as in the php-file
function applyContent (resultURL) {
// Use jQuerys get-function to get the content of the file you've found in the search
$.get(resultURL, function(data) {
// Change '#finalResult' to the css-selector, of the element, which should contain the result at the end
$('#finalResult').html(data);
});
}
</script>
Once you click on a search-result, it should make it the content of #finalResult, or whatever element you choose.

html element whose text can be dynamically changed also an onclick action to point to a function NOT button

currently I am using a button whose 'value' i am able to change so that text written over button changes but I see that text is centered inside button & not big enough . Can I get something like +,- we see in windows explorer which enables to fold & expand folder in tree view.
i do not want to use any external file (img etc.) as I am creating a single self-sufficient webpage.
Please suggest.
you can use this code for displaying + sign
----Firstly put this code in the head of your html.
<script type="text/javascript">
function function_Name()
{
alert('hi');
}
</script>
Then call the above function from this link here below, onclick event here call the above declared function:
+