I'm trying to installe
ac-php emacs package. I installed it successfully from melpa but can't figure how to use.
Here's the screenshots of what happened.
Package installed
Configuration as described in ac-php
No option for
ac-php-*!
How to solve it? Please help
You issue here is your $('.to-translate').click() is being triggered every time you click on the input, which is then recreating the input every time.
I have updated your fiddle with a fix
https://jsfiddle.net/pcf331u5/
tpl += '<div id="'+iid+'" class="bg-warning"><p class="to-translate">'+text+'</p></div>';
$('.to-translate').click(function(){
$(this).parent().html('<input type="text" name="" class="form-control ttxti">');
});
I have added a p element inside of your div which contains the to-translate class. When the click event is triggered the parent (div) replaces the content with the input
Related
I´m using TinyMCE v4.7.9
When working with templates (https://www.tinymce.com/docs/plugins/template/)
I would like to insert the templates last in content editor, not where i stand, is there some hack to do that? Can i add a button "insert after" on dialog?
Now i'm stuck in some other P tag and my templates are DIVs.
Regards
After some trial and error and no way to find an answer to this, i found a work around.
I start the templates with <div data-insertafter
in setup on event "BeforeSetContent":
editor.on('BeforeSetContent', function (e) {
if (e.content.indexOf("<div data-insertafter") === 0) { //okej, insert after
editor.setContent(editor.getContent() + '<div class="row"></div>');//add an element to in the end
editor.selection.select(editor.getBody(), true);//select al
editor.selection.collapse(false);//set focus on that last div by inverting selection
e.content = e.content.replace("data-insertafter", "");//remove
}
});
You can certainly modify the template plugin to do that...each plugin ships in a minified and non-minified version so you can just modify the non-minified version to address this need.
I'm trying to use the placement option listed under input options for the NgbInputDatePicker.
I'd like to change the default bottom-left position of the popup datepicker, but when I try to use placement in the plunker example (https://ng-bootstrap.github.io/app/components/datepicker/demos/popup/plnkr.html) It doesn't change the position of the popup.
I've tried:
adding [placement]="top" inside of the input tag:
<input class="form-control" placeholder="yyyy-mm-dd"
name="dp" [placement]="top" [(ngModel)]="model" ngbDatepicker #d="ngbDatepicker">
I've also tried just placing it in the parent div:
<div class="input-group" placement="top">
<input class="form-control" placeholder="yyyy-mm-dd"
name="dp" [(ngModel)]="model" ngbDatepicker #d="ngbDatepicker">
but neither seems to change the pop up position. I'm new to Angular, so perhaps I just have the syntax wrong somehow? I noticed other input APIs in the documentation that seemed to be used in this fashion so I thought it might work...
I'm using ng-bootstrap 1.0.0-beta.2, and Angular 4.3.4.
Thanks.
The problem is that you are using a binding to an expression (top means expression in [placement]="top") while I think that your intention is to use "top" constant. You can solve it using one of the 2 methods:
placement="top" (preferred)
[placement]="'top'" (notice additional quotes around top)
When specified properly the placement option works perfectly fine as illustrated in this plunker: http://plnkr.co/edit/NCNmpm3tlxapH4jZS08F?p=preview
Please see the relevant plunker
https://plnkr.co/edit/f0BxpinhuqVz8o6IIFaL?p=preview
stack overflow makes you put code if a plunker is linked
but it is too much code to copy paste here it would just
look messy so I a am putting this comment instead.
If you run this and then click the add button a new entry is added to the array, but the form view does not reflect the forms state, instead the first entry is duplicated and the last entry is gone.
If anyone has any ideas or guides as to what I am doing wrong I would be very grateful as I have been pretty stuck on a seemingly easy task.
I tried to follow the official Angular Reactive Forms guide as close as possible to build this example.
Seems like Angular has trouble tracking the index of your objects in your formArray. This can be solved by using trackBy. Add it to your iteration with function:
<div *ngFor="let detail of detailArray.controls; let i=index; trackBy:trackByFn" [formGroupName]="i">
and in component:
trackByFn(index: any, item: any) {
return index;
}
Your PLUNKER
I want to use selenium to record and click at item in a page with the following code:
<input type="checkbox" onclick="HighlightRow(1, this, 3,"");" value="916242540932034325|628149" name="AID">
in Selenium IDE, recorded script:
click
//input[#name='AID' and #value='916242540932034325|628149']
However, the value 916242540932034325|628149
having security prefix "916242540932034325" which will change dynamically every time the page load.
Problems: My Recorded Script not able to RUN after page load due to the dynamic security prefix.
Help: Anyone have any suggestion for the problems I face above?
Try click //input[#name='AID' and contains(#value, '|628149')]. As long as that's a unique combination of NAME and VALUE, you'll get what you want.
i got a (hopefully) simple problem with a Code Template on Eclipse. I try to use a Code Template to surround a word with somehing. The Replacement is nearly successful, but i have a problem with handling the selected word.
My task is to select "save " on this example
<button type="submit">save</button>
and want to have
<button type="submit"><?= $this->_('save') ?></button>
The problem is, that i got this after replacement
<button type="submit">save<?= $this->_('save') ?></button>
Is there a possibility to remove the selected word after using a code template? I am thankful for every help i get. Smile
I forgot, the template looks like this:
<?= $$this->_('${word_selection}') ?>${cursor}
Maybe this question is somewhat old, but I came across the same idea in Java for adding String constants by simply typing the desired name and then replace it with a template, like this for example:
type VALUE and get it replaced with private static final String VALUE = "VALUE";
I use eclipse 3.6 and got it working with the following template:
private static final String ${word_selection} = "${word_selection}";
Then I do the following steps:
type VALUE
select it by double-clicking and hit CTRL+SPACE
enter first few chars for the template name in the opened proposal pop-up and select the template (see image below)
hit ENTER
And the result is this:
Maybe this is helpful.
Using templates and the ${line_selection} or ${word_selection} variables, Eclipse (Helios, 3.6.1 here) always seems to insert the rendered template after the text you initially selected.
I've experienced this myself (in the HTML editor) while trying to implement a similar 'Surround with Tag' template, and gave up and reverted to using Ctrl+1 (after selecting text), and using 'Surround with new element...'. Unfortunately this workaround doesn't help you much w/ PHP.
Possible bug report?
I also faced the same problem in jsp page. I resolved this issue by using 4 or more characters to select the template in eclipse. And I got the correct result.