Changeset 14901


Ignore:
Timestamp:
05/25/12 23:57:28 (12 months ago)
Author:
ArthurClemens
Message:

Item11571: move webtopiccreator functionality to core, improve feedback; replace ids so it can be used in multiple forms on the page

Location:
branches/Release01x01/core
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • branches/Release01x01/core/data/System/WebCreateNewTopicTemplate.txt

    r12748 r14901  
    1 %META:TOPICINFO{author="ProjectContributor" date="1316812706" format="1.1" version="1"}% 
    2 %TMPL:INCLUDE{"view"}% 
    3  
    4  
    5 %TMPL:DEF{"content"}%<div class="foswikiTopicText"> 
     1%META:TOPICINFO{author="ProjectContributor" date="1337979799" format="1.1" version="1"}% 
     2%{<verbatim class="tml"> 
     3=================================================== 
     4        Create new topic template 
     5=================================================== 
     6}%%TMPL:INCLUDE{"view"}%%{ 
     7--------------------------------------------------- 
     8        content 
     9--------------------------------------------------- 
     10}%%TMPL:DEF{"content"}%<div class="foswikiTopicText"> 
    611---+ %MAKETEXT{"Create New Topic in [_1] Web" args="<nop>%BASEWEB%"}% 
    712%TMPL:P{"createform"}% 
    8 </div>%TMPL:END% 
    9  
    10  
    11 %{ do not show the following elements }% 
    12 %TMPL:DEF{"topicaction"}%%TMPL:END% 
     13</div>%TMPL:END%%{ 
     14--------------------------------------------------- 
     15        do not show the following elements 
     16--------------------------------------------------- 
     17}%%TMPL:DEF{"topicaction"}%%TMPL:END% 
    1318%TMPL:DEF{"topicinfo"}%%TMPL:END% 
    1419%TMPL:DEF{"toolbar"}%%TMPL:END% 
    1520%TMPL:DEF{"topicpathinfo"}%%TMPL:END% 
    1621%TMPL:DEF{"breadcrumb"}%%TMPL:END% 
    17 %TMPL:DEF{"top:toolbarbuttons"}%%TMPL:END% 
    18  
    19  
    20 %TMPL:DEF{"createform"}%%TMPL:P{"formstartstep"}% 
     22%TMPL:DEF{"top:toolbarbuttons"}%%TMPL:END%%{ 
     23--------------------------------------------------- 
     24        script:topictemplate 
     25--------------------------------------------------- 
     26}%%TMPL:DEF{"script:topictemplate"}%%TMPL:P{"JavascriptFiles/foswikiString"}%%TMPL:P{ 
     27        "LIBJS" 
     28        id="JavascriptFiles/foswikiStringUnicodeChars" 
     29        requires="JavascriptFiles/foswikiString" 
     30}%%TMPL:P{ 
     31        "LIBJS" 
     32        id="JavascriptFiles/foswikiWebTopicCreator" 
     33        requires="JavascriptFiles/foswikiStringUnicodeChars" 
     34}%%ADDTOZONE{"head"  
     35        tag="WebCreateNewTopicTemplate:META"  
     36        text="<noautolink><meta name='foswiki.webTopicCreator.nameFeedback' content='%MAKETEXT{"Topic will be named: "}%' /> 
     37<meta name='foswiki.webTopicCreator.errorFeedbackNoWikiName' content='%MAKETEXT{"Enter the topic name as WikiWord or check the allow non-Wiki Word box."}%' />" 
     38        requires="" 
     39}%%TMPL:END%%{ 
     40--------------------------------------------------- 
     41        createform 
     42--------------------------------------------------- 
     43}%%TMPL:DEF{"createform"}%%TMPL:P{"formstartstep"}% 
    2144%TMPL:P{"topicnamestep"}% 
    2245%TMPL:P{"topicparentstep"}% 
    2346%TMPL:P{"topictemplatestep"}% 
    2447%TMPL:P{"submitstep"}% 
    25 %TMPL:P{"formendstep"}%%TMPL:END% 
    26  
    27  
    28 %TMPL:DEF{"formstartstep"}%%TMPL:P{"formstart"}%%TMPL:END% 
    29  
    30 %TMPL:DEF{"formendstep"}%%TMPL:P{"formend"}%%TMPL:END% 
    31  
    32 %{"nonwikiword" def already wraps its content in  
    33     <p class='foswikiAllowNonWikiWord'>...</p>}% 
    34 %TMPL:DEF{"topicnamestep"}%---+++ %MAKETEXT{"Topic name:"}% 
    35 %TMPL:P{"topicname"}%%TMPL:P{"nonwikiword"}% 
    36 %TMPL:END% 
    37  
    38 %TMPL:DEF{"topicparentstep"}%---+++ %MAKETEXT{"Topic parent:"}% 
    39 <p> 
     48%TMPL:P{"formendstep"}%%TMPL:END%%{ 
     49--------------------------------------------------- 
     50        formstartstep 
     51--------------------------------------------------- 
     52}%%TMPL:DEF{"formstartstep"}%%TMPL:P{"formstart"}%<div class="foswikiFormSteps">%TMPL:END%%{ 
     53--------------------------------------------------- 
     54        formendstep 
     55--------------------------------------------------- 
     56}%%TMPL:DEF{"formendstep"}%</div>%TMPL:P{"formend"}%%TMPL:END%%{ 
     57--------------------------------------------------- 
     58        topicnamestep 
     59--------------------------------------------------- 
     60}%%TMPL:DEF{"topicnamestep"}%<div class="foswikiFormStep"> 
     61---+++ %MAKETEXT{"Topic name:"}% 
     62%TMPL:P{"topicname"}% 
     63%TMPL:P{"nonwikiword"}% 
     64</div>%TMPL:END%%{ 
     65--------------------------------------------------- 
     66        topicparentstep 
     67--------------------------------------------------- 
     68}%%TMPL:DEF{"topicparentstep"}%<div class="foswikiFormStep"> 
     69---+++ %MAKETEXT{"Topic parent:"}% 
    4070%TMPL:P{"topicparent"}% 
    41 </p>%TMPL:END% 
    42  
    43 %TMPL:DEF{"topictemplatestep"}%---+++ %MAKETEXT{"Use template:"}% 
    44 <p> 
     71</div>%TMPL:END%%{ 
     72--------------------------------------------------- 
     73        topictemplatestep 
     74--------------------------------------------------- 
     75}%%TMPL:DEF{"topictemplatestep"}%<div class="foswikiFormStep"> 
     76---+++ %MAKETEXT{"Use template:"}% 
    4577%TMPL:P{"topictemplate"}% 
    46 </p>%TMPL:END% 
    47  
    48 %TMPL:DEF{"submitstep"}%<p> 
     78</div>%TMPL:END%%{ 
     79--------------------------------------------------- 
     80        submitstep 
     81--------------------------------------------------- 
     82}%%TMPL:DEF{"submitstep"}%<div class="foswikiFormStep"> 
    4983%TMPL:P{"submit"}% 
    50 </p>%TMPL:END% 
    51  
    52  
    53 %TMPL:DEF{"formstart"}%#NewTopic 
    54 <form name="newtopicform" id="newtopicform" action="%SCRIPTURLPATH{manage}%/%BASEWEB%/" method="post"> 
     84</div>%TMPL:END%%{ 
     85--------------------------------------------------- 
     86        formstart 
     87--------------------------------------------------- 
     88}%%TMPL:DEF{"formstart"}%#NewTopic 
     89<form name="newtopicform" action="%SCRIPTURLPATH{manage}%/%BASEWEB%/" method="post"> 
    5590<input type="hidden" name="action" value="create" /> 
    56 <input type="hidden" name="onlynewtopic" value="on" />%TMPL:END% 
    57  
    58 %TMPL:DEF{"topicname"}%<input type="text" class="foswikiInputField" name="topic" id="topic" size="40" value="%IF{"defined 'newtopic'" then="%URLPARAM{"newtopic"}%" else="$percentIF{$quot $ TOPIC='WebCreateNewTopic'$quot then=$quot$quot else=$quot%TOPIC%$quot}$percent"}%" />%TMPL:END% 
    59  
    60 %TMPL:DEF{"topicparent"}%%IF{"defined pickparent" then="<select name='topicparent' size='10' class='foswikiSelect'>$percentTOPICLIST{$quot<option $marker value='$name'>$name</option>$quot marker=$quotselected=\$quotselected\$quot$quot separator=$quot$quot selection=$quot$percentURLPARAM{ $quottopicparent$quot default=$quot%MAKETEXT{"(no parent, orphaned topic)"}%$quot }$percent$quot}$percent<option value=$quot$quot>$percentMAKETEXT{$quot(no parent, orphaned topic)$quot}$percent</option></select>" else="<input type='text' size='40' name='topicparent' class='foswikiInputField' value='%URLPARAM{topicparent}%' />&nbsp;<span class='foswikiUnvisited'><a id='pickparent' href='$percentSCRIPTURLPATH{view}$percent/$percentBASEWEB$percent/$percentBASETOPIC$percent?pickparent=1;$percentQUERYSTRING$percent;#NewTopic'>%MAKETEXT{"Pick from a list"}%</a></span>"}%%TMPL:END% 
    61  
    62 %TMPL:DEF{"topictemplate"}%<select name="templatetopic" class="foswikiSelect">%IF{"'%URLPARAM{"templatetopic"}%'" then='<option selected="selected">%URLPARAM{"templatetopic"}%</option>'}%<option value="">%MAKETEXT{"Default template"}%</option>%SEARCH{"name~'*Template'" scope="topic" topic="*Template" web="%BASEWEB%" excludetopic="*EditTemplate,*WebCreateNewTopicTemplate,*ViewTemplate" type="query" nonoise="on" format="<option value=\"$web.$topic\">$topic</option>"}%</select>%SEARCH{"name~'*Template'" scope="topic" topic="*Template" web="%BASEWEB%" limit="1" excludetopic="WebTopicEditTemplate,*WebCreateNewTopicTemplate,*ViewTemplate" type="query" nonoise="on" format=" <span class='foswikiUnvisited'><a id='viewtemplates' href='%SCRIPTURL{view}%/%SYSTEMWEB%/WebTemplateTopics?web=%BASEWEB%'>%MAKETEXT{"View templates"}%</a></span>"}% %TMPL:END% 
    63  
    64 %TMPL:DEF{"submit"}%<input id="submit" type="submit" class="foswikiSubmit" value='%MAKETEXT{"Create this topic"}%' />%TMPL:END% 
    65  
    66 %TMPL:DEF{"formend"}%</form>%TMPL:END% 
     91<input type="hidden" name="onlynewtopic" value="on" />%TMPL:END%%{ 
     92--------------------------------------------------- 
     93        topicname 
     94--------------------------------------------------- 
     95}%%TMPL:DEF{"topicname"}%<p><input type="text" class="foswikiInputField" name="topic" size="40" value="%IF{"defined 'newtopic'" then="%URLPARAM{"newtopic"}%" else="$percentIF{$quot $ TOPIC='WebCreateNewTopic'$quot then=$quot$quot else=$quot%TOPIC%$quot}$percent"}%" /> <span class="webTopicCreatorFeedback foswikiGrayText"><!--generated name will be put here--></span></p>%TMPL:END%%{ 
     96--------------------------------------------------- 
     97        topicparent 
     98--------------------------------------------------- 
     99}%%TMPL:DEF{"topicparent"}%<p><input type='text' size='40' name='topicparent' class='foswikiInputField' value='%URLPARAM{topicparent}%' />&nbsp;<span class='foswikiUnvisited'><a href='#' class='pickparent'>%MAKETEXT{"Pick from a list"}%</a> <img src='%ICONURLPATH{"processing-bg"}%' alt='' class='foswikiHidden processing' /></span></p>%TMPL:END%%{ 
     100--------------------------------------------------- 
     101        topictemplate 
     102--------------------------------------------------- 
     103}%%TMPL:DEF{"topictemplate"}%<p><select name="templatetopic" class="foswikiSelect">%IF{"'%URLPARAM{"templatetopic"}%'" then='<option selected="selected">%URLPARAM{"templatetopic"}%</option>'}%<option value="">%MAKETEXT{"Default template"}%</option>%SEARCH{"name~'*Template'" scope="topic" topic="*Template" web="%BASEWEB%" excludetopic="*EditTemplate,*WebCreateNewTopicTemplate,*ViewTemplate" type="query" nonoise="on" format="<option value=\"$web.$topic\">$topic</option>"}%</select>%SEARCH{"name~'*Template'" scope="topic" topic="*Template" web="%BASEWEB%" limit="1" excludetopic="WebTopicEditTemplate,*WebCreateNewTopicTemplate,*ViewTemplate" type="query" nonoise="on" format=" <span class='foswikiUnvisited'>%POPUPWINDOW{ 
     104url="%SCRIPTURL{view}%/%SYSTEMWEB%/WebTemplateTopics?web=%BASEWEB%;template=viewplain" 
     105template="viewplain" 
     106toolbar="1" 
     107label="%MAKETEXT{"View templates"}%" 
     108}%</span>"}%</p>%JQREQUIRE{"popupwindow"}%%TMPL:END%%{ 
     109--------------------------------------------------- 
     110        submit 
     111--------------------------------------------------- 
     112}%%TMPL:DEF{"submit"}%<p class="webTopicCreatorError foswikiGrayText"><!--generated name will be put here--></p> 
     113<p><input type="submit" class="foswikiSubmit" value='%MAKETEXT{"Create this topic"}%' /></p>%TMPL:END%%{ 
     114--------------------------------------------------- 
     115        formend 
     116--------------------------------------------------- 
     117}%%TMPL:DEF{"formend"}%</form>%TMPL:END%%{ 
     118=================================================== 
     119</verbatim>}% 
  • branches/Release01x01/core/lib/Foswiki/Contrib/core/MANIFEST

    r14698 r14901  
    136136data/System/ObjectMethod.txt 0644 
    137137data/System/PageCaching.txt 0644 
     138data/System/ParentList.txt 0644 
    138139data/System/PerlDoc.txt 0644 
    139140data/System/PlainSkin.txt 0644 
     
    907908pub/System/JavascriptFiles/foswikiStyles.js.gz 0644 
    908909pub/System/JavascriptFiles/foswikiStyles_src.js 0644 
     910pub/System/JavascriptFiles/foswikiWebTopicCreator.js 0644 
     911pub/System/JavascriptFiles/foswikiWebTopicCreator.js.gz 0644 
     912pub/System/JavascriptFiles/foswikiWebTopicCreator_src.js 0644 
    909913pub/System/JavascriptFiles/foswikiWindow.js 0644 
    910914pub/System/JavascriptFiles/foswikiWindow.js.gz 0644 
Note: See TracChangeset for help on using the changeset viewer.