def createWidget(self): self.serverToClient = [] self.hasDate = self.bone.boneStructure.get("date", True) self.hasTime = self.bone.boneStructure.get("time", True) tpl = html5.Template() # language=HTML tpl.appendChild(""" <div class='flr-wrapper'> <flare-input type="date" v-if="{{hasDate}}" class="input-group-item" [name]="dateInput"> <flare-input type="time" step="1" v-if="{{hasTime}}" class="input-group-item" [name]="timeInput"> </div> """, hasDate=self.hasDate, hasTime=self.hasTime, bindTo=self) if self.hasDate: self.serverToClient.append("%d.%m.%Y") if self.hasTime: self.serverToClient.append("%H:%M:%S") return tpl
def createWidget(self): tpl = html5.Template() #language=HTML tpl.appendChild( self.fromHTML(""" <flare-input [name]="latitude" type="number" placeholder="latitude" step="any"> <flare-input [name]="longitude" type="number" placeholer="longitute" step="any"> """)) return tpl
def createWidget(self): tpl = html5.Template() # language=HTML tpl.appendChild(""" <input [name]="widget" type="color" class="input flr-input"> <flare-button [name]="unsetBtn" text="Unset" icon="icon-cross" class="btn--delete"> """, bindTo=self) return tpl
def createWidget(self): tpl = html5.Template() #language=HTML widgetList = self.fromHTML( """<div class='flr-value--relational-wrapper'> <flare-input [name]="destWidget" class="input-group-item" readonly> <flare-button [name]="selectBtn" class="btn--select input-group-item input-group-item--last" text="Select" icon="icon-check"></flare-button> <flare-button hidden [name]="deleteBtn" class="btn--delete input-group-item" text="Delete" icon="icon-cross"></flare-button> </div> """) tpl.appendChild(widgetList,bindTo=self) return tpl
def createWidget(self): tpl = html5.Template() #language=HTML tpl.appendChild(""" <flare-input class="input-group-item" [name]="widget"> <div class="label input-group-item input-group-item--last" [name]="length" hidden>0</div> <!-- fixme: add later ... --> <div class="label" [name]="maxlength" hidden>0</div> <!-- fixme: add later ... --> """, bindTo=self) self.sinkEvent("onChange", "onKeyUp") self.timeout = None return tpl
def createWidget(self): tpl = html5.Template() self.previewImg = FilePreviewImage() self.appendChild(self.previewImg) def FileApiTest(): testDiv = html5.Div() divparamslist = dir(testDiv.element) return (("draggable" in divparamslist or ("ondragstart" in divparamslist and "ondrop" in divparamslist)) and "FormData" in dir(html5.window) and "FileReader" in dir(html5.window)) self.hasFileApi = FileApiTest() # language=html tpl.appendChild( self.fromHTML(""" <div class="flr-bone-widgets"> <div class="flr-widgets-item input-group" [name]='filerow'> <flare-input [name]="destWidget" readonly> <flare-button [name]="selectBtn" class="btn--select input-group-item--last" text="Select" icon="icon-select"></flare-button> <flare-button hidden [name]="deleteBtn" class="btn--delete" text="Delete" icon="icon-delete"></flare-button> </div> <div class="flr-widgets-item"> <div [name]="dropArea" class="supports-upload"> <flare-svg-icon value='icon-upload-file' title='Upload'> </flare-svg-icon> <label for="inplace-upload" class="flr-inplace-upload-label"><strong>Datei auswählen</strong><span [name]="dropText"> oder hierhin ziehen</span>.</label> <input id="inplace-upload" class="flr-inplace-upload" type="file" [name]="files" files selected"/> </div> <p [name]="uploadResult" style="display: none;"></p> </div> </div> """)) self.filerow.hide() if not self.hasFileApi: self.dropText.hide() else: for event in [ "onDragEnter", "onDragOver", "onDragLeave", "onDrop" ]: setattr(self.dropArea, event, getattr(self, event)) self.dropArea.sinkEvent(event) self.sinkEvent("onChange") return tpl