Vim:更改特定目录的文件格式[重复](Vim: Change the file format for a particular directory [duplicate])
这个问题在这里已有答案:
我正在使用Vim与其他使用Windows的开发人员一起开展项目。
问题:我得到“^ M”字符而不是换行符。 这可以通过这个简单的命令来解决
:set fileformats=dos
但是当我重新启动Vim时,将使用unix格式再次打开该文件。 另一个问题是我必须为目录中的每个文件执行命令。
是否可以为整个目录设置此参数?
This question already has an answer here:
I'm using Vim to work on a project with others developers using Windows.
The problem: I get "^M" characters instead of line-breaks. This can be solved with this simple command
:set fileformats=dos
But when I restart Vim, the file is opened again with the unix format. Another problem is that I have to execute the command for each file in the directory.
Is it possible to set this parameter for a whole directory?
原文:https://stackoverflow.com/questions/17811110
最满意答案
我想到了。 该应用程序为每个ID创建两个输入元素。 如果我得到第二个,那么我可以设置该值并触发AngularJS查看它的事件。
function login(un, pw) { $($('[ng-model="login.loginId"]')[1]).val(un).trigger('input'); $($('[ng-model="login.password"]')[1]).val(pw).trigger('input'); }; this.evaluate(login, username, password);
I figured it out. The app is creating two input elements per ID. If I get the second one then I can set the value and trigger an event for AngularJS to see it.
function login(un, pw) { $($('[ng-model="login.loginId"]')[1]).val(un).trigger('input'); $($('[ng-model="login.password"]')[1]).val(pw).trigger('input'); }; this.evaluate(login, username, password);
相关问答
更多-
我等到一些.jpg加载..(它工作了一次)。 casper.then(function() { this.evaluate(function(username, password) { document.querySelector('input[node-type="userid"]').value = username; document.querySelector('input[node-type="userpass"]').value = password; ...
-
如何使用CasperJS填写AngularJS输入字段,不带表格标签(How to use CasperJS to fill in AngularJS input fields w/out a form tag)[2023-09-09]
我想到了。 该应用程序为每个ID创建两个输入元素。 如果我得到第二个,那么我可以设置该值并触发AngularJS查看它的事件。 function login(un, pw) { $($('[ng-model="login.loginId"]')[1]).val(un).trigger('input'); $($('[ng-model="login.password"]')[1]).val(pw).trigger('input'); }; this.evaluate(login, username, ... -
该页面是一个带有附加样式表(XSL)的XML文档,用于将页面转换为HTML或XHTML。 这是由大多数浏览器自动完成的。 似乎PhantomJS默认编译,禁用XSLT处理。 因此,不处理样式表,PhantomJS将其视为任意数据。 您可以使用所需的选项集编译PhantomJS,也可以使用SlimerJS作为CasperJS的引擎。 默认情况下,使用过的gecko引擎支持XSLT转换。 另一种途径可能是使用JavaScript中包含的XSLTProcessor来自己转换内容,但PhantomJS中也没有。 T ...
-
当前网址为http://www.twse.com.tw/en/trading/exchange/STOCK_DAY/STOCK_DAY.php ,表示您在起始页面中被阻止并等待重定向,请更改您的 casper.then(function() { this.capture(filename); this.echo("Saved screenshot of " + (this.getCurrentUrl()) + " to " + filename); }); 至: casp ...
-
以下是更正后的代码。 在你的函数fillLastpack()你将一个对象数组推入packData数组,而你只需要推送一个对象。 更新小提琴 var myApp = angular.module('myApp', []); //myApp.directive('myDirective', function() {}); //myApp.factory('myService', function() {}); function MyCtrl($scope) { $scope.packData ...
-
您应该尝试使用fillXPath(但它在1.1版中可用): casper.test.begin('Test', 0, function suite(test) { casper.start('http://127.0.0.1:8020/test_casper/testme.html', function() { this.test.assertExists({ type: 'xpath', path: '//*[@name="sele ...
-
使用casperjs登录网站(Use casperjs to login a website)[2024-03-04]
casper.evaluate()提供对PhantomJS和CasperJS中沙盒DOM上下文(页面上下文)的访问。 evaluate()内部指的是全局对象,它是window而不是casper 。 您无法访问casper或在页面上下文之外定义的任何其他变量,并且您只能将原始对象传入或传出(Docs: PhantomJS , CasperJS )。 由于您要执行的操作是同步的,因此您只需将其移出函数即可: casper.thenEvaluate(function () { document.query ... -
我已经解决了阅读官方文档并使用此代码的问题: ng-options="user.username as user.username for user in users track by user.username" I've resolved reading the official documentation and using this code: ng-options="user.username as user.username for user in users track by user.us ...
-
this在任何函数中都undefined在casperjs中undefined 尝试casper.then : casper.start(url); casper.then(function() { var deviceValue = this.evaluate(function() { return $('table').find('select').val(); }); this.echo(deviceValue); }); this out of any function is ...
-
我使用下面的代码解决了这个问题: casper.waitUntilVisible('.close-j',function(){ this.click(x("//a[@ng-show='!activeDialog.hideCloseButton']")); this.wait(5000); }); I solved this problem by using the code below: casper.waitUntilVisible('.close-j',function(){ t ...