Giter VIP home page Giter VIP logo

Comments (9)

jimyhuang avatar jimyhuang commented on July 25, 2024

如果是在ethercalc中標註,這個link是要open new window,是否合適?
判斷難免有例外

from hackfoldr.

clkao avatar clkao commented on July 25, 2024

good idea! we can put that info in the 3rd column (options), which is already being parsed as json

from hackfoldr.

jimyhuang avatar jimyhuang commented on July 25, 2024

據clkao說在這裡
https://github.com/hackfoldr/hackfoldr/blob/master/app/app/controllers.ls#L25

from hackfoldr.

jimyhuang avatar jimyhuang commented on July 25, 2024

first try of livescript...
example sheet: https://ethercalc.org/hackfoldr

diff --git a/app/app/controllers.ls b/app/app/controllers.ls
index 6326fe9..862f7dc 100644
--- a/app/app/controllers.ls
+++ b/app/app/controllers.ls
@@ -23,7 +23,11 @@ angular.module 'app.controllers' <[ui.state]>
     docs: HackFolder.docs
     tree: HackFolder.tree
     godoc: (doc) ->
-      $scope.go "/#{ $scope.hackId }/#{ decodeURIComponent doc.id }"
+      if doc.opts?target == '_blank'
+        window.open doc.url, doc.id
+        return true
+      else
+        $scope.go "/#{ $scope.hackId }/#{ decodeURIComponent doc.id }"
     open: (doc) ->
       window.open doc.url, doc.id
       return false

from hackfoldr.

clkao avatar clkao commented on July 25, 2024

@jimyhuang is now project owner, please commit if this works ;)

from hackfoldr.

jimyhuang avatar jimyhuang commented on July 25, 2024

是能work
但clkao,你確定我寫的對嗎 XD
對的話我就commit進去

from hackfoldr.

clkao avatar clkao commented on July 25, 2024

looks fine to me. we can add some common sites (facebook, github) check in the if as well ;)

from hackfoldr.

jimyhuang avatar jimyhuang commented on July 25, 2024

yep .. trying...

from hackfoldr.

jimyhuang avatar jimyhuang commented on July 25, 2024

fixed~~

from hackfoldr.

Related Issues (20)

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.