-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* v * Update satolist.js * v * v * Update package.json
- Loading branch information
1 parent
f7c5815
commit b2279f1
Showing
21 changed files
with
322 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#miniapps { | ||
width: 100%; | ||
} | ||
#miniapps .miniapp { | ||
cursor: pointer; | ||
padding: 0.5em 0.75em; | ||
width: 100%; | ||
background: rgb(var(--background-secondary-theme)); | ||
} | ||
#miniapps .miniapp .appimage { | ||
aspect-ratio: 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
var miniapps = (function(){ | ||
|
||
var self = new nModule(); | ||
|
||
var essenses = {}; | ||
|
||
var Essense = function(p){ | ||
|
||
var primary = deep(p, 'history'); | ||
|
||
var el, ed; | ||
|
||
var actions = { | ||
|
||
} | ||
|
||
var events = { | ||
|
||
} | ||
|
||
var renders = { | ||
miniapps : function(){ | ||
var apps = self.app.apps.get.forminiapps() | ||
|
||
self.shell({ | ||
name : 'apps', | ||
data : { | ||
apps | ||
}, | ||
|
||
el : el.c | ||
|
||
}, function(_p){ | ||
if(clbk) clbk() | ||
}) | ||
} | ||
} | ||
|
||
var state = { | ||
save : function(){ | ||
|
||
}, | ||
load : function(){ | ||
|
||
} | ||
} | ||
|
||
var initEvents = function(){ | ||
|
||
self.app.apps.on('installed', renders.miniapps) | ||
self.app.apps.on('removed', renders.miniapps) | ||
self.app.apps.on('loaded', renders.miniapps) | ||
} | ||
|
||
return { | ||
primary : primary, | ||
|
||
getdata : function(clbk, p){ | ||
|
||
|
||
ed = p.settings.essenseData | ||
|
||
var data = { | ||
ed | ||
}; | ||
|
||
|
||
pretry(() => { | ||
return self.app.apps.inited | ||
}, 100, 15000).then(() => { | ||
var apps = self.app.apps.get.forminiapps() | ||
|
||
data.apps = apps | ||
|
||
|
||
clbk(data); | ||
}) | ||
|
||
|
||
|
||
}, | ||
|
||
destroy : function(){ | ||
ed = {} | ||
el = {}; | ||
|
||
self.app.apps.off('installed', renders.miniapps) | ||
self.app.apps.off('removed', renders.miniapps) | ||
self.app.apps.off('loaded', renders.miniapps) | ||
}, | ||
|
||
init : function(p){ | ||
|
||
state.load(); | ||
|
||
el = {}; | ||
el.c = p.el.find('#' + self.map.id); | ||
|
||
initEvents(); | ||
|
||
renders.miniapps() | ||
|
||
p.clbk(null, p); | ||
} | ||
} | ||
}; | ||
|
||
|
||
|
||
self.run = function(p){ | ||
|
||
var essense = self.addEssense(essenses, Essense, p); | ||
|
||
self.init(essense, p); | ||
|
||
}; | ||
|
||
self.stop = function(){ | ||
|
||
_.each(essenses, function(essense){ | ||
|
||
window.rifticker.add(() => { | ||
essense.destroy(); | ||
}) | ||
|
||
}) | ||
|
||
} | ||
|
||
return self; | ||
})(); | ||
|
||
|
||
if(typeof module != "undefined") | ||
{ | ||
module.exports = miniapps; | ||
} | ||
else{ | ||
|
||
app.modules.miniapps = {}; | ||
app.modules.miniapps.module = miniapps; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@import "../../css/__cssvar"; | ||
|
||
#miniapps{ | ||
width: 100%; | ||
.miniapp{ | ||
cursor: pointer; | ||
padding :@rhythm 1.5 * @rhythm; | ||
width: 100%; | ||
|
||
background: rgb(var(--background-secondary-theme)); | ||
|
||
.appimage{ | ||
aspect-ratio: 1; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<% _.each(apps, function(app){ %> | ||
<a href="<%-app.url%>"> | ||
<div class="miniapp"> | ||
<div class="appimage" image="<%-app.icon%>"></div> | ||
</div> | ||
</a> | ||
<% }) %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div id="<%-module.map.id%>"> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.