How to mask and unmask input element password type in Ionic / Angluar

How to mask and unmask input element password type in ionic/angular/js:

  
this.togglePasswordField = function () {
     console.log("toggle password field called");
     if (document.getElementById("passwordElement").type == "password") {
        document.getElementById("passwordElement").type = "text";

         document.getElementById("passwordHideIcon").classList.remove("ion-eye");
         document.getElementById("passwordHideIcon").classList.add("ion-eye-disabled");
     }
     else {
          document.getElementById("passwordElement").type = "password";
          document.getElementById("passwordHideIcon").classList.remove("ion-eye-disabled");
          document.getElementById("passwordHideIcon").classList.add("ion-eye");     
          }
    }

This way only uses basic html element manipulation.

passwordHideIcon element is a button that calls the function and uses the ionic icon for eyes and eyes disabled.

How to install the Android Q beta

The Verge:

If you’re not the kind of person who wants to unlock your phone’s bootloader, I can’t blame you. Google lets Pixel owners enroll in the beta by simply logging in with a Google account, then selecting the compatible device that they’d like to install the beta. You’ll get an over-the-air update that way, just like you normally would for stable versions of Android.

Once you click “Enroll,” you’ll eventually get an update notification on the enrolled device that a system update is ready. You may need to check for a system update in order for it to fetch the beta software, but it usually doesn’t take long for it to be ready for download. (Google says it could take 24 hours or more, but we’ve rarely had to wait that long. The beta hit one of our phones less than a half-hour after enrolling it.) As new Android Q developer previews come out, you’ll get a notification to install them, too, as you would for any regular system update.

Alternatively, you can flash the Android Q beta to your Pixel phone. Google has provided a list of image downloads for the supported phones, but you should only take this road if you’re a developer, or if you just like to do things the hard way. Phones that are updated in this manner won’t receive over-the-air updates to upcoming beta versions, so if you want the latest Android Q features without much hassle, just enroll in the beta instead.

How to Disable Android Back Button in Ionic 1 / Angular

To disable back button in Android put one of the codes below in your app.js in the .run function.

// app.js

// Disable Back in Entire App
$ionicPlatform.registerBackButtonAction(function(){
  event.preventDefault();
}, 100);

Or Conditionally Disable Back:

// app.js

$ionicPlatform.registerBackButtonAction(function(){
  if($ionicHistory.currentStateName === 'someStateName'){
    event.preventDefault();
  }else{
    $ionicHistory.goBack();
  }
}, 100);

How To Enable Google Chrome Dark Mode

The Verge:

Chrome 73 has officially rolled out to all users today, bringing with it several new improvements, including the long-awaited dark mode for macOS. (“Windows support is on the way,” the release notes read.)

Dark mode was first announced for Chrome last month, but today’s release has made it official. It works pretty much as you’d expect: if dark mode is enabled on your computer, Chrome will automatically theme itself appropriately to match, in what essentially looks like the browser’s regular darker Incognito Mode menu bars. (Incognito Mode while using dark mode on Chrome looks virtually identical, save for a new icon in the menu bar.)

It’s technically not the first time Chrome has offered dark or themed options — Google has offered themes for Chrome (including dark mode-esque styles) in the Chrome Web Store for a while, but today’s update makes it more official on a system level. So, instead of having to switch back and forth manually, Chrome will simply just respect whatever your native settings are.

You can install Dark Mode by going to the Google Chrome Theme.

Ionic Slider Input Doesn’t Work in Popups on iOS

The issue seems to be in the modal.js file of the ionic library

https://github.com/driftyco/ionic/blob/1.x/js/angular/service/modal.js#L194

The temporary fix:

var isInScroll = ionic.DomUtil.getParentOrSelfWithClass(e.target, 'scroll');
if (isInScroll !== null && !isInScroll) {
    e.preventDefault();
}

Another possible solution is to add the class=”scroll” to your input element that is of type range.

Link to the github issue.

How To Build Production and Release Version of Ionic App

To make the production and release version of Android app using Ionic run:

ionic cordova build ios --prod --release

This should run the same as the expanded version:

ionic cordova build ios --minifycss --optimizejs --minifyjs --release

You may need to run with sudo in front of the command if you have permission issues.

For iOS builds the –release flag does not seem to do anything in my testing. I could not find any official documentation explaining what this flag does to iOS builds.

For more detail visit the ionic documentation on building
https://ionicframework.com/docs/cli/commands/cordova-build

JS Infinite Alert Prank Code gets Japanese Girl in Serious Trouble

Ars Technica Reporting:

Explaining her actions, the girl said that she’d run into such pranks herself and thought it would be funny if someone clicked the link.

The Twitter user referenced in the message, 0_Infinity_, has a protected account, but the user left a message in their bio field suggesting that they don’t understand why there’s so much fuss about the script today, as it was written in 2014.

To protest the actions of the Japanese police and the absurdity of calling this act a crime, Tokyo developer Kimikazu Kato has published on GitHub a project called Let’s Get Arrested. Forking the project and then creating a branch named gh-pages will create a simple GitHub-hosted website that contains nothing but the infinitely looped alert, putting criminality at our fingertips.

for ( ; ; ) {
    window.alert(" ∧_∧ ババババ\n( ・ω・)=つ≡つ\n(っ ≡つ=つ\n`/  )\n(ノΠU\n何回閉じても無駄ですよ~ww\nm9(^Д^)プギャー!!\n byソル (@0_Infinity_)")
}

Calling her a criminal is totally absurd.