Skip to content

Commit

Permalink
updates for M7
Browse files Browse the repository at this point in the history
  • Loading branch information
stevewithington committed Oct 20, 2016
1 parent d870297 commit 8300950
Show file tree
Hide file tree
Showing 2 changed files with 205 additions and 195 deletions.
273 changes: 134 additions & 139 deletions display_objects/slider/configurator.cfm
Expand Up @@ -11,10 +11,15 @@
// Nivo Slider Options: http://nivo.dev7studios.com/support/jquery-plugin-usage/
$ = application.serviceFactory.getBean('MuraScope').init(session.siteid);
// Mura Scope
if ( !IsDefined('m') ) {
m = StructKeyExists(session, 'siteid')
? application.serviceFactory.getBean('MuraScope').init(session.siteid)
: application.serviceFactory.getBean('MuraScope').init('default');
}
// need to get a listing of local indexes.
rsFeeds = $.getBean('feedGateway').getFeeds(siteid=$.event('siteid'),type='Local');
rsFeeds = m.getBean('feedGateway').getFeeds(siteid=m.event('siteid'),type='Local');
// Nivo Themes
arrMuraNivoThemes = ['default','light','dark','bar'];
Expand All @@ -26,36 +31,24 @@
arrImageSizes = ['small','medium','large','custom'];
// IF MuraCMS v6.0+, there may be one or more custom predefined image sizes available
if ( ListFirst($.globalConfig('version'), '.') >= 6 ) {
rsImageSizes = $.siteConfig().getCustomImageSizeQuery();
if ( ListFirst(m.globalConfig('version'), '.') >= 6 ) {
rsImageSizes = m.siteConfig().getCustomImageSizeQuery();
arrCustomImageSizes = ListToArray(ValueList(rsImageSizes.name));
arrImageSizes.addAll(arrCustomImageSizes);
}
params = {};
if ( IsJSON($.event('params')) ) {
params = DeSerializeJSON($.event('params'));
}
param name='objectparams.feed' default='';
param name='objectparams.theme' default='default';
param name='objectparams.size' default='large';
param name='objectparams.height' default='AUTO';
param name='objectparams.width' default='AUTO';
param name='objectparams.sliderid' default=LCase(Replace(CreateUUID(), '-', '', 'ALL'));
param name='objectparams.effect' default='random';
param name='objectparams.showcaption' default=true;
param name='objectparams.pausetime' default=3;
param name='objectparams.outputslidelinks' default=true;
defaultParams = {
feed = ''
, theme = 'default'
, size = 'large'
, width = 'AUTO'
, height = 'AUTO'
, sliderid = LCase(Replace(CreateUUID(), '-', '', 'ALL'))
, effect = 'random'
, showcaption = true
, pausetime = 3
, outputslidelinks = true
};
StructAppend(params, defaultParams, false);
</cfscript>
<style type="text/css">
#availableObjectParams dt { padding-top:1.5em; }
#availableObjectParams dt.first { padding-top:0; }
</style>
<script>
jQuery('#size').change(function(){
var o = jQuery('#customOptions');
Expand All @@ -67,119 +60,121 @@
});
</script>
<cfoutput>
<div id="availableObjectParams"
data-object="plugin"
data-name="MuraNivo"
data-objectid="#$.event('objectID')#">
<dl class="singleColumn">
<!--- NIVO THEME --->
<dt class="first"><label for="size">Nivo Theme</label></dt>
<dd>
<select name="theme" id="theme" class="objectParam">
<cfloop array="#arrMuraNivoThemes#" index="theme">
<option value="#LCase(theme)#"<cfif params.theme eq theme> selected="selected"</cfif>>#esapiEncode('html', theme)#</option>
</cfloop>
</select>
</dd>
<!--- FEED --->
<dt><label for="feed">Local Content Index</label></dt>
<dd>
<cfif rsFeeds.recordcount>
<select name="feed" id="feed" class="objectParam">
<cfif not Len(Trim(params.feed))>
<option value=""> &ndash; Select &ndash; </option>
</cfif>
<cfloop query="rsFeeds">
<option value="#feedid#"<cfif params.feed eq feedid> selected="selected"</cfif>>#esapiEncode('html', name)#</option>
</cfloop>
</select>
<cfelse>
<p class="alert alert-info">
<strong>Ooops!</strong> You need to create a <a href="http://docs.getmura.com/v6/content-managers/building-the-home-page/content-collections/local-content-indexes/">Local Content Index</a> to use this display object. Be sure that your <a href="http://docs.getmura.com/v6/content-managers/building-the-home-page/content-collections/local-content-indexes/">Local Content Index</a> items contain images! For example, create an index of Gallery items.
</p>
<input type="hidden" name="feed" value="" />
<!--- NIVO THEME --->
<div class="mura-control-group">
<label class="mura-control-label" for="size">Nivo Theme</label>
<select name="theme" id="theme" class="objectParam">
<cfloop array="#arrMuraNivoThemes#" index="theme">
<option value="#LCase(theme)#"<cfif objectparams.theme eq theme> selected="selected"</cfif>>#esapiEncode('html', theme)#</option>
</cfloop>
</select>
</div>

<!--- FEED --->
<div class="mura-control-group">
<label class="mura-control-label" for="feed">Local Content Index</label>

<cfif rsFeeds.recordcount>
<select name="feed" id="feed" class="objectParam">
<cfif not Len(Trim(objectparams.feed))>
<option value=""> &ndash; Select &ndash; </option>
</cfif>
</dd>
<!--- SLIDER SIZE --->
<dt><label for="size">Slider Size</label></dt>
<dd>
<select name="size" id="size" class="objectParam">
<cfloop array="#arrImageSizes#" index="image">
<option value="#LCase(image)#"<cfif params.size eq image> selected="selected"</cfif>>#esapiEncode('html', image)#</option>
</cfloop>
</select>
</dd>
<!--- SLIDER WIDTH / HEIGHT --->
<div id="customOptions"<cfif params.size neq 'custom'> style="display:none;"</cfif>>
<dt><label for="width">Slider Width</label></dt>
<dd>
<input type="text"
name="width" id="width"
class="objectParam"
value="#params.width#" />
</dd>
<dt><label for="height">Slider Height</label></dt>
<dd>
<input type="text"
name="height" id="height"
class="objectParam"
value="#params.height#" />
</dd>
</div>
<!--- SLIDER EFFECT --->
<dt><label for="size">Transition Effect</label></dt>
<dd>
<select name="effect" id="effect" class="objectParam">
<cfloop array="#arrMuraNivoEffects#" index="e">
<option value="#e#"<cfif params.effect eq e> selected="selected"</cfif>>#esapiEncode('html', e)#</option>
</cfloop>
</select>
</dd>
<!--- SLIDER ID --->
<dt><label for="sliderid">Slider CSS ID</label></dt>
<dd>
<input type="text"
name="sliderid" id="sliderid"
class="objectParam"
value="#params.sliderid#" />
</dd>
<!--- SHOW CAPTION --->
<dt><label for="showcaption">Show Caption</label></dt>
<dd>
<label class="radio inline">
<input type="radio" class="objectParam" name="showcaption" value="true" <cfif params.showcaption> checked="checked"</cfif> />
Yes
</label>
<label class="radio inline">
<input type="radio" class="objectParam" name="showcaption" value="false" <cfif not params.showcaption> checked="checked"</cfif> />
No
</label>
</dd>
<!--- PAUSE TIME --->
<dt><label for="size">How long to show each slide (in seconds)</label></dt>
<dd>
<select name="pausetime" id="pausetime" class="objectParam">
<cfloop from="1" to="10" index="s">
<option value="#s#"<cfif params.pausetime eq s> selected="selected"</cfif>>#esapiEncode('html', s)#</option>
</cfloop>
</select>
</dd>

<!--- LINK SLIDES --->
<dt><label for="outputslidelinks">Link Slides</label></dt>
<dd>
<label class="radio inline">
<input type="radio" class="objectParam" name="outputslidelinks" value="true" <cfif params.outputslidelinks> checked="checked"</cfif> />
Yes
</label>
<label class="radio inline">
<input type="radio" class="objectParam" name="outputslidelinks" value="false" <cfif not params.outputslidelinks> checked="checked"</cfif> />
No
</label>
</dd>
<!--- MISC. --->
<input type="hidden" name="configureddts" class="objectParam" value="#now()#" />
<input type="hidden" name="configuredby" class="objectParam" value="#esapiEncode('html_attr', $.currentUser('LName'))#, #esapiEncode('html_attr', $.currentUser('FName'))#" />
</dl>
<cfloop query="rsFeeds">
<option value="#feedid#"<cfif objectparams.feed eq feedid> selected="selected"</cfif>>#esapiEncode('html', name)#</option>
</cfloop>
</select>
<cfelse>
<p class="alert alert-info">
<strong>Ooops!</strong> You need to create a <a href="http://docs.getmura.com/v6/content-managers/building-the-home-page/content-collections/local-content-indexes/">Local Content Index</a> to use this display object. Be sure that your <a href="http://docs.getmura.com/v6/content-managers/building-the-home-page/content-collections/local-content-indexes/">Local Content Index</a> items contain images! For example, create an index of Gallery items.
</p>
<input type="hidden" name="feed" value="" />
</cfif>
</div>

<!--- SLIDER SIZE --->
<div class="mura-control-group">
<label class="mura-control-label" for="size">Slider Size</label>
<select name="size" id="size" class="objectParam">
<cfloop array="#arrImageSizes#" index="image">
<option value="#LCase(image)#"<cfif objectparams.size eq image> selected="selected"</cfif>>#esapiEncode('html', image)#</option>
</cfloop>
</select>
</div>

<!--- SLIDER WIDTH / HEIGHT --->
<div id="customOptions"<cfif objectparams.size neq 'custom'> style="display:none;"</cfif>>
<div class="mura-control-group">
<label class="mura-control-label" for="width">Slider Width</label>
<input type="text"
name="width" id="width"
class="objectParam"
value="#objectparams.width#" />
</div>
<div class="mura-control-group">
<label class="mura-control-label" for="height">Slider Height</label>
<input type="text"
name="height" id="height"
class="objectParam"
value="#objectparams.height#" />
</div>
</div>

<!--- SLIDER EFFECT --->
<div class="mura-control-group">
<label class="mura-control-label" for="size">Transition Effect</label>
<select name="effect" id="effect" class="objectParam">
<cfloop array="#arrMuraNivoEffects#" index="e">
<option value="#e#"<cfif objectparams.effect eq e> selected="selected"</cfif>>#esapiEncode('html', e)#</option>
</cfloop>
</select>
</div>

<!--- SLIDER ID --->
<div class="mura-control-group">
<label class="mura-control-label" for="sliderid">Slider CSS ID</label>
<input type="text"
name="sliderid" id="sliderid"
class="objectParam"
value="#objectparams.sliderid#" />
</div>

<!--- SHOW CAPTION --->
<div class="mura-control-group">
<label class="mura-control-label" for="showcaption">Show Caption</label>
<label class="radio inline">
<input type="radio" class="objectParam" name="showcaption" value="true" <cfif objectparams.showcaption> checked="checked"</cfif> />
Yes
</label>
<label class="radio inline">
<input type="radio" class="objectParam" name="showcaption" value="false" <cfif not objectparams.showcaption> checked="checked"</cfif> />
No
</label>
</div>

<!--- PAUSE TIME --->
<div class="mura-control-group">
<label class="mura-control-label" for="size">How long to show each slide (in seconds)</label>
<select name="pausetime" id="pausetime" class="objectParam">
<cfloop from="1" to="10" index="s">
<option value="#s#"<cfif objectparams.pausetime eq s> selected="selected"</cfif>>#esapiEncode('html', s)#</option>
</cfloop>
</select>
</div>

<!--- LINK SLIDES --->
<div class="mura-control-group">
<label class="mura-control-label" for="outputslidelinks">Link Slides</label>
<label class="radio inline">
<input type="radio" class="objectParam" name="outputslidelinks" value="true" <cfif objectparams.outputslidelinks> checked="checked"</cfif> />
Yes
</label>
<label class="radio inline">
<input type="radio" class="objectParam" name="outputslidelinks" value="false" <cfif not objectparams.outputslidelinks> checked="checked"</cfif> />
No
</label>
</div>

<!--- MISC. --->
<input type="hidden" name="configureddts" class="objectParam" value="#now()#" />
<input type="hidden" name="configuredby" class="objectParam" value="#esapiEncode('html_attr', m.currentUser('LName'))#, #esapiEncode('html_attr', m.currentUser('FName'))#" />
</cfoutput>

0 comments on commit 8300950

Please sign in to comment.