Coder Social home page Coder Social logo

shijiezhou1 / ember-blog Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 15.91 MB

๐Ÿ– Blogger page for portfolio because it was made with emberjs

Home Page: https://shijiezhou1.github.io/ember-blog/

License: MIT License

JavaScript 70.17% HTML 4.03% SCSS 6.61% Handlebars 19.19%
ember ember-inspector ember-cli chrome javascript emberjs ember-engines ember-data

ember-blog's Introduction

Ember-Blog

ci-ember-demo

Build status CircleCI Maintainability Test Coverage Build Status License Coverage Status

demo: https://bloging.netlify.com/ or: https://shijiezhou1.github.io/Ember-Blog/

TL;DR;

This README outlines the details of collaborating on this Ember application. A short introduction of this app could easily go here.

Prerequisites

You will need the following things properly installed on your computer.

Installation

  • git clone <repository-url> this repository
  • cd ember-blog
  • npm install

notes - docker :

  • docker pull danlynn/ember-cli

Running / Development

Code Generators

Make use of the many generators for code, try ember help generate for more details

Running Tests

  • ember test
  • ember test --server

Linting

  • npm run lint:hbs
  • npm run lint:js
  • npm run lint:js -- --fix

Building

  • ember build (development)
  • ember build --environment production (production)

Deploying

Specify what it takes to deploy your app.

Further Reading / Useful Links

Ember Component Life Cycles

Touch
touchStart()
touchMove()
touchEnd()
touchCancel()
Keyboard
events

keyDown()
keyUp()
keyPress()
Mouse
events

mouseDown()
mouseUp()
contextMenu()
click()
doubleClick()
mouseMove()
focusIn()
focusOut()
mouseEnter()
mouseLeave()
Form
submit()
change()
focusIn()
focusOut()
input()
HTML5
drag
and
drop
dragStart()
drag()
dragEnter()
dragLeave()
dragOver()
dragEnd()
drop()
import Component from "@ember/component"

export default Component.extend({
  // on initial Render

  init() {
    this._super(...arguments)
  },

  didUpdateAttrs() {
    this._super(...arguments)
  },

  willRender() {},

  didInsertElement() {},

  didRender() {},

  // ON Re-render

  didUpdateAttrs() {},

  didReceiveAttrs() {},

  willUpdate() {},

  willRender() {},

  didUpdate() {},

  didRender() {},

  // On Component Destory

  willDestroyElement() {},

  willClearRender() {},

  didDestoryElement() {},

  actions: {
    required(event) {},
  },
})

Controller Lifecycle hook

import Ember from 'ember';

// Ember 1.10

export default Ember.Route.extend({

    //---fire in order on route enter---

    beforeModel(transition) {
    //empty by default
    //Primarily for redirecting before the model is fetched
    },

    model(params, transition) {
    //empty by default
    // fetch the model from server here
    // return a model
    },

    afterModel(model, transition) {
    //empty by default
    //accepts model for optional model setup
    },

    serialize(model, params) {
    //has default behavior that serializes parameter out of passed model
    //works perfectly if naming scheme is followed. More on this later.
    //override to implement custom behavior
    return {paramName: paramValue};
    }

    redirect(model, transition) {
    //empty by default
    // almost identical to afterModel
    //but route is now considered active
    },

    activate() {
    // empty by default
    // used for optional setup after all model hooks
    },

    setupController(controller, model) {
    //default implmentation sets model as property on controller
    //must keep default behavior an optionally do more controller setup

    controller.set('model', model);
    },

    renderTemplate(controller, model) {
    //default implementation renders the template with the same name as the route
    //with the default controller
    // template name is passed as string
    // override the function to customize which template and controller
    // or to render mutiple templates

    this.render(this.routeName, {
    into: 'applcation',
    controller: controller,
    model: model
    });

},

//----on route exit----

resetController(controller, isExiting, transition) {
//empty by default
//fires when route changes or model is refreshed
// isExiting property true when exiting (obviously)
},

deactivate() {
//empty by default
//fires on route exit
}

});

export default Controller.extends({

  appName: '',

  actions: {
    yourmethod() {

    }
  }

})

Route Lifecylce hook

import Ember from 'ember'; // Ember 1.10
export default Ember.Route.extend({ //---fire in order on route enter---
    beforeModel(transition) {
      //empty by default
      //Primarily for redirecting before the model is fetched
    },
    model(params,transition) {
      //empty by default
      // fetch the model from server here
      // return a model
    },
    afterModel(model, transition) {
      //empty by default
      //accepts model for optional model setup
    },
    serialize(model, params) {
      //has default behavior that serializes parameter out of passed model
      //works perfectly if naming scheme is followed. More on this later.
      //override to implement custom behavior
      return {paramName: paramValue};
    }
    redirect(model, transition) {
      //empty by default
      //almost identical to afterModel
      //but route is now considered active
    },
    activate() {
      // empty by default
      // used for optional setup after all model hooks
    },
    setupController(controller, model) {
      //default implmentation sets model as property on controller
      //must keep default behavior an optionally do more controller setup
      controller.set('model',model);
    },
    renderTemplate(controller, model) {
      //default implementation renders the template with the same name as the route
      //with the default controller
      // template name is passed as string
      // override the function to customize which template and controller
      // or to render mutiple templates
      this.render(this.routeName, {
        into: 'applcation',
        controller:controller,
        model: model
      });
    }, //----on route exit----
    resetController(controller, isExiting, transition) {
      //empty by default
      //fires when route changes or model is refreshed
      // isExiting property true when exiting (obviously)
    },
    deactivate() {
      //empty by default
      //fires on route exit
    }

    });

ember-blog's People

Contributors

dependabot-preview[bot] avatar shijiezhou1 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ember-blog's Issues

everyport in use error

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

https://stackoverflow.com/questions/57535688/ember-serve-every-port-is-in-use

Refactor design.js:model

I've selected design.js:model for refactoring, which is a unit of 25 lines of code. Addressing this will make our codebase more maintainable and improve Better Code Hub's Write Short Units of Code guideline rating! ๐Ÿ‘

Here's the gist of this guideline:

  • Definition ๐Ÿ“–
    Limit the length of code units to 15 lines of code.
  • Whyโ“
    Small units are easier to analyse, test and reuse.
  • How ๐Ÿ”ง
    When writing new units, don't let them grow above 15 lines of code. When a unit grows beyond this, split it in smaller units of no longer than 15 lines.

You can find more info about this guideline in Building Maintainable Software. ๐Ÿ“–


โ„น๏ธ To know how many other refactoring candidates need addressing to get a guideline compliant, select some by clicking on the ๐Ÿ”ฒ next to them. The risk profile below the candidates signals (โœ…) when it's enough! ๐Ÿ


Good luck and happy coding! :shipit: โœจ ๐Ÿ’ฏ

fix readme

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Refactor showdown.js

I've selected showdown.js for refactoring, which is a module that has 3 instance(s) of code in comments (1, 2, 3). Addressing this will make our codebase more maintainable and improve Better Code Hub's Write Clean Code guideline rating! ๐Ÿ‘

Here's the gist of this guideline:

  • Definition ๐Ÿ“–
    Apply The Boy Scout Rule and fix "code smells" in the codebase.
  • Whyโ“
    Clean code is maintainable code.
  • How ๐Ÿ”ง
    Remove useless comments, commented code blocks, and dead code. Refactor poorly handled exceptions, magic constants, and poorly named units or variables.

You can find more info about this guideline in Building Maintainable Software. ๐Ÿ“–


โ„น๏ธ To know how many other refactoring candidates need addressing to get a guideline compliant, select some by clicking on the ๐Ÿ”ฒ next to them. The risk profile below the candidates signals (โœ…) when it's enough! ๐Ÿ


Good luck and happy coding! :shipit: โœจ ๐Ÿ’ฏ

Refactor sidebar-right.js

I've selected sidebar-right.js for refactoring, which is a module that has 2 instance(s) of code in comments (1, 2). Addressing this will make our codebase more maintainable and improve Better Code Hub's Write Clean Code guideline rating! ๐Ÿ‘

Here's the gist of this guideline:

  • Definition ๐Ÿ“–
    Apply The Boy Scout Rule and fix "code smells" in the codebase.
  • Whyโ“
    Clean code is maintainable code.
  • How ๐Ÿ”ง
    Remove useless comments, commented code blocks, and dead code. Refactor poorly handled exceptions, magic constants, and poorly named units or variables.

You can find more info about this guideline in Building Maintainable Software. ๐Ÿ“–


โ„น๏ธ To know how many other refactoring candidates need addressing to get a guideline compliant, select some by clicking on the ๐Ÿ”ฒ next to them. The risk profile below the candidates signals (โœ…) when it's enough! ๐Ÿ


Good luck and happy coding! :shipit: โœจ ๐Ÿ’ฏ

adding information about the app and setup test folders

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

getting the api to run

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.