小编Jor*_*dec的帖子

光标未在设备模式下显示(谷歌浏览器)

所以我正在尝试开发一个web应用程序,我试图在移动设备上查看它.我目前正在使用Cordova和JQuery Mobile以及ripple.js在我的浏览器中查看我的应用程序.

  • 第一个问题(据我所知)是ripple.js在Google Chrome中效果最好,所以这是我唯一的测试平台.
  • 第二个问题是当我打开设备模式时,它在我输入渲染版本时没有显示黑点(光标).

我将解释我的情况或情景:

  1. 举个例子,我会去http://google.com
  2. 我按F12进入开发者模式
  3. 我单击切换设备模式按钮
    在此输入图像描述

  4. 我将看到我的光标,直到我输入生成的移动画布.虽然我通常会看到一个黑色透明点,但我现在什么都看不到.然而,我可以像往常一样点击并拖动,但我看不到我在做什么.

我已经尝试过的事情:

  • 将所有标志重置为默认值
  • 将所有开发者工具设置重置为默认值
  • (编辑)安装了以前版本的Chrome AND Chromium

所以问题是,如何让我的光标回来?

额外的:我正在使用版本49.0.2623.87 m,但这与我的同事没有关系,版本相同,他看到了光标.

(编辑)目前我正在使用鼠标选项,我按下Ctrl键查看指示光标所在位置的圆圈,但这确实是一个临时解决方案.

(编辑)我通过做一些事情来修复它.所以我不确定修复它的确切方法.我删除了一些程序,我在它仍然工作后安装了.我卸载了其中的4个.我还更新了我的显卡,然后重新启动了.所以它可能是显卡更新,软件卸载和/或重启.

google-chrome

18
推荐指数
2
解决办法
1万
查看次数

Cannot assign to read only property 'closed' of object '[object Object]'

I've been cracking my head on this for a few days now, but I can't find the reason why this is happening.

So I'm getting the following error message:

TypeError: Cannot assign to read only property 'closed' of object '[object Object]'

在此处输入图片说明

如您所见,它发生在sendProposal函数的civilliability-step3.component.ts中:

civilliability-step3.component.ts

@Component({
  selector: 'app-civilliability-step3',
  templateUrl: './civilliability-step3.component.html',
  styleUrls: ['./civilliability-step3.component.scss']
})
export class CivilliabilityStep3Component implements OnInit, OnDestroy {
  @Output() modelChange = new EventEmitter<CivilLiabilityRequestType>();
  @Output() onCloseForm = new EventEmitter();
  @Input() model: CivilLiabilityRequestType;

  public formGroup: FormGroup;

  private closedProposalSub: Subscription;

  constructor(private formBuilder: FormBuilder, …
Run Code Online (Sandbox Code Playgroud)

javascript angular

8
推荐指数
1
解决办法
3456
查看次数

在Aurelia中将数据从一个视图模型传递到另一个视图模型

我有一个名为的页面entry-main,它包含以下模板:

<template>
    <entry-search></entry-search>
    <entry-details></entry-details>
</template>
Run Code Online (Sandbox Code Playgroud)

里面<entry-search>有另一个自定义元素.它看起来像这样:

<template>
    <div class="row">
        <div class="col-lg-12">
            <div class="input-group">
                <span id="entry_search" class="input-group-addon">
                    <span class="fa fa-search"></span>
                </span>
                <!-- important part -->
                    <typeahead id="choose" placeholder="Holding the place"></typeahead>
                <!-- end of important part -->
            </div>
        </div>
    </div>
</template>
Run Code Online (Sandbox Code Playgroud)

在typeahead viewmodel中,我得到了我的typeahead的值,如下所示:

$(this.id).on('typeahead:selected', function (e, item) {
       this.selected = item;
});
Run Code Online (Sandbox Code Playgroud)

我现在的问题是,如何this.selected从我的entry-details-viewmodel中获取我的typeahead-viewmodel?
为了清楚起见,它应该是这样的:

<entry-main>
    <entry-search>
          <typeahead></typeahead>
    </entry-search>

    <entry-details>
          ${selected}
    </entry-details>
</entry-main>
Run Code Online (Sandbox Code Playgroud)

ecmascript-6 aurelia aurelia-binding

6
推荐指数
1
解决办法
2727
查看次数

Cordova表单不提交或按钮不起作用(android +4.4)

注意:以下问题仅发生在4.4.2以上的Android版本上(据我所知)


TL; DR

  • 问题1:带有click/tap/vclick/touchstart的按钮,在我的cordova应用程序中仅部分(10-30%的时间)工作(仅限Android).
  • 问题2:表单中的按钮(提交按钮)不会触发我的.submit(function(){..});事件,但键盘上的"进入/输入"按钮确实会触发事件.(也仅限Android)


我正在尝试为ios/android/windows开发混合应用程序.在应用程序中,我偶尔会有触发某些操作的按钮.

问题1
通常我会使用.on('click', function() { ... });,但我了解到点击并不真正与移动设备配合.相反,我会使用vclick,tap或者touchstart,但这似乎并不总是有用.有时按钮会触发,有时它会在我反复点击/点击后触发.

问题2
在其他页面上,我将有一个包含在<form>标签中的表单,其中包含一个<button type="submit" id="btnSubmit">Submit form</button>.在我的javascript中,我将有一个.on('submit', function(e){ ... });事件来捕获表单提交,但由于另一个无法解释的原因,这似乎不起作用.

这是我的表格:

<form id="registerForm" method="post" action="#" class="ui-body ui-body-b ui-corner-all">
    <div data-role="fieldcontain" class="ui-hide-label">
        <label for="regLang" data-translation="reg_language"></label>
        <select id="regLang" name="Language">
            <!--<option value="0">EN</option>-->
            <option value="1">NL</option>
            <option value="2">FR</option>
            <!--<option value="3">DE</option>-->
        </select>
    </div>
    <div data-role="fieldcontain" class="ui-hide-label">
        <label for="regCode">Registration Code:</label>
        <input type="text" name="RegistrationCode" placeholder="Registration Code" data-translation="reg_code" id="regCode" />
    </div>
    <div data-role="fieldcontain" …
Run Code Online (Sandbox Code Playgroud)

android webview jquery-mobile cordova

5
推荐指数
1
解决办法
3709
查看次数

RadComboBox中的重音不敏感搜索

我对使用ASP webforms和Telerik相对较新,但我正在寻找一种允许我在a中输入特殊字符(é,ù,à,...)的方法RadComboBox.

让我说我的名字ObjectDataSource叫"RenéTomebody".我需要通过搜索"Rene"和"René"来找到他,但到目前为止还没有运气.

在应用程序中,他们设法在RadGrid带有过滤器的情况下执行此操作,但RadComboBox就我所知,同样的解决方案并不起作用.

他们使用的解决方案RadGrid:http://www.telerik.com/forums/accent-insensitive-filtering-filtering-on-a-different-column#YS1QT8P1U0-cRPFNfjvDzA

asp.net telerik

5
推荐指数
1
解决办法
245
查看次数

在不同类的控制台应用程序中使用 AutoFac 构造函数注入

所以我觉得我在这里遗漏了一些东西,但我基本上是在制作一个将调用多个处理程序的控制台应用程序。

程序.cs

private static IContainer _container;
static void Main(string[] args)
{
    _container = AutoFacBootstrapper.Init();
    var _backupFactory = _container.Resolve<IBackupFactory>();

    UserHandler.Init();
}
Run Code Online (Sandbox Code Playgroud)

AutoFacBootstrapper.cs

public static IContainer Init()
{
    var builder = new ContainerBuilder();
    builder.RegisterType<BackupFactory>().As<IBackupFactory>();

    return builder.Build();
}
Run Code Online (Sandbox Code Playgroud)

看到这一切既美好又有趣,我可以在 Program.cs 中使用我的工厂,但是当我尝试在不同的类中使用我的工厂时(比如 UserHandler.cs),我的_backupFactory将保持为 null(这是有道理的)。

用户处理程序

private static IBackupFactory _backupFactory;
public UserHandler(IBackupFactory backupFactory)
{
    _backupFactory = backupFactory;
}

public static void Init(string[] subCommands)
{
    var users = _backupFactory.GetFtpUsers();
}
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个问题,以便我可以在另一个类中使用构造函数注入,而只需在启动时对其进行初始化?

c# autofac constructor-injection

4
推荐指数
1
解决办法
2935
查看次数

Cordova网址和图片src在Windows中的网页上有"不安全"

我正在使用Angular开发一个Cordova应用程序,而且我正在为Windows开发一些东西.

我正在尝试这样的事情:

<img ng-src="{{dataDirectory + buildingPhoto.FilenamePhoto}}" class="full-width">
Run Code Online (Sandbox Code Playgroud)

dataDirectory ="ms-appdata:/// local"
buildingPhoto.FilenamePhoto ="VOL-00122kaftfoto_thumb.png"

但这只会导致使用此代码损坏图像:

<img class="full-width" src="unsafe:ms-appdata:///local/VOL-00122kaftfoto_thumb.png" ng-src="ms-appdata:///local/VOL-00122kaftfoto_thumb.png">
Run Code Online (Sandbox Code Playgroud)

我认为这unsafe意味着前缀被视为不安全而且需要列入白名单,因此我在我的中添加了app.js:

.config(['$compileProvider', function($compileProvider) {

    $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|ghttps?|ms-appx|ms-appdata|x-wmapp0):/);
    $compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|file|ms-appx|ms-appdata|x-wmapp0):|data:image\//);
}])
Run Code Online (Sandbox Code Playgroud)

我还在index.html中添加了这个元标记:

<meta http-equiv="Content-Security-Policy" content="ms-appdata *; default-src *; img-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'" />
Run Code Online (Sandbox Code Playgroud)

但它不起作用,所以我有点卡在这里,希望有人能把我推向正确的方向.

angularjs cordova windows-10

3
推荐指数
1
解决办法
1135
查看次数

C#AmbiguousMatchException当GetProperty并尝试相互映射两个对象时

我正在尝试制作一个将eUsers列表对象映射到用户列表对象的函数。它实际上会映射一些属性,但是当时propertyInfo.Name == "UserName",它将AmbiguousMatchException在下面的行中抛出a :

typeof(User)
    .GetProperty(ePropertyInfo.Name, BindingFlags.IgnoreCase | BindingFlags.Instance | BindingFlags.Public | BindingFlags.SetField)
    .SetValue(user, ePropertyInfo.GetValue(currentEUser));
Run Code Online (Sandbox Code Playgroud)

我进行了测试,看来它是由GetProperty方法触发的。我不太确定是什么原因造成的。这是全部功能:

private List<User> ConvertEUsersToUsers(List<eUser> eUsers)
{
    List<User> users = new List<User>();
    User user = null;

    IList<PropertyInfo> eUserProps = new List<PropertyInfo>(eUsers.FirstOrDefault().GetType().GetProperties());
    IList<PropertyInfo> userProps = typeof(User).GetProperties();
    foreach (eUser currentEUser in eUsers)
    {
        user = new User();
        foreach (PropertyInfo ePropertyInfo in eUserProps)
        {
            foreach (PropertyInfo propertyInfo in userProps)
            {
                if (propertyInfo.Name == ePropertyInfo.Name)
                {
                    if (ePropertyInfo.CanWrite)
                    {
                        typeof(User)
                            .GetProperty(ePropertyInfo.Name, BindingFlags.IgnoreCase | BindingFlags.Instance | BindingFlags.Public …
Run Code Online (Sandbox Code Playgroud)

c# propertyinfo

0
推荐指数
1
解决办法
114
查看次数

c#将数据字符串转换为对象

所以我正在尝试解决这个问题,这应该不会太难,但我现在被困在这个问题上太久了。

这是我正在处理的数据var data = "2,6;2,7;4,14;5,20";
这是一个显示的字符串<modifierGroup>,<modifier>;<modifierGroup>,<modifier>;...

这是我最终想要获取数据的模型:

public class ModifierGroup
{
    public int Id { get; set; }
    public List<Modifier> Modifiers { get; set; }
}

public class Modifier
{
    public int Id { get; set; }
}
Run Code Online (Sandbox Code Playgroud)

现在我一直在想我需要以这种格式获取我的数据,所以我最终可以将它推送到模型中:

Key=2
    Value=6
    Value=7
    
Key=4
    Value=14
    
Key=5
    Value=20
Run Code Online (Sandbox Code Playgroud)

但我可能是错的。我很想保持代码简短。所以我宁愿防止循环中的循环并一遍又一遍地执行 if 语句。最好的情况是我得到 1 行或 2 行代码,但如果它不起作用,它也不起作用。

c#

0
推荐指数
1
解决办法
46
查看次数