Notepadd++ or any editor - custom autocomplete - javascript

I need to trigger a custom auto-complete when user enters a certain XML tag or XML attribute. I would prefer Notepad++.
I know in plugins/API directory there are list of files which contains keywords for auto complete.But it will not be very useful as i need to trigger autocomplete based on certain keyworkds.
The list is very vast so is there any other way to do it ? Currently I use a HTML JavaScript page to render the list. But its not that fruitful.
I want the list to be presented when someone is actually editing the XML page.
Any workarounds ?

In SynWrite app: try option (Auto-Complete tab of options): "Auto show list after typing N chars". It works not only for xml.

Related

Is it possible to create an HTML button in a text box to convert content to PDF (offline, CKEditor)?

So, my platform is integrated with CKEditor and everything I download there works fine. They even have a plugin that does exactly what I want (https://ckeditor.com/cke4/addon/exportpdf). But it's not 100% free.
My platform also allows adding custom buttons to its text editor / box. The code has to be HTML and the instructions for the code are:
Use {option} for the value of the entered option, if applicable. Use
{content} to indicate where the content highlighted when the button is
pressed should be inserted. Please note that any HTML entered here
should conform to the HTML specification (including any required
attributes for HTML tags), otherwise the software may not process it
correctly.
My platform is private, so pages and content are only displayed after logging in.
Is it possible to add an HTML button that converts the text in the editor box to PDF? (Even if I have to use an external website for that.)
Thanks!

Solution to raise the amount of products( quotedetails or quoteproducts) in Quote entity via modal

I want to add a Button in the ribbon of Quote,
When the user clicks on that, A modal displays, with two fields.
One is quote product categories that exist in that quote, that means it searches in quote product of the quote and find all the categories exist in that specific quote and then display them in a combo box. with their guid or something like that.
Another field is a textbox, which is percentage.
something like .
The end-user clicks on the ribbon button, the modal appears, he/she gives a number to the percentage and select one of the categories; when presses apply button, it find and return all amounts of the quote products in that quote that matches the user selected category, compute some amount based on quote total amount and the returned amounts and and insert that computed number into a field in each quote product named overed_amount.
How can I handle this? JS or Plugin?
I prefer to this via JS rather than writing plugin, But can I pass parameters between this HTML or JS file to CRM Form/Forms?
And does anybody have any sample? like this? any suggestion?
I googled and most of Plugins are about writing simple plugin based on existing code.
Can I display modal via plugin? Any suggestion or advise? or sample?
Plugins (and custom workflow assemblies) run as part of the backend platform. The only "UI" component they have is they run synchronously and throws an Exception, a popup will show that Exception to the user.
The typical way to add custom UI components is via custom web resources.
In custom web resources you can do HTML / JS / CSS, and even leverage 3rd party libraries such as KendoUI. You can add them to the form or open them via a ribbon button.
A custom web resource can typically interact with the main Dynamics 365 form via the parent property (as the above linked article describes).
One library that can help with displaying custom web resources in D365 is Alert.js, though as the documentation says, it's unsupported.
If you want to include some backend operations as part of the custom UI, you can create custom actions and call them from the custom web resource's JavaScript.

How can I generate a list of html elements on a particular page?

I am adding a help text model to my rails app, which allows admins to create help text for pages on my site. The form that allows admins to make help text requires text, location, and admin name. I would like the location attribute to have two input fields. The first being the particular page, and the second being the exact html element that the help text is to appear in.
How can I generate a list of the elements on the specified page?
Once the location is selected, I will build a helper to convert that into an xpath. From there, the help text and icon(s) will be added to the page via JavaScript.
If this approach isn't the most effective, what might be another method? RubyGems, scripts, rails magic, etc.
TL;DR How can I generate a list of html elements only knowing the page.

How do I create select menu in an external file and embed it in html to show the menu

My website has individual pages for members, but I have a select menu used to scroll from one member to the other. I have the select menu coded in the html on every page, but I need a better solution since my membership is growing.
I need to be able to create that same select menu in a separate file with the ability, when selected to jump to another member page, have that embedded in the body where I need it so that all I have to do is alter/ update the external file and it'll be done for all the member pages.
I've looked into javascripting it, mysqling it, but can't find (looking on youtube) a code to exactly help me in what I need.
My typical code for the select
//(select.....
//(option value="http:www.website-Profile-blahblah.html.... so on and so forth.
I need to pull this from an external file to use across the board and place it in the body where I need it.
thanks for any help you can offer.
In general this sounds like something you should be using a back end rendering engine for. As far as the select goes, this would be a great place to use a dropdown menu such as the one provided by bootstrap since clicking a select won't actually move you to another page.
If you dont want to use/can't use a back end rendering engine to render the options, I would suggest looking at angular.js which has a great ng-repeat and ng-option feature that would allow you to dynamically build the select/dropdown with as many users as you want.
angular ng-repeat page: https://docs.angularjs.org/api/ng/directive/ngRepeat
bootstrap dropdown: http://www.w3schools.com/bootstrap/bootstrap_dropdowns.asp (note the a tags could go directly to the user's page)
From experience in cases like this, it is much easier to have an SQL table to store the links you would like to use. The next thing to do is to have your back-end send you the list of links. With this, you can dynamically create the option tag and append it to your select tag. functions like newOptionTag.setAttribute('value', 'url'),document.createElement('option') and selectElement.appendChild(newOptionTag) should help you on your way
If you really want to use a seperate file, you could store the membernames and links in a json file. On document load get the file, parse it, then use the object to build the options.
The w3schools website (though frowned upon by some) has a json tutorial and an example that is already halfway there.
EDIT: I see it actually uses mysql to build the json file...

Scraping a dynamically generated webpage with HTML5 <input> field

I want to collect data from this page. I have keywords I want to input in the search box, which is defined as an HTML5 <input> with an eventlistener that dynamically changes the page based on the query.
For example, I want a script that inputs the term "hello world" in the search field and then scrapes the dynamically generated content, say the name of the collections that appear. Because of the Same Origin Policy I can't use JavaScript and I've spent the last 3 hours looking into Python but couldn't find anything there.
I can't tell if this is so obvious no one writes/asks about it, or it's a clever way to not let scripts scrape from your site.
Open the page in Chrome's Debugger or Firebug in Firefox and look at the Network Tab and find out the AJAX requests the JavaScript is doing when you enter text into the input field(s).
Then write a webscraper using any of:
https://pypi.python.org/pypi/requests
https://pypi.python.org/pypi/spyda
https://pypi.python.org/pypi/scrapy

Categories

Resources