This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // delete resources from an admin page | |
| // zero chance of recovering deleted data, so BE VERY CAREFUL WITH THIS | |
| $(".a-delete.a-alert-trigger").trigger('click'); $(".a-button.a-button-secondary.a-alert-delete.a-small").trigger('click') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class HelpScout | |
| include HTTParty | |
| base_uri 'https://api.helpscout.net' | |
| def initialize(api_key) | |
| @auth = {username: api_key, password: 'x'} | |
| end | |
| def customers(page=1, options={} ) | |
| options.merge!({query: {page: page}}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #################################################################### | |
| ## Always hide certain fields if title field contains 'MATCH_PHRASE' | |
| #################################################################### | |
| {% assign do_not_render = customer.title | scan: 'MATCH_PHRASE' | size %} | |
| {% unless do_not_render > 0 %} | |
| <!-- HTML/Liquid to be hidden when title includes 'MATCH_PHRASE' --> | |
| {% endif %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source 'https://rubygems.org' | |
| gem 'desk_api', '~> 0.6.1' | |
| gem 'rake' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'pathname' | |
| base_path = Pathname.new(File.expand_path('../', __FILE__)) | |
| Dir[base_path.join('translation_sources', '*.xml')].each do |source| | |
| # only put cmd in a local var because #{} interpolation | |
| # uglifies syntax highlighting w/ %x() | |
| cmd = "file --mime-encoding #{source}" | |
| source_encoding = %x(cmd)[(source.length + 2)..-2] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- | |
| In this example assume we have some cases which are creatd with the a label called "Display Custom Field" | |
| And ONLY when this label is present on a case we want to display a Case Custom Field on teh case theme called "Awesome List" | |
| You would use the following (walkthrough of the logic below): | |
| --> | |
| <!--=======--> | |
| <!--Snippet--> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <form action="get" id="go_to_case"> | |
| <div><input type="text" id="case_id" name="case_id" placeholder="Enter Case ID"></div> | |
| <div><button type="submit">Go to Case</button></div> | |
| </form> | |
| <script type="text/javascript"> | |
| $('#go_to_case').on({ | |
| submit: function(e) { | |
| e.preventDefault(); | |
| var case_path = "/customer/portal/private/cases/" + document.getElementById('case_id').value; | |
| window.location.href = case_path; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Example link --> | |
| <a href="https://SUBDOMAIN_GOES_HERE.desk.com/customer/portal/emails/new?ticket[labels_new]=LABEL_GOES_HERE">Email Form</a> | |
| <!-- Example iframe --> | |
| <iframe src="https://SUBDOMAIN_GOES_HERE.desk.com/customer/portal/emails/new?ticket[labels_new]=LABEL_GOES_HERE" frameborder="0"></iframe> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Past this script in your header --> | |
| <script type="application/javascript"> | |
| $(function(){ | |
| // Enter CSS declarations for highlighted below | |
| var highlight_css = "background-color: yellow;"; | |
| $("#q").bind("autocompleteopen", function(event, ui) { | |
| var query_text = $('#q').val(); | |
| var queries = query_text.split(' '); | |
| var search_results = $('.article-autocomplete-body, .article-autocomplete-subject'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!--First, create a custom snippet in Desk and include some basic HTML in the "Custom Text" area--> | |
| <!--Documentation: | |
| https://support.desk.com/customer/portal/articles/566489-using-snippets-in-your-help-center--> | |
| <!--Put the snippet in your theme twice, and wrap one of them in a div with a class of "render_snippet_html" --> | |
| <div> | |
| This snippet will display as raw HTML: {{system.snippets.testhtml}} | |
| </div> | |
| <div> | |
| This snippet will display as bold: <span class="render_html_snippet">{{system.snippets.testhtml}}</span> |