Ignore default snippet in Sublime Text - code-snippets

I've created my own custom version of the html.sublime-snippet adding in a doctype and some meta tags and saved it in the User directory.
Now, when when I try to trigger my snippet both the default version and my custom version show up as options.
Is there any way to semi-permanently disable the default snippet so only my version is available?

I was bothered by Python's default snippet for #property. I found working solution here. Your would be similar:
In .config/sublime-text-2/Packages copy the HTML folder to (for example) HTML Customized.
Hose/Edit out the snippets that offend you in HTML Customized.
Add HTML to the ignored_packages entry in the preferences to disable the standard HTML snippets.
Without catch!
Someone called marcuso posted this solution on Sublime Text forum. He deserves all glory. (And also Matt York, who mentioned the thread in this comment).

Options:
You can change the tabTrigger of your new snippet
You can change the tabTrigger of the default snippet
You can comment out the tabTrigger line of the default snippet:
<!-- <tabTrigger>html</tabTrigger> -->
The catch: when you update ST I believe it will overwrite any changes made to the default configuration files. So, if you comment out the tabTrigger in the default snippet it will be uncommented after your next upgrade of ST.

Related

Add tooltips for ng-tagsinput

I have been using ng-tagsinput from benford -> http://mbenford.github.io/ngTagsInput/
I am trying to add tooltips for tags added in input field. This tooltip should show contents of the tag. Can anyone help me to add tooltips for the tag?
Any help is appreciated.
Thank you,
I have made little changes in latest file of ng-tags-input.js and ng-tags-input.min.js that will solve your requirement of tool tip.
I have added ng-attr-title={{$getDisplayText()}} at ngTagsInput/tag-item.html template section in js file. by simply adding title attribute to the span tag will work. This change made for you, but #mbenford the creator of this library may add this as an feature.
You can download the file from below links. and you can see the tooltip on tags :)
https://ufile.io/k5v8w - min js
https://ufile.io/sntbh - unminified js
This is a very old question but a template approach is better. Just use the "template" attribute and add tooltip to your template. Details here:
http://mbenford.github.io/ngTagsInput/documentation/guides/custom-templates

Automatically add current url before print instruction in Joomla article

I want to manually add a [Print] icon in the position of my choosing in a Joomla 3.6 article. This article will be used as a 'master' which will be copied and renamed on a weekly basis so I would like the reference to the article in the URL to be automatic. Something like this:
<div class="btn-group">Print Preview</div>
I tried using # to reference the current page etc but this meant that the entire content of the page was (all modules, headers, footers, etc) were displayed in the print preview as well as the current article.
Thank you.
p.s. BTW, "Joomla3.6" isn't a valid tag yet so I couldn't add it with my reputation of just 1!
Not sure about your goal to "Manually add a [print] icon".
The normal way:
In the joomla /adminstrator , in the menu under Content->article, in the options on the right, there is a "Show print icon" - option. This will show the print icon for all articles. You might need to style it to suit your need. This can also be configured on a per-menu - basis.
Optionally:
You could override the default output of the article template (More on output overrides here) and add the print icon wherever you need it:
Copy the file /components/com_content/views/article/tmpl/default.php to /templates/yourtemplate/html/com_content/article/default.php
Add the print icon somewhere: <div class="btn-group"><a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language)); ?>" ... >Print Preview</a></div>
But, you can probably use the first method. Or perhaps just move the current output of the print icon in default.php, using the override method described above.

Orbeon changed behavior for xforms:alert / xforms:h3lp

[Stackoverflow disallows the word help in the title. Hence the h3lp]
We are in the proces of moving our code from Orbeon 3.9 to Orbeon 4.x. One of the many things that changed is the behavior for display of xforms:alert and xforms:help. Example code:
<xforms:input ref="#code">
<xforms:alert ref="$resources/required-field"/>
<xforms:help ref="$helptext"/>
</xforms:input>
In Orbeon 3.9 the alert is displayed as a red img with a white exclamation mark that has the text as tooltip, only if the binding fails. The help is displayed as a blue-ish image with a question that activated a tiny pseudo window containing the (potentially large) help text.
In Orbeon 4.7 the alert text is displayed as-is, no image and no condition based on binding. This interferes with a carefully designed interface as it takes up a lot more space. The help text is not displayed at all because .xforms-help has display: none;. Overriding that doesn't work because the text would then just be displayed inline.
I could not find documentation for these changes. Does anyone know the rationale and how to make "alert" and "help" useful yet again?
There are two changes with Orbeon Forms 4.x which might be relevant to this:
The HTML layout of elements has changed a bit. This means existing CSS might have to be adapted. You can check this by comparing the HTML produced by 3.9 vs. 4.x for a given page. With 4.x, all form elements, for example, are wrapped within a <span> or <div> element.
Form Runner uses Twitter Bootstrap as a CSS library. But the Bootstrap CSS files are also included for non-Form Runner pages.
This said, "red icon" alerts should still work, see for example the good old Espresso Order or Bookcast demos.
If you see alerts inline and unconditionally, it means that somehow the proper CSS doesn't apply, either because of the HTML layout change mentioned above, or because some CSS files are missing.
Look at this post : http://blog.orbeon.com/2014/01/improving-how-we-show-help-messages.html
and this : http://discuss.orbeon.com/how-to-use-the-quot-new-quot-xforms-help-in-4-5-td4658348.html
julien

Generating a link with Markdown (BlueCloth) that opens in a new window

I'd like to have a link generated with BlueCloth that opens in a new window. All I could find was the ordinary [Google](http://www.google.com/) syntax but nothing with a new window.
Ideas?
Regards
Tom
Here is a complete reference for markdown: http://daringfireball.net/projects/markdown/syntax
And since there is no mention of how to set the target attribute, I would believe it is not directly possible, but the reference also says:
For any markup that is not covered by
Markdown’s syntax, you simply use HTML
itself. There’s no need to preface it
or delimit it to indicate that you’re
switching from Markdown to HTML; you
just use the tags.
Source: http://daringfireball.net/projects/markdown/syntax#html
So I would suggest you have to use the html syntax for links like this
update
if you wrap the markdown generated content in a div with a specific id like this:
and you use jQuery, you can add the following javascript:
$('#some_id a').attr('target','_blank');
Or you can save the BlueCloth output in a variable before outputting.
markdown_generated_string.gsub!(/<a\s+/i,'<a target="_blank" ')

Sitecore Rich Text Html Editor Profile - set global default

OK I can't believe this can't be found anywhere so I'm asking the question.
Is there a way to set the default Html Editor Profile in Sitecore so I don't have the override the Source field on each individual Rich Text field?
e.g. I want to make this the default option for the Html editor:
/sitecore/system/Settings/Html Editor Profiles/Rich Text Medium
Its an old question but here is the solution I found in Sitecore 6.5 - I was looking to do the same thing in 6.5:
You can change the value to the path of your default editor in the web.config. This will change is across all fields where the source is not defined.
<!-- HTML EDITOR DEFAULT PROFILE
Path to the default html editor profile.
Default value: /sitecore/system/Settings/Html Editor Profiles/Rich Text Default
-->
<setting name="HtmlEditor.DefaultProfile" value="/sitecore/system/Settings/Html Editor Profiles/Rich Text Default"/>
It seems to fall back to the "/sitecore/system/Settings/Html Editor Profiles/Rich Text Default" in case the source is not defined. Thus, if you try to modify this default profile, every RTE field will obtain these modifications by default, without specifying the source.
Never tried it myself, though...

Resources