How to add snippet menu onTrigger sublime text 2 - sublimetext2

I try to make in my snippet when you trigger it gives you the same "dropdown" as auto complete does.
My currently snippet looks like:
<snippet>
<content>
<![CDATA[
Somehow to make an menu..
]]>
</content>
<tabTrigger>Trigger</tabTrigger>
</snippet>

Related

What scope for html.erb in Sublime Text?

I'm writing a snippet for html.erb files,
but I can't understead what should I write in scope tag.
When I press ctrl+shift+alt+p it shows to me "text.html.ruby text.html.basic"
html.erb
<p>test</p>
<%= 'test' %>
The snippet
<snippet>
<content><![CDATA[test]]></content>
<tabTrigger>test</tabTrigger>
<scope>text.html.ruby</scope>
</snippet>
or
<snippet>
<content><![CDATA[test]]></content>
<tabTrigger>test</tabTrigger>
<scope>text.html.basic</scope>
</snippet>
Doesn't work but it's all right with the snippet cuz when I change the scope to "source.ruby" all is working fine.
P.S correct my english.
Correct tag for erb is:
<scope>text.html.ruby</scope>
You problem in content section, because tabTrigger "test" will be replaced by same value "test". There should be something like this:
<snippet>
<content><![CDATA[<%= ${1:test} %>]]></content>
<tabTrigger>test</tabTrigger>
<scope>text.html.ruby</scope>
</snippet>

Paper-dialog with iron-pages and inside each page paper-dialog-scrollable

Using Polymer 1 I'm trying to figure out a way to dinamically switch pages inside a paper-dialog and inside each page to have a paper-dialog-scrollable element.
Here's the short version of what I'm trying to do:
<paper-dialog with-backdrop>
<iron-pages selected="0">
<div>
<paper-dialog-scrollable>
Long content 1 goes in here...
</paper-dialog-scrollable>
</div>
<div>
<paper-dialog-scrollable>
Long content 2 goes in here...
</paper-dialog-scrollable>
</div>
</iron-pages>
</paper-dialog>
The issue is that the paper-dialog-scrollable, when the window is resized, goes over the paper-dialog edges and no scrollbars get shown.
I've looked a the code for paper-dialog-scrollable and it has a "dialogElement" property that is by default "this.parentNode". I've also tried to change that from the code with each page change but I cannot get it to work. Here's the "code":
this.querySelector('iron-pages').selectedItem.querySelector('paper-dialog-scrollable').dialogElement = this.querySelector('paper-dialog');
The last attempt I made was to trigger the refit and notifyResize on the dialog just under the above snippet of code, using the following:
this.querySelector('paper-dialog').notifyResize();
this.querySelector('paper-dialog').refit();
Maybe someone has ran into this issue and found a solution to this!?
Any hints or ideas would be appreciated!

How do I make a div container show some content, when clicked to show all content?

I was wondering how do I make it so that a div container show parts of its content in a small text box, and there will be an arrow at the bottom of the text box pointing downwards, and when clicked upon, it will make the text box bigger and show all of its content?
Can this be achieved using html/css, without the need to use javascript and jQuery or is it a jQuery thing?
<div class="society3" style="overflow:auto">
<p>Description:<p>
<p><?php echo $description; ?></p>
</div>
The description variable just contains a paragraph of text, so I would like the div container to show part of the text and when someone wants to read the full description, they can click on the button and, box will extend to show all content of the div tag.
The bad news is that you will need to use jQuery or similar for something like this, but the good news is that it's relatively straight forward. After you've loaded it into your page, all you need to do is target the id you would like to show/hide (or as it is called in jQuery toggle) and make an onClick() event.
For example, something like this should work.
<script>
$(document).ready(function(){
$("button").click(function(){
$("#toggle").toggle();
});
});
</script>
<div id="button" class="society3" style="overflow:auto">
<p>Description:<p>
<p id="toggle" style="display: none">[content]</p>
</div>
The most similar of your objective is using html5, but this works in google chrome, sometimes in firefox.
<html>
<head><meta charset="UTF-8"></head>
<style type="text/css">
.expand{
padding:10px;
}
</style>
<div class="expand">
<details>
<summary>OPEN</summary>
<p>Some text</p>
</details>
</div>
</html>

code or pre element isn't working perfectly on Bootstrap

I am creating a landing page for myself with Twitter Bootstrap framework and I want to show some code on my landing page and that's why I am writing my code into <code></code> or <pr></pre> this elements but it's not showing. I put my code like below:
<code>
<command type="?">Click Me!</command>
</code>
or
<pre>
<command type="?">Click Me!</command>
</pre>
But, Twitter Bootstrap is only showing to me "Click Me!" word. He don't show me the whole code into the <code> or <pre> elements.
How may I fix this?
You still have to replace the < and > characters with < and >, respectively, or they will be interpreted as HTML:
<pre>
<command type="?"> Click Me! </command>
</pre>

How to remove title from RichTextEditor control in Flash?

It is possible to remove some RichTextEditor control bar with showControlBar property.
But how to remove title bar too?
The following code displays control WITH empty title bar:
<mx:RichTextEditor id="mLog" left="10" right="10" top="10" bottom="41"
dropShadowVisible="false" showControlBar="false">
How's this look?
<mx:RichTextEditor showControlBar="false" dropShadowEnabled="false"
headerHeight="0"
borderThicknessLeft="0" borderThicknessRight="0"
borderThicknessTop="0" borderThicknessBottom="0"/>
headerHeight sets the title bar height to 0. The 4 borderThicknessXXX settings remove the borders that still showed.