How to display dropdown list of sublime-snippets in html files - sublimetext3

I have created a libary with about 80 sublime-snippet's.
They work great on my machine which is the machine I created them on. I then passed my folder out to two of my fellow employees so that they could use the new library of snippets I created. The only issue is the snippets won't work on their machines. They are installing it in /Sublime Text 3/Packages/MySnippetFolder. These snippets are meant to be used in .html files. However they are only showing up in .py files for my coworkers. Scope is commented out in the sublime-snippet files so shouldn't they appear in .html files as well? Any advice is appreciated thank you very much for your time in advance.
Edit: Ok So the snippets are working as intended I believe. The thing I am confused about now is when I use it in a python file a dropdown list appears that contains my snippets. When I try this in my html files there is no drop list containing my snippets. Is there a way to have to drop down list appear in my html files as well like it does for the bootstrap 3/4 snippets package?
Here is an example of the code for one of my snippets.
<snippet>
<content><![CDATA[
<div class="form-group v-spacing-extra-large">
<p>Minimum: <strong>1</strong> | Maximum: <strong>10</strong> | Multiple <small>(Step)</small>: <strong>1</strong>
</p>
<div class="input-stepper-group">
<a aria-label="Decrease Quantity by 1" tabindex="0" data-stepper-role="decrease" data-stepper-target="#demo-stepper-three" href="#" class="btn btn-secondary js-stepper-control disabled"><i aria-hidden="true" class="icon-minus"></i></a>
<input aria-describedby="product-qty-three-stepper-aria-describedby" aria-label="quantity" data-toggle="stepper" data-round="up" id="demo-stepper-three" class="form-control stepper" pattern="[0-9.]+" type="text" data-min="1" data-max="10" data-step="1" value="1">
<a aria-label="Increase Quantity by 1" tabindex="0" data-stepper-role="increase" data-stepper-target="#demo-stepper-three" href="#" class="btn btn-secondary js-stepper-control"><i aria-hidden="true" class="icon-plus"></i></a>
</div>
<span id="product-qty-three-stepper-aria-describedby" class="ada screen-reader-only">Initial Quantity is set to 1. Max Quantity is set to 10 and the step multiple is set to 1.</span>
</div>
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>ff-stepper-min1-max10-stepby1</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>

To have the dropdown list appear in your html files unless you have another package installed to enable this just type < before your snippet code. So if you have a my-snippet.sublime-snippet , then to use that you would type "<"my-snippet wihtout the "'s and you would see the drop down once you began typing.

Just press CTRL + Space anywhere in the code to get the snippets dropdown.

Related

Selecting a Value for a DojoComboBox using Selenium Python

I'm trying to build a data scraper with Selenium Python that searches a webpage. The search page contains a dojoComboBox that allows you to select a name from a dropdown list.
Here is the HTML for the dojoComboBox:
<span _="whitespace and CR's between tags adds in FF" class="dojoComboBoxOuter dj_khtml dj_safari dropSel" style="null">
<input style="display:none" tabindex="-1" name="txtCaseName" value="" dojoattachpoint="comboBoxValue">
<input style="display:none" tabindex="-1" name="txtCaseName_selected" value="" dojoattachpoint="comboBoxSelectionValue">
<input type="text" autocomplete="off" class="dojoComboBox dropSel" dojoattachevent="key:_handleKeyEvents; keyUp: onKeyUp; compositionEnd; onResize;" dojoattachpoint="textInputNode" style="null">
<img hspace="0" vspace="0" class="dojoComboBox dropSel" dojoattachpoint="downArrowNode" dojoattachevent="onMouseUp: handleArrowClick; onResize;" src="dojo/src/widget/templates/images/combo_box_arrow.png" style="width: 13px; height: 13px;">
</span>
I can get the DojoComboBox scroll menu to open with the following code:
dropdown = browser.find_element_by_css_selector("img.dojoComboBox")
dropdown.click()
However, I can't seem to find a way to actually select one of the values.
Update:
The HTML I posted above is from the page I pull up when I inspect elements (the HTML under the 'Elements' tab of Chrome DevTools). I've been looking at some other files that I found in the 'Source' tab, and I found some code in a page called main.aspx?e=nauqov2blnhlnh45eseztnao that looks also related to the DojoComboBox:
<select name="txtCaseName" id="txtCaseName" class="dropSel"dojotype="ComboBox"
setSelectedValue="dojo.byId('txtCaseName1').value=arguments[0]"
autocomplete="true" dataurl="CaseCode.aspx?match=%{searchString}&lang=e"
mode="remote" maxlistlength="7">
</select>
However, neither of these seem to encode options that I can select. I thought that perhaps the options would be stored in the url labeled 'dataurl' in the piece of HTML above, but when I copy that link into my address bar, it doesn't take me to a valid webpage. From what I've found in the Dojo documentation, it seems like the options should be stored in a separate file/database, but I can't find any suggestions about how to access that file.
Any suggestions? (Thanks!)
you will have to store every options in a list. Then based on some conditions such as name of option, you can choose it and click on it.
all_options = browser.find_elements_by_css_selector("your locator for every options")
for options in all_options:
if "option_name" in options.text.strip():
options.click()

Bootstrap Fileinput cannot hide progress bar (nodejs/Electron)

I am creating an Electron project and I am using Bootstrap Fileinput.
<div class="form-group">
<label class="control-label col-xs-3">Folder containing installation/patch scripts</label>
<div class="col-xs-9">
<input id="input-2" name="input2" type="file" class="file" data-show-upload="false" data-show-preview="false" data-show-cancel="false" webkitdirectory>
</div>
</div>
The control is rendered fine and works. The issue is that, as soon as the control is rendered, I can see "0%" above it. No matter what I have tried I cannot remove that. I don't want a progress bar to be visible, the control will work only to locate a folder name, which will then be used for other purposes.
Any ideas why I always see the progress bar?
I found the solution. I had to add the following option in js code when I create fileinput:
layoutTemplates: {progress: ''}

How can I create searchmask for Mindbreeze, which is limited to only one defined Datasource, or atleast via search parameters?

We have a mindbreeze Installation, which defines 3 Datasources. And with the editor I created a searchmask.
The generated/exported code seems to be plain Mustache-html,
<div data-template="filteredfacet" data-name="datasource/category" role="treeitem" tabindex="-1" aria-expanded="true" aria-labelledby="label7841" style="position: relative;">
<script type="text/x-mustache-template" data-tag-name="span" data-attr-title="{{name}}{{^name?}}{{html}}{{/name?}}">
<span class="{{#showAddAnd?}}mb-add-and-available{{/showAddAnd?}}">
{{{html}}}
{{#showAddAnd?}} <a class="action mb-add-and"><i class="icon-plus-sign"></i></a> {{/showAddAnd?}}
</span>
<span class="pull-right" title="{{count}}">
{{#count?}}{{count}}{{/count?}}{{#excluded}}–{{/excluded}}
</span>
</script>
</div>
Where it only seems possible to change the look and feel.
In the Online Documentation an Cheat-Sheet I could find some metadata, but not the desired.
Does someone have any experience with this? Or some pointer how I can limit a search on only on specific data source.
You can add a constraint for the whole search application. This also allows you to restrict to a specific data source. Just add a results display like "List", "Image Gallery" or "Map":
After adding you can change the option "Restrict the Results" to every query you want. In your case e.g. datasource/category:"Web" does the trick.

how to make custom templates in Koken

I'm using Koken and would like to customize the template for text entries by putting the date at the top of the entry.
I hacked a call to new Date() into the core template file /admin/templates/text.tmpl.html
<div id="entry-editor">
<div id="edit-area" data-bind="html: content() ||
'<p class=\'date\'>' + new Date() + '</p>
<p class=\'media-row\'><br /></p>'">
</div>
</div> <!-- close #entry-editor -->
This works fine, but I know the perils of hacking core files.
As of this writing, I don't see an answer on the page linked as "define your own custom template types" on help.koken.me.
Without hacking core files, how can I have Koken add a date to the top of each text entry?
From http://help.koken.me/customer/portal/questions/1080677-how-to-make-custom-templates-in-koken-
Simply place a <koken:time> tag in the customized theme template.
For example, in my /storage/themes/<custom-theme-name>/essay.lens file:
<header>
<h2>
<koken:link>{{ essay.title }}</koken:link>
</h2>
<p>
<strong><koken:time show="time" /> <koken:time show="date" /></strong>
</p>
</header>

ModX Revolution MIGX/GetImageList not displaying entire list

I have a site that was built and handed over to me, so I'm not as familiar with ModX as I'd like to be. That said, I've built my own templates, tpls and the like.
However, and existing MIGX using template is giving me fits. It used to display all the items in the list properly - one image, and three text fields. Now, it randomly will stop displaying one item.
When I say random, I don't mean that it switches around when you refresh the page - I mean right now item #4 isn't being displayed (even in source code, nothing appears). But if I were to delete any other item, that #4 might just show up again, and a different item start disappearing.
I'm at a loss here. I see no special characters in the text fields. Even if there were, that wouldn't explain how an item will work then not work then work again based on making changes to other items.
Please let me know what other information I can provide to assist in troubleshooting this.
Below is all the relevant code I can think of.
Template:
<div id="content">
[[!getImageList?
&tvname=`management`
&docid=`[[*id]]`
&tpl=`management_tpl`
&limit=`0`
]]
<div class="clear"></div>
</div><!-- #content -->
management_tpl:
<div class="management_box">
<div class="management_img">
<img src="[[+image:phpthumbof=`w=100&z=1`]]" alt="[[+pagetitle]]" />
</div>
<div class="management_content">
<h2>[[+name]]</h2>
<h3>[[+position]]</h3>
[[+descr]]
Show more
</div>
<div id="[[+name:stripString=` `]]" class="fulldescr">
<img src="[[+image:phpthumbof=`w=100&z=1`]]" alt="[[+pagetitle]]" />
<h2>[[+name]]</h2>
<h3>[[+position]]</h3>
[[+fulldescr]]
</div>
<div class="clear"></div>
</div>
Thanks,
Chris
For anyone who finds this in the future - my MIGX plugin was outdated and had some flaws that caused this. Updating the plugin fixed everything.

Resources