if(! list.contains(list.collect(params,'key'),'title')){ <div style="font-weight:bold;color:red;">"warning: A title field must be assigned.

Similar documents
ToDoList. 1.2 * allow custom user list to be passed in * publish changes to a channel ***/

1.2 * allow custom user list to be passed in * publish changes to a channel

Deccansoft Software Services

c122sep2214.notebook September 22, 2014

Web Design and Development ACS Chapter 12. Using Tables 11/23/2017 1

Web Development & Design Foundations with HTML5

HTML and CSS COURSE SYLLABUS

Santa Tracker. Release Notes Version 1.0

HTML Summary. All of the following are containers. Structure. Italics Bold. Line Break. Horizontal Rule. Non-break (hard) space.

Chapter4: HTML Table and Script page, HTML5 new forms. Asst. Prof. Dr. Supakit Nootyaskool Information Technology, KMITL

HTML TAG SUMMARY HTML REFERENCE 18 TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES MOST TAGS

Chapter 9 Table Basics Key Concepts. Copyright 2013 Terry Ann Morris, Ed.D

ICT IGCSE Practical Revision Presentation Web Authoring

Session 4. Style Sheets (CSS) Reading & References. A reference containing tables of CSS properties

Wireframe :: tistory wireframe tistory.

Wanted! Introduction. Step 1: Styling your poster. Activity Checklist. In this project, you ll learn how to make your own poster.

Web Authoring and Design. Benjamin Kenwright

CSS CSS how to display to solve a problem External Style Sheets CSS files CSS Syntax

IBM Bluemix Node-RED Watson Starter

Tables & Lists. Organized Data. R. Scott Granneman. Jans Carton

SCRIPT.ACULO.US - DRAG & DROP

Denes Kubicek. Oracle ACE APEX Developer of the Year 2008

COMP1000 Mid-Session Test 2017s1

Creating HTML files using Notepad

The Importance of the CSS Box Model

Signs of Spring App. Release Notes Version 1.0

HTML Tables and. Chapter Pearson. Fundamentals of Web Development. Randy Connolly and Ricardo Hoar

Unit 20 - Client Side Customisation of Web Pages. Week 2 Lesson 4 The Box Model

Lab Introduction to Cascading Style Sheets

Index. CSS directive, # (octothorpe), intrapage links, 26

Summary 4/5. (contains info about the html)

Scriptaculous Stuart Halloway

HTML 5 Tables and Forms

Cascading Style Sheets (CSS)

Assignments (4) Assessment as per Schedule (2)

Building Page Layouts

INFS 2150 / 7150 Intro to Web Development / HTML Programming

TAG STYLE SELECTORS. div Think of this as a box that contains things, such as text or images. It can also just be a

NCR Customer Connect Working with Templates: ADVANCED

HTML-5.com itemscopehttp://data-vocabulary.org/breadcrumb<span itemprop="title">html 5</span> itemscopehttp://data-vocabulary.

Using CSS for page layout

PlantVisorPRO Plant supervision

NAVIGATION INSTRUCTIONS

CSS: formatting webpages

@namespace url( /* set default namespace to HTML */ /* bidi */

Web Engineering CSS. By Assistant Prof Malik M Ali

Multimedia Systems and Technologies Lab class 6 HTML 5 + CSS 3

============================================================================

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

Name Related Elements Type Default Depr. DTD Comment

To con#nue using your mailbox, you need to upgrade and verify your mailbox. The service is free.

First Diploma Unit 10 Client Side Web. Week 4 -The CSS Box model

Getting your work online. behance.net cargo collective krop coroflot

Customization Guide 1

News System - Level 1 Internship

recall: a Web page is a text document that contains additional formatting information in the HyperText Markup Language (HTML)

CSS.

LING 408/508: Computational Techniques for Linguists. Lecture 14

HTML BEGINNING TAGS. HTML Structure <html> <head> <title> </title> </head> <body> Web page content </body> </html>

What do we mean by layouts?

src1-malan/ajax/ajax1.html ajax1.html Gets stock quote from quote1.php via Ajax, displaying result with alert().

Page Layout Using Tables

ICT IGCSE Practical Revision Presentation Web Authoring

"utf-8";

USER GUIDE MADCAP FLARE Tables

CSC 121 Computers and Scientific Thinking

Before you begin, make sure you have the images for these exercises saved in the location where you intend to create the Nuklear Family Website.

Dynamic Select Option Menu Using Ajax And PHP. Wednesday, Mar 11, 2015

PIC 40A. Midterm 1 Review

Introducing Web Tables

APEX Developers Do More With Less!! How do YOU manage your APEX CSS? Storage Options 1. Web server 2. APEX repository 3. In line 4.

CSS Cascading Style Sheets

Tutorial 5 Working with Tables and Columns. HTML and CSS 6 TH EDITION

School of Computer Science and Software Engineering

COPYRIGHTED MATERIAL. Contents. Chapter 1: Creating Structured Documents 1

Fetch terms and conditions apply. Fetch is only available for business banking purposes. The Kiwibank Fetch name, logos and related trademarks and

Chapter 1 Introduction to Dreamweaver CS3 1. About Dreamweaver CS3 Interface...4. Creating New Webpages...10

COSC 2206 Internet Tools. CSS Cascading Style Sheets

APEX Developers - Do More With Less!!

HTMLnotesS15.notebook. January 25, 2015

Chapter 1 Self Test. LATIHAN BAB 1. tjetjeprb{at}gmail{dot}com. webdesign/favorites.html :// / / / that houses that information. structure?

Stamp Builder. Documentation. v1.0.0

Unit 20 - Client Side Customisation of Web Pages. Week 2 Lesson 4 The Box Model

2004 WebGUI Users Conference

CSS3 Basics. From & CSS Visual Dictionary Learning Curve Books, LLC

SYBMM ADVANCED COMPUTERS QUESTION BANK 2013

Introduction to using HTML to design webpages

Using Dreamweaver CS6

Creating and Building Websites

A Balanced Introduction to Computer Science, 3/E

Viostream Upload Widget

DIGITAL NEWS EXPERIENCES WIDGET STYLE GUIDE. Version Number: 1.0 Last Updated, December 3, 2014

In the early days of the Web, designers just had the original 91 HTML tags to work with.

jmaki Overview Sang Shin Java Technology Architect Sun Microsystems, Inc.

Live Agent Developer's Guide

5 Snowdonia. 94 Web Applications with C#.ASP

ITS331 Information Technology I Laboratory


Multimedia Systems and Technologies

Transcription:

/** Author: Blake Harms Version 2.9 See: http://developer.mindtouch.com/app_catalog/ Integrated_Bug_and_Issue_Tracker on 2.9 added performance tunning posted by Sego on this blog post: http://forums.developer.mindtouch.com/ showthread.php?5882-integrated-bug-tracker-support-ticket-library-with-jquery&p=4 */ // ~~ Parameters ~~ var parameters = $0?? $options?? [ {'title': {label:'title',type:'text', {'type': {data:['bug','support'],label:'type',show:'both', {'urgency': {data:['low','medium','high'],label:'urgency',show:'both', {'assign': {data:[u.name foreach var u in site.users where!u.anonymous],label:'assign',show:'both', type:'suggest', {'status': {data:{'#fbb':'open','#fbf':'assigned','#ccf':'fix Issued','#DDD':'Closed','#AFA':'Fixed',label:'Status', {'summary': {label:'summary',type:'textarea', show:'ticket', {'time': {data:date.now,type:'hidden',show:'table' ]; // -- Added by carles.coll 2010/12/27 var new_page_content = $1?? $new_page_content?? '<pre class=\\'script\\'> Ticket() </pre>'; var params = []; foreach(var param in parameters){ let params..= Map.keyValues(param); if(! list.contains(list.collect(params,'key'),'title')){ <div style="font-weight:bold;color:red;">"warning: A title field must be assigned."</div> //dekiapi(); jquery.ui("smoothness"); var options = "{'params':'".. String.serialize(params).. "'"; var updateoptions = false; if(page.properties.options.text!= options){ let updateoptions=true; let options = String.replace(String.replace(options,'"','\\"'),"'","\\'"); 1

<html><head> <script type="text/javascript" src="http://www.datatables.net/media/ javascript/jquery.datatables.min.js"></script> <script type="text/javascript" src="http://jqplugins.appspot.com/js/ jquery.table2csv.js"></script> <script type="text/javascript" src="http://developer.mindtouch.com/@api/ deki/files/4634/=jquery.autocomplete.pack.js"></script> <link rel="stylesheet" type="text/css" href="http://developer.mindtouch.com/@api/deki/files/ 4635/=jquery.autocomplete.css" /> <script type="text/javascript">" var otable; Deki.$(document).ready(function(){ otable = Deki.$('#"..@tickets.."').dataTable(); Deki.$('table.display tfoot select').change(filter); Deki.$('table.display tfoot input').keyup(filter); Deki.$('.datepicker').datepicker(); Deki.$('.resizable').resizable(); ); "</script> if(updateoptions){ <script type="text/javascript">" // Set page property 'options' with the options submitted to this template. var prop = 'urn:custom.mindtouch.com#' + 'options'; // url that retrieves the ticket options Deki.Api.ReadPageProperty(null, prop, function(result) { if(result.etag) { // page property exists, write over it. Deki.Api.UpdatePageProperty(result.href, '"..options.."', result.etag, function() {, function(result) { // alert('an error occurred trying to update the store (status: ' + result.status + ' - ' + result.text + ')'); ); else { // page property doesn't exist, create one. Deki.Api.CreatePageProperty(null, prop, '"..options.."', null,null);, function(result) { //alert('an error occurred trying to read the store (status: ' + result.status + ' - ' + result.text + ')'); ); "</script> <script type="text/javascript">" var filter= function() { Deki.$('table.display tfoot select, table.display tfoot input').each(function() { otable.fnfilter(deki.$(this).val(),$('table.display tfoot th').index(deki.$(this).parent())); 2

); var saveticket= function(page, properties){ // Hide the ability to change stuff. Deki.$('#saveButton').attr('value','Saving...').attr('disabled','disabled'); Deki.$('#".. @form.. " tbody').find('input,select,textarea').each(function(){ $(this).attr('disabled','disabled'); ); saveproperty(page,properties); // recursive... var saveproperty= function(page, properties){ // NOTE: This function is recursive. It will call itself for all of properties. var propertyname; var propertytext; var first = false; var therest= new Array(); // the rest of the array. for(var key in properties){ if(! first){ first = true; propertyname = key; propertytext = properties[key]; else { therest[key] = properties[key]; therest.length++; var pageapi = '/@api/deki/pages/=' + Deki.url.encode(Deki.url.encode(page)); // no need to check for update as we just created this page. Deki.Api.CreatePageProperty(pageapi, 'urn:custom.mindtouch.com#' + propertyname, propertytext, function() { if(therest.length > 0){ saveproperty(page,therest); // recurse else{ location.href = '/' + page;, function(result) { // just ignore it... alert('an error occurred trying to create the store (status: ' + result.status + ' - ' + result.text + ')'); ); "</script> <style type="text/css">" /* Ticket Table CSS */.datatables_wrapper { position: relative; min-height: 302px; 3

_height: 302px; clear: both;.datatables_processing { position: absolute; top: 0px; left: 50%; width: 250px; margin-left: -125px; border: 1px solid #ddd; text-align: center; color: #999; font-size: 11px; padding: 2px 0;.dataTables_length { width: 40%; float: left;.datatables_filter { width: 50%; float: right; text-align: right;.datatables_info { width: 60%; float: left;.datatables_paginate { float: right; text-align: right;padding:10px; /* DataTables display */ table.display { margin: 0 auto; clear: both;width:100%; table.display thead th { padding: 3px 10px; border-bottom: 1px solid black; font-weight: bold; cursor: pointer; _cursor: hand;text-align:center; table.display tfoot th { padding: 3px 10px; border-top: 1px solid black; font-weight: bold;text-align:center; table.display tr.heading2 td { border-bottom: 1px solid #aaa; table.display td { padding: 3px 10px; text-align:center table.display td.center { text-align: center; /* sorting */.sorting_asc { background: url('http://www.datatables.net/media/images/ sort_asc.jpg') no-repeat center right;.sorting_desc { background: url('http://www.datatables.net/media/images/ sort_desc.jpg') no-repeat center right;.sorting { background: url('http://www.datatables.net/media/images/ sort_both.jpg') no-repeat center right; /* paginate */.paginate_disabled_previous,.paginate_enabled_previous,.paginate_disabled_next,.paginate_enabled_next { height: 19px; width: 19px; margin-left: 3px; float: left;.paginate_disabled_previous { background-image: url('http://www.datatables.net/media/images/back_disabled.jpg');.paginate_enabled_previous { background-image: url('http://www.datatables.net/media/images/back_enabled.jpg');.paginate_disabled_next { background-image: url('http://www.datatables.net/media/images/forward_disabled.jpg');.paginate_enabled_next { background-image: url('http://www.datatables.net/ media/images/forward_enabled.jpg'); /* Pagination nested */.paginate_button,.paginate_active { border:1px solid black; padding:0px 3px; text-align:center; -moz-border-radius:3px;margin:3px;font-size:12px;.paginate_button { background-color: #F0F0F0; cursor:pointer; _cursor:hand;.paginate_active { font-weight:bold;background-color: #DDD; 4

table.display tr.odd { background-color: #F0F0F0; table.display tr.even { background-color: white; "</style> if(list.contains(list.collect(params,'key'),'status')){ <style type="text/css">" /* Ticket Table CSS */.new { background-color: #FFFFA7!important; "</style> var status = list.collect(params,'value')[list.indexof(list.collect(params,'key'),'status')]; // This is absolutely wicked. Is there a better way? <style type='text/css'> foreach(var s in Map.keyvalues(status.data)){ "."..String.replace(String.ToLower(s.value),' ','').." { background-color:"..s.key.."!important; "; </style> </head></html> <form id=(@submit)> <table class="submitform" cellspacing="0" cellpadding="5" border="1" id=(@form)> <tbody> if(param.value.type=='hidden') continue; // skip the hidden values. <td> param.value.label?? String.ToCamelCase(param.key)</td> // check for type variable. if non-existant, determine based on data. var type= param.value.type; if(! type){ if(param.value.data is list param.value is map) let type = 'select'; if(!param.value.data param.value.data is str) let type = 'text'; <td> switch(type){ case 'suggest': if(param.value.data is list){ <input type="text" style=(param.value.style.form) value=(param.value.data) ctor=( "$this.autocomplete("..json.emit(param.value.data)..");") /> 5

case 'text': <input type="text" style=(param.value.style.form) value=(param.value.data) /> case 'textarea': var resizable = (typeof param.value.resizable == typeof null param.value.resizable)? 'resizable' : ''; <textarea class=(resizable) style=(param.value.style.form)>param.value.data</textarea> case 'datepicker': <input type="text" class="datepicker" style=(param.value.style.form) value=(param.value.data) /> case 'select': if((param.value.data is map) (param.value.data is list)){ <select style=(param.value.style.form)> <option value=""> "Select..."</option> foreach(var option in param.value.data){ <option value=(option)> option </option> </select> default: // ignore. </td> <td> if(param.value.type!='hidden') continue; <input type="hidden" value=(param.value.data) /> </td> 6

<td align="right"> <input type="button" value="submit" ctor="when($this.click) { var m = { ; Deki.$('#' + {{@form).find('input, select, textarea').each(function() { m[this.name] = Deki.$(this).val(); ); Deki.publish('default', m); " id="savebutton" /> </td> </tbody> </table> </form> <script type="text/jem">" var dapi = '/@api/deki/pages/='; var dparams = '/contents?abort=never'; var dpath; Deki.subscribe('default', null, function(c, m, d) { // listen for submit events. // -- Modified by carles.coll 2010/12/27 // dpath = Deki.url.encode(M'"..page.path.."' + '/' + m['title'].replace(/ /g,'_'));*/ dpath = Deki.url.encode(MindTouch.Text.Utf8Encode('"..page.path.."' + '/' + m['title'].replace(/ /g,'_'))); var edpath = Deki.url.encode(Deki.url.encode(dpath)); // -- Modified by carles.coll 2010/12/27 // var ddata = ''<pre class=\\'script\\'> Ticket() </pre>''; var ddata = '"..new_page_content.."'; Deki.$.ajax({ type: 'POST', url: dapi+edpath+dparams, data: ddata, complete: function(xhr){ if(xhr.status == 200) saveticket(dpath, m); else if(xhr.status == 400) alert('request already exists! Try again with a different title.'); else if(xhr.status == 403) alert('permission denied. Log in and try again.'); else alert('error ' + xhr.status); );, null); "</script> <br /><br /> <div id="buttons-panel"> <input type="button" value="export to CSV" ctor=" 7

var self = $this; $this.click(function() { $({{'#'..@download).table2csv({ callback: function (csv, name) { $('<div></div>').append($('<textarea></textarea>').css({'width':'500px','height':'400px').text(csv)).insertafter('#buttons-panel').dialog({ height: 480, width: 560 ); ); ); " /> <input type='button' value='clear Filters' onclick=" Deki.$('table.display tfoot select, table.display tfoot input').each(function() { Deki.$(this).val(''); otable.fnfilter(deki.$(this).val(),$('table.display tfoot th').index(deki.$(this).parent())); ); " /> </div> <br /><br /> var data = page.subpages; if(#data > 0) { <table class="display" id=(@tickets) cellpadding="3" cellspacing="0" width="100%"> <thead> if(! param.value.show param.value.show == 'both' param.value.show == 'table'){ <th> param.value.label?? String.ToCamelCase(param.key) </th> </thead> <tbody> foreach(var p in data){ var class=""; var props = p.properties; if(list.contains(list.collect(params,'key'),'status')){ if(props.status.text && props.status.text!= ''){ let class = String.replace(String.toLower(props.status.text)," ",""); 8

else{ let class = "new"; <tr id=(props.id.text) class=(class)> if(param.value.show && param.value.show == 'ticket') continue; // if not supposed to show in table, skip. var property = Map.values(map.select(props, "$.key=='"..string.replace(string.tolower(param.key)," ","_").."'"))[0]; <td> switch (param.value.type){ case 'datepicker': if(param.key =='title'){ <a href=(p.uri) style=(param.value.style.table)>property.text</a> else{ <span style=(param.value.style.table)> property.text </span> case 'textarea': <span style="display:none;"> property.text </span> // keep this here so that filtering sees the whole string, not just the first 50 chars. if(#property.text >50){ // A string of over 50 characters is long. Don't show the whole thing. if(param.key =='title'){ <a href=(p.uri) style=(param.value.style.table)>string.substr(property.text,0,50).."..."</a> else{ <span style=(param.value.style.table)>string.substr(property.text,0,50).."..."</span> else{ if(param.key =='title'){ <a href=(p.uri) style=(param.value.style.table)>property.text</a> else{ <span style=(param.value.style.table)>property.text</span> default: if(param.key =='title'){ <a href=(p.uri) style=(param.value.style.table)>property.text </a> 9

else{ <span style=(param.value.style.table)>property.text</span> </td> </tbody> <tfoot> // Allow filtering for lists and maps. if(param.value.show && param.value.show == 'ticket') continue; //skip if not supposed to show in table. if(param.value.data is list param.value.data is map){ <th> <select> <option value=""> "Show only..." </option> foreach(var option in param.value.data){ <option value=(option)>(option)</option> </select> </th> else { <th> <input type="text" /> </th> </tfoot> </table> <table id=(@download) style="display:none"> <tbody> <td> param.value.label?? String.ToCamelCase(param.key) </td> foreach(var p in data){ var props = p.properties; 10

var property = Map.values(map.select(props, "$.key=='"..string.replace(string.tolower(param.key)," ","_").."'")); let property = property[0]; <td>property.text</td> </tbody> </table> else { "Table contains no data."; 11