plxdcma_modal_textlistinputsimple 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. package/css.css +0 -0
  2. package/init.js +34 -0
  3. package/js.js +42 -0
  4. package/modal.ejs +13 -0
  5. package/package.json +6 -0
package/css.css ADDED
File without changes
package/init.js ADDED
@@ -0,0 +1,34 @@
1
+ var plxdcma_standarinit=require(`plxdcma_standarinit`)
2
+ var fs=require(`fs`)
3
+ var path=require(`path`)
4
+ var myux=require(`plxdcma_myux`)
5
+ module.exports.use=function(req){
6
+ if(req.__myAppInternals.opentextlistModal == null){
7
+ myux.use(req)
8
+ req.__myAppInternals.opentextlistModal=true
9
+ if(req.__myAppInternals.paths == null){
10
+ req.__myAppInternals.paths=[]
11
+ }
12
+ req.__myAppInternals.paths.push(`<script src="/myux/modal/opentextlistModal/js.js"></script>`)
13
+ //req.__myAppInternals.paths.push(`<script src="/myux/modal/listmodality.js"></script>`)
14
+ req.__myAppInternals.paths.push(`<link rel="stylesheet" href="/myux/modal/opentextlistModal/css.css">`)
15
+ if(req.__myAppInternals.modals == null){
16
+ req.__myAppInternals.modals=[]
17
+ }
18
+ req.__myAppInternals.modals.push(path.join(__dirname,"modal.ejs"))
19
+ }
20
+ }
21
+ plxdcma_standarinit.use(function(app){
22
+ app.get(`/myux/modal/opentextlistModal/css.css`,function(req,res){
23
+ fs.readFile(path.join(__dirname,"css.css"),"utf8",function(err,html){
24
+ res.write(html)
25
+ res.end()
26
+ })
27
+ })
28
+ app.get(`/myux/modal/opentextlistModal/js.js`,function(req,res){
29
+ fs.readFile(path.join(__dirname,"js.js"),"utf8",function(err,html){
30
+ res.write(html)
31
+ res.end()
32
+ })
33
+ })
34
+ })
package/js.js ADDED
@@ -0,0 +1,42 @@
1
+ var opxmin=null
2
+ function openTextListModal(pretexts,rfunc){
3
+ opxmin=rfunc
4
+ TextsListModal.style.display="block"
5
+ oplxlistmodalcontainer.innerHTML=""
6
+ for(var each in pretexts){
7
+ var px=pretexts[each]
8
+ var pxText=document.createElement("p")
9
+ pxText.contenteditable=true
10
+ pxText.innerHTML=px
11
+ pxText.onkeyup=daKeyUp.bind({pxText:pxText})
12
+ listmodalcontainer.appendChild(pxText)
13
+ }
14
+ }
15
+ function daKeyUp(){
16
+ var t=this.pxText.innerText.trim()
17
+ if(t == ""){
18
+ this.pxText.parentNode.removeChild(this.pxText)
19
+ }
20
+ }
21
+ function procedemin2x(){
22
+ var texts=[]
23
+ for(var i = 0 ; i < oplxlistmodalcontainer.children.length;i++){
24
+ var ch=oplxlistmodalcontainer.children[i]
25
+ var tx=ch.innerText.trim("")
26
+ if(tx == ""){
27
+ continue
28
+ }
29
+ texts.push(tx)
30
+ }
31
+ opxmin(texts)
32
+ TextsListModal.style.display='none'
33
+ }
34
+ function appendtencoi(){
35
+ var value=tlinput.value
36
+ var px=document.createElement("p")
37
+ px.innerHTML=value
38
+
39
+ px.contentEditable=true
40
+ oplxlistmodalcontainer.appendChild(px)
41
+ tlinput.value=""
42
+ }
package/modal.ejs ADDED
@@ -0,0 +1,13 @@
1
+
2
+ <div id="TextsListModal" class="Modal">
3
+ <div id="" class="ModalInternalBox" style="padding:16px" >
4
+ <i onclick="TextsListModal.style.display='none'" style="float:right" class='fa fa-times'></i>
5
+
6
+ <div id="oplxlistmodalcontainer">
7
+ </div>
8
+ <input id='tlinput' placeholder="text" type="text" name="" value="">
9
+ <button onclick="appendtencoi()" class="defaultbtn" type="button" name="button">+</button>
10
+ <br/><br/><br/>
11
+ <button onclick="procedemin2x()" class="defaultbtn" type="button" name="button">Listo</button>
12
+ </div>
13
+ </div>
package/package.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "plxdcma_modal_textlistinputsimple",
3
+ "version": "1.0.0",
4
+ "main": "init.js",
5
+ "license": "MIT"
6
+ }