Archive for the ‘Web Development’ Category

Sencha Touch v1 Open Links in New Windows

Tuesday, March 27th, 2012

Just add this snippet to your code if you want to force all links in your panels to open in a new window.   I’m targeting links specifically, but you could use it on just about anything.

Ext.override(Ext.Panel, {
  listeners : {
    click: {
      element: 'el',
      fn: function (e) {
        if (e.target.tagName === 'A') {
          e.stopEvent();
          window.open(e.target.href);
        }
      }
    }
  }
});

Fix for Sencha Touch Rounded Corners Bug in v1.0-1.1.1

Friday, December 30th, 2011

Some rounded corners in Sencha Touch forms with fieldsets look like garbage by default.  Here’s a CSS only fix:

.x-form-fieldset .x-field:first-child.x-label-align-top .x-field-text,
.x-form-fieldset .x-field:first-child.x-label-align-top .x-input-text,
.x-form-fieldset .x-field:first-child.x-label-align-top .x-input,
.x-form-fieldset .x-field:first-child.x-label-align-top .x-input-number,
.x-form-fieldset .x-field:first-child.x-label-align-top .x-spinner-body,
.x-form-fieldset .x-field:first-child.x-label-align-top .x-input-radio,
.x-form-fieldset .x-field:first-child.x-label-align-top .x-input-checkbox,
.x-form-fieldset .x-field:first-child.x-label-align-top .x-input-email,
.x-form-fieldset .x-field:first-child.x-label-align-top .x-input-url,
.x-form-fieldset .x-field:first-child.x-label-align-top .x-input-password,
.x-form-fieldset .x-field:first-child.x-label-align-top .x-input-slider {
  -webkit-border-top-left-radius: 0;
  border-top-left-radius: 0;
  -webkit-border-top-right-radius: 0;
  border-top-right-radius: 0;
}

 

Thank you: http://www.sencha.com/forum/showthread.php?152265-CSS-bugs-with-fieldsets-and-labelAlign-top

Count Number of Lines of Code in a Project

Tuesday, December 20th, 2011

find ./ -name \*.js | xargs wc

[find] [in this current directory] [files named] ["wildcard".js] [and] [just print counts]

The first column is the number of lines for the listed file, with the total count at the bottom.  As you can tell, I’m working on a JavaScript project.

Modify Your Drupal Registration Form in a Zen Sub Theme

Thursday, December 15th, 2011

Add the following to your template.php file, and you can add your own user-register.tpl.php and user-profile-edit.tpl.php files to your theme.  For my purposes, I wanted to remove the form so I just added a paragraph to the tpl file and left it at that.

YOURTHEMENAME_theme(&existing, $type, $theme, $path){
  return array(
    '$hooks' => zen_theme($existing, $type, $theme, $path),
      'user_register' => array(
      'template' => 'user-register',
      'arguments' => array('form' => NULL),
    ),
    'user_profile_form' => array(
      'template' => 'user-profile-edit',
      'arguments' => array('form' => NULL),
    ),
  );
}

I took some of the info from comments here and Drupal documentation here. Thanks!

The iPhone, Cookies, and JSONP Logins

Tuesday, November 29th, 2011

I’ve been working a lot on mobile apps lately and one issue I recently came across was that my logins that are handled over JSONP requests work just fine on Chrome desktop and the Android browser, but not on Safari (mobile or desktop) unless I changed cookie settings on the device to “Accept All”.  That’s an awful answer since I don’t want to just force users to change their settings just to be able to use my app.

I’m now using the default setting, which is “Accept Visited” and my workaround was to include an iFrame with the source set to my server domain that is being logged into remotely and style is set to “display:none” since I don’t actually want to show the iFrame.  I consider this quite the hack, so if someone else has a better idea I’m all ears.


©2005-2017 Blog – Epiphany Digital is proudly powered by Badgers and Web Design is by Epiphany Digital
Entries (RSS) and Comments (RSS). 28 queries. 1.979 seconds.

Thank you for visiting this site. The web fairy will visit you in your sleep... you know, I was going somewhere with this, but it really doesn't have as much innocent charm as the tooth fairy, especially when I picture the web fairy as someone much like the Simpsons' Comic Book Guy but with wings. It's just not something I want.